From e2fd98af575a5c240593f21df442eb035f35e892 Mon Sep 17 00:00:00 2001 From: Alexander Bokovoy Date: Tue, 16 Mar 2004 17:18:57 +0000 Subject: Fix check_path_syntax() for multibyte encodings which have no '\' as second byte. This is intermediate fix as discussed with Jeremy until we move check_path_syntax() to UCS2 internally where all ambiguity is resolved. Please add other encodings into charcnv.c with such property.' ' (This used to be commit 2c404f6ba988d68c6f44df9409c0de319553de10) --- source3/smbd/reply.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source3/smbd/reply.c') diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index bca7a75fbb..48894308d1 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -33,6 +33,7 @@ extern char magic_char; extern BOOL case_sensitive; extern BOOL case_preserve; extern BOOL short_case_preserve; +extern BOOL is_unix_charset_unsafe; extern int global_oplock_break; unsigned int smb_echo_count = 0; @@ -110,7 +111,8 @@ NTSTATUS check_path_syntax(pstring destname, const pstring srcname) } s++; } else { - if ((*s & 0x80) && IS_DIRECTORY_SEP(s[1])) { + /* Activate this codepath only if we know that Unix charset may contain unsafe '\\' */ + if ((is_unix_charset_unsafe == True) && ((*s & 0x80) && IS_DIRECTORY_SEP(s[1]))) { /* * Potential mb char with second char a directory separator. * All the encodings we care about are 2 byte only, so do a -- cgit