Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[Samba] duplicate domains in browse list

15 views
Skip to first unread message

Joerg Pulz

unread,
May 26, 2004, 4:10:07 AM5/26/04
to
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

i recently upgraded some of my servers from 3.0.2a to 3.0.4

after the upgrade my browselist shows duplicate entries for the domains.
one domains is managed by a samba PDC(providing WINS too) and two samba
BDC's.
the other domains are managed by one samba PDC.

'smbclient -N -L <WINS_SERVER>' shows:
- ---
Workgroup Master
--------- -------
PUMA
PUMA PUMASRV
STRESSI STRESSISRV
STRESSI STRESSISRV
ZII MINOS
ZII MINOS
- ---

the 'browse.dat' file contains the following:
- ---
"ZII" c0001000 "MINOS" "ZII"
"MINOS" 408d9b2b "Samba Server 3.0.4" "ZII"
"ZII " 80001000 "MINOS" "ZII "
"PUMA " 80001000 "PUMASRV" "PUMA "
"PUMA" 80001000 "" "PUMA"
"STRESSI " 80001000 "STRESSISRV" "STRESSI "
"STRESSI" 80001000 "STRESSISRV" "STRESSI"
- ---

here are the entries from 'log.nmbd':
- ---
[2004/05/26 09:24:03, 0] nmbd/nmbd_workgroupdb.c:create_workgroup(68)
create_workgroup: workgroup name PUMA ESC is too long.
Truncating to PUMA
[2004/05/26 09:24:03, 0] nmbd/nmbd_workgroupdb.c:create_workgroup(68)
create_workgroup: workgroup name STRESSI ESC is too long.
Truncating to STRESSI
- ---

i don't know what's going on there..
this behavior is new in 3.0.4. i haven't seen this in 3.0.2a.
can somebody take a look at the nmbd changes between 3.0.2a and 3.0.4?

thanks in advance
Joerg
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (FreeBSD)

iD8DBQFAtE68SPOsGF+KA+MRAjwDAJ9mrir9Q2vWvHKDapc6r3J0a/17gQCgzMAh
6PMu3oxA3TwGjrT+TqigQuc=
=TqV5
-----END PGP SIGNATURE-----
--
To unsubscribe from this list go to the following URL and read the
instructions: http://lists.samba.org/mailman/listinfo/samba

Gerald (Jerry) Carter

unread,
May 26, 2004, 10:20:11 AM5/26/04
to
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Joerg Pulz wrote:
| Hi,
|
| i recently upgraded some of my servers from 3.0.2a to 3.0.4
|
| after the upgrade my browselist shows duplicate entries
| for the domains. one domains is managed by a samba
| PDC(providing WINS too) and two samba BDC's.
| the other domains are managed by one samba PDC.

Try this patch.


cheers, jerry
- ----------------------------------------------------------------------
Hewlett-Packard ------------------------- http://www.hp.com
SAMBA Team ---------------------- http://www.samba.org
GnuPG Key ---- http://www.plainjoe.org/gpg_public.asc
"...a hundred billion castaways looking for a home." ----------- Sting
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFAtKYKIR7qMdg1EfYRAuiDAKCagpb3yqyFpHJ74TNcIOiP1RFLPgCfRQlq
VKobdBMtzVes0xBv8MIpdNs=
=P1de
-----END PGP SIGNATURE-----

look

Joerg Pulz

unread,
May 26, 2004, 12:30:19 PM5/26/04
to
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wed, 26 May 2004, Gerald (Jerry) Carter wrote:

> Joerg Pulz wrote:
> | Hi,
> |
> | i recently upgraded some of my servers from 3.0.2a to 3.0.4
> |
> | after the upgrade my browselist shows duplicate entries
> | for the domains. one domains is managed by a samba
> | PDC(providing WINS too) and two samba BDC's.
> | the other domains are managed by one samba PDC.
>
> Try this patch.

i tried the patch but it didn't work. i could only update one server with
this patch, the other ones are to busy.
after startng the recompiled stuff and removing the browse.dat files from
every other machine, the domain came up again and a short time later the
duplicated entry appears..

maybe i must upgrade all involved machines??

in your patch was nothing about 'nmbd'. isn't this the place where all the
name stuff is handled?

joerg
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (FreeBSD)

iD8DBQFAtMSOSPOsGF+KA+MRAvbhAJ9bERn8CNHt9N6Krq63b9qxDVDmMQCffFrB
brVcMAiiRW4M2P7vDXwgP24=
=sgBF

