vfs_gpfs: Request DENY_DELETE sharemode when possible
authorChristof Schmitt <cs@samba.org>
Wed, 23 Aug 2017 19:37:08 +0000 (12:37 -0700)
committerRalph Boehme <slow@samba.org>
Mon, 4 Sep 2017 12:08:45 +0000 (14:08 +0200)
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph B√∂hme <slow@samba.org>
Autobuild-Date(master): Mon Sep  4 14:08:45 CEST 2017 on sn-devel-144

source3/modules/vfs_gpfs.c

index 012b9331701840aa767fb954070eeef620e21a62..e94c9cc4f1d83e458f2c01980133bebe5764c418 100644 (file)
@@ -99,6 +99,15 @@ static bool set_gpfs_sharemode(files_struct *fsp, uint32_t access_mask,
                        0 : GPFS_DENY_WRITE;
                deny |= (share_access & (FILE_SHARE_READ)) ?
                        0 : GPFS_DENY_READ;
+
+               /*
+                * GPFS_DENY_DELETE can only be set together with either
+                * GPFS_DENY_WRITE or GPFS_DENY_READ.
+                */
+               if (deny & (GPFS_DENY_WRITE|GPFS_DENY_READ)) {
+                       deny |= (share_access & (FILE_SHARE_DELETE)) ?
+                               0 : GPFS_DENY_DELETE;
+               }
        }
        DEBUG(10, ("am=%x, allow=%d, sa=%x, deny=%d\n",
                   access_mask, allow, share_access, deny));