--- gdm-2.28.1/common/gdm-settings-keys.h-orig	2009-11-09 09:44:01.172394810 -0600
+++ gdm-2.28.1/common/gdm-settings-keys.h	2009-11-09 09:45:13.311517076 -0600
@@ -33,6 +33,10 @@ G_BEGIN_DECLS
 #define GDM_KEY_TIMED_LOGIN_USER "daemon/TimedLogin"
 #define GDM_KEY_TIMED_LOGIN_DELAY "daemon/TimedLoginDelay"
 
+#define GDM_KEY_INCLUDE "greeter/Include"
+#define GDM_KEY_EXCLUDE "greeter/Exclude"
+#define GDM_KEY_INCLUDE_ALL "greeter/IncludeAll"
+
 #define GDM_KEY_DISALLOW_TCP "security/DisallowTCP"
 
 #define GDM_KEY_XDMCP_ENABLE "xdmcp/Enable"
--- gdm-2.28.1/data/gdm.schemas.in.in-orig	2009-11-09 09:43:23.600749867 -0600
+++ gdm-2.28.1/data/gdm.schemas.in.in	2009-11-09 09:45:13.310582136 -0600
@@ -55,6 +55,22 @@
     </schema>
 
     <schema>
+      <key>greeter/Include</key>
+      <signature>s</signature>
+      <default></default>
+    </schema>
+    <schema>
+      <key>greeter/Exclude</key>
+      <signature>s</signature>
+      <default>bin,root,daemon,adm,lp,sync,shutdown,halt,mail,news,uucp,operator,nobody,nobody4,noaccess,postgres,pvm,rpm,nfsnobody,pcap</default>
+    </schema>
+    <schema>
+      <key>greeter/IncludeAll</key>
+      <signature>b</signature>
+      <default>true</default>
+    </schema>
+
+    <schema>
       <key>xdmcp/Enable</key>
       <signature>b</signature>
       <default>false</default>
--- gdm-2.28.1/gui/simple-greeter/gdm-user-manager.c-orig	2009-11-09 09:44:19.454877784 -0600
+++ gdm-2.28.1/gui/simple-greeter/gdm-user-manager.c	2009-11-09 13:05:27.386674210 -0600
@@ -46,6 +46,7 @@
 
 #include "gdm-user-manager.h"
 #include "gdm-user-private.h"
+#include "gdm-settings-keys.h"
 
 #define GDM_USER_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GDM_TYPE_USER_MANAGER, GdmUserManagerPrivate))
 
@@ -76,34 +77,11 @@
 
 #define DEFAULT_GLOBAL_FACE_DIR DATADIR "/faces"
 #define DEFAULT_USER_ICON       "stock_person"
