diff options
Diffstat (limited to 'source3')
-rw-r--r-- | source3/smbd/trans2.c | 10 | ||||
-rw-r--r-- | source3/smbd/vfs.c | 7 |
2 files changed, 16 insertions, 1 deletions
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index 60becc95f6..0394113408 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -3779,6 +3779,11 @@ static NTSTATUS smb_set_file_time(connection_struct *conn, const SMB_STRUCT_STAT *psbuf, struct utimbuf tvs) { + uint32 action = + FILE_NOTIFY_CHANGE_LAST_ACCESS + |FILE_NOTIFY_CHANGE_LAST_WRITE; + + if (!VALID_STAT(*psbuf)) { return NT_STATUS_OBJECT_NAME_NOT_FOUND; } @@ -3786,10 +3791,12 @@ static NTSTATUS smb_set_file_time(connection_struct *conn, /* get some defaults (no modifications) if any info is zero or -1. */ if (null_mtime(tvs.actime)) { tvs.actime = psbuf->st_atime; + action &= ~FILE_NOTIFY_CHANGE_LAST_ACCESS; } if (null_mtime(tvs.modtime)) { tvs.modtime = psbuf->st_mtime; + action &= ~FILE_NOTIFY_CHANGE_LAST_WRITE; } DEBUG(6,("smb_set_file_time: actime: %s " , ctime(&tvs.actime))); @@ -3826,6 +3833,9 @@ static NTSTATUS smb_set_file_time(connection_struct *conn, if(file_utime(conn, fname, &tvs)!=0) { return map_nt_error_from_unix(errno); } + if (action != 0) { + notify_fname(conn, NOTIFY_ACTION_MODIFIED, action, fname); + } return NT_STATUS_OK; } diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c index df81b2936d..82ea602187 100644 --- a/source3/smbd/vfs.c +++ b/source3/smbd/vfs.c @@ -514,8 +514,13 @@ int vfs_set_filelen(files_struct *fsp, SMB_OFF_T len) release_level_2_oplocks_on_change(fsp); DEBUG(10,("vfs_set_filelen: ftruncate %s to len %.0f\n", fsp->fsp_name, (double)len)); flush_write_cache(fsp, SIZECHANGE_FLUSH); - if ((ret = SMB_VFS_FTRUNCATE(fsp, fsp->fh->fd, len)) != -1) + if ((ret = SMB_VFS_FTRUNCATE(fsp, fsp->fh->fd, len)) != -1) { set_filelen_write_cache(fsp, len); + notify_fname(fsp->conn, NOTIFY_ACTION_MODIFIED, + FILE_NOTIFY_CHANGE_SIZE + | FILE_NOTIFY_CHANGE_ATTRIBUTES, + fsp->fsp_name); + } return ret; } |