Author: jra
Date: 2005-11-22 16:21:55 +0000 (Tue, 22 Nov 2005)
New Revision: 11862

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

Log:
Fix inspired by Thomas Neumann <[EMAIL PROTECTED]> to ensure that
default case applies only to new files and correctly examines 8.3
and long names.
Jeremy.

Modified:
   trunk/source/smbd/filename.c


Changeset:
Modified: trunk/source/smbd/filename.c
===================================================================
--- trunk/source/smbd/filename.c        2005-11-22 16:21:52 UTC (rev 11861)
+++ trunk/source/smbd/filename.c        2005-11-22 16:21:55 UTC (rev 11862)
@@ -150,9 +150,6 @@
                        pstrcpy(saved_last_component, name);
        }
 
-       if (!conn->case_preserve || (mangle_is_8_3(name, False, SNUM(conn)) && 
!conn->short_case_preserve))
-               strnorm(name, lp_defaultcase(SNUM(conn)));
-
        start = name;
        pstrcpy(orig_path, name);
 
@@ -301,16 +298,17 @@
                                        return(False);
                                }
 
-                               /* 
+                               /*
                                 * Just the last part of the name doesn't exist.
-                                * We may need to strupper() or strlower() it 
in case
-                                * this conversion is being used for file 
creation 
-                                * purposes. If the filename is of mixed case 
then 
-                                * don't normalise it.
+                                * We need to strupper() or strlower() it as
+                                * this conversion may be used for file 
creation 
+                                * purposes. Fix inspired by Thomas Neumann 
<[EMAIL PROTECTED]>.
                                 */
-
-                               if (!conn->case_preserve && 
(!strhasupper(start) || !strhaslower(start)))               
+                               if (!conn->case_preserve ||
+                                               (mangle_is_8_3(start, False, 
SNUM(conn)) &&
+                                                !conn->short_case_preserve)) {
                                        strnorm(start, 
lp_defaultcase(SNUM(conn)));
+                               }
 
                                /*
                                 * check on the mangled stack to see if we can 
recover the 

Reply via email to