-#define DEFAULT_EXCLUDE         { "bin",        \
-                                  "root",       \
-                                  "daemon",     \
-                                  "adm",        \
-                                  "lp",         \
-                                  "sync",       \
-                                  "shutdown",   \
-                                  "halt",       \
-                                  "mail",       \
-                                  "news",       \
-                                  "uucp",       \
-                                  "operator",   \
-                                  "nobody",     \
-                                  "nobody4",    \
-                                  "noaccess",   \
-                                  GDM_USERNAME, \
-                                  "postgres",   \
-                                  "pvm",        \
-                                  "rpm",        \
-                                  "nfsnobody",  \
-                                  "pcap",       \
-                                  NULL }
 
 struct GdmUserManagerPrivate
 {
         GHashTable            *users;
         GHashTable            *sessions;
-        GHashTable            *exclusions;
         GHashTable            *shells;
         DBusGConnection       *connection;
         DBusGProxy            *seat_proxy;
@@ -112,6 +90,10 @@ struct GdmUserManagerPrivate
         GFileMonitor          *passwd_monitor;
         GFileMonitor          *shells_monitor;
 
+        GSList                *exclude;
+        GSList                *include;
+        gboolean               include_all;
+
         guint                  reload_id;
         guint                  ck_history_id;
 
@@ -599,6 +581,43 @@ get_x11_display_for_session (DBusGConnec
         return x11_display;
 }
 
+static gint
+match_name_cmpfunc (gconstpointer a,
+                    gconstpointer b)
+{
+        if (a == NULL || b == NULL) {
+                return -1;
+        }
+
+        return g_strcmp0 ((char *) a,
+                          (char *) b);
+}
+
+static gboolean
+user_in_exclude_list (GdmUserManager *manager,
+                      const char *user)
+{
+        GSList   *found;
+        gboolean  ret = FALSE;
+
+        g_debug ("checking exclude list");
+
+        /* always exclude the "gdm" user. */
+        if (user == NULL || (strcmp (user, GDM_USERNAME) == 0)) {
+                return TRUE;
+        }
+
+        if (manager->priv->exclude != NULL) {
+                found = g_slist_find_custom (manager->priv->exclude,
+                                             user,
+                                             match_name_cmpfunc);
+                if (found != NULL) {
+                        ret = TRUE;
+                }
+        }
+        return ret;
+}
+
 static gboolean
 maybe_add_session_for_user (GdmUserManager *manager,
                             GdmUser        *user,
@@ -628,7 +647,7 @@ maybe_add_session_for_user (GdmUserManag
                 goto out;
         }
 
-        if (g_hash_table_lookup (manager->priv->exclusions, gdm_user_get_user_name (user))) {
+        if (user_in_exclude_list (manager, gdm_user_get_user_name (user))) {
                 g_debug ("GdmUserManager: excluding user '%s'", gdm_user_get_user_name (user));
                 goto out;
         }
@@ -906,7 +925,7 @@ seat_session_added (DBusGProxy     *seat
         }
 
         /* check exclusions up front */
-        if (g_hash_table_lookup (manager->priv->exclusions, pwent->pw_name)) {
+        if (user_in_exclude_list (manager, pwent->pw_name)) {
                 g_debug ("GdmUserManager: excluding user '%s'", pwent->pw_name);
                 return;
         }
@@ -1222,7 +1241,7 @@ process_ck_history_line (GdmUserManager 
                 return;
         }
 
-        if (g_hash_table_lookup (manager->priv->exclusions, username)) {
+        if (user_in_exclude_list (manager, username)) {
                 g_debug ("GdmUserManager: excluding user '%s'", username);
                 g_free (username);
                 return;
@@ -1359,6 +1378,35 @@ reload_ck_history (GdmUserManager *manag
 }
 
 static void
+add_included_user (char *username, GdmUserManager *manager)
+{
+        GdmUser     *user;
+
+        g_debug ("Adding included user %s", username);
+        /*
+         * The call to gdm_user_manager_get_user will add the user if it is
+         * valid and not already in the hash.
+         */
+        user = gdm_user_manager_get_user (manager, username);
+        if (user == NULL) {
+                g_debug ("GdmUserManager: unable to lookup user '%s'", username);
+                g_free (username);
+                return;
+        }
+}
+
+static void
+add_included_users (GdmUserManager *manager)
+{
+        /* Add users who are specifically included */
+        if (manager->priv->include != NULL) {
+                g_slist_foreach (manager->priv->include,
+                                 (GFunc)add_included_user,
+                                 (gpointer)manager);
+        }
+}
+
+static void
 reload_passwd (GdmUserManager *manager)
 {
         struct passwd *pwent;
@@ -1390,48 +1438,58 @@ reload_passwd (GdmUserManager *manager)
                 }
         }
 
-        for (pwent = fgetpwent (fp); pwent != NULL; pwent = fgetpwent (fp)) {
-                GdmUser *user;
+        if (manager->priv->include_all != TRUE) {
+                g_debug ("GdmUserManager: include_all is FALSE");
+        } else {
+                g_debug ("GdmUserManager: include_all is TRUE");
+
+                for (pwent = fgetpwent (fp);
+                     pwent != NULL;
+                     pwent = fgetpwent (fp)) {
+                        GdmUser *user;
+
+                        user = NULL;
+
+                        /* Skip users below MinimalUID... */
+                        if (pwent->pw_uid < DEFAULT_MINIMAL_UID) {
+                                continue;
+                        }
 
-                user = NULL;
+                        /* ...And users w/ invalid shells... */
+                        if (pwent->pw_shell == NULL ||
+                            !g_hash_table_lookup (manager->priv->shells,
+                                                  pwent->pw_shell)) {
+                                g_debug ("GdmUserManager: skipping user with bad shell: %s", pwent->pw_name);
+                                continue;
+                        }
 
-                /* Skip users below MinimalUID... */
-                if (pwent->pw_uid < DEFAULT_MINIMAL_UID) {
-                        continue;
-                }
+                        /* ...And explicitly excluded users */
+                        if (user_in_exclude_list (manager, pwent->pw_name)) {
+                                g_debug ("GdmUserManager: explicitly skipping user: %s", pwent->pw_name);
+                                continue;
+                        }
 
-                /* ...And users w/ invalid shells... */
-                if (pwent->pw_shell == NULL ||
-                    !g_hash_table_lookup (manager->priv->shells, pwent->pw_shell)) {
-                        g_debug ("GdmUserManager: skipping user with bad shell: %s", pwent->pw_name);
-                        continue;
-                }
+                        user = g_hash_table_lookup (manager->priv->users,
+                                                    pwent->pw_name);
 
-                /* ...And explicitly excluded users */
-                if (g_hash_table_lookup (manager->priv->exclusions, pwent->pw_name)) {
-                        g_debug ("GdmUserManager: explicitly skipping user: %s", pwent->pw_name);
-                        continue;
-                }
+                        /* Update users already in the *new* list */
+                        if (g_slist_find (new_users, user)) {
+                                _gdm_user_update (user, pwent);
+                                continue;
+                        }
 
-                user = g_hash_table_lookup (manager->priv->users, pwent->pw_name);
+                        if (user == NULL) {
+                                user = create_user (manager);
+                        } else {
+                                g_object_ref (user);
+                        }
 
-                /* Update users already in the *new* list */
-                if (g_slist_find (new_users, user)) {
+                        /* Freeze & update users not already in the new list */
+                        g_object_freeze_notify (G_OBJECT (user));
                         _gdm_user_update (user, pwent);
-                        continue;
-                }
 
-                if (user == NULL) {
-                        user = create_user (manager);
-                } else {
-                        g_object_ref (user);
+                        new_users = g_slist_prepend (new_users, user);
                 }
-
-                /* Freeze & update users not already in the new list */
-                g_object_freeze_notify (G_OBJECT (user));
-                _gdm_user_update (user, pwent);
-
-                new_users = g_slist_prepend (new_users, user);
         }
 
         /* Go through and handle removed users */
@@ -1476,6 +1534,7 @@ reload_users (GdmUserManager *manager)
 {
         reload_ck_history (manager);
         reload_passwd (manager);
+        add_included_users (manager);
 }
 
 static gboolean
@@ -1536,6 +1595,7 @@ on_shells_monitor_changed (GFileMonitor 
 
         reload_shells (manager);
         reload_passwd (manager);
+        add_included_users (manager);
 }
 
 static void
@@ -1551,6 +1611,7 @@ on_passwd_monitor_changed (GFileMonitor 
         }
 
         reload_passwd (manager);
+        add_included_users (manager);
 }
 
 static void
@@ -1613,84 +1674,108 @@ gdm_user_manager_class_init (GdmUserMana
 }
 
 static void
+gdm_set_string_list (char *value, GSList **retval)
+{
+        char **temparr;
+        int    i;
+
+        *retval = NULL;
+
+        if (value == NULL || *value == '\0') {
+                g_debug ("Not adding NULL user");
+                *retval = NULL;
+                return;
+        }
+
+        temparr = g_strsplit (value, ",", 0);
+        for (i=0 ; temparr != NULL && temparr[i] != NULL ; i++) {
+                g_debug ("Adding value %s", temparr[i]);
+                g_strstrip (temparr[i]);
+                *retval = g_slist_prepend (*retval, g_strdup (temparr[i]));
+        }
+
+        g_strfreev (temparr);
+}
+
+
+static void
 gdm_user_manager_init (GdmUserManager *manager)
 {
         int            i;
         GFile         *file;
         GError        *error;
-        const char    *exclude_default[] = DEFAULT_EXCLUDE;
+        char          *temp;
+        gboolean       res;
 
         manager->priv = GDM_USER_MANAGER_GET_PRIVATE (manager);
 
+        /* exclude/include */
+        g_debug ("Setting users to include:");
+        res = gdm_settings_client_get_string  (GDM_KEY_INCLUDE,
+                                               &temp);
+        gdm_set_string_list (temp, &(manager->priv->include));
+
+        g_debug ("Setting users to exclude:");
+        res = gdm_settings_client_get_string  (GDM_KEY_EXCLUDE,
+                                               &temp);
+        gdm_set_string_list (temp, &(manager->priv->exclude));
+
+        res = gdm_settings_client_get_boolean (GDM_KEY_INCLUDE_ALL,
+                                               &(manager->priv->include_all));
+
         /* sessions */
         manager->priv->sessions = g_hash_table_new_full (g_str_hash,
                                                          g_str_equal,
                                                          g_free,
                                                          g_free);
 
-        /* exclusions */
-        manager->priv->exclusions = g_hash_table_new_full (g_str_hash,
-                                                           g_str_equal,
-                                                           g_free,
-                                                           NULL);
-        for (i = 0; exclude_default[i] != NULL; i++) {
-                g_hash_table_insert (manager->priv->exclusions,
-                                     g_strdup (exclude_default [i]),
-                                     GUINT_TO_POINTER (TRUE));
-        }
+        /* users */
+        manager->priv->users = g_hash_table_new_full (g_str_hash,
+                                                      g_str_equal,
+                                                      g_free,
+                                                      (GDestroyNotify) g_object_run_dispose);
 
-        /* /etc/shells */
-        manager->priv->shells = g_hash_table_new_full (g_str_hash,
-                                                       g_str_equal,
-                                                       g_free,
-                                                       NULL);
-        reload_shells (manager);
-        file = g_file_new_for_path (_PATH_SHELLS);
-        error = NULL;
-        manager->priv->shells_monitor = g_file_monitor_file (file,
-                                                             G_FILE_MONITOR_NONE,
-                                                             NULL,
-                                                             &error);
-        if (manager->priv->shells_monitor != NULL) {
-                g_signal_connect (manager->priv->shells_monitor,
-                                  "changed",
-                                  G_CALLBACK (on_shells_monitor_changed),
-                                  manager);
-        } else {
-                if (error != NULL) {
+        if (manager->priv->include_all == TRUE) {
+                /* /etc/shells */
+                manager->priv->shells = g_hash_table_new_full (g_str_hash,
+                                                               g_str_equal,
+                                                               g_free,
+                                                               NULL);
+                reload_shells (manager);
+                file = g_file_new_for_path (_PATH_SHELLS);
+                error = NULL;
+                manager->priv->shells_monitor = g_file_monitor_file (file,
+                                                                     G_FILE_MONITOR_NONE,
+                                                                     NULL,
+                                                                     &error);
+                if (manager->priv->shells_monitor != NULL) {
+                        g_signal_connect (manager->priv->shells_monitor,
+                                          "changed",
+                                          G_CALLBACK (on_shells_monitor_changed),
+                                          manager);
+                } else {
                         g_warning ("Unable to monitor %s: %s", _PATH_SHELLS, error->message);
                         g_error_free (error);
-                } else {
-                        g_warning ("Unable to monitor %s", _PATH_SHELLS);
                 }
-        }
-        g_object_unref (file);
+                g_object_unref (file);
 
-        /* /etc/passwd */
-        manager->priv->users = g_hash_table_new_full (g_str_hash,
-                                                      g_str_equal,
-                                                      g_free,
-                                                      (GDestroyNotify) g_object_run_dispose);
-        file = g_file_new_for_path (PATH_PASSWD);
-        manager->priv->passwd_monitor = g_file_monitor_file (file,
-                                                             G_FILE_MONITOR_NONE,
-                                                             NULL,
-                                                             &error);
-        if (manager->priv->passwd_monitor != NULL) {
-                g_signal_connect (manager->priv->passwd_monitor,
-                                  "changed",
-                                  G_CALLBACK (on_passwd_monitor_changed),
-                                  manager);
-        } else {
-                if (error != NULL) {
+                /* /etc/passwd */
+                file = g_file_new_for_path (PATH_PASSWD);
+                manager->priv->passwd_monitor = g_file_monitor_file (file,
+                                                                     G_FILE_MONITOR_NONE,
+                                                                     NULL,
+                                                                     &error);
+                if (manager->priv->passwd_monitor != NULL) {
+                        g_signal_connect (manager->priv->passwd_monitor,
+                                          "changed",
+                                          G_CALLBACK (on_passwd_monitor_changed),
+                                          manager);
+                } else {
                         g_warning ("Unable to monitor %s: %s", PATH_PASSWD, error->message);
                         g_error_free (error);
-                } else {
-                        g_warning ("Unable to monitor %s", PATH_PASSWD);
                 }
+                g_object_unref (file);
         }
-        g_object_unref (file);
-
 
         get_seat_proxy (manager);
 
@@ -1711,6 +1796,14 @@ gdm_user_manager_finalize (GObject *obje
 
         g_return_if_fail (manager->priv != NULL);
 
+        if (manager->priv->exclude != NULL) {
+                g_slist_free (manager->priv->exclude);
+        }
+
+        if (manager->priv->include != NULL) {
+                g_slist_free (manager->priv->include);
+        }
+
         if (manager->priv->seat_proxy != NULL) {
                 g_object_unref (manager->priv->seat_proxy);
         }
--- gdm-2.28.1/gui/simple-greeter/Makefile.am-orig	2009-11-09 09:43:35.663852535 -0600
+++ gdm-2.28.1/gui/simple-greeter/Makefile.am	2009-11-09 09:45:13.310990491 -0600
@@ -250,6 +250,7 @@ test_user_chooser_SOURCES = 		\
 
 test_user_chooser_LDADD =	\
 	libgdmuser.la		\
+	$(top_builddir)/common/libgdmcommon.la	\
 	$(COMMON_LIBS)		\
 	$(SIMPLE_GREETER_LIBS)	\
 	$(NULL)
@@ -260,6 +261,7 @@ test_user_manager_SOURCES = 	\
 
 test_user_manager_LDADD =	\
 	libgdmuser.la		\
+	$(top_builddir)/common/libgdmcommon.la	\
 	$(COMMON_LIBS)		\
 	$(SIMPLE_GREETER_LIBS)	\
 	$(NULL)
--- gdm-2.28.1/gui/simple-greeter/test-user-manager.c-orig	2009-11-09 09:44:26.952335171 -0600
+++ gdm-2.28.1/gui/simple-greeter/test-user-manager.c	2009-11-09 09:45:13.313412878 -0600
@@ -31,6 +31,7 @@
 #include <gtk/gtk.h>
 
 #include "gdm-user-manager.h"
+#include "gdm-settings-client.h"
 
 static GdmUserManager *manager = NULL;
 
@@ -78,6 +79,11 @@ main (int argc, char *argv[])
 
         gtk_init (&argc, &argv);
 
+        if (! gdm_settings_client_init (GDMCONFDIR "/gdm.schemas", "/")) {
+                g_critical ("Unable to initialize settings client");
+                exit (1);
+        }
+
         manager = gdm_user_manager_ref_default ();
         g_signal_connect (manager,
                           "users-loaded",
--- gdm-2.28.1/gui/user-switch-applet/Makefile.am-orig	2009-11-09 09:43:48.007715618 -0600
+++ gdm-2.28.1/gui/user-switch-applet/Makefile.am	2009-11-09 09:45:13.313657549 -0600
@@ -2,6 +2,7 @@ NULL =
 
 AM_CPPFLAGS = \
 	-I$(top_srcdir)/gui/simple-greeter		\
+	-I$(top_srcdir)/common				\
 	-DPREFIX=\""$(prefix)"\" 			\
 	-DLIBDIR=\""$(libdir)"\" 			\
 	-DDATADIR=\""$(datadir)"\"		 	\
@@ -11,6 +12,7 @@ AM_CPPFLAGS = \
 	-DGLADEDIR=\""$(pkgdatadir)"\" 			\
 	-DLIBEXECDIR=\""$(libexecdir)"\" 		\
 	-DSBINDIR=\""$(sbindir)"\"		 	\
+	-DGDMCONFDIR=\"$(gdmconfdir)\"			\
 	$(GTK_CFLAGS)					\
 	$(APPLET_CFLAGS)				\
 	$(NULL)
@@ -27,6 +29,7 @@ gdm_user_switch_applet_SOURCES =  	\
 
 gdm_user_switch_applet_LDADD = 		\
 	$(top_builddir)/gui/simple-greeter/libgdmuser.la	\
+	$(top_builddir)/common/libgdmcommon.la		\
 	$(COMMON_LIBS)					\
 	$(APPLET_LIBS)					\
 	$(NULL)
--- gdm-2.28.1/gui/user-switch-applet/applet.c-orig	2009-11-09 09:44:49.646747624 -0600
+++ gdm-2.28.1/gui/user-switch-applet/applet.c	2009-11-09 09:45:13.314465558 -0600
@@ -42,6 +42,7 @@
 
 #include "gdm-user-manager.h"
 #include "gdm-entry-menu-item.h"
+#include "gdm-settings-client.h"
 
 #define LOCKDOWN_DIR    "/desktop/gnome/lockdown"
 #define LOCKDOWN_KEY    LOCKDOWN_DIR "/disable_user_switching"
@@ -1416,6 +1417,11 @@ fill_applet (PanelApplet *applet)
         adata->applet = applet;
         adata->panel_size = 24;
 
+        if (! gdm_settings_client_init (GDMCONFDIR "/gdm.schemas", "/")) {
+                g_critical ("Unable to initialize settings client");
+                exit (1);
+        }
+
         adata->client = gconf_client_get_default ();
 
         gtk_widget_set_tooltip_text (GTK_WIDGET (applet), _("Change account settings and status"));
