[Bug 735072] Re: The hostname proposed by installer is too long for file sharing to work correctly.

Johan Fornander fornander.johan at gmail.com
Mon Apr 25 17:02:53 UTC 2011


The source code in the official samba git (source/lib/util.c) seems to
use HOST_NAME_MAX and I found an inconsistency in the code base:

source/lib/replace/replace.h:
 384 #ifndef HOST_NAME_MAX
 385 #define HOST_NAME_MAX 255

source/lib/replace/system/network.h	
 269 #ifndef HOST_NAME_MAX
 270 #define HOST_NAME_MAX 256

Which one is used?

Then here is what I think my problem is:

The function get_myname() in util.c uses
char hostname[HOST_NAME_MAX];

Another function in the same file, set_netbios_aliases(), blindly uses
this hostname through helper functions without checking its boundaries
to match those of a valid NetBIOS name.


Now I could be wrong since I just took 5 minutes to check the source code while also skimming this link:
http://www.tech-faq.com/netbios-names.html


How this is supposed to work out of the box when windows machines, or osx for that matter, only recognizes NetBIOS names of length 15 is beyond me. Can this really have been overlooked since the inception of samba or am I missing something here?

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is a bug assignee.
https://bugs.launchpad.net/bugs/735072

Title:
  The hostname proposed by installer is too long for file sharing to
  work correctly.



More information about the Ubuntu-server-bugs mailing list