summaryrefslogtreecommitdiff
path: root/source3/smbd/mangle_hash.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2005-08-23 17:53:11 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:01:12 -0500
commit78257e343305b426c5853c4dcbfa3d63dd5f720d (patch)
treeadaec863c4e51b95d9c476f265669572a3f5c7fe /source3/smbd/mangle_hash.c
parent9454668a90ab453761c6064835cbc7ac36f9341b (diff)
downloadsamba-78257e343305b426c5853c4dcbfa3d63dd5f720d.tar.gz
samba-78257e343305b426c5853c4dcbfa3d63dd5f720d.tar.bz2
samba-78257e343305b426c5853c4dcbfa3d63dd5f720d.zip
r9532: Fix for bug #2152, championed by Neil Hoggarth <neil.hoggarth@physiol.ox.ac.uk>.
Jeremy. (This used to be commit d29a45565d955e655b9b5a06039be39efc9e021b)
Diffstat (limited to 'source3/smbd/mangle_hash.c')
-rw-r--r--source3/smbd/mangle_hash.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source3/smbd/mangle_hash.c b/source3/smbd/mangle_hash.c
index 871702623a..093b60b042 100644
--- a/source3/smbd/mangle_hash.c
+++ b/source3/smbd/mangle_hash.c
@@ -167,10 +167,6 @@ static NTSTATUS is_valid_name(const smb_ucs2_t *fname, BOOL allow_wildcards, BOO
if (strcmp_wa(fname, ".")==0 || strcmp_wa(fname, "..")==0)
return NT_STATUS_OK;
- /* Name cannot start with '.' */
- if (*fname == UCS2_CHAR('.'))
- return NT_STATUS_UNSUCCESSFUL;
-
if (only_8_3) {
ret = has_valid_83_chars(fname, allow_wildcards);
if (!NT_STATUS_IS_OK(ret))
@@ -247,6 +243,10 @@ static NTSTATUS is_8_3_w(const smb_ucs2_t *fname, BOOL allow_wildcards)
if (strcmp_wa(fname, ".") == 0 || strcmp_wa(fname, "..") == 0)
return NT_STATUS_OK;
+ /* Name cannot start with '.' */
+ if (*fname == UCS2_CHAR('.'))
+ return NT_STATUS_UNSUCCESSFUL;
+
if (!NT_STATUS_IS_OK(is_valid_name(fname, allow_wildcards, True)))
goto done;