idmap: Use dom_sid_str_buf
authorVolker Lendecke <vl@samba.org>
Thu, 18 Oct 2018 04:08:32 +0000 (06:08 +0200)
committerJeremy Allison <jra@samba.org>
Fri, 2 Nov 2018 20:21:15 +0000 (21:21 +0100)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/winbindd/idmap_script.c

index 7b7f8844c36c7301ed0948225dc73268f6a72045..e4de1a09ba0b45eceb40e976b803de002f12c3df 100644 (file)
@@ -333,7 +333,7 @@ static struct tevent_req *idmap_script_sid2xid_send(
 {
        struct tevent_req *req, *subreq;
        struct idmap_script_sid2xid_state *state;
-       char sidbuf[DOM_SID_STR_BUFLEN];
+       struct dom_sid_buf sidbuf;
 
        req = tevent_req_create(mem_ctx, &state,
                                struct idmap_script_sid2xid_state);
@@ -342,10 +342,11 @@ static struct tevent_req *idmap_script_sid2xid_send(
        }
        state->idx = idx;
 
-       dom_sid_string_buf(sid, sidbuf, sizeof(sidbuf));
-
-       state->syscmd = talloc_asprintf(state, "%s SIDTOID %s",
-                                       script, sidbuf);
+       state->syscmd = talloc_asprintf(
+               state,
+               "%s SIDTOID %s",
+               script,
+               dom_sid_str_buf(sid, &sidbuf));
        if (tevent_req_nomem(state->syscmd, req)) {
                return tevent_req_post(req, ev);
        }