Gerald (Jerry) Carter

unread,
May 26, 2004, 1:20:09 PM5/26/04
to
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Joerg Pulz wrote:

| i tried the patch but it didn't work. i could only
| update one server with this patch, the other ones are
| to busy. after startng the recompiled stuff and
| removing the browse.dat files from every other machine,
| the domain came up again and a short time
| later the duplicated entry appears..
|
| maybe i must upgrade all involved machines??


Probably so. Sounds like the bad workgroup names
are just getting passed around.

| in your patch was nothing about 'nmbd'. isn't this the
| place where all the name stuff is handled?

nmbd uses the same internal string functions that smbd
uses. That's what needed to be fixed.


cheers, jerry
- ----------------------------------------------------------------------
Hewlett-Packard ------------------------- http://www.hp.com
SAMBA Team ---------------------- http://www.samba.org
GnuPG Key ---- http://www.plainjoe.org/gpg_public.asc
"...a hundred billion castaways looking for a home." ----------- Sting

-----BEGIN PGP SIGNATURE-----


Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFAtM6qIR7qMdg1EfYRAsSqAJ9ITv6AWFiScV3s2wSkO3n1nOK2VwCgupbA
qrK3LDkWlQbhW0qWGpCtFrM=
=u7If

Gerald (Jerry) Carter

unread,
May 26, 2004, 1:20:10 PM5/26/04
to
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Joerg Pulz wrote:

| maybe i must upgrade all involved machines??

btw... you only need to update nmbd on all the machines.


cheers, jerry
- ----------------------------------------------------------------------
Hewlett-Packard ------------------------- http://www.hp.com
SAMBA Team ---------------------- http://www.samba.org
GnuPG Key ---- http://www.plainjoe.org/gpg_public.asc
"...a hundred billion castaways looking for a home." ----------- Sting

-----BEGIN PGP SIGNATURE-----


Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFAtM7TIR7qMdg1EfYRAsZ5AKC3j3U7yHLZGf9p+NF1/28JnkaBxgCgq9ri
Sk8KT6SHdxyfpgLYcrqk5AE=
=53C4

Joerg Pulz

unread,
May 26, 2004, 2:50:16 PM5/26/04
to
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wed, 26 May 2004, Gerald (Jerry) Carter wrote:
>
> Joerg Pulz wrote:
>
> | maybe i must upgrade all involved machines??
>
> btw... you only need to update nmbd on all the machines.

i've upgraded all machines now, but that did not help.

the problem occurs only with real domains. not with workgroups!

i have a workgroup with an samba-3.0.4 fileserver on a seperate subnet
smb.conf:
- ---
workgroup = MIRA
local master = yes
domain master = no
preferred master = no
domain logons = no
wins support = no
wins server = <ZII\PDC>
- ---

this one appears in all DMB's browse.dat file as:
- ---
"MIRA" c0001000 "MIRA1" "MIRA"
- ---

i have one domain with samba-3.0.4 PDC + BDC + BDC
smb.conf_PDC:
- ---
workgroup = ZII
local master = yes
domain master = yes
preferred master = yes
wins support = yes
domain logons = yes
- ---

smb.conf_BDC's
- ---
workgroup = ZII
local master = no
domain master = no
preferred master = no
wins support = no
wins server = <ZII\PDC>
domain logons = yes
- ---

the ZII domain appears in the PDC/BDC's browse.dat as:
- ---
"ZWE-FRM-II" c0001000 "MINOS" "ZWE-FRM-II"
"MINOS" 408d9b2b "Samba Server 3.0.4" "ZWE-FRM-II"
- ---
which is okay.

know i have a different domain controlled by samba-3.0.4 on a seperate
subnet
smb.conf:
- ---
workgroup = PUMA
local master = yes
domain master = yes
preferred master = yes
wins support = no
wins server = <ZII\PDC>
domain logons = yes
- ---

this domain appears on the domains PDC's browse.dat as:
- ---
"PUMA" c0001000 "PUMASRV" "PUMA"
"PUMASRV" 400d9b2b "Samba Server 3.0.4" "PUMA"
- ---
which is also coreect, but on all other DMB's browse.dat as:
- ---
"PUMA" 80001000 "PUMASRV "PUMA"
"PUMA " 80001000 "PUMASRV" "PUMA "
- ---
which is not correct.


as you can see, the workgroup is on all DMB's registered with "c0001000"
like the own domain on the DMB. but other DOMIAN's are registered twice
with "80001000".

