mirror of
https://github.com/samba-team/samba.git
synced 2025-01-12 09:18:10 +03:00
This patch will change order how attributes are modified
from: add, delete
to: delete, add
This is needed to update single valued attributes in Novell NDS and
should not harm anyone else.
(This used to be commit fabf801690
)
This commit is contained in:
parent
38b17cb153
commit
db088293ae
@ -438,22 +438,23 @@ BOOL fetch_ldap_pw(char **dn, char** pw)
|
||||
the old value, should it exist. */
|
||||
|
||||
if ((newval != NULL) && (strlen(newval) > 0)) {
|
||||
if (existed) {
|
||||
/* There has been no value before, so don't delete it.
|
||||
* Here's a possible race: We might end up with
|
||||
* duplicate attributes */
|
||||
/* By deleting exactly the value we found in the entry this
|
||||
* should be race-free in the sense that the LDAP-Server will
|
||||
* deny the complete operation if somebody changed the
|
||||
* attribute behind our back. */
|
||||
/* This will also allow modifying single valued attributes
|
||||
* in Novell NDS. In NDS you have to first remove attribute and then
|
||||
* you could add new value */
|
||||
|
||||
smbldap_set_mod(mods, LDAP_MOD_DELETE, attribute, oldval);
|
||||
}
|
||||
|
||||
smbldap_set_mod(mods, LDAP_MOD_ADD, attribute, newval);
|
||||
}
|
||||
|
||||
if (!existed) {
|
||||
/* There has been no value before, so don't delete it.
|
||||
Here's a possible race: We might end up with
|
||||
duplicate attributes */
|
||||
return;
|
||||
}
|
||||
|
||||
/* By deleting exactly the value we found in the entry this
|
||||
should be race-free in the sense that the LDAP-Server will
|
||||
deny the complete operation if somebody changed the
|
||||
attribute behind our back. */
|
||||
|
||||
smbldap_set_mod(mods, LDAP_MOD_DELETE, attribute, oldval);
|
||||
}
|
||||
|
||||
/**********************************************************************
|
||||
|
Loading…
Reference in New Issue
Block a user