From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/11151 Path: news.gmane.org!.POSTED!not-for-mail From: He X Newsgroups: gmane.linux.lib.musl.general Subject: Re: Re: a bug in bindtextdomain() and strip '.UTF-8' Date: Sat, 18 Mar 2017 07:34:58 +0000 Message-ID: References: <20170211023610.GA1520@brightrain.aerifal.cx> <20170212023422.GE1520@brightrain.aerifal.cx> <20170213132816.GG1520@brightrain.aerifal.cx> <20170213171236.GI1520@brightrain.aerifal.cx> <20170317192749.GL1693@brightrain.aerifal.cx> <20170317193740.GM1693@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=001a114324fe069359054afc569f X-Trace: blaine.gmane.org 1489822534 957 195.159.176.226 (18 Mar 2017 07:35:34 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 18 Mar 2017 07:35:34 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-11166-gllmg-musl=m.gmane.org@lists.openwall.com Sat Mar 18 08:35:29 2017 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1cp8td-00088N-2d for gllmg-musl@m.gmane.org; Sat, 18 Mar 2017 08:35:29 +0100 Original-Received: (qmail 19802 invoked by uid 550); 18 Mar 2017 07:35:32 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 19778 invoked from network); 18 Mar 2017 07:35:31 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=RvMx2gZ9zCJ9UC8SoUn8HAQOX8uzwKsrpUYLvV0Nob4=; b=XGT0BEc+10mZgXPkkHcj6w+HqBXivo3cYue1NIeo+cXQ56/A6p/qTCjW0ZrgLVkIKS 28ejzFPrFBa6SqVItDzysV8UnEkUuVkIAl55n1RZQw+1Xaq/3+inao5kusPhXfh4+c52 wrjy+XzHh2ddaUMVFDwZ0WMQ93pc7IY9ev8/nISEBO2NanfFMHZTx5hrBYdgnR65NCET so6hNkaNtg4VFK/S/6rJkHJGPyRnHBFyT3a825N3kD2zRKO8gLE6kN5jqcVx9Jwjo0iF VhrlPqbcu2JLqodCNNwak+i2hfuG0BGraImK0aS+Ed4qG+q0kzV081/ES+UAhfQcYAIL 2stA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=RvMx2gZ9zCJ9UC8SoUn8HAQOX8uzwKsrpUYLvV0Nob4=; b=LViL9j2om4V0whrVQ1ZjOJo5D6MolKekFYgv/P7koikt0VgrnEveNFvSTXveLXL7vY kfQHSee6HLaAS3FZftdqgciZm+pldOTRsw0SoWv1h7pKVOHNzmYI2HQdZtHdpgej4QP0 I68jk64kdijMKCTaCSp8isd4jp5ihqtZ27OpJcN4uJJmjzB3qod+eL6f3UIoH/YtjPrp IG8zkel5HEeLpIRADgfEqcUrzkEuZnotWkAdcDLG2LWCVbf1T1w7aIsU5zm8tRNdwrNv tLubRqgedhf/AKVRqOjK0qyPQzTa8cdPI0acOs6L+mC6+Bt34n7KnVUEgRGZritM9UzG 3T7w== X-Gm-Message-State: AFeK/H3n05GbHz8TevjQlwZaDODYin50lSwmy+rOLNKKJu12WjI7bBF7OZjI01nEV+FzjvdTuL/L2P1GCzDZ9w== X-Received: by 10.31.160.3 with SMTP id j3mr7480973vke.92.1489822518969; Sat, 18 Mar 2017 00:35:18 -0700 (PDT) In-Reply-To: <20170317193740.GM1693@brightrain.aerifal.cx> Xref: news.gmane.org gmane.linux.lib.musl.general:11151 Archived-At: --001a114324fe069359054afc569f Content-Type: multipart/alternative; boundary=001a114324fe069353054afc569d --001a114324fe069353054afc569d Content-Type: text/plain; charset=UTF-8 > As discussed on irc, .charset suffixes should be dropped before the loop even begins (never used in pathnames), and they occur before the @mod, not after it, so the logic for dropping them is different. 1. drop .charset: Sorry for proposing it again, i forget this case after around three weeks, as i said before, vim will generate three different .mo files with different charset -> zh_CN.UTF-8.po, zh_CN.cp936.po, zh_CN.po. In that case, dropping is to generate a lots of junk. I now found it's not a bug of msgfmt. That is charset is converted by: iconv -f UTF-8 -t cp936 zh_CN.UTF-8.po | sed -e 's/charset=utf-8/charset=gbk/ > ... So that means, charset and pathname is decided by softwares, msgfmt does not do charset converting at all, just a format-translator. (btw, iconv.c is from alpine) How do we deal with the case? Patch the special software(since these special cases are rare, maybe other editors like emacs have similar actions, general softwares only prepare UTF-8 files)? Or put the drop back in the loop? I prefer the latter, it seems more elegant and correct than ugly patches, my idea is: ``` tt_TT.XXX@mod tt_TT.XXX tt.XXX@mod tt.XXX tt_TT@mod tt_TT tt@mod tt ``` I have made it in a similar way as @mod in the attached. Here's the output from strace: ``` 15:14:32.235463 open("./es_MX.utf8@euro/LC_MESSAGES/hellogt.mo", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory) 15:14:32.235495 open("./es_MX.utf8/LC_MESSAGES/hellogt.mo", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory) 15:14:32.235560 open("./es.utf8@euro/LC_MESSAGES/hellogt.mo", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory) 15:14:32.235585 open("./es.utf8/LC_MESSAGES/hellogt.mo", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory) 15:14:32.235621 open("./es_MX@euro/LC_MESSAGES/hellogt.mo", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory) 15:14:32.235656 open("./es_MX/LC_MESSAGES/hellogt.mo", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory) 15:14:32.235683 open("./es@euro/LC_MESSAGES/hellogt.mo", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = -1 ENOENT (No such file or directory) 15:14:32.235706 open("./es/LC_MESSAGES/hellogt.mo", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = 3 ``` Other possible LANG is tested, too. > One bug in my version: loclen+1 should be loclen+modlen+1. Without changing that, the pathname gets truncated if @mod is used. Otherwise it seems to work. 2. Yes, it is, made it in the attached. > then we should probably increase this limit a bit, perhaps to 24 or so. 3. the longest line is `tt_TT.iso885915@euro`, 21. 24 seems good for the current standard. Made it in the attached. 2017-03-17 19:37 GMT+00:00 Rich Felker : > On Fri, Mar 17, 2017 at 03:27:49PM -0400, Rich Felker wrote: > > + /* Logically split @mod suffix from locale name. */ > > + modname = memchr(locname, '@', loclen); > > + if (!modname) modname = locname + loclen; > > + alt_modlen = modlen = loclen - (modname-locname); > > + loclen = modname-locname; > > + > > + /* Drop .charset identifier; it is not used. */ > > + const char *csp = memchr(locname, '.', loclen); > > + if (csp) loclen = csp-locname; > > + > > + char name[dirlen+1 + loclen+1 + catlen+1 + domlen+3 + 1]; > > + const void *map; > > One bug in my version: loclen+1 should be loclen+modlen+1. Without > changing that, the pathname gets truncated if @mod is used. Otherwise > it seems to work. > > One separate but related problem I noticed while testing is that > musl's locale name length limit of 16 is insufficient for something > like "en_GB.UTF-8@euro". If we want to allow users to have an explicit > ".UTF-8" in the locale name (which, as we discussed a while back, > users may want to do if they plan to ssh into glibc-based systems) > then we should probably increase this limit a bit, perhaps to 24 or > so. > > Rich > --001a114324fe069353054afc569d Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
> As discussed on i= rc, .charset suffixes should be dropped before the
loop even begins (never used in p= athnames), and they occur before the
@mod, not after it, so the logic for dropping t= hem is different.

