In our configuration we provide specific shares based on IP, username or primary group. This is achieved by using substitutions with the following lines in smb.conf: include = /path/to/smb.conf.%U include = /path/to/smb.conf.%G include = /path/to/smb.conf.%I If a user "testuser" with primary group "testgroup" is connecting from "192.168.1.2" this would change dynamically to include = /path/to/smb.conf.testuser include = /path/to/smb.conf.testgroup include = /path/to/smb.conf.192.168.1.2 Actually only one (/path/to/smb.conf.testgroup) of the named three files exists an contains a share definition: [testshare] comment = Share for testing path = /testshare read only = yes public = no valid users = +testgroup This was working fine in previous versions (up to 4.13.17). Connecting to the server using a Windows 7 or 10 machine there is one share "testshare" that is visible as share and also accessible. Connecting using "smbclient -Utestuser -Lsambahost" resulted with correct share list: Sharename Type Comment --------- ---- ------- IPC$ IPC IPC Service testshare Disk Share for testing Also "net share -Utestuser" gave correct results: IPC$ testshare After upgrading from 4.13.17 to 4.16.7 without any configuration change our results are different. Connecting using a Windows 7 or 10 machine there is no share visible - Explorer just says "This folder is empty". But I can successfully connect to the share directly using \\sambahost\testshare\ - as long as I know the share name. Connecting using "smbclient -Utestuser -Lsambahost" only shows: Sharename Type Comment --------- ---- ------- IPC$ IPC IPC Service Connecting using "smbclient -Utestuser \\\\sambahost\\testshare\\" works without problems. Also "net share -Utestuser" shows only IPC$ So it seems that substitution and parsing the resulting configuration file is working correctly, but somehow browsing for shares defined in such a way is broken as those are simply not showing up. If I change the configuration from include = /path/to/smb.conf.%G to include = /path/to/smb.conf.testgroup the share is visible in Windows and using "net share" or "smbclient -L". One strange thing to mention: If I use "net share" in combination with "-mCORE", "-mCOREPLUS", "-mLANMAN1" or "-mLANMAN2" I get correct results every time but as soon as I use "-mNT1" or any higher protocol the share is not displayed. Any ideas?
I'm also dealing with the same problem
Just to let you know: This issue happens because in Samba 4.16 the RPC services were taken out of smbd, the share listing is now done by a separate daemon. Unfortunately our internal configuration loading with all the macros is very difficult to replicate in this separate daemon. It will take days of work to get this straight again.
thanks Volker for your comment. does this mean that this issue will not fixed? do you think that "access based share enum" setting could and should be used instead?
(In reply to Arnaud FLORENT from comment #3) > does this mean that this issue will not fixed? Well, someone needs to fix it. Right now it is not my personal priority. If it is someone else's priority, I'm happy to give guidance how to fix it. > do you think that "access based share enum" setting could and should be used > instead? Good question, haven't tried that. But I could imagine that this would work.
looks like this issue should be fixed according to https://bugzilla.samba.org/show_bug.cgi?id=15243 but it still happens for me running 4.16.8-Ubuntu (from www.corpit.ru/mjt repo)
(In reply to Arnaud FLORENT from comment #5) I guess it's fixed with 4.16.9, see https://bugzilla.samba.org/show_bug.cgi?id=15243#c14 Please reopen if it's still a problem *** This bug has been marked as a duplicate of bug 15243 ***
yes it works now on samba 4.16.10+dfsg-1 (from www.corpit.ru/mjt repo) on ubuntu 20.04.1 LTS thanks a lot
Still not resolved here. Behavior completely unchanged. substitution is working correctly files all loaded and parsed correctly shares accessible but not visible. I wonder if there is some other codepath as I run with -d10 here and I don't see any log output from source3/rpc_server/srvsvc/srv_srvsvc_nt.c As of the code there should be some output from init_srv_share_info_ctr() e.g. DEBUG(5,("init_srv_share_info_ctr\n")); or DEBUG(10, ("counting service %s\n", .... or DEBUG(10, ("NOT counting service %s\n", .... but I can't find anything.