Merge ~ahasenack/ubuntu/+source/samba:jammy-samba-dep8-fix-1955851 into ubuntu/+source/samba:ubuntu/devel

Proposed by Andreas Hasenack
Status: Merged
Merged at revision: 9f985261f48fe44fc107979bb09ca89238b012fa
Proposed branch: ~ahasenack/ubuntu/+source/samba:jammy-samba-dep8-fix-1955851
Merge into: ubuntu/+source/samba:ubuntu/devel
Diff against target: 28 lines (+8/-1)
2 files modified
debian/changelog (+7/-0)
debian/tests/util (+1/-1)
Reviewer Review Type Date Requested Status
Bryce Harrington (community) Approve
Canonical Server Pending
Review via email: mp+414508@code.launchpad.net

Description of the change

This applies to samba the same fix that was used in the latest autofs upload. I tried a bileto ticket for this (well, two actually), but bileto seems broken and the test never starts.
I haven't seen samba fail this test even with the bug, and I cannot explain it.

I ran it locally, and it passed:
$ tail ../dep8/log
autopkgtest [10:38:20]: test smbclient-share-access-uring: - - - - - - - - - - results - - - - - - - - - -
smbclient-share-access-uring PASS
autopkgtest [10:38:20]: @@@@@@@@@@@@@@@@@@@@ summary
cifs-share-access PASS
cifs-share-access-uring PASS
python-smoke PASS
smbclient-anonymous-share-list PASS
smbclient-authenticated-share-list PASS
smbclient-share-access PASS
smbclient-share-access-uring PASS

More specifically, around the smbpasswd calls. We are interested in seeing "Added user smbtestXXXX":
$ grep -A 3 smbpasswd ../dep8/log
+ smbpasswd -s -a smbtest2231
+ echo 2231
+ echo 2231
Added user smbtest2231.
--
+ + echosmbpasswd 2854 -s
+ -a smbtest2854
echo 2854
Added user smbtest2854.
--
+ + smbpasswdecho -s 3987 -a smbtest3987
+
echo 3987
Added user smbtest3987.
--
+ smbpasswd+ -s -a smbtest4268
echo 4268
+ echo 4268
Added user smbtest4268.
--
+ + smbpasswdecho -s -a 4584 smbtest4584
+
echo 4584
Added user smbtest4584.

To post a comment you must log in.
Revision history for this message
Bryce Harrington (bryce) wrote :

Yep, looks good.

An alternate solution could be

   printf "${password}\n${password}\n"

however no particular benefit to that over the double echo.

Btw minor misspelling 'seetting' in commit message and changelog.
Otherwise, LGTM, +1

review: Approve
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

I found out why the current dep8 test works: it's /bin/sh vs /bin/bash

In /bin/sh, the internal echo command by default supports \n. Still, I think the proposed solution is less surprising. And I did test echo -n with the \n, and got mixed results.

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Uploaded.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index 67319b0..7bb6dc6 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,10 @@
6+samba (2:4.13.14+dfsg-0ubuntu4) jammy; urgency=medium
7+
8+ * d/t/util: fix setting the password of the smb test user
9+ (LP: #1955851)
10+
11+ -- Andreas Hasenack <andreas@canonical.com> Thu, 20 Jan 2022 17:06:13 -0300
12+
13 samba (2:4.13.14+dfsg-0ubuntu3) jammy; urgency=medium
14
15 * No-change rebuild with Python 3.10 as default version
16diff --git a/debian/tests/util b/debian/tests/util
17index 47d58b9..87a2ccd 100644
18--- a/debian/tests/util
19+++ b/debian/tests/util
20@@ -31,7 +31,7 @@ add_user() {
21 echo "Creating a local and samba user called ${username}"
22 useradd -m "${username}"
23 echo "Setting samba password for the ${username} user"
24- echo "${password}\n${password}" | smbpasswd -s -a ${username}
25+ (echo "${password}"; echo "${password}") | smbpasswd -s -a ${username}
26 }
27
28 # $1: share name

Subscribers

People subscribed via source and target branches