Bug #1332
closedssh should use YESEXPR/NOEXPR
100%
Description
ja_JP.UTF-8 locale環境で、sshを使用した際に、「yes/no」 ではなく、「はい/いいえ」を入力する必要がある。
そのため、日本語を入力出来ない環境で困る場合がある。
/usr/lib/locale/ja_JP.UTF-8/LC_MESSAGES/LCL_DATA を修正することで、回避可能。
Files
Updated by Yasushi TAKI almost 12 years ago
Satoru MIYAZAKI said,
On ja_JP.UTF-8 locale, when using ssh, ssh response 'yes/no' by Japanese "はい/いいえ" .
If user can't input by Japanese, it is critical problems.
Workaround:
Change /usr/lib/locale/ja_JP.UTF-8/LC_MESSAGES/LCL_DATA
MIYAZAKIさん:
具体的に、どのように変更すればよろしいのでしょうか?
---
On Solaris 10 and 11 express, Japanese users don't need to type "はい/いいえ". Most Linux Distribution is same. we can type "yes/no".
Maybe, this problems is compatibility illumos g18n module and Solaris.
Miyazaki-san said how to fix about DATA.
Updated by Rich Lowe almost 12 years ago
- Project changed from site to illumos gate
Updated by Albert Lee almost 12 years ago
LCL_DATA contains
^((はい)|(ハイ)|([yY]([eE][sS])?)) ^((いいえ)|(イイエ)|([nN]([oO])?)) はい いいえ
The regular expressions on the first two lines are presumably used to check input and should match "y"/"n", "yes"/"no", as well as "はい" /"いいえ", or even "ハイ"/"イイエ".
Was only "はい" /"いいえ" accepted?
Updated by Yuri Pankov almost 12 years ago
usr/src/cmd/ssh/ssh doesn't use YESEXPR and NOEXPR, it uses only YESSTR and NOSTR, which works fine on Solaris 11 as there they are 'yes' and 'no' for ja_JP.UTF-8. Real fix could be something like the attached patch (tested in ja_JP.UTF-8 and ru_RU.UTF-8).
Updated by Yuri Pankov almost 12 years ago
And ru_RU.UTF-8 locale on Solaris 11 accepts only localized responses, so it's broken there as well..
Updated by Satoru MIYAZAKI almost 12 years ago
この問題のWorkaroundとして、添付するpatch をあてていました。
Yuriさんのpatchでこの問題は解決しそうですね。
ただ、ssh以外の他のコマンドでも、YESEXPR/NOEXPRの代わりにYESSTR/NOSTRを使用していないかどうかを
チェックする必要がありそうです。
Updated by Yuri Pankov almost 12 years ago
Could you please translate that? I can't read japanese.
Updated by Yuri Pankov almost 12 years ago
Anyway, patching LC_MESSAGES doesn't look correct to me, we should use the regexes provided by LC_MESSAGES instead (my patch isn't ideal, but should be ok for the start), otherwise we'll end patching a lot of locales...
Updated by Yasushi TAKI almost 12 years ago
MIYAZAKI-san said,
Attached patch is workaround for this problem.
He think, Yuri's patches is good, too.
But, YESEXPR / NOEXPR are used the other of ssh?
We need to check it.
I(TAKI) think....
BTW, why other os ( freebsd , linux ) work fine?
Updated by Yuri Pankov almost 12 years ago
Try the following:
$ cat test.c #include <stdio.h> #include <locale.h> #include <langinfo.h> int main(int argc, char *argv[]) { char *locale; locale = strdup(argv[1]); setlocale(LC_ALL, locale); printf("LOCALE=%s YESSTR=%s NOSTR=%s YESEXPR=%s NOEXPR=%s\n", locale, nl_langinfo(YESSTR), nl_langinfo(NOSTR), nl_langinfo(YESEXPR), nl_langinfo(NOEXPR)); return (0); }
followed by:
gcc -o test test.c for i in /usr/lib/locale/*.UTF-8; do ./test `basename $i`; done
/usr/share/locale for BSD, of course...
and you'll see why..
they don't really support locales, FreeBSD at least, didn't check linux
Updated by Yuri Pankov almost 12 years ago
And as I said, with ru_RU.UTF-8, ssh accepts only localized 'да' or 'нет', doesn't look good... which are returned by nl_langinfo for YESSTR and NOSTR, so touching ja_JP.UTF-8's data doesn't seem like a solution..
Updated by Albert Lee almost 12 years ago
- Subject changed from ssh on ja_JP.UTF-8 locale to ssh on ja_JP.UTF-8 locale
Updated by Garrett D'Amore over 11 years ago
- Subject changed from ssh on ja_JP.UTF-8 locale to ssh should use YESEXPR/NOEXPR
Updated by Garrett D'Amore over 11 years ago
- Assignee set to Garrett D'Amore
I'll take this... its locale related, and I guess this has become kind of one of my areas...
Updated by Yuri Pankov over 11 years ago
My RTI for this was accepted, but not commited.
Updated by Garrett D'Amore over 11 years ago
Yuri: I will look into it tonight. (I am about to leave right now, or I would handle it now.)
Updated by Garrett D'Amore over 11 years ago
Fixed in:
changeset: 13585:411be0f9d82b tag: tip user: Garrett D'Amore <garrett@damore.org> date: Tue Jan 31 22:25:52 2012 -0800 description: 1332 ssh should use YESEXPR/NOEXPR Reviewed by: Garrett D'Amore <garrett@damore.org> Reviewed by: Albert Lee <trisk@opensolaris.org> Approved by: Garrett D'Amore <garrett@damore.org>
Updated by Garrett D'Amore over 11 years ago
This change came from Yuri Pankov, and I forgot to edit the user when I did hg reci. Sorry!
Updated by Garrett D'Amore over 11 years ago
- Status changed from New to Resolved
- % Done changed from 0 to 100