summaryrefslogtreecommitdiff
path: root/source3/smbd/mangle_hash2.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2005-09-29 01:27:19 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:04:47 -0500
commit4850bc63104f5f2945d9e91cfbd99773a5bc570f (patch)
tree5ce2cae56cefae44558a94772f320ee0179a4454 /source3/smbd/mangle_hash2.c
parent93bbaac16636c86c2a0c8c61fbbfd1a5c63f6f5a (diff)
downloadsamba-4850bc63104f5f2945d9e91cfbd99773a5bc570f.tar.gz
samba-4850bc63104f5f2945d9e91cfbd99773a5bc570f.tar.bz2
samba-4850bc63104f5f2945d9e91cfbd99773a5bc570f.zip
r10600: Fix bug #2769 (mangle filenames ending in a space)
and an old bug where mangle mathod hash wasn't mangling file names with more than one dot which also end in a dot. Jeremy. (This used to be commit 105e38847dc0078951abcda16808590ccc363b00)
Diffstat (limited to 'source3/smbd/mangle_hash2.c')
-rw-r--r--source3/smbd/mangle_hash2.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/source3/smbd/mangle_hash2.c b/source3/smbd/mangle_hash2.c
index e44aaf17e7..613dda9a16 100644
--- a/source3/smbd/mangle_hash2.c
+++ b/source3/smbd/mangle_hash2.c
@@ -445,6 +445,7 @@ static BOOL is_reserved_name(const char *name)
/*
See if a filename is a legal long filename.
A filename ending in a '.' is not legal unless it's "." or "..". JRA.
+ A filename ending in ' ' is not legal either. See bug id #2769.
*/
static BOOL is_legal_name(const char *name)
@@ -480,6 +481,10 @@ static BOOL is_legal_name(const char *name)
} else {
alldots = False;
}
+ if ((name[0] == ' ') && (name[1] == '\0')) {
+ /* Can't end in ' ' */
+ return False;
+ }
name++;
}
@@ -491,7 +496,6 @@ static BOOL is_legal_name(const char *name)
if (dot_pos[1] == '\0')
return False;
}
-
return True;
}