X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org X-Mail-Handler: MailHop Outbound by DynDNS X-Report-Abuse-To: abuse AT dyndns DOT com (see http://www.dyndns.com/services/mailhop/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX18dqlXYOeEkbPOWR1GdCa1j Date: Sat, 11 Feb 2012 12:18:06 -0500 From: Christopher Faylor To: cygwin AT cygwin DOT com Subject: Re: TTY and sshpass Message-ID: <20120211171806.GA26664@ednor.casa.cgf.cx> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <4F3468FA DOT 1030000 AT gmail DOT com> <20120211102430 DOT GD9823 AT calimero DOT vinschen DOT de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120211102430.GD9823@calimero.vinschen.de> User-Agent: Mutt/1.5.20 (2009-06-14) Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com On Sat, Feb 11, 2012 at 11:24:30AM +0100, Corinna Vinschen wrote: >On Feb 10 18:03, Sylvain Archenault wrote: >> > On 2/9/2012 7:46 PM, Sylvain Archenault wrote: >> > I've been using sshpass (http://sourceforge.net/projects/sshpass/) for a >> > while and it stopped working after I updated cygwin to the last version >> > 1.7.10-1 (was wokring with 1.7.9). >> [...] >> I'm going to contact sshpass author. > >Apart from the fact that sshpass is a very dangerous package for your >security, and that you should prefer using public keys over using >sshpass, this seems to be not exactly a sshpass problem. Rather it's a >change in the 1.7.10 Cygwin DLL which triggers this behaviour. > >As a temporary workaround, try this patch to sshpass: > >--- main.c.orig 2012-02-11 11:22:44.563278057 +0100 >+++ main.c 2012-02-11 11:16:26.220409437 +0100 >@@ -265,7 +265,8 @@ int runprogram( int argc, char *argv[] ) > setsid(); > // This line makes the ptty our controlling tty. We do not otherwise need it open > slavept=open(name, O_RDWR ); >- close( slavept ); >+ //close( slavept ); >+ open ("/dev/tty", O_RDWR); > > close( masterpt ); FWIW, as I mentioned in private email, your patch "doesn't work for me". I had checked in the moral equivalent of the above change into the Cygwin DLL itself (available in a snapshot but, why bother since it doesn't fix anything) but that "didn't work for me" either. Since it is my change which broke this fragile application, I'm looking into fixing it. It would help if I could get sshpass working reliably on my Linux 3.2.1 system then I'd have something to compare against. But I can't because... well, you know. cgf -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple