landlock fix for old kernel versions

This commit is contained in:
netblue30 2024-04-06 23:16:10 -04:00
parent 04c458c4d1
commit 8259f66e1f
2 changed files with 10 additions and 2 deletions

View file

@ -294,4 +294,10 @@ void ll_add_profile(int type, const char *data) {
ptr->next = entry;
}
#else
void ll_add_profile(int type, const char *data) {
(void) type;
(void) data;
}
#endif /* HAVE_LANDLOCK */

View file

@ -1073,7 +1073,9 @@ int profile_check_line(char *ptr, int lineno, const char *fname) {
return 0;
}
#ifdef HAVE_LANDLOCK
//#ifdef HAVE_LANDLOCK
// landlock_connon.inc included by derfault in landlock.profile
// all landlcok functions are empty in case landlock is not available in the kernel
if (strncmp(ptr, "landlock.enforce", 16) == 0) {
arg_landlock_enforce = 1;
return 0;
@ -1098,7 +1100,7 @@ int profile_check_line(char *ptr, int lineno, const char *fname) {
ll_add_profile(LL_FS_EXEC, ptr + 20);
return 0;
}
#endif
//#endif
// memory deny write&execute
if (strcmp(ptr, "memory-deny-write-execute") == 0) {