Add two flags to allow for handling of Extended Signatures (Session Key Protection...
[samba.git] / source3 / smbd / mangle_hash.c
index 988251e87879e1a10d0da34ad452fbe1d17717d4..056879c8765b0a8d1b0215f6e50bd24dc99fc367 100644 (file)
@@ -26,6 +26,7 @@
 #include "smbd/globals.h"
 #include "mangle.h"
 #include "util_tdb.h"
+#include "lib/param/loadparm.h"
 
 /* -------------------------------------------------------------------------- **
  * Other stuff...
@@ -333,9 +334,6 @@ static bool is_8_3(const char *fname, bool check_case, bool allow_wildcards,
        smb_ucs2_t *ucs2name;
        NTSTATUS ret = NT_STATUS_UNSUCCESSFUL;
        size_t size;
-       char magic_char;
-
-       magic_char = lp_magicchar(p);
 
        if (!fname || !*fname)
                return False;
@@ -427,8 +425,8 @@ static bool is_mangled(const char *s, const struct share_params *p)
        magic = strchr_m( s, magic_char );
        while( magic && magic[1] && magic[2] ) {         /* 3 chars, 1st is magic. */
                if( ('.' == magic[3] || '/' == magic[3] || !(magic[3]))          /* Ends with '.' or nul or '/' ?  */
-                               && isbasechar( toupper_ascii(magic[1]) )           /* is 2nd char basechar?  */
-                               && isbasechar( toupper_ascii(magic[2]) ) )         /* is 3rd char basechar?  */
+                               && isbasechar( toupper_m(magic[1]) )           /* is 2nd char basechar?  */
+                               && isbasechar( toupper_m(magic[2]) ) )         /* is 3rd char basechar?  */
                        return( True );                           /* If all above, then true, */
                magic = strchr_m( magic+1, magic_char );      /*    else seek next magic. */
        }
@@ -482,7 +480,7 @@ static void cache_mangled_name( const char mangled_name[13],
        s1 = strrchr( mangled_name_key, '.' );
        if( s1 && (s2 = strrchr( raw_name, '.' )) ) {
                size_t i = 1;
-               while( s1[i] && (tolower_ascii( s1[i] ) == s2[i]) )
+               while( s1[i] && (tolower_m( s1[i] ) == s2[i]) )
                        i++;
                if( !s1[i] && !s2[i] ) {
                        /* Truncate at the '.' */
@@ -534,9 +532,6 @@ static bool lookup_name_from_8_3(TALLOC_CTX *ctx,
        TDB_DATA data_val;
        char *saved_ext = NULL;
        char *s = talloc_strdup(ctx, in);
-       char magic_char;
-
-       magic_char = lp_magicchar(p);
 
        /* If the cache isn't initialized, give up. */
        if(!s || !tdb_mangled_cache ) {
@@ -684,9 +679,6 @@ static bool must_mangle(const char *name,
        smb_ucs2_t *name_ucs2 = NULL;
        NTSTATUS status;
        size_t converted_size;
-       char magic_char;
-
-       magic_char = lp_magicchar(p);
 
        if (!push_ucs2_talloc(NULL, &name_ucs2, name, &converted_size)) {
                DEBUG(0, ("push_ucs2_talloc failed!\n"));