Commit 03a91bf0 authored by Christof Schmitt's avatar Christof Schmitt Committed by Karolin Seeger

winbind: Use domain name from lsa query for sid_to_name cache entry

When winbindd is asked to map a name like\name to a SID ,that
is sucessfully resolved through the lsa lookup name call. The same call
also returns the short domain name (netbios name of the domain). Use
that short domain name for the sid_to_name cache entry, so that
subsequent sid_to_name queries return the expected netbiosname\name
result and not\name.

BUG: default avatarChristof Schmitt <>
Reviewed-by: default avatarVolker Lendecke <>
(cherry picked from commit aec9bda2)

Autobuild-User(v4-9-test): Karolin Seeger <>
Autobuild-Date(v4-9-test): Wed May 15 14:18:45 UTC 2019 on sn-devel-144
parent b3876c30
......@@ -346,4 +346,3 @@
# Disabling NTLM means you can't use samr to change the password
^samba3.wbinfo_name_lookup.Verify DOMAIN/USER output\(ad_member\)
......@@ -1792,6 +1792,7 @@ NTSTATUS wb_cache_name_to_sid(struct winbindd_domain *domain,
NTSTATUS status;
bool old_status;
const char *dom_name;
old_status = domain->online;
......@@ -1818,7 +1819,7 @@ NTSTATUS wb_cache_name_to_sid(struct winbindd_domain *domain,
status = domain->backend->name_to_sid(domain, mem_ctx, domain_name,
name, flags, NULL, sid, type);
name, flags, &dom_name, sid, type);
......@@ -1853,7 +1854,7 @@ NTSTATUS wb_cache_name_to_sid(struct winbindd_domain *domain,
(void)strlower_m(discard_const_p(char, name));
wcache_save_sid_to_name(domain, status, sid,
domain_name, name, save_type);
dom_name, name, save_type);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment