Bug#95213: [Pkg-shadow-devel] Bug#95213: Passing env variables after the login name does not work

Nicolas François Nicolas François , 95213@bugs.debian.org
Tue, 5 Apr 2005 21:49:03 +0200


Hi,

On Tue, Apr 05, 2005 at 07:44:21PM +0200, Tomasz KÅ‚oczko wrote:
> > And, as mentioned in the bug report, te env var passing at the login
> > prompt is advertised in the login(1) man page)
> 
> login from Solaris do not have this kind abilities.
> Also I don't see this kind abilities in oldest login.c code 
> (mantaining shadow in CVS was started in 1996).
> So in next shadow (4.0.8) will be removed text about abilities to allow
> pass envoroment variable in login prompt.
> 
> I'm identify text fragment about this abilities in 
> src/{de,hu,pl}/login.1 but I need help on update ja/login.1.

In fact, it (can) work:

21:35:49# login fzt FOO=BAR
Password:
Last login: Tue Apr  5 18:50:59 2005 on :0
Linux nekral 2.4.27 #1 sam oct 9 16:13:52 CEST 2004 i686 GNU/Linux
You have mail.
fzt@nekral:~$ echo $FOO
BAR

(Can you try it on Solaris?)

It depends on the args login receives (it doesn't work with:
login "fzt FOO=BAR").
When login is started without any argument (when it prints a "login:"
prompt), the text entered by the user is just taken as a user name, no env
can be provided.


The same thing happen when login is invoked by getty (getty prints the
prompt, and then invoke login with the username in argument).

This could be solved by login or getty by splitting the text entered by
the user on spaces (this may be much more complex because of quotes...).

I don't think this functionality is really useful, so maybe it is not
worth doing something else than updating the man page (it should indicate
that it only woks when the variables are indicated on the command line, as
in the synopsis).

Cheers,
-- 
Nekral