From 8cdcda6c9760e2e6a1a5aa14585645b3d200c0ae Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Wed, 23 Mar 2022 07:42:30 +0000 Subject: [PATCH] audit: fix build for linux-headers-5.17 Without the change build fails as: audit_wrap.c:5010:15: error: invalid use of flexible array member 5010 | arg1->buf = (char [])(char *)memcpy(malloc((size)*sizeof(char)), (const char *)(arg2), sizeof(char)*(size)); | ^ --- pkgs/os-specific/linux/audit/default.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/os-specific/linux/audit/default.nix b/pkgs/os-specific/linux/audit/default.nix index e9762f44dcdc..6d14a3293fca 100644 --- a/pkgs/os-specific/linux/audit/default.nix +++ b/pkgs/os-specific/linux/audit/default.nix @@ -69,6 +69,13 @@ stdenv.mkDerivation rec { sha256 = "0qjq41ridyamajz9v9nyplgq7f8nn3fxw375s9sa5a0igsrx9pm0"; excludes = [ "ChangeLog" ]; }) + # Fix pending upstream inclusion for linux-headers-5.17 support: + # https://github.com/linux-audit/audit-userspace/pull/253 + (fetchpatch { + name = "ignore-flexible-array.patch"; + url = "https://github.com/linux-audit/audit-userspace/commit/beed138222421a2eb4212d83cb889404bd7efc49.patch"; + sha256 = "1hf02zaxv6x0wmn4ca9fj48y2shks7vfna43i1zz58xw9jq7sza0"; + }) ]; postPatch = ''