static int replmd_add_make_extended_dn(struct ldb_request *req,
				       const DATA_BLOB *guid_blob,
				       struct ldb_dn **_extended_dn)
{
	int ret;
        const DATA_BLOB *sid_blob;
	/* Calculate an extended DN for any linked attributes */
	struct ldb_dn *extended_dn = ldb_dn_copy(req, req->op.add.message->dn);
	if (!extended_dn) {
		return LDB_ERR_OPERATIONS_ERROR;
	}
	ret = ldb_dn_set_extended_component(extended_dn, "GUID", guid_blob);
	if (ret != LDB_SUCCESS) {
		return ret;
	}

	sid_blob = ldb_msg_find_ldb_val(req->op.add.message, "objectSID");
	if (sid_blob != NULL) {
		ret = ldb_dn_set_extended_component(extended_dn, "SID", sid_blob);
		if (ret != LDB_SUCCESS) {
			return ret;
		}
	}
	*_extended_dn = extended_dn;
	return LDB_SUCCESS;
}
static int replmd_add_make_extended_dn(struct ldb_request *req,
				       const DATA_BLOB *guid_blob,
				       struct ldb_dn **_extended_dn)
{
	int ret;
        const DATA_BLOB *sid_blob;
	 
	struct ldb_dn *extended_dn = ldb_dn_copy(req, req->op.add.message->dn);
	if (!extended_dn) {
		return LDB_ERR_OPERATIONS_ERROR;
	}
	ret = ldb_dn_set_extended_component(extended_dn, "GUID", guid_blob);
	if (ret != LDB_SUCCESS) {
		return ret;
	}

	sid_blob = ldb_msg_find_ldb_val(req->op.add.message, "objectSID");
	if (sid_blob != NULL) {
		ret = ldb_dn_set_extended_component(extended_dn, "SID", sid_blob);
		if (ret != LDB_SUCCESS) {
			return ret;
		}
	}
	*_extended_dn = extended_dn;
	return LDB_SUCCESS;
}