Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re: List users without homes and homes without users

by trippledubs (Chaplain)
on May 16, 2018 at 18:27 UTC ( #1214678=note: print w/replies, xml ) Need Help??

in reply to List users without homes and homes without users

Perl has the getpwent function from C. You can use that directly as a perl function if you want. You might need the stat function. Also linux has the pwck tool that identifies some of the problems you describe. It's just as fine to do it the way you're going. /etc/passwd is very parseable as text, another way to do it.

If you run the program as root, your program has all the permissions as root. So if you make a mistake in your programming and accidentally tell perl to wipe out your password file, the OS is not going to stop it from doing that, it is allowed. If your program runs with more limited permissions, the OS will prevent it from doing things it is not allowed to do.

Perl has more to offer in this venture also. You could make your program aggregate the results into an excel spreadsheet, e-mail you the results, fix them right there, etc. To actually fix the results you would probably need more permissions.

  • Comment on Re: List users without homes and homes without users

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1214678]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (2)
As of 2018-07-22 01:09 GMT
Find Nodes?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?

    Results (451 votes). Check out past polls.