summaryrefslogtreecommitdiff
path: root/source3/smbd/reply.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2005-05-25 19:25:35 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:56:59 -0500
commit75f109bc81c0ff0d714070b3f324bce62c2f3984 (patch)
tree887ad30feac1edc17b507aa6e278e42a568f9957 /source3/smbd/reply.c
parent0419e24287d09a71735d94ea019a7f17842201d3 (diff)
downloadsamba-75f109bc81c0ff0d714070b3f324bce62c2f3984.tar.gz
samba-75f109bc81c0ff0d714070b3f324bce62c2f3984.tar.bz2
samba-75f109bc81c0ff0d714070b3f324bce62c2f3984.zip
r6977: Fix bug #2735 (not mangling control characters) plus
ensure we don't create files with control characters either. Jeremy. (This used to be commit 0ca2423c706423a07721e375345b6d45a45cbcf4)
Diffstat (limited to 'source3/smbd/reply.c')
-rw-r--r--source3/smbd/reply.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index 686f54c5e7..1c2e950836 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -118,6 +118,9 @@ NTSTATUS check_path_syntax(pstring destname, const pstring srcname)
}
if (!(*s & 0x80)) {
+ if (*s <= 0x1f) {
+ return NT_STATUS_OBJECT_NAME_INVALID;
+ }
switch (*s) {
case '*':
case '?':
@@ -244,6 +247,9 @@ NTSTATUS check_path_syntax_wcard(pstring destname, const pstring srcname)
}
if (!(*s & 0x80)) {
+ if (*s <= 0x1f) {
+ return NT_STATUS_OBJECT_NAME_INVALID;
+ }
*d++ = *s++;
} else {
switch(next_mb_char_size(s)) {