How about making the entry into the password file directly. fopen(3S) it
directly and append your entry to it as it is a simple text file.
The password you have entered from the user (unencrypted) can be encrypted
using the crypt(3C) library function.
If you do this you can also think about using
alternative methods for generating the salt. gettimeofday(3C) is
traditional but you can also use alternatives like gethrtime(3C).
Invoking useradd and the likes may not be such a good idea. when you can
do the above. It is much simpler too !
On Thu, 29 Apr 1999, wrote:
> I'm working on a programm which have to create useraccounts. The users
> who want to have an account, must enter their name, etc... and their
> password in a database (MySQL). Then the program analyse their demands
> and, if it's good, create their accounts. Actually I use the commande
> 'useradd' in may program and I can't change the password dynamicly...
> Have I choose the good solution with 'useradd'? else how can I do???
>
####################################################
# Blinston S. Fernandes eMail:[EMAIL PROTECTED] #
# System Software Development Group #
# Centre for Development of Advanced Computing #
# 2/1 Ramanashree Plaza #
# Bangalore 560 025 #
# India #
# Tel: 91-080-5584271/982/143 ext:310 #
# Fax: 91-080-5584893 # b2
############################################### **