summaryrefslogtreecommitdiff
path: root/source3/smbd/open.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2009-08-21 21:44:21 -0700
committerJeremy Allison <jra@samba.org>2009-08-21 21:44:21 -0700
commit1af0aa92b3f3467715f6ffbfedf66df1acc0a83c (patch)
treea151ed8cc04a4bea659b8d11484a197ca3b74b2c /source3/smbd/open.c
parent47c7063dc62dc06d0cdd50e1946c088f8bf1ee1d (diff)
downloadsamba-1af0aa92b3f3467715f6ffbfedf66df1acc0a83c.tar.gz
samba-1af0aa92b3f3467715f6ffbfedf66df1acc0a83c.tar.bz2
samba-1af0aa92b3f3467715f6ffbfedf66df1acc0a83c.zip
Fix bug 6529 - Offline files conflict with Vista and Office 2003
On filesystems that can't store less than one second timestamps, round the incoming timestamp set requests so the client can't discover that a time set request has been truncated by the filesystem. Needs backporting to 3.4, 3.3, 3.2 and (even) 3.0. Jeremy
Diffstat (limited to 'source3/smbd/open.c')
-rw-r--r--source3/smbd/open.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index 045635535f..9b4eedf432 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -3284,8 +3284,12 @@ static NTSTATUS create_file_unixpath(connection_struct *conn,
/* Try and make a create timestamp, if required. */
if ((info == FILE_WAS_CREATED) || (info == FILE_WAS_OVERWRITTEN)) {
if (lp_store_create_time(SNUM(conn))) {
+ struct timespec ts = smb_fname->st.st_ex_btime;
+ if (!conn->hires_timestamps_avail) {
+ round_timespec(&ts);
+ }
set_create_timespec_ea(conn, fsp,
- smb_fname, smb_fname->st.st_ex_btime);
+ smb_fname, ts);
}
}