View | Details | Raw Unified | Return to bug 92 | Differences between
and this patch

Collapse All | Expand All

(-)ssh.c (-5 / +20 lines)
Lines 841-849 ssh_confirm_remote_forward(int type, u_i Link Here
841
			logit("Warning: remote port forwarding failed for "
841
			logit("Warning: remote port forwarding failed for "
842
			    "listen port %d", rfwd->listen_port);
842
			    "listen port %d", rfwd->listen_port);
843
	}
843
	}
844
	if (++remote_forward_confirms_received == options.num_remote_forwards)
844
	if (++remote_forward_confirms_received == options.num_remote_forwards) {
845
		debug("All remote forwarding requests processed");
845
		debug("All remote forwarding requests processed");
846
		/* XXX fork-after-authentication */
846
		if (fork_after_authentication_flag) {
847
			fork_after_authentication_flag = 0;
848
			if (daemon(1, 1) < 0)
849
				fatal("daemon() failed: %.200s",
850
				    strerror(errno));
851
		}
852
	}
847
}
853
}
848
854
849
static void
855
static void
Lines 1043-1052 ssh_session(void) Link Here
1043
	    options.permit_local_command)
1049
	    options.permit_local_command)
1044
		ssh_local_cmd(options.local_command);
1050
		ssh_local_cmd(options.local_command);
1045
1051
1046
	/* If requested, let ssh continue in the background. */
1052
	/*
1047
	if (fork_after_authentication_flag)
1053
	 * If requested and we are not interested in replies to remote
1054
	 * forwarding requests, then let ssh continue in the background.
1055
	 */
1056
	if (fork_after_authentication_flag &&
1057
	    (!options.exit_on_forward_failure ||
1058
	    options.num_remote_forwards == 0)) {
1059
		fork_after_authentication_flag = 0;
1048
		if (daemon(1, 1) < 0)
1060
		if (daemon(1, 1) < 0)
1049
			fatal("daemon() failed: %.200s", strerror(errno));
1061
			fatal("daemon() failed: %.200s", strerror(errno));
1062
	}
1050
1063
1051
	/*
1064
	/*
1052
	 * If a command was specified on the command line, execute the
1065
	 * If a command was specified on the command line, execute the
Lines 1185-1193 ssh_session2(void) Link Here
1185
	muxserver_listen();
1198
	muxserver_listen();
1186
1199
1187
	/* If requested, let ssh continue in the background. */
1200
	/* If requested, let ssh continue in the background. */
1188
	if (fork_after_authentication_flag)
1201
	if (fork_after_authentication_flag) {
1202
		fork_after_authentication_flag = 0;
1189
		if (daemon(1, 1) < 0)
1203
		if (daemon(1, 1) < 0)
1190
			fatal("daemon() failed: %.200s", strerror(errno));
1204
			fatal("daemon() failed: %.200s", strerror(errno));
1205
	}
1191
1206
1192
	return client_loop(tty_flag, tty_flag ?
1207
	return client_loop(tty_flag, tty_flag ?
1193
	    options.escape_char : SSH_ESCAPECHAR_NONE, id);
1208
	    options.escape_char : SSH_ESCAPECHAR_NONE, id);

Return to bug 92