Bug 10085 - private dir = %$(ENVVAR) in smb.conf is not expanded
private dir = %$(ENVVAR) in smb.conf is not expanded
Status: NEW
Product: Samba 4.1 and newer
Classification: Unclassified
Component: File services
4.1.0rc2
All All
: P5 normal
: ---
Assigned To: Samba QA Contact
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-08-14 09:56 UTC by SATOH Fumiyasu
Modified: 2013-08-14 10:24 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 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,