]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: lib: adouble: Add dirfsp to ad_convert_delete_adfile(). Use UNLINKAT instead...
authorJeremy Allison <jra@samba.org>
Mon, 16 Sep 2019 22:15:05 +0000 (15:15 -0700)
committerRalph Boehme <slow@samba.org>
Thu, 26 Sep 2019 17:20:50 +0000 (17:20 +0000)
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/lib/adouble.c

index 6dde546af886bdf046426b2887f57637bcd68309..5cac5dbd9bb8f91342790489087a825a5c1a9a9a 100644 (file)
@@ -1343,9 +1343,10 @@ static bool ad_convert_blank_rfork(vfs_handle_struct *handle,
 }
 
 static bool ad_convert_delete_adfile(vfs_handle_struct *handle,
-                                    struct adouble *ad,
-                                    const struct smb_filename *smb_fname,
-                                    uint32_t flags)
+                               struct adouble *ad,
+                               struct files_struct *dirfsp,
+                               const struct smb_filename *smb_fname,
+                               uint32_t flags)
 {
        struct smb_filename *ad_name = NULL;
        int rc;
@@ -1363,7 +1364,10 @@ static bool ad_convert_delete_adfile(vfs_handle_struct *handle,
                return false;
        }
 
-       rc = SMB_VFS_NEXT_UNLINK(handle, ad_name);
+       rc = SMB_VFS_NEXT_UNLINKAT(handle,
+                       dirfsp,
+                       ad_name,
+                       0);
        if (rc != 0) {
                DBG_ERR("Unlinking [%s] failed: %s\n",
                        smb_fname_str_dbg(ad_name), strerror(errno));
@@ -1435,7 +1439,11 @@ int ad_convert(struct vfs_handle_struct *handle,
                goto done;
        }
 
-       ok = ad_convert_delete_adfile(handle, ad, smb_fname, flags);
+       ok = ad_convert_delete_adfile(handle,
+                       ad,
+                       dirfsp,
+                       smb_fname,
+                       flags);
        if (!ok) {
                ret = -1;
                goto done;