Privileges and expiration

Discussion in 'Mac Programming' started by LostSoul80, May 12, 2011.

  1. macrumors 68020

    LostSoul80

    Joined:
    Jan 25, 2009
    #1
    Hi all,
    I need to perform a privileged task after more than 5 minutes within my Cocoa application. I'm using the Security framework to gain the right credentials, but after about 5 minutes they expire - and I don't want the user to write his password again.
    Any workaround?

    Thanks
     
  2. Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #2
    An idea off the top of my head is to create your own tool that gets run, sleeps 5 minutes and then executes the real program.
     
  3. thread starter macrumors 68020

    LostSoul80

    Joined:
    Jan 25, 2009
    #3
    Thanks for the reply.
    That's pretty much what I did. I created an external tool, and what I do is just running it as a child process with an administrator authentication. Of course it works, though I would have preferred another way to get it.:(
     
  4. macrumors 65816

    jiminaus

    Joined:
    Dec 16, 2010
    Location:
    Sydney
    #4
    Actually helper tools are the preferred mechanism for elevating privileges in Mac OS X, particularly in future versions (but I can't say more of course).
     

Share This Page