svn commit: samba r16844 - in trunk/source/smbd: .

jra at samba.org jra at samba.org
Thu Jul 6 21:28:30 GMT 2006


Author: jra
Date: 2006-07-06 21:28:29 +0000 (Thu, 06 Jul 2006)
New Revision: 16844

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

Log:
Our original error code mapping for NTSTATUS -> DOS
errors is correct, but not for chkpath. Special case
that.
Jeremy.

Modified:
   trunk/source/smbd/reply.c


Changeset:
Modified: trunk/source/smbd/reply.c
===================================================================
--- trunk/source/smbd/reply.c	2006-07-06 21:25:29 UTC (rev 16843)
+++ trunk/source/smbd/reply.c	2006-07-06 21:28:29 UTC (rev 16844)
@@ -426,14 +426,6 @@
 		*err = check_path_syntax_posix(dest, tmppath);
 	} else {
 		*err = check_path_syntax_wcard(dest, tmppath, contains_wcard);
-
-		/* Strange DOS error code semantics... */
-		if (!(SVAL(inbuf,smb_flg2) & FLAGS2_32_BIT_ERROR_CODES)) {
-			if (NT_STATUS_EQUAL(NT_STATUS_OBJECT_NAME_INVALID,*err)) {
-				/* We need to map to ERRbadpath */
-				*err = NT_STATUS_OBJECT_PATH_NOT_FOUND;
-			}
-		}
 	}
 
 	return ret;
@@ -461,14 +453,6 @@
 		*err = check_path_syntax_posix(dest, tmppath);
 	} else {
 		*err = check_path_syntax(dest, tmppath);
-
-		/* Strange DOS error code semantics... */
-		if (!(SVAL(inbuf,smb_flg2) & FLAGS2_32_BIT_ERROR_CODES)) {
-			if (NT_STATUS_EQUAL(NT_STATUS_OBJECT_NAME_INVALID,*err)) {
-				/* We need to map to ERRbadpath */
-				*err = NT_STATUS_OBJECT_PATH_NOT_FOUND;
-			}
-		}
 	}
 
 	return ret;
@@ -827,6 +811,14 @@
 	srvstr_get_path(inbuf, name, smb_buf(inbuf) + 1, sizeof(name), 0, STR_TERMINATE, &status);
 	if (!NT_STATUS_IS_OK(status)) {
 		END_PROFILE(SMBchkpth);
+
+		/* Strange DOS error code semantics only for chkpth... */
+		if (!(SVAL(inbuf,smb_flg2) & FLAGS2_32_BIT_ERROR_CODES)) {
+			if (NT_STATUS_EQUAL(NT_STATUS_OBJECT_NAME_INVALID,status)) {
+				/* We need to map to ERRbadpath */
+				status = NT_STATUS_OBJECT_PATH_NOT_FOUND;
+			}
+		}
 		return ERROR_NT(status);
 	}
 



More information about the samba-cvs mailing list