• 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: do shell script and passwords
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: do shell script and passwords


  • Subject: Re: do shell script and passwords
  • From: Matthew Stuckwisch <email@hidden>
  • Date: Fri, 7 Jun 2002 16:24:21 -0500

How do I get feedback from a script that the command sent an incorrect
password?

I'm not too terribly sure about this. Most likely try/on error theError/end try type block.

Here is the script:

set AdminPass to "myPass"
do shell script "/usr/sbin/rawrequest" administrator privileges yes
password AdminPass


something weird is going on... first off, the result returned is empty, even
though the password is purposely set wrong.

This means that there was no output in a successfully ran operation

Even worse, the process is actually run! I even quit the process in
processViewer, and tried the script again, and sure enough, it launches
the process without the correct password.

Wait about 10-15 minutes than try again. Adminstrator priveleges (aka, sudo commands) cache their password for a certain amount of time (default is 5 minutes iirc). However, since I'm haven't done many sudo commands with AS, I do know off hand whether or not you will need "sudo" in front of the command, otherwise the shell might not recognize it as such (I'm not an expert on this topic, so...someone else who knows more can jump in here anytime ;-)

Am I missing something? Is my correct password being cached somewhere by
some part of this process (before I tried to create an error trapping
routine for a bad password, I had been using the script with the correct
password).

Heh, see above. If 15 minutes or so doesn't seem to uncache the password,
try rebooting which will (or should) definitely flush the cache.


Matthew Stuckwisch
[AIM/MSN]{GuifaSwimmer} | [Yahoo!]{SapphireTree} | [ICQ]{137477701}
[IRC]{guifa / G}(esperNET / irc.massinova.com)
_______________________________________________
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.

  • Follow-Ups:
    • Re: do shell script and passwords
      • From: Ryan Stark <email@hidden>
References: 
 >do shell script and passwords (From: garrett <email@hidden>)

  • Prev by Date: Re: do shell script and passwords
  • Next by Date: Re: do shell script and passwords
  • Previous by thread: Re: do shell script and passwords
  • Next by thread: Re: do shell script and passwords
  • Index(es):
    • Date
    • Thread