Hi Everyone.... I'm trying to add users from a perl script, the script writes out lines of users to add to the system. Then a system call is made using :
system("/bin/bash","/tmp/Seabed_Users");
In the file Seabed_Users is the following...
adduser -g 45 -s /bin/false -p FtItmgt8G8RJY -d <directory>/username username
When the file is run from the command line as root it works fine, however from the setuid script it doesn't work I get
"adduser: unable to lock password file"
in the error log.. Any ideas
Thanks
Simon
When the file is run from the command line as root it works fine
I think this is the problem. I think adduser requires you to be root in order to have the right permission on the passwd file. I get the same error if I try adduser as a normal user on the command line.
Cheers,
Mathew