]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: smbd: Change close_remove_share_mode() to call SMB_VFS_UNLINKAT().
authorJeremy Allison <jra@samba.org>
Fri, 13 Sep 2019 19:25:10 +0000 (12:25 -0700)
committerRalph Boehme <slow@samba.org>
Thu, 26 Sep 2019 17:20:48 +0000 (17:20 +0000)
Use conn->cwd_fsp as current fsp. Rework to modern standards.

No logic change for now.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/smbd/close.c

index a9d570a36d4ffb7ddb05b71216f798af7b3e2452..c441f4eb5bcca689e0938cb7fa51af18a7d255a5 100644 (file)
@@ -303,6 +303,7 @@ static NTSTATUS close_remove_share_mode(files_struct *fsp,
        const struct security_token *del_nt_token = NULL;
        bool got_tokens = false;
        bool normal_close;
+       int ret;
 
        /* Ensure any pending write time updates are done. */
        if (fsp->update_write_time_event) {
@@ -483,7 +484,11 @@ static NTSTATUS close_remove_share_mode(files_struct *fsp,
        }
 
 
-       if (SMB_VFS_UNLINK(conn, fsp->fsp_name) != 0) {
+       ret = SMB_VFS_UNLINKAT(conn,
+                       conn->cwd_fsp,
+                       fsp->fsp_name,
+                       0);
+       if (ret != 0) {
                /*
                 * This call can potentially fail as another smbd may
                 * have had the file open with delete on close set and