static NTSTATUS pdb_samba_dsdb_create_alias(struct pdb_methods *m,
				     const char *name, uint32_t *rid)
{
	TALLOC_CTX *frame = talloc_stackframe();
	struct pdb_samba_dsdb_state *state = talloc_get_type_abort(
		m->private_data, struct pdb_samba_dsdb_state);
	struct dom_sid *sid;

	struct ldb_dn *dn;
	NTSTATUS status;

	/* Internally this uses transactions to ensure all the steps
	 * happen or fail as one */
	status = dsdb_add_domain_alias(state->ldb, frame, name, &sid, &dn);
	if (!NT_STATUS_IS_OK(status)) {
		TALLOC_FREE(frame);
	}

	sid_peek_rid(sid, rid);
	TALLOC_FREE(frame);
	return NT_STATUS_OK;
}
static NTSTATUS pdb_samba_dsdb_create_alias(struct pdb_methods *m,
				     const char *name, uint32_t *rid)
{
	TALLOC_CTX *frame = talloc_stackframe();
	struct pdb_samba_dsdb_state *state = talloc_get_type_abort(
		m->private_data, struct pdb_samba_dsdb_state);
	struct dom_sid *sid;

	struct ldb_dn *dn;
	NTSTATUS status;

	 
	status = dsdb_add_domain_alias(state->ldb, frame, name, &sid, &dn);
	if (!NT_STATUS_IS_OK(status)) {
		TALLOC_FREE(frame);
	}

	sid_peek_rid(sid, rid);
	TALLOC_FREE(frame);
	return NT_STATUS_OK;
}