Applescript administator privileges

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

  1. GoMattGo! macrumors newbie

    Joined:
    Apr 21, 2008
    #1
    Hi,

    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?

    Thanks,
    Matt
     
  2. lee1210 macrumors 68040

    lee1210

    Joined:
    Jan 10, 2005
    Location:
    Dallas, TX
    #2
    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.

    -Lee
     
  3. GoMattGo! thread starter macrumors newbie

    Joined:
    Apr 21, 2008
    #3
    Thanks

    Thanks Lee!
     

Share This Page