Why not to read environment before do_pwchange() ?

Piotr Kapczuk piotr at hoop.pl
Tue Mar 22 01:52:05 EST 2005


Hi

   I use OpenSSH 3.8.1p1 on AIX 5.2 ML05. (compiled from source, not
   IBM's package). On one of my hosts users use it solely for password
   changes.

   Default user shell is /usr/bin/passwd. After one logs in, environment
   is set per user (/etc/security/environ, ~/.ssh/environment) LANG is
   set to pl_PL

   passwd is "aware" of the environment and system talks to user in
   Polish. That's what I want.

   Problem occurres when password expires. User is forced to change
   password. From now on passwd talks in system's default $LANG, which
   is English.

   I've found the cause of such behavior in session.c

   Function do_child() invokes do_pwchange() at the beginning, before
   everything else. (4.0p1 session.c line 1445)

   Environment is read later by do_setup_env() - when setting $SHELL
   (line 1496)

   When /usr/bin/passwd is executed by do_pwchange() it doesn't know
   environment and uses default from /etc/environment.

   The solution is to read user environment before forcing password
   change.


   Is this appropriate place for asking for a fix ?

   
   PS. I know there's IBM's OpenSSH port with NLS patches.
   Unfortunately it's old :|

   I'm not subscribed to the list so please CC me when replaying.
   
-- 
Regards
Piotr Kapczuk
_________________________________________________________
"Decisions are good, but good decisions are better."




More information about the openssh-unix-dev mailing list