[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdebase/workspace/kdm/backend
From:       Luboš Luňák <l.lunak () kde ! org>
Date:       2008-12-16 14:50:04
Message-ID: 1229439004.726960.4091.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 897662 by lunakl:

After successful authorization always ask PAM for the login name,
instead of using whatever the user typed, this helps e.g. with LDAP,
which ignores leading and trailing whitespace, so such incorrectly
typed login can succeed but the session will be broken.



 M  +9 -8      client.c  


--- trunk/KDE/kdebase/workspace/kdm/backend/client.c #897661:897662
@@ -402,14 +402,15 @@
 		pamh = 0;
 		V_RET;
 	}
-	if (!curuser) {
-		debug( " asking PAM for user ...\n" );
-		pam_get_item( pamh, PAM_USER, &pitem );
-		reInitErrorLog();
-		strDup( &curuser, (const char *)pitem );
-		gSendInt( V_PUT_USER );
-		gSendStr( curuser );
-	}
+	// normalize name (e.g. ldap removes whitespace)
+	debug( " asking PAM for user ...\n" );
+	pam_get_item( pamh, PAM_USER, &pitem );
+	reInitErrorLog();
+	if( curuser )
+		free( curuser );
+	strDup( &curuser, (const char *)pitem );
+	gSendInt( V_PUT_USER );
+	gSendStr( curuser );
 	if (pretc != PAM_SUCCESS) {
 		switch (pretc) {
 		case PAM_USER_UNKNOWN:
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic