Xpra: Ticket #2407: socket-dirs defaults are ignored

I noticed that the socket-dirs defaults never actually get used. This was confusing, because showconfig vs. --help would indicate different "defaults." This patch changes that - the defaults as shown by showconfig will actually be used.



Mon, 09 Sep 2019 03:57:43 GMT - Antoine Martin: owner changed

I'm not sure the patch is correct: the idea for some settings stored as lists is to leave them empty before parsing the command line so that if the user overrides them on the command line then we will use those values, otherwise we use the defaults.

How did you figure out that socket-dirs was not used? What exact commands?


Mon, 09 Sep 2019 15:49:59 GMT - michael: attachment set


Mon, 09 Sep 2019 15:51:11 GMT - michael:

Replying to Antoine Martin:

I'm not sure the patch is correct: the idea for some settings stored as lists is to leave them empty before parsing the command line so that if the user overrides them on the command line then we will use those values, otherwise we use the defaults.

How did you figure out that socket-dirs was not used? What exact commands?

xpra start was working, because do_run_server() would pull in the defaults itself using get_socket_dirs(). However, e.g. xpra attach :1 would simply not work - it couldn't find any of the sockets. Also, xpra showconfig would show both "used" and "default" values for socket-dirs, even when socket-dirs wasn't set anywhere - and since the "used" value was just [], attach would not work.

Please see the attached replacement patch, which makes slightly more aggressive changes. It changes the optparse action to "store", instead of "append", to achieve the behavior you specified. It also changes fixup_socketdirs() to not pull in defaults itself (making it a bit more consistent with the other fixup_* functions). It similarly changes do_run_server() to not pull in socket_dirs defaults itself, as they will already be set (and setup_local_sockets() would raise an exception anyway).


Tue, 10 Sep 2019 04:37:38 GMT - Antoine Martin: status changed; resolution set

Thanks! Applied in r23762. (it's nice to be able to remove the "defaults" argument to fixup_options)

I've ran the full set of unit tests on most platforms without problems.

See also #2411.


Thu, 12 Sep 2019 22:37:04 GMT - michael:

Replying to Antoine Martin:

Thanks! Applied in r23762. (it's nice to be able to remove the "defaults" argument to fixup_options)

I've ran the full set of unit tests on most platforms without problems.

See also #2411.

Thank you! I love Xpra!


Sat, 23 Jan 2021 05:50:28 GMT - migration script:

this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/2407