diff --git a/CVE-2023-33461.patch b/CVE-2023-33461.patch deleted file mode 100644 index ac03187bb99d254af8595fc87f604bd6e555e375..0000000000000000000000000000000000000000 --- a/CVE-2023-33461.patch +++ /dev/null @@ -1,45 +0,0 @@ -From ace9871f65d11b5d73f0b9ee8cf5d2807439442d Mon Sep 17 00:00:00 2001 -From: Antonio -Date: Fri, 2 Jun 2023 15:03:10 -0300 -Subject: [PATCH] Handle null return from iniparser_getstring - -Origin: https://github.com/ndevilla/iniparser/pull/146 - -Fix handling of NULL returns from iniparser_getstring in -iniparser_getboolean, iniparser_getlongint and iniparser_getdouble, -avoiding a crash. ---- - src/iniparser.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/src/iniparser.c b/src/iniparser.c -index f1d1658..dbceb20 100644 ---- a/src/iniparser.c -+++ b/src/iniparser.c -@@ -456,7 +456,7 @@ long int iniparser_getlongint(const dictionary * d, const char * key, long int n - const char * str ; - - str = iniparser_getstring(d, key, INI_INVALID_KEY); -- if (str==INI_INVALID_KEY) return notfound ; -+ if (str==NULL || str==INI_INVALID_KEY) return notfound ; - return strtol(str, NULL, 0); - } - -@@ -511,7 +511,7 @@ double iniparser_getdouble(const dictionary * d, const char * key, double notfou - const char * str ; - - str = iniparser_getstring(d, key, INI_INVALID_KEY); -- if (str==INI_INVALID_KEY) return notfound ; -+ if (str==NULL || str==INI_INVALID_KEY) return notfound ; - return atof(str); - } - -@@ -553,7 +553,7 @@ int iniparser_getboolean(const dictionary * d, const char * key, int notfound) - const char * c ; - - c = iniparser_getstring(d, key, INI_INVALID_KEY); -- if (c==INI_INVALID_KEY) return notfound ; -+ if (c==NULL || c==INI_INVALID_KEY) return notfound ; - if (c[0]=='y' || c[0]=='Y' || c[0]=='1' || c[0]=='t' || c[0]=='T') { - ret = 1 ; - } else if (c[0]=='n' || c[0]=='N' || c[0]=='0' || c[0]=='f' || c[0]=='F') { diff --git a/iniparser-4.1.tar.gz b/iniparser-4.1.tar.gz deleted file mode 100644 index fd23a046e7f8e0489142320577fd327ca2a993bd..0000000000000000000000000000000000000000 Binary files a/iniparser-4.1.tar.gz and /dev/null differ diff --git a/iniparser.spec b/iniparser.spec index 776d7f1a69d2c0306ddb6cfbe87ecd3799b8eced..318f0924f45d8ad84cfc14d1ab52bd77bb4917a6 100644 --- a/iniparser.spec +++ b/iniparser.spec @@ -1,59 +1,83 @@ Name: iniparser -Version: 4.1 -Release: 5 +Version: 4.2.4 +Release: 1 Summary: ini file parser License: MIT and Zlib -URL: https://github.com/ndevilla/iniparser -Source0: https://github.com/ndevilla/iniparser/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz -Patch0: CVE-2023-33461.patch +URL: https://github.com/ndevilla/iniparser +Source0: https://github.com/ndevilla/iniparser/archive/v%{version}.tar.gz -BuildRequires: gcc doxygen chrpath +BuildRequires: gcc +BuildRequires: make +BuildRequires: cmake +BuildRequires: doxygen +BuildRequires: chrpath %description -This modules offers parsing of ini files from the C level. See a complete documentation in HTML format, from this directory open the file html/index.html with any HTML-capable browser. +iniParser is an ANSI C library to parse "INI-style" files, often used to +hold application configuration information. + +%package devel +Summary: Header files, libraries and development documentation for %{name} +Requires: %{name} = %{version}-%{release} + +%description devel +This package contains the header files, static libraries and development +documentation for %{name}. If you like to develop programs using %{name}, +you will need to install %{name}-devel. + +%package static +Summary: C library for parsing "INI-style" files - static library +Requires: %{name}-devel = %{version}-%{release} + +%description static +Static library (.a) version of libiniparser. %prep -%autosetup -n %{name}-%{version} -p1 +%autosetup %build -export CFLAGS="${RPM_OPT_FLAGS}" +mkdir build && pushd build +%cmake -DBUILD_TEST=ON -DBUILD_EXAMPLES=ON .. %make_build -cd doc;make +popd %install -install -d %{buildroot}/%{_includedir}/%{name} -install -m 644 -t %{buildroot}%{_includedir}/%{name} src/dictionary.h src/iniparser.h - -install -d %{buildroot}/%{_libdir} -install -m 755 -t %{buildroot}%{_libdir}/ libiniparser.so.1 -ln -s libiniparser.so.1 %{buildroot}%{_libdir}/libiniparser.so - -install -d %{buildroot}/%{_docdir}/%{name} -cp -r example %{buildroot}/%{_docdir}/%{name} -cp -r html %{buildroot}/%{_docdir}/%{name} - -chrpath -d %{buildroot}/%{_libdir}/libiniparser.so.1 +pushd build +%make_install +popd +rm -rf %{buildroot}%{_bindir}/testrun +rm -rf %{buildroot}%{_bindir}/ressources +rm -rf %{buildroot}%{_docdir}/%{name}/examples + +chrpath -d %{buildroot}%{_libdir}/libiniparser.so.4 mkdir -p %{buildroot}/etc/ld.so.conf.d echo "%{_libdir}" > %{buildroot}/etc/ld.so.conf.d/%{name}-%{_arch}.conf -%pre -%preun -%post -/sbin/ldconfig -%postun -/sbin/ldconfig +%ldconfig_scriptlets %check %files %license LICENSE -%doc README.md INSTALL AUTHORS FAQ-en.md FAQ-zhcn.md -%{_includedir}/* -%{_libdir}/* -%{_docdir}/* +%doc README.md INSTALL AUTHORS FAQ*md +%{_libdir}/libiniparser.so.* %config(noreplace) /etc/ld.so.conf.d/* +%files devel +%{_libdir}/libiniparser.so +%{_includedir}/%{name} +%{_libdir}/cmake/%{name} +%{_libdir}/pkgconfig/%{name}.pc +%{_docdir}/%{name}/html + +%files static +%{_libdir}/libiniparser.a + %changelog +* Tue Oct 22 2024 liweigang - 4.2.4-1 +- update to version 4.2.4 +- modify spec, add iniparser-devel and iniparser-static + * Sun Jun 25 2023 wangkai <13474090681@163.com> - 4.1-5 - Fix CVE-2023-33461 diff --git a/v4.2.4.tar.gz b/v4.2.4.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..1df81803cc278858c892109f8665a3c44c9a66f6 Binary files /dev/null and b/v4.2.4.tar.gz differ