On Thursday 30 October 2008 12:20, Sergio wrote:
> Hello,
> 
> I have a telnet server (in.telnetd) on a PPC board. I'm using BusyBox login 
> and switching from 1.9.2 to 1.12.1 I noticed that user doesn't login 
> anymore in its $HOME directory.
> 
> $HOME directory, however, is correctly set because with a "cd" command I 
> jump in it.
> 
> I've seen the difference between 1.9.2 and 1.12.1 was introduced with svn 
> revision 21346 where 2nd and 3rd parameters of setup_environment() were 
> switched:
> 
> -     /* setup_environment params: shell, loginshell, changeenv, pw */
> -     setup_environment(tmp, 1, !(opt & LOGIN_OPT_p), pw);
> -     /* FIXME: login shell = 1 -> 3rd parameter is ignored! */
> +     /* setup_environment params: shell, clear_env, change_env, pw */
> +     setup_environment(tmp, !(opt & LOGIN_OPT_p), 1, pw);
> 
> I see that in.telnetd calls login with "-p" argument that, in fact, asks 
> login to preserve environment so (in the setup_environment.c code) the 
> setup_environment() does not chdir() to $HOME.
> 
> Is this correct?

Don't know, but have a feeling that it is not.

I propose chdir'ing to user's home directory
in setup_environment() regardless of the clear_env value.

What do you think?
--
vda
_______________________________________________
busybox mailing list
[email protected]
http://busybox.net/cgi-bin/mailman/listinfo/busybox

Reply via email to