Bug in samldb_description_check?

tridge at samba.org tridge at samba.org
Sun Feb 13 16:21:41 MST 2011


Hi Matthias,

 > perhaps use ldb_msg_normalize(), apply your checks, and then if they
 > pass then continue with the original request?

After Andrew sent this message we found a much better solution. We now
have a LDB_FLAG_INTERNAL_FORCE_SINGLE_VALUE_CHECK flag on
elements. The samldb.c check on description now looks like this:

	el = ldb_msg_find_element(ac->msg, "description");
	if (el != NULL) {
		el->flags |= LDB_FLAG_INTERNAL_FORCE_SINGLE_VALUE_CHECK;
	}

We've tested this, and constrained modifications on description now
work. It is also much more efficient.

In general I'd like to keep subtle logic like single valued tests in
one place. We already have it in the tdb backend, so the best approach
is to have a way to enable that code for an element, instead of
re-implementing it inside samldb.c. I think it would be worth keeping
that in mind for some of the other subtleties that samldb.c handles
now.

I've pushed the change to autobuild.

Cheers, Tridge


More information about the samba-technical mailing list