[Date Prev][Date Next] [Chronological] [Thread] [Top]

ITS#5505



The BackendDB structure could have a specific bd_modifiersName field for 
internal modifications; the slap_overinst structure could have a 
on_modifiersName as well.  Both could be configurable using a(n 
optional, single-valued) olcModifiersName attribute.

Internal writes would receive the modifiersName from:

- the application; or
- the overlay's olcModifiersName; or
- the database's olcModifiersName; or
- the database's rootdn; or
- ?!?  fail?  remain anonymous?

a call to

int
slap_get_modifiersName( Operation *op, BackendDB *be, slap_overinst *on,
	struct berval *mn, struct berval *nmn )
{
	*mn = op->o_dn;
	*nmn = op->o_ndn;

	if ( BER_BVISEMPTY( nmn ) ) {
		if ( on && !BER_BVISNULL( &on->on_modifiersName ) ) {
			*mn = on->on_modifiersName;
			*nmn = on->on_nmodifiersName;
		} else if ( be ) {
			if ( !BER_BVISNULL( &be->bd_modifiersName ) ) {
				*mn = be->bd_modifiersName;
				*nmn = be->bd_nmodifiersName;
			} else if ( !BER_BVISNULL( &be->bd_rootdn ) ) {
				*mn = be->bd_rootdn;
				*nmn = be->bd_rootndn;
			}
		}
	}

	return !BER_BVISEMPTY( nm );
}

would return the appropriate value, if any.

Probably a bit too much effort, but then multiple customizations that 
need to perform internal writes would be saved the effort and the 
dispersion of having to define their own configuration bit for a common 
feature.

p.


Ing. Pierangelo Masarati
OpenLDAP Core Team

SysNet s.r.l.
via Dossi, 8 - 27100 Pavia - ITALIA
http://www.sys-net.it
-----------------------------------
Office:  +39 02 23998309
Mobile:  +39 333 4963172
Fax:     +39 0382 476497
Email:   ando@sys-net.it
-----------------------------------