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.
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?
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 HOST_NAME_ MAX];
char hostname[
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: www.tech- faq.com/ netbios- names.html
http://
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?