after a period of time all DMB's have duplicate entries for their own
domain in "browse.dat" of course of the browselist synchronization between
the DMB's.

as you can see, we use one PDC as WINS server for all domains, but that
should be no problem, because the entries in "wins.dat" are all correct
and without any spaces at the end.

the complete setup shown above was working with samba-3.0.2a without any
problems.

i saw changes in CVS from jra to the "nmdb" code 2 months ago, and this is
the code is used for 3.0.4. may these changes have something to do with
this new/incorrect behavior??

regards
Joerg
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (FreeBSD)

iD8DBQFAtOYdSPOsGF+KA+MRAo0LAJ9RK8VW99lMwnSCf+XzgU4rfEsjkgCggK7/
Clpbtq/ujSev0yKNIQdoPvA=
=6kiH

Jeremy Allison

unread,
May 27, 2004, 2:20:12 PM5/27/04
to
On Thu, May 27, 2004 at 04:42:00PM +0200, Joerg Pulz wrote:
>
> i looked a little bit deeper in jra's changes and have reverted some of
> them to the state of samba-3.0.2a.
>
> the problem seems to be in "nmbd/nmbd_browsesync.c"
>
> attached is a patch wich applies to this file.
>
> i updated all my DMB's with this patch applied and i have the correct
> behavior back. no more duplicated entries in the browse.dat files.
>
> Remember: this behavior comes up on DMB's only. these are the only one's
> which do automtic browse list synchronization to make cross subnet
> browsing possible.
>
> it would be very nice if someone please can take a look at the parts i've
> changed and can provide a better fix or integrate my changes.
>
> any comments are also welcome.

Ok, all the changes here are just to reduce the size of string
used from an unstring to an nstring. Unfortunately this cannot
be correct as it would cause truncation for multibyte characters
in code pages like Japanese.

It may be that the change you added causes extra non-zero bytes not
to be examined in the comparison functions. If that is the case
the following patch should have the same effect. If you could test
this instead of your patch I'd appreciate it.

Thanks,

Jeremy.

look

Joerg Pulz

unread,
May 27, 2004, 2:50:16 PM5/27/04
to
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thu, 27 May 2004, Jeremy Allison wrote:

> Ok, all the changes here are just to reduce the size of string
> used from an unstring to an nstring. Unfortunately this cannot
> be correct as it would cause truncation for multibyte characters
> in code pages like Japanese.
>
> It may be that the change you added causes extra non-zero bytes not
> to be examined in the comparison functions. If that is the case
> the following patch should have the same effect. If you could test
> this instead of your patch I'd appreciate it.

I've tested the small patch on one DMB but it did NOT work.

I stopped 'smbd' and 'nmbd', removed the browse.dat file, installed the
new binaries, and started the whole thing.
as soon as the browse.dat file is recreated, it contains domain names with
trailing spaces until MAX_NETBIOSNAME_LEN is reached.

I had to stop the processes to not pollute all browse lists again.

regards
Joerg
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (FreeBSD)

iD8DBQFAtjdESPOsGF+KA+MRAugvAJwPa6Hv04CAPe49dj66KCJEiSGIZACgrrNy
g3aWJOxMCo6US7yKMctBEQk=
=oQOh

Jeremy Allison

unread,
May 27, 2004, 6:20:05 PM5/27/04
to
On Thu, May 27, 2004 at 08:45:22PM +0200, Joerg Pulz wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Thu, 27 May 2004, Jeremy Allison wrote:
>
> >Ok, all the changes here are just to reduce the size of string
> >used from an unstring to an nstring. Unfortunately this cannot
> >be correct as it would cause truncation for multibyte characters
> >in code pages like Japanese.
> >
> >It may be that the change you added causes extra non-zero bytes not
> >to be examined in the comparison functions. If that is the case
> >the following patch should have the same effect. If you could test
> >this instead of your patch I'd appreciate it.
>
> I've tested the small patch on one DMB but it did NOT work.
>
> I stopped 'smbd' and 'nmbd', removed the browse.dat file, installed the
> new binaries, and started the whole thing.
> as soon as the browse.dat file is recreated, it contains domain names with
> trailing spaces until MAX_NETBIOSNAME_LEN is reached.
>
> I had to stop the processes to not pollute all browse lists again.

Thanks for testing it. Ok, the part I didn't know is that the
bad names in the browse list have trailing spaces. That helps
a lot in tracking this down. I'll mail more when I've investigated
it.

