aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2022-11-17 11:56:45 +0100
committerEelco Dolstra <edolstra@gmail.com>2022-11-17 11:56:45 +0100
commitf423d4425f6573206045e9626812002906d9493d (patch)
treefd008f1bb66e2994caff6e18e7714ad0660c1a80
parent6c6eff8ac40e2f5d7b6ff8e772feebb1aa484039 (diff)
Fix segfault in unprivileged mode
-rw-r--r--src/libstore/build/local-derivation-goal.hh4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libstore/build/local-derivation-goal.hh b/src/libstore/build/local-derivation-goal.hh
index 070ae53f3..f92280aa1 100644
--- a/src/libstore/build/local-derivation-goal.hh
+++ b/src/libstore/build/local-derivation-goal.hh
@@ -92,8 +92,8 @@ struct LocalDerivationGoal : public DerivationGoal
result. */
std::map<Path, ValidPathInfo> prevInfos;
- uid_t sandboxUid() { return usingUserNamespace ? (buildUser->getUIDCount() == 1 ? 1000 : 0) : buildUser->getUID(); }
- gid_t sandboxGid() { return usingUserNamespace ? (buildUser->getUIDCount() == 1 ? 100 : 0) : buildUser->getGID(); }
+ uid_t sandboxUid() { return usingUserNamespace ? (!buildUser || buildUser->getUIDCount() == 1 ? 1000 : 0) : buildUser->getUID(); }
+ gid_t sandboxGid() { return usingUserNamespace ? (!buildUser || buildUser->getUIDCount() == 1 ? 100 : 0) : buildUser->getGID(); }
const static Path homeDir;