Re: do shell script and passwords
Re: do shell script and passwords
- Subject: Re: do shell script and passwords
- From: Matthew Stuckwisch <email@hidden>
- Date: Mon, 10 Jun 2002 08:03:12 -0500
How do I get feedback from a script that the command sent an incorrect
password?
You should be getting an execution error, but...
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).
Yep. The admin password (as with sudo) is cached for 5 minutes by
default -
see man sudo. Run the command sudo -k to make sure that the cache is
deleted. If you can still run the process with a dodgy password then
something is definitely up
well I have bad news and worse news....
some background: rawrequest NEEDS sudo to run
lets take the command sudo /usr/sbin/rawrequest
if I do that in the terminal - I need to enter a pw... all good
now if I wanna do it from AS I can invoke:
property AdminPass : "mypassword"
do shell script "/usr/sbin/rawrequest" administrator privileges yes
password
AdminPass
result is ""
guess what - it runs rawrequest - EVEN WITH A BAD PASSWORD... I have run
sudo -k from the terminal and from AS. I have restarted... I have waited
15,
30, 60, 300 mins... in other words... if I invoke this from AS I do NOT
need
a password... as a matter of fact....
do shell script "/usr/sbin/rawrequest"
works too. what is going on... could someone actually try this out.. they
can get the rawrequest PKG installer that comes with WhatRoute 1.8 rather
than speculate... because I am doing everything suggested and guess what.
.
no go!
and whether u may think I have the syntax wrong in the do shell script
command (like not saying "sudo /usr/... etc) it still properly launches
the
process...
Let's do the ultimate test to see what's really going on.
WARNING!!!! DON'T ACTUALLY TRY THIS. YOU HAVE BEEN WARNED. [1]
do shell script "sudo rm -rf /" with administrator privileges
WARNING!!!! DON'T ACTUALLY TRY THIS. YOU HAVE BEEN WARNED. [2]
Matthew Stuckwisch
[AIM/MSN]{GuifaSwimmer} | [Yahoo!]{SapphireTree} | [ICQ]{137477701}
[IRC]{guifa / G}(esperNET / irc.massinova.com)
[1] for those unfamiliar with UNIX, the rm -rf command deletes files
without asking for confirmation or display any warnings and makes rm
nearly always exit with success and begins recursively deleting files
starting from the location given or the current directory. In this case,
the directory specified is "/", with is the top of the hard drive,
therefore, if you run this command YOU WILL LOSE ALL YOUR DATA. So don't
do it, you've been warned, mmkay?
[2] This post was mainly meant to be sarcasm. So DON'T run the script, I
take NO RESPONSIBILITY if you happen to be stupid enough to actually run
it.
_______________________________________________
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.