[GH-ISSUE #4235] firecfg does not work with symlinks (discord.desktop) #2588

Closed
opened 2026-05-05 09:15:35 -06:00 by gitea-mirror · 6 comments
Owner

Originally created by @sak96 on GitHub (May 3, 2021).
Original GitHub issue: https://github.com/netblue30/firejail/issues/4235

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.
Originally created by @sak96 on GitHub (May 3, 2021). Original GitHub issue: https://github.com/netblue30/firejail/issues/4235 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 1. run `i3-dmenu-desktop --dmenu "echo Discord"`. you should be able to use `xdg-open /usr/share/applications/discord.desktop` as well. 1. run `firejail --list` and find discord is not running **Environment** <details> <summary>Linux distribution and version Arch linux </summary> LSB Version: 1.4 Distributor ID: Arch Description: Arch Linux Release: rolling Codename: n/a </details> <details> <summary>Firejail version == 0.9.64.4</summary> ``` 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 ``` </details> **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. ```zsh $ 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](https://github.com/netblue30/firejail/blob/0bbbe2566a900073a52b7b12b607b368fadcfcac/src/firecfg/desktop_files.c#L171). **Checklist** - [ ] The profile (and redirect profile if exists) hasn't already been fixed [upstream](https://github.com/netblue30/firejail/tree/master/etc). - [ ] The program has a profile. (If not, request one in `https://github.com/netblue30/firejail/issues/1139`) - [x] 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.
gitea-mirror 2026-05-05 09:15:35 -06:00
Author
Owner

@sak96 commented on GitHub (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
<!-- gh-comment-id:831369977 --> @sak96 commented on GitHub (May 3, 2021): workaround ```bash 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 ```
Author
Owner

@rusty-snake commented on GitHub (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
<!-- gh-comment-id:831377165 --> @rusty-snake commented on GitHub (May 3, 2021): > workaround > > ```shell > 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: ```bash sed "s%Exec=/usr/bin/discord%Exec=discord%" /usr/share/applications/discord.desktop > ~/.local/share/applications/discord.desktop ```
Author
Owner

@ghost commented on GitHub (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!

<!-- gh-comment-id:921785681 --> @ghost commented on GitHub (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!
Author
Owner

@rusty-snake commented on GitHub (Sep 17, 2021):

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.

<!-- gh-comment-id:922036804 --> @rusty-snake commented on GitHub (Sep 17, 2021): 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](https://en.wikipedia.org/wiki/Querdenken)"_). Personally I give up firecfg.
Author
Owner

@ghost commented on GitHub (Sep 17, 2021):

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

<!-- gh-comment-id:922070798 --> @ghost commented on GitHub (Sep 17, 2021): Unfortunately C is no language I would put in a PR myself.
Author
Owner

@netblue30 commented on GitHub (Dec 21, 2021):

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

<!-- gh-comment-id:998821346 --> @netblue30 commented on GitHub (Dec 21, 2021): Fixed, thanks for the bug. If you still have problems, let us know!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/firejail#2588
No description provided.