xpra icon
Bug tracker and wiki

This bug tracker and wiki are being discontinued
please use https://github.com/Xpra-org/xpra instead.


Ticket #1357: shell-noquote.patch

File shell-noquote.patch, 701 bytes (added by Antoine Martin, 5 years ago)

backport of the new shell-quote function

  • xpra/scripts/server.py

     
    137137
    138138
    139139def sh_quotemeta(s):
    140     safe = ("abcdefghijklmnopqrstuvwxyz"
    141             + "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
    142             + "0123456789"
    143             + "/._:,-+")
    144     quoted_chars = []
    145     for char in s:
    146         if char not in safe:
    147             quoted_chars.append("\\")
    148         quoted_chars.append(char)
    149     return "\"%s\"" % ("".join(quoted_chars),)
     140    return "'" + s.replace("'", "'\\''") + "'"
    150141
    151142def xpra_runner_shell_script(xpra_file, starting_dir, socket_dir):
    152143    script = []