[PC-BSD Commits] r22038 - pcbsd-projects/PCDM

svn at pcbsd.org svn at pcbsd.org
Wed Apr 3 09:01:59 PDT 2013


Author: kenmoore
Date: 2013-04-03 16:01:59 +0000 (Wed, 03 Apr 2013)
New Revision: 22038

Modified:
   pcbsd-projects/PCDM/pcdm-xprocess.cpp
Log:
Quick fix for making sure that PAM is closed down if there is an error in authentication.



Modified: pcbsd-projects/PCDM/pcdm-xprocess.cpp
===================================================================
--- pcbsd-projects/PCDM/pcdm-xprocess.cpp	2013-04-03 15:54:31 UTC (rev 22037)
+++ pcbsd-projects/PCDM/pcdm-xprocess.cpp	2013-04-03 16:01:59 UTC (rev 22038)
@@ -64,10 +64,9 @@
   //Backend::log("Starting up Desktop environment ("+xcmd+") as user ("+xuser+")");
   
   //Check for PAM username/password validity
-  if( !pam_checkPW() ){ emit InvalidLogin(); return FALSE; }
-  pam_started = TRUE; //flag that pam is started
+  if( !pam_checkPW() ){ emit InvalidLogin(); pam_shutdown(); return FALSE; }
   //Startup the PAM session
-  if( !pam_startSession() ){ return FALSE; }
+  if( !pam_startSession() ){ pam_shutdown(); return FALSE; }
   pam_session_open = TRUE; //flag that pam has an open session
   
   // Configure the DE startup command
@@ -132,6 +131,7 @@
   //Initialize PAM
   ret = pam_start("login", cUser, &pamc, &pamh);
   if( ret == PAM_SUCCESS ){
+    pam_started = TRUE; //flag that pam is started
     //Place the user-supplied password into the structure 
     ret = pam_set_item(pamh, PAM_AUTHTOK, cPassword);
     //Set the TTY 



More information about the Commits mailing list