aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@protonmail.com>2024-04-06 23:16:10 -0400
committerLibravatar netblue30 <netblue30@protonmail.com>2024-04-06 23:16:10 -0400
commit8259f66e1f6b54f0ea6039f5fd65a77cbb27dfd9 (patch)
tree238645e79abb534ed09dbbdde4e1ff4353531af8
parentRELNOTES: add profile items (diff)
downloadfirejail-8259f66e1f6b54f0ea6039f5fd65a77cbb27dfd9.tar.gz
firejail-8259f66e1f6b54f0ea6039f5fd65a77cbb27dfd9.tar.zst
firejail-8259f66e1f6b54f0ea6039f5fd65a77cbb27dfd9.zip
landlock fix for old kernel versions
-rw-r--r--src/firejail/landlock.c6
-rw-r--r--src/firejail/profile.c6
2 files changed, 10 insertions, 2 deletions
diff --git a/src/firejail/landlock.c b/src/firejail/landlock.c
index 453ad8f10..44d7eeafa 100644
--- a/src/firejail/landlock.c
+++ b/src/firejail/landlock.c
@@ -294,4 +294,10 @@ void ll_add_profile(int type, const char *data) {
294 ptr->next = entry; 294 ptr->next = entry;
295} 295}
296 296
297#else
298void ll_add_profile(int type, const char *data) {
299 (void) type;
300 (void) data;
301}
302
297#endif /* HAVE_LANDLOCK */ 303#endif /* HAVE_LANDLOCK */
diff --git a/src/firejail/profile.c b/src/firejail/profile.c
index 4e0b17a8c..62767f8dc 100644
--- a/src/firejail/profile.c
+++ b/src/firejail/profile.c
@@ -1073,7 +1073,9 @@ int profile_check_line(char *ptr, int lineno, const char *fname) {
1073 return 0; 1073 return 0;
1074 } 1074 }
1075 1075
1076#ifdef HAVE_LANDLOCK 1076//#ifdef HAVE_LANDLOCK
1077// landlock_connon.inc included by derfault in landlock.profile
1078// all landlcok functions are empty in case landlock is not available in the kernel
1077 if (strncmp(ptr, "landlock.enforce", 16) == 0) { 1079 if (strncmp(ptr, "landlock.enforce", 16) == 0) {
1078 arg_landlock_enforce = 1; 1080 arg_landlock_enforce = 1;
1079 return 0; 1081 return 0;
@@ -1098,7 +1100,7 @@ int profile_check_line(char *ptr, int lineno, const char *fname) {
1098 ll_add_profile(LL_FS_EXEC, ptr + 20); 1100 ll_add_profile(LL_FS_EXEC, ptr + 20);
1099 return 0; 1101 return 0;
1100 } 1102 }
1101#endif 1103//#endif
1102 1104
1103 // memory deny write&execute 1105 // memory deny write&execute
1104 if (strcmp(ptr, "memory-deny-write-execute") == 0) { 1106 if (strcmp(ptr, "memory-deny-write-execute") == 0) {