This is a regression introduced by da2611adef32107f5a0eec97501c01232ab72efc. If one of the registered netbios names of a Samba server is "FOO", then the function is_myname() in source3/lib/util.c will return true for all netbios names beginning with "FOO": source3/lib/util.c: bool is_myname(const char *s) { ... for (n=0; my_netbios_names(n); n++) { const char *nbt_name = my_netbios_names(n); if (strncasecmp_m(nbt_name, s, strlen(nbt_name)) == 0) { ret=True; break; } } Because the strncasecmp_m() only compares the length of nbt_name, it will return true if nbt_name is a substring of s.
Created attachment 11306 [details] Compare the maximum allowed length of a NetBIOS name Possible fix
For what it's worth, I can confirm that the included patch fixes the problem that was originally reported to us, which was that a PDC on domain FOO did not show up in the browse list of Windows clients named FOOanything, while logging: process_browse_packet: Discarding datagram from IP a.b.c.d. Source name FOO-S01<00> is one of our names !
Created attachment 11370 [details] git-am fix for 4.3.0, 4.2.next, 4.1.next. Master patch applies cleanly to 4.1.x and above.
Comment on attachment 11370 [details] git-am fix for 4.3.0, 4.2.next, 4.1.next. Trying to get reviewers so I can get this into 4.x.next :-).
Karolin please push to 4.3.0, 4.2.next, 4.1.next. Cheers, Jeremy.
Pushed to autobuild-v4-{1,2,3}-test
Pushed to v4-{1,2,3}-test