diff --git a/pkgs/by-name/ld/ldb/package.nix b/pkgs/by-name/ld/ldb/package.nix index 04d9e7d645bd..45e3f142befb 100644 --- a/pkgs/by-name/ld/ldb/package.nix +++ b/pkgs/by-name/ld/ldb/package.nix @@ -17,6 +17,7 @@ buildPackages, libxcrypt, testers, + fetchpatch, }: stdenv.mkDerivation (finalAttrs: { @@ -33,6 +34,16 @@ stdenv.mkDerivation (finalAttrs: { "dev" ]; + patches = [ + # Fix rep_memset_s calling C23 memset_explicit with wrong arg count (4 instead of 3). + # Upstream samba commit 04e0fb9b2d; later reworked more broadly in ef08be24e9 and 3e81b73a05 + # which replace memset_s with memset_explicit entirely, but those don't apply to ldb 2.9.2. + (fetchpatch { + url = "https://gitlab.com/samba-team/samba/-/commit/04e0fb9b2d1d87516f1331096c78e8355b4fa9f3.patch"; + hash = "sha256-sBqtVwGBXseCAMlv3QaiSYQmOw7H4cAJwc0Ey5yD6Os="; + }) + ]; + nativeBuildInputs = [ pkg-config python3