]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
vfs_gpfs: Cleanup clearing file system share mode
authorChristof Schmitt <cs@samba.org>
Fri, 3 Jan 2020 18:40:50 +0000 (11:40 -0700)
committerJeremy Allison <jra@samba.org>
Wed, 8 Jan 2020 00:01:36 +0000 (00:01 +0000)
The VFS flock function is called with a zero access_mask to indicate
that the share mode should be cleared. Adjust the check to directly
check the access_mask and provide a better message to indicate this
case.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/modules/vfs_gpfs.c

index dde45156ffc08085c86fac7fae2d97fa8036076c..10db72dcd35fa79b7bf1e048289246679c209997 100644 (file)
@@ -121,12 +121,10 @@ static bool set_gpfs_sharemode(files_struct *fsp, uint32_t access_mask,
        unsigned int deny = GPFS_DENY_NONE;
        int result;
 
-       allow = vfs_gpfs_access_mask_to_allow(access_mask);
-
-       if (allow == GPFS_SHARE_NONE) {
-               DEBUG(10, ("special case am=no_access:%x\n",access_mask));
-       }
-       else {
+       if (access_mask == 0) {
+               DBG_DEBUG("Clearing file system share mode.\n");
+       } else {
+               allow = vfs_gpfs_access_mask_to_allow(access_mask);
                deny = vfs_gpfs_share_access_to_deny(share_access);
        }
        DEBUG(10, ("am=%x, allow=%d, sa=%x, deny=%d\n",