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

bugfix: firecfg: check full .desktop filename in check_profile() #6674

Merged
merged 1 commit into from
Mar 4, 2025

Conversation

kmk3
Copy link
Collaborator

@kmk3 kmk3 commented Mar 1, 2025

Currently, firecfg only checks the last word in .desktop files when
trying to match them to an existing profile. For example:

  • org.gnome.gedit.desktop -> gedit.desktop
  • org.gnome.seahorse.Application.desktop -> Application.desktop

This works in the former case where there is an exact match of the last
word on each side (gedit.desktop and gedit.profile), but not in the
latter case (Application.desktop and seahorse.profile).

So make firecfg also check the full filename of the .desktop file, to
make it easier to create redirect profiles that match the full name of
the .desktop files. For example:

  • org.gnome.seahorse.Application.desktop ->
    org.gnome.seahorse.Application.profile (which itself then redirects
    to seahorse.profile)

Related commits:

Relates to #2624 #6658.

Currently, firecfg only checks the last word in .desktop files when
trying to match them to an existing profile.  For example:

* `org.gnome.gedit.desktop` -> `gedit.desktop`
* `org.gnome.seahorse.Application.desktop` -> `Application.desktop`

This works in the former case where there is an exact match of the last
word on each side (`gedit.desktop` and `gedit.profile`), but not in the
latter case (`Application.desktop` and `seahorse.profile`).

So make firecfg also check the full filename of the .desktop file, to
make it easier to create redirect profiles that match the full name of
the .desktop files.  For example:

* `org.gnome.seahorse.Application.desktop` ->
  `org.gnome.seahorse.Application.profile` (which itself then redirects
  to `seahorse.profile`)

Related commits:

* a6341b9 ("disable DBus activation in firecfg", 2017-09-25)
* 3e69deb ("fix firecfg", 2017-09-25)
* bd97615 ("Temp fix firecfg (netblue30#2634)", 2019-04-02)

Relates to netblue30#2624 netblue30#6658.
@kmk3 kmk3 added firecfg Anything related to firecfg and not firejail itself bugfix This fixes a bug labels Mar 1, 2025
@kmk3 kmk3 requested a review from rusty-snake March 1, 2025 23:57
@kmk3 kmk3 merged commit 8f69e98 into netblue30:master Mar 4, 2025
13 checks passed
@kmk3 kmk3 deleted the firecfg-fix-full-desktop branch March 4, 2025 17:02
kmk3 added a commit to kmk3/firejail that referenced this pull request Mar 4, 2025
Apparently the .desktop file for `seahorse` is located in the following
path:

* `/usr/share/applications/org.gnome.seahorse.Application.desktop`

Which ends in `Application.desktop` instead of `seahorse.desktop`,
leading to it not being automatically detected by firecfg.

So add a redirect profile and an entry in firecfg.config.

See also commit 8f69e98 ("bugfix: firecfg: check full filename in
check_profile() (netblue30#6674)", 2025-03-04).

Fixes netblue30#6658.

Reported-by: @ginto37
Reported-by: @rusty-snake
kmk3 added a commit to kmk3/firejail that referenced this pull request Mar 6, 2025
Apparently the .desktop file for `seahorse` is located in the following
path:

* `/usr/share/applications/org.gnome.seahorse.Application.desktop`

Which ends in `Application.desktop` instead of `seahorse.desktop`,
leading to it not being automatically detected by firecfg.

So add a redirect profile and an entry in firecfg.config.

See also commit 8f69e98 ("bugfix: firecfg: check full filename in
check_profile() (netblue30#6674)", 2025-03-04).

Fixes netblue30#6658.

Reported-by: @ginto37
Reported-by: @rusty-snake
kmk3 added a commit to kmk3/firejail that referenced this pull request Mar 6, 2025
Apparently the .desktop file for `seahorse` is located in the following
path:

* `/usr/share/applications/org.gnome.seahorse.Application.desktop`

Which ends in `Application.desktop` instead of `seahorse.desktop`,
leading to it not being automatically detected by firecfg.

So add a redirect profile and an entry in firecfg.config.

Related commits:

* bd97615 ("Temp fix firecfg (netblue30#2634)", 2019-04-02)
* 8f69e98 ("bugfix: firecfg: check full filename in check_profile()
  (netblue30#6674)", 2025-03-04).

Fixes netblue30#6658.

Relates to netblue30#2624.

Reported-by: @ginto37
Reported-by: @rusty-snake
kmk3 added a commit that referenced this pull request Mar 6, 2025
Apparently the .desktop file for `seahorse` is located in the following
path:

* `/usr/share/applications/org.gnome.seahorse.Application.desktop`

Which ends in `Application.desktop` instead of `seahorse.desktop`,
leading to it not being automatically detected by firecfg.

So add a redirect profile and an entry in firecfg.config.

Related commits:

* bd97615 ("Temp fix firecfg (#2634)", 2019-04-02)
* 8f69e98 ("bugfix: firecfg: check full filename in check_profile()
  (#6674)", 2025-03-04).

Fixes #6658.

Relates to #2624.

Reported-by: @ginto37
Reported-by: @rusty-snake
kmk3 added a commit to kmk3/firejail that referenced this pull request Mar 6, 2025
To avoid CI failures.

From the first run of `cppcheck_old` on commit 8f69e98 ("bugfix:
firecfg: check full filename in check_profile() (netblue30#6674)", 2025-03-04)
[1]:

> This is a scheduled Ubuntu 20.04 brownout. Ubuntu 20.04 LTS runner
> will be removed on 2025-04-01. For more details, see
> actions/runner-images#11101

The target depends on the cppcheck version from Ubuntu 20.04 in order to
work properly and this distribution will become EOL next month (April
2025), so just remove the target.

Added on commit 53f0b39 ("CI: keep old cppcheck job and ignore two
files in new job that take too long to check", 2022-07-26).

[1] https://github.com/netblue30/firejail/actions/runs/13658953453/job/38185280665
kmk3 added a commit that referenced this pull request Mar 7, 2025
To avoid CI failures.

From the first run of `cppcheck_old` on commit 8f69e98 ("bugfix:
firecfg: check full filename in check_profile() (#6674)", 2025-03-04)
[1]:

> This is a scheduled Ubuntu 20.04 brownout. Ubuntu 20.04 LTS runner
> will be removed on 2025-04-01. For more details, see
> actions/runner-images#11101

The target depends on the cppcheck version from Ubuntu 20.04 in order to
work properly and this distribution will become EOL next month (April
2025), so just remove the target.

Added on commit 53f0b39 ("CI: keep old cppcheck job and ignore two
files in new job that take too long to check", 2022-07-26).

[1] https://github.com/netblue30/firejail/actions/runs/13658953453/job/38185280665
@kmk3 kmk3 changed the title bugfix: firecfg: check full filename in check_profile() bugfix: firecfg: check full .desktop filename in check_profile() Mar 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix This fixes a bug firecfg Anything related to firecfg and not firejail itself
Projects
Status: Done (on RELNOTES)
Development

Successfully merging this pull request may close these issues.

2 participants