summaryrefslogtreecommitdiffstats
path: root/source/winbindd/winbindd_cache.c
diff options
context:
space:
mode:
authorKarolin Seeger <kseeger@samba.org>2008-06-16 15:21:28 +0200
committerKarolin Seeger <kseeger@samba.org>2008-06-16 15:21:28 +0200
commitb58e4f6b3d73294d8448c0dff4341183c52e5b7c (patch)
treedcfaa57a2f8b7c8404277fb5d511d40a248b91cb /source/winbindd/winbindd_cache.c
parent1f86c7a2a19e66948c9b51572d3c078b6e03ef52 (diff)
downloadsamba-b58e4f6b3d73294d8448c0dff4341183c52e5b7c.tar.gz
samba-b58e4f6b3d73294d8448c0dff4341183c52e5b7c.tar.xz
samba-b58e4f6b3d73294d8448c0dff4341183c52e5b7c.zip
winbind cache: Don't create SN cache entries during name-to-sid queries.
Clients can request name-to-sid queries for different combinations of upper and lower case names. We don't want to create the reverse caching entries for each combination used. This avoids inconsistent answers on sid-to-name queries. Please review! Karolin
Diffstat (limited to 'source/winbindd/winbindd_cache.c')
-rw-r--r--source/winbindd/winbindd_cache.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/source/winbindd/winbindd_cache.c b/source/winbindd/winbindd_cache.c
index 60403717c18..03512b97454 100644
--- a/source/winbindd/winbindd_cache.c
+++ b/source/winbindd/winbindd_cache.c
@@ -1451,13 +1451,13 @@ do_query:
if (domain->online &&
(NT_STATUS_IS_OK(status) || NT_STATUS_EQUAL(status, NT_STATUS_NONE_MAPPED))) {
wcache_save_name_to_sid(domain, status, domain_name, name, sid, *type);
+
+ /* Don't add SN cache entries for sid-to-name queries during this operation.
+ * It leads to inconsistent answers during sid-to-name queries as the
+ * client can ask for different combinations of lower case and upper case
+ * names in these name-to-sid queries.
+ */
- /* Only save the reverse mapping if this was not a UPN */
- if (!strchr(name, '@')) {
- strupper_m(CONST_DISCARD(char *,domain_name));
- strlower_m(CONST_DISCARD(char *,name));
- wcache_save_sid_to_name(domain, status, sid, domain_name, name, *type);
- }
}
return status;