Commit graph

10536 commits

Author SHA1 Message Date
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
Kelvin M. Klann
d145db7522 ci: codespell: upgrade ubuntu-22.04 to ubuntu-24.04
Relevant software changes:

* codespell 2.1.0 -> 2.2.6

See also [1] and [2].

[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
2025-08-20 07:02:54 -03:00
Kelvin M. Klann
77aff18525 firecfg.config: fix order (warzone2100.real)
And improve the comment.

Fixes the following:

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

This amends commit 4422c9358 ("warzone2100 for Debian/Ubuntu -
/usr/bin/warzone2100 is a script calling /usr/bin/warzone2100.real",
2025-08-19).
2025-08-20 07:01:53 -03:00
netblue30
4422c9358c warzone2100 for Debian/Ubuntu - /usr/bin/warzone2100
is a script calling /usr/bin/warzone2100.real
2025-08-19 17:29:50 -04:00
Kelvin M. Klann
b45a80e660 bugfix: firemon: fix potential memory leak in procevent_monitor
Simplify the deallocation of `cmd` to make it easier to understand,
which looks like it would fix a potential memory leak of `cmd`:

    if (!cmd) {
        cmd = pid_proc_cmdline(pid); // alloc
    }
    if (add_new) {
        // ...                       // no dealloc
    }
    else if (proc_ev->what == PROC_EVENT_EXIT && pids[pid].level == 1) {
        // ...                       // no dealloc
    }
    else {
        // ...
        else {
            sprintf(lineptr, " %s\n", cmd);
            if (cmd != pids[pid].option.event.cmd) {
                free(cmd);           // dealloc
            }
        }
        // ...
    }

This is a follow-up to commit 5ec00f70c ("fix: avoid cmd double-free in
procevent_monitor", 2025-07-31) / PR #6846.

Relates to #6792.
2025-08-19 10:08:20 -03:00
Kelvin M. Klann
a67db2d467 bugfix: firecfg: fix parsing filenames with multiple ".desktop"
When checking if a .desktop file is valid, firecfg currently searches
for the first occurrence of `.desktop` in the filename and checks that
it is at the end of the string.

This fails if the filename contains multiple occurrences of `.desktop`,
such as the one for Telegram Desktop, `org.telegram.desktop.desktop`:

    $ sudo firecfg
    [...]
       org.telegram.desktop.desktop skipped (not a .desktop file)

Instead, start the `.desktop` comparison from the last `.` character in
the filename.

This amends commit a9c851ee4 ("firecfg: use ignorelist also for .desktop
files", 2024-01-08) / PR #6153.

Fixes #6865.

Relates to #5245 #5876.

Reported-by: @tht2005
Reported-by: @rusty-snake
2025-08-19 09:16:00 -03:00
Kelvin M. Klann
6228f71ad5 RELNOTES: add bugfix, build, ci, docs and profile items
Relates to #6792 #6846 #6854 #6858 #6859 #6862 #6864 #6866 #6867 #6868.
Relates to #6869.
2025-08-18 15:10:15 -03:00
netblue30
9ca94eafd1
Merge pull request #6846 from grey3228/fix/procevent_monitor_cmd_double_free
bugfix: firemon: avoid cmd double-free in procevent_monitor
2025-08-18 12:06:41 -04:00
netblue30
d35f732af8
Merge pull request #6867 from kmk3/wine-disable-noinput
profiles: wine: disable noinput so gamepads work
2025-08-18 12:05:35 -04:00
netblue30
26aa380b49
Merge pull request #6868 from kmk3/cppcheck-ignore-syscalls-c
build: cppcheck: ignore src/lib/syscalls.c
2025-08-18 12:05:18 -04:00
netblue30
5ceb87512b
Merge pull request #6869 from kmk3/cppcheck-fix-var-init
bugfix: fnettrace-icmp: fix uninitialized vars (cppcheck)
2025-08-18 12:03:58 -04:00
Kelvin M. Klann
a8c13152ac build: cppcheck: ignore src/lib/syscalls.c
cppcheck 2.18.0 fails to parse this file:

    $ cppcheck --version
    Cppcheck 2.18.0
    $ cppcheck -q --force --error-exitcode=1 \
      --enable=warning,performance --max-ctu-depth=40 \
      src/lib/syscall.c
    cppcheck: --max-ctu-depth is being capped at 10. This limitation will be removed in a future Cppcheck version.
    src/lib/syscall.c:80:26: error: syntax error [syntaxError]
     { .name = "@aio", .list =
                             ^
    src/lib/syscall.c:109:31: error: syntax error [syntaxError]
     { .name = "@basic-io", .list =
                                  ^
2025-08-18 09:54:06 -03:00
Kelvin M. Klann
e205ed32e9 bugfix: fnettrace-icmp: fix uninitialized vars (cppcheck)
These warnings break CI when using `ubuntu-24.04`:

    $ cppcheck --version
    Cppcheck 2.13.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 .
    src/fnettrace-icmp/main.c:116:3: warning: Uninitialized variable: type_ptr [uninitvar]
      type_ptr,
      ^
    src/fnettrace-icmp/main.c:90:19: note: Assignment 'type_ptr=type_number', assigned value is <Uninit>
     char *type_ptr = type_number;
                      ^
    src/fnettrace-icmp/main.c:91:11: note: Assuming condition is true
     if (type < 19)
              ^
    src/fnettrace-icmp/main.c:116:3: note: Uninitialized variable: type_ptr
      type_ptr,
      ^
    src/fnettrace-icmp/main.c:117:3: warning: Uninitialized variable: code_ptr [uninitvar]
      code_ptr);
      ^
    src/fnettrace-icmp/main.c:97:19: note: Assignment 'code_ptr=code_number', assigned value is <Uninit>
     char *code_ptr = code_number;
                      ^
    src/fnettrace-icmp/main.c:98:15: note: Assuming condition is true
     if (type ==3 && code < 16)
                  ^
    src/fnettrace-icmp/main.c:117:3: note: Uninitialized variable: code_ptr
      code_ptr);
      ^
    make: *** [Makefile:379: cppcheck] Error 1
2025-08-18 09:53:00 -03:00
Kelvin M. Klann
89f5d8f5fb build: cppcheck: format make target 2025-08-18 09:16:02 -03:00
Kelvin M. Klann
9dede69750
Merge pull request #6864 from kmk3/ci-speedup-main-build
ci: speed-up main build & add build-gcc
2025-08-18 11:34:36 +00:00
Kelvin M. Klann
0cab47b013 profiles: wine: disable noinput so gamepads work
From @kolAflash[1]:

> The `noinput` setting for Wine prevents Joysticks from being used in
> Wine.

> Use the Wine "control" center for testing: `wine control`.
>
> There you find a `Gamecontroller` program for testing.

Fixes #6866.

Relates to #6707.

[1] https://github.com/netblue30/firejail/issues/6866#issue-3328634575

Suggested-by: @kolAflash
2025-08-18 05:34:17 -03:00
Kelvin M. Klann
dbf4b9a22b ci: drop apt dependencies from main build
Disable apparmor/selinux and use the default compiler version (currently
gcc 11.4.0-1ubuntu1~22.04).

Note that these configuration options are are still enabled in the
`build-gcc` job, so the code coverage should remain unaffected.

This allows dropping the apt-get update/install commands, which can take
a significant amount of time (sometimes even most of the job runtime),
depending on the state of the CI infrastructure.

For a relatively recent example of this, see the build of commit
a31f74165 ("bugfix: fix "Not enforcing Landlock" message always being
printed (#6806)", 2025-07-10) [1]:

* `apt-get update`: 12s
* `apt-get install`: 64s
* `make`: 40s

When comparing master (8bccd686f) [2] [3] [4] to this commit [5] [6] [7]
using 3 consecutive builds each, the average build time goes down from
77s to 21s (a ~72% reduction), making the CI feedback much quicker,
which is especially helpful when iterating on a branch in general and
when trying to debug CI build failures.

[1] https://github.com/netblue30/firejail/actions/runs/16141617993/job/45550207173
[2] https://github.com/netblue30/firejail/actions/runs/17019049268/job/48245518988
[3] https://github.com/netblue30/firejail/actions/runs/17019049268/job/48245547046
[4] https://github.com/netblue30/firejail/actions/runs/17019049268/job/48245579009
[5] https://github.com/netblue30/firejail/actions/runs/17019030502/job/48245478097
[6] https://github.com/netblue30/firejail/actions/runs/17019030502/job/48245617867
[7] https://github.com/netblue30/firejail/actions/runs/17019030502/job/48245626724
2025-08-18 05:00:36 -03:00
Kelvin M. Klann
47811cb6da ci: run main build in parallel
To make it faster.

See also commit 500d8f2d6 ("ci: run make in parallel where applicable",
2023-08-14) / PR #5960.
2025-08-18 05:00:36 -03:00
Kelvin M. Klann
0d2b949a85 ci: copy build to build-gcc & remove --enable-analyzer
Changes:

* Copy the `build` job from build.yml to `build-gcc` in build-extra.yml
* Remove `--enable-analyzer` in the main build

`-fanalyzer` increases the chance of false positives (compared to using
just the normal warning flags), so leave it just in build-extra to make
it clearer why the main build fails (that is, build errors, normal
warnings or analyzer warnings).
2025-08-18 05:00:36 -03:00
Kelvin M. Klann
8d099f623c docs: README.md: fix misc formatting
This amends commit e108976f5 ("added signature to release 0.9.76,
updated main page, small modifs for mkasc.sh", 2025-08-17).
2025-08-18 04:59:02 -03:00
Kelvin M. Klann
d9bb7ed4bd docs: README.md: improve 0.9.76 text and add links to xorg issue
This amends commit e108976f5 ("added signature to release 0.9.76,
updated main page, small modifs for mkasc.sh", 2025-08-17).

Relates to #6773 #6775.
2025-08-18 04:56:07 -03:00
netblue30
b9a592b510 more cppcheck 2025-08-17 17:43:45 -04:00
netblue30
d4881b6bc3 cppcheck cleanup 2025-08-17 17:17:42 -04:00
netblue30
be3c2a0713 some problems reported by ccpcheck 2025-08-17 12:04:58 -04:00
netblue30
e108976f5a added signature to release 0.9.76, updated main page, small modifs for mkasc.sh 2025-08-17 09:44:50 -04:00
Kelvin M. Klann
8bccd686fd
ci: standardize "apt-get install" step name (#6862)
For consistency and simplicity, name the `apt-get install` step just
"install dependencies" in all jobs.

Affected jobs:

* check-c.yml: scan-build
* check-c.yml: cppcheck

Related commits:

* 94e2ce275 ("Create build.yml (#3651)", 2020-10-01)
* 0fa11826b ("build: test build with apparmor and selinux in CI",
  2020-10-01)
2025-08-16 13:47:34 +00:00
Kelvin M. Klann
c902890cd1
docs: github: clarify how to attach logs (#6858)
Link to the GitHub docs for attaching a file[1].

This should be more straightforward in most cases and would avoid
polluting the user profile with gists unnecessarily (which might get in
the way of using/managing other gists), especially over time when
dealing with many projects/issues/comments.

Keep the gist as a fallback option just in case the file attachment
feature randomly gets broken for an extended period of time, as the
GitHub web UI overall keeps getting slower and jankier over time.

Note: It seems that in both cases (attachment/gist), the file size limit
in the web UI is 25MB[2].

Relates to #5398.

Misc: This was noticed on #5611.

[1] https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/attaching-files
[2] https://docs.github.com/en/repositories/working-with-files/managing-large-files/about-large-files-on-github#file-size-limits
2025-08-16 11:42:58 +00:00
Kelvin M. Klann
83492f35f8
bugfix: fix potential infinite loop in checkcfg (-fanalyzer) (#6859)
It looks like it could happen if a line in /etc/firejail/firejail.config
starts with `netfilter-default ` and there is a space or tab right after
that.

    $ pacman -Q gcc14 glibc
    gcc14 14.3.1+r25+g42e99e057bd7-1
    glibc 2.42+r3+gbc13db739377-1
    $ ./configure --enable-analyzer CC=gcc-14 >/dev/null &&
      make clean >/dev/null && make >/dev/null
    [...]
    ../../src/firejail/checkcfg.c: In function ‘checkcfg’:
    ../../src/firejail/checkcfg.c:137:40: warning: infinite loop [CWE-835] [-Wanalyzer-infinite-loop]
      137 |                                 while (*fname == ' ' || *fname == '\t')
          |                                        ^~~~~~
      ‘checkcfg’: events 1-5
        |
        |  137 |                                 while (*fname == ' ' || *fname == '\t')
        |      |                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        |      |                                        |             |
        |      |                                        |             (2) if it ever follows ‘true’ branch, it will always do so...
        |      |                                        (1) infinite loop here
        |      |                                        (5) ...to here
        |  138 |                                         ptr++;
        |      |                                         ~~~~~
        |      |                                            |
        |      |                                            (3) ...to here
        |      |                                            (4) looping back...
        |
    [...]

Added on commit 340a6b2ee ("added netfilter-default config option in
/etc/firejail/firejail.config", 2016-07-28).
2025-08-15 09:39:25 +00:00