diff options
author | Damien Miller <djm@cvs.openbsd.org> | 2005-09-13 23:40:08 +0000 |
---|---|---|
committer | Damien Miller <djm@cvs.openbsd.org> | 2005-09-13 23:40:08 +0000 |
commit | f7ed8afaa32cf14a3921e1a6629a45030d317578 (patch) | |
tree | aff976549515501dd8aecdd5af5558144fc815d4 /usr.bin/ssh/sftp-server.c | |
parent | 1c0cfe866c6d27bcf2266c00206273572ea38d15 (diff) |
ensure that stdio fds are attached; ok deraadt@
Diffstat (limited to 'usr.bin/ssh/sftp-server.c')
-rw-r--r-- | usr.bin/ssh/sftp-server.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.bin/ssh/sftp-server.c b/usr.bin/ssh/sftp-server.c index 45a19f8fe77..8e78377f0b4 100644 --- a/usr.bin/ssh/sftp-server.c +++ b/usr.bin/ssh/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" @@ -1016,6 +1017,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 */ handle_init(); |