Friday, December 14, 2001, 1:37:00 AM, Daniel Falkenberg wrote:
> Could some one help me with the following code?  Basically the code
> works OK except for the fact that the user $new_user (s) home dir is not
> created?

> #!/usr/bin/perl -w

> use Unix::PasswdFile;

> my $new_user = "test7";
> my $new_fname = "Test";
> my $new_lname = "Account";
> my $new_pass  = "password";

> my $pw = new Unix::PasswdFile "/etc/passwd";
$pw->>user("$new_user", $pw->encpass("$new_pass"), $pw->maxuid + 1, 45,
> "$new_fname $new_lname", "/home/$new_user", "/bin/false");
$pw->>passwd("$new_user", $pw->encpass("$new_pass"));
$pw->>commit();
> undef $pw;
> system("pwconv $new_user");

> Am I missing something here?

i haven't used the module, but looking at the documentation it doesn't
say anything about creating the user's home directory.

it looks like you can use Unix::PasswdFile to set the right entries in
/etc/passwd, but you'll have to make sure the directories are there
through other methods.


-- 
Best Regards,
Daniel                                  [EMAIL PROTECTED]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to