Index: gdm2//config/gdm.conf.in
===================================================================
RCS file: /export/cvs/gnome-2.0/gdm2/config/gdm.conf.in,v
retrieving revision 1.117
diff -p -u -5 -r1.117 gdm.conf.in
--- gdm2//config/gdm.conf.in	2004/04/13 18:29:16	1.117
+++ gdm2//config/gdm.conf.in	2004/04/16 08:37:36
@@ -445,5 +445,16 @@ command=@X_SERVER@ -audit 0
 flexible=false
 # Run the chooser instead of the greeter.  When the user chooses a
 # machine they will get this same server but run with
 # "-terminate -query hostname"
 chooser=true
+
+# If you wish to turn on certain a11y extensions for a particular group, 
+# use UserGroup to specify the group name and XserverArg to specify the 
+# required extensions. More than one set of UserGroup and XserverArg can be 
+# specified.
+#
+#[UserGroup-<GroupName1>]
+#XserverArg=+kb
+#[UserGroup-<GroupName2>]
+#XserverArg=+kb -accessx
+
Index: gdm2//daemon/gdm.c
===================================================================
RCS file: /export/cvs/gnome-2.0/gdm2/daemon/gdm.c,v
retrieving revision 1.191
diff -p -u -5 -r1.191 gdm.c
--- gdm2//daemon/gdm.c	2004/02/12 19:49:46	1.191
+++ gdm2//daemon/gdm.c	2004/04/16 08:37:36
@@ -192,10 +192,11 @@ gchar *GdmXnest = NULL;
 int GdmFirstVT = 7;
 gboolean GdmVTAllocation = TRUE;
 gboolean GdmDisallowTCP = TRUE;
 gchar *GdmSoundProgram = NULL;
 gchar *GdmSoundOnLoginFile = NULL;
+gchar *GdmA11yArgs = NULL;
 
 
 /* set in the main function */
 char **stored_argv = NULL;
 int stored_argc = 0;
Index: gdm2//daemon/server.c
===================================================================
RCS file: /export/cvs/gnome-2.0/gdm2/daemon/server.c,v
retrieving revision 1.108
diff -p -u -5 -r1.108 server.c
--- gdm2//daemon/server.c	2004/02/20 18:07:33	1.108
+++ gdm2//daemon/server.c	2004/04/16 08:37:36
@@ -47,14 +47,16 @@
 #include "auth.h"
 #include "slave.h"
 #include "getvt.h"
 
 #define SERVER_WAIT_ALARM 10
+extern char *GdmA11yArgs;
 
 
 /* Local prototypes */
 static void gdm_server_spawn (GdmDisplay *d, const char *vtarg);
+static void gdm_server_add_a11y_args (char **argv);
 static void gdm_server_usr1_handler (gint);
 static void gdm_server_child_handler (gint);
 static char * get_font_path (const char *display);
 
 /* Configuration options */
@@ -897,10 +899,30 @@ rotate_logs (const char *dname)
 	g_free (fname1);
 	g_free (fname);
 }
 
 
