mirror of
https://github.com/NixOS/nix.git
synced 2024-11-29 18:22:27 +00:00
Don't use [[noreturn]]
This commit is contained in:
parent
3c4c30eadd
commit
89a2a11d9f
@ -337,10 +337,6 @@ Path EvalState::checkSourcePath(const Path & path_)
|
||||
{
|
||||
if (!allowedPaths) return path_;
|
||||
|
||||
auto doThrow = [&]() [[noreturn]] {
|
||||
throw RestrictedPathError("access to path '%1%' is forbidden in restricted mode", path_);
|
||||
};
|
||||
|
||||
bool found = false;
|
||||
|
||||
for (auto & i : *allowedPaths) {
|
||||
@ -350,7 +346,8 @@ Path EvalState::checkSourcePath(const Path & path_)
|
||||
}
|
||||
}
|
||||
|
||||
if (!found) doThrow();
|
||||
if (!found)
|
||||
throw RestrictedPathError("access to path '%1%' is forbidden in restricted mode", path_);
|
||||
|
||||
/* Resolve symlinks. */
|
||||
debug(format("checking access to '%s'") % path_);
|
||||
@ -361,7 +358,7 @@ Path EvalState::checkSourcePath(const Path & path_)
|
||||
return path;
|
||||
}
|
||||
|
||||
doThrow();
|
||||
throw RestrictedPathError("access to path '%1%' is forbidden in restricted mode", path);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user