diff options
author | 2006-02-12 06:45:34 +0000 | |
---|---|---|
committer | 2006-02-12 06:45:34 +0000 | |
commit | 5ccdfb1f4af74af89e4d0cda665ca9ee6e6e29d1 (patch) | |
tree | 3b604e89045a2612c295aa2c74fa2abcff618932 /usr.bin/ssh/ssh.c | |
parent | don't bother to expalicitly mention ukphy(4) in driver man pages. (diff) | |
download | wireguard-openbsd-5ccdfb1f4af74af89e4d0cda665ca9ee6e6e29d1.tar.xz wireguard-openbsd-5ccdfb1f4af74af89e4d0cda665ca9ee6e6e29d1.zip |
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@
Diffstat (limited to 'usr.bin/ssh/ssh.c')
-rw-r--r-- | usr.bin/ssh/ssh.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/usr.bin/ssh/ssh.c b/usr.bin/ssh/ssh.c index c01c7ee8f98..e5dcf36c224 100644 --- a/usr.bin/ssh/ssh.c +++ b/usr.bin/ssh/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 <sys/resource.h> #include <sys/ioctl.h> @@ -631,11 +631,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) |