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()).

cheers
christian.

Reply via email to