push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,61 @@
{
lib,
stdenv,
fetchFromGitHub,
asciidoc,
libcap,
pkg-config,
systemdLibs,
installShellFiles,
nixosTests,
}:
stdenv.mkDerivation rec {
pname = "isolate";
version = "2.2";
src = fetchFromGitHub {
owner = "ioi";
repo = "isolate";
rev = "v${version}";
hash = "sha256-AacKIRS/Ah1KoE+bz+lK2GPbS3F3ifBGXvvCFWMd7hs=";
};
nativeBuildInputs = [
asciidoc
installShellFiles
pkg-config
];
buildInputs = [
libcap.dev
systemdLibs.dev
];
patches = [
./take-config-file-from-env.patch
];
installPhase = ''
runHook preInstall
install -Dm755 ./isolate $out/bin/isolate
install -Dm755 ./isolate-cg-keeper $out/bin/isolate-cg-keeper
install -Dm755 ./isolate-check-environment $out/bin/isolate-check-environment
installManPage isolate.1
runHook postInstall
'';
passthru.tests = {
isolate = nixosTests.isolate;
};
meta = {
description = "Sandbox for securely executing untrusted programs";
mainProgram = "isolate";
homepage = "https://github.com/ioi/isolate";
license = lib.licenses.gpl2Plus;
maintainers = with lib.maintainers; [ virchau13 ];
};
}

View File

@@ -0,0 +1,19 @@
diff --git a/config.c b/config.c
index 6477259..c462ed3 100644
--- a/config.c
+++ b/config.c
@@ -114,9 +114,12 @@ cf_check(void)
void
cf_parse(void)
{
- FILE *f = fopen(CONFIG_FILE, "r");
+ char *config_file = getenv("ISOLATE_CONFIG_FILE");
+ if(!config_file)
+ die("ISOLATE_CONFIG_FILE environment variable not set");
+ FILE *f = fopen(config_file, "r");
if (!f)
- die("Cannot open %s: %m", CONFIG_FILE);
+ die("Cannot open %s: %m", config_file);
char line[MAX_LINE_LEN];
while (fgets(line, sizeof(line), f))