(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.9 and 1.1.2.11

version 1.1.2.9, 2007/01/07 21:39:01 version 1.1.2.11, 2007/01/09 17:46:28
Line 261 
Line 261 
     int uid,     int uid,
     int gid,     int gid,
     int& pid,     int& pid,
       SessionKey& providerAgentSessionKey,
     AnonymousPipe*& readPipe,     AnonymousPipe*& readPipe,
     AnonymousPipe*& writePipe)     AnonymousPipe*& writePipe)
 { {
Line 268 
Line 269 
  
     // Initialize output parameters in case of error.     // Initialize output parameters in case of error.
  
       providerAgentSessionKey.clear();
     pid = -1;     pid = -1;
     readPipe = 0;     readPipe = 0;
     writePipe = 0;     writePipe = 0;
Line 734 
Line 736 
     int uid,     int uid,
     int gid,     int gid,
     int& pid,     int& pid,
       SessionKey& providerAgentSessionKey,
     AnonymousPipe*& readPipe,     AnonymousPipe*& readPipe,
     AnonymousPipe*& writePipe)     AnonymousPipe*& writePipe)
 { {
     AutoMutex autoMutex(_mutex);     AutoMutex autoMutex(_mutex);
  
       providerAgentSessionKey.clear();
     readPipe = 0;     readPipe = 0;
     writePipe = 0;     writePipe = 0;
  
Line 776 
Line 780 
     if (_recv(_getSock(), &response, sizeof(response)) != sizeof(response))     if (_recv(_getSock(), &response, sizeof(response)) != sizeof(response))
         return -1;         return -1;
  
       // Get the session key.
   
       Strlcpy((char*)providerAgentSessionKey.data(),
           response.key, providerAgentSessionKey.size());
   
     // Check response status and pid.     // Check response status and pid.
  
     if (response.status != 0)     if (response.status != 0)
Line 941 
Line 950 
 { {
     AutoMutex autoMutex(_mutex);     AutoMutex autoMutex(_mutex);
  
       sessionKey.clear();
   
     // _send request header:     // _send request header:
  
     ExecutorRequestHeader header;     ExecutorRequestHeader header;
Line 1005 
Line 1016 
     return response.status;     return response.status;
 } }
  
   int OutOfProcess_newSessionKey(
       const char username[EXECUTOR_BUFFER_SIZE],
       SessionKey& sessionKey)
   {
       AutoMutex autoMutex(_mutex);
   
       sessionKey.clear();
   
       // _send request header:
   
       ExecutorRequestHeader header;
       header.code = EXECUTOR_NEW_SESSION_KEY_MESSAGE;
   
       if (_send(_getSock(), &header, sizeof(header)) != sizeof(header))
           return -1;
   
       // _send request body.
   
       ExecutorNewSessionKeyRequest request;
       memset(&request, 0, sizeof(request));
       Strlcpy(request.username, username, sizeof(request.username));
   
       if (_send(_getSock(), &request, sizeof(request)) != sizeof(request))
           return -1;
   
       // Receive the response
   
       ExecutorNewSessionKeyResponse response;
   
       if (_recv(_getSock(), &response, sizeof(response)) != sizeof(response))
           return -1;
   
       Strlcpy((char*)sessionKey.data(), response.key, sessionKey.size());
   
       return response.status;
   }
   
   int OutOfProcess_deleteSessionKey(
       const SessionKey& sessionKey)
   {
       AutoMutex autoMutex(_mutex);
   
       // Send request header:
   
       ExecutorRequestHeader header;
       header.code = EXECUTOR_DELETE_SESSION_KEY_MESSAGE;
   
       if (_send(_getSock(), &header, sizeof(header)) != sizeof(header))
           return -1;
   
       // Send request body.
   
       ExecutorDeleteSessionKeyRequest request;
       memset(&request, 0, sizeof(request));
       Strlcpy(request.key, sessionKey.data(), sizeof(request.key));
   
       if (_send(_getSock(), &request, sizeof(request)) != sizeof(request))
           return -1;
   
       // Receive the response
   
       ExecutorDeleteSessionKeyResponse response;
   
       if (_recv(_getSock(), &response, sizeof(response)) != sizeof(response))
           return -1;
   
       return response.status;
   }
   
 #endif /* defined(PEGASUS_ENABLE_PRIVILEGE_SEPARATION) */ #endif /* defined(PEGASUS_ENABLE_PRIVILEGE_SEPARATION) */
  
 //////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
Line 1089 
Line 1169 
     int uid,     int uid,
     int gid,     int gid,
     int& pid,     int& pid,
       SessionKey& providerAgentSessionKey,
     AnonymousPipe*& readPipe,     AnonymousPipe*& readPipe,
     AnonymousPipe*& writePipe)     AnonymousPipe*& writePipe)
 { {
     if (_getSock() == -1)     if (_getSock() == -1)
         return InProcess_startProviderAgent(          return InProcess_startProviderAgent(sessionKey, module,
             sessionKey, module, uid, gid, pid, readPipe, writePipe);              uid, gid, pid, providerAgentSessionKey, readPipe, writePipe);
  
 #if defined(PEGASUS_ENABLE_PRIVILEGE_SEPARATION) #if defined(PEGASUS_ENABLE_PRIVILEGE_SEPARATION)
     return OutOfProcess_startProviderAgent(      return OutOfProcess_startProviderAgent(sessionKey, module,
         sessionKey, module, uid, gid, pid, readPipe, writePipe);          uid, gid, pid, providerAgentSessionKey, readPipe, writePipe);
 #else #else
       providerAgentSessionKey.clear();
     return -1;     return -1;
 #endif /* defined(PEGASUS_ENABLE_PRIVILEGE_SEPARATION) */ #endif /* defined(PEGASUS_ENABLE_PRIVILEGE_SEPARATION) */
 } }
