libstore: move setupSyscallFilter to linux platform bits

setting them that little bit later really doesn't hurt us at all.

Change-Id: I6b50fbe0b58d037de729748cb4f87dd628bd111b
This commit is contained in:
eldritch horrors
2026-01-21 15:59:30 +01:00
parent 95c65ce637
commit 5ba9a3961c
4 changed files with 3 additions and 9 deletions
@@ -1127,8 +1127,6 @@ void LocalDerivationGoal::runChild()
commonExecveingChildInit();
setupSyscallFilter();
/* Make the contents of netrc and the CA certificate bundle
available to builtin:fetchurl (which may run under a
different uid and/or in a sandbox). */
@@ -316,12 +316,6 @@ protected:
kj::Promise<Result<WorkResult>> handleRawChild() noexcept;
kj::Promise<Result<std::optional<WorkResult>>> handleRawChildStream() noexcept;
/**
* Set up the system call filtering required for the sandbox.
* This currently only has an effect on Linux.
*/
virtual void setupSyscallFilter() {}
/**
* Prepare the sandbox. Currently only used on linux to build the sandbox namespace,
* write configuration files inside it, and to set up networking with pasta enabled.
+2
View File
@@ -907,6 +907,8 @@ std::string LinuxLocalDerivationGoal::rewriteResolvConf(std::string fromHost)
bool LinuxLocalDerivationGoal::prepareChildSetup()
{
setupSyscallFilter();
if (!useChroot) {
return true;
}
+1 -1
View File
@@ -84,7 +84,7 @@ private:
* Set up system call filtering using seccomp, unless disabled at build time.
* This also sets the NO_NEW_PRIVS flag.
*/
void setupSyscallFilter() override;
void setupSyscallFilter();
bool supportsUidRange() override
{