From a81e3902bce0ee6509290fdc009743c563443446 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 22 Nov 2001 07:32:48 +0000 Subject: Fixed caching of lookupname/lookupsid. Error in check of success ! Jeremy. (This used to be commit d039d4fa507a7284e7e1cada0026c63863fe0a2d) --- source3/nsswitch/winbindd_util.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/source3/nsswitch/winbindd_util.c b/source3/nsswitch/winbindd_util.c index cf7a04e8ff..a40efe7437 100644 --- a/source3/nsswitch/winbindd_util.c +++ b/source3/nsswitch/winbindd_util.c @@ -293,12 +293,15 @@ static BOOL winbindd_lookup_sid_by_name_in_cache(fstring name, DOM_SID *sid, enu if ((domain = find_domain_from_name(domain_str)) == NULL) return False; - if (winbindd_fetch_sid_cache_entry(domain, name, &sid_ret)) + if (!winbindd_fetch_sid_cache_entry(domain, name, &sid_ret)) return False; string_to_sid( sid, sid_ret.sid); *type = (enum SID_NAME_USE)sid_ret.type; + DEBUG(10,("winbindd_lookup_sid_by_name_in_cache: Cache hit for name %s. SID = %s\n", + name, sid_ret.sid )); + return True; } @@ -409,12 +412,15 @@ static BOOL winbindd_lookup_name_by_sid_in_cache(DOM_SID *sid, fstring name, enu sid_to_string(sid_str, sid); - if (winbindd_fetch_name_cache_entry(domain, sid_str, &name_ret)) + if (!winbindd_fetch_name_cache_entry(domain, sid_str, &name_ret)) return False; fstrcpy( name, name_ret.name ); *type = (enum SID_NAME_USE)name_ret.type; + DEBUG(10,("winbindd_lookup_name_by_sid_in_cache: Cache hit for SID = %s, name %s\n", + sid_str, name )); + return True; } -- cgit