From 3ec54c7e58eb9724a5d54d3e985992ebecbd7553 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Wed, 15 Mar 2006 11:30:13 +1100 Subject: - djm@cvs.openbsd.org 2006/02/12 06:45:34 [ssh.c ssh_config.5] add a %l expansion code to the ControlPath, which is filled in with the local hostname at runtime. Requested by henning@ to avoid some problems with /home on NFS; ok dtucker@ --- ssh.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'ssh.c') diff --git a/ssh.c b/ssh.c index 5331402e5..4a373356f 100644 --- a/ssh.c +++ b/ssh.c @@ -40,7 +40,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: ssh.c,v 1.260 2006/02/10 00:27:13 stevesk Exp $"); +RCSID("$OpenBSD: ssh.c,v 1.261 2006/02/12 06:45:34 djm Exp $"); #include #include @@ -638,11 +638,15 @@ again: options.control_path = NULL; if (options.control_path != NULL) { + char me[NI_MAXHOST]; + + if (gethostname(me, sizeof(me)) == -1) + fatal("gethostname: %s", strerror(errno)); snprintf(buf, sizeof(buf), "%d", options.port); cp = tilde_expand_filename(options.control_path, original_real_uid); options.control_path = percent_expand(cp, "p", buf, "h", host, - "r", options.user, (char *)NULL); + "r", options.user, "l", me, (char *)NULL); xfree(cp); } if (mux_command != 0 && options.control_path == NULL) -- cgit v1.2.3