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

firecfg does not work with symlinks (discord.desktop) #4235

Closed
1 of 7 tasks
sak96 opened this issue May 3, 2021 · 6 comments
Closed
1 of 7 tasks

firecfg does not work with symlinks (discord.desktop) #4235

sak96 opened this issue May 3, 2021 · 6 comments
Labels
bug Something isn't working firecfg Anything related to firecfg and not firejail itself

Comments

@sak96
Copy link
Contributor

sak96 commented May 3, 2021

In archlinux firecfg doesn't overwrite /usr/share/applications/discord.desktop exec field to /usr/local/bin/discord.
This is because the /usr/share/applications/discord.desktop is symlink to /opt/discord/discord.desktop

Bug and expected behavior

  • firecfg should update discord.desktop file
  • firecfg did not update discord.desktop file

No profile and disabling firejail
N/A

Reproduce
Steps to reproduce the behavior:

  1. installed discord and firejail in archlinux using pacman
  2. run i3-dmenu-desktop --dmenu "echo Discord". you should be able to use xdg-open /usr/share/applications/discord.desktop as well.
  3. run firejail --list and find discord is not running

Environment

Linux distribution and version Arch linux LSB Version: 1.4 Distributor ID: Arch Description: Arch Linux Release: rolling Codename: n/a
Firejail version == 0.9.64.4
firejail version 0.9.64.4

Compile time support:
   - AppArmor support is enabled
   - AppImage support is enabled
   - chroot support is enabled
   - D-BUS proxy support is enabled
   - file and directory whitelisting support is enabled
   - file transfer support is enabled
   - firetunnel support is enabled
   - networking support is enabled
   - overlayfs support is disabled
   - private-home support is enabled
   - private-cache and tmpfs as user enabled
   - SELinux support is disabled
   - user namespace support is enabled
   - X11 sandboxing support is enabled

Additional context

  • the firecfg patched binary is generated at /usr/local/bin/discord.
  • the desktop file exec /usr/bin/discord.
  • the desktop file is a link.
    $ ls -l /usr/share/applications/discord.desktop
    lrwxrwxrwx root root 28 B Wed Mar 24 06:39:37 2021 /usr/share/applications/discord.desktop ⇒ /opt/discord/discord.desktop
  • IMPORTANT!!! firecfg skips links as per this.

Checklist

  • The profile (and redirect profile if exists) hasn't already been fixed upstream.
  • The program has a profile. (If not, request one in https://github.com/netblue30/firejail/issues/1139)
  • I have performed a short search for similar issues (to avoid opening a duplicate).
  • If it is a AppImage, --profile=PROFILENAME is used to set the right profile.
  • Used LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 PROGRAM to get english error-messages.
  • I'm aware of browser-allow-drm yes/browser-disable-u2f no in firejail.config to allow DRM/U2F in browsers.
  • This is not a question. Questions should be asked in https://github.com/netblue30/firejail/discussions.
@sak96
Copy link
Contributor Author

sak96 commented May 3, 2021

workaround

cp /usr/share/applications/discord.desktop ~/.local/share/applications
sed -e "s%/usr/bin/discord%/usr/local/bin/discord%" -i ~/.local/share/applications/discord.desktop

@rusty-snake rusty-snake added bug Something isn't working firecfg Anything related to firecfg and not firejail itself labels May 3, 2021
@rusty-snake
Copy link
Collaborator

rusty-snake commented May 3, 2021

workaround

cp /usr/share/applications/discord.desktop ~/.local/share/applications
sed -e "s%/usr/bin/discord%/usr/bin/local/discord%" -i ~/.local/share/applications/discord.desktop

simpler:

sed "s%Exec=/usr/bin/discord%Exec=discord%" /usr/share/applications/discord.desktop > ~/.local/share/applications/discord.desktop

@kmk3 kmk3 changed the title Firecfg not patch discord.desktop Firecfg does not patch discord.desktop May 4, 2021
@ghost
Copy link

ghost commented Sep 17, 2021

Is there anything new on a fix for this being implemented. The issue persists. The workarounds posted here work, however a fix would be greatly preferable!

@rusty-snake
Copy link
Collaborator

I think desktop_files.c is the place for this and also for #4018 and #2624. The last commit (ignoring update copyright commits) to it was on 2 Apr 2019 (in a time before masks and "Querdenken"). Personally I give up firecfg.

@ghost
Copy link

ghost commented Sep 17, 2021

Unfortunately C is no language I would put in a PR myself.

netblue30 added a commit that referenced this issue Dec 21, 2021
@netblue30
Copy link
Owner

Fixed, thanks for the bug. If you still have problems, let us know!

@kmk3 kmk3 added this to To Document (RELNOTES/man) in Release 0.9.68 Dec 27, 2021
@kmk3 kmk3 changed the title Firecfg does not patch discord.desktop firecfg ignores symlinks (discord.desktop) Jan 19, 2022
@kmk3 kmk3 changed the title firecfg ignores symlinks (discord.desktop) firecfg does not work with symlinks (discord.desktop) Jan 19, 2022
kmk3 added a commit to kmk3/firejail that referenced this issue Jan 26, 2022
Note: They are added in the order that the issues were fixed/closed.

Note2: The issues were found through the following url:

https://github.com/netblue30/firejail/issues?q=is%3Aclosed+label%3Abug+-label%3Asecurity+closed%3A%3E2021-06-29+

The date used is the release date of 0.9.66, so in theory the query
should return every bug closed after that.  Security-related issues are
excluded because they will be added separately.

Note3: All issues other than netblue30#4328 were fixed before 0.9.68rc1.

Relates to netblue30#2758 netblue30#4235 netblue30#4328 netblue30#4387 netblue30#4395 netblue30#4460 netblue30#4467 netblue30#4558 netblue30#4560 netblue30#4586.
@kmk3 kmk3 moved this from To Document (RELNOTES/man) to Done (on RELNOTES) in Release 0.9.68 Jan 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working firecfg Anything related to firecfg and not firejail itself
Projects
No open projects
Release 0.9.68
  
Done (on RELNOTES)
Development

No branches or pull requests

3 participants