1. drop .charset: Sorry for proposing it again, i forget this case = after around three weeks, as i said before, vim will generate three differe= nt .mo files with different charset -> zh_CN.UTF-8.po, zh_CN.cp936.po, z= h_CN.po. In that case, dropping is to generate a lots of junk.=C2=A0
I now found it's not a bug of msgfmt. That is charset is c= onverted by: iconv -f UTF-8 -t cp936 zh_CN.UTF-8.po | sed -e 's/charset= =3Dutf-8/charset=3Dgbk/ > ... So that means, charset and pathname=C2=A0i= s decided by softwares, msgfmt does not do charset converting at all, just = a format-translator. (btw, iconv.c is from alpine)

How do we deal with the case? Patch the special software(since these speci= al cases are rare, maybe other editors like emacs have similar actions, gen= eral softwares only prepare UTF-8 files)?
Or put the drop back in= the loop? I prefer the latter, it seems more elegant and correct than ugly= patches, my idea is: ```
tt_TT.XXX@mod
tt_TT.XXX
tt.XXX@mod
tt.XXX
tt_TT@mod
tt_TT
tt@mod
tt
``= `
I have made it in a similar way as @mod in the attached. Here's the output from strace:
```
15:14:32.235463 open("./es_MX.utf8@euro/LC_MESSAGE= S/hellogt.mo", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such f= ile or directory)
15:14:32.= 235495 open("./es_MX.utf8/LC_MESSAGES/hellogt.mo", O_RDONLY|= O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or directory)
15:14:32.235560 open("./es.utf8@e= uro/LC_MESSAGES/hellogt.mo", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -= 1 ENOENT (No such file or directory)
15:14:32.235585 open("./es.utf8/LC_MESSAGES/hellogt.mo&= quot;, O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or direct= ory)
15:14:32.235621 open(&= quot;./es_MX@euro/LC_MESSAGES/hellogt.mo", O_RDONLY|O_NONBLOCK|O_= CLOEXEC) =3D -1 ENOENT (No such file or directory)
15:14:32.235656 open("./es_MX/LC_MESSAGES/hellogt.mo", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such fi= le or directory)
15:14:32.2= 35683 open("./es@euro/LC_MESSAGES/hellogt.mo", O_RDONLY|O_NO= NBLOCK|O_CLOEXEC) =3D -1 ENOENT (No such file or directory)
15:14:32.235706 open("./es/LC_MESSAGE= S/hellogt.mo", O_RDONLY|O_NONBLOCK|O_CLOEXEC) =3D 3
<= div>```
Other possible LANG is tested, too.

