summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2007-02-03 16:53:52 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:17:41 -0500
commit43101d6dd5bf3f4c805e3c23bf5c2a5e3c85d284 (patch)
treeec94eb14379000ac0825bb68f5cb1184d05cd9be /source3/smbd
parent4c484662d63e1ce00afc9dc445579dc73122b360 (diff)
downloadsamba-43101d6dd5bf3f4c805e3c23bf5c2a5e3c85d284.tar.gz
samba-43101d6dd5bf3f4c805e3c23bf5c2a5e3c85d284.tar.bz2
samba-43101d6dd5bf3f4c805e3c23bf5c2a5e3c85d284.zip
r21131: Some notify fixes
(This used to be commit b9300e1d5acba4e2537fcc6631d1ee4d53685f64)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/trans2.c10
-rw-r--r--source3/smbd/vfs.c7
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;
}