summaryrefslogtreecommitdiff
path: root/sftp.c
diff options
context:
space:
mode:
authordtucker <dtucker>2005-10-03 08:11:24 +0000
committerdtucker <dtucker>2005-10-03 08:11:24 +0000
commit572908260e8356dd1178d0935389e6fdc68e0379 (patch)
tree97c9f5c4dce8be07e67f36ca2c906363426c9971 /sftp.c
parent9c61a23816530463dbcb072b41342d10185740cf (diff)
downloadopenssh-572908260e8356dd1178d0935389e6fdc68e0379.tar.gz
- 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.c')
-rw-r--r--sftp.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sftp.c b/sftp.c
index f98ed7d2..f29927c0 100644
--- a/sftp.c
+++ b/sftp.c
@@ -16,7 +16,7 @@
#include "includes.h"
-RCSID("$OpenBSD: sftp.c,v 1.66 2005/08/08 13:22:48 jaredy Exp $");
+RCSID("$OpenBSD: sftp.c,v 1.67 2005/09/13 23:40:07 djm Exp $");
#ifdef USE_LIBEDIT
#include <histedit.h>
@@ -1447,6 +1447,9 @@ main(int argc, char **argv)
extern int optind;
extern char *optarg;
+ /* Ensure that fds 0, 1 and 2 are open or directed to /dev/null */
+ sanitise_stdfd();
+
__progname = ssh_get_progname(argv[0]);
args.list = NULL;
addargs(&args, "ssh"); /* overwritten with ssh_program */