PROBLEM: - starting with smbclient 4.6.0rc1, smbclient won't populate the browse list unless server has "domain logons = yes" (or maybe equivalent) - smbclient up to 4.5.14 can always get another samba's ("standalone server") browse list (as in "source3/client/client.c/list_servers()") - since old smbclient versions work, I think this is an smbclient problem (not server) DETAILS: - client and server are RHEL5 - server has samba 3.x or 4.7.0 (doesn't matter) - smb.conf of server at the end of this post - smbclient tested: 3.x, 4.5.14, 4.6.0.rc1 4.6.8 4.7.0 - flipping "domain logons" yes/no on the server, w/o restarting the server, will cause smbclient >= 4.6.0rc1 to display/not-display the server browse list. - with smbclient <= 4.5.14 the browse list is always displayed, regardless of "domain logons" on server - i see some changes in source3/client/client.c in 4.6.0rc1 (cli_session_setup -> cli_session_setup_creds) SAMPLE OUTPUT (4.7.0 server w/o domain logons): ==== smbclient 4.5.14 =================================== ./samba-4.5.14/bin/smbclient -s /dev/null -g -mNT1 -L 192.168.1.4 -Uuser2%user2 Domain=[TEST-WG] OS=[Windows 6.1] Server=[Samba 4.7.0] Domain=[TEST-WG] OS=[Windows 6.1] Server=[Samba 4.7.0] Disk|tmp| IPC|IPC$|IPC Service (Samba 4.7.0) Server|TEST-SAMBA|Samba 4.7.0 <=== WORKS Workgroup|TEST-WG|TEST-SAMBA ==== smbclient 4.6.0.rc1 ================================== ./samba-4.6.0rc1/bin/smbclient -s /dev/null -g -mNT1 -L 192.168.1.4 -Uuser2%user2 Domain=[TEST-SAMBA] OS=[] Server=[] Domain=[TEST-SAMBA] OS=[] Server=[] Disk|tmp| IPC|IPC$|IPC Service (Samba 4.7.0) Workgroup|TEST-WG|TEST-SAMBA <=== BROWSE LIST MISSING ==== smbclient 4.7.0 ===================================== ./samba-4.7.0/bin/smbclient -s /dev/null -g -mNT1 -L 192.168.1.4 -Uuser2%user2 Disk|tmp| IPC|IPC$|IPC Service (Samba 4.7.0) Reconnecting with SMB1 for workgroup listing. Workgroup|TEST-WG|TEST-SAMBA <=== BROWSE LIST MISSING ============================== SAMPLE OUTPUT (4.7.0 server with "domain logons = yes"): ==== smbclient 4.5.14 =============================== ./samba-4.5.14/bin/smbclient -s /dev/null -g -mNT1 -L 192.168.1.4 -Uuser2%user2 Domain=[TEST-WG] OS=[Windows 6.1] Server=[Samba 4.7.0] Domain=[TEST-WG] OS=[Windows 6.1] Server=[Samba 4.7.0] Disk|tmp| IPC|IPC$|IPC Service (Samba 4.7.0) Server|TEST-SAMBA|Samba 4.7.0 <=== WORKS AS BEFORE Workgroup|TEST-WG|TEST-SAMBA ==== smbclient 4.6.0.rc1 ================================= ./samba-4.6.0rc1/bin/smbclient -s /dev/null -g -mNT1 -L 192.168.1.4 -Uuser2%user2 Domain=[TEST-WG] OS=[] Server=[] Domain=[TEST-WG] OS=[] Server=[] Disk|tmp| IPC|IPC$|IPC Service (Samba 4.7.0) Server|TEST-SAMBA|Samba 4.7.0 <=== NOW IT WORKS Workgroup|TEST-WG|TEST-SAMBA ==== smbclient 4.7.0 ==================================== ./samba-4.7.0/bin/smbclient -s /dev/null -g -mNT1 -L 192.168.1.4 -Uuser2%user2 Disk|tmp| IPC|IPC$|IPC Service (Samba 4.7.0) Reconnecting with SMB1 for workgroup listing. Server|TEST-SAMBA|Samba 4.7.0 <=== NOW IT WORKS Workgroup|TEST-WG|TEST-SAMBA This is the smb.conf on the server: [global] workgroup = TEST-WG netbios name = TEST-SAMBA passdb backend = smbpasswd smb passwd file = /etc/samba/smbpasswd load printers = no ;domain logons = yes (switched yes/no for tests) preferred master = yes os level = 30 null passwords = yes server string = Samba %v encrypt passwords = yes security = user map to guest = bad user guest account = ftp [tmp] path = /tmp guest ok = yes writeable = yes
The problem goes away if using the patch "[PATCH] libcli/smb: Parse primary domain from session setup" http://lists.samba.org/pipermail/samba-technical/attachments/20171023/73f7219d/0001-libcli-smb-Parse-primary-domain-from-session-setup.bin from https://lists.samba.org/archive/samba-technical/2017-October/123501.html