svn commit: samba r2187 - in branches/SAMBA_3_0_RELEASE/source/smbd: .

jerry at samba.org jerry at samba.org
Thu Sep 2 14:16:51 GMT 2004


Author: jerry
Date: 2004-09-02 14:16:50 +0000 (Thu, 02 Sep 2004)
New Revision: 2187

WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/branches/SAMBA_3_0_RELEASE/source/smbd&rev=2187&nolog=1

Log:
revert merge of r2150 from 3.0
Modified:
   branches/SAMBA_3_0_RELEASE/source/smbd/reply.c


Changeset:
Modified: branches/SAMBA_3_0_RELEASE/source/smbd/reply.c
===================================================================
--- branches/SAMBA_3_0_RELEASE/source/smbd/reply.c	2004-09-02 12:54:48 UTC (rev 2186)
+++ branches/SAMBA_3_0_RELEASE/source/smbd/reply.c	2004-09-02 14:16:50 UTC (rev 2187)
@@ -97,25 +97,26 @@
 				d--;
 			}
 			s += 3;
-		} else if ((s[0] == '.') && (s[1] == '\0')) {
-			if (s == srcname) {
-				ret = NT_STATUS_OBJECT_NAME_INVALID;
-				break;
-			}
-			*d++ = *s++;
-		} else if ((s[0] == '.') && IS_DIRECTORY_SEP(s[1])) {
+		} else if ((s[0] == '.') && (IS_DIRECTORY_SEP(s[1]) || (s[1] == '\0'))) {
+
 			/*
 			 * No mb char starts with '.' so we're safe checking the directory separator here.
 			 */
 
-			/* "./" or ".\\" fails with a different error depending on what is after it... */
+			/* "./" or ".\\" fails with a different error depending on where it is... */
 
-			if (s[2] == '\0') {
+			if (s == srcname) {
 				ret = NT_STATUS_OBJECT_NAME_INVALID;
+				break;
 			} else {
+				if (s[1] != '\0' && s[2] == '\0') {
+					ret = NT_STATUS_INVALID_PARAMETER;
+					break;
+				}
 				ret = NT_STATUS_OBJECT_PATH_NOT_FOUND;
+				break;
 			}
-			break;
+			s++;
 		} else {
 			if (!(*s & 0x80)) {
 				if (allow_wcard_names) {
@@ -520,6 +521,7 @@
 int reply_chkpth(connection_struct *conn, char *inbuf,char *outbuf, int dum_size, int dum_buffsize)
 {
 	int outsize = 0;
+	int mode;
 	pstring name;
 	BOOL ok = False;
 	BOOL bad_path = False;
@@ -542,6 +544,8 @@
 		return ERROR_NT(NT_STATUS_OBJECT_PATH_NOT_FOUND);
 	}
 
+	mode = SVAL(inbuf,smb_vwv0);
+
 	if (check_name(name,conn)) {
 		if (VALID_STAT(sbuf) || SMB_VFS_STAT(conn,name,&sbuf) == 0)
 			if (!(ok = S_ISDIR(sbuf.st_mode))) {
@@ -574,8 +578,9 @@
 	}
 
 	outsize = set_message(outbuf,0,0,True);
-	DEBUG(3,("chkpth %s mode=%d\n", name, (int)SVAL(inbuf,smb_vwv0)));
 
+	DEBUG(3,("chkpth %s mode=%d\n", name, mode));
+
 	END_PROFILE(SMBchkpth);
 	return(outsize);
 }



More information about the samba-cvs mailing list