version 1.9, 2007/07/24 19:42:03
|
version 1.15, 2008/01/29 18:45:05
|
|
|
# include <Executor/PAMAuth.h> | # include <Executor/PAMAuth.h> |
#endif | #endif |
| |
|
#ifdef PEGASUS_OS_PASE |
|
# include <as400_protos.h> // For fork400() |
|
#endif |
|
|
PEGASUS_NAMESPACE_BEGIN | PEGASUS_NAMESPACE_BEGIN |
| |
//////////////////////////////////////////////////////////////////////////////// | //////////////////////////////////////////////////////////////////////////////// |
|
|
switch (mode) | switch (mode) |
{ | { |
case 'r': | case 'r': |
return fopen(path, "rb"); |
return fopen(path, "r"); |
| |
case 'w': | case 'w': |
return fopen(path, "wb"); |
return fopen(path, "w"); |
| |
case 'a': | case 'a': |
return fopen(path, "a+"); | return fopen(path, "a+"); |
|
|
String path = FileSystem::getAbsolutePath( | String path = FileSystem::getAbsolutePath( |
pegasusHome.getCString(), PEGASUS_PROVIDER_AGENT_PROC_NAME); | pegasusHome.getCString(), PEGASUS_PROVIDER_AGENT_PROC_NAME); |
| |
# if !defined(PEGASUS_DISABLE_PROV_USERCTXT) |
# if !defined(PEGASUS_DISABLE_PROV_USERCTXT) && !defined(PEGASUS_OS_ZOS) |
| |
PEGASUS_UID_T newUid = (PEGASUS_UID_T)-1; | PEGASUS_UID_T newUid = (PEGASUS_UID_T)-1; |
PEGASUS_GID_T newGid = (PEGASUS_GID_T)-1; | PEGASUS_GID_T newGid = (PEGASUS_GID_T)-1; |
|
|
| |
# if defined(PEGASUS_OS_VMS) | # if defined(PEGASUS_OS_VMS) |
pid = (int)vfork(); | pid = (int)vfork(); |
|
# elif defined(PEGASUS_OS_PASE) |
|
pid = (int)fork400("QUMEPRVAGT",0); |
# else | # else |
pid = (int)fork(); | pid = (int)fork(); |
# endif | # endif |
|
|
| |
# endif /* !defined(PEGASUS_OS_VMS) */ | # endif /* !defined(PEGASUS_OS_VMS) */ |
| |
# if !defined(PEGASUS_DISABLE_PROV_USERCTXT) |
# if !defined(PEGASUS_DISABLE_PROV_USERCTXT) && !defined(PEGASUS_OS_ZOS) |
| |
// Set uid and gid for the new provider agent process. | // Set uid and gid for the new provider agent process. |
| |
|
|
virtual int reapProviderAgent( | virtual int reapProviderAgent( |
int pid) | int pid) |
{ | { |
AutoMutex autoMutex(_mutex); |
// The Executor process automatically cleans up all its child |
|
// processes, so it does not need to explicitly harvest the |
// Send request header: |
// exit status of the cimprovagt processes it starts. |
|
|
ExecutorRequestHeader header; |
|
header.code = EXECUTOR_REAP_PROVIDER_AGENT_MESSAGE; |
|
| |
if (SendBlock(_sock, &header, sizeof(header)) != sizeof(header)) |
return 0; |
return -1; |
|
|
|
// Send request body: |
|
|
|
ExecutorReapProviderAgentRequest request; |
|
memset(&request, 0, sizeof(request)); |
|
request.pid = pid; |
|
|
|
if (SendBlock(_sock, &request, sizeof(request)) != sizeof(request)) |
|
return -1; |
|
|
|
// Receive the response |
|
|
|
ExecutorReapProviderAgentResponse response; |
|
|
|
if (RecvBlock(_sock, &response, sizeof(response)) != sizeof(response)) |
|
return -1; |
|
|
|
return response.status; |
|
} | } |
| |
virtual int authenticatePassword( | virtual int authenticatePassword( |