JHT ===> William Yost patches integrated to fix leading path on 8.3
authorSamba Release Account <samba-bugs@samba.org>
Mon, 10 Feb 1997 13:54:29 +0000 (13:54 +0000)
committerSamba Release Account <samba-bugs@samba.org>
Mon, 10 Feb 1997 13:54:29 +0000 (13:54 +0000)
filename problem.
Problem conditions:
case sensitive = no
default case = lower
mangle case = yes
preserve case = yes
short preserve case = yes
Problem: Win95 still writes upper case file names.
Patches supplied have been incorporated into mangle.c and server.c
but needs YOSTW to be defined for it to take effect.

Action:
=======
If we are happy with the patch, delete old code in mangle.c, then
remove all YOSTW #ifdefs.
(This used to be commit 84fc674c89e8999f284b59888dfa2cdc47438e88)

source3/smbd/mangle.c
source3/smbd/server.c

index 6d98d9e39c58c920fc996af9828e8b6f2514ae96..c0baa659821ed19d7db5a686cc5de21df1c326ad 100644 (file)
@@ -92,6 +92,7 @@ BOOL is_8_3(char *fname)
   DEBUG(5,("checking %s for 8.3\n",fname));
 
   if (case_mangle)
+#ifndef YOSTW
     switch (case_default)
       {
       case CASE_LOWER:
@@ -101,6 +102,10 @@ BOOL is_8_3(char *fname)
        if (strhaslower(fname)) return(False);
        break;
       }
+#endif
+#ifdef YOSTW
+       if (strhasupper(fname) && strhaslower(fname)) return(False);
+#endif
 
   /* can't be longer than 12 chars */
   if (len == 0 || len > 12)
index 5ff60c6c6ce7e5f33dbe5c18a56e9bb92612304b..6f4da9b7794fcf8f87d87916108ec3b4138e456c 100644 (file)
@@ -389,6 +389,9 @@ BOOL unix_convert(char *name,int cnum,pstring saved_last_component)
   struct stat st;
   char *start, *end;
   pstring dirpath;
+#ifdef YOSTW
+  char szName[132], *p;
+#endif
 
   *dirpath = 0;
   if(saved_last_component)
@@ -398,6 +401,23 @@ BOOL unix_convert(char *name,int cnum,pstring saved_last_component)
   unix_format(name);
   unix_clean_name(name);
 
+#ifdef YOSTW
+  /* Remove leading path specifications to check for 8_3 name */
+  if ( strncmp( name, "./",2) == 0 ) {
+       strcpy( szName, name+2 );
+  }
+  else {
+       strcpy( szName, name );
+  }
+  p = strrchr( szName, '/' );
+  if ( p != NULL ) {
+       p++;
+  }
+  else {
+       p = szName;
+  }
+#endif
+  
   if (!case_sensitive && 
       (!case_preserve || (is_8_3(name) && !short_case_preserve)))
     strnorm(name);