[bug] multibyte sharename becomes broken when default service is enable
Samba-JP TAKAHASHI Motonobu
monyo at samba.gr.jp
Mon Jun 11 17:10:40 GMT 2001
Hello,
There is a bug under multibyte environment with Windows NT/2000
For example, if we connect to a share named [:8a:bf:8e:9a:8a:bf:8e:9a]
on Samba with following smb.conf from Windows NT/2000, then a new
share named [:8a:bf:8e:9a:8a:bf] is created for the client with using
default service function.
This does not depend on 'coding system' and this problem affects any
Japanese share name (that mean multi byte share name).
This is a very severe problem in Japan and we fixed this in our Samba
2.0.9 Japanese Edition.
There are similar coding in dos_buffer2_to_str() and
dos_buffer2_to_multistr(), we suspect there is another bug...
----- sample smb.conf -----
# Global parameters
[global]
coding system = CAP
client code page = 932
guest account = smbguest
default service = sambatest
[sambatest]
guest only = Yes
guest ok = Yes
[:8a:bf:8e:9a:8a:bf:8e:9a]
---- Cut Here ---- For 2.0.9 ----
diff -ur lib/util_unistr.c.010611 lib/util_unistr.c
--- lib/util_unistr.c.010611 Wed May 30 12:36:34 2001
+++ lib/util_unistr.c Mon Jun 11 10:28:48 2001
@@ -175,11 +175,10 @@
char *lbuf = lbufs[nexti];
char *p;
uint16 *src = str->buffer;
- int max_size = MIN(sizeof(str->buffer)-3, str->uni_str_len);
nexti = (nexti+1)%8;
- for (p = lbuf; *src && p-lbuf < max_size; src++) {
+ for (p = lbuf; *src && p-lbuf < sizeof(str->buffer)-3 && src-str->buffer < str->uni_str_len; src++) {
uint16 ucs2_val = SVAL(src,0);
uint16 cp_val = ucs2_to_doscp[ucs2_val];
---- Cut Here ---- For 2.2 HEAD ----
diff -ur lib/util_unistr.c.010611 lib/util_unistr.c
--- lib/util_unistr.c.010611 Mon Apr 9 06:50:08 2001
+++ lib/util_unistr.c Mon Jun 11 10:46:58 2001
@@ -201,11 +201,10 @@
char *lbuf = lbufs[nexti];
char *p;
uint16 *src = str->buffer;
- int max_size = MIN(MAXUNI-3, str->uni_str_len);
nexti = (nexti+1)%8;
- for (p = lbuf; (p-lbuf < max_size) && *src; src++) {
+ for (p = lbuf; (p-lbuf < MAXUNI-3) && (src-str->buffer < str->uni_str_len) && *src; src++) {
uint16 ucs2_val = SVAL(src,0);
uint16 cp_val = ucs2_to_doscp[ucs2_val];
---- Cut Here ----
-----
TAKAHASHI Motonobu mailto:monyo at samba.gr.jp
Samba Users Group Japan http://www.samba.gr.jp/
More information about the samba-technical
mailing list