>=C2=A0One bug in = my version: loclen+1 should be loclen+modlen+1. Without
changing that, the pathname gets truncated if @mod = is used. Otherwise
it seems to work.
2. Yes, it is, made it in the attach= ed.

> then we sh= ould probably increase this limit a bit, perhaps to 24 or
so.
3. the longest line is `tt_TT.iso885915@eur= o`, 21. 24 seems good for the current standard. Made it in the attached.

2= 017-03-17 19:37 GMT+00:00 Rich Felker <dalias@libc.org>:
On Fri, Mar 17, 2017 at 03:27:49PM -0400, Rich= Felker wrote:
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0/* Logically split @m= od suffix from locale name. */
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0modname =3D memchr(lo= cname, '@', loclen);
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (!modname) modname= =3D locname + loclen;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0alt_modlen =3D modlen= =3D loclen - (modname-locname);
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0loclen =3D modname-lo= cname;
> +
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0/* Drop .charset iden= tifier; it is not used. */
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0const char *csp =3D m= emchr(locname, '.', loclen);
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (csp) loclen =3D c= sp-locname;
> +
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0char name[dirlen+1 + = loclen+1 + catlen+1 + domlen+3 + 1];
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0const void *map;

One bug in my version: loclen+1 should be loclen+modlen+1. Without
changing that, the pathname gets truncated if @mod is used. Otherwise
it seems to work.

One separate but related problem I noticed while testing is that
musl's locale name length limit of 16 is insufficient for something
like "en_GB.UTF-8@euro". If we want to allow users to have an exp= licit
".UTF-8" in the locale name (which, as we discussed a while back,=
users may want to do if they plan to ssh into glibc-based systems)
then we should probably increase this limit a bit, perhaps to 24 or
so.

Rich

--001a114324fe069353054afc569d-- --001a114324fe069359054afc569f Content-Type: text/plain; charset=US-ASCII; name="locale.diff" Content-Disposition: attachment; filename="locale.diff" Content-Transfer-Encoding: base64 X-Attachment-Id: f_j0exufm40 ZGlmZiAtLWdpdCBhL3NyYy9sb2NhbGUvZGNuZ2V0dGV4dC5jIGIvc3JjL2xvY2FsZS9kY25nZXR0 ZXh0LmMKaW5kZXggYjY4ZTI0Yi4uYWJhYTQxNCAxMDA2NDQKLS0tIGEvc3JjL2xvY2FsZS9kY25n ZXR0ZXh0LmMKKysrIGIvc3JjL2xvY2FsZS9kY25nZXR0ZXh0LmMKQEAgLTEwMCw3ICsxMDAsOSBA QCBzdHJ1Y3QgbXNnY2F0IHsKIAlzaXplX3QgbWFwX3NpemU7CiAJdm9pZCAqdm9sYXRpbGUgcGx1 cmFsX3J1bGU7CiAJdm9sYXRpbGUgaW50IG5wbHVyYWxzOwotCWNoYXIgbmFtZVtdOworCXN0cnVj dCBiaW5kaW5nICpiaW5kaW5nOworCWNvbnN0IHN0cnVjdCBfX2xvY2FsZV9tYXAgKmxtOworCWlu dCBjYXQ7CiB9OwoKIHN0YXRpYyBjaGFyICpkdW1teV9nZXR0ZXh0ZG9tYWluKCkKQEAgLTEyMCw4 ICsxMjIsOCBAQCBjaGFyICpkY25nZXR0ZXh0KGNvbnN0IGNoYXIgKmRvbWFpbm5hbWUsIGNvbnN0 IGNoYXI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