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

SLAPI and add requests



I notice that the preoperation plugin only has access to a
skeletal entry, ie. without any attributes filled in. The
complete entry should be available as SLAPI_ADD_ENTRY.

For example, it is often useful to have a preoperation add
plugin set a default for an attribute:

	...
	if (slapi_entry_attr_find(entry, "someAttribute", ...)) {
		/* entry already has attribute; do nothing */
	} else {
		/* set the attribute to some reasonable default */
		slapi_entry_attr_set_charptr(e, "someAttribute", "someDefault");
	}
	...

I would like to fix this, but it's going to involve shuffling
some code around in servers/slapd/add.c (the modification list
will need to be turned into an entry much earlier on).

Thoughts? I am very reluctant to disturb the code path for when
SLAPI is disabled. I think it should be possible to implement this
without changing the code path too much (at the expense of some
additinal code whe SLAPI is enabled).

-- Luke

~i 
--
Luke Howard | PADL Software Pty Ltd | www.padl.com