vinix-ports / vpac / vinix-landlock.patch
15 lines · 15 sloc · 715 bytes · f9395a626df08e4415c502ecd90b5e23be75f9d2
Raw
1--- a/engine/sandbox_restrictions.v
2+++ b/engine/sandbox_restrictions.v
3@@ -118,6 +118,12 @@
4 abi := C.v_alpm_landlock_abi()
5 if abi < 0 {
6+ // Vinix has no Landlock syscall. The caller still sets no-new-privs
7+ // and seccomp and drops privileges before it starts the transfer.
8+ if C.errno == C.ENOSYS && os.uname().sysname == 'Vinix' {
9+ handle.log(.debug, 'Landlock is unavailable on this Vinix kernel\n')
10+ return 0
11+ }
12 problem := os.last_error().msg()
13 handle.log(.error, localized_message('restricting filesystem access failed because Landlock is not supported by the kernel!\n'))
14 return AlpmError{ kind: .retrieve_prepare, detail: 'Landlock is not supported: ${problem}' }
15 }
16