aboutsummaryrefslogtreecommitdiff
path: root/crypto/openssh/clientloop.c
diff options
context:
space:
mode:
authorDag-Erling Smørgrav <des@FreeBSD.org>2017-03-02 00:11:32 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>2017-03-02 00:11:32 +0000
commit076ad2f836d5f49dc1375f1677335a48fe0d4b82 (patch)
tree2c74554320c43f6038362284ff6d28ab31f5a2e5 /crypto/openssh/clientloop.c
parent5adcb2b96de8857caee551f12f4165be98c303e7 (diff)
parentab4ec008e7abd1c8098428dbf9642c3685383045 (diff)
Notes
Diffstat (limited to 'crypto/openssh/clientloop.c')
-rw-r--r--crypto/openssh/clientloop.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/crypto/openssh/clientloop.c b/crypto/openssh/clientloop.c
index 9820455c42939..2c44f5d19d55f 100644
--- a/crypto/openssh/clientloop.c
+++ b/crypto/openssh/clientloop.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: clientloop.c,v 1.284 2016/02/08 10:57:07 djm Exp $ */
+/* $OpenBSD: clientloop.c,v 1.286 2016/07/23 02:54:08 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -123,6 +123,9 @@ extern int stdin_null_flag;
/* Flag indicating that no shell has been requested */
extern int no_shell_flag;
+/* Flag indicating that ssh should daemonise after authentication is complete */
+extern int fork_after_authentication_flag;
+
/* Control socket */
extern int muxserver_sock; /* XXX use mux_client_cleanup() instead */
@@ -1510,9 +1513,9 @@ client_loop(int have_pty, int escape_char_arg, int ssh2_chan_id)
debug("Entering interactive session.");
if (options.control_master &&
- ! option_clear_or_none(options.control_path)) {
+ !option_clear_or_none(options.control_path)) {
debug("pledge: id");
- if (pledge("stdio rpath wpath cpath unix inet dns proc exec id tty",
+ if (pledge("stdio rpath wpath cpath unix inet dns recvfd proc exec id tty",
NULL) == -1)
fatal("%s pledge(): %s", __func__, strerror(errno));
@@ -1528,7 +1531,8 @@ client_loop(int have_pty, int escape_char_arg, int ssh2_chan_id)
NULL) == -1)
fatal("%s pledge(): %s", __func__, strerror(errno));
- } else if (! option_clear_or_none(options.proxy_command)) {
+ } else if (!option_clear_or_none(options.proxy_command) ||
+ fork_after_authentication_flag) {
debug("pledge: proc");
if (pledge("stdio cpath unix inet dns proc tty", NULL) == -1)
fatal("%s pledge(): %s", __func__, strerror(errno));