s3: VFS: vfs_fruit. Add struct files_struct *dirfsp parameter to fruit_unlink_rsrc_st...
authorJeremy Allison <jra@samba.org>
Fri, 13 Sep 2019 21:10:16 +0000 (14:10 -0700)
committerRalph Boehme <slow@samba.org>
Thu, 26 Sep 2019 17:20:49 +0000 (17:20 +0000)
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/modules/vfs_fruit.c

index 2a9e8ab495aa43315773e59fcf98feef5bfcb6a4..9edfdffff84936e875ea0de00998c945322efe49 100644 (file)
@@ -1823,8 +1823,9 @@ static int fruit_unlink_meta(vfs_handle_struct *handle,
 }
 
 static int fruit_unlink_rsrc_stream(vfs_handle_struct *handle,
-                                   const struct smb_filename *smb_fname,
-                                   bool force_unlink)
+                               struct files_struct *dirfsp,
+                               const struct smb_filename *smb_fname,
+                               bool force_unlink)
 {
        int ret;
 
@@ -1860,7 +1861,10 @@ static int fruit_unlink_rsrc_stream(vfs_handle_struct *handle,
                }
        }
 
-       ret = SMB_VFS_NEXT_UNLINK(handle, smb_fname);
+       ret = SMB_VFS_NEXT_UNLINKAT(handle,
+                       dirfsp,
+                       smb_fname,
+                       0);
        if ((ret != 0) && (errno == ENOENT) && force_unlink) {
                ret = 0;
        }
@@ -1940,7 +1944,10 @@ static int fruit_unlink_rsrc(vfs_handle_struct *handle,
 
        switch (config->rsrc) {
        case FRUIT_RSRC_STREAM:
-               rc = fruit_unlink_rsrc_stream(handle, smb_fname, force_unlink);
+               rc = fruit_unlink_rsrc_stream(handle,
+                               dirfsp,
+                               smb_fname,
+                               force_unlink);
                break;
 
        case FRUIT_RSRC_ADFILE: