Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Tim Daneliuk Newsgroups: comp.lang.python Subject: Re: Quotation Ugliness Date: Wed, 26 Nov 2014 09:55:30 -0600 Organization: A noiseless patient Spider Lines: 37 Message-ID: <5475F7F2.4020901@tundraware.com> References: <54756D5F.4040806@tundraware.com> <20141126082606.281ff681@bigbox.christie.dr> <5475F38F.5010501@tundraware.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: mx02.eternal-september.org; posting-host="d887b3e675279b69468e57e74ea1dcb8"; logging-data="14759"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18Ek0UqQkPlb/pkPxZNs7BUkcvBSRRplqM=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 In-Reply-To: Cancel-Lock: sha1:BfIDQavvvahsYspb1+iggx/9g54= Xref: csiph.com comp.lang.python:81593 On 11/26/2014 09:48 AM, Chris Angelico wrote: > On Thu, Nov 27, 2014 at 2:36 AM, Tim Daneliuk wrote: >> The more I think about this, the more I think I am just going to look for >> the >> string 'sudo' anywhere in the argument. This merely will force the user to >> enter their sudo password if detected. If it turns out to be a false >> positive, >> no harm will be done and the password will just go unused. > > That sounds reasonable; imperfect, but reasonable. But what happens if > the password "goes unused"? Will it be provided on stdin to the > program? That could be VERY bad in two ways (revealing the password, > and breaking the program's expectations). > > ChrisA Nope. Password only exist in memory locally. If you want to see the whole program in action as it currently exists: http://www.tundraware.com/Software/tsshbatch I do a lot of work in very large data centers where I need to execute a bunch of commands across, say, a thousand servers. tsshbatch has solved the problem neatly for some years. I'm just trying to knock some of the rough edges off it :) P.S. There are other such programs like 'capistrano' that are spiritually quite similar. I wrote tsshbatch before I found out about the others, which are all written in other lanugages (like Ruby). So, not only did this serve to solve my problem, it also taught me paramiko :) -- ---------------------------------------------------------------------------- Tim Daneliuk tundra@tundraware.com PGP Key: http://www.tundraware.com/PGP/