Mailing-List: contact cygwin-apps-help AT sourceware DOT cygnus DOT com; run by ezmlm Sender: cygwin-apps-owner AT sourceware DOT cygnus DOT com List-Subscribe: List-Archive: List-Post: List-Help: , Delivered-To: mailing list cygwin-apps AT sources DOT redhat DOT com Date: Wed, 2 May 2001 18:44:35 +0200 From: Corinna Vinschen To: cygapp Subject: Re: rshd uses pipes to communicate with shell Message-ID: <20010502184435.C9762@cygbert.vinschen.de> Mail-Followup-To: cygapp References: <13043917449 DOT 20010428233534 AT logos-m DOT ru> <20010429220820 DOT E22095 AT cygbert DOT vinschen DOT de> <310163284 DOT 20010430201528 AT logos-m DOT ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <310163284.20010430201528@logos-m.ru>; from deo@logos-m.ru on Mon, Apr 30, 2001 at 08:15:28PM +0400 On Mon, Apr 30, 2001 at 08:15:28PM +0400, egor duda wrote: > Hi! > > Monday, 30 April, 2001 Corinna Vinschen cygwin-apps AT cygwin DOT com wrote: > > CV> On Sat, Apr 28, 2001 at 11:35:34PM +0400, egor duda wrote: > >> Hi! > >> > >> is there some special reason for using pipes in rshd? this breaks > >> programs that rely on getpeername() for additional security check when > >> they're called from rshd. > > CV> It's the base implementation. I didn't change anything except for > CV> getting it working. Feel free to change it but be aware of that > CV> annoying socketpair problem some users have. Just in case... > > oh, i see. i should make myself clearer. i'm talking about > > #ifdef __CYGWIN__ > int cv[2]; > #endif > > in rshd.c. base implementation uses pipe to handle stderr, but cygwin > version seems to handle stdout via pipe too. if some program started > by rshd then calls getpeername (1, &name, &name_len), it fails with > ENOTSOCK. i suspect there was some reason for adding 'cv', wasn't > there? Sure. I'm actually not quite sure what the exact reason was but somehow I needed it when I patched it a year ago. AFAIR, I once got "Descriptor is a file, not a socket" messages and using that additional pipe solved it. While we're talking about that... this reminds me evidently of the USE_PIPES problem in OpenSSH that some people have. I wouldn't be surprised if the reason is the same... Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Developer mailto:cygwin AT cygwin DOT com Red Hat, Inc.