From 43101d6dd5bf3f4c805e3c23bf5c2a5e3c85d284 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 3 Feb 2007 16:53:52 +0000 Subject: r21131: Some notify fixes (This used to be commit b9300e1d5acba4e2537fcc6631d1ee4d53685f64) --- source3/smbd/trans2.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'source3/smbd/trans2.c') 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; } -- cgit