diff --git a/pkgs/applications/editors/vim/common.nix b/pkgs/applications/editors/vim/common.nix index e0ac32c54ec5..6c5a21be40f6 100644 --- a/pkgs/applications/editors/vim/common.nix +++ b/pkgs/applications/editors/vim/common.nix @@ -13,6 +13,12 @@ rec { hardeningDisable = [ "fortify" ]; + patches = [ + # Arbitrary code execution fix + # https://github.com/numirias/security/blob/cf4f74e0c6c6e4bbd6b59823aa1b85fa913e26eb/doc/2019-06-04_ace-vim-neovim.md + ./0001-source-command-doesnt-check-for-the-sandbox-5357552.patch + ]; + postPatch = # Use man from $PATH; escape sequences are still problematic. '' diff --git a/pkgs/applications/editors/vim/configurable.nix b/pkgs/applications/editors/vim/configurable.nix index 3b75d08787e8..64930cb2b0e0 100644 --- a/pkgs/applications/editors/vim/configurable.nix +++ b/pkgs/applications/editors/vim/configurable.nix @@ -76,7 +76,9 @@ in stdenv.mkDerivation rec { "default" = common.src; # latest release }; - patches = [ ./cflags-prune.diff ] ++ stdenv.lib.optional ftNixSupport ./ft-nix-support.patch; + patches = common.patches or [] + ++ [ ./cflags-prune.diff ] + ++ stdenv.lib.optional ftNixSupport ./ft-nix-support.patch; configureFlags = [ "--enable-gui=${guiSupport}" diff --git a/pkgs/applications/editors/vim/default.nix b/pkgs/applications/editors/vim/default.nix index 6378bc7c7dc2..b448c7057f94 100644 --- a/pkgs/applications/editors/vim/default.nix +++ b/pkgs/applications/editors/vim/default.nix @@ -15,7 +15,7 @@ in stdenv.mkDerivation rec { name = "vim-${version}"; - inherit (common) version src postPatch hardeningDisable enableParallelBuilding meta; + inherit (common) version src patches postPatch hardeningDisable enableParallelBuilding meta; nativeBuildInputs = [ gettext pkgconfig ]; buildInputs = [ ncurses ] @@ -25,12 +25,6 @@ stdenv.mkDerivation rec { cf-private ]; - patches = [ - # Arbitrary code execution fix - # https://github.com/numirias/security/blob/cf4f74e0c6c6e4bbd6b59823aa1b85fa913e26eb/doc/2019-06-04_ace-vim-neovim.md - ./0001-source-command-doesnt-check-for-the-sandbox-5357552.patch - ]; - configureFlags = [ "--enable-multibyte" "--enable-nls"