Beefy Boxes and Bandwidth Generously Provided by pair Networks RobOMonk
Do you know where your variables are?
 
PerlMonks  

Re: How do I check if another user can access a file?

by i5513 (Monk)
on Aug 18, 2011 at 10:00 UTC ( #920906=note: print w/ replies, xml ) Need Help??


in reply to How do I check if another user can access a file?

I would write in a sub in perl:

  • Get (and read manual) stat from file (permissions, user and group owner)
  • If user is the owner, verify r/w permission with S_IRUSR S_IWUSR masks and fix if don't have permission you want
  • If user is in group owner (getgrnam), then verify r/w permission with S_IRGRP S_IWGRP masks and fix if don't have permission you want
  • If user is not in group owner, then verify r/w permission with S_IROTH S_IWOTH masks, and fix with system and adduser from your S.O.

But probably you should simplify your environment and make a good use of groups and umasks ;)


Comment on Re: How do I check if another user can access a file?

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2013-05-26 04:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best material for plates (tableware) is:









    Results (524 votes), past polls