Skip to content

Commit 4b521f1

Browse files
L-asEricson2314
authored andcommitted
Remove privateNetwork variable from local drv goal
Can just inline its definition, it was immutable.
1 parent 87824bc commit 4b521f1

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

src/libstore/unix/build/local-derivation-goal.cc

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1032,9 +1032,6 @@ void LocalDerivationGoal::startBuilder()
10321032
us.
10331033
*/
10341034

1035-
if (derivationType->isSandboxed())
1036-
privateNetwork = true;
1037-
10381035
userNamespaceSync.create();
10391036

10401037
usingUserNamespace = userNamespacesSupported();
@@ -1062,7 +1059,7 @@ void LocalDerivationGoal::startBuilder()
10621059

10631060
ProcessOptions options;
10641061
options.cloneFlags = CLONE_NEWPID | CLONE_NEWNS | CLONE_NEWIPC | CLONE_NEWUTS | CLONE_PARENT | SIGCHLD;
1065-
if (privateNetwork)
1062+
if (derivationType->isSandboxed())
10661063
options.cloneFlags |= CLONE_NEWNET;
10671064
if (usingUserNamespace)
10681065
options.cloneFlags |= CLONE_NEWUSER;
@@ -1879,7 +1876,7 @@ void LocalDerivationGoal::runChild()
18791876

18801877
userNamespaceSync.readSide = -1;
18811878

1882-
if (privateNetwork) {
1879+
if (derivationType->isSandboxed()) {
18831880

18841881
/* Initialise the loopback interface. */
18851882
AutoCloseFD fd(socket(PF_INET, SOCK_DGRAM, IPPROTO_IP));

src/libstore/unix/build/local-derivation-goal.hh

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,6 @@ struct LocalDerivationGoal : public DerivationGoal
8888
*/
8989
std::shared_ptr<AutoDelete> autoDelChroot;
9090

91-
/**
92-
* Whether to run the build in a private network namespace.
93-
*/
94-
bool privateNetwork = false;
95-
9691
/**
9792
* Stuff we need to pass to initChild().
9893
*/

0 commit comments

Comments
 (0)