From e4998337e75c5e9debe914ff4eb2c0b0fa97c156 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Sun, 2 Apr 2006 19:45:42 +0000 Subject: r14868: I will not write code when changing to Daylight Savings Time. I will not write code when changing to Daylight Savings Time. I will not write code when changing to Daylight Savings Time. I will not write code when changing to Daylight Savings Time. I will not write code when changing to Daylight Savings Time. I will not write code when changing to Daylight Savings Time. I will not write code when changing to Daylight Savings Time. I will not write code when changing to Daylight Savings Time. I will not write code when changing to Daylight Savings Time. ... Fix my brain dead inverted logic for turning winbindd on and off when run on a DC or when calling pdb functions from within winbindd. (This used to be commit 021b3dc2db9fb422ede4657a1f27ef7ef2d22cee) --- source3/passdb/pdb_interface.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'source3/passdb/pdb_interface.c') diff --git a/source3/passdb/pdb_interface.c b/source3/passdb/pdb_interface.c index 88cf387838..b6e635cca1 100644 --- a/source3/passdb/pdb_interface.c +++ b/source3/passdb/pdb_interface.c @@ -1509,11 +1509,13 @@ static BOOL get_memberuids(TALLOC_CTX *mem_ctx, gid_t gid, uid_t **pp_uids, size /* We only look at our own sam, so don't care about imported stuff */ winbindd_env = getenv(WINBINDD_DONT_ENV); - winbind_putenv("0"); + winbind_off(); if ((grp = getgrgid(gid)) == NULL) { - /* allow winbindd lookups */ - winbind_putenv( winbindd_env ? winbindd_env : "1" ); + /* allow winbindd lookups, but only if they weren't already disabled */ + if ( !(winbindd_env && strequal(winbindd_env, "1")) ) { + winbind_on(); + } return False; } @@ -1539,8 +1541,11 @@ static BOOL get_memberuids(TALLOC_CTX *mem_ctx, gid_t gid, uid_t **pp_uids, size add_uid_to_array_unique(mem_ctx, pw->pw_uid, pp_uids, p_num); } - /* allow winbindd lookups */ - winbind_putenv( winbindd_env ? winbindd_env : "1" ); + /* allow winbindd lookups, but only if they weren't already disabled */ + + if ( !(winbindd_env && strequal(winbindd_env, "1")) ) { + winbind_on(); + } return True; } -- cgit