Bug 13831 - Inconsistent output from wbinfo --sid-to-name depending on cache state
Summary: Inconsistent output from wbinfo --sid-to-name depending on cache state
Status: RESOLVED FIXED
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Winbind (show other bugs)
Version: 4.10.0rc4
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Karolin Seeger
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-03-11 23:33 UTC by Christof Schmitt
Modified: 2019-05-16 10:02 UTC (History)
2 users (show)

See Also:


Attachments
patches for 4.9 (15.17 KB, patch)
2019-04-18 20:29 UTC, Christof Schmitt
vl: review+
Details
patches for 4.10 (15.32 KB, patch)
2019-04-18 20:29 UTC, Christof Schmitt
vl: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Christof Schmitt 2019-03-11 23:33:52 UTC
wbinfo --sid-to-name returns different outputs, depending on what has
been queried and cached previously:

$ bin/wbinfo --name-to-sid="$REALM/$DC_USERNAME"
S-1-5-21-274866641-1785003985-1147516049-500 SID_USER (1)

$ bin/wbinfo --sid-to-name=S-1-5-21-274866641-1785003985-1147516049-500
ADDOM.SAMBA.EXAMPLE.COM/administrator 1

$ bin/net cache -s $SERVERCONFFILE flush

$ bin/wbinfo --sid-to-name=S-1-5-21-274866641-1785003985-1147516049-500
ADDOMAIN/Administrator 1

Internall, winbindd issues a LSA lookupnames call that takes the
realm.com\username as input (which is valid according to 3.1.4.5
LsarLookupNames4 (Opnum 77)). The lookupnames call also returns domain
information, including the short domain name. The problem here is that
winbindd fills the cache based on the input from wbinfo, instead of
the domain name queried from the domain controller.

Patches to follow.
Comment 2 Christof Schmitt 2019-04-18 20:29:33 UTC
Created attachment 15085 [details]
patches for 4.9
Comment 3 Christof Schmitt 2019-04-18 20:29:50 UTC
Created attachment 15086 [details]
patches for 4.10
Comment 4 Karolin Seeger 2019-05-14 12:41:04 UTC
Pushed to autobuild-v4-{10,9}-test.
Comment 5 Karolin Seeger 2019-05-16 10:02:35 UTC
(In reply to Karolin Seeger from comment #4)
Pushed to both branches.
Closing out bug report.

Thanks!