version 1.61, 2006/01/30 16:17:08
|
version 1.64, 2006/06/26 22:23:29
|
|
|
| |
#include "System.h" | #include "System.h" |
| |
#include <windows.h> |
#include "Network.h" |
#ifndef _WINSOCKAPI_ |
|
#include <winsock2.h> |
|
#endif |
|
#include <fcntl.h> | #include <fcntl.h> |
#include <sys/types.h> | #include <sys/types.h> |
#include <time.h> | #include <time.h> |
|
|
return String(pcSalt) + String((char *)pbBuffer); | return String(pcSalt) + String((char *)pbBuffer); |
} | } |
| |
|
String processUserName; |
|
Mutex processUserNameMut; |
|
|
Boolean System::isSystemUser(const char* userName) | Boolean System::isSystemUser(const char* userName) |
{ | { |
|
if(processUserName.size() == 0) |
|
{ |
|
// Lock and recheck the processUserName length in case two threads |
|
// enter this block simultaneously |
|
AutoMutex mut(processUserNameMut); |
|
if(processUserName.size() == 0) |
|
{ |
|
processUserName = getEffectiveUserName(); |
|
} |
|
} |
|
if(processUserName == userName) |
|
{ |
|
return true; |
|
} |
|
|
Boolean isSystemUser = false; | Boolean isSystemUser = false; |
| |
char mUserName[UNLEN+1]; | char mUserName[UNLEN+1]; |
|
|
return retVal; | return retVal; |
} | } |
| |
Boolean System::changeUserContext(const char* userName) |
Boolean System::lookupUserId( |
|
const char* userName, |
|
PEGASUS_UID_T& uid, |
|
PEGASUS_GID_T& gid) |
|
{ |
|
// ATTN: Implement this method to look up the specified user |
|
return false; |
|
} |
|
|
|
Boolean System::changeUserContext( |
|
const PEGASUS_UID_T& uid, |
|
const PEGASUS_GID_T& gid) |
{ | { |
// ATTN: Implement this method to change the process user context to the | // ATTN: Implement this method to change the process user context to the |
// specified user | // specified user |