1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

s3: smbd: Fix smbd crash on dangling symlink with posix connection calling several non-posix info levels.

Tidy up fsp == NULL checks. Remove knownfail.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14742

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>

Autobuild-User(master): Noel Power <npower@samba.org>
Autobuild-Date(master): Wed Jun 16 11:58:00 UTC 2021 on sn-devel-184
This commit is contained in:
Jeremy Allison 2021-06-15 15:42:33 -07:00 committed by Noel Power
parent ac10058d7f
commit 263c95aee3
2 changed files with 13 additions and 3 deletions

View File

@ -1,2 +0,0 @@
^samba3.smbtorture_s3.crypt.POSIX-SYMLINK-SETPATHINFO.smbtorture\(nt4_dc_smb1\)
^samba3.smbtorture_s3.plain.POSIX-SYMLINK-SETPATHINFO.smbtorture\(nt4_dc_smb1\)

View File

@ -744,6 +744,10 @@ NTSTATUS set_ea(connection_struct *conn, files_struct *fsp,
return NT_STATUS_EAS_NOT_SUPPORTED;
}
if (fsp == NULL) {
return NT_STATUS_INVALID_HANDLE;
}
posix_pathnames = (fsp->fsp_name->flags & SMB_FILENAME_POSIX_PATH);
status = refuse_symlink_fsp(fsp);
@ -6862,7 +6866,7 @@ static NTSTATUS smb_set_file_full_ea_info(connection_struct *conn,
struct ea_list *ea_list = NULL;
NTSTATUS status;
if (!fsp) {
if (fsp == NULL) {
return NT_STATUS_INVALID_HANDLE;
}
@ -7887,6 +7891,10 @@ static NTSTATUS smb_set_file_basic_info(connection_struct *conn,
return NT_STATUS_INVALID_PARAMETER;
}
if (fsp == NULL) {
return NT_STATUS_INVALID_HANDLE;
}
status = check_access_fsp(fsp, FILE_WRITE_ATTRIBUTES);
if (!NT_STATUS_IS_OK(status)) {
return status;
@ -7944,6 +7952,10 @@ static NTSTATUS smb_set_info_standard(connection_struct *conn,
return NT_STATUS_INVALID_PARAMETER;
}
if (fsp == NULL) {
return NT_STATUS_INVALID_HANDLE;
}
/* create time */
ft.create_time = time_t_to_full_timespec(srv_make_unix_date2(pdata));
/* access time */