#451340 replace operation used to add and remove attributes

Package:
ldapvi
Source:
ldapvi
Description:
perform an LDAP search and update results using a text editor
Submitter:
Michael Spang
Date:
2010-08-01 12:18:03 UTC
Severity:
normal
#451340#5
Date:
2007-11-15 06:33:13 UTC
From:
To:
ldapvi uses the replace changetype to add and remove values for attributes.
This causes a race condition if the user of ldapvi changes an attribute
that was externally modified while his editor was open.

The solution is to use 'add' and 'delete' instead of replace, as
appropriate.

Thanks.
Michael Spang

#451340#10
Date:
2007-11-15 08:57:37 UTC
From:
To:
Quoting Michael Spang (mspang@uwaterloo.ca):

That's what I thought until I got all those bug reports about ldapvi's
original behaviour of using add/delete not working as intended.

See #374962 for an example where OpenLDAP appears to be doing schema
checks between the add and delete, rather than on the combined operation
(in this example combined with an attribute type that ignores
whitespace, which ldapvi is not aware of).

I could make the old behaviour a configuration option...


d.

#451340#19
Date:
2007-11-15 10:34:57 UTC
From:
To:
* I wrote:

Okay, after discussion with Gerfried Fuchs:

  - the problem in #374962 might have been just that ldapvi was doing
    an `add' followed by `delete' rather than vice versa

  - my original reason for this patch was a report that the delete/add
    method caused problems with iPlanet in a multimaster configuration
    (?!), but I never received more information on that

  - when offering an option for the old behaviour of using delete/add,
    we will need to take care not to break the workaround for users that
    depend on the order of attribute values as requested in:
http://lists.askja.de/pipermail/ldapvi/2007-May/000021.html

For the scenario where multiple users change the same entry, delete/add
compared to replace could offer two distinct advantages:
  i) error instead of unintentional overwriting of the other
     "simultaneous" write operation
 ii) no conflict at all with "simultaneous" changes to values of the same
     multi-valued attribute if those values were not touched by the
     current operation

ldapvi originally tried to achieve ii) by using delete/add only for the
values that were changed.

We could instead aim for i) and still keep the old ordering by
performing a `delete' for every value seen previously, and then `add'
for each new value in the desired order.

#451340#24
Date:
2010-08-01 12:15:10 UTC
From:
To:
Hi

What is the status of this bug? I tried to use ldapvi to modify the
config on a openldap server (via cn=config). However large parts of this
code only implementes add and delete, but not replace modifications.

Bastian