[Pkg-samba-maint] Bug#1069867: autopkgtest to test %U substitution in included config files

Santiago Ruano Rincón santiagorr at riseup.net
Fri Apr 26 02:51:57 BST 2024


Source: samba
Severity: wishlist
Tags: patch

Dear samba maintainers,

Please, find attached an autopkgtest that checks if %U variable
substitution in include config files works correctly.

I have include it and verified it works in the recent buster update
https://tracker.debian.org/news/1520926/accepted-samba-2495dfsg-5deb10u5-source-into-oldoldstable/
to confirm it didn't introduce regressions like the one described at:
https://bugs.launchpad.net/ubuntu/+source/samba/+bug/2003867

Cheers,

  -- Santiago
-------------- next part --------------
#!/bin/sh -x
#
# Test to check regressions such as:
# https://bugs.launchpad.net/ubuntu/+source/samba/+bug/2003867

username="smbtest$$"
password="$$"

cat >> /etc/samba/smb.conf <<EOFEOF
include = /etc/samba/%U.conf
EOFEOF

cat >> /etc/samba/${username}.conf <<EOFEOF
[smbtest]
    browseable = yes
    writeable = yes
    guest ok = no
    path =  /home/%U/
EOFEOF

systemctl reload smbd.service

echo "Creating a local test user called ${username}"
useradd -m "$username"
echo "Setting samba password for the ${username} user"
echo "${password}\n${password}" | smbpasswd -s -a ${username}
userhome=$(eval echo ~$username)
echo "Creating file with random data and computing its md5"
dd if=/dev/urandom bs=1 count=128 2>/dev/null | base64 > ${userhome}/data
chown ${username}:${username} ${userhome}/data
cd ${userhome}
md5sum data > data.md5

rm -f downloaded-data
echo "Downloading file and comparing its md5"
smbclient //localhost/${username} -U ${username}%${password} -c "get data downloaded-data"

mv -f downloaded-data data
md5sum -c data.md5
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-samba-maint/attachments/20240425/6390aa40/attachment.sig>


More information about the Pkg-samba-maint mailing list