Applescript administator privileges

Discussion in 'Mac Programming' started by GoMattGo!, Apr 22, 2008.

  1. GoMattGo! macrumors newbie

    Apr 21, 2008

    I'm a bit confused with the "with administrator privileges" option for the following command:

    do shell script my_command with administrator privileges

    If I am logged into my machine (10.5.2 mini) as the admin, I still get the prompt to enter the password. I thought that since I am logged in as admin, it wouldn't require me to enter it at all. Granted, once I do this once, I don't have to reentered the password if I run again during the next few minutes, but I didn't think I'd need to enter it at all.

    Can someone straighten me out on this?

  2. lee1210 macrumors 68040


    Jan 10, 2005
    Dallas, TX
    this is completely intentional. Unless you are logged in as root, which you should have no reason to do, you have to enter your password to do things with escalated privileges. This is to prevent rogue programs from doing nasty things without your knowledge just because you're logged in as an admin user. See Windows for an example of how to handle this poorly.

  3. GoMattGo! thread starter macrumors newbie

    Apr 21, 2008

    Thanks Lee!

Share This Page