Tidy up landlock check
This test was flagged as ambiguous by clang. Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
cc0292a1ad
commit
95e71ce52b
1 changed files with 3 additions and 3 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue