1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-06-19 00:17:51 +02:00

don't interpolate local host values

This commit is contained in:
Kelly Brazil
2023-01-21 16:37:27 -08:00
parent ac9128fa0c
commit 0648d2e9e3

View File

@ -21,6 +21,8 @@
Configuration file (aka ``ssh_config``) support. Configuration file (aka ``ssh_config``) support.
""" """
# search jc_change for jc fixes
import fnmatch import fnmatch
import getpass import getpass
import os import os
@ -429,20 +431,20 @@ class SSHConfig:
# The actual tokens! # The actual tokens!
replacements = { replacements = {
# TODO: %%??? # TODO: %%???
"%C": sha1(tohash.encode()).hexdigest(), # "%C": sha1(tohash.encode()).hexdigest(), # jc_change
"%d": homedir, # "%d": homedir, # jc_change
"%h": configured_hostname, "%h": configured_hostname,
# TODO: %i? # TODO: %i?
"%L": local_hostname, # "%L": local_hostname, # jc_change
"%l": local_fqdn, # "%l": local_fqdn, # jc_change
# also this is pseudo buggy when not in Match exec mode so document # also this is pseudo buggy when not in Match exec mode so document
# that. also WHY is that the case?? don't we do all of this late? # that. also WHY is that the case?? don't we do all of this late?
"%n": target_hostname, "%n": target_hostname,
"%p": port, "%p": port,
"%r": remoteuser, "%r": remoteuser,
# TODO: %T? don't believe this is possible however # TODO: %T? don't believe this is possible however
"%u": user, # "%u": user, # jc_change
"~": homedir, # "~": homedir, # jc_change
} }
# Do the thing with the stuff # Do the thing with the stuff
tokenized = value tokenized = value