OpenSSH
[Top] [All Lists]

Re: support of locale

To: Carson Gaspar <carson@taltos.org>
Subject: Re: support of locale
From: Darren Tucker <dtucker@zip.com.au>
Date: Wed, 24 Jan 2007 12:21:53 +1100
Cc: openssh-unix-dev@mindrot.org, Cynthia.K.Mullis@state.or.us
Delivered-to: sp-com-lists@consult.net
Delivered-to: openssh-unix-dev-list1@securepoint.com
Delivered-to: openssh-unix-dev-tmda@mindrot.org
Delivered-to: openssh-unix-dev@mindrot.org
In-reply-to: <45B6AA43.90808@taltos.org>
List-archive: <http://lists.mindrot.org/pipermail/openssh-unix-dev>
List-help: <mailto:openssh-unix-dev-request@mindrot.org?subject=help>
List-id: Development of portable OpenSSH <openssh-unix-dev.mindrot.org>
List-post: <mailto:openssh-unix-dev@mindrot.org>
List-subscribe: <http://lists.mindrot.org/mailman/listinfo/openssh-unix-dev>, <mailto:openssh-unix-dev-request@mindrot.org?subject=subscribe>
List-unsubscribe: <http://lists.mindrot.org/mailman/listinfo/openssh-unix-dev>, <mailto:openssh-unix-dev-request@mindrot.org?subject=unsubscribe>
References: <s5b5d8f2.078@sos.state.or.us> <45B69035.5030207@zip.com.au> <45B6AA43.90808@taltos.org>
Reply-to: dtucker@zip.com.au
Sender: openssh-unix-dev-bounces+openssh-unix-dev-list1=securepoint.com@mindrot.org
User-agent: Mutt/1.5.11
On Tue, Jan 23, 2007 at 04:37:23PM -0800, Carson Gaspar wrote:
> Darren Tucker wrote:
> > Cynthia K MULLIS wrote:
> >> When I ssh to a server, the locale information is set to "C" regardless
> >> of the settings in the /etc/default/init. 
> > 
> > OpenSSH's sshd does not parse /etc/default/init, so unless your shell 
> > does then you won't see them.
> > 
> > I don't know what normally parses it on Solaris, but if it's a PAM 
> > module then enabling PAM might help.
> 
> It's parsed by "init", oddly enough ;-)

Ah, right.  That would make sense :-)

> If you change /etc/default/init, you need to reboot (sadly, there is no 
> way to get init to re-read the config file). Then init will have the new 
> settings, and all children of init will inherit them.

OK, but unless you have sshd spawned out of inittab that still won't help
much.

> I haven't looked at the source to see if sshd will pass said environment 
> along to its children or not.

It doesn't, but it's not hard to make it do so, eg:

Index: session.c
===================================================================
RCS file: /usr/local/src/security/openssh/cvs/openssh/session.c,v
retrieving revision 1.349
diff -u -p -r1.349 session.c
--- session.c   23 Oct 2006 17:01:56 -0000      1.349
+++ session.c   24 Jan 2007 01:18:13 -0000
@@ -1024,6 +1024,15 @@ do_setup_env(Session *s, const char *she
                free_windows_environment(p);
        }
 #endif
+       {
+               char *var, *val, *localevar[] = { "LANG", "LC_CTYPE",
+                   "LC_NUMERIC", "LC_TIME", "LC_COLLATE", "LC_MONETARY",
+                   "LC_MESSAGES", "LC_ALL", NULL };
+
+               for (i = 0; (var = localevar[i]) != NULL; i++)
+                       if ((val = getenv(var)) != NULL)
+                               child_set_env(&env, &envsize, var, val);
+       }
 
 #ifdef GSSAPI
        /* Allow any GSSAPI methods that we've used to alter

-- 
Darren Tucker (dtucker at zip.com.au)
GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4  37C9 C982 80C7 8FF4 FA69
    Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.
_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@mindrot.org
http://lists.mindrot.org/mailman/listinfo/openssh-unix-dev

<Prev in Thread] Current Thread [Next in Thread>