The Samba-Bugzilla – Attachment 9212 Details for
Bug 10139
valid utf8 filenames cause "invalid conversion error" messages.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
git-am fix for 3.6.x.
0001-Fix-is_legal_name-to-not-emit-character-conversion-e.patch (text/plain), 1.35 KB, created by
Jeremy Allison
on 2013-09-12 21:42:22 UTC
(
hide
)
Description:
git-am fix for 3.6.x.
Filename:
MIME Type:
Creator:
Jeremy Allison
Created:
2013-09-12 21:42:22 UTC
Size:
1.35 KB
patch
obsolete
>From c87bd86225d0c9155bd34972f79c9f4ba09489e5 Mon Sep 17 00:00:00 2001 >From: Jeremy Allison <jra@samba.org> >Date: Thu, 12 Sep 2013 14:44:58 -0700 >Subject: [PATCH] Fix is_legal_name() to not emit character conversion error > messages. > >Using next_codepoint() does the same check, but without the conversion >message. > >Signed-off-by: Jeremy Allison <jra@samba.org> >--- > source3/smbd/mangle_hash2.c | 9 +++++---- > 1 file changed, 5 insertions(+), 4 deletions(-) > >diff --git a/source3/smbd/mangle_hash2.c b/source3/smbd/mangle_hash2.c >index 5aafe2f..90d9498 100644 >--- a/source3/smbd/mangle_hash2.c >+++ b/source3/smbd/mangle_hash2.c >@@ -626,7 +626,8 @@ static bool is_legal_name(const char *name) > while (*name) { > if (((unsigned int)name[0]) > 128 && (name[1] != 0)) { > /* Possible start of mb character. */ >- char mbc[2]; >+ size_t size = 0; >+ (void)next_codepoint(name, &size); > /* > * Note that if CH_UNIX is utf8 a string may be 3 > * bytes, but this is ok as mb utf8 characters don't >@@ -634,9 +635,9 @@ static bool is_legal_name(const char *name) > * for mb UNIX asian characters like Japanese (SJIS) here. > * JRA. > */ >- if (convert_string(CH_UNIX, CH_UTF16LE, name, 2, mbc, 2, False) == 2) { >- /* Was a good mb string. */ >- name += 2; >+ if (size > 1) { >+ /* Was a mb string. */ >+ name += size; > continue; > } > } >-- >1.8.4 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Flags:
vl
:
review+
Actions:
View
Attachments on
bug 10139
:
9211
| 9212