From: Jeremy Allison Date: Fri, 13 Sep 2019 19:25:10 +0000 (-0700) Subject: s3: smbd: Change close_remove_share_mode() to call SMB_VFS_UNLINKAT(). X-Git-Tag: talloc-2.3.1~611 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f8cff71e5f9edb97a3817bc259c0aeec6fbdba7f;p=thirdparty%2Fsamba.git s3: smbd: Change close_remove_share_mode() to call SMB_VFS_UNLINKAT(). Use conn->cwd_fsp as current fsp. Rework to modern standards. No logic change for now. Signed-off-by: Jeremy Allison Reviewed-by: Ralph Boehme --- diff --git a/source3/smbd/close.c b/source3/smbd/close.c index a9d570a36d4..c441f4eb5bc 100644 --- a/source3/smbd/close.c +++ b/source3/smbd/close.c @@ -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