mirror of
https://git.sr.ht/~cismonx/bookmarkfs
synced 2025-06-07 19:58:50 +00:00
sandbox: workaround legacy landlock
So that they can build with kernel headers older than 6.2, and still work as expected on newer kernels.
This commit is contained in:
parent
5c244c4ef5
commit
bf9e0e7f92
1 changed files with 6 additions and 0 deletions
|
@ -278,6 +278,12 @@ sandbox_enter (
|
|||
goto free_sfctx;
|
||||
}
|
||||
|
||||
#ifndef LANDLOCK_ACCESS_FS_REFER // Available since Linux 5.19
|
||||
#define LANDLOCK_ACCESS_FS_REFER ( UINT64_C(1) << 13 )
|
||||
#endif
|
||||
#ifndef LANDLOCK_ACCESS_FS_TRUNCATE // Available since Linux 6.2
|
||||
#define LANDLOCK_ACCESS_FS_TRUNCATE ( UINT64_C(1) << 14 )
|
||||
#endif
|
||||
#define LANDLOCK_FS_RIGHT_NAME_(name) LANDLOCK_ACCESS_FS_##name
|
||||
#define LANDLOCK_FS_RIGHT(...) \
|
||||
BITWISE_OR(LANDLOCK_FS_RIGHT_NAME_, __VA_ARGS__)
|
||||
|
|
Loading…
Add table
Reference in a new issue