The branch, master has been updated via 65165433ecb95a697442fd88723036605ea21186 (commit) via 84bfd7395c48783fd6fca19effa12561217f65ec (commit) via e411ec6a8af13ff9213b27212a4bed2db651585d (commit) from 36c0f0f99aee940668b84c2c70b27f4993d9e6ee (commit)
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit 65165433ecb95a697442fd88723036605ea21186 Author: Jeremy Allison <j...@samba.org> Date: Thu Jul 30 13:19:26 2009 -0700 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. commit 84bfd7395c48783fd6fca19effa12561217f65ec Author: Jeremy Allison <j...@samba.org> Date: Thu Jul 30 13:16:40 2009 -0700 Remove the extraneous logic in smb_set_info_standard - we do the time twiddling logic at the smb_set_file_time level. Jeremy. commit e411ec6a8af13ff9213b27212a4bed2db651585d Author: Jeremy Allison <j...@samba.org> Date: Thu Jul 30 13:13:23 2009 -0700 SMB_INFO_STANDARD is not a valid info level on set, and was being read incorrectly anyway. Remove. Jeremy. ----------------------------------------------------------------------- Summary of changes: source3/include/smb.h | 1 + source3/smbd/trans2.c | 92 +++++++++++++------------------------------------ 2 files changed, 25 insertions(+), 68 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/include/smb.h b/source3/include/smb.h index 1192744..819d3a8 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -1895,6 +1895,7 @@ struct smb_extended_info { struct smb_file_time { struct timespec mtime; struct timespec atime; + struct timespec ctime; struct timespec create_time; }; diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index f34e15b..8cbd259 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; } } @@ -6045,38 +6061,6 @@ static NTSTATUS smb_set_posix_lock(connection_struct *conn, } /**************************************************************************** - Deal with SMB_INFO_STANDARD. -****************************************************************************/ - -static NTSTATUS smb_set_info_standard(connection_struct *conn, - const char *pdata, - int total_data, - files_struct *fsp, - const struct smb_filename *smb_fname) -{ - struct smb_file_time ft; - ZERO_STRUCT(ft); - - if (total_data < 12) { - return NT_STATUS_INVALID_PARAMETER; - } - - /* create time */ - ft.create_time = interpret_long_date(pdata); - - /* access time */ - ft.atime = interpret_long_date(pdata + 8); - - /* write time */ - ft.mtime = interpret_long_date(pdata + 16); - - DEBUG(10,("smb_set_info_standard: file %s\n", - smb_fname_str_dbg(smb_fname))); - - return smb_set_file_time(conn, fsp, smb_fname, &ft, true); -} - -/**************************************************************************** Deal with SMB_SET_FILE_BASIC_INFO. ****************************************************************************/ @@ -6087,12 +6071,9 @@ static NTSTATUS smb_set_file_basic_info(connection_struct *conn, const struct smb_filename *smb_fname) { /* Patch to do this correctly from Paul Eggert <egg...@twinsun.com>. */ - struct timespec write_time; - struct timespec changed_time; struct smb_file_time ft; uint32 dosmode = 0; NTSTATUS status = NT_STATUS_OK; - bool setting_write_time = true; ZERO_STRUCT(ft); @@ -6107,38 +6088,23 @@ static NTSTATUS smb_set_file_basic_info(connection_struct *conn, return status; } - /* access time */ - ft.atime = interpret_long_date(pdata+8); - - write_time = interpret_long_date(pdata+16); - changed_time = interpret_long_date(pdata+24); - - /* mtime */ - ft.mtime = timespec_min(&write_time, &changed_time); - /* create time */ ft.create_time = interpret_long_date(pdata); - if ((timespec_compare(&write_time, &ft.mtime) == 1) && - !null_timespec(write_time)) { - ft.mtime = write_time; - } + /* access time */ + ft.atime = interpret_long_date(pdata+8); - /* Prefer a defined time to an undefined one. */ - if (null_timespec(ft.mtime)) { - if (null_timespec(write_time)) { - ft.mtime = changed_time; - setting_write_time = false; - } else { - ft.mtime = write_time; - } - } + /* write time. */ + ft.mtime = interpret_long_date(pdata+16); + + /* change time. */ + ft.ctime = interpret_long_date(pdata+24); DEBUG(10, ("smb_set_file_basic_info: file %s\n", smb_fname_str_dbg(smb_fname))); return smb_set_file_time(conn, fsp, smb_fname, &ft, - setting_write_time); + true); } /**************************************************************************** @@ -7118,16 +7084,6 @@ NTSTATUS smbd_do_setfilepathinfo(connection_struct *conn, switch (info_level) { - case SMB_INFO_STANDARD: - { - status = smb_set_info_standard(conn, - pdata, - total_data, - fsp, - smb_fname); - break; - } - case SMB_INFO_SET_EA: { status = smb_info_set_ea(conn, -- Samba Shared Repository