svn commit: samba r14941 - in branches/SAMBA_4_0/source/ntvfs/posix: .

tridge at samba.org tridge at samba.org
Thu Apr 6 10:05:20 GMT 2006


Author: tridge
Date: 2006-04-06 10:05:19 +0000 (Thu, 06 Apr 2006)
New Revision: 14941

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=14941

Log:

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.

Modified:
   branches/SAMBA_4_0/source/ntvfs/posix/pvfs_rename.c


Changeset:
Modified: branches/SAMBA_4_0/source/ntvfs/posix/pvfs_rename.c
===================================================================
--- branches/SAMBA_4_0/source/ntvfs/posix/pvfs_rename.c	2006-04-06 09:23:34 UTC (rev 14940)
+++ branches/SAMBA_4_0/source/ntvfs/posix/pvfs_rename.c	2006-04-06 10:05:19 UTC (rev 14941)
@@ -41,7 +41,7 @@
 	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 @@
 			       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;
 }



More information about the samba-cvs mailing list