Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XDG_CURRENT_DESKTOP=X-QUBES breaks Electron Safe Storage #9435

Open
DemiMarie opened this issue Sep 1, 2024 · 2 comments
Open

XDG_CURRENT_DESKTOP=X-QUBES breaks Electron Safe Storage #9435

DemiMarie opened this issue Sep 1, 2024 · 2 comments
Labels
affects-4.2 This issue affects Qubes OS 4.2. C: templates needs diagnosis Requires technical diagnosis from developer. Replace with "diagnosed" or remove if otherwise closed. P: default Priority: default. Default priority for new issues, to be replaced given sufficient information. T: bug Type: bug report. A problem or defect resulting in unintended behavior in something that exists.

Comments

@DemiMarie
Copy link

How to file a helpful issue

Qubes OS release

R4.2

Brief summary

Electron Safe Storage fails unless one of the following holds:

  • The current desktop (presumably found from $XDG_CURRENT_DESKTOP) is set to something it knows about.
  • A command-line flag is passed.

This breaks Element and Wire, causing data loss unless the user knows what they are doing.

Steps to reproduce

Not sure. Upgrading Electron may have been the cause,.

Expected behavior

Electron Safe Storage works.

Actual behavior

Electron Safe Storage fails.

@DemiMarie DemiMarie added T: bug Type: bug report. A problem or defect resulting in unintended behavior in something that exists. P: default Priority: default. Default priority for new issues, to be replaced given sufficient information. labels Sep 1, 2024
@andrewdavidwong andrewdavidwong added C: templates needs diagnosis Requires technical diagnosis from developer. Replace with "diagnosed" or remove if otherwise closed. affects-4.2 This issue affects Qubes OS 4.2. labels Sep 1, 2024
@marmarek
Copy link
Member

marmarek commented Sep 2, 2024

Can you provide more specific reproduction steps?

Anyway, this looks more like an Electron bug (if your diagnosis is actually correct), the X-QUBES value is perfectly valid one (it isn't directly specified, but Desktop Entry Specification links it with OnlyShowIn/NotShowIn and those are explained in more details in Desktop Menu Specification, including the "X-" one).

@DemiMarie
Copy link
Author

DemiMarie commented Sep 4, 2024

Can you provide more specific reproduction steps?

The simplest way to reproduce this bug is to start the Wire flatpak (com.wire.WireDesktop) with a modified .desktop file. This works:

[Desktop Entry]
Name=Wire
# Wire Desktop works because Electron is told to ask GNOME Keyring for secrets
Exec=/usr/bin/flatpak run --branch=stable --arch=x86_64 --command=/app/bin/wire-desktop --file-forwarding com.wire.WireDesktop --password-store=gnome-libsecret @@u %U @@

As does this:

[Desktop Entry]
Name=Wire
# Wire Desktop works because Electron thinks it is running under GNOME and so asks
# GNOME Keyring for secrets.
Exec=/usr/bin/flatpak run --branch=stable --env=XDG_CURRENT_DESKTOP=GNOME --arch=x86_64 --command=/app/bin/wire-desktop --file-forwarding com.wire.WireDesktop @@u %U @@

But this does NOT work:

[Desktop Entry]
Name=Wire
# Wire Desktop started this way cannot find its secrets because it does not know
# which secret store to use and does not fall back to the portal.
Exec=/usr/bin/flatpak run --branch=stable --env=XDG_CURRENT_DESKTOP=X-QUBES --arch=x86_64 --command=/app/bin/wire-desktop --file-forwarding com.wire.WireDesktop @@u %U @@

Anyway, this looks more like an Electron bug (if your diagnosis is actually correct), the X-QUBES value is perfectly valid one (it isn't directly specified, but Desktop Entry Specification links it with OnlyShowIn/NotShowIn and those are explained in more details in Desktop Menu Specification, including the "X-" one).

The bug is that Electron does not fall back to the portal, which is what it should use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-4.2 This issue affects Qubes OS 4.2. C: templates needs diagnosis Requires technical diagnosis from developer. Replace with "diagnosed" or remove if otherwise closed. P: default Priority: default. Default priority for new issues, to be replaced given sufficient information. T: bug Type: bug report. A problem or defect resulting in unintended behavior in something that exists.
Projects
None yet
Development

No branches or pull requests

3 participants