Message ID | 1380997489-21879-3-git-send-email-jabk@prevas.dk |
---|---|
State | Accepted |
Delegated to: | Esben Haabendal |
Headers | show |
jabk@prevas.dk writes: > From: Jacob Kjaergaard <jacob@barsoekjaergaard.dk> > > --- > recipes/gnutls/gnutls.inc | 5 +-- > .../gets-no-longer-existin-e-glibc-2.16.patch | 34 ++++++++++++++++++++ > 2 files changed, 37 insertions(+), 2 deletions(-) > create mode 100644 recipes/gnutls/gnutls/gets-no-longer-existin-e-glibc-2.16.patch > > diff --git a/recipes/gnutls/gnutls.inc b/recipes/gnutls/gnutls.inc > index 1a78472..207cbda 100644 > --- a/recipes/gnutls/gnutls.inc > +++ b/recipes/gnutls/gnutls.inc > @@ -2,7 +2,7 @@ DESCRIPTION = "GNU Transport Layer Security Library" > HOMEPAGE = "http://www.gnu.org/software/gnutls/" > BUGTRACKER = "https://savannah.gnu.org/support/?group=gnutls" > > -inherit c++ autotools-autoreconf binconfig pkgconfig gettext > +inherit c++ autotools binconfig pkgconfig gettext > > DEPENDS += "libz liblzo libtasn1 libgcrypt libreadline" > DEPENDS_${PN} += "libz liblzo libtasn1 libgcrypt libreadline" > @@ -10,7 +10,8 @@ RDEPENDS_${PN} += "gnutls-extra liblzo libtasn1" > > require conf/fetch/gnu.conf > > -SRC_URI = "${GNU_MIRROR}/gnutls/gnutls-${PV}.tar.bz2" > +SRC_URI = "${GNU_MIRROR}/gnutls/gnutls-${PV}.tar.bz2 \ > + file://gets-no-longer-existin-e-glibc-2.16.patch" > > EXTRA_OECONF="--with-included-opencdk --with-included-libcfg --disable-rpath \ > --with-libtasn1-prefix=${HOST_SYSROOT} \ > diff --git a/recipes/gnutls/gnutls/gets-no-longer-existin-e-glibc-2.16.patch b/recipes/gnutls/gnutls/gets-no-longer-existin-e-glibc-2.16.patch > new file mode 100644 > index 0000000..db86b7d > --- /dev/null > +++ b/recipes/gnutls/gnutls/gets-no-longer-existin-e-glibc-2.16.patch > @@ -0,0 +1,34 @@ > +diff --git a/gl/stdio.in.h b/gl/stdio.in.h > +index 9dc7c4a..8cb19d7 100644 > +--- a/gl/stdio.in.h > ++++ b/gl/stdio.in.h > +@@ -710,9 +710,11 @@ _GL_CXXALIAS_RPL (gets, char *, (char *s)); > + _GL_CXXALIAS_SYS (gets, char *, (char *s)); > + # undef gets > + # endif > ++# if defined gets > + _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. */ > + _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead"); > ++# endif > + #endif > + > + > +diff --git a/lib/gl/stdio.in.h b/lib/gl/stdio.in.h > +index 03bea2a..cb6483b 100644 > +--- a/lib/gl/stdio.in.h > ++++ b/lib/gl/stdio.in.h > +@@ -710,9 +710,11 @@ _GL_CXXALIAS_RPL (gets, char *, (char *s)); > + _GL_CXXALIAS_SYS (gets, char *, (char *s)); > + # undef gets > + # endif > ++# if defined gets > + _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. */ > + _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead"); > ++# endif > + #endif Is this safe/good to use, also for other glibc versions, which does have gets? /Esben
Jacob Barsøe Kjærgaard <jacob.kjaergaard@prevas.dk> writes: > On 10/15/2013 01:55 PM, Esben Haabendal wrote: >> Is this safe/good to use, also for other glibc versions, which does have >> gets? > > Yes, I consider this patch harmless. It simply removes the warning if > gets is undefined. > > If gets is defined as in older glibc versions it will still provide > the warning. > > As a note I have fixed other recipes to build against eglibc 2.16 in the same > way e.g. > meta/base 07bd68badf57b1429c7e66c001a8c435dc35e29f Ok. Merged to master. /Esben
diff --git a/recipes/gnutls/gnutls.inc b/recipes/gnutls/gnutls.inc index 1a78472..207cbda 100644 --- a/recipes/gnutls/gnutls.inc +++ b/recipes/gnutls/gnutls.inc @@ -2,7 +2,7 @@ DESCRIPTION = "GNU Transport Layer Security Library" HOMEPAGE = "http://www.gnu.org/software/gnutls/" BUGTRACKER = "https://savannah.gnu.org/support/?group=gnutls" -inherit c++ autotools-autoreconf binconfig pkgconfig gettext +inherit c++ autotools binconfig pkgconfig gettext DEPENDS += "libz liblzo libtasn1 libgcrypt libreadline" DEPENDS_${PN} += "libz liblzo libtasn1 libgcrypt libreadline" @@ -10,7 +10,8 @@ RDEPENDS_${PN} += "gnutls-extra liblzo libtasn1" require conf/fetch/gnu.conf -SRC_URI = "${GNU_MIRROR}/gnutls/gnutls-${PV}.tar.bz2" +SRC_URI = "${GNU_MIRROR}/gnutls/gnutls-${PV}.tar.bz2 \ + file://gets-no-longer-existin-e-glibc-2.16.patch" EXTRA_OECONF="--with-included-opencdk --with-included-libcfg --disable-rpath \ --with-libtasn1-prefix=${HOST_SYSROOT} \ diff --git a/recipes/gnutls/gnutls/gets-no-longer-existin-e-glibc-2.16.patch b/recipes/gnutls/gnutls/gets-no-longer-existin-e-glibc-2.16.patch new file mode 100644 index 0000000..db86b7d --- /dev/null +++ b/recipes/gnutls/gnutls/gets-no-longer-existin-e-glibc-2.16.patch @@ -0,0 +1,34 @@ +diff --git a/gl/stdio.in.h b/gl/stdio.in.h +index 9dc7c4a..8cb19d7 100644 +--- a/gl/stdio.in.h ++++ b/gl/stdio.in.h +@@ -710,9 +710,11 @@ _GL_CXXALIAS_RPL (gets, char *, (char *s)); + _GL_CXXALIAS_SYS (gets, char *, (char *s)); + # undef gets + # endif ++# if defined gets + _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. */ + _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead"); ++# endif + #endif + + +diff --git a/lib/gl/stdio.in.h b/lib/gl/stdio.in.h +index 03bea2a..cb6483b 100644 +--- a/lib/gl/stdio.in.h ++++ b/lib/gl/stdio.in.h +@@ -710,9 +710,11 @@ _GL_CXXALIAS_RPL (gets, char *, (char *s)); + _GL_CXXALIAS_SYS (gets, char *, (char *s)); + # undef gets + # endif ++# if defined gets + _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. */ + _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead"); ++# endif + #endif
From: Jacob Kjaergaard <jacob@barsoekjaergaard.dk> --- recipes/gnutls/gnutls.inc | 5 +-- .../gets-no-longer-existin-e-glibc-2.16.patch | 34 ++++++++++++++++++++ 2 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 recipes/gnutls/gnutls/gets-no-longer-existin-e-glibc-2.16.patch