From: Jeremy Allison Date: Fri, 7 Aug 2009 17:19:20 +0000 (-0700) Subject: Correctly send out notify messages for timestamp changes. X-Git-Tag: tevent-0.9.8~475^2~1 X-Git-Url: http://git.samba.org/?a=commitdiff_plain;h=ea6819ae7565c22b0d6276acebfbab472a4e4c18;p=samba.git Correctly send out notify messages for timestamp changes. "change time" has no notify message, so don't send anything out when we change it. Use FILE_NOTIFY_CHANGE_CREATION correctly when changing the create time. Jeremy. --- diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index 780d7d606c7..a8b721120d8 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -5224,7 +5224,6 @@ NTSTATUS smb_set_file_time(connection_struct *conn, 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)) { @@ -5240,8 +5239,6 @@ NTSTATUS smb_set_file_time(connection_struct *conn, if (null_timespec(ft->ctime)) { ft->ctime = smb_fname->st.st_ex_ctime; - } else { - set_ctime = true; } if (null_timespec(ft->atime)) { @@ -5278,8 +5275,9 @@ 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, FILE_NOTIFY_CHANGE_LAST_WRITE, + if (set_createtime) { + notify_fname(conn, NOTIFY_ACTION_MODIFIED, + FILE_NOTIFY_CHANGE_CREATION, smb_fname->base_name); } return NT_STATUS_OK;