]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: smbd: SMB1 UNIX extensions - POSIX mknod should just create the object, not chang...
authorJeremy Allison <jra@samba.org>
Tue, 15 Oct 2019 20:39:00 +0000 (13:39 -0700)
committerJeremy Allison <jra@samba.org>
Wed, 6 Nov 2019 18:08:40 +0000 (18:08 +0000)
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
source3/smbd/trans2.c

index 59821baeddf95ee9eb2c246a0ee1f37e5b6f965f..24a1ad083de355eec327c861f27530764af3d7c2 100644 (file)
@@ -8108,7 +8108,6 @@ static NTSTATUS smb_set_file_unix_basic(connection_struct *conn,
        files_struct *all_fsps = NULL;
        bool modify_mtime = true;
        struct file_id id;
-       struct smb_filename *smb_fname_tmp = NULL;
        SMB_STRUCT_STAT sbuf;
 
        ZERO_STRUCT(ft);
@@ -8160,42 +8159,10 @@ static NTSTATUS smb_set_file_unix_basic(connection_struct *conn,
                 * a new info level should be used for mknod. JRA.
                 */
 
-               status = smb_unix_mknod(conn,
+               return smb_unix_mknod(conn,
                                        pdata,
                                        total_data,
                                        smb_fname);
-               if (!NT_STATUS_IS_OK(status)) {
-                       return status;
-               }
-
-               smb_fname_tmp = cp_smb_filename(talloc_tos(), smb_fname);
-               if (smb_fname_tmp == NULL) {
-                       return NT_STATUS_NO_MEMORY;
-               }
-
-               if (SMB_VFS_STAT(conn, smb_fname_tmp) != 0) {
-                       status = map_nt_error_from_unix(errno);
-                       TALLOC_FREE(smb_fname_tmp);
-                       SMB_VFS_UNLINKAT(conn,
-                               conn->cwd_fsp,
-                               smb_fname,
-                               0);
-                       return status;
-               }
-
-               sbuf = smb_fname_tmp->st;
-               smb_fname = smb_fname_tmp;
-
-               /* Ensure we don't try and change anything else. */
-               raw_unixmode = SMB_MODE_NO_CHANGE;
-               size = get_file_size_stat(&sbuf);
-               ft.atime = sbuf.st_ex_atime;
-               ft.mtime = sbuf.st_ex_mtime;
-               /* 
-                * We continue here as we might want to change the 
-                * owner uid/gid.
-                */
-               delete_on_fail = True;
        }
 
 #if 1