s3: VFS: vfs_acl_common: Add dirfsp, flags parameters to unlink_acl_common().
authorJeremy Allison <jra@samba.org>
Tue, 17 Sep 2019 00:50:17 +0000 (17:50 -0700)
committerRalph Boehme <slow@samba.org>
Thu, 26 Sep 2019 17:20:48 +0000 (17:20 +0000)
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/modules/vfs_acl_common.c
source3/modules/vfs_acl_common.h
source3/modules/vfs_acl_tdb.c
source3/modules/vfs_acl_xattr.c

index 315dc2bd7612ecd0e9f684df182d5c271f95fbc2..a9d53ff685765d5f54562b9d320473924fba4c5a 100644 (file)
@@ -1204,7 +1204,9 @@ int rmdir_acl_common(struct vfs_handle_struct *handle,
 }
 
 int unlink_acl_common(struct vfs_handle_struct *handle,
-                       const struct smb_filename *smb_fname)
+                       struct files_struct *dirfsp,
+                       const struct smb_filename *smb_fname,
+                       int flags)
 {
        int ret;
 
index f8bc48bf65bfd76e2881c736d1bd9351c793ef64..d36e68c161b7e41c22c4d2da68258e8421cef0ee 100644 (file)
@@ -35,7 +35,9 @@ bool init_acl_common_config(vfs_handle_struct *handle,
 int rmdir_acl_common(struct vfs_handle_struct *handle,
                     const struct smb_filename *smb_fname);
 int unlink_acl_common(struct vfs_handle_struct *handle,
-                     const struct smb_filename *smb_fname);
+                       struct files_struct *dirfsp,
+                       const struct smb_filename *smb_fname,
+                       int flags);
 int chmod_acl_module_common(struct vfs_handle_struct *handle,
                            const struct smb_filename *smb_fname,
                            mode_t mode);
index 451eb4cf23a45d301f7cc7bf4a4be2986605a03f..0e98244ef358933cf34d599eef143a94a60f15ba 100644 (file)
@@ -260,7 +260,10 @@ static int unlink_acl_tdb(vfs_handle_struct *handle,
                goto out;
        }
 
-       ret = unlink_acl_common(handle, smb_fname_tmp);
+       ret = unlink_acl_common(handle,
+                       handle->conn->cwd_fsp,
+                       smb_fname_tmp,
+                       0);
 
        if (ret == -1) {
                goto out;
@@ -303,7 +306,10 @@ static int unlinkat_acl_tdb(vfs_handle_struct *handle,
        if (flags & AT_REMOVEDIR) {
                ret = rmdir_acl_common(handle, smb_fname_tmp);
        } else {
-               ret = unlink_acl_common(handle, smb_fname_tmp);
+               ret = unlink_acl_common(handle,
+                               dirfsp,
+                               smb_fname_tmp,
+                               flags);
        }
 
        if (ret == -1) {
index 82eef211b4b69103bafcc5eee3e57b3d03e12438..37c15ece8cd65c6cefdf644a8f71d8f6b3d219ab 100644 (file)
@@ -281,7 +281,10 @@ static int connect_acl_xattr(struct vfs_handle_struct *handle,
 static int acl_xattr_unlink(vfs_handle_struct *handle,
                         const struct smb_filename *smb_fname)
 {
-       return unlink_acl_common(handle, smb_fname);
+       return unlink_acl_common(handle,
+                               handle->conn->cwd_fsp,
+                               smb_fname,
+                               0);
 }
 
 static int acl_xattr_unlinkat(vfs_handle_struct *handle,
@@ -294,7 +297,10 @@ static int acl_xattr_unlinkat(vfs_handle_struct *handle,
        if (flags & AT_REMOVEDIR) {
                ret = rmdir_acl_common(handle, smb_fname);
        } else {
-               ret = unlink_acl_common(handle, smb_fname);
+               ret = unlink_acl_common(handle,
+                               dirfsp,
+                               smb_fname,
+                               flags);
        }
        return ret;
 }