Commit graph

10713 commits

Author SHA1 Message Date
Spider Jerusalem
3207760728
profiles: godot: allow ~/.local/share/Trash (#6904)
Fixes an error in Godot 4.5 where files cannot be deleted from within
the Editor.
2025-09-22 02:28:09 +00:00
Kelvin M. Klann
d0c89ae819 RELNOTES: add rlimit items
Relates to #6890 #6891 #6893 #6894 #6895.
2025-09-12 07:41:20 -03:00
Kelvin M. Klann
aca3376a77
tests: rlimit: add missing tests for rlimit-as / rlimit-cpu (#6895)
This is a follow-up to #6893.

Relates to #1604.
2025-09-12 10:34:02 +00:00
Kelvin M. Klann
2dbd31618c rlimit: fix suffixes not working
This amends commit 993a9b373 ("modif: rlimit: use uppercase suffixes in
the code/docs (#6891)", 2025-09-07).
2025-09-09 15:34:19 -03:00
Kelvin M. Klann
ad797d7380
docs: rlimit: improve text and use base-2 units (#6894)
The base-2 units are more accurate, as `--rlimit-as=1K` is equivalent to
`--rlimit-as=1024`, not `--rlimit-as=1000`, for example.

This is a follow-up to #6891.

Relates to #4315.
2025-09-09 17:47:30 +00:00
Kelvin M. Klann
45229e0f9b
modif: rlimit: improve error messages (#6893)
Changes:

* Remove unrelated `strerror` output from some error messages
* Remove periods from some error messages
* Ensure that the invalid value is in the error message
* Ensure that the full command name is in the error message (instead of
  just `rlimit` in some cases)
* Standardize output
* tests: Expect the full command name (and argument in some cases)

Examples:

Before:

    $ firejail --quiet --noprofile --rlimit-cpu=-1 /bin/true
    Error: invalid rlimit -1
    $ firejail --quiet --noprofile --rlimit-nproc=-1 /bin/true
    Error: invalid rlimit -1
    $ firejail --quiet --noprofile --rlimit-as=-1 /bin/true
    Error: invalid rlimit-as. Only use positive numbers and K, M or G suffix.: No such file or directory

After:

    $ firejail --quiet --noprofile --rlimit-cpu=-1 /bin/true
    Error: invalid rlimit-cpu: -1
    $ firejail --quiet --noprofile --rlimit-nproc=-1 /bin/true
    Error: invalid rlimit-nproc: -1
    $ firejail --quiet --noprofile --rlimit-as=-1 /bin/true
    Error: invalid rlimit-as: -1; use only positive numbers and K, M or G suffix

This is a follow-up to #6891.

Relates to #4315.
2025-09-09 17:46:52 +00:00
Kelvin M. Klann
af766b4b7d rlimit: sort commands in the code/tests
Note: They are already sorted in the following files:

* contrib/syntax/lists/profile_commands_arg1.list
* src/firejail/usage.c
* src/man/firejail-profile.5.in
* src/man/firejail.1.in
* src/zsh_completion/_firejail.in
* test/environment/rlimit-bad-profile.exp
* test/environment/rlimit-bad.exp

Related commits:

* 137985136 ("Baseline firejail 0.9.28", 2015-08-08)
* caefb7929 ("RLIMIT_AS", 2017-10-13) / PR #1604
* e8685de73 ("implemented --rlimit-cpu - set max CPU time for processes
  running in the sandbox; for issue #1614, more to come...", 2017-10-24)
2025-09-08 12:44:07 -03:00
Kelvin M. Klann
3e4bbc3f21 rlimit: rename test profiles for clarity
Add the specific rlimit command name to the filename.

Commands used to rename the files:

    git mv rlimit-bad1.profile rlimit-bad-fsize.profile
    git mv rlimit-bad2.profile rlimit-bad-nofile.profile
    git mv rlimit-bad3.profile rlimit-bad-nproc.profile
    git mv rlimit-bad4.profile rlimit-bad-sigpending.profile

Added on commit d30ae468d ("testing", 2016-11-19).
2025-09-08 12:44:07 -03:00
Kelvin M. Klann
993a9b373e
modif: rlimit: use uppercase suffixes in the code/docs (#6891)
The proper suffixes (KiB, MiB and GiB) are uppercase.

This is a follow-up to #6890.

Relates to #4315.
2025-09-07 12:01:15 +00:00
Kelvin M. Klann
7f712264ec
modif: rlimit: allow uppercase suffixes (#6890)
For better usability and because the proper suffixes (KiB, MiB and GiB)
are uppercase.

Affected commands:

* `rlimit-as`
* `rlimit-fsize`

Before:

    $ firejail --quiet --noprofile --rlimit-as=100m /bin/true
    $ firejail --quiet --noprofile --rlimit-as=100M /bin/true
    Error: invalid rlimit-as. Only use positive numbers and k, m or g suffix.: No such file or directory

After:

    $ firejail --quiet --noprofile --rlimit-as=100m /bin/true
    $ firejail --quiet --noprofile --rlimit-as=100M /bin/true

Relates to #4315.
2025-09-05 21:22:12 +00:00
Kelvin M. Klann
920917b978 RELNOTES: add profile items
Relates to #6879 #6883 #6884 #6885.
2025-09-04 08:47:12 -03:00
Kelvin M. Klann
498e654db7 RELNOTES: add new profile item
Related commits:

* ae22e5610 ("ne text editor profile", 2025-08-23)
* 04e8ceda5 ("profiles: ne: fix comment and include typos", 2025-09-04)
2025-09-04 08:46:41 -03:00
Kelvin M. Klann
04e8ceda54 profiles: ne: fix comment and include typos
This amends commit ae22e5610 ("ne text editor profile", 2025-08-23).
2025-09-04 08:44:36 -03:00
dependabot[bot]
d3e5ef823a build(deps): bump github/codeql-action from 3.29.7 to 3.29.11
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.29.7 to 3.29.11.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](51f77329af...3c3833e0f8)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 3.29.11
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-04 11:34:21 +00:00
dependabot[bot]
b67b2db74e build(deps): bump actions/checkout from 4.2.2 to 5.0.0
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.2.2 to 5.0.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](11bd71901b...08c6903cd8)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 5.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-04 11:33:37 +00:00
Kelvin M. Klann
830d5a94b6
Merge pull request #6885 from kmk3/profiles-organize-blacklists
profiles: organize blacklist sections as per profile.template
2025-09-04 11:33:04 +00:00
Hank Leininger
03eac22c10
profiles: hashcat: fix runtime errors (#6364)
private-bin messes with hashcat's ability to find its installed
files under /usr/share/hashcat/.

novideo makes hashcat unable to access /dev/nvidia* (on some distros?)

Signed-off-by: Hank Leininger <hlein@korelogic.com>
2025-09-02 20:44:16 -06:00
Kelvin M. Klann
da5dd4bc0c profiles: organize blacklist sections as per profile.template
On each profile, ensure that the `blacklist` section is right above the
`include disable` section.

See etc/templates/profile.template.

Misc: This appears to affect about a third of the profiles that contain
`blacklist` entries:

    $ git grep -El '^#?blacklist ' -- etc/profile* | wc -l
    158
    $ git diff --name-only f1381b342 | wc -l
    49

Kind of relates to commit 04efbb276 ("profiles: replace x11 socket
blacklist with disable-X11.inc", 2024-03-22) / PR #6286.
2025-09-01 06:53:10 -03:00
Kelvin M. Klann
a45e2016fe profiles: curl/wget: move nvm comments to the top
Optional/commented entries usually go there.

See also the top comments on firefox-common.profile.

Relates to #5058.
2025-08-31 11:06:37 -03:00
Kelvin M. Klann
872b0551f9 profiles: rtv: move rtv-addons comment to the top
Optional/commented entries usually go there.

See also the top comments on firefox-common.profile.

Relates to #4016.
2025-08-31 11:06:29 -03:00
Kelvin M. Klann
f1381b342c profiles: newsbeuter: organize blacklist section
Relates to #4064.
2025-08-31 11:00:41 -03:00
Kelvin M. Klann
0df8e342eb profiles: libreoffice/makepkg: sort gpg comment sections
Related commits:

* d0ae07485 ("makepkg profile for Arch platform, #1642", 2017-11-15)
* e25596bfb ("profiles: libreoffice: support signing documents with GPG
  (#6353)", 2024-05-24)
2025-08-31 11:00:41 -03:00
Kelvin M. Klann
558a7a878a profiles: libreoffice: sort noblacklist section
Related commits:

* 9e3ba319b ("Unify all profiles", 2017-08-07) / #1427.
* eb4b505ac ("Consistent home directory nomenclature", 2017-11-17)
2025-08-31 11:00:41 -03:00
Kelvin M. Klann
8e5171b971
profiles: add missing mailcap entries (#6884)
Allow `~/.mailcap` for the profiles that have `mailcap` in `private-etc`
and vice-versa.

Fixes #6883.

Reported-by: @vinc17fr
Suggested-by: @vinc17fr
2025-08-31 13:59:04 +00:00
Kelvin M. Klann
d789fe44a2 profiles: w3m: sort whitelist section
Added on commit 450d0124f ("Update w3m.profile", 2021-06-07) / PR #4347.
2025-08-30 09:51:58 -03:00
Kelvin M. Klann
c4bd0b9c12 profiles: seamonkey: sort profile
Related commits:

* 63c35052b ("Add '$HOME/.local/share/pki' to blacklist", 2019-02-03)
* 324c73ea4 ("ordering fixes", 2022-01-06) / PR #4830
2025-08-30 07:17:24 -03:00
Kelvin M. Klann
a16c867e7e RELNOTES: format bugfix item
This amends commit 2a3cd30bc ("RELNOTES: add modif, bugfix, build, ci
and profile items", 2025-08-24).

Relates to #6865 #6871.
2025-08-30 06:59:40 -03:00
JustinWayland
8a2cb8ed5d
profiles: qutebrowser: add comment about qute-pass support (#6879) 2025-08-26 11:22:46 +00:00
Kelvin M. Klann
2a3cd30bc4 RELNOTES: add modif, bugfix, build, ci and profile items
Relates to #6856 #6865 #6871 #6872 #6873 #6874 #6875 #6876 #6877.
2025-08-24 15:14:51 -03:00
Kelvin M. Klann
a32cc2f17d profiles: disable-common: sort history section
This amends commit ae22e5610 ("ne text editor profile", 2025-08-23).
2025-08-24 15:12:38 -03:00
Kelvin M. Klann
aa118897ab firecfg.config: format/improve Note2 text
Related commits:

* ae22e5610 ("ne text editor profile", 2025-08-23)
* 7d6b9ac7b ("fix ci sorting error", 2025-08-23)
* df2f6a5c0 ("firecfg.config: remove empty lines to fix CI", 2025-08-24)

Relates to #6002.
2025-08-24 15:12:37 -03:00
Kelvin M. Klann
df2f6a5c04 firecfg.config: remove empty lines to fix CI
Fixes the following error[1]:

    $ ./ci/check/profiles/sort-firecfg.config.sh src/firecfg/firecfg.config
    sort: -:2: disorder:

This amends commit 7d6b9ac7b ("fix ci sorting error", 2025-08-23).

[1] https://github.com/netblue30/firejail/actions/runs/17181037095/job/48743454360
2025-08-24 12:39:24 -03:00
netblue30
7d6b9ac7b7 fix ci sorting error 2025-08-23 18:49:59 -04:00
netblue30
ae22e5610a ne text editor profile 2025-08-23 18:42:05 -04:00
netblue30
939f650dcd wayland/pipewire fix 2025-08-23 07:52:02 -04:00
Kelvin M. Klann
e1239ad375
Merge pull request #6856 from kmk3/procevent-improve-debug
modif: firemon: improve debug message code
2025-08-22 13:46:29 +00:00
Kelvin M. Klann
1069127f5f procevent.c: replace printf with debug_prctl
Replace almost all debug `printf` calls with `debug_prctl` to reduce the
amount of duplication and `ifdefs`.

Note: There is one debug `printf` call that uses a different message
format, so it is left as is.

Command used to search and replace:

    $ perl -0 -pi -e 's/#ifdef DEBUG_PRCTL\n(\s+)printf\("%s: %d, ([^\n]+)", __FUNCTION__, __LINE__([^\n]+)\n#endif/${1}debug_prctl("$2"$3/g; \
      s/(debug_prctl\("event[^\n]+)/\t\t\t\t$1\n/g' \
      src/firemon/procevent.c

Relates to #6792.
2025-08-22 10:42:50 -03:00
Kelvin M. Klann
eb6fc94037 procevent.c: add debug_prctl macro
See the next commit.

See also commit e06c3e99d ("common.h: use __func__ instead of
__FUNCTION__", 2023-06-17) / PR #5871.
2025-08-22 10:42:50 -03:00
Kelvin M. Klann
0c884029fc procevent.c: reposition some debug message calls
Move them from the middle of the finalization code to before it.
2025-08-22 10:42:50 -03:00
Kelvin M. Klann
8b8bf79547 procevent.c: improve misc formatting 2025-08-22 10:42:50 -03:00
amano-kenji
aee633e2c2
profiles: firefox-common: add a comment about mpris (#6876)
Note: firefox.profile already has this command enabled, but this change
is actually for librewolf.
2025-08-22 13:40:43 +00:00
Kelvin M. Klann
76ae89e4ca
build: cppcheck: use --check-level=exhaustive (#6877)
The `--check-level=exhaustive` option was briefly added, then changed to
`--max-ctu-depth=40`, presumably because the version being used in CI
(cppcheck 2.7 on ubuntu-22.04) did not support the former.

The current version in CI (cppcheck 2.13 on ubuntu-24.04) supports that
option, so restore it.

This fixes a flood of `information:` messages (which appear even with
`-q`) in the latest version of cppcheck:

    $ cppcheck --version
    Cppcheck 2.18.0
    $ make cppcheck
    cppcheck -q -j 4 --force --error-exitcode=1 --enable=warning,performance \
      --max-ctu-depth=40 \
      -i src/firejail/checkcfg.c \
      -i src/firejail/main.c \
      -i src/lib/syscall.c \
      .
    cppcheck: --max-ctu-depth is being capped at 10. This limitation will be removed in a future Cppcheck version.
    src/etc-cleanup/main.c:0:0: information: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. [normalCheckLevelMaxBranches]

    ^
    src/fbuilder/build_bin.c:0:0: information: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. [normalCheckLevelMaxBranches]

    ^
    src/fbuilder/build_fs.c:0:0: information: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. [normalCheckLevelMaxBranches]

    ^
    [...]

This is a follow-up to #6874.

Related commits:

* be3c2a071 ("some problems reported by ccpcheck", 2025-08-17)
* d4881b6bc ("cppcheck cleanup", 2025-08-17)
* ebb368780 ("ci: cppcheck: upgrade ubuntu-22.04 to ubuntu-24.04",
  2025-08-20) / PR #6874
2025-08-21 12:37:07 +00:00
netblue30
5e58dfbc2d Merge branch 'master' of ssh://github.com/netblue30/firejail 2025-08-20 10:31:02 -04:00
netblue30
746d7c6ee1 updated profile stats 2025-08-20 10:30:50 -04:00
amano-kenji
1c485ceb73
Merge pull request #6875 from amano-kenji/qutebrowser
profiles: qutebrowser: whitelist /usr/share/pdf.js
2025-08-20 11:33:36 +00:00
netblue30
ef4033f84d
Merge pull request #6871 from kmk3/firecfg-fix-double-desktop
bugfix: firecfg: fix parsing filenames with multiple ".desktop"
2025-08-20 06:57:26 -04:00
netblue30
6b1b7794a8
Merge pull request #6872 from kmk3/procevent-fix-cmd-memleak
bugfix: firemon: fix potential memory leak in procevent_monitor
2025-08-20 06:57:00 -04:00
netblue30
062f5d871e
Merge pull request #6873 from kmk3/ci-codespell-ubuntu-2404
ci: codespell: upgrade ubuntu-22.04 to ubuntu-24.04
2025-08-20 06:55:59 -04:00
netblue30
43614f3784
Merge pull request #6874 from kmk3/ci-cppcheck-ubuntu2404
ci: cppcheck: upgrade ubuntu-22.04 to ubuntu-24.04
2025-08-20 06:55:41 -04:00
Kelvin M. Klann
ebb368780d ci: cppcheck: upgrade ubuntu-22.04 to ubuntu-24.04
Relevant software changes:

* cppcheck 2.7 -> 2.13

This is a follow-up to #6873.

See also [1] and [2].

Fixes CI breakage in #6856[3]:

    $ cppcheck --version
    Cppcheck 2.7
    $ make cppcheck
    cppcheck -q -j '4' --force --error-exitcode=1 --enable=warning,performance \
      --max-ctu-depth=40 \
      -i src/firejail/checkcfg.c \
      -i src/firejail/main.c \
      -i src/lib/syscall.c \
      .
    src/firemon/procevent.c:306:6: error: syntax error [syntaxError]
         debug_prctl("event fork\n");
         ^
    make: *** [Makefile:379: cppcheck] Error 1

[1] https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2204-Readme.md
[2] https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2404-Readme.md
[3] https://github.com/netblue30/firejail/actions/runs/17047583642/job/48327251189
2025-08-20 07:18:17 -03:00