]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: smbd: Change smb_set_file_unix_basic() to call SMB_VFS_UNLINKAT() in 3 places.
authorJeremy Allison <jra@samba.org>
Fri, 13 Sep 2019 18:33:53 +0000 (11:33 -0700)
committerRalph Boehme <slow@samba.org>
Thu, 26 Sep 2019 17:20:48 +0000 (17:20 +0000)
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 <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/smbd/trans2.c

index 7c1e020324b7d9990b5376300fe75b34c67fa59d..bc4b3934c83d242d6924ba13d735e96e34c941e6 100644 (file)
@@ -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;
                }