Thanks,

Jeremy.

Jeremy Allison

unread,
May 27, 2004, 7:00:10 PM5/27/04
to
On Thu, May 27, 2004 at 08:45:22PM +0200, Joerg Pulz wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Thu, 27 May 2004, Jeremy Allison wrote:
>
> >Ok, all the changes here are just to reduce the size of string
> >used from an unstring to an nstring. Unfortunately this cannot
> >be correct as it would cause truncation for multibyte characters
> >in code pages like Japanese.
> >
> >It may be that the change you added causes extra non-zero bytes not
> >to be examined in the comparison functions. If that is the case
> >the following patch should have the same effect. If you could test
> >this instead of your patch I'd appreciate it.
>
> I've tested the small patch on one DMB but it did NOT work.
>
> I stopped 'smbd' and 'nmbd', removed the browse.dat file, installed the
> new binaries, and started the whole thing.
> as soon as the browse.dat file is recreated, it contains domain names with
> trailing spaces until MAX_NETBIOSNAME_LEN is reached.
>
> I had to stop the processes to not pollute all browse lists again.

Ok, here is one definate bug I've found - we were not converting correctly to
UNIX charset before sending the mailslot in the function :

announce_local_master_browser_to_domain_master_browser()

However, I don't think this would cause the problem. Here is the
fix for this I've just checked in, if you could test this I'd appreciate
it.

Jeremy.

look

Jeremy Allison

unread,
May 27, 2004, 9:00:09 PM5/27/04
to
On Thu, May 27, 2004 at 08:45:22PM +0200, Joerg Pulz wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Thu, 27 May 2004, Jeremy Allison wrote:
>
> >Ok, all the changes here are just to reduce the size of string
> >used from an unstring to an nstring. Unfortunately this cannot
> >be correct as it would cause truncation for multibyte characters
> >in code pages like Japanese.
> >
> >It may be that the change you added causes extra non-zero bytes not
> >to be examined in the comparison functions. If that is the case
> >the following patch should have the same effect. If you could test
> >this instead of your patch I'd appreciate it.
>
> I've tested the small patch on one DMB but it did NOT work.
>
> I stopped 'smbd' and 'nmbd', removed the browse.dat file, installed the
> new binaries, and started the whole thing.
> as soon as the browse.dat file is recreated, it contains domain names with
> trailing spaces until MAX_NETBIOSNAME_LEN is reached.

Can you send me your smb.conf please. I'd really like to make
sure I've fixed this for 3.0.5.

Thanks,

Jeremy.

Joerg Pulz

unread,
May 28, 2004, 3:00:15 AM5/28/04
to
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thu, 27 May 2004, Jeremy Allison wrote:

> On Thu, May 27, 2004 at 08:45:22PM +0200, Joerg Pulz wrote:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> On Thu, 27 May 2004, Jeremy Allison wrote:
>>
>>> Ok, all the changes here are just to reduce the size of string
>>> used from an unstring to an nstring. Unfortunately this cannot
>>> be correct as it would cause truncation for multibyte characters
>>> in code pages like Japanese.
>>>
>>> It may be that the change you added causes extra non-zero bytes not
>>> to be examined in the comparison functions. If that is the case
>>> the following patch should have the same effect. If you could test
>>> this instead of your patch I'd appreciate it.
>>
>> I've tested the small patch on one DMB but it did NOT work.
>>
>> I stopped 'smbd' and 'nmbd', removed the browse.dat file, installed the
>> new binaries, and started the whole thing.
>> as soon as the browse.dat file is recreated, it contains domain names with
>> trailing spaces until MAX_NETBIOSNAME_LEN is reached.
>
> Can you send me your smb.conf please. I'd really like to make
> sure I've fixed this for 3.0.5.

Hi Jeremy,

i tested your last patch, but it did NOT work too. sorry.

i've upgraded all DMB's with it, removed browse.dat and started all DMB's.
the same as above, the browse.dat is recreated and conatins entries with
trailing spaces for the domains the DMB is NOT the master.

i will send you my smb.conf files in another mail directly.

thanks for your help


Joerg
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (FreeBSD)

iD8DBQFAtuHzSPOsGF+KA+MRAuG7AJ9CQ0R7a97thZDK8zkNbhseEo/shgCgr82E
E+bHQ5NZIMOZpQ4lIiP8Caw=
=hG8L
-----END PGP SIGNATURE-----

Farkas Levente

