Umask? Setting Default File Permissions

In the standard Mac OS X Lion install, newly created files get the following permissions:
Owner -> Read & Write
Group -> Read only
Everyone -> Read only.
I'd like the permissions on newly created files to be this instead:
Owner -> Read & Write
Group -> Read & Write
Everyone -> No Access
I can change the permissions for each new file manually (using Get Info), but believe there must be an easier way.  Perhaps by changing some under the hood default setting or via other programming?  I've been led to believe that changing the umask might be the solution, but have no expierence with doing this or otherwise messing with umask.
Any help/guidance is greatly appreceated.

Use at your own risk...Your milage may vary...You have been warned...Don't blame me...This is a disclaimer...etc.
I believe I have the answer to my own question.  Solution is to change the umask for user applications.  Outline:
Use a file editor in Terminal to create a file called "launchd-user.conf" in the etc folder of the root directory (i.e., file is: /etc/launchd-user.conf).
add a line in that file to read: umask 007
Now files created by ALL users will have 660 or -rw-rw----- permissions (that's four dashes at the end; 1 dash for the execute on group and 3 dashes for read, write, and execute on others).  That is:
Owner -> Read & Write
Group -> Read & Write
Everyone -> No access
Other permissions can be set as default by changing the umask 007 line to read umask nnn (where each n is a number between 0 and 7).  See further below for helpful references on octal notation and use of umask.
Solution above is from Apple article and carries all kinds of warnings.  See here:
http://support.apple.com/kb/HT2202
I had hoped that new folders would get 770 or drwxrwx--- permissions (that's three dashes at the end), but it doesn't seem to work for new folders created by the Finder.  Instead they get 750 or drwxr-x--- permissions (that's three dashes at the end) if created by Finder and 755 or drwxr-xr-x permissions if created by TextEdit (and other applications?).
Other potential solutions (that I've not looked into): Get TinkerTool System Release 2 and work in what the developer calls the "Pane System."
Helpful article (not by Apple) on octal notation:
http://en.wikipedia.org/wiki/File_system_permissions#Octal_notation
Helpful article (not by Apple) on use of umask:
http://www.cyberciti.biz/tips/understanding-linux-unix-umask-value-usage.html

Similar Messages

  • How to set default file permissions for applicatio...

    I have the nokia n86 and was wondering if there was any way of setting the file permissions of a program via the phone. To put it in context, i downloaded a program that edits photos but everytime i try to load a picture from my phone it asks me (for every single folder in my phone, not just the photo ones) if the program can open it. I can be there clicking yes all day as i there is a lot of folders and subfolders on the phone. I know sony ericssons had an option where you could select the programs permissions to always ask or never ask but i cant seem to find a similar option on the nokia.
    Does anyone have any ideas?

    Same issue here. Everything I put on the drive is set to Read-only for the group.

  • How to set all file permissions to default?

    So a few background notes are in order. I came across an article on the NSA's website titled Hardening Tips for Mac OS x 10.6 "Snow Leopard", needless to say I have come to believe I have made this irreversible. The NSA suggested to do some fancy command line coding to disable this, modify that, and change permissions to this. After hours spent on "hardening" my system, I have little hair left to pull in frustration. Is there any way to restore all file permissions back to default? I have used the Repair Disk Permissions, but that has done very little. To give the scope of what permissions have been skewed, I have observed several things:
    The desktop wallpapers, on all Desktops (as I'm in Lion 10.7.3), start from the same picture every time. I have the wallpapers changing, randomly, every 5 minutes.
    Safari doesn't keep the home page. No matter how often I try to change the homepage, I restart Safari, and I'm right back to the original homepage.
    Firefox doesn't retain the fact that I want it to be the default Web Browser. In fact, it keeps "forgetting" that I've used it before, and thus brings me to their awesome start page whenever someone first uses Firefox.
    Spotlight gets "stuck" i.e. almost every time I start my machine, it indexes. Even after I let it finish indexing, the next time I start my computer, it starts again.
    I have to input the administrator password after almost every activity, such as copying to the desktop, moving an application not bought from the Mac App Store into the /Applications folder, deleting a file from anywhere inside my home folder, etc.
    Some preference panes that need access to certain folders, such as Hazel's access to my desktop, are denied that access without ever prompting me for a password (though even if it did, it would get rather annoying after every startup)
    My firewall (in System Preferences>Security & Privacy>Firewall) doesn't "remember" that I do indeed want Dropbox to accept incoming connections. I have to input my admin password at each startup after clicking "allow"
    Opera pretty much doesn't function. Its bookmarking capability, home page, saved tabs, any thing that requires the saving of any type of preference to the computer results in a dialog pop up informing me that Opera failed to save what it needed, and prompts me to "Try again" or "Cancel" (hint: the "Try again" button doesn't work)
    There are more symptoms of an ever growing problem.
    I have backed up my machine from Time Machine, but I think it retains these file permissions, unless I'm wrong.
    Summary:
    How can I fully restore EVERY file permission back to default? Repair Disk Permissions doesn't work
    Is there a way that I can re-install Mac OS X, restore through Time Machine, and achieve the default file permissions, essentially losing all file permissions?

    Repairing the permissions of a home folder in Lion is a complicated procedure. I don’t know of a simpler one that always works.
    Launch the Terminal application by entering the first few letters of its name into a Spotlight search. Drag or copy – do not type – the following line into the window, then press return:
    chmod -R -N ~
    If you get an error message about permissions, enter this:
    sudo !!
    You'll be prompted for your login password, which won't be displayed when you type it. You may get a one-time warning not to screw up.
    Next, boot from your recovery partition by holding down the key combination command-R at startup. Release the keys when you see a gray screen with a spinning dial.
    When the recovery desktop appears, select Utilities ▹ Terminal from the menu bar.
    In the Terminal window, enter “resetpassword” (without the quotes) and press return. A Reset Password window opens.
    Select your boot volume if not already selected.
    Select your username from the menu labeled Select the user account if not already selected.
    Under Reset Home Directory Permissions and ACLs, click the Reset button.
    Select  ▹ Restart from the menu bar.

  • Aperture 3 default file permissions for referenced images

    Hi,
    This might be a bit more an OS X question than an Aperture question, but perhaps asking this here might help other people with similar case.
    Is there a way to change the default file permissions Aperture 3 sets for image files imported from a digital camera?
    My wife and I both import photos from our camera to a directory hierarchy under /Users/Shared/Photos/, and we both have our own Aperture libraries which reference the masters from that location.
    However, when one of us imports photos from the camera, the permissions for the image files are set as 600 and the permissions need to be changed into 660 (for example) or otherwise the images are not readable for the other. (In the shell umask shows 0022 by default, but as I start the Aperture from the dock, changing the umask in the shell doesn't help)
    Message was edited by: AJH75

    Hi,
    This might be a bit more an OS X question than an Aperture question, but perhaps asking this here might help other people with similar case.
    Is there a way to change the default file permissions Aperture 3 sets for image files imported from a digital camera?
    My wife and I both import photos from our camera to a directory hierarchy under /Users/Shared/Photos/, and we both have our own Aperture libraries which reference the masters from that location.
    However, when one of us imports photos from the camera, the permissions for the image files are set as 600 and the permissions need to be changed into 660 (for example) or otherwise the images are not readable for the other. (In the shell umask shows 0022 by default, but as I start the Aperture from the dock, changing the umask in the shell doesn't help)
    Message was edited by: AJH75

  • How to set default file path while downloading alv output

    Hi,
    Can anyone tell me that how to set default file path while downloading the ALV output to system using Local file button on tool bar.
    Please look below screenshots:
    Kindly help me resolve it.
    Thanks in advance.
    Regards,
    Ashutosh Katara

    This information initial value is (maybe) stored in Windows Register (register.exe) at Software\SAP\SAPGUI Front\SAP Frontend Server\Filetransfer -> PathDownload, you can read it thru class CL_GUI_FRONTEND_SERVICES method GET_UPLOAD_DOWNLOAD_PATH and update it thru method REGISTRY_SET_VALUE. (Else there may be some parameter ID to force data, but I'm no longer sure)
    Regards,
    Raymond

  • How to set default file type for Open dialog

    Dear my friends,
    I am using "At selection-screen ON VALUE-REQUEST FOR filepath" to display open dialog and i want to set default file type for open dialog = *.txt.
    Thank your times !

    Hello,
    U can make use of this code:
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR SP_FILE.
      PERFORM SAVE_DIALOG CHANGING SP_FILE G_F_RC.
    FORM SAVE_DIALOG CHANGING PO_FILE PO_RC.
      DATA: L_VA_BOXTITLE     TYPE STRING,
            L_VA_DEFAULTFILE  TYPE STRING,
            L_VA_DEFAULTNAME  TYPE STRING,
            L_VA_DEFAULTPATH  TYPE STRING,
            L_VA_DEFAULTFULL  TYPE STRING,
            L_VA_FILTERTEXT   TYPE STRING,
            L_VA_CODE         TYPE I.
      CLEAR: PO_RC, G_F_CONF.
      L_VA_BOXTITLE   = TEXT-B01.
      L_VA_FILTERTEXT = TEXT-B02.
      IF PO_FILE IS INITIAL.
        CLEAR L_VA_DEFAULTFILE.
      ELSE.
        L_VA_DEFAULTFILE = PO_FILE.
      ENDIF.
      CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_SAVE_DIALOG
        EXPORTING
          WINDOW_TITLE            = L_VA_BOXTITLE
          DEFAULT_EXTENSION       = 'TXT'
          DEFAULT_FILE_NAME       = L_VA_DEFAULTFILE
          FILE_FILTER             = L_VA_FILTERTEXT
          INITIAL_DIRECTORY       = 'C:SAPWorkdir'
        CHANGING
          FILENAME                = L_VA_DEFAULTNAME
          PATH                    = L_VA_DEFAULTPATH
          FULLPATH                = L_VA_DEFAULTFULL
          USER_ACTION             = L_VA_CODE
        EXCEPTIONS
          CNTL_ERROR              = 1
          ERROR_NO_GUI            = 2
          OTHERS                  = 3.
      IF SY-SUBRC <> 0.
        PERFORM CHECK_ERRORTYPE(Z48M_MATDATA_UP) CHANGING SY-MSGTY.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                   WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        CLEAR PO_FILE.
        EXIT.
      ENDIF.
      IF L_VA_CODE NE 0.
        MESSAGE S818(3F) WITH TEXT-011.
        CLEAR: PO_FILE, PO_RC.
        EXIT.
      ELSE.
        WRITE L_VA_DEFAULTFULL TO PO_FILE.
        G_F_CONF = G_C_XFELD.
      ENDIF.
    ENDFORM.                    " save_dialog
    If useful reward.
    Vasanth

  • How to set default file location in Illustrator?

    I'm using Creative Suite CS5 in Windows Pro 64, and would like to set a default location for files in Illustrator and Photoshop when I execute the File > Open or File > Save commands.
    Yes, the program defaults to the location of the last file opened, but sometimes that file is gone, or I'm creating a new one from scratch, and the program looks for files in a distant place in my file structure.
    ** Is it possible to set a default file location for opening and saving in Illustrator CS5 (and in Photoshop CS5)?
    Thanks.

    Not that I know of. It simply reverts to the global "My Documents"/ "Documents" folder as provided by your operating system. these can of course be changed using variables and editing the Windows Registry/ Group Policies, but that affects all programs...
    Mylenium

  • How to set default file path for save

    Hello all,
    I'm currently blocked on the below issue and is hoping to gain your help and insights.
    We have recently upgraded to InDesign CS6. Now when an INDD file created in an older version of INDD is opened in CS6, all the save dialogs would not default to the location of the original INDD file. Though if the same file is opened in the version of InDesign that created it, the save dialog goes to the proper location by default.
    Debugged using our custom plugin as a gate way, and found out that after InDesign CS6 performed the document upgrade/convert, the database for the converted document loses file information. i.e.  IDataBase::GetSysFile() returns nil. I think we can figure out some way to get the original file path. For example, we can intercept "kAfterOpenDocSignalResponderService", and get the original file path of the opened file from IDocumentSignalData. Though I haven't yet able to figure out a safe way to set this file path to the document, so that the save dialogs would by default point at this path.
    Utils<Facade::IWorkgroupFacade>()->InitDocumentAssetManagement(docRef, filePath) seems to do the right thing, but it seems to be quite intruding, and I'm afraid that it is overkilling and will cause bad side effect for the use case I'm looking for.
    So I'm wondering if anyone has any suggestions to achieve this without implementing/overriding the file save dialog.
    Thanks.
    -Jeff

    You should be able to avoid writing your own open-doc trap by using kDocBoss's IOpenedFileInfo to obtain the original file's path. It seems fairly reliable; the only time I've seen it come up empty is for an opened QuarkXPress document.
    I'm afraid I don't know of a sanctioned way to change IDataBase::GetSysFile() without going through the database's SaveAs machinery. Overriding this behavior might only be possible by replacing the regular Save dialog with your own.
    But if InitDocumentAssetManagement() is helping, maybe the workgroup/asset management approach is worth pursuing. Have you tried spying on that call in the debug app? You might be able to isolate and use one of the commands that it's invoking (IAMSPManager::BindAsset() / kSetAssetAttributesCmdBoss?) without all of the side-effects of the higher-level call.

  • CS4 Set default file type when placing file

    The File->Place dialog box has a default file type of 'Importable files.'  Is it possible to set the default to All files (or anything else)?  Making the change manually does not seem to stick.  I have the same general question regarding File->Open.  A search of the forums returned one hit (unanswered) in the Dreamweaver forum.
    Thank you.
    Dick Conrad

    Peter:
    Good question.  One of our editors made this request, and I believe that he works with files that lack extensions.  But controlling the default would also let us go in the other direction: quickly see only .rtf or .txt files, for example.
    Any trick would be impractical if it lived in InDesign Defaults.  All ID users get the same copy, and no two editors would want the same filter.
    Thanks for your response.
    Dick Conrad

  • Will EC support setting default file type and Open With from file menu?

    The default file types I can live without, but at least allow for Open With on right click from Windows Explorer.
    I currently have EC set in the Open With programs list, but EC does not comply for any files I opt to open it with (.css, .php, .html etc).
    EC open but not the file I choose.
    Also, even though the above use case is not ideal when if I do attempt an Open With when EC is already open, a new application session starts instead of attempting to open in the currently active app frame. It would be ideal to allow for single app frame, multiple files when Open With is employed.
    Darrell

    Hey Darrell,
    Thanks for the feedback. How Edge Code treats files is definitely something we know isn't ideal and it's something we're looking at fixing soon. There's currently a story on the Brackets backlog that adresses the Open With issue - https://trello.com/c/GhF1Bgf9
    And it based on howit ranks in that priority it looks like we could potentially take that into Edge Code over the next couple of months.
    This is definitely a feature that we think is important before we consider ourselves 1.0 so it's high priority.
    =Ryan
    [email protected]

  • Set default File Export Form for Communication Medium?

    Hi,
    Does anyone know whether it's possible to set a default File Export Form for Communication Medium.
    For example, I created communication medium 'Direct Mailing'. Everytime when a user selects this communication medium in a Marketing Campaign, I would like the File Export Form 'Z_DIRECT_MAILING' to be selected automatically. Is this possible?
    Regards,
    Jeroen

    @ Rienk - That isn't my issue, what I was looking for was to have the last setting I selected (either in Batch Export or in QT Movie Export) "Stick" so when I go to do the next set I don't have to re-select all of my settings.
    @ Nick - Not a good thing in this case. I need to send out QTs that have the speed change "baked-in" and convert the format(to ProRes, so the Color Grading session using "Color" doesn't choke. I changed my Sequence: "Settings > QuickTime Video Settings > Compressor" to ProRes, but the "Current Setting" seems to stick to the original clip's capture format (XDCAM EX).

  • Setting Default File Availability

    Is it possible to set the SendNow default file availability at something other than 30 days?  I would like to set availability at 14 days and leave it, rather than set it at each send. Wonderful online service! Feels as if it was made for us. Thanks.

    Hello there,
    Thanks for posting! This is a great feature suggestion; we're absolutely interested in making settings in SendNow (and Acrobat.com and Adobe CreatePDF) more customizable, so we'll certainly be discussing your idea as we plan for future releases.
    Also, since it sounds like you've been able to use the service a bit, I'd like to invite you to participate in Adobe's Customer Reference Program; it would just consist of a 30-minute phone call with someone from the team here, so it wouldn't be a huge commitment. We'd very much appreciate to hear your feedback on the product. Please let me know if you'd be interested in speaking with us; if you are, I can have our Customer Reference Program Manager contact you shortly.
    Thank you again for posting your suggestion; and keep 'em coming as you continue to use SendNow!
    Best regards,
    Rebecca Staley
    Acrobat.com Community Manager

  • How to set default file extension in the FileChooser?

    We are trying to use the FileChooser but for some reason, it doesn't have any file extensions in the drop down menu (like in windows). Does anyone know how to put this in?
    Also, how do we set the file name for the saving file, rather than typing the name in ourself?
    Also, how do we position the file chooser dialog in the middle of the screen? Right now, it's in the top left corner of the screen.
    Here's our piece of code, used for saving file.
    FileChooser fileChooser = new FileChooser();
            File file = fileChooser.showSaveDialog(stage);
            /*User might clicked on the cancel button*/
            if (file != null) {
                try {
                    Writer output = new BufferedWriter(new FileWriter(file));
                    output.write(text);
                    output.close();
                } catch (IOException ex) {
                    logger.error("save file error", ex);
            }Any help would be appreciated! Thanks!

    867511 wrote:
    We are trying to use the FileChooser but for some reason, it doesn't have any file extensions in the drop down menu (like in windows). Does anyone know how to put this in?Have you read the API? What's the nested class of FileChooser that's listed immediately after it in the classes list?
    Also, how do we set the file name for the saving file, rather than typing the name in ourself?I don't see any API for that. You could file a RFE on kenai.
    Also, how do we position the file chooser dialog in the middle of the screen? Right now, it's in the top left corner of the screen.I don't see any API for that either.
    db

  • Set default file manager to ranger on arch

    On ubuntu based distributions I would use exo-prefered-applications. In arch I created a desktop file containing "exec=terminator -n ranger", added it to mimeinfo.cache, and added the line inode/directory=ranger.desktop to mimeapps.list. However, when I run "xdg-open ." it opens the directory in firefox... So what is the process to use a terminal application like ranger as a default file manager in arch?

    cfr wrote:xdg-mime or one of the alternatives, I think.
    Yeah, that is basically what I did. I just realized the problem was that I mixed up "-n" with "-x." It is working now!

  • How to change default file permissions so others can write to file

    We have 15 people sharing files on a network. If we open a file on the network, work on it, and save it, it is readable and writeable for everybody. But if we drag the file off the network, work on it on our own hard drive, and save it, and THEN drag it back to the network, it is read-only for everybody. Documents made on our own hard drives are, by default, read-only for others.
    This is a real time waster for us!
    This means that every time we make a document on our own hard drives, we have to remember to go to the extra trouble to change it's permissions before we put it on our network. Please, is there some way to change the default settings, so that if I, say, save a Word doc on my hard drive and then move it to the network, it is readable and writeable by everybody without me having to change it's permissions?

    Sounds like you are not using ACLs.  When you double click your share point in Server.app, how many entries do you have in the Permissions window?  If you have only 3 then you are not using ACLs which explains why your permissions are not inheriting.  POSIX permissions, the base three of owner, group, and everyone, do not inherit.  You need to add at least one more permission entry to the table.  This is called an ACE (access control entry).  Together, you are building an ACL (access control list).  Try not to use users.  Always add groups if possible as it is easier to manage and never requires propagation of the permissions.
    R-
    Apple Consulting Network
    Apple Professional Services
    Author "Mavericks Server – Foundation Services" :: Exclusively available in Apple's iBooks Store

Maybe you are looking for

  • Create pdf with link to image library on shared server?

    I want to create a pdf from an image library that's shared across a server by 20 mac users. But I want the 'contact sheet' to include clickable links from the thumbnails within it, eg: the user can double click and image and it will open in photoshop

  • Error while creating table maintenance generator

    Hi, I am getting below error while creating table maintenance generator. Screen SAPLZtest   0002 could not be generated.   In DYNPFIELD_ATTR field LENGTH has the invalid value 241. Reason for that error might be: In the table I have a field with a da

  • Problem with printing from classic

    I used to print things out from classic but somehow I can't print anymore. It tell me to go to chooser and choose the printer but I can't choose it. I tried to click on HP printer but no reponse. I tried to reinstall but no use. That reinstalling see

  • Dstat on Solaris 9

    I use this nifty utility on my RedHat servers: http://dag.wieers.com/home-made/dstat/ Has anyone bothered with getting dstat to work on Solaris 9? This utility needs Python which will want a few other things installed, I wonder if anyone has bothered

  • Webi 4.0 Hyperlink for Hierachy Object

    Hi, I'm using SSAS cube as a source for my webi report . When i apply a hyperlink to hierarchy object,the hierarchy object become flat. Is that any method to maintain the hierarchy while using hyperlink? Thanks.