[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#900629: debian-edu-install: breaks installation of samba



On Wed, Jun 06, 2018 at 12:02:47AM +0000, Mike Gabriel wrote:
> On  Di 05 Jun 2018 19:03:59 CEST, Holger Levsen wrote:
> > On Tue, Jun 05, 2018 at 01:06:52PM +0200, Wolfgang Schweer wrote:
> > > > netbios name PROFITBRICKS-BUILD10-AMD64 is not a valid netbios name
> > > > ERROR: Invalid smb.conf
> > > > dpkg: error processing package samba-common-bin (--configure):
> > > >  installed samba-common-bin package post-installation script subprocess
> > > >  returned error exit status 255
> > > IMO this bug should/could be fixed in jenkins.d.n by setting a valid
> > > netbios name via $(hostname).
> > 
> > no.
> > 
> > installation must not fail just because the hostname is
> > profitbricks-build-amd64 or whatever.
> 
> IMHO, this is a samba bug...

Depends on the POV, I guess:

Seen from Samba, the long hostname is an issue.
Seen from Jenkins, Samba should do better.

In the comparable samba/debci case, debci has a pending fix (netbios 
compliant hostname). The issue has been discussed at some length, see:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=898875 
 
> > > For Debian Edu the netbios name is set to TJENER, but at the moment
> > > samba-common-bin gets installed, the vanilla smb.conf is tested (plus
> > > preseeded values w/ netbios name not preseedable), replaced with the
> > > Debian Edu one later (via Cfengine). So there's nothing Debian Edu can
> > > do to fix this bug (afaict).
> > 
> > we can shorten the netbios name if using the hostname for the netbios
> > name is problematic because its too long.
> > 
> > > Please check the attached patch.
> > 

> > NACK, see above :)
> 
> I agree, but the fix needs to be in Samba.
 
Might be better, yes. Maybe the Samba maintainers would accept something 
like this:

--- 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
+else
+    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
+fi
 echo "Done"
 
 
+#DEBHELPER#
--------------------------------------------------------------

It would only warn instead of erroring out in case of too long 
hostnames. I figure this being enough to fix #816301, starting point for 
all this, see:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=816301
and
https://salsa.debian.org/samba-team/samba/blob/648ea6aa3c191c20d67cb765abfee6e8993e394b/debian/samba-common-bin.postinst

Wolfgang

Attachment: signature.asc
Description: PGP signature


Reply to: