Compare commits

...

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

4 changed files with 67 additions and 117 deletions

View File

@ -1 +1 @@
80898f5e95d905080426fdff7899d81eb4f888c2 SOURCES/dmidecode-3.5.tar.xz
c74291da874589334483adac4c30a5c0a13bc91b SOURCES/dmidecode-3.6.tar.xz

2
.gitignore vendored
View File

@ -1 +1 @@
SOURCES/dmidecode-3.5.tar.xz
SOURCES/dmidecode-3.6.tar.xz

View File

@ -1,64 +0,0 @@
From c76ddda0ba0aa99a55945e3290095c2ec493c892 Mon Sep 17 00:00:00 2001
From: Jean Delvare <jdelvare@suse.de>
Date: Wed, 26 Apr 2023 15:44:27 +0200
Subject: [PATCH] Consistently use read_file() when reading from a dump file
Use read_file() instead of mem_chunk() to read the entry point from a
dump file. This is faster, and consistent with how we then read the
actual DMI table from that dump file.
This made no functional difference so far, which is why it went
unnoticed for years. But now that a file type check was added to the
mem_chunk() function, we must stop using it to read from regular
files.
This will again allow root to use the --from-dump option.
Signed-off-by: Jean Delvare <jdelvare@suse.de>
Tested-by: Jerry Hoemann <jerry.hoemann@hpe.com>
---
dmidecode.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/dmidecode.c b/dmidecode.c
index 54f59c1..52ddbf1 100644
--- a/dmidecode.c
+++ b/dmidecode.c
@@ -6025,17 +6025,25 @@ int main(int argc, char * const argv[])
pr_comment("dmidecode %s", VERSION);
/* Read from dump if so instructed */
+ size = 0x20;
if (opt.flags & FLAG_FROM_DUMP)
{
if (!(opt.flags & FLAG_QUIET))
pr_info("Reading SMBIOS/DMI data from file %s.",
opt.dumpfile);
- if ((buf = mem_chunk(0, 0x20, opt.dumpfile)) == NULL)
+ if ((buf = read_file(0, &size, opt.dumpfile)) == NULL)
{
ret = 1;
goto exit_free;
}
+ /* Truncated entry point can't be processed */
+ if (size < 0x20)
+ {
+ ret = 1;
+ goto done;
+ }
+
if (memcmp(buf, "_SM3_", 5) == 0)
{
if (smbios3_decode(buf, opt.dumpfile, 0))
@@ -6059,7 +6067,6 @@ int main(int argc, char * const argv[])
* contain one of several types of entry points, so read enough for
* the largest one, then determine what type it contains.
*/
- size = 0x20;
if (!(opt.flags & FLAG_NO_SYSFS)
&& (buf = read_file(0, &size, SYS_ENTRY_FILE)) != NULL)
{
--
2.43.0

View File

@ -1,15 +1,13 @@
Summary: Tool to analyse BIOS DMI data
Name: dmidecode
Version: 3.5
Version: 3.6
Release: 1%{?dist}
Epoch: 1
License: GPLv2+
Source0: http://download.savannah.gnu.org/releases/%{name}/%{name}-%{version}.tar.xz
URL: http://www.nongnu.org/dmidecode/
Patch0: 0001-Consistently-use-read_file-when-reading-from-a-dump-.patch
Source0: https://download.savannah.gnu.org/releases/%{name}/%{name}-%{version}.tar.xz
URL: https://www.nongnu.org/dmidecode/
BuildRequires: gcc make
BuildRequires: pkgconfig(bash-completion)
ExclusiveArch: %{ix86} x86_64 ia64 aarch64
%description
@ -24,82 +22,98 @@ slots (e.g. AGP, PCI, ISA) and memory module slots, and the list of
I/O ports (e.g. serial, parallel, USB).
%prep
%autosetup
%setup -q
%build
make %{?_smp_mflags} CFLAGS="%{optflags}" LDFLAGS="%{__global_ldflags}"
%make_build CFLAGS="%{optflags}" LDFLAGS="%{__global_ldflags}"
%install
make %{?_smp_mflags} DESTDIR=%{buildroot} prefix=%{_prefix} install-bin install-man
%make_install %{?_smp_mflags} prefix=%{_prefix} install-bin install-man
%files
%doc AUTHORS NEWS README
%{!?_licensedir:%global license %%doc}
%license LICENSE
%{_sbindir}/dmidecode
%ifnarch ia64 aarch64
%{_sbindir}/vpddecode
%{_sbindir}/ownership
%{_sbindir}/biosdecode
%{_datadir}/bash-completion/completions/vpddecode
%{_datadir}/bash-completion/completions/ownership
%{_datadir}/bash-completion/completions/biosdecode
%endif
%{_mandir}/man8/*
%{_datadir}/bash-completion/completions/%{name}
%changelog
* Wed Dec 20 2023 Lichen Liu <lichliu@redhat.com> - 1:3.5-1
- Rebase to upstream 3.5
* Mon Aug 05 2024 Lichen Liu <lichliu@redhat.com> - 1:3.6-1
- updated to upstream v3.6
* Thu Jun 08 2023 Lichen Liu <lichliu@redhat.com> - 1:3.3-5
- Resolves: rhbz#2186860
* Tue Jan 09 2024 Lichen Liu <lichliu@redhat.com> - 1:3.5-3
- Expanding the list of CPU sockets to match the list specified in SMBIOS 3.7.0
* Wed Jan 26 2022 Coiby Xu <coxu@redhat.com> - 1:3.3-4
- Resolves: rhbz#2042224
* Fri Dec 22 2023 Lichen Liu <lichliu@redhat.com> - 1:3.5-2
- Add processor support from SMBIOS-3.6.0
- Consistently use read_file when reading from a dump file
* Wed Jan 05 2022 Coiby Xu <coxu@redhat.com> - 1:3.3-3
- Resolves: rhbz#2027665
* Fri May 05 2023 Lichen Liuu <lichliu@redhat.com> - 1:3.5-1
- updated to upstream v3.5
- Resolves: rhbz#2186858
* Tue Nov 10 2021 Coiby Xu <coxu@redhat.com> - 1:3.3-2
- Resolves: rhbz#1996651
* Wed Jan 05 2022 Coiby Xu <coxu@redhat.com> - 1:3.3-7
- Resolves: rhbz#2029784
* Tue Nov 9 2021 Coiby Xu <coxu@redhat.com> - 1:3.3-1
- Rebase to upsteam 3.3
- Resolves: rhbz#1998772
* Mon Dec 06 2021 Coiby Xu <coxu@redhat.com> - 1:3.3-6
- Resolves: rhbz#2024078
* Fri Apr 9 2021 Coiby Xu <coxu@redhat.com> - 1:3.2-10
- Fix crash with -u option
- Resolves: rhbz#1885823
* Thu Nov 04 2021 Coiby Xu <coxu@redhat.com> - 1:3.3-4
- Resolves: rhbz#1996988
* Thu Dec 10 2020 Lianbo Jiang <lijiang@redhat.com> - 1:3.2-8
- CI found an error in the commit <c54348130a2a>, need to fix it.
- Resolves: rhbz#1858350
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 1:3.3-2
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Tue Dec 08 2020 Lianbo Jiang <lijiang@redhat.com> - 1:3.2-7
- Fix the "OUT OF SPEC" error for empty NVMe and DIMM slots
- Resolves: rhbz#1858350
* Wed May 19 2021 Coiby Xu <coxu@redhat.com> - 1:3.3-1
- updated to upstream v3.3
- Supported SMBIOS spec up to v3.3.0
* Wed May 20 2020 Lianbo Jiang <lijiang@redhat.com> - 1:3.2-6
- Updated to the latest upstream(5b3c8e995026 ("Allow overriding
build settings from the environment"))
- Resolves: rhbz#1796581
* Thu Apr 15 2021 Mohan Boddu <mboddu@redhat.com> - 1:3.2-10
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Sun Oct 27 2019 Lianbo Jiang <lijiang@redhat.com> - 1:3.2-5
- Fix the "OUT OF SPEC" for type 9
- Resolves: rhbz#1763678
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1:3.2-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Mon Oct 21 2019 Lianbo Jiang <lijiang@redhat.com> - 1:3.2-4
- Updated to the latest upstream(a808e6ef4ebc ("Typo"))
- Resolves: rhbz#1725435
* Mon Jul 27 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1:3.2-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Mon Apr 22 2019 Lianbo Jiang <lijiang@redhat.com> - 1:3.2-3
- Add "Logical non-volatile device" to the memory device types
- Resolves: rhbz#1664573
* Mon Jul 13 2020 Tom Stellard <tstellar@redhat.com> - 1:3.2-7
- Use make macros
- https://fedoraproject.org/wiki/Changes/UseMakeBuildInstallMacro
* Mon Apr 15 2019 Lianbo Jiang <lijiang@redhat.com> - 1:3.2-2
- add CI gating test.
- Resolves: rhbz#1680617
* Mon Feb 03 2020 Tom Stellard <tstellar@redhat.com> - 1:3.2-6
- Use make_build macro instead of plain make
* Wed Sep 19 2018 Lianbo Jiang <lijiang@redhat.com> - 1:3.2-1
- update to upstream dmidecode-3.2
- Resolves: rhbz#1628211
* Tue Jan 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1:3.2-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Mon Nov 18 2019 Anton Arapov <aarapov@redhat.com> - 1:3.2-4
- v3.2 patched up to upstream commit 62bce59f
* Wed Jul 24 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1:3.2-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1:3.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Tue Sep 18 2018 Anton Arapov <aarapov@redhat.com> - 1:3.2-1
- updated to upstream v3.2
- Supported SMBIOS spec up to v3.2.0
* Thu Aug 02 2018 Anton Arapov <aarapov@redhat.com> - 1:3.1-7
- patched up to upstream commit bd78a5dfd4
* Thu Jul 12 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1:3.1-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1:3.1-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild