Bug#900908: [Pkg-samba-maint] Bug#900908: Bug#900908: Missing bug URLs

2018-06-07 Thread L . P . H . van Belle
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@alioth-lists.d
> ebian.net] Namens Mathieu Parent
> Verzonden: donderdag 7 juni 2018 11:19
> Aan: w.schw...@gmx.de
> CC: 900...@bugs.debian.org
> Onderwerp: [Pkg-samba-maint] Bug#900908: Bug#900908: Missing bug URLs
> 
> Le jeu. 7 juin 2018 à 11:08, Wolfgang Schweer 
>  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-ma...@alioth-lists.debian.net
> https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/pkg-s
> amba-maint
> 



Bug#900908: [Pkg-samba-maint] Bug#900908: Missing bug URLs

2018-06-07 Thread Mathieu Parent
Le jeu. 7 juin 2018 à 11:08, Wolfgang Schweer  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



Bug#900908: [Pkg-samba-maint] Bug#900908: Missing bug URLs

2018-06-07 Thread Wolfgang Schweer
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); 'netbios name' isn't preseedable, too. Please correct me if I'm 
wrong.

Wolfgang


signature.asc
Description: PGP signature


Bug#900908: [Pkg-samba-maint] Bug#900908: Missing bug URLs

2018-06-07 Thread Mathieu Parent
Hi,

piuparts is also affected:

  netbios name PIU-SLAVE-UBC-01 is not a valid netbios name

(https://piuparts.debian.org/sid/fail/samba-common-bin_2:4.8.2+dfsg-1.log)

I don't know how to handle this. 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).

Regards
-- 
Mathieu Parent



Bug#900908: Missing bug URLs

2018-06-06 Thread Wolfgang Schweer
On Wed, Jun 06, 2018 at 05:35:20PM +0200, Wolfgang Schweer wrote:

> 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.

¹https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=898875
²https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=900629

Wolfgang


signature.asc
Description: PGP signature