mirror of
https://github.com/PowerShell/openssh-portable.git
synced 2025-07-27 15:54:22 +02:00
- djm@cvs.openbsd.org 2005/05/27 08:30:37
[ssh.c] fix -O for cases where no ControlPath has been specified or socket at ControlPath is not contactable; spotted by and ok avsm@
This commit is contained in:
parent
2db8ae671e
commit
0814d3136f
@ -13,6 +13,10 @@
|
|||||||
- dtucker@cvs.openbsd.org 2005/05/26 09:08:12
|
- dtucker@cvs.openbsd.org 2005/05/26 09:08:12
|
||||||
[ssh-keygen.c]
|
[ssh-keygen.c]
|
||||||
uint32_t -> u_int32_t for consistency; ok djm@
|
uint32_t -> u_int32_t for consistency; ok djm@
|
||||||
|
- djm@cvs.openbsd.org 2005/05/27 08:30:37
|
||||||
|
[ssh.c]
|
||||||
|
fix -O for cases where no ControlPath has been specified or socket at
|
||||||
|
ControlPath is not contactable; spotted by and ok avsm@
|
||||||
|
|
||||||
20050531
|
20050531
|
||||||
- (dtucker) [contrib/aix/pam.conf] Correct comments. From davidl at
|
- (dtucker) [contrib/aix/pam.conf] Correct comments. From davidl at
|
||||||
@ -2661,4 +2665,4 @@
|
|||||||
- (djm) Trim deprecated options from INSTALL. Mention UsePAM
|
- (djm) Trim deprecated options from INSTALL. Mention UsePAM
|
||||||
- (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu
|
- (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu
|
||||||
|
|
||||||
$Id: ChangeLog,v 1.3806 2005/06/01 13:02:25 dtucker Exp $
|
$Id: ChangeLog,v 1.3807 2005/06/01 13:08:51 dtucker Exp $
|
||||||
|
15
ssh.c
15
ssh.c
@ -40,7 +40,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "includes.h"
|
#include "includes.h"
|
||||||
RCSID("$OpenBSD: ssh.c,v 1.239 2005/05/10 10:30:43 djm Exp $");
|
RCSID("$OpenBSD: ssh.c,v 1.240 2005/05/27 08:30:37 djm Exp $");
|
||||||
|
|
||||||
#include <openssl/evp.h>
|
#include <openssl/evp.h>
|
||||||
#include <openssl/err.h>
|
#include <openssl/err.h>
|
||||||
@ -145,7 +145,7 @@ pid_t proxy_command_pid = 0;
|
|||||||
int control_fd = -1;
|
int control_fd = -1;
|
||||||
|
|
||||||
/* Multiplexing control command */
|
/* Multiplexing control command */
|
||||||
static u_int mux_command = SSHMUX_COMMAND_OPEN;
|
static u_int mux_command = 0;
|
||||||
|
|
||||||
/* Only used in control client mode */
|
/* Only used in control client mode */
|
||||||
volatile sig_atomic_t control_client_terminate = 0;
|
volatile sig_atomic_t control_client_terminate = 0;
|
||||||
@ -612,8 +612,13 @@ again:
|
|||||||
options.control_path = tilde_expand_filename(
|
options.control_path = tilde_expand_filename(
|
||||||
options.control_path, original_real_uid);
|
options.control_path, original_real_uid);
|
||||||
}
|
}
|
||||||
if (options.control_path != NULL && options.control_master == 0)
|
if (mux_command != 0 && options.control_path == NULL)
|
||||||
|
fatal("No ControlPath specified for \"-O\" command");
|
||||||
|
if (options.control_path != NULL && options.control_master == 0) {
|
||||||
|
if (mux_command == 0)
|
||||||
|
mux_command = SSHMUX_COMMAND_OPEN;
|
||||||
control_client(options.control_path);
|
control_client(options.control_path);
|
||||||
|
}
|
||||||
|
|
||||||
/* Open a connection to the remote host. */
|
/* Open a connection to the remote host. */
|
||||||
if (ssh_connect(host, &hostaddr, options.port,
|
if (ssh_connect(host, &hostaddr, options.port,
|
||||||
@ -1303,6 +1308,10 @@ control_client(const char *path)
|
|||||||
fatal("%s socket(): %s", __func__, strerror(errno));
|
fatal("%s socket(): %s", __func__, strerror(errno));
|
||||||
|
|
||||||
if (connect(sock, (struct sockaddr*)&addr, addr_len) == -1) {
|
if (connect(sock, (struct sockaddr*)&addr, addr_len) == -1) {
|
||||||
|
if (mux_command != SSHMUX_COMMAND_OPEN) {
|
||||||
|
fatal("Control socket connect(%.100s): %s", path,
|
||||||
|
strerror(errno));
|
||||||
|
}
|
||||||
if (errno == ENOENT)
|
if (errno == ENOENT)
|
||||||
debug("Control socket \"%.100s\" does not exist", path);
|
debug("Control socket \"%.100s\" does not exist", path);
|
||||||
else {
|
else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user