aboutsummaryrefslogtreecommitdiffstats
path: root/src/firejail/firejail.h
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@protonmail.com>2023-10-24 12:43:46 -0400
committerLibravatar Kelvin M. Klann <kmk3.code@protonmail.com>2023-11-07 17:55:13 -0300
commit13b2c566df883269b55f77757bb50a5d2890ec20 (patch)
tree5c7ccc9d00886b93c4429a91671161fa6464f1f9 /src/firejail/firejail.h
parentcleanup (diff)
downloadfirejail-13b2c566df883269b55f77757bb50a5d2890ec20.tar.gz
firejail-13b2c566df883269b55f77757bb50a5d2890ec20.tar.zst
firejail-13b2c566df883269b55f77757bb50a5d2890ec20.zip
feature: add Landlock support
Based on 5315 by ChrysoliteAzalea. It is based on the same underlying structure, but with a lot of refactoring/simplification and with bugfixes and improvements. Co-authored-by: Kelvin M. Klann <kmk3.code@protonmail.com> Co-authored-by: Азалия Смарагдова <charming.flurry@yandex.ru>
Diffstat (limited to 'src/firejail/firejail.h')
-rw-r--r--src/firejail/firejail.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/firejail/firejail.h b/src/firejail/firejail.h
index c791913ea..efeda7228 100644
--- a/src/firejail/firejail.h
+++ b/src/firejail/firejail.h
@@ -281,6 +281,9 @@ extern int arg_overlay; // overlay option
281extern int arg_overlay_keep; // place overlay diff in a known directory 281extern int arg_overlay_keep; // place overlay diff in a known directory
282extern int arg_overlay_reuse; // allow the reuse of overlays 282extern int arg_overlay_reuse; // allow the reuse of overlays
283 283
284extern int arg_landlock; // add basic Landlock rules
285extern int arg_landlock_proc; // 0 - no access; 1 -read-only; 2 - read-write
286
284extern int arg_seccomp; // enable default seccomp filter 287extern int arg_seccomp; // enable default seccomp filter
285extern int arg_seccomp32; // enable default seccomp filter for 32 bit arch 288extern int arg_seccomp32; // enable default seccomp filter for 32 bit arch
286extern int arg_seccomp_postexec; // need postexec ld.preload library? 289extern int arg_seccomp_postexec; // need postexec ld.preload library?
@@ -950,4 +953,23 @@ void run_ids(int argc, char **argv);
950// oom.c 953// oom.c
951void oom_set(const char *oom_string); 954void oom_set(const char *oom_string);
952 955
956// landlock.c
957#ifdef HAVE_LANDLOCK
958int ll_get_fd(void);
959int ll_read(const char *allowed_path);
960int ll_write(const char *allowed_path);
961int ll_special(const char *allowed_path);
962int ll_exec(const char *allowed_path);
963int ll_basic_system(void);
964int ll_restrict(__u32 flags);
965#else
966static inline int ll_get_fd(void) { return -1; }
967static inline int ll_read(...) { return 0; }
968static inline int ll_write(...) { return 0; }
969static inline int ll_special(...) { return 0; }
970static inline int ll_exec(...) { return 0; }
971static inline int ll_basic_system(void) { return 0; }
972static inline int ll_restrict(...) { return 0; }
973#endif /* HAVE_LANDLOCK */
974
953#endif 975#endif