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

vlendec at samba.org vlendec at samba.org
Tue Jan 9 08:56:24 GMT 2007


Author: vlendec
Date: 2007-01-09 08:56:24 +0000 (Tue, 09 Jan 2007)
New Revision: 20627

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

Log:
orig_name is not needed anymore, and slightly simplify logic by doing early
returns.

Volker


Modified:
   branches/SAMBA_3_0/source/smbd/reply.c


Changeset:
Modified: branches/SAMBA_3_0/source/smbd/reply.c
===================================================================
--- branches/SAMBA_3_0/source/smbd/reply.c	2007-01-09 08:19:05 UTC (rev 20626)
+++ branches/SAMBA_3_0/source/smbd/reply.c	2007-01-09 08:56:24 UTC (rev 20627)
@@ -1977,7 +1977,6 @@
 {
 	pstring directory;
 	pstring mask;
-	pstring orig_name;
 	char *p;
 	int count=0;
 	NTSTATUS error = NT_STATUS_OK;
@@ -1994,11 +1993,6 @@
 			: NT_STATUS_OBJECT_PATH_NOT_FOUND;
 	}
 
-	/*
-	 * Feel my pain, this code needs rewriting *very* badly! -- vl
-	 */
-	pstrcpy(orig_name, name);
-	
 	p = strrchr_m(name,'/');
 	if (!p) {
 		pstrcpy(directory,".");
@@ -2030,7 +2024,7 @@
 
 		if (SMB_VFS_UNLINK(conn,directory) == 0) {
 			count++;
-			notify_fname(conn, orig_name, -1,
+			notify_fname(conn, directory, -1,
 				     NOTIFY_ACTION_REMOVED);
 		}
 
@@ -2041,8 +2035,13 @@
 		if (strequal(mask,"????????.???"))
 			pstrcpy(mask,"*");
 
-		if (check_name(directory,conn))
-			dir_hnd = OpenDir(conn, directory, mask, dirtype);
+		if (!check_name(directory,conn)) {
+			return NT_STATUS_OBJECT_PATH_NOT_FOUND;
+		}
+
+		if (!(dir_hnd = OpenDir(conn, directory, mask, dirtype))) {
+			return NT_STATUS_NO_SUCH_FILE;
+		}
 		
 		/* XXXX the CIFS spec says that if bit0 of the flags2 field is set then
 		   the pattern matches against the long name, otherwise the short name 



More information about the samba-cvs mailing list