Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Re: So you know Perl; but do you know programming?

by Marza (Vicar)
on Jul 04, 2002 at 17:59 UTC ( [id://179511]=note: print w/replies, xml ) Need Help??


in reply to Re: So you know Perl; but do you know programming?
in thread So you know Perl; but do you know programming?

Hello Abigail!

The answer is simple. The script is used because we have NIS. Useradd only supports local entries.

The snippet was only an example of doing much more than was needed: 7 loops and three file opens to simply verify a username and to get a uid?

Sure the hashing is overkill. At the time I either didn't know about getpwnam or forgot about it. However, even with the 2 hashes. It reduced the looping to 2 and 1 file open. However, with the suggestions. I don't plan to use the hashes and I am dropping 1 loop.

As to reusing uids? You are correct. However, when an employee leaves, his account is disabled(ie "**" for a password. A list of stuff owned is generated and other workers go through his files and chown what is needed and delete what is not. This eliminates "We forgot what it was for so we should hold onto it." When there are no more files owned, the account gets deleted.

Finally, the script does more then what the snippet shown. Mail entries and mail lists, Meeting Maker account creation(what will be added), and a section for NT creation as well as other stuff like config files, etc.

But I do thank you for the comments!

  • Comment on Re: Re: So you know Perl; but do you know programming?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://179511]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (2)
As of 2024-04-26 00:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found