[WORKAROUND] Re: [Samba] duplicate domains in browse list

Joerg Pulz Joerg.Pulz at frm2.tum.de
Thu May 27 14:42:00 GMT 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wed, 26 May 2004, Joerg Pulz wrote:

> 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!
>
> 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.
>
> 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??

Hi,

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.

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

iD8DBQFAtf47SPOsGF+KA+MRAqKbAJ9IrOaakH65bItAU8NYCEZoa3DumwCeNsCZ
aIMJ3j1z5+6XuCsjM27TnkM=
=bsVO
-----END PGP SIGNATURE-----
-------------- next part --------------
--- nmbd/nmbd_browsesync.c.orig	Sun Apr  4 09:37:36 2004
+++ nmbd/nmbd_browsesync.c	Thu May 27 15:00:51 2004
@@ -102,7 +102,7 @@
 static void announce_local_master_browser_to_domain_master_browser( struct work_record *work)
 {
 	pstring outbuf;
-	unstring myname;
+	fstring myname;
 	char *p;
 
 	if(ismyip(work->dmb_addr)) {
@@ -120,7 +120,7 @@
 	SCVAL(p,0,ANN_MasterAnnouncement);
 	p++;
 
-	unstrcpy(myname, global_myname());
+	fstrcpy(myname, global_myname());
 	strupper_m(myname);
 	myname[15]='\0';
 	/* The call below does CH_UNIX -> CH_DOS conversion. JRA */
@@ -146,7 +146,7 @@
 
 static void sync_with_dmb(struct work_record *work)
 {
-	unstring dmb_name;
+	nstring dmb_name;
 
 	if( DEBUGLVL( 2 ) ) {
 		dbgtext( "sync_with_dmb:\n" );
@@ -197,7 +197,7 @@
 		p += 1;
 
 		while (numnames--) {
-			unstring qname;
+			nstring qname;
 			uint16 nb_flags;
 			int name_type;
 
@@ -278,7 +278,7 @@
 	struct nmb_name nmbname;
 	struct userdata_struct *userdata;
 	size_t size = sizeof(struct userdata_struct) + sizeof(fstring)+1;
-	unstring qname;
+	nstring qname;
 
 	pull_ascii_nstring(qname, sizeof(qname), q_name->name);
 	if( !(work = find_workgroup_on_subnet(subrec, qname)) ) {
@@ -399,7 +399,7 @@
                                               struct in_addr from_ip)
 {
 	struct work_record *work;
-	unstring server_name;
+	fstring server_name;
 
 	server_name[0] = 0;
 
@@ -420,7 +420,7 @@
 		p += 1;
 
 		while (numnames--) {
-			unstring qname;
+			nstring qname;
 			uint16 nb_flags;
 			int name_type;
 
@@ -434,7 +434,7 @@
 			if(!(nb_flags & NB_GROUP) && (name_type == 0x00) && 
 					server_name[0] == 0) {
 				/* this is almost certainly the server netbios name */
-				unstrcpy(server_name, qname);
+				fstrcpy(server_name, qname);
 				continue;
 			}
 
@@ -647,7 +647,7 @@
 	/* sync with a probability of 1/count */
 	for (work=unicast_subnet->workgrouplist; work; work = work->next) {
 		if (strcmp(lp_workgroup(), work->work_group)) {
-			unstring dmb_name;
+			nstring dmb_name;
 
 			if (((unsigned)sys_random()) % count != 0)
 				continue;


More information about the samba mailing list