At first glance, this code seemed completely unnecessary. However, it
was added (by commit
f6bc4c08b19f5615) for a valid reason: adding the
whenChanged/uSNChanged attributes to the message can cause msg->elements
to be reallocated, which means the old_el pointer (which points to
msg->elements memory) can be out of date.
whenChanged/uSNChanged now get added to the msg last, just before the DB
modify operation. So old_el can no longer become out of date within
replmd_process_link_attribute(), so re-fetching it is now redundant.
Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
}
}
- old_el = ldb_msg_find_element(msg, attr->lDAPDisplayName);
- if (old_el == NULL) {
- return ldb_operr(ldb);
- }
-
ret = dsdb_check_single_valued_link(attr, old_el);
if (ret != LDB_SUCCESS) {
return ret;