• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
do shell script...password...with administrator privileges: another leopard bug?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

do shell script...password...with administrator privileges: another leopard bug?


  • Subject: do shell script...password...with administrator privileges: another leopard bug?
  • From: Loren Ryter <email@hidden>
  • Date: Sun, 06 Jul 2008 10:13:29 -0400
  • Thread-topic: do shell script...password...with administrator privileges: another leopard bug?

I posted this to MacScripter, but on further investigation think this is a
Leopard bug:

The intent is to test for a valid admin password without getting an
authentication dialog from OS X.

Try this:

===

set user_pass to "ii"
try
    do shell script "sudo -k"
    set test_password to do shell script ("ls /private/var/root/") password
user_pass with administrator privileges
on error myerr
    log myerr
end try

===

However, instead of being trapped by "try", it puts up an authentication
dialog anyway.

According to the dictionary for "do shell script" the description of the
"password" parameter specifies:

"use this administrator password to avoid a password dialog"

I tried the key line like this (leaving out "with administrator privileges")
too:

set test_password to do shell script ("ls /private/var/root/") password
user_pass

Then "try" successfully traps with the error "permission denied" -- but then
a valid user_pass also is trapped with the same error.

====

Do I need to file another Leopard bug report here?

Is there another way to successfully test this?

Original post here:

http://bbs.macscripter.net/viewtopic.php?id=26358




 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: do shell script...password...with administrator privileges: another leopard bug?
      • From: Axel Luttgens <email@hidden>
    • Re: do shell script...password...with administrator privileges: another leopard bug?
      • From: deivy petrescu <email@hidden>
  • Prev by Date: Re: help needed - Broken (folder of front window)
  • Next by Date: Re: do shell script...password...with administrator privileges: another leopard bug?
  • Previous by thread: Re: "running" command issues
  • Next by thread: Re: do shell script...password...with administrator privileges: another leopard bug?
  • Index(es):
    • Date
    • Thread