re: Setting global umask
re: Setting global umask
- Subject: re: Setting global umask
- From: email@hidden (Jody Fairchild)
- Date: Mon, 14 Jan 2002 14:21:11 +0900
in cocoa-dev digest vol 2 #11, rainer wrote:
>
Message: 9
>
Date: Sun, 13 Jan 2002 20:45:23 -0200
>
From: Rainer Brockerhoff <email@hidden>
>
Subject: Setting global umask
>
>
I need to set the global umask to something other than "022" to get
>
custom default permissions for files created by applications and the
>
Finder.
>
>
I've been unable to find the location for the default umask anywhere in
>
"the user's preferences". A search on Google and in the ADC docs also
>
failed. Any hints?
typically, if it's set at all, it would be in one of the user's "dot"
files, i.e., ".login", ".tcshrc", ".cshrc", etc. imho, the best place to
put one's umask is the .login file, but that's no guarantee of where anyone
else is going to put it ... note also that you may encounter some parsing
issues, due to conditional stuff, e.g. (from my .login):
# otherwise perl module installs get broken
if ($USER != "root") umask 77
and that of course says nothing of the case (and this is probably the
majority of non-power-users) who have no idea where or what their .login is,
and consequently have no default setting anywhere, other than the system
default, which seems to be 022, as you said (see also:)
/usr/share/init/tcsh/environment
imho, 022 isn't a bad value for most mac users' systems, which probably
aren't going to have much serious multi-user stuff going on. but it's hard
to guess what the user would want, just based on parsing files.
one thing you might consider is temporarily spawning a shell as the user, in
order to read the default umask ... you could do this by running a tiny
shell script which writes its umask value to stdout as an NSTask.
-jf