From: Jeremy Allison Date: Mon, 16 Sep 2019 22:15:05 +0000 (-0700) Subject: s3: lib: adouble: Add dirfsp to ad_convert_delete_adfile(). Use UNLINKAT instead... X-Git-Tag: talloc-2.3.1~594 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0535656284db66dc7bc90fea2f15b1d00a13fe10;p=thirdparty%2Fsamba.git s3: lib: adouble: Add dirfsp to ad_convert_delete_adfile(). Use UNLINKAT instead of UNLINK. Signed-off-by: Jeremy Allison Reviewed-by: Ralph Boehme --- diff --git a/source3/lib/adouble.c b/source3/lib/adouble.c index 6dde546af88..5cac5dbd9bb 100644 --- a/source3/lib/adouble.c +++ b/source3/lib/adouble.c @@ -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;