From: Jelmer Vernooij Date: Mon, 20 Apr 2009 13:54:02 +0000 (+0200) Subject: Error out at runtime when seteuid/setresuid or setegid/setresgid are not X-Git-Tag: tdb-1.1.5~958^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bb0f43006403106fda6231ef9b5c9674ebb53e14;p=thirdparty%2Fsamba.git 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. --- 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