Benches Uncategorized

14

how does one change umask in leopard?

apple Verified

Imported from the Apple Support Forums via the Wayback Machine 🔗

how does one change umask in leopard so that it affects all applications? I'd like to know how to do it both for individual users and globally.

this [macosx hint|http://www.macosxhints.com/article.php?story=20071207091554360] claims that this can be done by modifying the file /etc/luanchd.conf but it didn't work for me.

14 replies

Sign in or join Beachball Help to reply.

  1. 0

    Apple Support Community member

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    I think even if that did work, you wouldn't want to do it, especially if you'd be creating files with more restrictive permissions than the system as a whole is expecting.

    That being said, I haven't found any way to change the umask in an Apple supported way, that is, by changing a well-known configuration file, etc. I'm filing a bug on this momentarily...

  2. 0

    Apple Support Community member

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    actually this hint works, there is just a misprint in it. The hint says to create the file
    /etc/luanchd.conf with content *umask 077* (or whatever umask value you want). In fact, the file of course needs to be /etc/launchd.conf

    I just blindly copy/pasted from the hint at first. I just tried it with /etc/launchd.conf and it works. Of course, you are right and one has to be careful with more restrictive umasks. I would still like to know how to change umask locally on per user level.

  3. 0

    Apple Support Community member

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Yeah, the launchd.conf hack will work, but I don't consider that to be Apple supported. And, like you say, I can't find any way to do this on a per-user basis. It seems like a big hole that Apple missed.

  4. 0

    Apple Support Community member

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Apple has a Leopard security document, [here|http://images.apple.com/server/macosx/docs/LeopardSecurity_Config20080530.pdf]. It has a section, "Setting Global File Permissions" in Chapter 7 about umask, how to set it, and warnings and caveats.

  5. 0

    Apple Support Community member

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    thanks for the link.

    That manual says that to change the global umask one has to change the value of NSUmask field in /Library/Preferences/.GlobalPreferences.plist

    I tried that and it had no effect whatsoever. the manual does say that not all applications are affected but I couldn't find a single application that is affected by that change. Also, I read at other places on the web that NSUmask doesn't work in leopard but it did in Tiger. can't verify that but the bottom line is that the method outlined in that manual doesn't work. Even if it did, it would be a global change. The manual doesn't say anything about changing umask for individual users.

  6. 0

    Apple Support Community member

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    I tried setting NSUmask in the various .Globalist... files, but that seemed to have no affect.

  7. 0

    Apple Support Community member

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    I tried setting NSUmask in the various .Globalist... files, but that seemed to have no affect.

  8. 0

    Apple Support Community member

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Hi V.K.,

    I filed a security bug with Apple on the inability to set a global user umask that affected GUI and CLI applications. I actually got a response back with what looks like a way to do this... sort of. First off, this is an undocumented feature that was supposedly added to 10.5.3, and it's not supported by Apple. Use at your own risk.

    Here's what I did, and it seems to work:

    1. Create a new file in /etc called launchd-user.conf. Add the following line:

    umask 077

    2. Reboot

    After logging in, you'll see that your umask from the command line is 077, and files saved through GUI applications also seem to save using that umask.

    The big limitation here (which I've communicated back to Apple) is that this user setting affects all users on the system; there doesn't seem to be a way to set different umask's for different users. (I also tried the $HOME/.launchd.conf, which the man page says is read by launchd, but that didn't work either).

    Message was edited by: glsmith

  9. 0

    Apple Support Community member

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Hi glsmith, Thanks for that! it seems to work. as you say it's completely undocumented. pretty sneaky of them to stick it into 10.5.3 without telling anyone. let's hope they add the ability to set individual user umasks in 10.5.4 . Of course, they should document it if they do.

    Message was edited by: V.K.

  10. 0

    Apple Support Community member

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Yes, they hinted that they were working on documenting this, and that they were working on a generally more robust solution. My bug's still open, so I'll pass along anything else that's juicy (and not under NDA

  11. 0

    Apple Support Community member

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    We set individual umasks by adding (for example):

    umask 002

    to the .profile in the user's home directory. This takes effect when the user logs in.

  12. 0

    Apple Support Community member

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    I know this one of course. However, this changes umask only for the shell. As I said I want it to be changed for all GUI applications starting with Finder.

  13. 0

    Apple Support Community member

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    hi!

    i've read the whole thread, and it's interesting, however i have a related question which is not answered here but for which someone might have an idea.

    i want to change the umask of my www user (the user that runs the apache server). this can't be done using 'umask xxx' in .profile, because this "user" has no homedir, as it cannot log in (login shell set to /usr/bin/false). is there any other way to change it? i've taken a look at the ServerAdminTools, but couldn't find anything there either...

    thx!

  14. 0

    Apple Support Community member

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    the official way to do this (same as suggested by glsmith) has now been documented
    http://support.apple.com/kb/HT2202