10.4: Set umask independently for Finder.app

Nov 10, '06 07:30:02AM

Contributed by: Anonymous

In OS X, the default permissions for items created by most programmes is -rw-r--r-- (644) for files and drwx-r-xr-x (755) for folders. This previous hint describes a useful method for changing the default permissions for GUI applications by adding an NSUmask property to the .GlobalPreferences.plist file to set a umask differring from the default 022. Unfortunately, this property only applies globally, and doesn't work when applied to the .plist files of individual applications.

This seems to be new in Tiger, but the default umask for the Finder can be set independently by adding a umask property to the com.apple.finder.plist file, either in an individual user's Preferences folder to apply to that user, or in the startup disk's main /Library/Preferences folder to apply to all users. The new permissions don't just apply to new folders -- they also apply to anything new created (but not copied) by the Finder including clippings, .xxxloc files, etc. However, note that folders created from the Save dialogues of other programs will have the default permissions of items created by that application.

Unlike NSUmask, which requires the decimal equivalent of the octal representation of the umask, the Finder's umask takes the octal value directly. For example, to set the default permissions so that new folders created by all users on the computer are Group writable (drwxrwxr-x (775)), enter these commands in Terminal while logged into an Admin account:

$ defaults write /Library/Preferences/com.apple.finder umask -int 2
$ chmod +r /Library/Preferences/com.apple.finder.plist
To give just the current account's Finder more restrictive default permissions of drwx----- (700):
$ defaults write com.apple.finder umask -int 77
For the change to take effect for any given logged-in user, it will be necessary to quit and restart the Finder (don't Force Quit or relaunch it), or log out and back in. In the future, hopefully more Apple applications will allow their umask to be changed without hacking the application package.

Note that despite its title, this old hint describes something completely different -- changing the default umask for all users and all programs (not just "Finder") -- and as some of the comments suggest, is probably even scarier than setting a global NSUmask.

Comments (4)

Mac OS X Hints