static int get_parsed_dns_trusted_fallback(struct ldb_module *module,
					   struct replmd_private *replmd_private,
					   TALLOC_CTX *mem_ctx,
					   struct ldb_message_element *el,
					   struct parsed_dn **pdn,
					   const char *ldap_oid,
					   struct ldb_request *parent)
{
	int ret;
	if (el == NULL) {
		*pdn = NULL;
		return LDB_SUCCESS;
	}

	if (!replmd_private->sorted_links) {
		/* We need to sort the list. This is the slow old path we want
		   to avoid.
		 */
		ret = get_parsed_dns(module, mem_ctx, el, pdn, ldap_oid,
				      parent);
		if (ret != LDB_SUCCESS) {
			return ret;
		}
	} else {
		ret = get_parsed_dns_trusted(mem_ctx, el, pdn);
		if (ret != LDB_SUCCESS) {
			ldb_module_oom(module);
			return LDB_ERR_OPERATIONS_ERROR;
		}
	}

	/*
	 * This upgrades links to FL2003 style, and sorts the result
	 * if that was needed.
	 *
	 * TODO: Add a database feature that asserts we have no FL2000
	 *       style links to avoid this check or add a feature that
	 *       uses a similar check to find sorted/unsorted links
	 *       for an on-the-fly upgrade.
	 */

	ret = replmd_check_upgrade_links(ldb_module_get_ctx(module),
					 *pdn, el->num_values,
					 el,
					 ldap_oid);
	if (ret != LDB_SUCCESS) {
		return ret;
	}

	return LDB_SUCCESS;
}
static int get_parsed_dns_trusted_fallback(struct ldb_module *module,
					   struct replmd_private *replmd_private,
					   TALLOC_CTX *mem_ctx,
					   struct ldb_message_element *el,
					   struct parsed_dn **pdn,
					   const char *ldap_oid,
					   struct ldb_request *parent)
{
	int ret;
	if (el == NULL) {
		*pdn = NULL;
		return LDB_SUCCESS;
	}

	if (!replmd_private->sorted_links) {
		 
		ret = get_parsed_dns(module, mem_ctx, el, pdn, ldap_oid,
				      parent);
		if (ret != LDB_SUCCESS) {
			return ret;
		}
	} else {
		ret = get_parsed_dns_trusted(mem_ctx, el, pdn);
		if (ret != LDB_SUCCESS) {
			ldb_module_oom(module);
			return LDB_ERR_OPERATIONS_ERROR;
		}
	}

	 

	ret = replmd_check_upgrade_links(ldb_module_get_ctx(module),
					 *pdn, el->num_values,
					 el,
					 ldap_oid);
	if (ret != LDB_SUCCESS) {
		return ret;
	}

	return LDB_SUCCESS;
}