diff options
author | James Peach <jpeach@samba.org> | 2007-09-14 04:17:17 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:30:45 -0500 |
commit | a136de663f122603e8d34e06027896ff39b35e11 (patch) | |
tree | 1080c38a381e5bd064f5ff02765150c34d644d43 | |
parent | cfcf7cf03e1be34e6839c1a659c4e8c1b5358c37 (diff) | |
download | samba-a136de663f122603e8d34e06027896ff39b35e11.tar.gz samba-a136de663f122603e8d34e06027896ff39b35e11.tar.xz samba-a136de663f122603e8d34e06027896ff39b35e11.zip |
r25142: Panic if setting the group list fails while switching security
contexts. Patch from Tim Prouty <tim.prouty@isilon.com>.
-rw-r--r-- | source/smbd/sec_ctx.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source/smbd/sec_ctx.c b/source/smbd/sec_ctx.c index 67b15dc014c..108d1794c71 100644 --- a/source/smbd/sec_ctx.c +++ b/source/smbd/sec_ctx.c @@ -239,7 +239,9 @@ static void set_unix_security_ctx(uid_t uid, gid_t gid, int ngroups, gid_t *grou /* Start context switch */ gain_root(); #ifdef HAVE_SETGROUPS - sys_setgroups(gid, ngroups, groups); + if (sys_setgroups(gid, ngroups, groups) != 0) { + smb_panic("sys_setgroups failed"); + } #endif become_id(uid, gid); /* end context switch */ @@ -282,6 +284,7 @@ static void set_unix_security_ctx(uid_t uid, gid_t gid, int ngroups, gid_t *grou DEBUG(0, ("WARNING: failed to set group list " "(%d groups) for UID %ld: %s\n", ngroups, uid, strerror(errno))); + smb_panic("sys_setgroups failed"); } become_uid(uid); |