From 4718d430ccd282bf1e2ab6ea582c0510d7485e0a Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 28 Jan 2013 14:26:31 +0100 Subject: [PATCH] mailutils: Fix build http://hydra.nixos.org/build/3875816 --- pkgs/tools/networking/mailutils/default.nix | 2 +- pkgs/tools/networking/mailutils/no-gets.patch | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 pkgs/tools/networking/mailutils/no-gets.patch diff --git a/pkgs/tools/networking/mailutils/default.nix b/pkgs/tools/networking/mailutils/default.nix index 43293b795782..3a84516cd370 100644 --- a/pkgs/tools/networking/mailutils/default.nix +++ b/pkgs/tools/networking/mailutils/default.nix @@ -11,7 +11,7 @@ stdenv.mkDerivation rec { sha256 = "0szbqa12zqzldqyw97lxqax3ja2adis83i7brdfsxmrfw68iaf65"; }; - patches = [ ./path-to-cat.patch ]; + patches = [ ./path-to-cat.patch ./no-gets.patch ]; buildInputs = [ gettext gdbm libtool pam readline ncurses diff --git a/pkgs/tools/networking/mailutils/no-gets.patch b/pkgs/tools/networking/mailutils/no-gets.patch new file mode 100644 index 000000000000..d72fa3f056cc --- /dev/null +++ b/pkgs/tools/networking/mailutils/no-gets.patch @@ -0,0 +1,14 @@ +--- a/lib/stdio.in.h ++++ b/lib/stdio.in.h +@@ -138,8 +138,10 @@ + /* It is very rare that the developer ever has full control of stdin, + so any use of gets warrants an unconditional warning. Assume it is + always declared, since it is required by C89. */ +-#undef gets ++#ifdef gets ++# undef gets + _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead"); ++#endif + + #if @GNULIB_FOPEN@ + # if @REPLACE_FOPEN@