From: Jeremy Allison Date: Fri, 13 Sep 2019 18:33:53 +0000 (-0700) Subject: s3: smbd: Change smb_set_file_unix_basic() to call SMB_VFS_UNLINKAT() in 3 places. X-Git-Tag: talloc-2.3.1~613 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=24516e78eebbb30df09f85cdeacf6d1ad2635d32;p=thirdparty%2Fsamba.git s3: smbd: Change smb_set_file_unix_basic() to call SMB_VFS_UNLINKAT() in 3 places. Use conn->cwd_fsp as current fsp. This is horrible code and must be removed. No logic change for now. Signed-off-by: Jeremy Allison Reviewed-by: Ralph Boehme --- diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index 7c1e020324b..bc4b3934c83 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -8164,7 +8164,10 @@ static NTSTATUS smb_set_file_unix_basic(connection_struct *conn, if (SMB_VFS_STAT(conn, smb_fname_tmp) != 0) { status = map_nt_error_from_unix(errno); TALLOC_FREE(smb_fname_tmp); - SMB_VFS_UNLINK(conn, smb_fname); + SMB_VFS_UNLINKAT(conn, + conn->cwd_fsp, + smb_fname, + 0); return status; } @@ -8241,7 +8244,10 @@ static NTSTATUS smb_set_file_unix_basic(connection_struct *conn, if (ret != 0) { status = map_nt_error_from_unix(errno); if (delete_on_fail) { - SMB_VFS_UNLINK(conn, smb_fname); + SMB_VFS_UNLINKAT(conn, + conn->cwd_fsp, + smb_fname, + 0); } return status; } @@ -8272,7 +8278,10 @@ static NTSTATUS smb_set_file_unix_basic(connection_struct *conn, if (ret != 0) { status = map_nt_error_from_unix(errno); if (delete_on_fail) { - SMB_VFS_UNLINK(conn, smb_fname); + SMB_VFS_UNLINKAT(conn, + conn->cwd_fsp, + smb_fname, + 0); } return status; }