bool fix_link_sid;
};
+/*
+ * the result of replmd_process_linked_attribute(): either there was no change
+ * (update was ignored), a new link was added (either inactive or active), or
+ * an existing link was modified (active/inactive status may have changed).
+ */
+typedef enum {
+ LINK_CHANGE_NONE,
+ LINK_CHANGE_ADDED,
+ LINK_CHANGE_MODIFIED,
+} replmd_link_changed;
+
static int replmd_replicated_apply_merge(struct replmd_replicated_request *ar);
static int replmd_delete_internals(struct ldb_module *module, struct ldb_request *req, bool re_delete);
static int replmd_check_upgrade_links(struct ldb_context *ldb,
struct ldb_message *msg,
const struct dsdb_attribute *attr,
struct la_entry *la_entry,
- struct ldb_request *parent)
+ struct ldb_request *parent,
+ replmd_link_changed *change)
{
struct drsuapi_DsReplicaLinkedAttribute *la = la_entry->la;
struct ldb_context *ldb = ldb_module_get_ctx(module);
bool add_as_inactive = false;
WERROR status;
+ *change = LINK_CHANGE_NONE;
+
/* the value blob for the attribute holds the target object DN */
status = dsdb_dn_la_from_blob(ldb, attr, schema, mem_ctx,
la->value.blob, &dsdb_dn);
val_to_update = pdn->v;
old_dsdb_dn = pdn->dsdb_dn;
+ *change = LINK_CHANGE_MODIFIED;
} else {
unsigned offset;
val_to_update = &old_el->values[offset];
old_dsdb_dn = NULL;
+ *change = LINK_CHANGE_ADDED;
}
/* set the link attribute's value to the info that was received */
enum deletion_state deletion_state = OBJECT_NOT_DELETED;
struct ldb_context *ldb = ldb_module_get_ctx(module);
const struct dsdb_attribute *attr = NULL;
+ replmd_link_changed change_type;
/*
* get the attribute being modified and the search result for the
DLIST_REMOVE(la_group->la_entries, la);
ret = replmd_process_linked_attribute(module, tmp_ctx,
replmd_private,
- msg, attr, la, NULL);
+ msg, attr, la, NULL,
+ &change_type);
if (ret != LDB_SUCCESS) {
replmd_txn_cleanup(replmd_private);
return ret;