static int idmap_msg_add_dom_sid(struct idmap_context *idmap_ctx,
		TALLOC_CTX *mem_ctx, struct ldb_message *msg,
		const char *attr_name, const struct dom_sid *sid)
{
	struct ldb_val val;
	enum ndr_err_code ndr_err;

	ndr_err = ndr_push_struct_blob(&val, mem_ctx, sid,
				       (ndr_push_flags_fn_t)ndr_push_dom_sid);

	if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
		return -1;
	}

	return ldb_msg_add_value(msg, attr_name, &val, NULL);
}
static int idmap_msg_add_dom_sid(struct idmap_context *idmap_ctx,
		TALLOC_CTX *mem_ctx, struct ldb_message *msg,
		const char *attr_name, const struct dom_sid *sid)
{
	struct ldb_val val;
	enum ndr_err_code ndr_err;

	ndr_err = ndr_push_struct_blob(&val, mem_ctx, sid,
				       (ndr_push_flags_fn_t)ndr_push_dom_sid);

	if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
		return -1;
	}

	return ldb_msg_add_value(msg, attr_name, &val, NULL);
}