vfs: Use dom_sid_str_buf
authorVolker Lendecke <vl@samba.org>
Sat, 8 Dec 2018 14:37:21 +0000 (15:37 +0100)
committerJeremy Allison <jra@samba.org>
Mon, 10 Dec 2018 23:40:31 +0000 (00:40 +0100)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/modules/vfs_acl_common.c
source3/modules/vfs_afsacl.c
source3/modules/vfs_nfs4acl_xattr.c

index 6c0d931bf43cbe77a5a332924dc8682f55e50327..5cc75ca99c0e4afa7b6f1936da950bf67327a25f 100644 (file)
@@ -813,6 +813,7 @@ static NTSTATUS set_underlying_acl(vfs_handle_struct *handle, files_struct *fsp,
 {
        NTSTATUS status;
        const struct security_token *token = NULL;
+       struct dom_sid_buf buf;
 
        status = SMB_VFS_NEXT_FSET_NT_ACL(handle, fsp, security_info_sent, psd);
        if (!NT_STATUS_EQUAL(status, NT_STATUS_ACCESS_DENIED)) {
@@ -840,7 +841,8 @@ static NTSTATUS set_underlying_acl(vfs_handle_struct *handle, files_struct *fsp,
        }
 
        DBG_DEBUG("overriding chown on file %s for sid %s\n",
-                  fsp_str_dbg(fsp), sid_string_tos(psd->owner_sid));
+                 fsp_str_dbg(fsp),
+                 dom_sid_str_buf(psd->owner_sid, &buf));
 
        /* Ok, we failed to chown and we have
           SEC_STD_WRITE_OWNER access - override. */
index 54c9344a637706172978f0db37e1fb0b181223df..d9be513d041ad835c5023fbec1d80746c7304fd1 100644 (file)
@@ -814,10 +814,11 @@ static bool nt_to_afs_acl(const char *filename,
                        }
 
                        if (sidpts) {
+                               struct dom_sid_buf buf;
                                /* Expect all users/groups in pts as SIDs */
                                name = talloc_strdup(
                                        talloc_tos(),
-                                       sid_string_tos(&ace->trustee));
+                                       dom_sid_str_buf(&ace->trustee, &buf));
                                if (name == NULL) {
                                        return false;
                                }
index 0e52782075be97b04ca7f3dd4fe2ed8b0bcde165..65387af2c0ec35f68972822de93e74de675534c1 100644 (file)
@@ -30,6 +30,7 @@
 #include "system/filesys.h"
 #include "smbd/smbd.h"
 #include "libcli/security/security_token.h"
+#include "libcli/security/dom_sid.h"
 #include "nfs4_acls.h"
 #include "librpc/gen_ndr/ndr_nfs4acl.h"
 #include "nfs4acl_xattr.h"
@@ -372,6 +373,7 @@ static NTSTATUS nfs4acl_xattr_fset_nt_acl(vfs_handle_struct *handle,
        mode_t expected_mode;
        mode_t restored_mode;
        bool chown_needed = false;
+       struct dom_sid_buf buf;
        NTSTATUS status;
        int ret;
 
@@ -467,7 +469,8 @@ static NTSTATUS nfs4acl_xattr_fset_nt_acl(vfs_handle_struct *handle,
        }
 
        DBG_DEBUG("overriding chown on file %s for sid %s\n",
-                 fsp_str_dbg(fsp), sid_string_tos(psd->owner_sid));
+                 fsp_str_dbg(fsp),
+                 dom_sid_str_buf(psd->owner_sid, &buf));
 
        become_root();
        status = smb_set_nt_acl_nfs4(handle,