[fpc-pascal]How to change a users password on Linux

2004-05-21 Thread A.J. Venter
Hi,

I am working on a project that needs among other things to create Linux
users, and then set a password for them.

One way to do this is to use a program that can read the password from
stdin and just wrap around it, for example
echo "testusers:test" | chpasswd will change testuser's password to test
on Slackware.
Likewize redhat likes have a version of passwd that takes a --stdin
option, so you can do
echo "test" | passwd --stdin testuser 
Both these can only be run by root of course.

The problem is no system seems to support both, and I need maximum
distribution indepedance. Has anybody else done a frontend for user
management or similiar system ? Can anyone tell me how  to set a user's
password in a distribution independant way ?

TIA
A.J.


___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal]RE: How to change a users password on Linux

2004-05-21 Thread A.J. Venter
Erm, obviously I need a way to do that in pascal, I think that got
left out of the message 
A.J.


___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal]How to change a users password on Linux

2004-05-21 Thread Michael . VanCanneyt


On Fri, 21 May 2004, A.J. Venter wrote:

> Hi,
> 
> I am working on a project that needs among other things to create Linux
> users, and then set a password for them.
> 
> One way to do this is to use a program that can read the password from
> stdin and just wrap around it, for example
> echo "testusers:test" | chpasswd will change testuser's password to test
> on Slackware.
> Likewize redhat likes have a version of passwd that takes a --stdin
> option, so you can do
> echo "test" | passwd --stdin testuser 
> Both these can only be run by root of course.
> 
> The problem is no system seems to support both, and I need maximum
> distribution indepedance. Has anybody else done a frontend for user
> management or similiar system ? Can anyone tell me how  to set a user's
> password in a distribution independant way ?

libc unit. putpwent() and friends.
in the FPC sources, see packages/base/libc/pwdh.inc for all functions.

Michael.

___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal