This bug appears to be present all the way up to current master. With a two node DFS replication environment configured, I've noticed that libsmbclient uses the smbc_init->smbc_get_auth_data_fn() provided workgroup/domain in the initial connection, but then switches to the default smb.conf workgroup/domain when handling the the DFS referral. It should instead continue to use the smbc_init->smbc_get_auth_data_fn() value. Patch to follow...
I used the test code in bug 10123 to reproduce this bug, alongside a two node replicated Windows DFS server environment.
Created attachment 10626 [details] proposed fix, sent to samba-technical list
Comment on attachment 10626 [details] proposed fix, sent to samba-technical list LGTM. David, do you want to get this and the other DFS fix into 4.0.x and above as well ?
(In reply to Jeremy Allison from comment #4) Thanks for the review! Yes, I'd like to get both 10123 and 11059 fixes into the maintenance branches. I'll back port and attach patches for each.
Created attachment 10631 [details] extra change needed for encrypted sessions
David - should the 'extra change needed for encrypted sessions' change be in master too ?
(In reply to Jeremy Allison from comment #7) Yes please Jeremy. Once both are there I'll add the maintenance branch patches.
Comment on attachment 10631 [details] extra change needed for encrypted sessions LGTM - pushed to master.
Created attachment 10642 [details] patchset for v4-2-test branch, slightly differs from master (extra cli_init_creds() call)
Created attachment 10643 [details] patchset for v4-1-test branch, slightly differs from master (extra cli_init_creds() call)
Created attachment 10644 [details] patchset for v4-0-test branch, slightly differs from master (extra cli_init_creds() call)
Created attachment 10645 [details] patchset for v3-6-stable branch, for those playing along at home
Reassigning to Karolin for inclusion in 4.0.next, 4.1.next, 4.2.0.
Pushed to autobuild-v4-[0|1|2]-test.
Pushed to all branches. Closing out bug report. Thanks!