From 1fa637cb5b089cf708a807c497a76d5e72c71048 Mon Sep 17 00:00:00 2001 From: Dave Love Date: Jan 21 2019 13:13:36 +0000 Subject: - Patch to fix failure with gcc 9 --- diff --git a/procenv-strcpy.patch b/procenv-strcpy.patch new file mode 100644 index 0000000..70bb767 --- /dev/null +++ b/procenv-strcpy.patch @@ -0,0 +1,20 @@ +--- procenv-0.50/src/procenv.c~ 2017-10-16 18:35:19.000000000 +0100 ++++ procenv-0.50/src/procenv.c 2019-01-21 12:38:39.351979835 +0000 +@@ -4333,14 +4333,10 @@ + + l = strlen (str); + +- if (len < l) ++ if (len < l+1) + bug ("buffer too small"); + +- /* Ensure nul byte copied */ +- strncpy (buffer, str, l+1); +- +- /* Overwrite NL */ +- buffer[strlen (buffer)-1] = '\0'; ++ strcpy (buffer, str); + } + + char * + diff --git a/procenv.spec b/procenv.spec index 8dcf3b5..f2cc354 100644 --- a/procenv.spec +++ b/procenv.spec @@ -4,17 +4,19 @@ Name: procenv Version: 0.50 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Utility to show process environment License: GPLv3+ URL: https://github.com/jamesodhunt/procenv Source0: https://github.com/jamesodhunt/procenv/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz - +# Fix bad check which fails with gcc 9, but is harmless +# https://github.com/jamesodhunt/procenv/issues/7 +Patch1: procenv-strcpy.patch BuildRequires: expat, libcap-devel, libselinux-devel, check-devel, gcc # Only used for testing; not in EPEL. -%if 0%{?fedora} -BuildRequires: perl-JSON-PP +%if 0%{?fedora}%{?el8} +BuildRequires: perl(JSON::PP) %endif %ifnarch %{arm} s390 s390x BuildRequires: numactl-devel @@ -28,20 +30,20 @@ process runs in, and for comparing system environments. %prep %setup -q +%patch1 -p1 # remove symlink mv README.rst README %build %configure -make %{?_smp_mflags} +%make_build %install -make install DESTDIR=$RPM_BUILD_ROOT +%make_install %check make check -%{!?_licensedir:%global license %%doc} %files %{_bindir}/procenv %{_mandir}/man1/procenv.1* @@ -50,6 +52,9 @@ make check %license COPYING %changelog +* Mon Jan 21 2019 Dave Love - 0.50-4 +- Patch to fix failure with gcc 9 + * Fri Jul 13 2018 Fedora Release Engineering - 0.50-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild