diff options
author | Olle Lundberg <geek@nerd.sh> | 2012-11-20 12:43:40 +0100 |
---|---|---|
committer | Olle Lundberg <geek@nerd.sh> | 2013-02-28 12:31:59 +0100 |
commit | f41fc8fd28c9fd7a41fd6c291d507a7a1b3cde56 (patch) | |
tree | 782f07515ecbf2c97081a8765701fbfac92c49a9 | |
parent | 109d2b200a1e419f139166380fd0d136f4d57321 (diff) |
Create a copy of the identityfile list.
The copy is needed else the original
identityfile list is in the internal
config list is updated when we modify
the return dictionary.
-rw-r--r-- | paramiko/config.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/paramiko/config.py b/paramiko/config.py index 5e1cd88a..f5486b97 100644 --- a/paramiko/config.py +++ b/paramiko/config.py @@ -157,7 +157,11 @@ class SSHConfig (object): for match in matches: for key, value in match['config'].iteritems(): if key not in ret: - ret[key] = value + # Create a copy of the original value, + # else it will reference the original list + # in self._config and update that value too + # when the extend() is being called. + ret[key] = value[:] elif key == 'identityfile': ret[key].extend(value) ret = self._expand_variables(ret, hostname) |