svn commit: samba r20618 - in branches: SAMBA_3_0/source/smbd SAMBA_4_0/source/torture/raw

vlendec at samba.org vlendec at samba.org
Mon Jan 8 21:08:31 GMT 2007


Author: vlendec
Date: 2007-01-08 21:08:31 +0000 (Mon, 08 Jan 2007)
New Revision: 20618

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

Log:
Fix a bug in bad_path handling that also exists in 3.0.23: For reply_unlink
under Linux we returned NT_STATUS_NOT_A_DIRECTORY. This is because in the
bad_path==True condition lstat(2) returns ENOTDIR and not ENOENT.

Not sure if we want to necessarily replicate the INVALID_PARAMETER here, but
this is what W2k3 does. 

Jeremy, I tried to call you, but you were not around. So I'll leave it up to
you to merge this.

Volker


Modified:
   branches/SAMBA_3_0/source/smbd/reply.c
   branches/SAMBA_4_0/source/torture/raw/samba3misc.c


Changeset:
Modified: branches/SAMBA_3_0/source/smbd/reply.c
===================================================================
--- branches/SAMBA_3_0/source/smbd/reply.c	2007-01-08 20:06:36 UTC (rev 20617)
+++ branches/SAMBA_3_0/source/smbd/reply.c	2007-01-08 21:08:31 UTC (rev 20618)
@@ -1995,6 +1995,11 @@
 	*directory = *mask = 0;
 	
 	rc = unix_convert(name,conn,0,&bad_path,&sbuf);
+	if (bad_path) {
+		return has_wild
+			? NT_STATUS_INVALID_PARAMETER
+			: NT_STATUS_OBJECT_PATH_NOT_FOUND;
+	}
 
 	/*
 	 * Feel my pain, this code needs rewriting *very* badly! -- vl

Modified: branches/SAMBA_4_0/source/torture/raw/samba3misc.c
===================================================================
--- branches/SAMBA_4_0/source/torture/raw/samba3misc.c	2007-01-08 20:06:36 UTC (rev 20617)
+++ branches/SAMBA_4_0/source/torture/raw/samba3misc.c	2007-01-08 21:08:31 UTC (rev 20618)
@@ -496,7 +496,23 @@
 	status = smbcli_setatr(cli_dos->tree, invname, 0, 0);
 	CHECK_STATUS(status, NT_STATUS_DOS(ERRDOS, ERRbadfile));
 
+	status = smbcli_unlink(cli_nt->tree, invpath);
+	CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_NOT_FOUND);
+	status = smbcli_unlink(cli_dos->tree, invpath);
+	CHECK_STATUS(status, NT_STATUS_DOS(ERRDOS, ERRbadpath));
+
 	/*
+	 * W2k3 returns INVALID_PARAMETER for a wildcard unlink if the
+	 * directory does not exist. They seem to use the t2ffirst, this also
+	 * returns INVALID_PARAMETER under this condition.
+	 */
+
+	status = smbcli_unlink(cli_nt->tree, "test.txt\\*.*");
+	CHECK_STATUS(status, NT_STATUS_INVALID_PARAMETER);
+	status = smbcli_unlink(cli_dos->tree, "test.txt\\*.*");
+	CHECK_STATUS(status, NT_STATUS_DOS(ERRDOS, ERRinvalidparam));
+
+	/*
 	 * reply_search returns STATUS_NO_MORE_FILES on invalid path
 	 */
 
@@ -622,11 +638,6 @@
 #endif
 	}
 
-	status = smbcli_unlink(cli_nt->tree, invpath);
-	CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_NOT_FOUND);
-	status = smbcli_unlink(cli_dos->tree, invpath);
-	CHECK_STATUS(status, NT_STATUS_DOS(ERRDOS, ERRbadpath));
-
 	status = smbcli_mkdir(cli_nt->tree, invpath);
 	CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_NOT_FOUND);
 	status = smbcli_mkdir(cli_dos->tree, invpath);



More information about the samba-cvs mailing list