s4-drs: cope with bogus empty attributes from w2k8-r2 (Re: [SCM] Samba Shared Repository - branch master updated)

tridge at samba.org tridge at samba.org
Sat Nov 28 16:02:31 MST 2009

Hi Metze,

 > > +	/* delete any empty elements */
 > > +	for (i=0; i < msg->num_elements; i++) {
 > > +		if (msg->elements[i].name == NULL) {
 > > +			ldb_msg_remove_element(msg, &msg->elements[i]);
 > > +			i--;
 > > +		}
 > > +	}
 > > +
 > We need to be careful about this, an empty element means
 > we should remove existing values.
 > If remove the empty ones here, we need to let the repl_meta_data module
 > remove them based on the received meta_data array.

my comment in the above is perhaps misleading. I'm removing "empty"
ones that have a NULL name. It only gets a NULL name when the attid is
invalid (not in the prefixmap) and it also has no elements.

So we are not removing all the empty entries, so we don't need any
change in repl_meta_data.c at the moment. Before the above change we
were just exiting the DRS replication with an error.

This change was just to cope with what appears to be a bug in w2k8-r2,
where it sometimes sends completely bogus empty entries with bad attid
values. Kamen is looking into this with Bill Wesse, but I wanted a way
to avoid this problem now as otherwise I can't do any DRS testing. I
haven't found any way to remove these broken objects/attributes from
the w2k8 server, as they are already deleted, and they don't seem to
be being removed as part of the normal tombstoning. Re-installing
w2k8-r2 each time this happens is too painful for regular development.

I actually suspect the bug in w2k8-r2 is triggered by our ldap.py
testsuite somehow, as the bad objects are ones we create in that
testsuite, with one of the test objectclasses we create.

Cheers, Tridge

More information about the samba-technical mailing list