Re: Shell script date & time coercions...
Re: Shell script date & time coercions...
- Subject: Re: Shell script date & time coercions...
- From: Christopher Nebel <email@hidden>
- Date: Tue, 2 Apr 2002 13:15:45 -0800
On Tuesday, April 2, 2002, at 09:32 AM, Matthew Stuckwisch wrote:
Are AppleScripts granted root privileges, or is there a way for sudo
commands to also offer the password?
AppleScripts are most certainly *not* granted admin privileges by
default! We try to take security seriously -- admittedly, there are
holes, but none that big.
If you're using "do shell script", you can use the "with administrator
privileges" and "password" parameters. If you leave off the "password"
parameter, it will prompt you for it.
If you're telling the Terminal, you can use the following trick to
supply the password:
tell application "Terminal"
do script with command "echo '" & thePassword & "' | sudo -S command"
end tell
The -S option for sudo reads the password from standard input instead of
the terminal. Using sudo -S also works with "do shell script", of
course, but the parameter is easier.
--Chris Nebel
AppleScript Engineering
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.