]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
lsa_server4: Simplify get_tdo() with dom_sid_str_buf()
authorVolker Lendecke <vl@samba.org>
Fri, 27 May 2022 16:38:34 +0000 (18:38 +0200)
committerJeremy Allison <jra@samba.org>
Mon, 6 Jun 2022 19:22:28 +0000 (19:22 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source4/rpc_server/lsa/dcesrv_lsa.c

index 4101d6ddd348b95f99a4fa091022721c4a4446b8..8861cf95af85925496befe1a681c072ed5129262 100644 (file)
@@ -1673,7 +1673,6 @@ static NTSTATUS get_tdo(struct ldb_context *sam, TALLOC_CTX *mem_ctx,
        };
        char *dns = NULL;
        char *nbn = NULL;
-       char *sidstr = NULL;
        char *filter;
        int ret;
 
@@ -1712,10 +1711,8 @@ static NTSTATUS get_tdo(struct ldb_context *sam, TALLOC_CTX *mem_ctx,
                }
        }
        if (sid) {
-               sidstr = dom_sid_string(mem_ctx, sid);
-               if (!sidstr) {
-                       return NT_STATUS_INVALID_PARAMETER;
-               }
+               struct dom_sid_buf buf;
+               char *sidstr = dom_sid_str_buf(sid, &buf);
                filter = talloc_asprintf_append(filter,
                                                "(securityIdentifier=%s)",
                                                sidstr);