Re: Bug With “%C” in OpenSSH 7.7?

Damien Miller djm at mindrot.org
Sat Apr 14 11:32:31 AEST 2018


On Fri, 13 Apr 2018, Larry Ploetz wrote:

> There seems to be a problem with the %C token when used in localcommand 
> (controlpath works with it though).
> 
>     larryp:~ larry$ ssh -F /dev/null -o permitlocalcommand=yes -o 
> localcommand="echo \"%C\"" larryp at 192.168.1.1 hostname |& cat -vt
>     192.168.1.1
>     hostname
>     larryp:~ larry$ ssh -F /dev/null -o permitlocalcommand=yes -o 
> localcommand="echo \"%C\"" larryp at 192.168.1.1 hostname |& cat -vt
>     ^P^EM-pM-zM-z^?
>     hostname
>     larryp:~ larry$ ssh -F /dev/null -o permitlocalcommand=yes -o 
> localcommand="echo \"%C\"" larryp at 192.168.1.1 hostname |& cat -vt
> 
>     hostname
> 
> Please reply to my email address.

I think this should fix it:

diff --git a/ssh.c b/ssh.c
index e06542a..64ee841 100644
--- a/ssh.c
+++ b/ssh.c
@@ -1289,7 +1289,6 @@ main(int ac, char **av)
 		    (char *)NULL);
 		free(cp);
 	}
-	free(conn_hash_hex);
 
 	if (config_test) {
 		dump_client_config(&options, host);


More information about the openssh-unix-dev mailing list