diff options
author | Jeremy Allison <jra@samba.org> | 2008-08-26 18:05:34 -0700 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2008-08-26 18:05:34 -0700 |
commit | dc3f6b0861f83070b32a718d337fc755f5b18fee (patch) | |
tree | ad68d6037ed161c063c65088bd22c66bc6b11ee5 | |
parent | d1f140a9bac72205823b791aeb26bc28b9916ef6 (diff) | |
download | samba-dc3f6b0861f83070b32a718d337fc755f5b18fee.tar.gz samba-dc3f6b0861f83070b32a718d337fc755f5b18fee.tar.bz2 samba-dc3f6b0861f83070b32a718d337fc755f5b18fee.zip |
Fix bug spotted by Simo - don't use legacy if expired entry.
Jeremy.
(This used to be commit a7bbd33139c5835cf32efdbe0ef187117699e3e4)
-rw-r--r-- | source3/passdb/lookup_sid.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source3/passdb/lookup_sid.c b/source3/passdb/lookup_sid.c index a5e3362882..3861c8e229 100644 --- a/source3/passdb/lookup_sid.c +++ b/source3/passdb/lookup_sid.c @@ -1296,7 +1296,7 @@ void uid_to_sid(DOM_SID *psid, uid_t uid) /* Check the winbindd cache directly. */ ret = idmap_cache_find_uid2sid(uid, psid, &expired); - if (ret && is_null_sid(psid)) { + if (ret && !expired && is_null_sid(psid)) { /* * Negative cache entry, we already asked. * do legacy. @@ -1342,7 +1342,7 @@ void gid_to_sid(DOM_SID *psid, gid_t gid) /* Check the winbindd cache directly. */ ret = idmap_cache_find_gid2sid(gid, psid, &expired); - if (ret && is_null_sid(psid)) { + if (ret && !expired && is_null_sid(psid)) { /* * Negative cache entry, we already asked. * do legacy. @@ -1405,7 +1405,7 @@ bool sid_to_uid(const DOM_SID *psid, uid_t *puid) /* Check the winbindd cache directly. */ ret = idmap_cache_find_sid2uid(psid, puid, &expired); - if (ret && (*puid == (uid_t)-1)) { + if (ret && !expired && (*puid == (uid_t)-1)) { /* * Negative cache entry, we already asked. * do legacy. @@ -1469,7 +1469,7 @@ bool sid_to_gid(const DOM_SID *psid, gid_t *pgid) /* Check the winbindd cache directly. */ ret = idmap_cache_find_sid2gid(psid, pgid, &expired); - if (ret && (*pgid == (gid_t)-1)) { + if (ret && !expired && (*pgid == (gid_t)-1)) { /* * Negative cache entry, we already asked. * do legacy. |