diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | ssh.c | 8 | ||||
-rw-r--r-- | ssh_config.5 | 6 |
3 files changed, 16 insertions, 5 deletions
@@ -69,6 +69,11 @@ | |||
69 | - otto@cvs.openbsd.org 2006/02/11 19:31:18 | 69 | - otto@cvs.openbsd.org 2006/02/11 19:31:18 |
70 | [atomicio.c] | 70 | [atomicio.c] |
71 | type correctness; from Ray Lai in PR 5011; ok millert@ | 71 | type correctness; from Ray Lai in PR 5011; ok millert@ |
72 | - djm@cvs.openbsd.org 2006/02/12 06:45:34 | ||
73 | [ssh.c ssh_config.5] | ||
74 | add a %l expansion code to the ControlPath, which is filled in with the | ||
75 | local hostname at runtime. Requested by henning@ to avoid some problems | ||
76 | with /home on NFS; ok dtucker@ | ||
72 | 77 | ||
73 | 20060313 | 78 | 20060313 |
74 | - (dtucker) [configure.ac] Bug #1171: Don't use printf("%lld", longlong) | 79 | - (dtucker) [configure.ac] Bug #1171: Don't use printf("%lld", longlong) |
@@ -3970,4 +3975,4 @@ | |||
3970 | - (djm) Trim deprecated options from INSTALL. Mention UsePAM | 3975 | - (djm) Trim deprecated options from INSTALL. Mention UsePAM |
3971 | - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu | 3976 | - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu |
3972 | 3977 | ||
3973 | $Id: ChangeLog,v 1.4159 2006/03/15 00:29:51 djm Exp $ | 3978 | $Id: ChangeLog,v 1.4160 2006/03/15 00:30: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.260 2006/02/10 00:27:13 stevesk Exp $"); | 43 | RCSID("$OpenBSD: ssh.c,v 1.261 2006/02/12 06:45:34 djm Exp $"); |
44 | 44 | ||
45 | #include <sys/resource.h> | 45 | #include <sys/resource.h> |
46 | #include <sys/ioctl.h> | 46 | #include <sys/ioctl.h> |
@@ -638,11 +638,15 @@ again: | |||
638 | options.control_path = NULL; | 638 | options.control_path = NULL; |
639 | 639 | ||
640 | if (options.control_path != NULL) { | 640 | if (options.control_path != NULL) { |
641 | char me[NI_MAXHOST]; | ||
642 | |||
643 | if (gethostname(me, sizeof(me)) == -1) | ||
644 | fatal("gethostname: %s", strerror(errno)); | ||
641 | snprintf(buf, sizeof(buf), "%d", options.port); | 645 | snprintf(buf, sizeof(buf), "%d", options.port); |
642 | cp = tilde_expand_filename(options.control_path, | 646 | cp = tilde_expand_filename(options.control_path, |
643 | original_real_uid); | 647 | original_real_uid); |
644 | options.control_path = percent_expand(cp, "p", buf, "h", host, | 648 | options.control_path = percent_expand(cp, "p", buf, "h", host, |
645 | "r", options.user, (char *)NULL); | 649 | "r", options.user, "l", me, (char *)NULL); |
646 | xfree(cp); | 650 | xfree(cp); |
647 | } | 651 | } |
648 | if (mux_command != 0 && options.control_path == NULL) | 652 | if (mux_command != 0 && options.control_path == NULL) |
diff --git a/ssh_config.5 b/ssh_config.5 index 5c94ffc9c..5d821a0b1 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.76 2006/01/20 11:21:45 jmc Exp $ | 37 | .\" $OpenBSD: ssh_config.5,v 1.77 2006/02/12 06:45:34 djm 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 |
@@ -306,6 +306,8 @@ section above or the string | |||
306 | .Dq none | 306 | .Dq none |
307 | to disable connection sharing. | 307 | to disable connection sharing. |
308 | In the path, | 308 | In the path, |
309 | .Ql %l | ||
310 | will be substituted by the local host name, | ||
309 | .Ql %h | 311 | .Ql %h |
310 | will be substituted by the target host name, | 312 | will be substituted by the target host name, |
311 | .Ql %p | 313 | .Ql %p |
@@ -315,7 +317,7 @@ by the remote login username. | |||
315 | It is recommended that any | 317 | It is recommended that any |
316 | .Cm ControlPath | 318 | .Cm ControlPath |
317 | used for opportunistic connection sharing include | 319 | used for opportunistic connection sharing include |
318 | all three of these escape sequences. | 320 | at least the last three of these escape sequences (%h, %p and %r). |
319 | This ensures that shared connections are uniquely identified. | 321 | This ensures that shared connections are uniquely identified. |
320 | .It Cm DynamicForward | 322 | .It Cm DynamicForward |
321 | Specifies that a TCP port on the local machine be forwarded | 323 | Specifies that a TCP port on the local machine be forwarded |