Permission problems in wrining files

Discussion in 'Mac Programming' started by Arun Vir Singh, Aug 22, 2011.

  1. Arun Vir Singh macrumors newbie

    Joined:
    Aug 22, 2011
    #1
    Hi All,
    I have one installer created using Packagemaker. The installer writes some files to /Library/Preferences folder using writeToFile method of NSData class.
    The installer used to create files successfully on Leopard and Snow Leopard when login with admin user. But in Lion 10.7 there are problems in writing files to Preferences folder. I found that earlier admin used to be the default group to /Library/Preferences directory. But with Lion it has been changed to Wheel group.

    We can add admin group to Sharing and Permissions using Get Info Dialog for Preferences folder. I need some suggestion for getting this done either Problematically using Cocoa or Bash script?

    Would be better if we can add a group to the permissions of a directory through Cocoa?

    Thank you
     
  2. gnasher729 macrumors P6

    gnasher729

    Joined:
    Nov 25, 2005
    #2
    This is a security enhancement. Apple doesn't want everybody to be able to write to /Library. You better redesign your app to make it unnecessary to write to /Library.
     
  3. Arun Vir Singh thread starter macrumors newbie

    Joined:
    Aug 22, 2011
    #3
    First thanks for your reply. Can you tell me what is the best place to keep Global preferences for all the users in this changed scenario of permissions on Lion OS or I need to use some authorization technique to handle such scenario.

    Thanks
     
  4. gnasher729 macrumors P6

    gnasher729

    Joined:
    Nov 25, 2005
    #4
    You shouldn't keep global preferences. Preferences should be per user. Assume two employees sharing the same desk and computer, one working in the morning, one in the afternoon. When one changes the preferences, that shouldn't affect the preferences of the other person.
     

Share This Page