Re: copying files with admin privileges
Re: copying files with admin privileges
- Subject: Re: copying files with admin privileges
- From: Mike Abdullah <email@hidden>
- Date: Sat, 25 Feb 2006 18:25:25 +0000
OK, thank you every who replied to this, I shall read through the
docs and have a think.
It just kind of surprises me how you have to do this. I had assumed
that Apple would have provided a class that allows you to perform
operations at the permissions level that you require. This class
would then bring up a dialog asking the user for their details if
required.
Furthermore, if Apple were to implement something like this in
future, it would have the added effect that it would probably be
quite easy for the intrepid user to find out from this dialog, the
exact nature of the command their password is required for.
Mike.
On 24 Feb 2006, at 13:20, John Andersson wrote:
Is this what you want?
http://developer.apple.com/samplecode/AuthSample/AuthSample.html
More approaches here:
http://developer.apple.com/samplecode/Security/idxAuthorization-
date.html
/John
24 feb 2006 kl. 11.44 skrev Mike Abdullah:
Um, sorry for upsetting you?
You seem to have got the wrong impression about what I'm after!
I'm not looking to circumvent OS X's permissions scheme. I'm
trying to find out what is the proper approach for authenticating
from the user and carrying out the install.
Whilst I could use OS X's installer, I was trying to keep things
simple for the user. My program is just a normal app, and when it
starts up, it has a look to see if the user has installed the
script or not. If they haven't then it offers to install it for
them. However, I think I may just offer the ability to install
the script for the current user, since this requires no
authentication issues.
Mike.
On 23 Feb 2006, at 14:30, Robert Walker wrote:
However, when I try and make a copy to /Library/Scripts/
Applications/Mail I run into some problems.
If the user running the install is not an admin, then I cannot
create the required folders or copy things into them at all.
If the user is admin, but one of the existing folders is "owned"
by another admin user on the system, then I cannot create any of
the subfolders.
Well yeah, this darn well better be true.
What is the best way to do this? Or would I be better off not
allowing the user to install the script for everyone?
You'll have to do what every other similar "installer"
application has to do. Ask the user for their permission to
install the program. If the user is not an administrator then
there SHOULD BE NO POSSIBLE WAY for them to give this installer
the necessary permission.
I think the proper way to do this is to setup a Mac OS X
installer package and let the "built-in" installer program handle
the permission issues for you.
FYI: I don't believe this is the proper mailing list for these
types of questions. This issue is not directly related to the
Cocoa API.
On Feb 23, 2006, at 8:14 AM, Mike Abdullah wrote:
Hi, I need to copy some files with admin privileges.
Basically, in may app's resources folder, I have a simple script
that the application offers to install in the script menu. Now
to install this for the current user, it is very simple to copy
the file to ~/Library/Scripts/Applications/Mail using
NSFileManager's copyPath command.
However, when I try and make a copy to /Library/Scripts/
Applications/Mail I run into some problems.
If the user running the install is not an admin, then I cannot
create the required folders or copy things into them at all.
If the user is admin, but one of the existing folders is "owned"
by another admin user on the system, then I cannot create any of
the subfolders.
What is the best way to do this? Or would I be better off not
allowing the user to install the script for everyone?
Thanks,
Mike.
P.S. I have tried searching the archives, and am quite surprised
that I didn't find anything!
_______________________________________________
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40gmail.com
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden