[PATCH:xdm] Bug 13455: allowNullPasswd: true doesn't work until the second login attempt

Alan Coopersmith alan.coopersmith at oracle.com
Thu Jun 2 18:36:22 PDT 2011


Assign allow_null_passwd and allow_root_login variables' values before call to
pam_authenticate()

https://bugs.freedesktop.org/show_bug.cgi?id=13455

Based on a fix suggested by: Tim Shumakov <ars_1 at mail.ru>

Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
---
 greeter/greet.c |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/greeter/greet.c b/greeter/greet.c
index 8e32279..5182650 100644
--- a/greeter/greet.c
+++ b/greeter/greet.c
@@ -351,7 +351,7 @@ static int
 Greet (struct display *d, struct greet_info *greet)
 {
     XEvent		event;
-    Arg		arglist[3];
+    Arg		arglist[1];
 
     XtSetArg (arglist[0], XtNallowAccess, False);
     XtSetValues (login, arglist, 1);
@@ -394,9 +394,7 @@ Greet (struct display *d, struct greet_info *greet)
 	greet->password = password;
 #endif  /* USE_PAM */
 	XtSetArg (arglist[0], XtNsessionArgument, (char *) &(greet->string));
-	XtSetArg (arglist[1], XtNallowNullPasswd, (char *) &(greet->allow_null_passwd));
-	XtSetArg (arglist[2], XtNallowRootLogin, (char *) &(greet->allow_root_login));
-	XtGetValues (login, arglist, 3);
+	XtGetValues (login, arglist, 1);
 	Debug ("sessionArgument: %s\n", greet->string ? greet->string : "<NULL>");
     }
     return code;
@@ -432,6 +430,7 @@ greet_user_rtn GreetUser(
     struct dlfuncs        *dlfuncs)
 {
     int i;
+    Arg		arglist[2];
 
 /*
  * These must be set before they are used.
@@ -485,6 +484,12 @@ greet_user_rtn GreetUser(
 	exit (RESERVER_DISPLAY);
     }
 
+    XtSetArg (arglist[0], XtNallowNullPasswd,
+	      (char *) &(greet->allow_null_passwd));
+    XtSetArg (arglist[1], XtNallowRootLogin,
+	      (char *) &(greet->allow_root_login));
+    XtGetValues (login, arglist, 2);
+
     for (;;) {
 #ifdef USE_PAM
 
-- 
1.7.3.2



More information about the xorg-devel mailing list