[GH-ISSUE #4018] Desktop Entry: firecfg --fix can not distinguish firefox, firefox-nightly, firefox-developer-edition,... #2506

Open
opened 2026-05-05 09:11:28 -06:00 by gitea-mirror · 4 comments
Owner

Originally created by @geekshen8521 on GitHub (Feb 28, 2021).
Original GitHub issue: https://github.com/netblue30/firejail/issues/4018

Write clear, concise and in textual form.

Bug and expected behavior

  • Describe the bug.
    With firefox, firefox-nightly, firefox-developer-edition installed.
    firecfg --fix generates firefox-*.desktop file where each
    "Exec" part of the desktop file contains the same "firefox", instead of firefox-nightly, firefox-developer-edition as they should be. Now all desktop files launches the same firefox version.
  • What did you expect to happen?
    The Exec part of each firefox version should be different according to their firefox versions.
  • Running firefox firefox-nightly firefox-developer-edition directly in terminal produce no such problem.

Reproduce
Steps to reproduce the behavior:

  1. install firefox alongside with other firefox versions (e.g. firefox-developer-edition, firefox-nightly, ...)
  2. Run firecfg --fix
  3. cd ~/.local/share/applications
  4. check each firefox-*.desktop

Environment

  • Linux distribution and version (ie output of lsb_release -a, screenfetch or cat /etc/os-release)
    Name="Arch Linux"
    Kernel=5.11.2-arch1-1
  • Firejail version (output of firejail --version) exclusive or used git commit (git rev-parse HEAD)
    firejail-git r6994.8a7b96974-1 (from AUR)
    Additional context
    firefox firefox-developer-edition (official repo, latest version)
    firefox-nightly (AUR)
    firecfg --fix only generate firefox firefox-developer-edition firefox-nightly desktop files. And only these three are influenced.

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.
debug output
Originally created by @geekshen8521 on GitHub (Feb 28, 2021). Original GitHub issue: https://github.com/netblue30/firejail/issues/4018 Write clear, concise and in textual form. **Bug and expected behavior** - Describe the bug. With firefox, firefox-nightly, firefox-developer-edition installed. firecfg --fix generates firefox-*.desktop file where each "Exec" part of the desktop file contains the same "firefox", instead of firefox-nightly, firefox-developer-edition as they should be. Now all desktop files launches the same firefox version. - What did you expect to happen? The Exec part of each firefox version should be different according to their firefox versions. - Running `firefox` `firefox-nightly` `firefox-developer-edition` directly in terminal produce no such problem. **Reproduce** Steps to reproduce the behavior: 1. install firefox alongside with other firefox versions (e.g. firefox-developer-edition, firefox-nightly, ...) 2. Run `firecfg --fix` 3. cd ~/.local/share/applications 4. check each firefox-*.desktop **Environment** - Linux distribution and version (ie output of `lsb_release -a`, `screenfetch` or `cat /etc/os-release`) Name="Arch Linux" Kernel=5.11.2-arch1-1 - Firejail version (output of `firejail --version`) exclusive or used git commit (`git rev-parse HEAD`) firejail-git r6994.8a7b96974-1 (from AUR) **Additional context** firefox firefox-developer-edition (official repo, latest version) firefox-nightly (AUR) `firecfg --fix` only generate firefox firefox-developer-edition firefox-nightly desktop files. And only these three are influenced. **Checklist** - [ ] The profile (and redirect profile if exists) hasn't already been fixed [upstream](https://github.com/netblue30/firejail/tree/master/etc). - [x] 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. <details><summary> debug output </summary> </details>
gitea-mirror added the
bug
firecfg
labels 2026-05-05 09:11:28 -06:00
Author
Owner

@geekshen8521 commented on GitHub (Feb 28, 2021):

I have read the man page, and desktop files in /usr/share/applications are like these:
Exec=/usr/lib/firefox-developer-edition/firefox %u
Exec=/opt/firefox-nightly/firefox %u
I guess may be this is the reason.

<!-- gh-comment-id:787396431 --> @geekshen8521 commented on GitHub (Feb 28, 2021): I have read the man page, and desktop files in /usr/share/applications are like these: Exec=/usr/lib/firefox-developer-edition/firefox %u Exec=/opt/firefox-nightly/firefox %u I guess may be this is the reason.
Author
Owner

@rusty-snake commented on GitHub (Feb 28, 2021):

Looks like firecfg strips absolute paths even if they aren't in $PATH.

<!-- gh-comment-id:787422740 --> @rusty-snake commented on GitHub (Feb 28, 2021): Looks like firecfg strips absolute paths even if they aren't in $PATH.
Author
Owner

@rusty-snake commented on GitHub (Feb 28, 2021):

Workaround

Because firecfg does not override existing files in ~/.local/share/applications, you can copy those dot-desktop files and prepend /usr/bin/firejail on all Exec= lines.

for ffxdd in /usr/share/applications/firefox-*.desktop; do
	sed "s|Exec=|Exec=/usr/bin/firejail |g" "$ffxdd" > ~/.local/share/applications/"$(basename "$ffxdd")"
done

or as oneliner:

for ffxdd in /usr/share/applications/firefox-*.desktop; do sed "s|Exec=|Exec=/usr/bin/firejail |g" "$ffxdd" > ~/.local/share/applications/"$(basename "$ffxdd")"; done
<!-- gh-comment-id:787423780 --> @rusty-snake commented on GitHub (Feb 28, 2021): ### Workaround Because firecfg does not override existing files in `~/.local/share/applications`, you can copy those dot-desktop files and prepend `/usr/bin/firejail` on all `Exec=` lines. ```bash for ffxdd in /usr/share/applications/firefox-*.desktop; do sed "s|Exec=|Exec=/usr/bin/firejail |g" "$ffxdd" > ~/.local/share/applications/"$(basename "$ffxdd")" done ``` or as oneliner: ```bash for ffxdd in /usr/share/applications/firefox-*.desktop; do sed "s|Exec=|Exec=/usr/bin/firejail |g" "$ffxdd" > ~/.local/share/applications/"$(basename "$ffxdd")"; done ```
Author
Owner

@geekshen8521 commented on GitHub (Feb 28, 2021):

Thanks @rusty-snake
Another workaround is to simply edit the desktop files under ~/.local/share/applications accordingly. And make sure that in PATH variable, /usr/local/bin precedes /usr/bin/.

<!-- gh-comment-id:787457198 --> @geekshen8521 commented on GitHub (Feb 28, 2021): Thanks @rusty-snake Another workaround is to simply edit the desktop files under ~/.local/share/applications accordingly. And make sure that in PATH variable, `/usr/local/bin` precedes `/usr/bin/`.
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#2506
No description provided.