r2395: Patch from "Stefan (metze) Metzmacher" <metze@samba.org> to fix
[ira/wip.git] / source3 / smbd / mangle.c
index 392e48afc19ee1493ea2067953b837daa914844a..43becff69db99abb9bf27e0e9fe001d49e89e996 100644 (file)
@@ -23,8 +23,8 @@
 static struct mangle_fns *mangle_fns;
 
 /* this allows us to add more mangling backends */
-static struct {
-       char *name;
+static const struct {
+       const char *name;
        struct mangle_fns *(*init_fn)(void);
 } mangle_backends[] = {
        { "hash", mangle_hash_init },
@@ -98,16 +98,16 @@ BOOL mangle_is_8_3_wildcards(const char *fname, BOOL check_case)
   looking for a matching name if it doesn't. It should succeed most of the time
   or there will be a huge performance penalty
 */
-BOOL mangle_check_cache(char *s)
+BOOL mangle_check_cache(char *s, size_t maxlen)
 {
-       return mangle_fns->check_cache(s);
+       return mangle_fns->check_cache(s, maxlen);
 }
 
 /* 
    map a long filename to a 8.3 name. 
  */
 
-void mangle_map(char *OutName, BOOL need83, BOOL cache83, int snum)
+void mangle_map(pstring OutName, BOOL need83, BOOL cache83, int snum)
 {
        /* name mangling can be disabled for speed, in which case
           we just truncate the string */
@@ -120,5 +120,5 @@ void mangle_map(char *OutName, BOOL need83, BOOL cache83, int snum)
 
        /* invoke the inane "mangled map" code */
        mangle_map_filename(OutName, snum);
-       mangle_fns->name_map(OutName, need83, cache83);
+       mangle_fns->name_map(OutName, need83, cache83, lp_defaultcase(snum));
 }