summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2009-07-30 13:19:26 -0700
committerJeremy Allison <jra@samba.org>2009-07-30 13:19:26 -0700
commit65165433ecb95a697442fd88723036605ea21186 (patch)
tree6b22b1c61d77767f8a11185414f7af8b3c749edf /source3/smbd
parent84bfd7395c48783fd6fca19effa12561217f65ec (diff)
downloadsamba-65165433ecb95a697442fd88723036605ea21186.tar.gz
samba-65165433ecb95a697442fd88723036605ea21186.tar.bz2
samba-65165433ecb95a697442fd88723036605ea21186.zip
Fix bug #6529 - Offline files conflict with Vista and Office 2003.
We need to send a notify message when a timestamp is changed that can't be reflected in the underlying POSIX filesystem. Jeremy.
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/trans2.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index 93bd9107ac..8cbd259f63 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -5194,6 +5194,8 @@ NTSTATUS smb_set_file_time(connection_struct *conn,
uint32 action =
FILE_NOTIFY_CHANGE_LAST_ACCESS
|FILE_NOTIFY_CHANGE_LAST_WRITE;
+ bool set_createtime = false;
+ bool set_ctime = false;
NTSTATUS status;
if (!VALID_STAT(smb_fname->st)) {
@@ -5201,6 +5203,16 @@ NTSTATUS smb_set_file_time(connection_struct *conn,
}
/* get some defaults (no modifications) if any info is zero or -1. */
+ if (null_timespec(ft->create_time)) {
+ ft->create_time = smb_fname->st.st_ex_btime;
+ } else {
+ set_createtime = true;
+ }
+
+ if (!null_timespec(ft->ctime)) {
+ set_ctime = true;
+ }
+
if (null_timespec(ft->atime)) {
ft->atime= smb_fname->st.st_ex_atime;
action &= ~FILE_NOTIFY_CHANGE_LAST_ACCESS;
@@ -5235,6 +5247,10 @@ NTSTATUS smb_set_file_time(connection_struct *conn,
struct timespec ats = smb_fname->st.st_ex_atime;
if ((timespec_compare(&ft->atime, &ats) == 0) &&
(timespec_compare(&ft->mtime, &mts) == 0)) {
+ if (set_createtime || set_ctime) {
+ notify_fname(conn, NOTIFY_ACTION_MODIFIED, action,
+ smb_fname->base_name);
+ }
return NT_STATUS_OK;
}
}