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

List:       kde-commits
Subject:    KDE/kdebase/workspace/kdm
From:       Oswald Buddenhagen <ossi () kde ! org>
Date:       2007-12-16 11:02:20
Message-ID: 1197802940.578520.18959.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 749033 by ossi:

introduce V_MSG_INFO_AUTH greeter command and use it instead of
V_MSG_INFO while a PAM auth is in progress. should make it simpler to
identify prompt-like messages.


 M  +6 -1      backend/client.c  
 M  +1 -0      backend/greet.h  
 M  +12 -3     kfrontend/kgverify.cpp  


--- trunk/KDE/kdebase/workspace/kdm/backend/client.c #749032:749033
@@ -109,6 +109,7 @@
 #endif
 #ifdef USE_PAM
 static pam_handle_t *pamh;
+static int inAuth;
 #elif defined(_AIX)
 static char tty[16], hostname[100];
 #else
@@ -220,7 +221,7 @@
 		switch (msg[count]->msg_style) {
 		case PAM_TEXT_INFO:
 			debug( " PAM_TEXT_INFO: %s\n", msg[count]->msg );
-			displayStr( V_MSG_INFO, msg[count]->msg );
+			displayStr( inAuth ? V_MSG_INFO_AUTH : V_MSG_INFO, msg[count]->msg );
 			continue;
 		case PAM_ERROR_MSG:
 			debug( " PAM_ERROR_MSG: %s\n", msg[count]->msg );
@@ -337,11 +338,13 @@
 # endif
 	reInitErrorLog();
 
+	inAuth = True;
 	debug( " pam_authenticate() ...\n" );
 	pretc = pam_authenticate( pamh,
 	                          td->allowNullPasswd ? 0 : PAM_DISALLOW_NULL_AUTHTOK );
 	reInitErrorLog();
 	debug( " pam_authenticate() returned: %s\n", pam_strerror( pamh, pretc ) );
+	inAuth = False;
 	if (pdata->abort) {
 		pam_end( pamh, PAM_SUCCESS );
 		pamh = 0;
@@ -729,10 +732,12 @@
 		} else
 			gSendInt( V_CHTOK );
 		for (;;) {
+			inAuth = True;
 			debug( " pam_chauthtok() ...\n" );
 			pretc = pam_chauthtok( pamh, PAM_CHANGE_EXPIRED_AUTHTOK );
 			reInitErrorLog();
 			debug( " pam_chauthtok() returned: %s\n", pam_strerror( pamh, pretc ) );
+			inAuth = False;
 			if (pdata.abort) {
 				pam_end( pamh, PAM_SUCCESS );
 				pamh = 0;
--- trunk/KDE/kdebase/workspace/kdm/backend/greet.h #749032:749033
@@ -233,6 +233,7 @@
 #define V_CHTOK         113 /* password expired; change now */
 #define V_CHTOK_AUTH    114 /* password expired; change now, but authenticate first */
 #define V_PRE_OK        115 /* authentication succeeded, continue with password change */
+#define V_MSG_INFO_AUTH 116 /* info message during auth attached; 0 return */
 /* queries */
 #define V_GET_TEXT      200 /* str prompt, int echo, int ndelay; str return, int tag */
 # define V_IS_SECRET        1
--- trunk/KDE/kdebase/workspace/kdm/kfrontend/kgverify.cpp #749032:749033
@@ -565,6 +565,7 @@
 				free( msg );
 			gSendInt( 0 );
 			continue;
+		case V_MSG_INFO_AUTH: // should not happen
 		case V_MSG_INFO:
 			debug( " V_MSG_INFO\n" );
 			msg = gRecvStr();
@@ -683,7 +684,7 @@
 			debug( " V_MSG_ERR\n" );
 			msg = gRecvStr();
 			debug( "  %s->textMessage(%\"s, true)\n", pName.data(), msg );
-			if (!greet->textMessage( msg, true )) {
+			if (!greet->textMessage( msg, true )) { // XXX little point in filtering
 				debug( "  message passed\n" );
 				vrfErrBox( parent, user, msg );
 			} else
@@ -692,8 +693,8 @@
 				free( msg );
 			gSendInt( 0 );
 			continue;
-		case V_MSG_INFO:
-			debug( " V_MSG_INFO\n" );
+		case V_MSG_INFO_AUTH:
+			debug( " V_MSG_INFO_AUTH\n" );
 			msg = gRecvStr();
 			debug( "  %s->textMessage(%\"s, false)\n", pName.data(), msg );
 			if (!greet->textMessage( msg, false )) {
@@ -704,6 +705,14 @@
 			free( msg );
 			gSendInt( 0 );
 			continue;
+		case V_MSG_INFO:
+			debug( " V_MSG_INFO\n" );
+			msg = gRecvStr();
+			debug( "  display %\"s\n", msg );
+			vrfInfoBox( parent, user, msg );
+			free( msg );
+			gSendInt( 0 );
+			continue;
 		}
 
 		// terminal status
[prev in list] [next in list] [prev in thread] [next in thread] 

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