summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAllan McRae <allan@archlinux.org>2024-07-14 11:50:13 +1000
committerAllan McRae <allan@archlinux.org>2024-07-14 19:03:23 +1000
commit95e71ce52b4789a48aa01b510d0b20706b303d3f (patch)
treeb1dc0de3ffea59082919570470df863c43ec8b66
parentcc0292a1ad0ef4553f06442ec6a2368da9444008 (diff)
Tidy up landlock check
This test was flagged as ambiguous by clang. Signed-off-by: Allan McRae <allan@archlinux.org>
-rw-r--r--lib/libalpm/sandbox_fs.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libalpm/sandbox_fs.c b/lib/libalpm/sandbox_fs.c
index 3d7de013..c97f355e 100644
--- a/lib/libalpm/sandbox_fs.c
+++ b/lib/libalpm/sandbox_fs.c
@@ -150,10 +150,10 @@ bool _alpm_sandbox_fs_restrict_writes_to(alpm_handle_t *handle, const char *path
path_beneath.parent_fd = open(path, O_PATH | O_CLOEXEC | O_DIRECTORY);
path_beneath.allowed_access = _LANDLOCK_ACCESS_FS_READ | _LANDLOCK_ACCESS_FS_WRITE | _LANDLOCK_ACCESS_FS_TRUNCATE;
- if(!landlock_add_rule(ruleset_fd, LANDLOCK_RULE_PATH_BENEATH, &path_beneath, 0) != 0) {
+ if(landlock_add_rule(ruleset_fd, LANDLOCK_RULE_PATH_BENEATH, &path_beneath, 0) == 0) {
if(landlock_restrict_self(ruleset_fd, 0)) {
- _alpm_log(handle, ALPM_LOG_ERROR, _("restricting filesystem access failed because the landlock ruleset could not be applied!\n"));
- result = errno;
+ _alpm_log(handle, ALPM_LOG_ERROR, _("restricting filesystem access failed because the landlock ruleset could not be applied!\n"));
+ result = errno;
}
} else {
result = errno;