• 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
Re: Shell script date & time coercions...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Re: Shell script date & time coercions... (From: Matthew Stuckwisch <email@hidden>)

  • Prev by Date: Re: Examples of "handle cgi request" anywhere?
  • Next by Date: Re: Shell script date & time coercions...
  • Previous by thread: Re: Shell script date & time coercions...
  • Next by thread: Re: Shell script date & time coercions...
  • Index(es):
    • Date
    • Thread