Move file with admin priviledges

  • Hi,

    I am trying to enable a user to move a file that doesn't belong to
    him or her if he or she can identify himself or herself as an admin,
    with the method [[NSFileManager defaultFileManager]
    movePath:toPath:handler]; I have tried to use the AuthForAll example
    from Apple (which is Carbon, but I thought it could work anyway), and
    I can make the dialogue to identify myself by typing a username and
    password show up, but once I type my password, I still cannot move
    the file...

    What did I do wrong?

      -- Arthur;

    --
    AstroK Software
    Arthur VIGAN
    <contact...>
  • I believe if I remember correctly that you can elevate a sub-process not the
    current process.  You need to place the copy operation in a sub-process that
    you create with elevated privileges.  It has been too long for me to
    remember details (sorry).

    Michael

    > -----Original Message-----
    > From: cocoa-dev-bounces+lattam=<mac.com...> [mailto:cocoa-dev-
    > bounces+lattam=<mac.com...>] On Behalf Of AstroK Software
    > Sent: Tuesday, October 24, 2006 9:59 AM
    > To: <cocoa-dev...>
    > Subject: Move file with admin priviledges
    >
    > Hi,
    >
    > I am trying to enable a user to move a file that doesn't belong to
    > him or her if he or she can identify himself or herself as an admin,
    > with the method [[NSFileManager defaultFileManager]
    > movePath:toPath:handler]; I have tried to use the AuthForAll example
    > from Apple (which is Carbon, but I thought it could work anyway), and
    > I can make the dialogue to identify myself by typing a username and
    > password show up, but once I type my password, I still cannot move
    > the file...
    >
    > What did I do wrong?
    >
    > -- Arthur;
    >
    > --
    > AstroK Software
    > Arthur VIGAN
    > <contact...>
    >
    >
    >
    > _______________________________________________
    > Do not post admin requests to the list. They will be ignored.
    > Cocoa-dev mailing list      (<Cocoa-dev...>)
    > Help/Unsubscribe/Update your Subscription:
    > http://lists.apple.com/mailman/options/cocoa-dev/<lattam...>
    >
    > This email sent to <lattam...>
  • On 24 Oct 06, at 15:46, Michael Latta wrote:
    > I believe if I remember correctly that you can elevate a sub-
    > process not the
    > current process.  You need to place the copy operation in a sub-
    > process that
    > you create with elevated privileges.  It has been too long for me to
    > remember details (sorry).

    That is correct. There is no way to elevate a running process to run
    as root;
    you must launch a authenticated and/or setuid helper.
  • Le 25 oct. 06 à 03:19, Andrew Farmer a écrit :

    > On 24 Oct 06, at 15:46, Michael Latta wrote:
    >> I believe if I remember correctly that you can elevate a sub-
    >> process not the
    >> current process.  You need to place the copy operation in a sub-
    >> process that
    >> you create with elevated privileges.  It has been too long for me to
    >> remember details (sorry).
    >
    > That is correct. There is no way to elevate a running process to
    > run as root;
    > you must launch a authenticated and/or setuid helper.

    OK. Thanks! I will try to do that.

      -- Arthur;

    --
    AstroK Software
    Arthur VIGAN
    <contact...>
previous month october 2006 next month
MTWTFSS
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31          
Go to today