From: Jeremy Allison Date: Tue, 15 Oct 2019 20:39:00 +0000 (-0700) Subject: s3: smbd: SMB1 UNIX extensions - POSIX mknod should just create the object, not chang... X-Git-Tag: talloc-2.3.1~130 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b784aee40ffceae8332ff3aaa74c20539857ded6;p=thirdparty%2Fsamba.git s3: smbd: SMB1 UNIX extensions - POSIX mknod should just create the object, not change attributes after. Signed-off-by: Jeremy Allison Reviewed-by: Volker Lendecke --- diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index 59821baeddf..24a1ad083de 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -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