unread,
May 28, 2004, 4:50:12 AM5/28/04
to
Jeremy Allison wrote:
> On Thu, May 27, 2004 at 08:45:22PM +0200, Joerg Pulz wrote:
>
>>-----BEGIN PGP SIGNED MESSAGE-----
>>Hash: SHA1
>>
>>On Thu, 27 May 2004, Jeremy Allison wrote:
>>
>>
>>>Ok, all the changes here are just to reduce the size of string
>>>used from an unstring to an nstring. Unfortunately this cannot
>>>be correct as it would cause truncation for multibyte characters
>>>in code pages like Japanese.
>>>
>>>It may be that the change you added causes extra non-zero bytes not
>>>to be examined in the comparison functions. If that is the case
>>>the following patch should have the same effect. If you could test
>>>this instead of your patch I'd appreciate it.
>>
>>I've tested the small patch on one DMB but it did NOT work.
>>
>>I stopped 'smbd' and 'nmbd', removed the browse.dat file, installed the
>>new binaries, and started the whole thing.
>>as soon as the browse.dat file is recreated, it contains domain names with
>>trailing spaces until MAX_NETBIOSNAME_LEN is reached.
>
>
> Can you send me your smb.conf please. I'd really like to make
> sure I've fixed this for 3.0.5.

I've similar entries in my log files:
-----------------------
May 25 10:16:24 kek nmbd[10096]: [2004/05/25 10:16:24, 0]
nmbd/nmbd_workgroupdb.c:create_workgroup(68)
May 25 10:16:24 kek nmbd[10096]: create_workgroup: workgroup name MKK
^[ is too long. Truncating to MKK

if I not wrap the lines (the middle of the line):
create_workgroup: workgroup name MKK ^[ is too long.
Truncating to MKK

--
Levente "Si vis pacem para bellum!"

Jeremy Allison

unread,
May 28, 2004, 12:40:28 PM5/28/04
to

Could you send me the smb.conf and the log file please. Also
copies of your browse.dat files.

Thanks,

Jeremy.

Joerg Pulz

unread,
May 29, 2004, 7:50:09 AM5/29/04
to
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Fri, 28 May 2004, Jeremy Allison wrote:

> On Fri, May 28, 2004 at 09:24:31AM +0200, Joerg Pulz wrote:
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> >
> > On Thu, 27 May 2004, Jeremy Allison wrote:
> >
> > >Can you send me your smb.conf please. I'd really like to make
> > >sure I've fixed this for 3.0.5.
> >

> > i send you 2 smb.conf files with this mail.
> > one file belongs to the PDC of our MAIN domain called 'ZWE-FRM-II', which
> > is also the WINS server for all other hosts. this server works on subnet
> > 172.25.1.0/24. the attached 'smb.conf_1' belongs to this server.
> >
> > the second file belongs to a second PDC for domain 'PANDA', which works on
> > subnet 172.25.15.0/24 and uses the PDC of the 'ZWE-FRM-II' domain as WINS
> > server. the attached 'smb.conf_2' belongs to this server.
>
> Ok, this is the fix for this problem - this fix didn't make
> 3.0.5pre1.
>
> This perfectly explains the problem you're seeing - for workgroup
> names we were parsing 16 bytes (including the netbios type byte)
> instead of 15 bytes (only the name). This causes the trim_char
> call that should remove the extra space to fail :-(.
>
> --- lib/charcnv.c 2004-05-28 16:10:52.000000000 -0700
> +++ /home/jeremy/src/samba3.0/source/lib/charcnv.c 2004-05-27 15:04:24.000000000 -0700
> @@ -932,7 +932,7 @@
>
> size_t pull_ascii_nstring(char *dest, size_t dest_len, const void *src)
> {
> - return pull_ascii(dest, src, dest_len, sizeof(nstring), STR_TERMINATE);
> + return pull_ascii(dest, src, dest_len, sizeof(nstring)-1, STR_TERMINATE);
> }

Hi Jeremy,

your patch solves this problem PERFECTLY.
thank again for your help.

keep up the good work.

regards
Joerg
-----BEGIN PGP SIGNATURE-----

Version: GnuPG v1.2.3 (FreeBSD)

iD8DBQFAuHexSPOsGF+KA+MRArZVAKC8+48JaSo4BZoFrbCd5shuTLLqxgCfdYtW
ym8pwkyg5ANbef6caHZiRGg=
=u34J
-----END PGP SIGNATURE-----

0 new messages