-
-
Notifications
You must be signed in to change notification settings - Fork 61
qvm-open-in-dvm/qvm-open-in-vm doesn't work with KDE-based templates #10797
Copy link
Copy link
Labels
C: coreThis issue pertains to a Qubes core component.This issue pertains to a Qubes core component.C: templatesThis issue pertains to templates in general (as opposed to specific templates).This issue pertains to templates in general (as opposed to specific templates).P: defaultPriority: default. Default priority for new issues, to be replaced given sufficient information.Priority: default. Default priority for new issues, to be replaced given sufficient information.affects-4.3This issue affects Qubes OS 4.3.This issue affects Qubes OS 4.3.devel-vm-archlinux-cur-testdevel-vm-bookworm-cur-testdevel-vm-fc41-cur-testdevel-vm-fc42-cur-testdevel-vm-fc43-cur-testdevel-vm-fc44-cur-testdevel-vm-trixie-cur-testdiagnosedTechnical diagnosis of this issue has been performed.Technical diagnosis of this issue has been performed.pr submittedA pull request has been submitted for this issue.A pull request has been submitted for this issue.
Description
Metadata
Metadata
Assignees
Labels
C: coreThis issue pertains to a Qubes core component.This issue pertains to a Qubes core component.C: templatesThis issue pertains to templates in general (as opposed to specific templates).This issue pertains to templates in general (as opposed to specific templates).P: defaultPriority: default. Default priority for new issues, to be replaced given sufficient information.Priority: default. Default priority for new issues, to be replaced given sufficient information.affects-4.3This issue affects Qubes OS 4.3.This issue affects Qubes OS 4.3.devel-vm-archlinux-cur-testdevel-vm-bookworm-cur-testdevel-vm-fc41-cur-testdevel-vm-fc42-cur-testdevel-vm-fc43-cur-testdevel-vm-fc44-cur-testdevel-vm-trixie-cur-testdiagnosedTechnical diagnosis of this issue has been performed.Technical diagnosis of this issue has been performed.pr submittedA pull request has been submitted for this issue.A pull request has been submitted for this issue.
Qubes OS release
R4.3, but might affect older versions
Brief summary
qvm-open-in-dvmandqvm-open-in-vmdo not work with DispVM based on KDE-based templates.Steps to reproduce
qvm-open-in-dvmon this fileExpected behavior
File opens in a new DispVM.
Changes to the file are transferred back to the source VM (after closing the editor).
Actual behavior
The DispVM starts and then immediately shuts down.
Additional information
Similar to #6884
What's happening here is that
qubes-openis usingxdg-open, which in turn useskde-openorkde-open5in the KDE-based cube. These (kde-open/kde-open5) start the application that handles the file in a way that it is not their child process.This is how
pstreelooks when opening a file in a working DispVM (wherefirefox-esrhappens to be the application handling the file type):And this is how it looks in a cube where
kde-open/kde-open5was used to launch the application (in this case,gwenview):qubes-openis expected to wait until all its child processes are done; after it exits, the parent proces --vm-file-editor-- cleans up the temporary directory with the file being opened/edited, and exits, allowing the cube to shut down.Since
kde-open/kde-open5immediately return, and since the application process is not a child ofqubes-open, the DispVM immediately shuts down.In fact, this also affects
qvm-open-in-vmwhen the target cube uses a KDE-based template. In that case, the application is started, but by the time it actually fully starts, the file is gone, asvm-file-editoralready managed to delete it afterqubes-openexited.Proposed solution
Currently
qubes-openuses a combination ofexecandcatto keep stdout/stderr connected even if the handler (say,exo-open):This does not work for
kde-open/kde-open5. Instead, I tested a quick-fix based onpidwait:This works well in KDE-based templates, for viewing as well as editing files. Testing in GNOME-based and Xfce-based templates is my next step.
I'm sure this is not a perfect solution, there is possibly a race condition here where some other application could open that same temporary file and get picked up by
pidwait. This seems unlikely to me, but flagging just as well. That said, the| catmethod used currently is also described as a "silly hack".