do shell script...password...with administrator privileges: another leopard bug?
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