xpra icon
Bug tracker and wiki

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#1259 closed defect (fixed)

~/.xpra/run-xpra gets bigger and bigger during every start

Reported by: floemker Owned by: floemker
Priority: minor Milestone: 1.0
Component: server Version: trunk
Keywords: Cc:

Description

In server.py::run_server() the shell script ~/.xpra/run_server is unconditionally
newly written during every start. As PATH, LD_LIBRARY_PATH, and PYTHONPATH
are written as

    PATH="curValue":$PATH"; export PATH

these definitions get longer after every start. During every start one set of default values is added to these definitions.

The same is true for all string escaping. E.g. after some few server restarts:

    SSH_CONNECTION="192.168.2.152\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ 33114\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ 192.168.2.115\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ 22"; export SSH_CONNECTION

Change History (4)

comment:1 Changed 3 years ago by Antoine Martin

Owner: changed from Antoine Martin to floemker

This obviously only occurs when starting the server via the run-xpra script, ie: when starting over ssh.

r13040 fixes the paths accumulating duplicates. (will backport)


The other one is more tricky. This is not what I expected to see (with tcsh or bash without the "set"):

$ set SSH_CONNECTION="127.0.0.1\ 52958\ 127.0.0.1\ 22"
$ echo $SSH_CONNECTION
127.0.0.1\ 52958\ 127.0.0.1\ 22

Or more simply:

$ x="\ "
$ echo $x
\

Despite what I am reading here: Which characters need to be escaped in Bash? How do we know it?, it looks like the space character does not need escaping? Escaping it leads to the backslash ending up in the string... causing more trouble every time as it too gets escaped.

Suggestions welcome.

comment:2 Changed 3 years ago by floemker

Perhaps

def sh_quotemeta(s):
    return "'" + s.replace("'", "'\\''") + "'"

or something similar (untested)?

comment:3 Changed 3 years ago by Antoine Martin

Resolution: fixed
Status: newclosed

Applied in r13057. Seems to work, but I won't be backporting this to older branches (seems too risky), at least not for now.

comment:4 Changed 3 years ago by Antoine Martin

Backported to v0.17.x branch in r14416 to fix #1357.

Note: See TracTickets for help on using tickets.