[Pkg-samba-maint] Bug#900908: samba-common-bin: Please consider a more subtle smb.conf test

Wolfgang Schweer wschweer at arcor.de
Wed Jun 6 16:35:20 BST 2018

Package: samba-common-bin
Version: 2:4.8.2+dfsg-1
Severity: wishlist

User:     debian-edu at lists.debian.org
Usertags: debian-edu

Dear Maintainer,

just for testing, I installed samba-common-bin on a machine running buster/sid
with a (temporary) hostname of length 20.

The installation ended with an error (like expected).

IMO it would be nice to only issue a warning for this special case, esp. to
make automatic testing easier; see the well-known debci┬╣, but also the jenkins┬▓
issue. I have absolutely no clue how the Debian Edu jenkins issue could be
solved if the long name persists. Other test environments with too long
hostnames might also exist out in the wild.

After rebuilding the package with the below change, the package gets installed,
the WARNING is reported. I figure this might be enough information for an admin.

--- a/samba-common-bin.postinst 2018-06-06 14:13:40.612764675 +0200
+++ b/samba-common-bin.postinst 2018-06-06 14:28:30.645949184 +0200
@@ -3,7 +3,14 @@
 set -e

 echo "Checking smb.conf"
-samba-tool testparm -d1 --suppress-prompt > /dev/null
+if [ $(hostname|wc -m) -le 15 ] ; then
+    samba-tool testparm -d1 --suppress-prompt > /dev/null
+    echo "WARNING: The hostname is too long to serve as netbios name."
+    echo "Please set a valid netbios name, see man (5) smb.conf for details."
+    testparm -d1 -s --option='netbios name = test' > /dev/null
 echo "Done"


Thanks for your work on Samba,

More information about the Pkg-samba-maint mailing list