Skip to content
Commits on Source (7)
samba (2:4.7.4+dfsg-1.1) unstable; urgency=medium
* Non-maintainer upload.
* Add extra DEP8 tests to samba (Closes: #890439):
- d/t/control, d/t/cifs-share-access: access a file in a share using cifs
- d/t/control, d/t/smbclient-anonymous-share-list: list available shares
anonymously
- d/t/control, d/t/smbclient-authenticated-share-list: list available
shares using an authenticated connection
- d/t/control, d/t/smbclient-share-access: create a share and download a
file from it
-- Andreas Hasenack <andreas@canonical.com> Wed, 14 Feb 2018 17:46:13 -0200
samba (2:4.7.4+dfsg-1) unstable; urgency=medium
* New upstream version
......
#!/bin/sh -x
if ! testparm -s 2>&1 | grep -qE "^\[homes\]"; then
echo "Adding [homes] share"
cat >> /etc/samba/smb.conf <<EOFEOF
[homes]
valid users = %S
read only = no
guest ok = no
EOFEOF
systemctl reload smbd.service
else
echo "No need to add [homes] share, continuing."
fi
username="smbtest$$"
password="$$"
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
echo "Mounting //localhost/${username} via CIFS"
temp_mount=$(mktemp -d)
mount -t cifs //localhost/${username} "$temp_mount" -o user=${username},username=${username},password=${password}
echo "Verifying MD5 via cifs"
cd "$temp_mount"
md5sum -c data.md5
result=$?
cd -
umount "$temp_mount"
rmdir "$temp_mount"
exit "$result"
Tests: cifs-share-access
Depends: samba, coreutils, systemd, cifs-utils, passwd
Restrictions: needs-root, allow-stderr, isolation-machine
Tests: python-smoke
Depends: python-samba
Tests: smbclient-anonymous-share-list
Depends: samba, smbclient
Restrictions: allow-stderr, isolation-container
Tests: smbclient-authenticated-share-list
Depends: samba, smbclient, passwd
Restrictions: needs-root, allow-stderr, isolation-container
Tests: smbclient-share-access
Depends: samba, smbclient, coreutils, systemd, passwd
Restrictions: needs-root, allow-stderr, isolation-container
#!/bin/sh -x
smbclient -N -L localhost
#!/bin/sh -x
username="smbtest$$"
password="$$"
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}
echo "Testing with incorrect password: must fail"
smbclient -L localhost -U ${username}%wrongpass && exit 1
echo "Testing with correct password: must work"
smbclient -L localhost -U ${username}%${password}
#!/bin/sh -x
if ! testparm -s 2>&1 | grep -qE "^\[homes\]"; then
echo "Adding [homes] share"
cat >> /etc/samba/smb.conf <<EOFEOF
[homes]
valid users = %S
read only = no
guest ok = no
EOFEOF
systemctl reload smbd.service
else
echo "No need to add [homes] share, continuing."
fi
username="smbtest$$"
password="$$"
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