[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: perl and md5 crypt



On Mon, Jan 14, 2002 at 05:26:36AM +0100, Christian Jaeger wrote:
> At 2:04 Uhr +0100 14.01.2002, Dries Kimpe wrote:
> >Wouldn't it be easier (and more portable) to just use
> >the passwd program to set the password?
> >As you script has to run as root anyway it won't ask
> >for the old password, and you could just write the password that
> >you want to a pipe (as stdin for passwd)
> >[Don't use echo 'examplepass' | passwd user or other constructs like that
> >because of the ps-problem...]
> 
> Not sure what you mean with "the ps problem" but I just wrote some 
> passwd caller and it took me some time to figure out that I need 
> 'sleep' calls for it to work. I'm using IPC::Open3 and then before 
> each print to the outgoing pipe I sleep 1. See 
> http://ethlife-b.ethz.ch:8080/~programmer/elcms_suidtools/perllib/el_user_tools.pm
> for my code (setsyspasswd()).

I'm not sure about 'the ps problem' either, but I assume Dries means
that the process will be listed by ps as "echo 'examplepass'|passwd",
showing everyone currently logged into the system the password that
you just went to great pains to hide.

-rob

Attachment: pgphn38fHSal3.pgp
Description: PGP signature


Reply to: