From: Jeff Yana <jyana@(email surpressed)>
Subject: Re: [SYSADMIN/OSX] Changing the global umask (eg. for the Finder,etc)
   Date: Tue, 06 Jun 2006 13:24:44 -0400
Msg# 1307
View Complete Thread (1 article) | All Threads
Last Next
There is actually a faster method, where converting the binary file is
NOT required. Using the "defaults(1) command, you can edit the binary
file in-situ.

To set the umask to 002, you would invoke defaults like this:

sudo defaults write /Library/Preferences/.GlobalPreferences NSUmask 2

and it inserts the following key/value pairs:

  	
	<--snip-->

	<key>NSUmask</key>
        <string>2</string>

	<--snip-->

The key is getting the umask value set correctly. The argument that I provided "2" is the decimal representation of the octal value of 002 (note that I have not tried to pass it the octal equivalent, which may or may not work)

077 would be 63 decimal
022 (default) would be 18 decimal

etc, etc,

Here is how the conversion works for 2 (decimal) to 002 (octal):


|......o c t a l.......|...|d e c i m a l|

0 x 8² + 0 x 8¹ + 2 x 8° = 0 + 0 + 2 = 2
0 x 8² + 7 x 8¹ + 7 x 8° = 0 + 56 + 7 = 63

etc, etc...

For the octally challenged, here is a conversion table for you:

http://www.ascii.cl/conversion.htm

Beware of the layout, however since their formatting is a bit sloppy
(the octal numbers run into the binary and it makes the two appear as
one giant digit (at least in my browser, Firefix)...

Jeff

Greg Ercolano wrote:
 etc)
From: Greg Ercolano <erco@(email surpressed)>
Date: Tue, 18 Apr 2006 18:23:48 -0400
Message-ID: <1273-rush decimal general at seriss decimal com>
References: <711-rush decimal general at seriss decimal com>
Lines: 60
User-Agent: Thunderbird 1.5 (X11/20051201)
MIME-Version: 1.0
Newsgroups: rush.general
In-Reply-To: <711-rush decimal general at seriss decimal com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Path: seriss.com
Xref: seriss.com rush.general:1273
NNTP-Posting-Host: 24.205.137.195

Greg Ercolano wrote:
OSX: HOW TO CHANGE THE GLOBAL UMASK FOR ALL USERS TO 002
--------------------------------------------------------

DESCRIPTION
    The 'umask' is what sets the default read/write
    permissions for files and folders created by users under
    unix.. this includes OSX.

    Under OSX, it's been a strange issue because the
    umask seems to be at a default of 022 (rw-r--r--) for all guis,
[..]

SOLUTION
    1) Edit the file /Library/Preferences/.GlobalPreferences.plist

    2) Add the lines:
        <key>NSUmask</key>
        <integer>2</integer>

10.4.x UPDATE
-------------

         Following up to this thread on how to adjust the global umask
         on a Mac OSX machine.

	It would appear in 10.4 they started making binary versions of the
	XML files, and in some cases I've seen the umask value already set
	inside the file.

         So to set the global umask in 10.4.x, use these steps:

                 1) Edit the /Library/Preferences/.GlobalPreferences.plist file.
                    If it's in binary format, quit the editor without saving,
                    then run this:

                             plutil -convert xml1 /Library/Preferences/.GlobalPreferences.plist

                    ..that will convert the file into an ascii file. (You might want to
                    save the old file, just in case). See 'man plutil' for more info.

                 2) Search for an existing "NSUmask" and change the <string>002</string>
                    value to <string>000</string>, eg:

                    BEFORE:
                                 <key>NSUmask</key>
                                 <string>002</string>

                    AFTER:
                                 <key>NSUmask</key>
                                 <string>000</string>

                    If the above two lines don't already exist, add them within the outer <dict>
                    section of the file.

	This should affect all users on the machine that change is made to.

	You may also want to check if the user's own .GlobalPreferences.plist file
	in their home directory (eg. /Users/fred/Library/Preferences/.GlobalPreferences.plist)
	doesn't have any settings that might override this value.



Last Next