s3: smbd: vfs_fruit: Replace code in check_ms_nfs() with remove_virtual_nfs_aces().
authorJeremy Allison <jra@samba.org>
Thu, 15 Mar 2018 16:54:41 +0000 (09:54 -0700)
committerKarolin Seeger <kseeger@samba.org>
Fri, 6 Apr 2018 06:21:12 +0000 (08:21 +0200)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13319

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
(cherry picked from commit a3c925d80433e3d4fe1b1b315edf6520cacf0a9e)

source3/modules/vfs_fruit.c

index 67af69843ed99311d481287e9e11ac926ad58c29..38f421c337d5356793eaee56f0242f15bf260441 100644 (file)
@@ -3006,9 +3006,6 @@ static NTSTATUS check_ms_nfs(vfs_handle_struct *handle,
 {
        uint32_t i;
        struct fruit_config_data *config = NULL;
-       struct dom_sid sid;
-       NTSTATUS status = NT_STATUS_OK;
-       bool remove_ok = false;
 
        *pdo_chmod = false;
 
@@ -3042,40 +3039,7 @@ static NTSTATUS check_ms_nfs(vfs_handle_struct *handle,
         * fruit_fget_nt_acl().
         */
 
-       /* MS NFS style mode */
-       sid_compose(&sid, &global_sid_Unix_NFS_Mode,
-                   fsp->fsp_name->st.st_ex_mode);
-       status = security_descriptor_dacl_del(psd, &sid);
-       remove_ok = (NT_STATUS_IS_OK(status) ||
-                    NT_STATUS_EQUAL(status, NT_STATUS_OBJECT_NAME_NOT_FOUND));
-       if (!remove_ok) {
-               DBG_WARNING("failed to remove MS NFS_mode style ACE\n");
-               return status;
-       }
-
-       /* MS NFS style uid */
-       sid_compose(&sid, &global_sid_Unix_NFS_Users,
-                   fsp->fsp_name->st.st_ex_uid);
-       status = security_descriptor_dacl_del(psd, &sid);
-       remove_ok = (NT_STATUS_IS_OK(status) ||
-                    NT_STATUS_EQUAL(status, NT_STATUS_OBJECT_NAME_NOT_FOUND));
-       if (!remove_ok) {
-               DBG_WARNING("failed to remove MS NFS_users style ACE\n");
-               return status;
-       }
-
-       /* MS NFS style gid */
-       sid_compose(&sid, &global_sid_Unix_NFS_Groups,
-                   fsp->fsp_name->st.st_ex_gid);
-       status = security_descriptor_dacl_del(psd, &sid);
-       remove_ok = (NT_STATUS_IS_OK(status) ||
-                    NT_STATUS_EQUAL(status, NT_STATUS_OBJECT_NAME_NOT_FOUND));
-       if (!remove_ok) {
-               DBG_WARNING("failed to remove MS NFS_groups style ACE\n");
-               return status;
-       }
-
-       return NT_STATUS_OK;
+       return remove_virtual_nfs_aces(psd);
 }
 
 /****************************************************************************