1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-03 01:18:10 +03:00

lsasrv: Simplify dcesrv_lsa_AddRemoveAccountRights()

Use dom_sid_string_buf, no need to talloc.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
This commit is contained in:
Volker Lendecke 2024-09-20 15:46:01 +02:00 committed by Ralph Boehme
parent 7c4d1f9de1
commit 4f727b919a

View File

@ -3059,7 +3059,8 @@ static NTSTATUS dcesrv_lsa_AddRemoveAccountRights(struct dcesrv_call_state *dce_
{
struct auth_session_info *session_info =
dcesrv_call_session_info(dce_call);
const char *sidstr, *sidndrstr;
struct dom_sid_buf sidbuf;
const char *sidndrstr = NULL;
struct ldb_message *msg;
struct ldb_message_element *el;
int ret;
@ -3084,13 +3085,7 @@ static NTSTATUS dcesrv_lsa_AddRemoveAccountRights(struct dcesrv_call_state *dce_
return NT_STATUS_NO_MEMORY;
}
sidstr = dom_sid_string(msg, sid);
if (sidstr == NULL) {
TALLOC_FREE(msg);
return NT_STATUS_NO_MEMORY;
}
dnstr = talloc_asprintf(msg, "sid=%s", sidstr);
dnstr = talloc_asprintf(msg, "sid=%s", dom_sid_str_buf(sid, &sidbuf));
if (dnstr == NULL) {
TALLOC_FREE(msg);
return NT_STATUS_NO_MEMORY;