diff options
author | Michał Masłowski <mtjm@mtjm.eu> | 2012-10-21 23:56:44 +0200 |
---|---|---|
committer | Michał Masłowski <mtjm@mtjm.eu> | 2012-10-21 23:56:44 +0200 |
commit | 7e9d319e9575e68d86463b792425fcdba0f195d2 (patch) | |
tree | 8cd47511f55275a65d61b9fb0ed9d84d23bc09f6 /core/diffutils | |
parent | 02de600478bc393832a0707be7ea4b6c304d9e02 (diff) |
Fix the gnulib gets error with glibc 2.16 in core packages.
Diffstat (limited to 'core/diffutils')
-rw-r--r-- | core/diffutils/PKGBUILD | 8 | ||||
-rw-r--r-- | core/diffutils/gnulib-no-gets.patch | 44 |
2 files changed, 50 insertions, 2 deletions
diff --git a/core/diffutils/PKGBUILD b/core/diffutils/PKGBUILD index 9108c4999..5d1dbc730 100644 --- a/core/diffutils/PKGBUILD +++ b/core/diffutils/PKGBUILD @@ -12,11 +12,15 @@ license=('GPL3') groups=('base') depends=('glibc' 'sh') install=diffutils.install -source=(ftp://ftp.gnu.org/gnu/${pkgname}/${pkgname}-${pkgver}.tar.xz) -md5sums=('26ff64c332429c830c154be46b393382') +source=(ftp://ftp.gnu.org/gnu/${pkgname}/${pkgname}-${pkgver}.tar.xz + gnulib-no-gets.patch) +md5sums=('26ff64c332429c830c154be46b393382' + '97b8845dad2ca6017fc4ef54f0a4562b') build() { cd ${srcdir}/${pkgname}-${pkgver} + # Based on commit 66712c23388e93e5c518ebc8515140fa0c807348 from gnulib. + patch -p1 -i "$srcdir/gnulib-no-gets.patch" ./configure --prefix=/usr make } diff --git a/core/diffutils/gnulib-no-gets.patch b/core/diffutils/gnulib-no-gets.patch new file mode 100644 index 000000000..435c3bfb9 --- /dev/null +++ b/core/diffutils/gnulib-no-gets.patch @@ -0,0 +1,44 @@ +diff --git a/lib/stdio.in.h b/lib/stdio.in.h +index aa7b599..c377b6e 100644 +--- a/lib/stdio.in.h ++++ b/lib/stdio.in.h +@@ -698,22 +698,11 @@ _GL_WARN_ON_USE (getline, "getline is unportable - " + # endif + #endif + +-#if @GNULIB_GETS@ +-# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@ +-# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +-# undef gets +-# define gets rpl_gets +-# endif +-_GL_FUNCDECL_RPL (gets, char *, (char *s) _GL_ARG_NONNULL ((1))); +-_GL_CXXALIAS_RPL (gets, char *, (char *s)); +-# else +-_GL_CXXALIAS_SYS (gets, char *, (char *s)); +-# undef gets +-# endif +-_GL_CXXALIASWARN (gets); + /* 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. */ ++ so any use of gets warrants an unconditional warning; besides, C11 ++ removed it. */ ++#undef gets ++#if HAVE_RAW_DECL_GETS + _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead"); + #endif + +@@ -1053,9 +1042,9 @@ _GL_WARN_ON_USE (snprintf, "snprintf is unportable - " + # endif + #endif + +-/* Some people would argue that sprintf should be handled like gets +- (for example, OpenBSD issues a link warning for both functions), +- since both can cause security holes due to buffer overruns. ++/* Some people would argue that all sprintf uses should be warned about ++ (for example, OpenBSD issues a link warning for it), ++ since it can cause security holes due to buffer overruns. + However, we believe that sprintf can be used safely, and is more + efficient than snprintf in those safe cases; and as proof of our + belief, we use sprintf in several gnulib modules. So this header |