(file) Return to PAMSessionBasicAuthenticator.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Security / Authentication

Diff for /pegasus/src/Pegasus/Security/Authentication/PAMSessionBasicAuthenticator.cpp between version 1.1 and 1.1.2.4

version 1.1, 2013/05/28 12:36:51 version 1.1.2.4, 2013/11/21 17:59:46
Line 32 
Line 32 
 #include <Pegasus/Common/Tracer.h> #include <Pegasus/Common/Tracer.h>
 #include "PAMSessionBasicAuthenticator.h" #include "PAMSessionBasicAuthenticator.h"
 #include "PAMSession.h" #include "PAMSession.h"
   #include "pam_rcToAuthStatus.h"
  
 PEGASUS_USING_STD; PEGASUS_USING_STD;
  
Line 61 
Line 62 
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
 } }
  
 Boolean PAMSessionBasicAuthenticator::authenticate(  AuthenticationStatus PAMSessionBasicAuthenticator::authenticate(
     const String& userName,     const String& userName,
     const String& password,     const String& password,
     AuthenticationInfo* authInfo)     AuthenticationInfo* authInfo)
Line 70 
Line 71 
     PEG_METHOD_ENTER(TRC_AUTHENTICATION,     PEG_METHOD_ENTER(TRC_AUTHENTICATION,
         "PAMSessionBasicAuthenticator::authenticate()");         "PAMSessionBasicAuthenticator::authenticate()");
  
     if (PAM_SUCCESS != _PAMAuthenticate(      int pamRC = _PAMAuthenticate(
         userName.getCString(),         userName.getCString(),
         password.getCString(),         password.getCString(),
         authInfo))          authInfo);
   
       AuthenticationStatus authStatus = _getAuthStatusFromPAM_RC(pamRC);
   
       // in case of an expired password, store user authenticated password
       if (authStatus.isPasswordExpired())
     {     {
         PEG_METHOD_EXIT();          authInfo->setAuthenticatedPassword(password);
         return false;          authInfo->setAuthenticatedUser(userName);
           authInfo->setExpiredPassword(true);
     }     }
  
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
     return true;      return authStatus;
 } }
  
 Boolean PAMSessionBasicAuthenticator::validateUser(  AuthenticationStatus PAMSessionBasicAuthenticator::validateUser(
     const String& userName,     const String& userName,
     AuthenticationInfo* authInfo)     AuthenticationInfo* authInfo)
 { {
     PEG_METHOD_ENTER(TRC_AUTHENTICATION,     PEG_METHOD_ENTER(TRC_AUTHENTICATION,
         "PAMSessionBasicAuthenticator::validateUser()");         "PAMSessionBasicAuthenticator::validateUser()");
  
     if (PAM_SUCCESS != _PAMValidateUser(      int pamRC = _PAMValidateUser(userName.getCString(), authInfo);
         userName.getCString(),      AuthenticationStatus authStatus = _getAuthStatusFromPAM_RC(pamRC);
         authInfo))  
     {  
         PEG_METHOD_EXIT();  
         return false;  
     }  
  
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
     return true;      return authStatus;
 } }
  
  
Line 117 
Line 119 
     return responseHeader;     return responseHeader;
 } }
  
   AuthenticationStatus PAMSessionBasicAuthenticator::updateExpiredPassword(
           const String& userName,
           const String& oldPass,
           const String& newPass,
           const String& ipAddress)
   {
       PEG_METHOD_ENTER(TRC_AUTHENTICATION,
           "PAMSessionBasicAuthenticator::updateExpiredPassword()");
   
       int pamRC = _PAMUpdateExpiredPassword(
           userName.getCString(),
           oldPass.getCString(),
           newPass.getCString(),
           ipAddress.getCString());
   
       AuthenticationStatus authStatus = _getAuthStatusFromPAM_RC(pamRC);
   
       PEG_METHOD_EXIT();
       return authStatus;
   }
   
   
 PEGASUS_NAMESPACE_END PEGASUS_NAMESPACE_END


Legend:
Removed from v.1.1  
changed lines
  Added in v.1.1.2.4

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2