diff options
author | Jeremy Allison <jra@samba.org> | 2019-10-15 13:39:00 -0700 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2019-11-06 18:08:40 +0000 |
commit | b784aee40ffceae8332ff3aaa74c20539857ded6 (patch) | |
tree | 63683fa5c6c1003e376f13765049fa37e8f7a019 | |
parent | d8567d46bd7e371de83e4d1ee1592639eb6f0c06 (diff) | |
download | samba-b784aee40ffceae8332ff3aaa74c20539857ded6.tar.gz |
s3: smbd: SMB1 UNIX extensions - POSIX mknod should just create the object, not change attributes after.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
-rw-r--r-- | source3/smbd/trans2.c | 35 |
1 files changed, 1 insertions, 34 deletions
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 |