Skip to content

Commit f41fc8f

Browse files
committed
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.
1 parent 109d2b2 commit f41fc8f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

paramiko/config.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,11 @@ def lookup(self, hostname):
157157
for match in matches:
158158
for key, value in match['config'].iteritems():
159159
if key not in ret:
160-
ret[key] = value
160+
# Create a copy of the original value,
161+
# else it will reference the original list
162+
# in self._config and update that value too
163+
# when the extend() is being called.
164+
ret[key] = value[:]
161165
elif key == 'identityfile':
162166
ret[key].extend(value)
163167
ret = self._expand_variables(ret, hostname)

0 commit comments

Comments
 (0)