mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-22 14:06:16 +02:00
Don’t rely on EPERM
startProcess does not appear to send the exit code to the helper correctly. Not sure why this is, but it is probably safe to just fallback on all sandbox errors.
This commit is contained in:
parent
11d8534629
commit
9a0855bbb6
1 changed files with 2 additions and 2 deletions
|
@ -2320,7 +2320,7 @@ void DerivationGoal::startBuilder()
|
||||||
parent. This is only done when sandbox-fallback is set
|
parent. This is only done when sandbox-fallback is set
|
||||||
to true (the default). */
|
to true (the default). */
|
||||||
if (child == -1 && (errno == EPERM || errno == EINVAL) && settings.sandboxFallback)
|
if (child == -1 && (errno == EPERM || errno == EINVAL) && settings.sandboxFallback)
|
||||||
_exit(EPERM);
|
_exit(1);
|
||||||
if (child == -1) throw SysError("cloning builder process");
|
if (child == -1) throw SysError("cloning builder process");
|
||||||
|
|
||||||
writeFull(builderOut.writeSide.get(), std::to_string(child) + "\n");
|
writeFull(builderOut.writeSide.get(), std::to_string(child) + "\n");
|
||||||
|
@ -2328,7 +2328,7 @@ void DerivationGoal::startBuilder()
|
||||||
}, options);
|
}, options);
|
||||||
|
|
||||||
int res = helper.wait();
|
int res = helper.wait();
|
||||||
if (res == EPERM && settings.sandboxFallback) {
|
if (res != 0 && settings.sandboxFallback) {
|
||||||
useChroot = false;
|
useChroot = false;
|
||||||
goto fallback;
|
goto fallback;
|
||||||
} else if (res != 0)
|
} else if (res != 0)
|
||||||
|
|
Loading…
Reference in a new issue