[fpc-pascal]Password changing

Helio Cavichiolo Jr hcav at ig.com.br
Thu Jun 6 22:16:50 CEST 2002


Thank you Vassilis, but I thought fpc had a function to do that.
I'm currently using...

shell('echo "',user,':',pass,'" | chpasswd');

...but would prefer something system independent.


Em Qui 06 Jun 2002 16:51, vocĂȘ escreveu:
> Perhaps you could try something like this:
>
> program changemypasswd;
>
> uses Linux;
>
> var f : text;
>
> begin
>      Popen(f, '/usr/bin/passwd --stdin userid > /dev/null','w');
>      writeln(f, 'password');
>      Flush(f);
>      Close(f);
> end.
>
> It must work - test yourself to make sure it is working.
>
> If you like you can email me privately with info regarding the project
> you're making - perhaps I do have code to share (if I guess correctly what
> you are building).
>
> Vassilis




More information about the fpc-pascal mailing list