static int replmd_get_active_singleval_link(struct ldb_module *module,
					    TALLOC_CTX *mem_ctx,
					    struct parsed_dn pdn_list[],
					    unsigned int count,
					    const struct dsdb_attribute *attr,
					    struct parsed_dn **ret_pdn)
{
	unsigned int i;

	*ret_pdn = NULL;

	if (!(attr->ldb_schema_attribute->flags & LDB_ATTR_FLAG_SINGLE_VALUE)) {

		/* nothing to do for multi-valued linked attributes */
		return LDB_SUCCESS;
	}

	for (i = 0; i < count; i++) {
		int ret = LDB_SUCCESS;
		struct parsed_dn *pdn = &pdn_list[i];

		/* skip any inactive links */
		if (dsdb_dn_is_deleted_val(pdn->v)) {
			continue;
		}

		/* we've found an active value for this attribute */
		*ret_pdn = pdn;

		if (pdn->dsdb_dn == NULL) {
			struct ldb_context *ldb = ldb_module_get_ctx(module);

			ret = really_parse_trusted_dn(mem_ctx, ldb, pdn,
						      attr->syntax->ldap_oid);
		}

		return ret;
	}

	/* no active link found */
	return LDB_SUCCESS;
}
static int replmd_get_active_singleval_link(struct ldb_module *module,
					    TALLOC_CTX *mem_ctx,
					    struct parsed_dn pdn_list[],
					    unsigned int count,
					    const struct dsdb_attribute *attr,
					    struct parsed_dn **ret_pdn)
{
	unsigned int i;

	*ret_pdn = NULL;

	if (!(attr->ldb_schema_attribute->flags & LDB_ATTR_FLAG_SINGLE_VALUE)) {

		 
		return LDB_SUCCESS;
	}

	for (i = 0; i < count; i++) {
		int ret = LDB_SUCCESS;
		struct parsed_dn *pdn = &pdn_list[i];

		 
		if (dsdb_dn_is_deleted_val(pdn->v)) {
			continue;
		}

		 
		*ret_pdn = pdn;

		if (pdn->dsdb_dn == NULL) {
			struct ldb_context *ldb = ldb_module_get_ctx(module);

			ret = really_parse_trusted_dn(mem_ctx, ldb, pdn,
						      attr->syntax->ldap_oid);
		}

		return ret;
	}

	 
	return LDB_SUCCESS;
}