1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

s3: smbd: Pass full fsp to file_ntimes()

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
This commit is contained in:
Samuel Cabrero 2021-04-13 17:05:57 +02:00 committed by Samuel Cabrero
parent bccbc5bb1e
commit 1196903231
4 changed files with 10 additions and 8 deletions

View File

@ -1203,7 +1203,8 @@ NTSTATUS file_set_sparse(connection_struct *conn,
than POSIX.
*******************************************************************/
int file_ntimes(connection_struct *conn, const struct smb_filename *smb_fname,
int file_ntimes(connection_struct *conn,
files_struct *fsp,
struct smb_file_time *ft)
{
int ret = -1;
@ -1230,7 +1231,7 @@ int file_ntimes(connection_struct *conn, const struct smb_filename *smb_fname,
return 0;
}
if(SMB_VFS_NTIMES(conn, smb_fname, ft) == 0) {
if (SMB_VFS_NTIMES(conn, fsp->fsp_name, ft) == 0) {
return 0;
}
@ -1250,12 +1251,12 @@ int file_ntimes(connection_struct *conn, const struct smb_filename *smb_fname,
/* Check if we have write access. */
if (can_write_to_file(conn,
conn->cwd_fsp,
smb_fname))
conn->cwd_fsp,
fsp->fsp_name))
{
/* We are allowed to become root and change the filetime. */
become_root();
ret = SMB_VFS_NTIMES(conn, smb_fname, ft);
ret = SMB_VFS_NTIMES(conn, fsp->fsp_name, ft);
unbecome_root();
}

View File

@ -224,7 +224,7 @@ NTSTATUS vfs_default_durable_disconnect(struct files_struct *fsp,
if (!is_omit_timespec(&ft.mtime)) {
round_timespec(conn->ts_res, &ft.mtime);
file_ntimes(conn, fsp->fsp_name, &ft);
file_ntimes(conn, fsp, &ft);
}
ok = mark_share_mode_disconnected(lck, fsp);

View File

@ -284,7 +284,8 @@ int file_set_dosmode(connection_struct *conn,
NTSTATUS file_set_sparse(connection_struct *conn,
struct files_struct *fsp,
bool sparse);
int file_ntimes(connection_struct *conn, const struct smb_filename *smb_fname,
int file_ntimes(connection_struct *conn,
files_struct *fsp,
struct smb_file_time *ft);
bool set_sticky_write_time_path(struct file_id fileid, struct timespec mtime);
bool set_sticky_write_time_fsp(struct files_struct *fsp,

View File

@ -6622,7 +6622,7 @@ NTSTATUS smb_set_file_time(connection_struct *conn,
DEBUG(10,("smb_set_file_time: setting utimes to modified values.\n"));
ret = file_ntimes(conn, set_fsp->fsp_name, ft);
ret = file_ntimes(conn, set_fsp, ft);
if (ret != 0) {
return map_nt_error_from_unix(errno);
}