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

jra at samba.org jra at samba.org
Thu Feb 3 02:03:06 GMT 2005


Author: jra
Date: 2005-02-03 02:03:01 +0000 (Thu, 03 Feb 2005)
New Revision: 5184

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

Log:
Ensure we correctly set the per-connection "case_sensitive" setting.
Rename dptrs_open to the more correct dirhandles_open.
Remove old #if 1.
Jeremy.

Modified:
   trunk/source/smbd/dir.c
   trunk/source/smbd/filename.c
   trunk/source/smbd/service.c


Changeset:
Modified: trunk/source/smbd/dir.c
===================================================================
--- trunk/source/smbd/dir.c	2005-02-03 02:02:54 UTC (rev 5183)
+++ trunk/source/smbd/dir.c	2005-02-03 02:03:01 UTC (rev 5184)
@@ -57,7 +57,7 @@
 
 static struct bitmap *dptr_bmap;
 static struct dptr_struct *dirptrs;
-static int dptrs_open = 0;
+static int dirhandles_open = 0;
 
 #define INVALID_DPTR_KEY (-3)
 
@@ -135,7 +135,7 @@
 	for(dptr = dirptrs; dptr; dptr = dptr->next) {
 		if(dptr->dnum == key) {
 			if (!forclose && !dptr->dir_hnd) {
-				if (dptrs_open >= MAX_OPEN_DIRECTORIES)
+				if (dirhandles_open >= MAX_OPEN_DIRECTORIES)
 					dptr_idleoldest();
 				DEBUG(4,("dptr_get: Reopening dptr key %d\n",key));
 				if (!(dptr->dir_hnd = OpenDir(dptr->conn, dptr->path))) {
@@ -385,7 +385,7 @@
 
 	string_set(&conn->dirpath,dir2);
 
-	if (dptrs_open >= MAX_OPEN_DIRECTORIES)
+	if (dirhandles_open >= MAX_OPEN_DIRECTORIES)
 		dptr_idleoldest();
 
 	dptr = SMB_MALLOC_P(struct dptr_struct);
@@ -968,7 +968,7 @@
 		goto fail;
 	}
 
-	dptrs_open++;
+	dirhandles_open++;
 	return dirp;
 
   fail:
@@ -1004,7 +1004,7 @@
 	}
 	SAFE_FREE(dirp->name_cache);
 	SAFE_FREE(dirp);
-	dptrs_open--;
+	dirhandles_open--;
 	return ret;
 }
 

Modified: trunk/source/smbd/filename.c
===================================================================
--- trunk/source/smbd/filename.c	2005-02-03 02:02:54 UTC (rev 5183)
+++ trunk/source/smbd/filename.c	2005-02-03 02:03:01 UTC (rev 5184)
@@ -150,11 +150,7 @@
 			pstrcpy(saved_last_component, name);
 	}
 
-#if 1
 	if (!conn->case_preserve || (mangle_is_8_3(name, False) && !conn->short_case_preserve))
-#else
-	if (!conn->case_sensitive && (!conn->case_preserve || (mangle_is_8_3(name, False) && !conn->short_case_preserve)))
-#endif
 		strnorm(name, lp_defaultcase(SNUM(conn)));
 
 	start = name;

Modified: trunk/source/smbd/service.c
===================================================================
--- trunk/source/smbd/service.c	2005-02-03 02:02:54 UTC (rev 5183)
+++ trunk/source/smbd/service.c	2005-02-03 02:03:01 UTC (rev 5184)
@@ -60,17 +60,26 @@
 	last_flags = flags;
 	
 	/* Obey the client case sensitivity requests - only for clients that support it. */
-	if (lp_casesensitive(snum) == Auto) {
-		/* We need this uglyness due to DOS/Win9x clients that lie about case insensitivity. */
-		enum remote_arch_types ra_type = get_remote_arch();
-		if ((ra_type != RA_SAMBA) && (ra_type != RA_CIFSFS)) {
-			/* Client can't support per-packet case sensitive pathnames. */
+	switch (lp_casesensitive(snum)) {
+		case Auto:
+			{
+				/* We need this uglyness due to DOS/Win9x clients that lie about case insensitivity. */
+				enum remote_arch_types ra_type = get_remote_arch();
+				if ((ra_type != RA_SAMBA) && (ra_type != RA_CIFSFS)) {
+					/* Client can't support per-packet case sensitive pathnames. */
+					conn->case_sensitive = False;
+				} else {
+					conn->case_sensitive = !(flags & FLAG_CASELESS_PATHNAMES);
+				}
+			}
+			break;
+		case True:
+			conn->case_sensitive = True;
+			break;
+		default:
 			conn->case_sensitive = False;
-		} else {
-			conn->case_sensitive = !(flags & FLAG_CASELESS_PATHNAMES);
-		}
+			break;
 	}
-
 	magic_char = lp_magicchar(snum);
 	return(True);
 }



More information about the samba-cvs mailing list