summaryrefslogtreecommitdiff
path: root/source3/smbd/mangle_hash2.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/smbd/mangle_hash2.c')
-rw-r--r--source3/smbd/mangle_hash2.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/source3/smbd/mangle_hash2.c b/source3/smbd/mangle_hash2.c
index 1d81602641..e2c4b43bc3 100644
--- a/source3/smbd/mangle_hash2.c
+++ b/source3/smbd/mangle_hash2.c
@@ -280,7 +280,7 @@ static BOOL is_mangled(const char *name)
simplifies things greatly (it means that we know the string won't
get larger when converted from UNIX to DOS formats)
*/
-static BOOL is_8_3(const char *name, BOOL check_case)
+static BOOL is_8_3(const char *name, BOOL check_case, BOOL allow_wildcards)
{
int len, i;
char *dot_p;
@@ -330,8 +330,8 @@ static BOOL is_8_3(const char *name, BOOL check_case)
/* the length are all OK. Now check to see if the characters themselves are OK */
for (i=0; name[i]; i++) {
- /* note that we allow wildcard petterns! */
- if (!FLAG_CHECK(name[i], FLAG_ASCII|FLAG_WILDCARD) && name[i] != '.') {
+ /* note that we may allow wildcard petterns! */
+ if (!FLAG_CHECK(name[i], FLAG_ASCII|(allow_wildcards ? FLAG_WILDCARD : 0)) && name[i] != '.') {
return False;
}
}
@@ -477,7 +477,7 @@ static BOOL is_legal_name(const char *name)
the name parameter must be able to hold 13 bytes
*/
-static BOOL name_map(char *name, BOOL need83, BOOL cache83)
+static void name_map(char *name, BOOL need83, BOOL cache83)
{
char *dot_p;
char lead_char;
@@ -491,14 +491,14 @@ static BOOL name_map(char *name, BOOL need83, BOOL cache83)
if (!is_reserved_name(name)) {
/* if the name is already a valid 8.3 name then we don't need to
do anything */
- if (is_8_3(name, False)) {
- return True;
+ if (is_8_3(name, False, False)) {
+ return;
}
/* if the caller doesn't strictly need 8.3 then just check for illegal
filenames */
if (!need83 && is_legal_name(name)) {
- return True;
+ return;
}
}
@@ -580,7 +580,6 @@ static BOOL name_map(char *name, BOOL need83, BOOL cache83)
fstrcpy(name, new_name);
/* all done, we've managed to mangle it */
- return True;
}