Bug 10085 - private dir = %$(ENVVAR) in smb.conf is not expanded
Summary: private dir = %$(ENVVAR) in smb.conf is not expanded
Status: RESOLVED WONTFIX
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: File services (show other bugs)
Version: 4.1.0rc2
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Samba QA Contact
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-14 09:56 UTC by SATOH Fumiyasu
Modified: 2017-01-03 09:17 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description SATOH Fumiyasu 2013-08-14 09:56:32 UTC
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.
Comment 1 SATOH Fumiyasu 2013-08-14 10:24:19 UTC
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,
Comment 2 Andrew Bartlett 2017-01-03 09:11:17 UTC
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,