svn commit: samba r20597 - in branches/SAMBA_3_0/source/smbd: .

vlendec at samba.org vlendec at samba.org
Sun Jan 7 18:08:50 GMT 2007


Author: vlendec
Date: 2007-01-07 18:08:50 +0000 (Sun, 07 Jan 2007)
New Revision: 20597

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

Log:
Survive some of the notify mask tests.
Modified:
   branches/SAMBA_3_0/source/smbd/dosmode.c
   branches/SAMBA_3_0/source/smbd/notify.c
   branches/SAMBA_3_0/source/smbd/reply.c


Changeset:
Modified: branches/SAMBA_3_0/source/smbd/dosmode.c
===================================================================
--- branches/SAMBA_3_0/source/smbd/dosmode.c	2007-01-07 15:26:35 UTC (rev 20596)
+++ branches/SAMBA_3_0/source/smbd/dosmode.c	2007-01-07 18:08:50 UTC (rev 20597)
@@ -499,8 +499,11 @@
 		unixmode |= (st->st_mode & (S_IWUSR|S_IWGRP|S_IWOTH));
 	}
 
-	if ((ret = SMB_VFS_CHMOD(conn,fname,unixmode)) == 0)
+	if ((ret = SMB_VFS_CHMOD(conn,fname,unixmode)) == 0) {
+		notify_fname(conn, fname, FILE_NOTIFY_CHANGE_ATTRIBUTES,
+			     NOTIFY_ACTION_MODIFIED);
 		return 0;
+	}
 
 	if((errno != EPERM) && (errno != EACCES))
 		return -1;
@@ -529,6 +532,8 @@
 		ret = SMB_VFS_FCHMOD(fsp, fsp->fh->fd, unixmode);
 		unbecome_root();
 		close_file_fchmod(fsp);
+		notify_fname(conn, fname, FILE_NOTIFY_CHANGE_ATTRIBUTES,
+			     NOTIFY_ACTION_MODIFIED);
 	}
 
 	return( ret );
@@ -601,6 +606,9 @@
 		DEBUG(4,("set_filetime(%s) failed: %s\n",fname,strerror(errno)));
 		return False;
 	}
+
+	notify_fname(conn, fname, FILE_NOTIFY_CHANGE_LAST_WRITE,
+		     NOTIFY_ACTION_MODIFIED);
   
 	return(True);
 } 

Modified: branches/SAMBA_3_0/source/smbd/notify.c
===================================================================
--- branches/SAMBA_3_0/source/smbd/notify.c	2007-01-07 15:26:35 UTC (rev 20596)
+++ branches/SAMBA_3_0/source/smbd/notify.c	2007-01-07 18:08:50 UTC (rev 20597)
@@ -541,6 +541,20 @@
 	TALLOC_FREE(lck);
 }
 
+void notify_fname(connection_struct *conn, const char *path,
+		  uint32 filter, uint32 action)
+{
+	char *parent;
+	const char *name;
+
+	if (!parent_dirname_talloc(tmp_talloc_ctx(), path, &parent, &name)) {
+		return;
+	}
+
+	notify_action(conn, parent, name, filter, action);
+	TALLOC_FREE(parent);
+}
+
 static void notify_fsp(files_struct *fsp, struct notify_message *msg)
 {
 	struct notify_change *change, *changes;

Modified: branches/SAMBA_3_0/source/smbd/reply.c
===================================================================
--- branches/SAMBA_3_0/source/smbd/reply.c	2007-01-07 15:26:35 UTC (rev 20596)
+++ branches/SAMBA_3_0/source/smbd/reply.c	2007-01-07 18:08:50 UTC (rev 20597)
@@ -2026,9 +2026,6 @@
 		mangle_check_cache( mask, sizeof(pstring)-1, conn->params );
 	
 	if (!has_wild) {
-		char *dir;
-		const char *fname;
-
 		pstrcat(directory,"/");
 		pstrcat(directory,mask);
 		error = can_delete(conn,directory,dirtype,bad_path);
@@ -2039,12 +2036,7 @@
 			count++;
 		}
 
-		if (parent_dirname_talloc(tmp_talloc_ctx(), orig_name,
-					  &dir, &fname)) {
-			notify_action(conn, dir, fname, -1,
-				      NOTIFY_ACTION_REMOVED);
-			TALLOC_FREE(dir); /* not strictly necessary */
-		}
+		notify_fname(conn, orig_name, -1, NOTIFY_ACTION_REMOVED);
 
 	} else {
 		struct smb_Dir *dir_hnd = NULL;



More information about the samba-cvs mailing list