i would highly recommend that you use your operating system's useradd or adduser command to manipulate the password file, instead of doing it yourself directly. you can easily write a wrapper around that to supply default arguments for the things you don't want to prompt for, if that is what you are looking for. otherwise, you need to worry about file locking, data that will screw up parsing the file, and a host of other problems that someone else has already thought about, and tested extensively (or one would hope, anyway). | [reply] |
See the core functions documented under getpwent, getpwnam, getpwuid and sugared by User::pwent.
They take care of shadow files, and other authentication schemes.
After Compline, Zaxo
| [reply] |
There's an example of accessing the /etc/passwd file as a flat-file database in the DBD::CSV docs. That may be a good place to start.
_______________
D
a
m
n
D
i
r
t
y
A
p
e
Home Node
|
Email
| [reply] |