summaryrefslogtreecommitdiff
path: root/lib/common/UnixUser.cpp
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2006-08-31 22:35:51 +0000
committerChris Wilson <chris+github@qwirx.com>2006-08-31 22:35:51 +0000
commit186fbcc5fa57fa5899262d877f10be5cb4f87654 (patch)
tree537e73c0c5ee34ec9a8dccc839168d7c5ea7c64c /lib/common/UnixUser.cpp
parent85d5ccab78c156a8113cfef02748facb91aa6393 (diff)
Disable all calls to set*id() on Win32 (doesn't work) (refs #3)
Diffstat (limited to 'lib/common/UnixUser.cpp')
-rw-r--r--lib/common/UnixUser.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/common/UnixUser.cpp b/lib/common/UnixUser.cpp
index df2d0ddd..1ec9608d 100644
--- a/lib/common/UnixUser.cpp
+++ b/lib/common/UnixUser.cpp
@@ -78,8 +78,12 @@ UnixUser::~UnixUser()
if(mRevertOnDestruction)
{
// Revert to "real" user and group id of the process
+ #ifdef WIN32
+ if(0)
+ #else
if(::setegid(::getgid()) != 0
|| ::seteuid(::getuid()) != 0)
+ #endif
{
THROW_EXCEPTION(CommonException, CouldNotRestoreProcessUser)
}
@@ -101,8 +105,12 @@ void UnixUser::ChangeProcessUser(bool Temporary)
if(Temporary)
{
// Change temporarily (change effective only)
+ #ifdef WIN32
+ if(0)
+ #else
if(::setegid(mGID) != 0
|| ::seteuid(mUID) != 0)
+ #endif
{
THROW_EXCEPTION(CommonException, CouldNotChangeProcessUser)
}
@@ -112,9 +120,13 @@ void UnixUser::ChangeProcessUser(bool Temporary)
}
else
{
- // Change perminantely (change all UIDs and GIDs)
+ // Change permanently (change all UIDs and GIDs)
+ #ifdef WIN32
+ if(0)
+ #else
if(::setgid(mGID) != 0
|| ::setuid(mUID) != 0)
+ #endif
{
THROW_EXCEPTION(CommonException, CouldNotChangeProcessUser)
}