Leopard OS-wide umask support

Recently at work we noticed problems with files and directories on network shares (namely SSHFS via Macfusion) that weren’t set to group write even with -o umask=0002 in the extra options field of the SSH Advanced tab in the mount options. Viewing the FUSE mount via its system directory would show group write, however logging in with traditional command line SSH would show the files and directories not to have it.

The simpler solution therefore would be to set umask system-wide, for GUI and CLI in Leopard, so it would be applied to everything without worrying about individual configuration options on our SSH, NFS and Samba mounts. A quick Google search revealed a recent Apple Support article that offered a convenient solution – a file named launchd-user.conf stored in /etc that holds a single line with your umask requirements, e.g.:

umask 0002

I’ve created a package installer which you can download at the link below that installs the file for you if you’re not comfortable adding it yourself. You’ll also need to restart after you make these changes.

LeopardUmask.pkg

Caveats:

  • The Apple Support article notes that it is for setting a system-wide umask in 10.5.3, brief research indicates that you may require at least this version of Leopard for it to pick up the umask from the file.
  • As the file is located in /etc, it will set the umask for all users – a possible solution for individual user support would be to place a custom launchd-user.conf file in your home directory (~/launchd-user.conf), though I haven’t tested this.