diff options
Diffstat (limited to 'clientloop.c')
-rw-r--r-- | clientloop.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/clientloop.c b/clientloop.c index 3b6cacb08..e5cc3f8cb 100644 --- a/clientloop.c +++ b/clientloop.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: clientloop.c,v 1.284 2016/02/08 10:57:07 djm Exp $ */ | 1 | /* $OpenBSD: clientloop.c,v 1.286 2016/07/23 02:54:08 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -127,6 +127,9 @@ extern int stdin_null_flag; | |||
127 | /* Flag indicating that no shell has been requested */ | 127 | /* Flag indicating that no shell has been requested */ |
128 | extern int no_shell_flag; | 128 | extern int no_shell_flag; |
129 | 129 | ||
130 | /* Flag indicating that ssh should daemonise after authentication is complete */ | ||
131 | extern int fork_after_authentication_flag; | ||
132 | |||
130 | /* Control socket */ | 133 | /* Control socket */ |
131 | extern int muxserver_sock; /* XXX use mux_client_cleanup() instead */ | 134 | extern int muxserver_sock; /* XXX use mux_client_cleanup() instead */ |
132 | 135 | ||
@@ -1514,9 +1517,9 @@ client_loop(int have_pty, int escape_char_arg, int ssh2_chan_id) | |||
1514 | debug("Entering interactive session."); | 1517 | debug("Entering interactive session."); |
1515 | 1518 | ||
1516 | if (options.control_master && | 1519 | if (options.control_master && |
1517 | ! option_clear_or_none(options.control_path)) { | 1520 | !option_clear_or_none(options.control_path)) { |
1518 | debug("pledge: id"); | 1521 | debug("pledge: id"); |
1519 | if (pledge("stdio rpath wpath cpath unix inet dns proc exec id tty", | 1522 | if (pledge("stdio rpath wpath cpath unix inet dns recvfd proc exec id tty", |
1520 | NULL) == -1) | 1523 | NULL) == -1) |
1521 | fatal("%s pledge(): %s", __func__, strerror(errno)); | 1524 | fatal("%s pledge(): %s", __func__, strerror(errno)); |
1522 | 1525 | ||
@@ -1532,7 +1535,8 @@ client_loop(int have_pty, int escape_char_arg, int ssh2_chan_id) | |||
1532 | NULL) == -1) | 1535 | NULL) == -1) |
1533 | fatal("%s pledge(): %s", __func__, strerror(errno)); | 1536 | fatal("%s pledge(): %s", __func__, strerror(errno)); |
1534 | 1537 | ||
1535 | } else if (! option_clear_or_none(options.proxy_command)) { | 1538 | } else if (!option_clear_or_none(options.proxy_command) || |
1539 | fork_after_authentication_flag) { | ||
1536 | debug("pledge: proc"); | 1540 | debug("pledge: proc"); |
1537 | if (pledge("stdio cpath unix inet dns proc tty", NULL) == -1) | 1541 | if (pledge("stdio cpath unix inet dns proc tty", NULL) == -1) |
1538 | fatal("%s pledge(): %s", __func__, strerror(errno)); | 1542 | fatal("%s pledge(): %s", __func__, strerror(errno)); |