mirror of
https://github.com/facebook/sapling.git
synced 2024-12-28 23:54:12 +03:00
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:
parent
a968007692
commit
8337fb5549
@ -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("'", "'\\''")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user