[Pkg-samba-maint] [Git][samba-team/samba][master] 2 commits: Add DEP8 test for macro expansion in config file

Michael Tokarev (@mjt) gitlab at salsa.debian.org
Wed Jan 21 13:35:58 GMT 2026



Michael Tokarev pushed to branch master at Debian Samba Team / samba


Commits:
6a5ac528 by Andreas Hasenack at 2026-01-07T13:52:38-03:00
Add DEP8 test for macro expansion in config file

Ubuntu hit a bug in this area a couple of times, at which point
this test was added to avoid further regressions.

See https://bugs.launchpad.net/ubuntu/+source/samba/+bug/2120811 for
details.

- - - - -
cba17c82 by Michael Tokarev at 2026-01-21T16:35:56+03:00
Merge branch 'salsa-macro-expansion' into 'master'

Add DEP8 test for macro expansion in config file

See merge request samba-team/samba!70
- - - - -


2 changed files:

- debian/tests/control
- + debian/tests/smbclient-macro-expansion


Changes:

=====================================
debian/tests/control
=====================================
@@ -28,3 +28,7 @@ Restrictions: needs-root, allow-stderr, isolation-container, skippable
 Tests: reinstall-samba-common-bin
 Depends: samba-common, samba-common-bin
 Restrictions: needs-root, needs-reboot, isolation-machine, allow-stderr
+
+Tests: smbclient-macro-expansion
+Depends: samba, smbclient
+Restrictions: needs-root, allow-stderr, isolation-container


=====================================
debian/tests/smbclient-macro-expansion
=====================================
@@ -0,0 +1,49 @@
+#!/bin/sh
+
+set -x
+set -e
+
+. debian/tests/util
+
+username="smbtest$$"
+password="$$"
+storagedir=$(mktemp -d)
+chmod 1777 "${storagedir}"
+testfile="hello.txt"
+echo hello >  "${storagedir}/${testfile}"
+
+cleanup() {
+    set +e
+    if [ -d "${storagedir}" ]; then
+        rm -rf "${storagedir}"
+    fi
+    if [ -f "/etc/samba/${username}.conf" ]; then
+        rm -f "/etc/samba/${username}.conf"
+    fi
+}
+
+trap cleanup EXIT
+
+# prepare a per-user config file snippet
+cat > /etc/samba/"${username}".conf <<EOF
+[global]
+[storage]
+    path = ${storagedir}
+    read only = no
+EOF
+sed -r -i "/^\[global\]$/a config file = \/etc\/samba\/%U.conf" /etc/samba/smb.conf
+systemctl reload smbd
+
+add_user "${username}" "${password}"
+
+echo "Listing //localhost/${testfile} as user ${username}"
+smbclient //localhost/storage -U "${username}"%"${password}" --command "ls ${testfile}"
+
+echo "Listing //localhost/${testfile} as anonymous should fail, because then the share doesn't exist"
+
+result=0
+smbclient //localhost/storage -N --command "ls ${testfile}" || result=$?
+if [ ${result} -eq 0 ]; then
+    echo "FAIL, this should not have worked"
+fi
+



View it on GitLab: https://salsa.debian.org/samba-team/samba/-/compare/eb3f0bd41c55cc1830c35bf8c9fe327510fd808d...cba17c826bd87f0a9776114d723c8c2c5662cacd

-- 
View it on GitLab: https://salsa.debian.org/samba-team/samba/-/compare/eb3f0bd41c55cc1830c35bf8c9fe327510fd808d...cba17c826bd87f0a9776114d723c8c2c5662cacd
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-samba-maint/attachments/20260121/7a7747e7/attachment-0001.htm>


More information about the Pkg-samba-maint mailing list