summaryrefslogtreecommitdiffstats
path: root/source/smbd/mangle_hash2.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2002-04-12 10:18:46 +0000
committerAndrew Tridgell <tridge@samba.org>2002-04-12 10:18:46 +0000
commit97eb3a121d33200ee7559b2413d6252efc04ebaf (patch)
treedc13d7bd92b2f215a512430d11d97a9dc3cbd275 /source/smbd/mangle_hash2.c
parent1c221b3e72b24b6b8bd0d14b6ce32cf701684a81 (diff)
downloadsamba-97eb3a121d33200ee7559b2413d6252efc04ebaf.tar.gz
samba-97eb3a121d33200ee7559b2413d6252efc04ebaf.tar.xz
samba-97eb3a121d33200ee7559b2413d6252efc04ebaf.zip
merged the mangling test and passdb bugfixes into SAMBA_3_0
Diffstat (limited to 'source/smbd/mangle_hash2.c')
-rw-r--r--source/smbd/mangle_hash2.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/source/smbd/mangle_hash2.c b/source/smbd/mangle_hash2.c
index 96ca7360b89..959a93e07b1 100644
--- a/source/smbd/mangle_hash2.c
+++ b/source/smbd/mangle_hash2.c
@@ -344,6 +344,7 @@ static BOOL check_cache(char *name)
/* we found it - construct the full name */
strncpy(extension, name+9, 3);
+ extension[3] = 0;
if (extension[0]) {
M_DEBUG(0,("check_cache: %s -> %s.%s\n", name, prefix, extension));
@@ -435,6 +436,19 @@ static BOOL name_map(char *name, BOOL need83, BOOL cache83)
/* find the '.' if any */
dot_p = strrchr(name, '.');
+ if (dot_p) {
+ /* if the extension contains any illegal characters or
+ is too long or zero length then we treat it as part
+ of the prefix */
+ for (i=0; i<4 && dot_p[i+1]; i++) {
+ if (! FLAG_CHECK(dot_p[i+1], FLAG_ASCII)) {
+ dot_p = NULL;
+ break;
+ }
+ }
+ if (i == 0 || i == 4) dot_p = NULL;
+ }
+
/* the leading character in the mangled name is taken from
the first character of the name, if it is ascii
otherwise '_' is used