diff options
author | Andreas Schneider <asn@samba.org> | 2015-10-30 13:39:30 +0100 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2015-11-05 09:23:16 +0100 |
commit | 2232db817336787c520ad32a1d3179a628d53e06 (patch) | |
tree | 0abbfb6fc291926e63e9de07cf773ced78c90b21 | |
parent | 56970b467b65ac00001132b499ab61b40ba1efa3 (diff) | |
download | samba-2232db817336787c520ad32a1d3179a628d53e06.tar.gz |
uwrap: Move the EINVAL check down in seteuid()
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
-rw-r--r-- | lib/uid_wrapper/uid_wrapper.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/uid_wrapper/uid_wrapper.c b/lib/uid_wrapper/uid_wrapper.c index e0d84beb7ea..dd999ffc114 100644 --- a/lib/uid_wrapper/uid_wrapper.c +++ b/lib/uid_wrapper/uid_wrapper.c @@ -1293,15 +1293,16 @@ int setuid(uid_t uid) #ifdef HAVE_SETEUID int seteuid(uid_t euid) { + if (!uid_wrapper_enabled()) { + return libc_seteuid(euid); + } + + /* On FreeBSD the uid_t -1 is set and doesn't produce and error */ if (euid == (uid_t)-1) { errno = EINVAL; return -1; } - if (!uid_wrapper_enabled()) { - return libc_seteuid(euid); - } - uwrap_init(); return uwrap_setresuid(-1, euid, -1); } |