Bug 14726 - Can't browse successfully scanned shared folder
Summary: Can't browse successfully scanned shared folder
Status: RESOLVED WORKSFORME
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: libsmbclient (show other bugs)
Version: 4.14.4
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Samba QA Contact
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-06-02 20:13 UTC by Danylo Korotil
Modified: 2021-07-21 07:23 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Danylo Korotil 2021-06-02 20:13:26 UTC
Initial bug: https://gitlab.gnome.org/GNOME/gvfs/-/issues/567

Code to reproduces:

smbclient //mydomain.local/public/ -U danylo.korostil
smbclient: Can't load /etc/samba/smb.conf - run testparm to debug it
Enter WORKGROUP\danylo.korostil's password: 
Try "help" to get a list of possible commands.
smb: \> ls
  .                                   D        0  Thu May 28 17:29:24 2020
  ..                                  D        0  Thu May 28 17:29:24 2020
  autotests                          Dr        0  Thu May 28 17:29:24 2020
  Projects                           Dr        0  Wed Mar 11 09:30:58 2020
  Users                              Dr        0  Thu Nov 14 13:13:56 2019

    15728127 blocks of size 4096. 4494102 blocks available
smb: \> cd Users
do_connect: Connection to pro-file-01 failed (Error NT_STATUS_NOT_FOUND)
Unable to follow dfs referral [\pro-file-01\pro-backup]
cd \Users\: NT_STATUS_NOT_FOUND
Comment 1 Jeremy Allison 2021-06-02 21:38:06 UTC
What happens if you do:

dir Users

instead of:

cd Users

?
Comment 2 Danylo Korotil 2021-06-03 09:12:41 UTC
smb: \> dir Users
do_connect: Connection to pro-file-01 failed (Error NT_STATUS_NOT_FOUND)
Unable to follow dfs referral [\pro-file-01\pro-backup]
do_list: [\Users] NT_STATUS_NOT_FOUND

    15728127 blocks of size 4096. 4528995 blocks available
Comment 3 Danylo Korotil 2021-06-11 20:34:51 UTC
Any further logs or actions required to make it clear?
Comment 4 Björn Jacke 2021-06-13 17:31:46 UTC
"mydomain.local" looks like this is a DNS zone name, is this your AD DC realm and you are connecting to that one? If this is an AD DC, can you please try the same of a member file server?
Your smb.conf would be good to see. Also a "ls -l" of the filesystem folder of the "public" share.
You reported this against 4.14.4, did you see the same with previous versions also? Is the server actually samba 4.14.4 or is the client side samba 4.14.4 or both?
Comment 5 Danylo Korotil 2021-06-19 20:15:24 UTC
Yeah, it seems like the AD DC realm. 

Sorry, I didn't get this "please try the same of a member file server". What exactly should I run?

I don't have any smb.conf. I used nautilus/gio to connect to this resource. Please see for more information here: https://gitlab.gnome.org/GNOME/gvfs/-/issues/567

samba --version
Version 4.14.4

I'm using gio (not sure whether they use server/client/both) and haven't tried the other version.
Comment 6 Rowland Penny 2021-06-20 07:07:43 UTC
(In reply to Danylo Korotil from comment #5)
I think what Bjorn is trying to say is that you seem to be trying to connect to a dns domain rather than to a specific computer.

Is 'mydomain,local' a dns domain name ?
If it is a domain name, does 'smbclient //server.mydomain.local/public/ -U danylo.korostil' work ?
Where 'server' is the hostname for the computer that holds the 'public' share.
Comment 7 Danylo Korotil 2021-06-22 17:28:31 UTC
Thanks, Rowland!

Unfortunately, I know too little about this server configuration, honestly. It's a kind of file share or something (I'm not really into it).

However, it works fine from my Windows machine and never asks for the server name or whatever. Can I find out the server name using the Windows machine?
Comment 8 Rowland Penny 2021-06-23 13:14:24 UTC
(In reply to Danylo Korotil from comment #7)

I think you need to find out more about your setup, especially the hostname of the server.

To connect to a share with smbclient, you need to use:

//server/service

Where 'server' can be the NETBios name, or short hostname, or the FQDN, or the ipaddress of the computer that holds the share. 'service' is another name for the share name.

Your 'mydomain.local' looks suspiciously like a dns domain and if it is, it would (from my experience) only work with the sysvol & netlogon shares on a Samba AD DC.

If you type 'hostname -d' into the machine where you are running smbclient, does it return 'mydomain.local' ?
Comment 9 Rowland Penny 2021-07-01 14:10:13 UTC
(In reply to Danylo Korotil from comment #7)

Okay, who thought using 'mydomain' as a HOST name was a good idea ?

Yes 'mydomain.local' is a mdns name and there isn't really a problem, because the command given is trying to follow a DFS link, so this:

smbclient //mydomain.local/public/ -U danylo.korostil

should be this:

smbclient //mydomain.local/public/ -U WORKGROUP_OF_THE COMPUTER_HOLDING__DFS_SHARE\\danylo.korostil

This isn't a Samba problem, it is a misconfiguration.
Comment 10 Danylo Korotil 2021-07-02 21:57:36 UTC
But why does it work without providing server on Windows machines? Is there some technical limitation samba can't overcome? I mean why the experience for regular users should be different? Get me right, it's not something I'm complaining, but I want to get the idea behind "why it doesn't fail on Windows machines out of the box if it looks so wrong". Thanks in advance!
Comment 11 Rowland Penny 2021-07-03 19:20:20 UTC
(In reply to Danylo Korotil from comment #10)

No, I (and Bjorn) was looking at it wrong, 'mydomain.local' is the MDNS name for your computer. The 'mydomain' part is your computers short hostname and the '.local' part is coming from Avahi (or Bonjour if you are using a Mac), so your smbclient command works up to a point, the point being the DFS link. DFS links work by connecting to a share on another machine and your user needs to have permission to connect to the ultimate share, you need to add the workgroup of the computer that holds your DFS share to your smbclient command.

I tried every thing I could, but I couldn't make the command fail, I then realised that I was also dealing with a DFS link (I really read what you posted, both here and on your link). If the correct command is run, it works, you are not using the correct command so it doesn't.

If your computer wasn't using 'mydomain' as its short hostname, this would probably have been realised earlier.

smbclient is working as expected, if it doesn't work from the gnome app, then there is possibly something wrong with that (or it could be misconfigured).
Comment 12 Rowland Penny 2021-07-21 07:23:54 UTC
Closing this, it has been over 14 days since last reply from Danylo and it works for me.