[PATCH v2 1/3] man/man7/landlock.7: Adapt compatibility in code example to ABI v8
Günther Noack <[email protected]>
| Newsgroups | org.kernel.vger.linux-man |
|---|---|
| Message-ID | <[email protected]> |
* Bring the code example up to speed with Landlock ABI v8 * Use the correct ABI level in the MIN() macro Signed-off-by: Günther Noack <[email protected]> --- man/man7/landlock.7 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/man/man7/landlock.7 b/man/man7/landlock.7 index 06910ccab5b1..0e3a11489af2 100644 --- a/man/man7/landlock.7 +++ b/man/man7/landlock.7 @@ -583,6 +583,9 @@ __u64 landlock_fs_access_rights[] = { (LANDLOCK_ACCESS_FS_TRUNCATE << 1) \- 1, /* v3: add "truncate" */ (LANDLOCK_ACCESS_FS_TRUNCATE << 1) \- 1, /* v4: TCP support */ (LANDLOCK_ACCESS_FS_IOCTL_DEV << 1) \- 1, /* v5: add "ioctl_dev" */ + (LANDLOCK_ACCESS_FS_IOCTL_DEV << 1) \- 1, /* v6: same */ + (LANDLOCK_ACCESS_FS_IOCTL_DEV << 1) \- 1, /* v7: same */ + (LANDLOCK_ACCESS_FS_IOCTL_DEV << 1) \- 1, /* v8: same */ }; \& int abi = landlock_create_ruleset(NULL, 0, @@ -595,7 +598,7 @@ if (abi == \-1) { perror("Unable to use Landlock"); return; /* Graceful fallback: Do nothing. */ } -abi = MIN(abi, 3); +abi = MIN(abi, 8); \& /* Only use the available rights in the ruleset. */ attr.handled_access_fs &= landlock_fs_access_rights[abi \- 1]; -- 2.54.0