fix: fail closed on authorization setup failure
CI / lint (pull_request) Successful in 30s
CI / sanitizers (address) (pull_request) Successful in 36s
CI / sanitizers (undefined) (pull_request) Successful in 35s
CI / fuzz-build (pull_request) Successful in 15s
CI / coverage (pull_request) Successful in 31s
CI / build-and-test (pull_request) Successful in 1m15s
CI / valgrind (pull_request) Successful in 33s

This commit is contained in:
2026-08-15 20:01:57 +02:00
parent d3b4c62f51
commit 7cffff0b8b
5 changed files with 18 additions and 8 deletions
+7 -1
View File
@@ -38,7 +38,13 @@ static bool __attribute__((unused)) configure_authorization(const char* root) {
authorized_root = NULL;
return false;
}
file_set_authorized_root(authorized_root_fd, authorized_root);
if (!file_set_authorized_root(authorized_root_fd, authorized_root)) {
close(authorized_root_fd);
authorized_root_fd = -1;
free(authorized_root);
authorized_root = NULL;
return false;
}
utils_set_authorized_root_fd(authorized_root_fd);
return true;
}