Kill a process in OS X?
briany at qldlearning.com
Thu Jun 24 15:17:06 CDT 2004
You can try using "echo" to pipe along the password. Keep in mind that
any shell() call which includes your password in clear text is a small
security hole, as the password will briefly appear in the process list.
echo 'pwdhere' | sudo ...
The best option would probably be to use "open process" and then write
the password to the process, but last I checked open process was still
broken. Haven't checked in a while though.
You might also search the archives for sudo and shell(), I seem to
recall an old thread about this way back when in which someone actually
pointed out the above security hole to me.
> I'm in a situation where there's a process running that I need to kill
> (OS X
> 10.3). If I do it through the terminal with 'sudo kill -9 <pid>', it
> asks me
> for the password in the terminal, and after I've entered it, it is
> killed. I
> need to move that functionality into a Rev stack and sending the 'sudo
> through shell() is a no-brainer, but how to I send the password along
> it so that it can do everything I was doing in the terminal?
> Thanks for anyone's help,
> Ken Ray
> Sons of Thunder Software
> Email: kray at sonsothunder.com
> Web Site: http://www.sonsothunder.com/
> use-revolution mailing list
> use-revolution at lists.runrev.com
More information about the use-livecode