sshrepo: add more safe characters (issue2983)

Extended the list of safe characters introduced in c3194121de6c to include
everything from pipes._safechars, which is only available on Unix platforms.
Place "-" at the end of the range to avoid backslash-escape.
New characters: @%+=:,
This commit is contained in:
Thomas Arendsen Hein 2011-12-09 15:50:33 +01:00
parent a968007692
commit 8337fb5549

View File

@ -21,7 +21,7 @@ class remotelock(object):
def _serverquote(s):
'''quote a string for the remote shell ... which we assume is sh'''
if re.match(r'[a-zA-Z0-9._\-/]*$', s):
if re.match('[a-zA-Z0-9@%_+=:,./-]*$', s):
return s
return "'%s'" % s.replace("'", "'\\''")