From d2b711ae9bfa83a1f30cc9ca85d8c9cd33e565e4 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 11 Dec 2018 17:17:46 +0100 Subject: vfs: Use dom_sid_str_buf Signed-off-by: Volker Lendecke Reviewed-by: Gary Lockyer (cherry picked from commit 59f29acb2cd947d2f594a5af3d73d0cbe8298d92) --- source3/modules/nfs4_acls.c | 14 ++++++++++---- source3/modules/vfs_afsacl.c | 6 ++++-- source3/modules/vfs_default.c | 6 ++++-- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/source3/modules/nfs4_acls.c b/source3/modules/nfs4_acls.c index 19f0fefdb98..7776caa16d2 100644 --- a/source3/modules/nfs4_acls.c +++ b/source3/modules/nfs4_acls.c @@ -317,6 +317,7 @@ static bool smbacl4_nfs42win(TALLOC_CTX *mem_ctx, for (aceint = acl->first; aceint != NULL; aceint = aceint->next) { uint32_t mask; struct dom_sid sid; + struct dom_sid_buf buf; SMB_ACE4PROP_T *ace = &aceint->prop; uint32_t win_ace_flags; @@ -349,7 +350,7 @@ static bool smbacl4_nfs42win(TALLOC_CTX *mem_ctx, } } DEBUG(10, ("mapped %d to %s\n", ace->who.id, - sid_string_dbg(&sid))); + dom_sid_str_buf(&sid, &buf))); if (!is_directory && params->map_full_control) { /* @@ -655,7 +656,10 @@ static bool smbacl4_fill_ace4( SMB_ACE4PROP_T *ace_v4 /* output */ ) { - DEBUG(10, ("got ace for %s\n", sid_string_dbg(&ace_nt->trustee))); + struct dom_sid_buf buf; + + DEBUG(10, ("got ace for %s\n", + dom_sid_str_buf(&ace_nt->trustee, &buf))); ZERO_STRUCTP(ace_v4); @@ -738,7 +742,7 @@ static bool smbacl4_fill_ace4( DEBUG(1, ("nfs4_acls.c: file [%s]: could not " "convert %s to uid or gid\n", filename->base_name, - sid_string_dbg(&ace_nt->trustee))); + dom_sid_str_buf(&ace_nt->trustee, &buf))); return false; } } @@ -882,9 +886,11 @@ static struct SMB4ACL_T *smbacl4_win2nfs4( if (!smbacl4_fill_ace4(fsp->fsp_name, pparams, ownerUID, ownerGID, dacl->aces + i, &ace_v4)) { + struct dom_sid_buf buf; DEBUG(3, ("Could not fill ace for file %s, SID %s\n", filename, - sid_string_dbg(&((dacl->aces+i)->trustee)))); + dom_sid_str_buf(&((dacl->aces+i)->trustee), + &buf))); continue; } diff --git a/source3/modules/vfs_afsacl.c b/source3/modules/vfs_afsacl.c index 54c9344a637..a69a99e8d95 100644 --- a/source3/modules/vfs_afsacl.c +++ b/source3/modules/vfs_afsacl.c @@ -761,8 +761,9 @@ static bool nt_to_afs_acl(const char *filename, } if (!mappable_sid(&ace->trustee)) { + struct dom_sid_buf buf; DEBUG(10, ("Ignoring unmappable SID %s\n", - sid_string_dbg(&ace->trustee))); + dom_sid_str_buf(&ace->trustee, &buf))); continue; } @@ -791,8 +792,9 @@ static bool nt_to_afs_acl(const char *filename, if (!lookup_sid(talloc_tos(), &ace->trustee, &dom_name, &name, &name_type)) { + struct dom_sid_buf buf; DEBUG(1, ("AFSACL: Could not lookup SID %s on file %s\n", - sid_string_dbg(&ace->trustee), + dom_sid_str_buf(&ace->trustee, &buf), filename)); continue; } diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c index 7dfa335190c..8aaa991781e 100644 --- a/source3/modules/vfs_default.c +++ b/source3/modules/vfs_default.c @@ -1324,6 +1324,7 @@ static NTSTATUS vfswrap_fsctl(struct vfs_handle_struct *handle, * but I have to check that --metze */ struct dom_sid sid; + struct dom_sid_buf buf; uid_t uid; size_t sid_len; @@ -1343,11 +1344,12 @@ static NTSTATUS vfswrap_fsctl(struct vfs_handle_struct *handle, if (!sid_parse(_in_data + 4, sid_len, &sid)) { return NT_STATUS_INVALID_PARAMETER; } - DEBUGADD(10, ("for SID: %s\n", sid_string_dbg(&sid))); + DEBUGADD(10, ("for SID: %s\n", + dom_sid_str_buf(&sid, &buf))); if (!sid_to_uid(&sid, &uid)) { DEBUG(0,("sid_to_uid: failed, sid[%s] sid_len[%lu]\n", - sid_string_dbg(&sid), + dom_sid_str_buf(&sid, &buf), (unsigned long)sid_len)); uid = (-1); } -- cgit v1.2.1