bug: inconsistent handling of workgroups > 15 chars leads to failed master browser elections

Joseph Cheek joseph at cheek.com
Fri Nov 2 12:16:03 GMT 2001


hi,

when i give samba a workgroup name with more than 15 characters [the
limit for netbios names], nmbd is unable to participate in browse master
elections.  it appears that parts of internal samba code honor 16
characters and parts only honor 15.

details:

i used a workgroup name of nodomain.nowhere, 16 characters, on samba
2.2.1a.  the samba box was the only member of this workgroup on the
segment [so it should become browse master].  the nmbd log shows:

[2001/11/02 12:06:22, 0]
nmbd/nmbd_elections.c:check_for_master_browser_fail(94)
check_for_master_browser_fail: Unable to find workgroup NODOMAIN.NOWHER on
subnet 4.35.140.177.=

4.35.140.177 is the IP of the samba box.

additionally, smbclient shows ambiguous data:

$ smbclient -N -L 127.0.01
added interface ip=4.35.140.177 bcast=4.35.143.255 nmask=255.255.252.0
Anonymous login successful
Domain=[NODOMAIN.NOWHERE] OS=[Unix] Server=[Samba 2.2.1a]

        Sharename      Type      Comment
        ---------      ----      -------
        public         Disk      Public Stuff
        IPC$           IPC       IPC Service (Redmond Linux)
        ADMIN$         Disk      IPC Service (Redmond Linux)
        lp             Printer

        Server               Comment
        ---------            -------
        SANFRANCISCO         Redmond Linux

        Workgroup            Master
        ---------            -------
        NODOMAIN.NOWHER

as you can see, Domain=[NODOMAIN.NOWHERE] but Workgroup is listed as
NODOMAIN.NOWHER.  no browse master has been established.  nmblookup
doesn't show a master for either variation:

$ nmblookup -M NODOMAIN.NOWHERE
querying NODOMAIN.NOWHERE on 4.35.143.255
name_query failed to find name NODOMAIN.NOWHERE#1d
$ nmblookup -M NODOMAIN.NOWHER
querying NODOMAIN.NOWHER on 4.35.143.255
name_query failed to find name NODOMAIN.NOWHER#1d

from this i surmise that inconsistent handling of a 16-character domain
name causes the failed browse master elections.  i believe the best fix to
be changing samba to completely ignore all characters > 15 in the domain
name, so that the above example would become Domain=[NODOMAIN.NOWHER].

any questions, please let me know.

thanks!

joe
joseph at cheek.com





More information about the samba mailing list