summaryrefslogtreecommitdiffstats
path: root/sftp-server.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2005-10-03 10:11:24 +0200
committerDarren Tucker <dtucker@zip.com.au>2005-10-03 10:11:24 +0200
commitce321d8a30a81222d11a4c27fd353804a9afecd3 (patch)
tree9b43bd892b03286fbbda2f032fe16a0f6cf9bb74 /sftp-server.c
parent - markus@cvs.openbsd.org 2005/09/09 19:18:05 (diff)
downloadopenssh-ce321d8a30a81222d11a4c27fd353804a9afecd3.tar.xz
openssh-ce321d8a30a81222d11a4c27fd353804a9afecd3.zip
- djm@cvs.openbsd.org 2005/09/13 23:40:07
[sshd.c ssh.c misc.h sftp.c ssh-keygen.c ssh-keysign.c sftp-server.c scp.c misc.c ssh-keyscan.c ssh-add.c ssh-agent.c] ensure that stdio fds are attached; ok deraadt@
Diffstat (limited to 'sftp-server.c')
-rw-r--r--sftp-server.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sftp-server.c b/sftp-server.c
index 6870e7732..e7d000cff 100644
--- a/sftp-server.c
+++ b/sftp-server.c
@@ -14,13 +14,14 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include "includes.h"
-RCSID("$OpenBSD: sftp-server.c,v 1.48 2005/06/17 02:44:33 djm Exp $");
+RCSID("$OpenBSD: sftp-server.c,v 1.49 2005/09/13 23:40:07 djm Exp $");
#include "buffer.h"
#include "bufaux.h"
#include "getput.h"
#include "log.h"
#include "xmalloc.h"
+#include "misc.h"
#include "sftp.h"
#include "sftp-common.h"
@@ -1036,6 +1037,9 @@ main(int ac, char **av)
int in, out, max;
ssize_t len, olen, set_size;
+ /* Ensure that fds 0, 1 and 2 are open or directed to /dev/null */
+ sanitise_stdfd();
+
/* XXX should use getopt */
__progname = ssh_get_progname(av[0]);