summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2009-04-20 15:54:02 +0200
committerJelmer Vernooij <jelmer@samba.org>2009-04-20 16:25:17 +0200
commitbb0f43006403106fda6231ef9b5c9674ebb53e14 (patch)
treecfcc40d1126ede2abbb6bece9352aed48fe0a77a /lib
parent20e1ba1c09631a3b1c850d9c8cbb42d863d0cb39 (diff)
downloadsamba-bb0f43006403106fda6231ef9b5c9674ebb53e14.tar.gz
samba-bb0f43006403106fda6231ef9b5c9674ebb53e14.tar.bz2
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')
-rw-r--r--lib/replace/replace.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/replace/replace.c b/lib/replace/replace.c
index be27744592..fc15717349 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