summaryrefslogtreecommitdiff
path: root/source3/smbd/sec_ctx.c
diff options
context:
space:
mode:
authorJames Peach <jpeach@samba.org>2007-09-14 15:08:07 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:30:46 -0500
commit8b6366b301d3020223fbd6ac3dad42b1476b37f9 (patch)
tree7f4522f2a2ebf02702c270b7fb611c467c075f78 /source3/smbd/sec_ctx.c
parentf157c9abb775e1891ebadeb41fb778804a01ae21 (diff)
downloadsamba-8b6366b301d3020223fbd6ac3dad42b1476b37f9.tar.gz
samba-8b6366b301d3020223fbd6ac3dad42b1476b37f9.tar.bz2
samba-8b6366b301d3020223fbd6ac3dad42b1476b37f9.zip
r25161: Don't panic if setgroups fails in non-root mode.
(This used to be commit ea226c5ed97d47649833546d5499213093d1925e)
Diffstat (limited to 'source3/smbd/sec_ctx.c')
-rw-r--r--source3/smbd/sec_ctx.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source3/smbd/sec_ctx.c b/source3/smbd/sec_ctx.c
index 108d1794c7..08d522cdd7 100644
--- a/source3/smbd/sec_ctx.c
+++ b/source3/smbd/sec_ctx.c
@@ -239,7 +239,7 @@ 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
- if (sys_setgroups(gid, ngroups, groups) != 0) {
+ if (sys_setgroups(gid, ngroups, groups) != 0 && !non_root_mode()) {
smb_panic("sys_setgroups failed");
}
#endif
@@ -280,7 +280,7 @@ static void set_unix_security_ctx(uid_t uid, gid_t gid, int ngroups, gid_t *grou
if (syscall(SYS_initgroups, (ngroups > max) ? max : ngroups,
- groups, uid) == 1) {
+ groups, uid) == -1 && !non_root_mode()) {
DEBUG(0, ("WARNING: failed to set group list "
"(%d groups) for UID %ld: %s\n",
ngroups, uid, strerror(errno)));