From 3960f0f15d32d5223584dfc9659316e34b56bba5 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Nov 04 2021 01:20:39 +0000 Subject: import popt-1.18-8.el9 --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..50197f5 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/popt-1.18.tar.gz diff --git a/.popt.metadata b/.popt.metadata new file mode 100644 index 0000000..9acb5eb --- /dev/null +++ b/.popt.metadata @@ -0,0 +1 @@ +0bf05488e151228fce9c0c9601162a9f432f69d9 SOURCES/popt-1.18.tar.gz diff --git a/SOURCES/popt-1.18-imp-covscan-fixes.patch b/SOURCES/popt-1.18-imp-covscan-fixes.patch new file mode 100644 index 0000000..f3c15f9 --- /dev/null +++ b/SOURCES/popt-1.18-imp-covscan-fixes.patch @@ -0,0 +1,64 @@ +commit 7e60d11c1b046e54378cf79280f4a856741c8749 +Author: Tobias Stoeckmann +Date: Sat Aug 22 14:09:58 2020 +0200 + + Close iconv in case of allocation error + + If memory allocation in strdup_locale_from_utf8 fails after calling + iconv_open, the returned conversion descriptor is not closed. + +diff --git a/src/poptint.c b/src/poptint.c +index 0cec176..3a0919a 100644 +--- a/src/poptint.c ++++ b/src/poptint.c +@@ -91,8 +91,10 @@ strdup_locale_from_utf8 (char * istr) + size_t ob = db; + size_t err; + +- if (dstr == NULL) ++ if (dstr == NULL) { ++ (void) iconv_close(cd); + return NULL; ++ } + err = iconv(cd, NULL, NULL, NULL, NULL); + while (1) { + *pout = '\0'; +commit 70011cc5763dca9a9b57e9539b465e00c9769996 +Author: Michal Domonkos +Date: Mon Jul 19 14:41:03 2021 +0200 + + Fix potential mem leak in poptReadConfigFile() + + While it seems that the actual implementation of poptReadFile() + shouldn't allocate the passed buffer (b) if the number of bytes (nb) is + zero (see the read(2) call in that function), it's still up to the + caller to take care of this resource, so let's just do that by bailing + out via "exit" where the freeing happens. + + Also initialize t to NULL to avoid freeing an undefined pointer. + + Found by Coverity. + +diff --git a/src/poptconfig.c b/src/poptconfig.c +index 8623ba2..7c52315 100644 +--- a/src/poptconfig.c ++++ b/src/poptconfig.c +@@ -344,13 +344,15 @@ int poptReadConfigFile(poptContext con, const char * fn) + char * b = NULL, *be; + size_t nb = 0; + const char *se; +- char *t, *te; ++ char *t = NULL, *te; + int rc; + + if ((rc = poptReadFile(fn, &b, &nb, POPT_READFILE_TRIMNEWLINES)) != 0) + return (errno == ENOENT ? 0 : rc); +- if (b == NULL || nb == 0) +- return POPT_ERROR_BADCONFIG; ++ if (b == NULL || nb == 0) { ++ rc = POPT_ERROR_BADCONFIG; ++ goto exit; ++ } + + if ((t = malloc(nb + 1)) == NULL) + goto exit; diff --git a/SPECS/popt.spec b/SPECS/popt.spec new file mode 100644 index 0000000..45a2d2e --- /dev/null +++ b/SPECS/popt.spec @@ -0,0 +1,254 @@ +%define ver 1.18 +#define snap rc1 +%define srcver %{ver}%{?snap:-%{snap}} + +Summary: C library for parsing command line parameters +Name: popt +Version: %{ver}%{?snap:~%{snap}} +Release: 8%{?dist} +License: MIT +URL: https://github.com/rpm-software-management/popt/ +Source0: http://ftp.rpm.org/popt/releases/popt-1.x/%{name}-%{srcver}.tar.gz +Patch0: popt-1.18-imp-covscan-fixes.patch +BuildRequires: gcc +BuildRequires: gettext +BuildRequires: make + +%description +Popt is a C library for parsing command line parameters. Popt was +heavily influenced by the getopt() and getopt_long() functions, but +it improves on them by allowing more powerful argument expansion. +Popt can parse arbitrary argv[] style arrays and automatically set +variables based on command line arguments. Popt allows command line +arguments to be aliased via configuration files and includes utility +functions for parsing arbitrary strings into argv[] arrays using +shell-like rules. + +%package devel +Summary: Development files for the popt library +Requires: %{name}%{?_isa} = %{version}-%{release}, pkgconfig + +%description devel +The popt-devel package includes header files and libraries necessary +for developing programs which use the popt C library. It contains the +API documentation of the popt library, too. + +%if 0%{!?_without_static:1} +%package static +Summary: Static library for parsing command line parameters +Requires: %{name}-devel%{?_isa} = %{version}-%{release} + +%description static +The popt-static package includes static libraries of the popt library. +Install it if you need to link statically with libpopt. +%endif + +%prep +%autosetup -n %{name}-%{srcver} -p1 + +%build +%configure %{?_without_static:--disable-static} +%make_build + +%install +%make_install + +# Don't install any libtool .la files +rm -f $RPM_BUILD_ROOT%{_libdir}/libpopt.la + +# Multiple popt configurations are possible +mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/popt.d/ + +%find_lang %{name} + +%check +make check + +%ldconfig_scriptlets + +%files -f %{name}.lang +%license COPYING +%doc CHANGES +%{_sysconfdir}/popt.d/ +%{_libdir}/libpopt.so.* + +%files devel +%doc README +%{_libdir}/libpopt.so +%{_libdir}/pkgconfig/%{name}.pc +%{_includedir}/popt.h +%{_mandir}/man3/popt.3* + +%if 0%{!?_without_static:1} +%files static +%{_libdir}/libpopt.a +%endif + +%changelog +* Tue Aug 10 2021 Mohan Boddu - 1.18-8 +- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags + Related: rhbz#1991688 + +* Tue Jul 20 2021 Michal Domonkos - 1.18-7 +- Add gating.yaml + +* Mon Jul 19 2021 Michal Domonkos - 1.18-6 +- Address important covscan issues (#1938846) + +* Fri Apr 16 2021 Mohan Boddu - 1.18-5 +- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937 + +* Sat Mar 06 2021 Robert Scheck 1.18-4 +- Conditionalize static subpackage during build-time + +* Wed Jan 27 2021 Fedora Release Engineering - 1.18-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Tue Jul 28 2020 Fedora Release Engineering - 1.18-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Wed Jun 24 2020 Panu Matilainen - 1.18-1 +- Update to popt 1.18 final (no changes from rc1) + +* Fri May 29 2020 Panu Matilainen - 1.18~rc1-1 +- Rebase to popt 1.18-rc1 +- Update URLs to the new upstream + +* Thu Jan 30 2020 Fedora Release Engineering - 1.16-19 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Fri Jul 26 2019 Fedora Release Engineering - 1.16-18 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Sat Feb 02 2019 Fedora Release Engineering - 1.16-17 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Thu Oct 11 2018 Panu Matilainen - 1.16-16 +- Use modern build helper macros +- Drop support for pre-usrmove versions (Fedora < 17 and RHEL < 7) +- Erm, dont nuke build-root at beginning of %%install + +* Fri Jul 13 2018 Fedora Release Engineering - 1.16-15 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Fri Feb 09 2018 Fedora Release Engineering - 1.16-14 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Sat Feb 03 2018 Igor Gnatenko - 1.16-13 +- Switch to %%ldconfig_scriptlets + +* Thu Oct 12 2017 Robert Scheck 1.16-12 +- Added upstream patch to handle glob(3) error returns (#1051685) + +* Thu Aug 03 2017 Fedora Release Engineering - 1.16-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Fri Jul 28 2017 Peter Jones - 1.16-10 +- Make it use %%autosetup -S git +- Fix a memory leak + +* Thu Jul 27 2017 Fedora Release Engineering - 1.16-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Sat Feb 11 2017 Fedora Release Engineering - 1.16-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Thu Feb 04 2016 Fedora Release Engineering - 1.16-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Thu Jun 18 2015 Fedora Release Engineering - 1.16-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Sun Aug 17 2014 Fedora Release Engineering - 1.16-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Thu Jun 26 2014 Panu Matilainen - 1.16-4 +- Mark license as such, not documentation + +* Sat Jun 07 2014 Fedora Release Engineering - 1.16-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Wed Jan 08 2014 Robert Scheck 1.16-2 +- Added patch to have --help and --usage translatable (#734434) + +* Sun Nov 24 2013 Robert Scheck 1.16-1 +- Upgrade to 1.16 (#448286, #999377) +- Tight run-time dependencies between sub-packages via %%{?_isa} +- Added patch for spelling mistakes in popt man page (#675567) + +* Sun Aug 04 2013 Fedora Release Engineering - 1.13-15 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Thu Feb 14 2013 Fedora Release Engineering - 1.13-14 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Fri Dec 14 2012 Panu Matilainen - 1.13-13 +- Remove useless doxygen docs to eliminate multilib conflicts (#533829) + +* Thu Aug 02 2012 Panu Matilainen - 1.13-12 +- Hack poptBadOption() to return something semi-meaningful on exec alias + failures (#697435, #710267) +- Run internal test-suite on build, minimal as it might be + +* Sat Jul 21 2012 Fedora Release Engineering - 1.13-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Sat Jan 14 2012 Fedora Release Engineering - 1.13-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Tue Jun 14 2011 Panu Matilainen +- Backport upstream patch to fix --opt= syntax for aliases (#293531) + +* Wed Feb 09 2011 Fedora Release Engineering - 1.13-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Tue Feb 16 2010 Robert Scheck 1.13-7 +- Solved multilib problems at doxygen generated files (#517509) + +* Sun Jul 26 2009 Fedora Release Engineering - 1.13-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Mon Feb 23 2009 Robert Scheck 1.13-5 +- Rebuilt against gcc 4.4 and rpm 4.6 + +* Sun May 25 2008 Robert Scheck 1.13-4 +- Solved multilib problems at doxygen generated files (#342921) + +* Wed Feb 20 2008 Robert Scheck 1.13-3 +- Revert the broken bind_textdomain_codeset() patch (#433324) + +* Thu Feb 14 2008 Robert Scheck 1.13-2 +- Added patch to work around missing bind_textdomain_codeset() + +* Sun Dec 30 2007 Robert Scheck 1.13-1 +- Upgrade to 1.13 (#290531, #332201, #425803) +- Solved multilib problems at doxygen generated files (#342921) + +* Thu Aug 23 2007 Robert Scheck 1.12-3 +- Added buildrequirement to graphviz (#249352) +- Backported bugfixes from CVS (#102254, #135428 and #178413) + +* Sun Aug 12 2007 Robert Scheck 1.12-2 +- Move libpopt to /lib[64] (#249814) +- Generate API documentation, added buildrequirement to doxygen + +* Mon Jul 23 2007 Robert Scheck 1.12-1 +- Changes to match with Fedora Packaging Guidelines (#249352) + +* Tue Jul 10 2007 Jeff Johnson +- release popt-1.12 through rpm5.org. + +* Sat Jun 9 2007 Jeff Johnson +- release popt-1.11 through rpm5.org. + +* Thu Dec 10 1998 Michael Johnson +- released 1.2.2; see CHANGES + +* Tue Nov 17 1998 Michael K. Johnson +- added man page to default install + +* Thu Oct 22 1998 Erik Troan +- see CHANGES file for 1.2 + +* Thu Apr 09 1998 Erik Troan +- added ./configure step to spec file