Skip to content

Commit

Permalink
landlock: use uint32_t instead of __u32 in firejail.h
Browse files Browse the repository at this point in the history
The build on Alpine fails due to `__u32` not being defined.  It seems
that musl itself does not define it, so linux/types.h would have to be
included (for example, by including linux/landlock.h).

Error from `build_src_package`[1]:

    make -C src/firejail/
    make[1]: Entering directory '/builds/Firejail/firejail_ci/src/firejail'
    gcc [...] -DMOD_DIR='"src/firejail"' [...] -c appimage.c -o appimage.o
    In file included from appimage.c:23:
    firejail.h:977:17: error: unknown type name '__u32'
      977 | int ll_restrict(__u32 flags);
          |                 ^~~~~
    make[1]: Leaving directory '/builds/Firejail/firejail_ci/src/firejail'
    make[1]: *** [../../src/prog.mk:16: appimage.o] Error 1
    make: *** [Makefile:58: src/firejail/firejail] Error 2

This amends commit 13b2c56 ("feature: add Landlock support",
2023-10-24) / PR netblue30#6078.

[1] https://gitlab.com/Firejail/firejail_ci/-/jobs/5729692038
  • Loading branch information
kmk3 committed Dec 12, 2023
1 parent 01a9ddb commit d44be8e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/firejail/firejail.h
Original file line number Diff line number Diff line change
Expand Up @@ -974,7 +974,7 @@ int ll_write(const char *allowed_path);
int ll_special(const char *allowed_path);
int ll_exec(const char *allowed_path);
int ll_basic_system(void);
int ll_restrict(__u32 flags);
int ll_restrict(uint32_t flags);
void ll_add_profile(int type, const char *data);
#endif /* HAVE_LANDLOCK */

Expand Down
2 changes: 1 addition & 1 deletion src/firejail/landlock.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ int ll_basic_system(void) {
return error;
}

int ll_restrict(__u32 flags) {
int ll_restrict(uint32_t flags) {
if (!ll_is_supported())
return 0;

Expand Down

0 comments on commit d44be8e

Please sign in to comment.