From b4d8f8b8e21021eb72bc84476387c13543a983cd Mon Sep 17 00:00:00 2001 From: Tuomas Tynkkynen Date: Sun, 16 Oct 2016 23:37:48 +0300 Subject: [PATCH] bind: Disable seccomp on non-x86 The list of permitted syscalls in the seccomp sandbox is only defined for x86. It fails to build otherwise: ```` In file included from /tmp/nix-build-bind-9.10.4-P3.drv-0/bind-9.10.4-P3/lib/isc/include/isc/magic.h:23:0, from /tmp/nix-build-bind-9.10.4-P3.drv-0/bind-9.10.4-P3/lib/isc/include/isc/app.h:89, from ./main.c:26: ./main.c: In function 'setup_seccomp': ./main.c:848:17: error: 'scmp_syscalls' undeclared (first use in this function) INSIST((sizeof(scmp_syscalls) / sizeof(int)) == ```` --- pkgs/servers/dns/bind/default.nix | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkgs/servers/dns/bind/default.nix b/pkgs/servers/dns/bind/default.nix index e55b3eeb18b..810fabb253f 100644 --- a/pkgs/servers/dns/bind/default.nix +++ b/pkgs/servers/dns/bind/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, openssl, libtool, perl, libxml2 +{ stdenv, lib, fetchurl, openssl, libtool, perl, libxml2 , libseccomp ? null }: let version = "9.10.4-P3"; in @@ -33,8 +33,7 @@ stdenv.mkDerivation rec { "--without-pkcs11" "--without-purify" "--without-python" - "--enable-seccomp" - ]; + ] ++ lib.optional (stdenv.isi686 || stdenv.isx86_64) "--enable-seccomp"; postInstall = '' moveToOutput bin/bind9-config $dev