git.samba.org
/
obnox
/
samba
/
samba-obnox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6e30b2e
)
uwrap: Add the EINVAL check to setegid()
author
Andreas Schneider
<asn@samba.org>
Fri, 30 Oct 2015 12:41:18 +0000
(13:41 +0100)
committer
Andreas Schneider
<asn@cryptomilk.org>
Thu, 5 Nov 2015 08:23:16 +0000
(09:23 +0100)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
lib/uid_wrapper/uid_wrapper.c
patch
|
blob
|
history
diff --git
a/lib/uid_wrapper/uid_wrapper.c
b/lib/uid_wrapper/uid_wrapper.c
index d720e533e4e832a5714d993c22bf13989b01a290..2702bd7c71a29127de8840167bedd67c14883ce4 100644
(file)
--- a/
lib/uid_wrapper/uid_wrapper.c
+++ b/
lib/uid_wrapper/uid_wrapper.c
@@
-1665,6
+1665,12
@@
int setegid(gid_t egid)
return libc_setegid(egid);
}
+ /* On FreeBSD the uid_t -1 is set and doesn't produce and error */
+ if (egid == (gid_t)-1) {
+ errno = EINVAL;
+ return -1;
+ }
+
uwrap_init();
return uwrap_setresgid(-1, egid, -1);
}