(file) Return to Executor.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Common

Diff for /pegasus/src/Pegasus/Common/Executor.cpp between version 1.1.2.8 and 1.1.2.9

version 1.1.2.8, 2007/01/05 00:32:31 version 1.1.2.9, 2007/01/07 21:39:01
Line 256 
Line 256 
 #else /* POSIX CASE FOLLOWS */ #else /* POSIX CASE FOLLOWS */
  
 static int InProcess_startProviderAgent( static int InProcess_startProviderAgent(
       const SessionKey& sessionKey,
     const char* module,     const char* module,
     int uid,     int uid,
     int gid,     int gid,
Line 422 
Line 423 
     return status;     return status;
 } }
  
 static int InProcess_pamAuthenticate(  static int InProcess_authenticatePassword(
     const char* username,     const char* username,
     const char* password,     const char* password,
     SessionKey& sessionKey)     SessionKey& sessionKey)
Line 436 
Line 437 
 #endif #endif
 } }
  
 static int InProcess_pamValidateUser(  static int InProcess_validateUser(
     const char* username)     const char* username)
 { {
 #if defined(PEGASUS_PAM_AUTHENTICATION) #if defined(PEGASUS_PAM_AUTHENTICATION)
Line 728 
Line 729 
 } }
  
 static int OutOfProcess_startProviderAgent( static int OutOfProcess_startProviderAgent(
       const SessionKey& sessionKey,
     const char* module,     const char* module,
     int uid,     int uid,
     int gid,     int gid,
Line 759 
Line 761 
  
     ExecutorStartProviderAgentRequest request;     ExecutorStartProviderAgentRequest request;
     memset(&request, 0, sizeof(request));     memset(&request, 0, sizeof(request));
       Strlcpy(request.key, sessionKey.data(), sizeof(request.key));
     memcpy(request.module, module, n);     memcpy(request.module, module, n);
     request.uid = uid;     request.uid = uid;
     request.gid = gid;     request.gid = gid;
Line 860 
Line 863 
     return response.status;     return response.status;
 } }
  
 static int OutOfProcess_pamAuthenticate(  static int OutOfProcess_authenticatePassword(
     const char* username,     const char* username,
     const char* password,     const char* password,
     SessionKey& sessionKey)     SessionKey& sessionKey)
Line 872 
Line 875 
     // _send request header:     // _send request header:
  
     ExecutorRequestHeader header;     ExecutorRequestHeader header;
     header.code = EXECUTOR_PAM_AUTHENTICATE_MESSAGE;      header.code = EXECUTOR_AUTHENTICATE_PASSWORD_MESSAGE;
  
     if (_send(_getSock(), &header, sizeof(header)) != sizeof(header))     if (_send(_getSock(), &header, sizeof(header)) != sizeof(header))
         return -1;         return -1;
  
     // _send request body.     // _send request body.
  
     ExecutorPAMAuthenticateRequest request;      ExecutorAuthenticatePasswordRequest request;
     memset(&request, 0, sizeof(request));     memset(&request, 0, sizeof(request));
     Strlcpy(request.username, username, EXECUTOR_BUFFER_SIZE);     Strlcpy(request.username, username, EXECUTOR_BUFFER_SIZE);
     Strlcpy(request.password, password, EXECUTOR_BUFFER_SIZE);     Strlcpy(request.password, password, EXECUTOR_BUFFER_SIZE);
Line 889 
Line 892 
  
     // Receive the response     // Receive the response
  
     ExecutorPAMAuthenticateResponse response;      ExecutorAuthenticatePasswordResponse response;
  
     if (_recv(_getSock(), &response, sizeof(response)) != sizeof(response))     if (_recv(_getSock(), &response, sizeof(response)) != sizeof(response))
         return -1;         return -1;
