From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17109 invoked from network); 15 May 2008 15:26:48 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.4 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 15 May 2008 15:26:48 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 73807 invoked from network); 15 May 2008 15:26:44 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 15 May 2008 15:26:44 -0000 Received: (qmail 4054 invoked by alias); 15 May 2008 15:26:41 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 25039 Received: (qmail 4037 invoked from network); 15 May 2008 15:26:40 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 15 May 2008 15:26:40 -0000 Received: from cluster-g.mailcontrol.com (cluster-g.mailcontrol.com [85.115.41.190]) by bifrost.dotsrc.org (Postfix) with ESMTP id C450C80589A4 for ; Thu, 15 May 2008 17:26:35 +0200 (CEST) Received: from cameurexb01.EUROPE.ROOT.PRI ([62.189.241.200]) by rly21g.srv.mailcontrol.com (MailControl) with ESMTP id m4FFQWhU005617 for ; Thu, 15 May 2008 16:26:33 +0100 Received: from news01.csr.com ([10.103.143.38]) by cameurexb01.EUROPE.ROOT.PRI with Microsoft SMTPSVC(6.0.3790.3959); Thu, 15 May 2008 16:26:27 +0100 Received: from news01.csr.com (localhost.localdomain [127.0.0.1]) by news01.csr.com (8.14.2/8.13.4) with ESMTP id m4FFQR99017074 for ; Thu, 15 May 2008 16:26:27 +0100 Received: from csr.com (pws@localhost) by news01.csr.com (8.14.2/8.14.2/Submit) with ESMTP id m4FFQRQg017071 for ; Thu, 15 May 2008 16:26:27 +0100 Message-Id: <200805151526.m4FFQRQg017071@news01.csr.com> X-Authentication-Warning: news01.csr.com: pws owned process doing -bs To: zsh-workers@sunsite.dk Subject: Re: zpty woes In-reply-to: <20080515145054.GC5190@sc.homeunix.net> References: <34AE8142-F5DA-44FD-96BA-61BDE12BC74E@mac.com> <200805151318.m4FDIvKS015244@news01.csr.com> <20080515145054.GC5190@sc.homeunix.net> Comments: In-reply-to Stephane Chazelas message dated "Thu, 15 May 2008 15:50:54 +0100." Date: Thu, 15 May 2008 16:26:27 +0100 From: Peter Stephenson X-OriginalArrivalTime: 15 May 2008 15:26:27.0504 (UTC) FILETIME=[0AF6FB00:01C8B6A0] X-Scanned-By: MailControl A-08-50-03 (www.mailcontrol.com) on 10.71.0.131 X-Virus-Scanned: ClamAV 0.91.2/7128/Thu May 15 12:45:41 2008 on bifrost X-Virus-Status: Clean Stephane Chazelas wrote: > On Thu, May 15, 2008 at 02:18:57PM +0100, Peter Stephenson wrote: > > Jaime Vargas wrote: > > > In the script attached, when trying to follwing line always fails. > > > > > > zpty -r scppty line "*:" || echo "no password asked" && exit > > > > > > It appears that the "password" string from the ssh session is discarded > > > by the psuedo terminal. > > > > > > Is there a way to fix this? or Am I missing something? > > > > To work around this, you need to use non-blocking mode, i.e. start with > > "zpty -b scppty ...". > > It works for me without "-b", why would you say "-b" is > necessary? OK, it works without -b if and only if you have the pattern. That stops it needing the newline. I said the code was tortuous. > The problem I've found is that zpty -r doesn't return when the > command in the pty has terminated. A strace -p shows: > > read(12, 0xb7ba04c8, 1) = -1 EIO (Input/output error) Highly plausible. That's likely to be the loop where it waits for the pattern regardless. -- Peter Stephenson Software Engineer CSR PLC, Churchill House, Cambridge Business Park, Cowley Road Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070