From e3138f2ffef32ee33778e0c068c6009a58536419 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 12 Apr 2011 16:23:17 +1000 Subject: s3-lib Move isvalid83_w to mangle_hash.c This means that there is no need for the 'valid.dat' table to be loaded by anything other than smbd, so the unloader is also removed. The concept of a 'valid dos character' has been replaced by the hash2 mangle method. Andrew Bartlett Signed-off-by: Andrew Tridgell --- source3/lib/netapi/netapi.c | 1 - source3/lib/util.c | 1 - source3/lib/util_unistr.c | 49 --------------------------------------------- 3 files changed, 51 deletions(-) (limited to 'source3/lib') diff --git a/source3/lib/netapi/netapi.c b/source3/lib/netapi/netapi.c index c04ca702493..cd590273ce2 100644 --- a/source3/lib/netapi/netapi.c +++ b/source3/lib/netapi/netapi.c @@ -182,7 +182,6 @@ NET_API_STATUS libnetapi_free(struct libnetapi_ctx *ctx) gfree_names(); gfree_loadparm(); - gfree_case_tables(); gfree_charcnv(); gfree_interfaces(); diff --git a/source3/lib/util.c b/source3/lib/util.c index 887d21f1607..0bb46db05f6 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -156,7 +156,6 @@ void gfree_all( void ) { gfree_names(); gfree_loadparm(); - gfree_case_tables(); gfree_charcnv(); gfree_interfaces(); gfree_debugsyms(); diff --git a/source3/lib/util_unistr.c b/source3/lib/util_unistr.c index 90fc6769f9b..18df993b5a6 100644 --- a/source3/lib/util_unistr.c +++ b/source3/lib/util_unistr.c @@ -21,11 +21,6 @@ #include "includes.h" -/* these 3 tables define the unicode case handling. They are loaded - at startup either via mmap() or read() from the lib directory */ -static uint8 *valid_table; -static bool initialized; - /* Copy into a smb_ucs2_t from a possibly unaligned buffer. Return the copied smb_ucs2_t */ #define COPY_UCS2_CHAR(dest,src) (((unsigned char *)(dest))[0] = ((unsigned char *)(src))[0],\ ((unsigned char *)(dest))[1] = ((unsigned char *)(src))[1], (dest)) @@ -36,40 +31,6 @@ static bool initialized; static int strncmp_w(const smb_ucs2_t *a, const smb_ucs2_t *b, size_t len); -/** - * Destroy global objects allocated by load_case_tables() - **/ -void gfree_case_tables(void) -{ - if ( valid_table ) { - unmap_file(valid_table, 0x10000); - valid_table = NULL; - } - initialized = false; -} - -/** - * Load the valid character map table from valid.dat or - * create from the configured codepage. - * - * This function is called whenever the configuration is reloaded. - * However, the valid character table is not changed if it's loaded - * from a file, because we can't unmap files. - **/ - -static void init_valid_table(void) -{ - if (valid_table) { - return; - } - - valid_table = (uint8 *)map_file(data_path("valid.dat"), 0x10000); - if (!valid_table) { - smb_panic("Could not load valid.dat file required for mangle method=hash"); - return; - } -} - /******************************************************************* Write a string in (little-endian) unicode format. src is in the current DOS codepage. len is the length in bytes of the @@ -110,16 +71,6 @@ int rpcstr_push_talloc(TALLOC_CTX *ctx, smb_ucs2_t **dest, const char *src) return -1; } -/******************************************************************* - Determine if a character is valid in a 8.3 name. -********************************************************************/ - -bool isvalid83_w(smb_ucs2_t c) -{ - init_valid_table(); - return valid_table[SVAL(&c,0)] != 0; -} - /******************************************************************* Count the number of two-byte pairs in a UTF16 string. ********************************************************************/ -- cgit