%i token does not expand on 4.13.14+dfsg-0ubuntu0.20.04.2
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
samba (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
%i should expand to the IP address that a smb client is connecting to. We use this to dynamically include share definitions on servers which have multiple IP addresses, via a global 'include' config line of the form:
include = /path/to/configs/%i
This worked fine on 4.13.14+
To confirm the behaviour, I have set up a test samba instance with a static 'include' (where I hard-code the server IP address rather than using the %i token) and added a 'root preexec' script in the share definition which has %i passed:
root preexec = /data/config/
and where preexec.sh is simply "echo $@ >> /tmp/debug.log". On 4.13.14+
For comparison, I've built samba-4.13.14 from https:/
My test smb.conf is simply the one provided by the Ubuntu packages, aside from the 'include' and the share definition:
== /etc/samba/smb.conf ==
[global]
workgroup = WORKGROUP
server string = %h server (Samba, Ubuntu)
log file = /var/log/
max log size = 1000
logging = file
panic action = /usr/share/
server role = standalone server
obey pam restrictions = yes
unix password sync = yes
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\
pam password change = yes
map to guest = bad user
usershare allow guests = yes
include = /data/config/
== /data/config/
[alt36]
path = /data/alt36
writeable = yes
browseable = yes
guest ok = yes
root preexec = /data/config/
In case it helps to reproduce the problem, or if its useful to anyone else affected by this, we downgraded (and have also pinned) the following packages:
apt-get install samba=2: 4.13.14+ dfsg-0ubuntu0. 20.04.1 samba-common= 2:4.13. 14+dfsg- 0ubuntu0. 20.04.1 samba-common- bin=2:4. 13.14+dfsg- 0ubuntu0. 20.04.1 libwbclient0= 2:4.13. 14+dfsg- 0ubuntu0. 20.04.1 samba-libs= 2:4.13. 14+dfsg- 0ubuntu0. 20.04.1 python3- samba=2: 4.13.14+ dfsg-0ubuntu0. 20.04.1 libsmbclient= 2:4.13. 14+dfsg- 0ubuntu0. 20.04.1 samba-dsdb- modules= 2:4.13. 14+dfsg- 0ubuntu0. 20.04.1 samba-vfs- modules= 2:4.13. 14+dfsg- 0ubuntu0. 20.04.1 winbind= 2:4.13. 14+dfsg- 0ubuntu0. 20.04.1