[Samba] %S Macro seems broken in default service

Ty! Boyack Ty.Boyack at colostate.edu
Fri Jun 7 14:37:56 MDT 2013

I am having trouble with the %S Macro being expanded to an unexpected 
value.  We have a section of disk where each directory under that 
directory is to be it's own share.  This looks like:

Rather than listing each share uniquely in the smb.conf, we put this in 
the global section:

default service = export
along with all of our defaults and settings.  Then we have the "export" 
service the "default service" refers to:

    path = /export/%S
    writeable = yes
    browseable = no

On previous samba versions (3.4.7 is one that I checked), it works fine. 
  Now on 4.0.5 and 4.0.6 on Fedora 18, it no longer works.

Before -- if a user asked for \\server\share1, %S would be set to 
"share1" and Samba would look for /export/share1.  Now, it appears that 
%S contains "export" since the logs give errors that it cannot find the 
path /export/export.  It's almost like the requested service is being 
changed to "export" (like you would want default service to do), but the 
name that the user supplied is also being overwritten, so that I can't 
see what share the user wanted.

Does anyone know if this is intentional, or a bug?  I don't see any 
references to others having the problem, so I'm wondering if I've missed 
something in the transition to 4.0 that needs to be done.

Note that IF I list each share in the smb.conf file as
   path = /export/share1
   writeable = yes
   browsable = no

then everything works fine, so I think it's just the macro expansion 
that is giving me fits.

Thanks for any help,


   Ty Boyack
   NREL Senior IT Engineer
   Ty.Boyack at colostate.edu
   (970) 491-1186

More information about the samba mailing list