diff options
author | Volker Lendecke <vl@samba.org> | 2018-10-25 21:45:05 +0200 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2018-11-02 21:21:15 +0100 |
commit | 602d247e0ba9a69c22f087abaf44de7d12114538 (patch) | |
tree | da0d595d0d7f73bcc1e23f7a3141ca1d81c4455b /source4/auth | |
parent | d0a56a55b613ac701bd39236fc7550d87252559b (diff) | |
download | samba-602d247e0ba9a69c22f087abaf44de7d12114538.tar.gz |
auth4: Use dom_sid_str_buf
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source4/auth')
-rw-r--r-- | source4/auth/sam.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/source4/auth/sam.c b/source4/auth/sam.c index bc95de223f4..38c4a248027 100644 --- a/source4/auth/sam.c +++ b/source4/auth/sam.c @@ -632,16 +632,14 @@ _PUBLIC_ NTSTATUS authsam_update_user_info_dc(TALLOC_CTX *mem_ctx, n = user_info_dc->num_sids; for (i = 0; i < n; i++) { struct dom_sid *sid = &user_info_dc->sids[i]; - char sid_buf[DOM_SID_STR_BUFLEN] = {0,}; - char dn_str[DOM_SID_STR_BUFLEN*2] = {0,}; + struct dom_sid_buf sid_buf; + char dn_str[sizeof(sid_buf.buf)*2]; DATA_BLOB dn_blob = data_blob_null; - int len; - len = dom_sid_string_buf(sid, sid_buf, sizeof(sid_buf)); - if ((len < 0) || (len+1 > sizeof(sid_buf))) { - return NT_STATUS_INVALID_SID; - } - snprintf(dn_str, sizeof(dn_str), "<SID=%s>", sid_buf); + snprintf(dn_str, + sizeof(dn_str), + "<SID=%s>", + dom_sid_str_buf(sid, &sid_buf)); dn_blob = data_blob_string_const(dn_str); /* |