sec_landlock_init :: () { #if !LANDLOCK_ENABLED { log_error("LANDLOCK IS DISABLED!"); if !is_dev_machine() then exit(99); return; } new_context := context; new_context.logger = my_logger; push_context,defer_pop new_context; version := landlock_is_version_equal_or_higher(DESIRED_VERSION, true); if !version { log_error("Warning: Your version of landlock is too old."); } rules := landlock_all_rules(); ok, ll_fd := landlock_create_ruleset(*rules); if !ok exit(1); ok = landlock_lock_privileges(); if !ok exit(1); ok = landlock_restrict_self(ll_fd); if !ok exit(1); log("is armed."); } #scope_file DESIRED_VERSION :: 7; my_logger :: #bake_arguments base_logger(prefix="Landlock");