=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/ssh.c,v retrieving revision 1.545 retrieving revision 1.546 diff -u -r1.545 -r1.546 --- src/usr.bin/ssh/ssh.c 2020/12/20 23:38:00 1.545 +++ src/usr.bin/ssh/ssh.c 2020/12/20 23:40:19 1.546 @@ -1,4 +1,4 @@ -/* $OpenBSD: ssh.c,v 1.545 2020/12/20 23:38:00 djm Exp $ */ +/* $OpenBSD: ssh.c,v 1.546 2020/12/20 23:40:19 djm Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -211,15 +211,6 @@ } } -#define DEFAULT_CLIENT_PERCENT_EXPAND_ARGS \ - "C", cinfo->conn_hash_hex, \ - "L", cinfo->shorthost, \ - "i", cinfo->uidstr, \ - "k", cinfo->keyalias, \ - "l", cinfo->thishost, \ - "n", cinfo->host_arg, \ - "p", cinfo->portstr - /* * Expands the set of percent_expand options used by the majority of keywords * in the client that support percent expansion. @@ -230,13 +221,7 @@ const struct ssh_conn_info *cinfo) { return percent_expand(str, - /* values from statics above */ - DEFAULT_CLIENT_PERCENT_EXPAND_ARGS, - /* values from arguments */ - "d", cinfo->homedir, - "h", cinfo->remhost, - "r", cinfo->remuser, - "u", cinfo->locuser, + DEFAULT_CLIENT_PERCENT_EXPAND_ARGS(cinfo), (char *)NULL); } @@ -252,13 +237,7 @@ char *ret; ret = percent_dollar_expand(str, - /* values from statics above */ - DEFAULT_CLIENT_PERCENT_EXPAND_ARGS, - /* values from arguments */ - "d", cinfo->homedir, - "h", cinfo->remhost, - "r", cinfo->remuser, - "u", cinfo->locuser, + DEFAULT_CLIENT_PERCENT_EXPAND_ARGS(cinfo), (char *)NULL); if (ret == NULL) fatal("invalid environment variable expansion"); @@ -1649,7 +1628,7 @@ /* Log into the remote system. Never returns if the login fails. */ ssh_login(ssh, &sensitive_data, host, (struct sockaddr *)&hostaddr, - options.port, pw, timeout_ms); + options.port, pw, timeout_ms, cinfo); if (ssh_packet_connection_is_on_socket(ssh)) { verbose("Authenticated to %s ([%s]:%d).", host, @@ -2067,11 +2046,7 @@ debug3("expanding LocalCommand: %s", options.local_command); cp = options.local_command; options.local_command = percent_expand(cp, - DEFAULT_CLIENT_PERCENT_EXPAND_ARGS, - "d", cinfo->homedir, - "h", cinfo->remhost, - "r", cinfo->remuser, - "u", cinfo->locuser, + DEFAULT_CLIENT_PERCENT_EXPAND_ARGS(cinfo), "T", tun_fwd_ifname == NULL ? "NONE" : tun_fwd_ifname, (char *)NULL); debug3("expanded LocalCommand: %s", options.local_command);