smbd 4.1.0rc2 (and 4.0.7 I've tested) ignores %$(ENVVAR) in a value of the following smb.conf(5) parameters: private dir lock directory state directory cache directory pid directory ncalrpc dir Sample smb.conf (I'm using this hack in https://github.com/fumiyas/ruby-net-smb/blob/master/test/etc/smb.conf): [global] private dir = %$(A) lock directory = %$(B) state directory = %$(C) cache directory = %$(D) pid directory = %$(E) ncalrpc dir = %$(F) To reproduce: # A=/tmp/test \ B=/tmp/test \ C=/tmp/test \ D=/tmp/test \ E=/tmp/test \ F=/tmp/test \ G=/tmp/test \ /usr/local/samba-4.1.0rc2/sbin/smbd -FDS -s /tmp/test/smb.conf smbd version 4.1.0rc2 started. Copyright Andrew Tridgell and the Samba Team 1992-2013 Failed to open %$(A)/secrets.tdb Failed to open %$(A)/secrets.tdb ERROR: smbd can not open secrets.tdb # ls -F /tmp/test %$(B)/ %$(E)/ smb.conf # mkdir '/tmp/test/%$(A)' # A=/tmp/test \ B=/tmp/test \ C=/tmp/test \ D=/tmp/test \ E=/tmp/test \ F=/tmp/test \ G=/tmp/test \ /usr/local/samba-4.1.0rc2/sbin/smbd -FDS -s /tmp/test/smb.conf smbd version 4.1.0rc2 started. Copyright Andrew Tridgell and the Samba Team 1992-2013 ^C # ls -F /tmp/test %$(A)/ %$(B)/ %$(C)/ %$(D)/ %$(E)/ %$(F)/ smb.conf No problems with smbd 3.6.16 and older.
There are smbd command-line options for "private dir" and other smb.conf parameters (e.g. --private-dir=DIR), but not for "ncalrpc dir" parameter,
Correct. % substitutions are no longer supported in many parameters as they generally don't make sense to change during execution. See the changes leading up to 5a8218b147ac62c065903591a15360a906da9bec Sorry,