Project

General

Profile

Actions

Bug #1332

closed

ssh should use YESEXPR/NOEXPR

Added by Satoru MIYAZAKI almost 12 years ago. Updated over 11 years ago.

Status:
Resolved
Priority:
Normal
Category:
-
Start date:
2011-08-03
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:
External Bug:

Description

ja_JP.UTF-8 locale環境で、sshを使用した際に、「yes/no」 ではなく、「はい/いいえ」を入力する必要がある。
そのため、日本語を入力出来ない環境で困る場合がある。
/usr/lib/locale/ja_JP.UTF-8/LC_MESSAGES/LCL_DATA を修正することで、回避可能。


Files

ssh.diff (1.25 KB) ssh.diff Yuri Pankov, 2011-08-04 10:47 AM
ja_JP.UTF-8_LCL_DATA.patch (309 Bytes) ja_JP.UTF-8_LCL_DATA.patch Satoru MIYAZAKI, 2011-08-04 08:25 PM
Actions #1

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.

Actions #2

Updated by Rich Lowe almost 12 years ago

  • Project changed from site to illumos gate
Actions #3

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?

Actions #4

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).

Actions #5

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..

Actions #6

Updated by Satoru MIYAZAKI almost 12 years ago

この問題のWorkaroundとして、添付するpatch をあてていました。
Yuriさんのpatchでこの問題は解決しそうですね。
ただ、ssh以外の他のコマンドでも、YESEXPR/NOEXPRの代わりにYESSTR/NOSTRを使用していないかどうかを
チェックする必要がありそうです。

Actions #7

Updated by Yuri Pankov almost 12 years ago

Could you please translate that? I can't read japanese.

Actions #8

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...

Actions #9

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?

Actions #10

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

Actions #11

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..

Actions #12

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
Actions #13

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
Actions #14

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...

Actions #15

Updated by Yuri Pankov over 11 years ago

My RTI for this was accepted, but not commited.

Actions #16

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.)

Actions #17

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>
Actions #18

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!

Actions #19

Updated by Garrett D'Amore over 11 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100
Actions

Also available in: Atom PDF