Line 1140 
Line 1222 
 #if defined(PEGASUS_ENABLE_PRIVILEGE_SEPARATION) #if defined(PEGASUS_ENABLE_PRIVILEGE_SEPARATION)
     return OutOfProcess_authenticatePassword(username, password, sessionKey);     return OutOfProcess_authenticatePassword(username, password, sessionKey);
 #else #else
       sessionKey.clear();
     return -1;     return -1;
 #endif /* defined(PEGASUS_ENABLE_PRIVILEGE_SEPARATION) */ #endif /* defined(PEGASUS_ENABLE_PRIVILEGE_SEPARATION) */
 } }
Line 1168 
Line 1251 
 #if defined(PEGASUS_ENABLE_PRIVILEGE_SEPARATION) #if defined(PEGASUS_ENABLE_PRIVILEGE_SEPARATION)
     return OutOfProcess_challengeLocal(user, path, sessionKey);     return OutOfProcess_challengeLocal(user, path, sessionKey);
 #else #else
       sessionKey.clear();
     return -1;     return -1;
 #endif /* defined(PEGASUS_ENABLE_PRIVILEGE_SEPARATION) */ #endif /* defined(PEGASUS_ENABLE_PRIVILEGE_SEPARATION) */
 } }
Line 1186 
Line 1270 
 #endif /* defined(PEGASUS_ENABLE_PRIVILEGE_SEPARATION) */ #endif /* defined(PEGASUS_ENABLE_PRIVILEGE_SEPARATION) */
 } }
  
   int Executor::newSessionKey(
       const char username[EXECUTOR_BUFFER_SIZE],
       SessionKey& sessionKey)
   {
       if (_getSock() == -1)
           return -1;
   
   #if defined(PEGASUS_ENABLE_PRIVILEGE_SEPARATION)
       return OutOfProcess_newSessionKey(username, sessionKey);
   #else
       sessionKey.clear();
       return 0;
   #endif /* defined(PEGASUS_ENABLE_PRIVILEGE_SEPARATION) */
   }
   
   int Executor::deleteSessionKey(
       const SessionKey& sessionKey)
   {
       if (_getSock() == -1)
           return -1;
   
   #if defined(PEGASUS_ENABLE_PRIVILEGE_SEPARATION)
       return OutOfProcess_deleteSessionKey(sessionKey);
   #else
       return 0;
   #endif /* defined(PEGASUS_ENABLE_PRIVILEGE_SEPARATION) */
   }
   
 PEGASUS_NAMESPACE_END PEGASUS_NAMESPACE_END


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

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2