Subject: bin/31243: sshd uses pipes rather than socketpairs
To: None <gnats-admin@netbsd.org, netbsd-bugs@netbsd.org>
From: Mark Davies <mark@mcs.vuw.ac.nz>
List: netbsd-bugs
Date: 09/09/2005 07:55:00
>Number:         31243
>Category:       bin
>Synopsis:       sshd uses pipes rather than socketpairs
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Sep 09 07:54:59 +0000 2005
>Originator:     Mark Davies
>Release:        NetBSD 3.99.7
>Organization:
Dept. of Comp. Sci., Victoria Uni. of Wellington, New Zealand.
>Environment:
	
	
System: NetBSD city-art.mcs.vuw.ac.nz 3.99.7 NetBSD 3.99.7 (MCS_WORKSTATION) #0: Mon Aug 15 16:21:55 NZST 2005 mark@turakirae.mcs.vuw.ac.nz:/mnt/SAVE/build.obj/src/work/src/sys/arch/i386/compile/MCS_WORKSTATION i386
Architecture: i386
Machine: i386
>Description:
	For many years now bash has had code to check if its being invoked from
	under an sshd/rshd and execute your .bashrc if it is. That code relies
	on stdin being a socket.
	We recently switched from using a pkgsrc compiled openssh on our NetBSD
	boxes to using the intree one (as its now recent enough) and our bash
	users started noticing that their .bashrc's were no longer being run.

	
>How-To-Repeat:
	Run:
		ssh <netbsd-machine> lsof
	and notice that the lsof file descriptor 0 is a pipe.
	or:
		ssh <netbsd-machine> env
	where the account on the remote machine has bash as its shell
	and some environment variable is set in its .bashrc and notice
	that the environment variable is not set in the env output.
	
>Fix:
	Make the following change, well actually remove the line and the
	preceeding comment entirely (on what NetBSD systems do socketpairs
	not seem to work?).

Index: includes.h
===================================================================
RCS file: /src/cvs/netbsd/src/crypto/dist/ssh/includes.h,v
retrieving revision 1.9
diff -u -r1.9 includes.h
--- includes.h	13 Feb 2005 18:14:04 -0000	1.9
+++ includes.h	7 Sep 2005 12:32:45 -0000
@@ -68,6 +68,6 @@
  * Define this to use pipes instead of socketpairs for communicating with the
  * client program.  Socketpairs do not seem to work on all systems.
  */
-#define USE_PIPES 1
+/* #define USE_PIPES 1 */
 
 #endif				/* INCLUDES_H */

cheers
mark

>Unformatted: