From 4abf299e0cd238d80ebe8b31eb0a4388499da404 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 6 Apr 2006 10:05:19 +0000 Subject: r14941: a rename of a file (but not a directory) triggers 3 events. The first two are the rename (FROM and TO) then the 3rd event is a modify event of both attributes and creation time. (This used to be commit 010a1b14a58c0194e1f8bba29f4d02a86b7559c5) --- source4/ntvfs/posix/pvfs_rename.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'source4/ntvfs/posix/pvfs_rename.c') diff --git a/source4/ntvfs/posix/pvfs_rename.c b/source4/ntvfs/posix/pvfs_rename.c index c3442884cf..6a397ef981 100644 --- a/source4/ntvfs/posix/pvfs_rename.c +++ b/source4/ntvfs/posix/pvfs_rename.c @@ -41,7 +41,7 @@ NTSTATUS pvfs_do_rename(struct pvfs_state *pvfs, const struct pvfs_filename *nam if (name1->dos.attrib & FILE_ATTRIBUTE_DIRECTORY) { mask = FILE_NOTIFY_CHANGE_DIR_NAME; } else { - mask = FILE_NOTIFY_CHANGE_FILE_NAME|FILE_NOTIFY_CHANGE_ATTRIBUTES|FILE_NOTIFY_CHANGE_CREATION; + mask = FILE_NOTIFY_CHANGE_FILE_NAME; } /* renames to the same directory cause a OLD_NAME->NEW_NAME notify. @@ -70,6 +70,16 @@ NTSTATUS pvfs_do_rename(struct pvfs_state *pvfs, const struct pvfs_filename *nam mask, name2); } + + /* this is a strange one. w2k3 gives an additional event for CHANGE_ATTRIBUTES + and CHANGE_CREATION on the new file when renming files, but not + directories */ + if ((name1->dos.attrib & FILE_ATTRIBUTE_DIRECTORY) == 0) { + notify_trigger(pvfs->notify_context, + NOTIFY_ACTION_MODIFIED, + FILE_NOTIFY_CHANGE_ATTRIBUTES|FILE_NOTIFY_CHANGE_CREATION, + name2); + } return NT_STATUS_OK; } -- cgit