summaryrefslogtreecommitdiff
path: root/source3/passdb
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2006-10-19 22:34:58 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:15:34 -0500
commit2145eff91d5b7e16ee486b410181f4b849a3fb9e (patch)
treef4228e9543e406c2227f2f1cf0df604e093b809b /source3/passdb
parent7ac5df4824f3ad464276b6deeee6cecfe9e21c76 (diff)
downloadsamba-2145eff91d5b7e16ee486b410181f4b849a3fb9e.tar.gz
samba-2145eff91d5b7e16ee486b410181f4b849a3fb9e.tar.bz2
samba-2145eff91d5b7e16ee486b410181f4b849a3fb9e.zip
r19419: BUG 4109: Patch from Timur Bakeyev. Fix bug causing smbd to turn off
winbindd and fail to disable the _NO_WINBIND environment. (This used to be commit a6366b40b3967853c20ca5399021108f09ffd505)
Diffstat (limited to 'source3/passdb')
-rw-r--r--source3/passdb/pdb_interface.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/source3/passdb/pdb_interface.c b/source3/passdb/pdb_interface.c
index 73f538214d..607a8b91d3 100644
--- a/source3/passdb/pdb_interface.c
+++ b/source3/passdb/pdb_interface.c
@@ -1295,27 +1295,25 @@ static BOOL get_memberuids(TALLOC_CTX *mem_ctx, gid_t gid, uid_t **pp_uids, size
struct group *grp;
char **gr;
struct passwd *pwd;
- char *winbindd_env;
+ BOOL winbind_env;
*pp_uids = NULL;
*p_num = 0;
/* We only look at our own sam, so don't care about imported stuff */
-
- winbindd_env = getenv(WINBINDD_DONT_ENV);
+ winbind_env = winbind_env_set();
winbind_off();
if ((grp = getgrgid(gid)) == NULL) {
/* allow winbindd lookups, but only if they weren't already disabled */
- if ( !(winbindd_env && strequal(winbindd_env, "1")) ) {
+ if (!winbind_env) {
winbind_on();
}
-
+
return False;
}
/* Primary group members */
-
setpwent();
while ((pwd = getpwent()) != NULL) {
if (pwd->pw_gid == gid) {
@@ -1326,7 +1324,6 @@ static BOOL get_memberuids(TALLOC_CTX *mem_ctx, gid_t gid, uid_t **pp_uids, size
endpwent();
/* Secondary group members */
-
for (gr = grp->gr_mem; (*gr != NULL) && ((*gr)[0] != '\0'); gr += 1) {
struct passwd *pw = getpwnam(*gr);
@@ -1336,11 +1333,10 @@ static BOOL get_memberuids(TALLOC_CTX *mem_ctx, gid_t gid, uid_t **pp_uids, size
}
/* allow winbindd lookups, but only if they weren't already disabled */
-
- if ( !(winbindd_env && strequal(winbindd_env, "1")) ) {
+ if (!winbind_env) {
winbind_on();
}
-
+
return True;
}