summaryrefslogtreecommitdiff
path: root/ssh.c
diff options
context:
space:
mode:
authordjm <djm>2010-07-16 03:56:23 +0000
committerdjm <djm>2010-07-16 03:56:23 +0000
commite9871aed99b1c712e4f75fbf9aef14a8d19add7a (patch)
tree16466811341afd88245c8af5eb4c0e56c6f11e6b /ssh.c
parente8ce531dc1412a06bc08c148273e9ba9c3ef158f (diff)
downloadopenssh-e9871aed99b1c712e4f75fbf9aef14a8d19add7a.tar.gz
- djm@cvs.openbsd.org 2010/07/12 22:38:52
[ssh.c] Make ExitOnForwardFailure work with fork-after-authentication ("ssh -f") for protocol 2. ok markus@
Diffstat (limited to 'ssh.c')
-rw-r--r--ssh.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/ssh.c b/ssh.c
index a1cf0151..e6073af7 100644
--- a/ssh.c
+++ b/ssh.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh.c,v 1.341 2010/06/26 23:04:04 djm Exp $ */
+/* $OpenBSD: ssh.c,v 1.342 2010/07/12 22:38:52 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1301,8 +1301,13 @@ ssh_session2(void)
/* Start listening for multiplex clients */
muxserver_listen();
- /* If requested, let ssh continue in the background. */
- if (fork_after_authentication_flag) {
+ /*
+ * If requested and we are not interested in replies to remote
+ * forwarding requests, then let ssh continue in the background.
+ */
+ if (fork_after_authentication_flag &&
+ (!options.exit_on_forward_failure ||
+ options.num_remote_forwards == 0)) {
fork_after_authentication_flag = 0;
if (daemon(1, 1) < 0)
fatal("daemon() failed: %.200s", strerror(errno));