PDA

View Full Version : Question about file authorization




swimlikehell
Apr 15, 2008, 03:28 PM
I have an updater which prompts the user for authorization, but it seems when it updates the files the new files are set with the admin authorization. I was wondering if anyone had any experience with this sort of application and can give me some suggestions of the authorization flags or anything I need to do for this to work. I used the example on apples web site:

developer.apple.com/documentation/Security/Conceptual/authorization_concepts/03authtasks/chapter_3_section_4.html#//apple_ref/doc/uid/TP30000995-CH206-TPXREF33

To get what I currently have. any suggestions would be much appreciated.



Eraserhead
Apr 15, 2008, 03:39 PM
but it seems when it updates the files the new files are set with the admin authorization.

What's wrong with that?

swimlikehell
Apr 15, 2008, 03:55 PM
If they do not have write privileges to the app they are updating the privileges should stay the same for that app.

Eraserhead
Apr 15, 2008, 04:05 PM
Ah, I see what your saying.

As a command line "hack" you could call chmod afterwards to set the correct permissions, but there may be a better way.

swimlikehell
Apr 15, 2008, 04:23 PM
I meant to say the new files have root privileges not admin privileges, I am aware of the chmode command line command but I was looking for an idea that I can put in my code not a hack. Thank you for your help.