[Pkg-samba-maint] Bug#900908: Bug#900908: Bug#900908: Missing bug URLs
L.P.H. van Belle
belle at bazuin.nl
Thu Jun 7 11:22:24 BST 2018
If i may say, just saw the posts,
The netbios name in 15 characters and uppercase.
This makes it more consistant when you join networks, it prevents problems.
I was thinking of the following.
When we are packaging, set a pre-defined hostname in smb.conf
netbios name = PRE-HOSTNAME
sed -i '/global/a \ \ \ netbios name = PRE-HOSTNAME' smb.conf
In samba-common-bin.postinst
This part, thank you Wolfgang, but now add this at the beginning for the script.
+if [ $(hostname|wc -m) -le 15 ] ; then
+ echo "Removing PRE-HOSTNAME after netbios hostname check from smb.conf"
+ sed '/netbios name = PRE-HOSTNAME/d'
+ # test for a correct smb.conf
+ samba-tool testparm -d1 --suppress-prompt > /dev/null
+else
+ echo "WARNING: The hostname is too long or invalid to serve as netbios name."
+ echo "Please set a valid netbios name, see man (5) smb.conf for details."
+ echo "When done run : dpkg-reconfigure -a, and continue the install."
+ exit 1
+fi
echo "Done"
At least, the change and check, should be done before samba/winbind is started.
This prevents possible caching problem and other (possible) tdb/ldb file problems.
Last, if we want to do this right, then we should check for the full mounty :
https://support.microsoft.com/nl-nl/help/909264/naming-conventions-in-active-directory-for-computers-domains-sites-and
Important one NetBIOS computer names: Check for Allowed characters and Disallowed characters.
Uppercase to keep things more clear.
And as you see in the link, there is more we can check to make sure the netbiosname and dns names wont confict.
Just sharing some of my ideas for this one.
Best regards,
Louis
> -----Oorspronkelijk bericht-----
> Van: Pkg-samba-maint
> [mailto:pkg-samba-maint-bounces+belle=bazuin.nl at alioth-lists.d
> ebian.net] Namens Mathieu Parent
> Verzonden: donderdag 7 juni 2018 11:19
> Aan: w.schweer at gmx.de
> CC: 900908 at bugs.debian.org
> Onderwerp: [Pkg-samba-maint] Bug#900908: Bug#900908: Missing bug URLs
>
> Le jeu. 7 juin 2018 à 11:08, Wolfgang Schweer
> <w.schweer at gmx.de> a écrit :
> >
> > On Thu, Jun 07, 2018 at 10:53:55AM +0200, Mathieu Parent wrote:
> > > I still think that failing the installation is correct (the admin
> > > should change the hostname before install or provide a
> smb.conf with
> > > "netbios name" properly set).
> >
> > Tried this as well: Providing smb.conf with valid netbios
> name _before_
> > installing samba-common-bin triggers a debconf prompt... So this
> > possibility doesn't allow automatic installations (like
> used with Debian
> > Edu);
>
> The prompt can be preseeded (with debconf-set-selections).
>
> > 'netbios name' isn't preseedable, too. Please correct me if I'm
> > wrong.
>
> Confirmed. This is probably where the fix should go (but it's hard,
> because this needs some more sed magic touching smb.conf).
>
> Regards
> --
> Mathieu Parent
>
> _______________________________________________
> Pkg-samba-maint mailing list
> Pkg-samba-maint at alioth-lists.debian.net
> https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/pkg-s
> amba-maint
>
More information about the Pkg-samba-maint
mailing list