Line 899 
Line 902 
     return response.status;     return response.status;
 } }
  
 static int OutOfProcess_pamValidateUser(  static int OutOfProcess_validateUser(
     const char* username)     const char* username)
 { {
     AutoMutex autoMutex(_mutex);     AutoMutex autoMutex(_mutex);
Line 907 
Line 910 
     // _send request header:     // _send request header:
  
     ExecutorRequestHeader header;     ExecutorRequestHeader header;
     header.code = EXECUTOR_PAM_VALIDATE_USER_MESSAGE;      header.code = EXECUTOR_VALIDATE_USER_MESSAGE;
  
     if (_send(_getSock(), &header, sizeof(header)) != sizeof(header))     if (_send(_getSock(), &header, sizeof(header)) != sizeof(header))
         return -1;         return -1;
  
     // _send request body.     // _send request body.
  
     ExecutorPAMValidateUserRequest request;      ExecutorValidateUserRequest request;
     memset(&request, 0, sizeof(request));     memset(&request, 0, sizeof(request));
     Strlcpy(request.username, username, EXECUTOR_BUFFER_SIZE);     Strlcpy(request.username, username, EXECUTOR_BUFFER_SIZE);
  
Line 923 
Line 926 
  
     // Receive the response     // Receive the response
  
     ExecutorPAMValidateUserResponse response;      ExecutorValidateUserResponse response;
  
     if (_recv(_getSock(), &response, sizeof(response)) != sizeof(response))     if (_recv(_getSock(), &response, sizeof(response)) != sizeof(response))
         return -1;         return -1;
Line 931 
Line 934 
     return response.status;     return response.status;
 } }
  
 int OutOfProcess_startLocalAuth(  int OutOfProcess_challengeLocal(
     const char* user,     const char* user,
     char path[EXECUTOR_BUFFER_SIZE],      char challenge[EXECUTOR_BUFFER_SIZE],
     SessionKey& sessionKey)     SessionKey& sessionKey)
 { {
     AutoMutex autoMutex(_mutex);     AutoMutex autoMutex(_mutex);
Line 941 
Line 944 
     // _send request header:     // _send request header:
  
     ExecutorRequestHeader header;     ExecutorRequestHeader header;
     header.code = EXECUTOR_START_LOCAL_AUTH_MESSAGE;      header.code = EXECUTOR_CHALLENGE_LOCAL_MESSAGE;
  
     if (_send(_getSock(), &header, sizeof(header)) != sizeof(header))     if (_send(_getSock(), &header, sizeof(header)) != sizeof(header))
         return -1;         return -1;
  
     // _send request body.     // _send request body.
  
     ExecutorStartLocalAuthRequest request;      ExecutorChallengeLocalRequest request;
     memset(&request, 0, sizeof(request));     memset(&request, 0, sizeof(request));
     Strlcpy(request.user, user, EXECUTOR_BUFFER_SIZE);     Strlcpy(request.user, user, EXECUTOR_BUFFER_SIZE);
  
Line 957 
Line 960 
  
     // Receive the response     // Receive the response
  
     ExecutorStartLocalAuthResponse response;      ExecutorChallengeLocalResponse response;
  
     if (_recv(_getSock(), &response, sizeof(response)) != sizeof(response))     if (_recv(_getSock(), &response, sizeof(response)) != sizeof(response))
         return -1;         return -1;
  
     Strlcpy((char*)sessionKey.data(), response.key, sessionKey.size());     Strlcpy((char*)sessionKey.data(), response.key, sessionKey.size());
     Strlcpy(path, response.path, EXECUTOR_BUFFER_SIZE);      Strlcpy(challenge, response.challenge, EXECUTOR_BUFFER_SIZE);
  
     return response.status;     return response.status;
 } }
  
 int OutOfProcess_finishLocalAuth(  int OutOfProcess_authenticateLocal(
     const SessionKey& sessionKey,     const SessionKey& sessionKey,
     const char* token)     const char* token)
 { {
Line 977 
Line 980 
     // _send request header:     // _send request header:
  
     ExecutorRequestHeader header;     ExecutorRequestHeader header;
     header.code = EXECUTOR_FINISH_LOCAL_AUTH_MESSAGE;      header.code = EXECUTOR_AUTHENTICATE_LOCAL_MESSAGE;
  
     if (_send(_getSock(), &header, sizeof(header)) != sizeof(header))     if (_send(_getSock(), &header, sizeof(header)) != sizeof(header))
         return -1;         return -1;
  
     // _send request body.     // _send request body.
  
     ExecutorFinishLocalAuthRequest request;      ExecutorAuthenticateLocalRequest request;
     memset(&request, 0, sizeof(request));     memset(&request, 0, sizeof(request));
     Strlcpy(request.key, (char*)sessionKey.data(), EXECUTOR_BUFFER_SIZE);     Strlcpy(request.key, (char*)sessionKey.data(), EXECUTOR_BUFFER_SIZE);
     Strlcpy(request.token, token, EXECUTOR_BUFFER_SIZE);     Strlcpy(request.token, token, EXECUTOR_BUFFER_SIZE);
Line 994 
Line 997 
  
     // Receive the response     // Receive the response
  
     ExecutorFinishLocalAuthResponse response;      ExecutorAuthenticateLocalResponse response;
  
     if (_recv(_getSock(), &response, sizeof(response)) != sizeof(response))     if (_recv(_getSock(), &response, sizeof(response)) != sizeof(response))
         return -1;         return -1;
Line 1049 
Line 1052 
 #if defined(PEGASUS_ENABLE_PRIVILEGE_SEPARATION) #if defined(PEGASUS_ENABLE_PRIVILEGE_SEPARATION)
     return OutOfProcess_openFile(path, mode);     return OutOfProcess_openFile(path, mode);
 #else #else
     return -1;      return NULL;
 #endif /* defined(PEGASUS_ENABLE_PRIVILEGE_SEPARATION) */ #endif /* defined(PEGASUS_ENABLE_PRIVILEGE_SEPARATION) */
 } }
  
Line 1081 
Line 1084 
 } }
  
 int Executor::startProviderAgent( int Executor::startProviderAgent(
       const SessionKey& sessionKey,
     const char* module,     const char* module,
     int uid,     int uid,
     int gid,     int gid,
Line 1090 
Line 1094 
 { {
     if (_getSock() == -1)     if (_getSock() == -1)
         return InProcess_startProviderAgent(         return InProcess_startProviderAgent(
             module, uid, gid, pid, readPipe, writePipe);              sessionKey, module, uid, gid, pid, readPipe, writePipe);
  
 #if defined(PEGASUS_ENABLE_PRIVILEGE_SEPARATION) #if defined(PEGASUS_ENABLE_PRIVILEGE_SEPARATION)
     return OutOfProcess_startProviderAgent(     return OutOfProcess_startProviderAgent(
         module, uid, gid, pid, readPipe, writePipe);          sessionKey, module, uid, gid, pid, readPipe, writePipe);
 #else #else
     return -1;     return -1;
 #endif /* defined(PEGASUS_ENABLE_PRIVILEGE_SEPARATION) */ #endif /* defined(PEGASUS_ENABLE_PRIVILEGE_SEPARATION) */
Line 1125 
Line 1129 
 #endif /* defined(PEGASUS_ENABLE_PRIVILEGE_SEPARATION) */ #endif /* defined(PEGASUS_ENABLE_PRIVILEGE_SEPARATION) */
 } }
  
 int Executor::pamAuthenticate(  int Executor::authenticatePassword(
     const char* username,     const char* username,
     const char* password,     const char* password,
     SessionKey& sessionKey)     SessionKey& sessionKey)
 { {
     if (_getSock() == -1)     if (_getSock() == -1)
         return InProcess_pamAuthenticate(username, password, sessionKey);          return InProcess_authenticatePassword(username, password, sessionKey);
  
 #if defined(PEGASUS_ENABLE_PRIVILEGE_SEPARATION) #if defined(PEGASUS_ENABLE_PRIVILEGE_SEPARATION)
     return OutOfProcess_pamAuthenticate(username, password, sessionKey);      return OutOfProcess_authenticatePassword(username, password, sessionKey);
 #else #else
     return -1;     return -1;
 #endif /* defined(PEGASUS_ENABLE_PRIVILEGE_SEPARATION) */ #endif /* defined(PEGASUS_ENABLE_PRIVILEGE_SEPARATION) */
 } }
  
 int Executor::pamValidateUser(  int Executor::validateUser(
     const char* username)     const char* username)
 { {
     if (_getSock() == -1)     if (_getSock() == -1)
         return InProcess_pamValidateUser(username);          return InProcess_validateUser(username);
  
 #if defined(PEGASUS_ENABLE_PRIVILEGE_SEPARATION) #if defined(PEGASUS_ENABLE_PRIVILEGE_SEPARATION)
     return OutOfProcess_pamValidateUser(username);      return OutOfProcess_validateUser(username);
 #else #else
     return -1;     return -1;
 #endif /* defined(PEGASUS_ENABLE_PRIVILEGE_SEPARATION) */ #endif /* defined(PEGASUS_ENABLE_PRIVILEGE_SEPARATION) */
 } }
  
 int Executor::startLocalAuth(  int Executor::challengeLocal(
     const char* user,     const char* user,
     char path[EXECUTOR_BUFFER_SIZE],     char path[EXECUTOR_BUFFER_SIZE],
     SessionKey& sessionKey)     SessionKey& sessionKey)
Line 1162 
Line 1166 
         return -1;         return -1;
  
 #if defined(PEGASUS_ENABLE_PRIVILEGE_SEPARATION) #if defined(PEGASUS_ENABLE_PRIVILEGE_SEPARATION)
     return OutOfProcess_startLocalAuth(user, path, sessionKey);      return OutOfProcess_challengeLocal(user, path, sessionKey);
 #else #else
     return -1;     return -1;
 #endif /* defined(PEGASUS_ENABLE_PRIVILEGE_SEPARATION) */ #endif /* defined(PEGASUS_ENABLE_PRIVILEGE_SEPARATION) */
 } }
  
 int Executor::finishLocalAuth(  int Executor::authenticateLocal(
     const SessionKey& sessionKey,     const SessionKey& sessionKey,
     const char* token)      const char* challengeResponse)
 { {
     if (_getSock() == -1)     if (_getSock() == -1)
         return -1;         return -1;
  
 #if defined(PEGASUS_ENABLE_PRIVILEGE_SEPARATION) #if defined(PEGASUS_ENABLE_PRIVILEGE_SEPARATION)
     return OutOfProcess_finishLocalAuth(sessionKey, token);      return OutOfProcess_authenticateLocal(sessionKey, challengeResponse);
 #else #else
     return -1;     return -1;
 #endif /* defined(PEGASUS_ENABLE_PRIVILEGE_SEPARATION) */ #endif /* defined(PEGASUS_ENABLE_PRIVILEGE_SEPARATION) */


Legend:
Removed from v.1.1.2.8  
changed lines
  Added in v.1.1.2.9

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2