From 65165433ecb95a697442fd88723036605ea21186 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 30 Jul 2009 13:19:26 -0700 Subject: 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. --- source3/smbd/trans2.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'source3/smbd') 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; } } -- cgit