summaryrefslogtreecommitdiffstats
path: root/source/lib/system_smbd.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2002-08-26 00:43:06 +0000
committerAndrew Bartlett <abartlet@samba.org>2002-08-26 00:43:06 +0000
commit17096315a0f30f946ddecb79708604a111c37011 (patch)
treedd1f26be20a3306f54a02562cc391aca60704d60 /source/lib/system_smbd.c
parenta613dde7edab62c4439d256932b9f9b4ae2ec4e0 (diff)
downloadsamba-17096315a0f30f946ddecb79708604a111c37011.tar.gz
samba-17096315a0f30f946ddecb79708604a111c37011.tar.xz
samba-17096315a0f30f946ddecb79708604a111c37011.zip
Try to support non-root-mode systems without getgrouplist().
Andrew Bartlett
Diffstat (limited to 'source/lib/system_smbd.c')
-rw-r--r--source/lib/system_smbd.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/lib/system_smbd.c b/source/lib/system_smbd.c
index 580ef8a4634..5eda37d9034 100644
--- a/source/lib/system_smbd.c
+++ b/source/lib/system_smbd.c
@@ -41,6 +41,11 @@ static int getgrouplist_internals(const char *user, gid_t gid, gid_t *groups, in
gid_t *gids_saved;
int ret, ngrp_saved;
+ if (non_root_mode()) {
+ *grpcnt = 0;
+ return 0;
+ }
+
/* work out how many groups we need to save */
ngrp_saved = getgroups(0, NULL);
if (ngrp_saved == -1) {