+static void
+gdm_server_add_a11y_args (char **argv)
+{
+   int count;
+   char **args;
+   int len;
+   int i;
+
+   len = ve_vector_len(argv);
+   g_shell_parse_argv (GdmA11yArgs, &count, &args, NULL);
+   argv = g_renew (char *, argv, len + count + 1);
+
+   for (i=0; i < count;i++) {
+	   argv[len++] = g_strdup(args[i]);
+   }
+
+   argv[len] = NULL;
+   g_strfreev (args);
+}
+
 char **
 gdm_server_resolve_command_line (GdmDisplay *disp,
 				 gboolean resolve_flags,
 				 const char *vtarg)
 {
@@ -1048,10 +1070,13 @@ gdm_server_spawn (GdmDisplay *d, const c
 
     /* Figure out the server command */
     argv = gdm_server_resolve_command_line (d,
 					    TRUE /* resolve flags */,
 					    vtarg);
+
+    if (GdmA11yArgs)
+	gdm_server_add_a11y_args (argv);
 
     command = g_strjoinv (" ", argv);
 
     /* Fork into two processes. Parent remains the gdm process. Child
      * becomes the X server. */
Index: gdm2//daemon/slave.c
===================================================================
RCS file: /export/cvs/gnome-2.0/gdm2/daemon/slave.c,v
retrieving revision 1.258
diff -p -u -5 -r1.258 slave.c
--- gdm2//daemon/slave.c	2004/03/04 18:48:14	1.258
+++ gdm2//daemon/slave.c	2004/04/16 08:37:36
@@ -57,10 +57,11 @@
 #endif
 
 #include <signal.h>
 #include <pwd.h>
 #include <grp.h>
+#include <sys/types.h>
 #include <errno.h>
 #include <time.h>
 #include <syslog.h>
 
 #ifdef HAVE_SELINUX
@@ -180,20 +181,22 @@ extern gboolean GdmAllowRemoteRoot;
 extern gchar *GdmGlobalFaceDir;
 extern gboolean GdmDebug;
 extern gboolean GdmDisallowTCP;
 extern gchar *GdmSoundProgram;
 extern gchar *GdmSoundOnLoginFile;
+extern gchar *GdmA11yArgs;
 
 
 /* Local prototypes */
 static gint     gdm_slave_xerror_handler (Display *disp, XErrorEvent *evt);
 static gint     gdm_slave_xioerror_handler (Display *disp);
 static void	gdm_slave_run (GdmDisplay *display);
 static void	gdm_slave_wait_for_login (void);
 static void     gdm_slave_greeter (void);
 static void     gdm_slave_chooser (void);
 static void     gdm_slave_session_start (void);
+static void     gdm_slave_parse_a11y_args (void);
 static void     gdm_slave_session_stop (gboolean run_post_session,
 					gboolean no_shutdown_check);
 static void     gdm_slave_alrm_handler (int sig);
 static void     gdm_slave_term_handler (int sig);
 static void     gdm_slave_usr2_handler (int sig);
@@ -3792,10 +3795,56 @@ finish_session_output (gboolean do_read)
 		}
 	}
 }
 
 static void
+gdm_slave_parse_a11y_args (void)
+{
+   struct passwd *pwent;
+   FILE *fp;
+   char *gname;
+   char *tmp;
+   char *xargs;
+   char buf[128];
+   struct group *group_struct;
+
+   pwent = getpwnam (login);
+   VE_IGNORE_EINTR (fp = fopen (GDM_CONFIG_FILE, "r"));
+
+   for (;;) {
+	if (! fgets (buf, sizeof (buf), fp)) 
+	    break;
+
+	if (buf[0] == '#' || buf[0] == '\n' || buf[0] == '\t')
+	    continue;
+
+	if (strstr(buf, "[UserGroup-")) {
+	    gname = strrchr (buf, '-');
+	    gname++;
+	    tmp = strrchr (buf, ']');
+	    tmp[0] = '\0';
+	    group_struct = getgrnam (gname);
+	    if (group_struct->gr_gid != pwent->pw_gid) 
+		continue;
+
+	    if (fgets (buf, sizeof (buf), fp)) {
+		if (strstr (buf, "XserverArg")) {
+		    xargs = strchr (buf, '=');
+		    if (xargs[1] =='\0' || xargs[1] == '\n' || xargs[1] == '\t' || xargs[1] == ' ')
+			continue;
+		    xargs++;
+		    g_strstrip (xargs);
+		    GdmA11yArgs = g_strdup (xargs);
+		    break;
+		}
+	    }
+	}
+   }
+   VE_IGNORE_EINTR (fclose (fp));
+}
+
+static void
 gdm_slave_session_start (void)
 {
     struct passwd *pwent;
     char *save_session = NULL, *session = NULL, *language = NULL, *usrsess, *usrlang;
     char *gnome_session = NULL;
@@ -3989,10 +4038,29 @@ gdm_slave_session_start (void)
     /* Ensure some sanity in this world */
     gdm_ensure_sanity ();
 
     if (GdmKillInitClients)
 	    gdm_server_whack_clients (d);
+
+    if (GdmA11yArgs) {
+	g_free (GdmA11yArgs);
+	GdmA11yArgs = NULL;
+    }
+
+    gdm_slave_parse_a11y_args ();
+
+    if (GdmA11yArgs) {
+	    gdm_server_stop(d);
+	    gdm_slave_send_num (GDM_SOP_XPID, 0);
+	    gdm_server_start (d, TRUE, FALSE, 20, 5);
+	    gdm_slave_send_num (GDM_SOP_XPID, d->servpid);
+    }
+
+    if (GdmA11yArgs) {
+	g_free (GdmA11yArgs);
+	GdmA11yArgs = NULL;
+    }
 
     /* Now that we will set up the user authorization we will
        need to run session_stop to whack it */
     session_started = TRUE;
 
