1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

r25142: Panic if setting the group list fails while switching security

contexts. Patch from Tim Prouty <tim.prouty@isilon.com>.
This commit is contained in:
James Peach 2007-09-14 04:17:17 +00:00 committed by Gerald (Jerry) Carter
parent cfcf7cf03e
commit a136de663f

View File

@ -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);