xpra icon
Bug tracker and wiki

Opened 2 weeks ago

Closed 13 days ago

Last modified 10 days ago

#2407 closed defect (fixed)

socket-dirs defaults are ignored

Reported by: michael Owned by: michael
Priority: trivial Milestone: 3.0
Component: core Version: 3.0.x
Keywords: Cc:

Description

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.

Attachments (1)

socket-dirs.defaults.patch (4.2 KB) - added by michael 2 weeks ago.

Download all attachments as: .zip

Change History (5)

comment:1 Changed 2 weeks ago by Antoine Martin

Owner: changed from Antoine Martin to michael

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?

Changed 2 weeks ago by michael

Attachment: socket-dirs.defaults.patch added

comment:2 in reply to:  1 Changed 2 weeks ago by 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).

comment:3 Changed 13 days ago by Antoine Martin

Resolution: fixed
Status: newclosed

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.

comment:4 in reply to:  3 Changed 10 days ago by 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!

Note: See TracTickets for help on using tickets.