Bug 12861 - "netbios name = %h" in smb.conf fails to expand and is shown as %H
Summary: "netbios name = %h" in smb.conf fails to expand and is shown as %H
Status: RESOLVED INVALID
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Other (show other bugs)
Version: 4.6.2
Hardware: All Linux
: P5 normal (vote)
Target Milestone: ---
Assignee: Andrew Bartlett
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-06-24 11:02 UTC by Peter Urbanec
Modified: 2017-06-29 06:45 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Urbanec 2017-06-24 11:02:04 UTC
Specifying "netbios name = %h" in smb.conf results in the server showing up on the network as "%H"

It looks like the string gets capitalised before variable substitution and as a result the "%h" changes to "%H" and is never expanded.
Comment 1 Andrew Bartlett 2017-06-25 02:36:22 UTC
This isn't a bug, or at least the change in behaviour was fairly deliberate.

The change was made in 74eed8f3ed5c333728350df1d23a4318e9104909 and included in Samba 4.0.

However, as the default is already the hostname, you should just be able to leave it unset.

This parameter is used in a server global context, so we don't really want it moving around with the % subs.

Sorry,
Comment 2 Peter Urbanec 2017-06-25 13:44:55 UTC
No worries.

I am looking at a deployed base of a few thousand machines that have the redundant "netbios name = %h" entry in smb.conf 

I'll take a look at adding a script to the samba init.d script to detect and delete the problematic line from smb.conf