summaryrefslogtreecommitdiffstats
path: root/ldap/servers/plugins/replication/windows_connection.c
diff options
context:
space:
mode:
authorNathan Kinder <nkinder@redhat.com>2006-02-20 19:36:24 +0000
committerNathan Kinder <nkinder@redhat.com>2006-02-20 19:36:24 +0000
commit836e08dc192bd3a9c8a10c3869c5efc48bf13024 (patch)
treeca230d96283b8c964a10e739b045956baf6ad585 /ldap/servers/plugins/replication/windows_connection.c
parentfb511a7f2c7c628b0ee2dc15ebcdded807e199ba (diff)
downloadds-836e08dc192bd3a9c8a10c3869c5efc48bf13024.tar.gz
ds-836e08dc192bd3a9c8a10c3869c5efc48bf13024.tar.xz
ds-836e08dc192bd3a9c8a10c3869c5efc48bf13024.zip
Bug(s) fixed: 181827
Bug Description: If you delete an attribute from an entry on AD, the attribute doesn't get deleted on the DS side. The replication code doesn't even notice that the entry changed. Reviewed by: Rich, Noriko, Pete (thanks!) Files: see diffs Branch: HEAD, Directory71Branch Fix Description: The dirsync search control passes back deleted attributes with no values. If you try to add a Slapi_Attr with no values to a Slapi_Entry, it doesn't get added. This fix stuffs the deleted attributes into the deleted attributes list in the Slapi_Entry and checks for them when creating the modification operations to be performed on the local entry. Flag Day: no Doc impact: no QA impact: A regression test needs to be added New Tests integrated into TET: none
Diffstat (limited to 'ldap/servers/plugins/replication/windows_connection.c')
-rw-r--r--ldap/servers/plugins/replication/windows_connection.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/ldap/servers/plugins/replication/windows_connection.c b/ldap/servers/plugins/replication/windows_connection.c
index 58408a49..4583c102 100644
--- a/ldap/servers/plugins/replication/windows_connection.c
+++ b/ldap/servers/plugins/replication/windows_connection.c
@@ -557,7 +557,19 @@ windows_LDAPMessage2Entry(LDAP * ld, LDAPMessage * msg, int attrsonly) {
{
type_to_use = a;
}
- slapi_entry_add_values( e, type_to_use, aVal);
+
+ /* If the list of attribute values is null, we need to delete this attribute
+ * from the local entry.
+ */
+ if (aVal == NULL) {
+ /* Windows will send us an attribute with no values if it was deleted
+ * on the AD side. Add this attribute to the deleted attributes list */
+ Slapi_Attr *attr = slapi_attr_new();
+ slapi_attr_init(attr, type_to_use);
+ entry_add_deleted_attribute_wsi(e, attr);
+ } else {
+ slapi_entry_add_values( e, type_to_use, aVal);
+ }
ldap_memfree(a);
ldap_value_free_len(aVal);