dsdb: Use dom_sid_str_buf
authorVolker Lendecke <vl@samba.org>
Thu, 18 Oct 2018 03:57:26 +0000 (05:57 +0200)
committerJeremy Allison <jra@samba.org>
Fri, 2 Nov 2018 20:21:14 +0000 (21:21 +0100)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source4/dsdb/samdb/ldb_modules/operational.c

index cdcec1c10463c7ab076c344cde746b48d00a4ace..8dad9517ced105c4259f9e140d52b4fa2b896922 100644 (file)
@@ -1071,13 +1071,12 @@ static int pso_search_by_sids(struct ldb_module *module, TALLOC_CTX *mem_ctx,
        sid_filter = talloc_strdup(mem_ctx, "");
 
        for (i = 0; sid_filter && i < num_sids; i++) {
-               char sid_buf[DOM_SID_STR_BUFLEN] = {0,};
+               struct dom_sid_buf sid_buf;
 
-               dom_sid_string_buf(&sid_array[i], sid_buf, sizeof(sid_buf));
-
-               sid_filter = talloc_asprintf_append(sid_filter,
-                                                   "(msDS-PSOAppliesTo=<SID=%s>)",
-                                                   sid_buf);
+               sid_filter = talloc_asprintf_append(
+                       sid_filter,
+                       "(msDS-PSOAppliesTo=<SID=%s>)",
+                       dom_sid_str_buf(&sid_array[i], &sid_buf));
        }
 
        if (sid_filter == NULL) {