Compare commits

..

No commits in common. "c8" and "c9-beta" have entirely different histories.
c8 ... c9-beta

2 changed files with 90 additions and 12 deletions

View File

@ -0,0 +1,40 @@
commit 34ab92ebc818bc5b356f1d297868512225493eca
Author: Sathvika Vasireddy <sv@linux.ibm.com>
Date: Thu Nov 9 02:37:36 2023 +0530
libvpd: Prevent adding duplicate entries in addDeviceSpecific() function
Currently, addDeviceSpecific() adds new 'DataItem' to the
'mDeviceSpecific' vector without checking for duplicates. This
vector can be further used by the front end tools to list vpd
information. If this vector has duplicate entries, then vpd
information for a specific device is listed more than once.
To fix this, prevent duplicate entries with the same 'ac' value
from being stored in the vector. Check if a 'DataItem' with
the same ac value already exists in the vector, and add the new
object to the vector only if no matching item is found.
Signed-off-by: Sathvika Vasireddy <sv@linux.ibm.com>
Signed-off-by: Mahesh Salgaonkar <mahesh@linux.ibm.com>
diff --git a/src/component.cpp b/src/component.cpp
index 44208ac..a945fc1 100644
--- a/src/component.cpp
+++ b/src/component.cpp
@@ -937,7 +937,6 @@ lderr:
d->ac = ac;
d->humanName = humanName;
d->setValue( val, lvl, __FILE__, __LINE__ );
-#if 0
/*
* There can be multiple records with the 'CL' key.
@@ -952,7 +951,6 @@ lderr:
if( (*i)->ac == ac )
return; //Failed to add - already present
}
-#endif
mDeviceSpecific.push_back( d );
}

View File

@ -1,12 +1,13 @@
Name: libvpd
Version: 2.2.9
Release: 1%{?dist}
Release: 2%{?dist}
Summary: VPD Database access library for lsvpd
Group: System Environment/Libraries
License: LGPLv2+
URL: https://github.com/power-ras/%{name}/releases
Source: https://github.com/power-ras/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz
# Prevent adding duplicate entries
Patch0: libvpd-prevent-adding-duplicate-entries.patch
BuildRequires: gcc-c++
BuildRequires: sqlite-devel zlib-devel libstdc++-devel libtool
@ -20,15 +21,15 @@ created by vpdupdate in the lsvpd package.
%package devel
Summary: Header files for libvpd
Group: Development/Libraries
Requires: %{name} = %{version}-%{release} sqlite-devel pkgconfig
%description devel
Contains header files for building with libvpd.
%prep
%setup -q
%autosetup -p1
%build
export CXXFLAGS="-std=c++14 $RPM_OPT_FLAGS"
./bootstrap.sh
%configure --disable-static
make %{?_smp_mflags}
@ -57,22 +58,59 @@ find %{buildroot} -type f -name "*.la" -delete
%{_libdir}/pkgconfig/libvpd_cxx-2.pc
%changelog
* Fri May 13 2022 Than Ngo <than@redhat.com> - 2.2.9-1
- Resolves: #2051316, rebase to 2.2.9
* Tue Jan 30 2024 Than Ngo <than@redhat.com> - 2.2.9-2
- Resolves: RHEL-23015, prevent adding duplicate entries
* Fri May 06 2022 Than Ngo <than@redhat.com> - 2.2.9-1
- Resolves: #2051288, rebase to 2.2.9
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 2.2.8-4
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 2.2.8-3
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.8-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Mon Nov 09 2020 Than Ngo <than@redhat.com> - 2.2.8-1
- Resolves: #1844429, rebase to 2.2.8
- rebase to 2.2.8
* Mon Apr 06 2020 Than Ngo <than@redhat.com> - 2.2.7-1
- Resolves: #1664098, rebase to 2.2.7
* Tue Oct 27 2020 Jeff Law <law@redhat.com> - 2.2.7-3
- Force C++14 as this code is not C++17 ready
* Wed Jun 05 2019 Than Ngo <than@redhat.com> - 2.2.6-2
- Reolves: #1715728, rebuild to get libvpd-devel added to the Builder repo
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.7-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Thu Jul 09 2020 Than Ngo <than@redhat.com> - 2.2.7-1
- rebase to 2.2.7
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.6-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Mon Dec 02 2019 Than Ngo <than@redhat.com> - 2.2.6-6
- Update Url and Source
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.6-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.6-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Fri Jul 20 2018 Sinny Kumari <sinnykumari@fedoraproject.org> - 2.2.6-3
- Add gcc-c++ as BuildRequires
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.6-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Fri Jul 06 2018 Sinny Kumari <sinnykumari@fedoraproject.org> - 2.2.6-1
- Rebase to 2.2.6
- run.vpdupdate is now created in /run instead of /var/lib/lsvpd/
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.5-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.5-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild