diff options
author | Andrew Tridgell <tridge@samba.org> | 2002-04-12 10:18:46 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2002-04-12 10:18:46 +0000 |
commit | 4023a61892278c9e09acd035166a55ff2b3d4f30 (patch) | |
tree | b51717ccd25c88ea8bf879194812198d10d41ec7 /source3/smbd/mangle_hash2.c | |
parent | ef3197889f53794a54274df5c2a6ff057d8afe51 (diff) | |
download | samba-4023a61892278c9e09acd035166a55ff2b3d4f30.tar.gz samba-4023a61892278c9e09acd035166a55ff2b3d4f30.tar.bz2 samba-4023a61892278c9e09acd035166a55ff2b3d4f30.zip |
merged the mangling test and passdb bugfixes into SAMBA_3_0
(This used to be commit 97eb3a121d33200ee7559b2413d6252efc04ebaf)
Diffstat (limited to 'source3/smbd/mangle_hash2.c')
-rw-r--r-- | source3/smbd/mangle_hash2.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/source3/smbd/mangle_hash2.c b/source3/smbd/mangle_hash2.c index 96ca7360b8..959a93e07b 100644 --- a/source3/smbd/mangle_hash2.c +++ b/source3/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 |