diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2009-04-20 15:54:02 +0200 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2009-04-20 16:25:17 +0200 |
commit | bb0f43006403106fda6231ef9b5c9674ebb53e14 (patch) | |
tree | cfcc40d1126ede2abbb6bece9352aed48fe0a77a /lib/replace/replace.c | |
parent | 20e1ba1c09631a3b1c850d9c8cbb42d863d0cb39 (diff) | |
download | samba-bb0f43006403106fda6231ef9b5c9674ebb53e14.tar.gz samba-bb0f43006403106fda6231ef9b5c9674ebb53e14.tar.xz samba-bb0f43006403106fda6231ef9b5c9674ebb53e14.zip |
Error out at runtime when seteuid/setresuid or setegid/setresgid are not
available. This means it's possible to compile libreplace when these
functions are not available and use it, as long as this particular
function is not used.
Diffstat (limited to 'lib/replace/replace.c')
-rw-r--r-- | lib/replace/replace.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/replace/replace.c b/lib/replace/replace.c index be277445923..fc15717349e 100644 --- a/lib/replace/replace.c +++ b/lib/replace/replace.c @@ -372,7 +372,8 @@ int rep_seteuid(uid_t euid) #ifdef HAVE_SETRESUID return setresuid(-1, euid, -1); #else -# error "You need a seteuid function" + errno = ENOSYS; + return -1; #endif } #endif @@ -383,7 +384,8 @@ int rep_setegid(gid_t egid) #ifdef HAVE_SETRESGID return setresgid(-1, egid, -1); #else -# error "You need a setegid function" + errno = ENOSYS; + return -1; #endif } #endif |