Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Click here to return to the '10.3: Set the global umask default value' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.3: Set the global umask default value
Authored by: Sophic on Mar 03, '04 11:19:43AM

Hmmmm, this doesn't seem to tell me everything! This global.defaults hack appears to me like it only applies to users logging into the desktop and not network clients, can somebody clarify this? How does this octal 022 relate to the chmod style of permissions '770' or 'ug=rwx o=' for instance? I currently use cron as I'm a bit sceptical about what the next apple update might do to such changes. All I want is to default group permissions to write instead of read only. As I haven't found a way yet do this for 10.3, I'll stick to running chmod scripts in cron. Isn't there something you can do to the /etc/rc file? I use the following (called via another script) if it's any help to anyone else;

# fix
# Usage:
# fix [group|path]
# If path is specified then group must be specified
# If group is omitted then staff is used as default.
# If path is omitted then current directory is used as default.
if $grp >& /dev/null ;then
if $pth >& /dev/null ;then
#echo $grp
#echo "$pth"
chown -fhv -R :"$grp" "$pth" >/dev/null
chmod -R g+rw "$pth" >/dev/null

If you ain't fast you're last.

[ Reply to This | # ]
Octal chmod/umask codes
Authored by: seika7 on Mar 22, '04 06:33:18PM

"How does this octal 022 relate to the chmod style of permissions '770' or 'ug=rwx o=' for instance?"

These numbers are masks, which subtract, digit by digit, from the maximum octal value of 777 (read/write/execute for user, group, and everyone). (Remember, the maximum digit value in octal is 7 (like 9 for decimal), then the next digit goes to 1 (like 10 in decimal). 8 in decimal is 10 in octal, but don't pronounce it "ten" unless you want to get confused in a hurry.) So a mask of 022 would knock 777 down to 755 which is rwx for the user (owner) and rw for group and everyone. What many file sharing users want is a mask of 002 which knocks 777 down to 775 giving both the user and the group read/write permissions and allowing everyone else to just read.

[ Reply to This | # ]