diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | ssh.c | 29 | ||||
-rw-r--r-- | ssh_config.5 | 7 |
3 files changed, 26 insertions, 15 deletions
@@ -38,6 +38,9 @@ | |||
38 | - jmc@cvs.openbsd.org 2005/04/26 12:59:02 | 38 | - jmc@cvs.openbsd.org 2005/04/26 12:59:02 |
39 | [sftp-client.h] | 39 | [sftp-client.h] |
40 | spelling correction in comment from wiz@netbsd; | 40 | spelling correction in comment from wiz@netbsd; |
41 | - jakob@cvs.openbsd.org 2005/04/26 13:08:37 | ||
42 | [ssh.c ssh_config.5] | ||
43 | fallback gracefully if client cannot connect to ControlPath. ok djm@ | ||
41 | 44 | ||
42 | 20050524 | 45 | 20050524 |
43 | - (djm) [contrib/caldera/openssh.spec contrib/redhat/openssh.spec] | 46 | - (djm) [contrib/caldera/openssh.spec contrib/redhat/openssh.spec] |
@@ -2537,4 +2540,4 @@ | |||
2537 | - (djm) Trim deprecated options from INSTALL. Mention UsePAM | 2540 | - (djm) Trim deprecated options from INSTALL. Mention UsePAM |
2538 | - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu | 2541 | - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu |
2539 | 2542 | ||
2540 | $Id: ChangeLog,v 1.3771 2005/05/26 02:05:49 djm Exp $ | 2543 | $Id: ChangeLog,v 1.3772 2005/05/26 02:07:13 djm Exp $ |
@@ -40,7 +40,7 @@ | |||
40 | */ | 40 | */ |
41 | 41 | ||
42 | #include "includes.h" | 42 | #include "includes.h" |
43 | RCSID("$OpenBSD: ssh.c,v 1.236 2005/04/21 11:47:19 djm Exp $"); | 43 | RCSID("$OpenBSD: ssh.c,v 1.237 2005/04/26 13:08:37 jakob Exp $"); |
44 | 44 | ||
45 | #include <openssl/evp.h> | 45 | #include <openssl/evp.h> |
46 | #include <openssl/err.h> | 46 | #include <openssl/err.h> |
@@ -613,7 +613,7 @@ again: | |||
613 | options.control_path, original_real_uid); | 613 | options.control_path, original_real_uid); |
614 | } | 614 | } |
615 | if (options.control_path != NULL && options.control_master == 0) | 615 | if (options.control_path != NULL && options.control_master == 0) |
616 | control_client(options.control_path); /* This doesn't return */ | 616 | control_client(options.control_path); |
617 | 617 | ||
618 | /* Open a connection to the remote host. */ | 618 | /* Open a connection to the remote host. */ |
619 | if (ssh_connect(host, &hostaddr, options.port, | 619 | if (ssh_connect(host, &hostaddr, options.port, |
@@ -1290,15 +1290,6 @@ control_client(const char *path) | |||
1290 | extern char **environ; | 1290 | extern char **environ; |
1291 | u_int flags; | 1291 | u_int flags; |
1292 | 1292 | ||
1293 | if (stdin_null_flag) { | ||
1294 | if ((fd = open(_PATH_DEVNULL, O_RDONLY)) == -1) | ||
1295 | fatal("open(/dev/null): %s", strerror(errno)); | ||
1296 | if (dup2(fd, STDIN_FILENO) == -1) | ||
1297 | fatal("dup2: %s", strerror(errno)); | ||
1298 | if (fd > STDERR_FILENO) | ||
1299 | close(fd); | ||
1300 | } | ||
1301 | |||
1302 | memset(&addr, '\0', sizeof(addr)); | 1293 | memset(&addr, '\0', sizeof(addr)); |
1303 | addr.sun_family = AF_UNIX; | 1294 | addr.sun_family = AF_UNIX; |
1304 | addr_len = offsetof(struct sockaddr_un, sun_path) + | 1295 | addr_len = offsetof(struct sockaddr_un, sun_path) + |
@@ -1311,8 +1302,20 @@ control_client(const char *path) | |||
1311 | if ((sock = socket(PF_UNIX, SOCK_STREAM, 0)) < 0) | 1302 | if ((sock = socket(PF_UNIX, SOCK_STREAM, 0)) < 0) |
1312 | fatal("%s socket(): %s", __func__, strerror(errno)); | 1303 | fatal("%s socket(): %s", __func__, strerror(errno)); |
1313 | 1304 | ||
1314 | if (connect(sock, (struct sockaddr*)&addr, addr_len) == -1) | 1305 | if (connect(sock, (struct sockaddr*)&addr, addr_len) == -1) { |
1315 | fatal("Couldn't connect to %s: %s", path, strerror(errno)); | 1306 | debug("Couldn't connect to %s: %s", path, strerror(errno)); |
1307 | close(sock); | ||
1308 | return; | ||
1309 | } | ||
1310 | |||
1311 | if (stdin_null_flag) { | ||
1312 | if ((fd = open(_PATH_DEVNULL, O_RDONLY)) == -1) | ||
1313 | fatal("open(/dev/null): %s", strerror(errno)); | ||
1314 | if (dup2(fd, STDIN_FILENO) == -1) | ||
1315 | fatal("dup2: %s", strerror(errno)); | ||
1316 | if (fd > STDERR_FILENO) | ||
1317 | close(fd); | ||
1318 | } | ||
1316 | 1319 | ||
1317 | if ((term = getenv("TERM")) == NULL) | 1320 | if ((term = getenv("TERM")) == NULL) |
1318 | term = ""; | 1321 | term = ""; |
diff --git a/ssh_config.5 b/ssh_config.5 index 7e48fa65b..d98246aa4 100644 --- a/ssh_config.5 +++ b/ssh_config.5 | |||
@@ -34,7 +34,7 @@ | |||
34 | .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 34 | .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
35 | .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 35 | .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
36 | .\" | 36 | .\" |
37 | .\" $OpenBSD: ssh_config.5,v 1.50 2005/04/21 06:17:50 djm Exp $ | 37 | .\" $OpenBSD: ssh_config.5,v 1.51 2005/04/26 13:08:37 jakob Exp $ |
38 | .Dd September 25, 1999 | 38 | .Dd September 25, 1999 |
39 | .Dt SSH_CONFIG 5 | 39 | .Dt SSH_CONFIG 5 |
40 | .Os | 40 | .Os |
@@ -270,6 +270,11 @@ to listen for control connections, but require confirmation using the | |||
270 | program before they are accepted (see | 270 | program before they are accepted (see |
271 | .Xr ssh-add 1 | 271 | .Xr ssh-add 1 |
272 | for details). | 272 | for details). |
273 | If the | ||
274 | .Cm ControlPath | ||
275 | can not be opened, | ||
276 | .Nm ssh | ||
277 | will continue without connecting to a master instance. | ||
273 | .It Cm ControlPath | 278 | .It Cm ControlPath |
274 | Specify the path to the control socket used for connection sharing. | 279 | Specify the path to the control socket used for connection sharing. |
275 | See | 280 | See |