summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2009-01-08 08:50:36 +0100
committerStefan Metzmacher <metze@samba.org>2009-01-08 12:22:18 +0100
commitd9e81664e5afc9576749241b9e445e232d5f83d6 (patch)
tree5548047fd4bf8aa105b63386387f7cc2abe04cca
parent2f9f8fe81e56f9c7bb15e96f9154afe73cf96f1a (diff)
downloadsamba-d9e81664e5afc9576749241b9e445e232d5f83d6.tar.gz
samba-d9e81664e5afc9576749241b9e445e232d5f83d6.tar.bz2
samba-d9e81664e5afc9576749241b9e445e232d5f83d6.zip
s3:smbd: it's pointless to have a global magic_char
We call magic_char = lp_magicchar(p) each time it's used. metze
-rw-r--r--source3/smbd/mangle_hash.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/source3/smbd/mangle_hash.c b/source3/smbd/mangle_hash.c
index 3582b7a0a4..9b40d717ce 100644
--- a/source3/smbd/mangle_hash.c
+++ b/source3/smbd/mangle_hash.c
@@ -52,8 +52,6 @@
*
*/
-static char magic_char = '~';
-
static const char basechars[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_-!@#$%";
#define MANGLE_BASE (sizeof(basechars)/sizeof(char)-1)
@@ -281,6 +279,7 @@ 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);
@@ -362,6 +361,7 @@ static void init_chartest( void )
static bool is_mangled(const char *s, const struct share_params *p)
{
char *magic;
+ char magic_char;
magic_char = lp_magicchar(p);
@@ -468,6 +468,7 @@ 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);
@@ -525,7 +526,7 @@ static bool lookup_name_from_8_3(TALLOC_CTX *ctx,
Do the actual mangling to 8.3 format.
*****************************************************************************/
-static bool to_8_3(const char *in, char out[13], int default_case)
+static bool to_8_3(char magic_char, const char *in, char out[13], int default_case)
{
int csum;
char *p;
@@ -604,6 +605,7 @@ 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);
@@ -639,6 +641,7 @@ static bool hash_name_to_8_3(const char *in,
{
smb_ucs2_t *in_ucs2 = NULL;
size_t converted_size;
+ char magic_char;
magic_char = lp_magicchar(p);
@@ -659,7 +662,7 @@ static bool hash_name_to_8_3(const char *in,
}
SAFE_FREE(in_ucs2);
- if (!to_8_3(in, out, default_case)) {
+ if (!to_8_3(magic_char, in, out, default_case)) {
return False;
}