summaryrefslogtreecommitdiff
path: root/source3/lib/system_smbd.c
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/lib/system_smbd.c
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/lib/system_smbd.c')
-rw-r--r--source3/lib/system_smbd.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/source3/lib/system_smbd.c b/source3/lib/system_smbd.c
index afa64489cf..fc506c901d 100644
--- a/source3/lib/system_smbd.c
+++ b/source3/lib/system_smbd.c
@@ -120,19 +120,15 @@ static int getgrouplist_internals(const char *user, gid_t gid, gid_t *groups,
static int sys_getgrouplist(const char *user, gid_t gid, gid_t *groups, int *grpcnt)
{
int retval;
- char *winbindd_env;
+ BOOL winbind_env;
DEBUG(10,("sys_getgrouplist: user [%s]\n", user));
- /* Save the winbindd state and not just blindly turn it back on */
-
- winbindd_env = getenv(WINBINDD_DONT_ENV);
-
/* This is only ever called for Unix users, remote memberships are
* always determined by the info3 coming back from auth3 or the
* PAC. */
-
- winbind_off() ;
+ winbind_env = winbind_env_set();
+ winbind_off();
#ifdef HAVE_GETGROUPLIST
retval = getgrouplist(user, gid, groups, grpcnt);
@@ -142,9 +138,8 @@ static int sys_getgrouplist(const char *user, gid_t gid, gid_t *groups, int *grp
unbecome_root();
#endif
- /* allow winbindd lookups , but only if they were not already disabled */
-
- if ( !(winbindd_env && strequal(winbindd_env, "1")) ) {
+ /* allow winbindd lookups, but only if they were not already disabled */
+ if (!winbind_env) {
winbind_on();
}