Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Different umask for different directories?

  • 05-11-2005 11:41pm
    #1
    Registered Users, Registered Users 2 Posts: 1,865 ✭✭✭


    Is it possible to set a different umask for different directories?

    I would like the files in ~/public_html to have u=rw,g=,o=r umask, but the files in ~/backup to have u=rwx,g=,o= umask.

    The only possible solution I've seen is: http://www.unix.org.ua/orelly/unix/upt/ch14_14.htm, which involves aliasing cd to a script that can check the directory and set the appropriate umask.

    Is there a better way?


Comments

  • Registered Users, Registered Users 2 Posts: 37,485 ✭✭✭✭Khannie


    If it makes any difference, I would have suggested the aliasing thing too. Seems the most logical way to me. Certainly couldn't think of an "out of the box" solution....though I'm no unix expert.


  • Registered Users, Registered Users 2 Posts: 3,744 ✭✭✭deRanged


    why not just chmod them after they're copied to the backup dir?
    it'd only be one extra line in the backup script.


  • Registered Users, Registered Users 2 Posts: 1,865 ✭✭✭Syth


    deRanged wrote:
    why not just chmod them after they're copied to the backup dir?
    it'd only be one extra line in the backup script.
    I don't have a backup script, I use Unison (a great little programme BTW), plus there would be a window in which things are available. I don't have sensitive stuff there, but I'd like it to be secure.

    If there is no solution, I'll just keep a umask of u=rw,g=,o= and ease up the permissions manually on my webdir.


  • Registered Users, Registered Users 2 Posts: 3,744 ✭✭✭deRanged


    I'm pretty sure I don't get this at all. :)

    You're keeping a backup of your web dir, manually with Unison?
    You could wrap the call so that your umask is temporarily changed.
    Syth wrote:
    I don't have a backup script, I use Unison (a great little programme BTW), plus there would be a window in which things are available. I don't have sensitive stuff there, but I'd like it to be secure.
    it's a backup of your web directory isn't it?


  • Registered Users, Registered Users 2 Posts: 1,865 ✭✭✭Syth


    No. I'm using UCD's internet society (netsoc), which members a shell account and webspace. We get 2GB each. I have my website there and I use it for backup. I mirror the stuff on my local harddrive to netsoc. My website stays and netsoc.


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 1,186 ✭✭✭davej


    What version of unix are you running ? With Solaris, for example, you could use ACLs to do this (setting the "default" for user, group, other).

    man setfacl

    edit: This still requires a manual change for the directory, but does give you more fine grained control..

    davej


  • Registered Users, Registered Users 2 Posts: 1,865 ✭✭✭Syth


    davej wrote:
    What version of unix are you running ? With Solaris, for example, you could use ACLs to do this (setting the "default" for user, group, other).

    man setfacl

    edit: This still requires a manual change for the directory, but does give you more fine grained control..

    davej
    OpenBSD 3.6

    setfacl doesn't seem to be a command or in the man page.


Advertisement