Skip to content

Commit

Permalink
Don’t rely on EPERM
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
matthewbauer committed Jul 30, 2019
1 parent 11d8534 commit 9a0855b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libstore/build.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2320,15 +2320,15 @@ void DerivationGoal::startBuilder()
parent. This is only done when sandbox-fallback is set
to true (the default). */
if (child == -1 && (errno == EPERM || errno == EINVAL) && settings.sandboxFallback)
_exit(EPERM);
_exit(1);
if (child == -1) throw SysError("cloning builder process");

writeFull(builderOut.writeSide.get(), std::to_string(child) + "\n");
_exit(0);
}, options);

int res = helper.wait();
if (res == EPERM && settings.sandboxFallback) {
if (res != 0 && settings.sandboxFallback) {
useChroot = false;
goto fallback;
} else if (res != 0)
Expand Down

0 comments on commit 9a0855b

Please sign in to comment.