samba-tool testparm and netbios name length: error or warning?

Andreas Hasenack andreas at
Sun Feb 23 14:06:08 UTC 2020


I just came across this different behavior between testparm(1) and
samba-tool testparm:

$ testparm
Load smb config files from /etc/samba/smb.conf
Loaded services file OK.
WARNING: The 'netbios name' is too long (max. 15 chars).
$ echo $?

$ samba-tool testparm
INFO 2020-02-22 21:16:42,905 pid:37370
/usr/lib/python3/dist-packages/samba/netcmd/ #96: Loaded
smb config files from /etc/samba/smb.conf
INFO 2020-02-22 21:16:42,905 pid:37370
/usr/lib/python3/dist-packages/samba/netcmd/ #97: Loaded
services file OK.
ERROR 2020-02-22 21:16:42,905 pid:37370
/usr/lib/python3/dist-packages/samba/netcmd/ #124: netbios
name FOCAL-BIND9-UPGRADE-TEST is not a valid netbios name
Press enter to see a dump of your service definitions
ERROR: Invalid smb.conf
$ echo $?

I noticed that nmbd just truncates the name to 15 chars and starts up
fine. Should this issue be a warning (like testparm(1) treats it), or
a fatal error, like samba-tool's testparm behavior?

A second question, and that is more of packaging and this might be the
wrong audience, but Debian/Ubuntu use "samba-tool testparm" to check
the config when the role is "active directory domain controller". Is
the netbios name length more critical in that scenario, and thus the
service should really fail hard to start?

I was thinking about patching samba-tool testparm to treat the over
length of the netbios name as just a warning, and exit 0 instead of
255 in that case, but wanted to get more opinions about this since I
rarely setup samba in that AD role.

More information about the samba-technical mailing list