=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/session.c,v retrieving revision 1.227 retrieving revision 1.228 diff -u -r1.227 -r1.228 --- src/usr.bin/ssh/session.c 2008/02/10 10:54:29 1.227 +++ src/usr.bin/ssh/session.c 2008/02/13 22:38:17 1.228 @@ -1,4 +1,4 @@ -/* $OpenBSD: session.c,v 1.227 2008/02/10 10:54:29 djm Exp $ */ +/* $OpenBSD: session.c,v 1.228 2008/02/13 22:38:17 djm Exp $ */ /* * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland * All rights reserved @@ -86,9 +86,6 @@ #include #endif -/* Magic name for internal sftp-server */ -#define INTERNAL_SFTP_NAME "internal-sftp" - /* func */ Session *session_new(void); @@ -438,6 +435,8 @@ if (dup2(err[0], 2) < 0) /* stderr */ perror("dup2 stderr"); + closefrom(STDERR_FILENO + 1); + /* Do processing for the child (exec command etc). */ do_child(s, command); /* NOTREACHED */ @@ -507,6 +506,8 @@ /* record login, etc. similar to login(1) */ if (!(options.use_login && command == NULL)) do_login(s, command); + + closefrom(STDERR_FILENO + 1); /* Do common processing for the child, such as execing the command. */ do_child(s, command);