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

Re: Add-if-not-present

masarati@aero.polimi.it wrote:
I need to implement a modify operation whose semantics is "add if not
present", an add that only takes place if that attribute is not yet
present in the entry.

I need it as an internal operation, so right now I wouldn't bother
formalizing it as an extension of the semantics of the modify operation.
Something like the SLAP_MOD_SOFTADD, which in turn consists in adding an
attribute value only if that value is not already present.

I'd introduce a SLAP_MOD_ADD_IF_NOT_PRESENT flag and add code to support
it in all (well, most) backends/overlays that need to muck with modify
operation type.

Sounds like you could do it with an Assertion Control (!(attr=*)).

  -- Howard Chu
  CTO, Symas Corp.           http://www.symas.com
  Director, Highland Sun     http://highlandsun.com/hyc/
  Chief Architect, OpenLDAP  http://www.openldap.org/project/