From 91b1c681c7272c461151b136d43133cbf75b4299 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Mon, 21 Jan 2008 13:31:25 +0000 Subject: [PATCH] - fixed segfault, if subdir does not exists --- pciutils-dir-d.patch | 11 +++++++---- pciutils.spec | 5 ++++- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/pciutils-dir-d.patch b/pciutils-dir-d.patch index 536afb4..f40ee20 100644 --- a/pciutils-dir-d.patch +++ b/pciutils-dir-d.patch @@ -1,6 +1,6 @@ diff -up pciutils-2.2.9/lib/pci.h.dird pciutils-2.2.9/lib/pci.h --- pciutils-2.2.9/lib/pci.h.dird 2006-09-09 14:46:06.000000000 +0200 -+++ pciutils-2.2.9/lib/pci.h 2008-01-18 09:51:03.000000000 +0100 ++++ pciutils-2.2.9/lib/pci.h 2008-01-21 14:27:27.000000000 +0100 @@ -162,6 +162,7 @@ char *pci_lookup_name(struct pci_access int pci_load_name_list(struct pci_access *a); /* Called automatically by pci_lookup_*() when needed; returns success */ void pci_free_name_list(struct pci_access *a); /* Called automatically by pci_cleanup() */ @@ -10,8 +10,8 @@ diff -up pciutils-2.2.9/lib/pci.h.dird pciutils-2.2.9/lib/pci.h enum pci_lookup_mode { PCI_LOOKUP_VENDOR = 1, /* Vendor name (args: vendorID) */ diff -up pciutils-2.2.9/lib/names.c.dird pciutils-2.2.9/lib/names.c ---- pciutils-2.2.9/lib/names.c.dird 2008-01-18 09:51:03.000000000 +0100 -+++ pciutils-2.2.9/lib/names.c 2008-01-18 09:54:28.000000000 +0100 +--- pciutils-2.2.9/lib/names.c.dird 2008-01-21 14:27:27.000000000 +0100 ++++ pciutils-2.2.9/lib/names.c 2008-01-21 14:29:55.000000000 +0100 @@ -11,6 +11,8 @@ #include #include @@ -58,7 +58,7 @@ diff -up pciutils-2.2.9/lib/names.c.dird pciutils-2.2.9/lib/names.c return 1; } -@@ -548,3 +550,46 @@ void pci_set_name_list_path(struct pci_a +@@ -548,3 +550,49 @@ void pci_set_name_list_path(struct pci_a a->id_file_name = name; a->free_id_name = to_be_freed; } @@ -77,6 +77,9 @@ diff -up pciutils-2.2.9/lib/names.c.dird pciutils-2.2.9/lib/names.c + strncat(new_id_path, ".d/", PATH_MAX - strnlen(new_id_path, PATH_MAX)); + /* printf("new_id_path is %s\n", new_id_path); */ + pci_ids_dir = opendir(new_id_path); ++ if (pci_ids_dir == NULL) ++ return 0; ++ + do + { + if ((dp = readdir(pci_ids_dir)) != NULL) diff --git a/pciutils.spec b/pciutils.spec index 86b60f9..96a5345 100644 --- a/pciutils.spec +++ b/pciutils.spec @@ -1,6 +1,6 @@ Name: pciutils Version: 2.2.9 -Release: 3%{?dist} +Release: 4%{?dist} Source: ftp://atrey.karlin.mff.cuni.cz/pub/linux/pci/%{name}-%{version}.tar.gz Patch0: pciutils-strip.patch Patch1: pciutils-2.2.4-buf.patch @@ -78,6 +78,9 @@ install -p lib/libpci.pc $RPM_BUILD_ROOT%{_libdir}/pkgconfig rm -rf $RPM_BUILD_ROOT %changelog +* Mon Jan 21 2008 Harald Hoyer 2.2.9-4 +- fixed segfault, if subdir does not exists + * Fri Jan 18 2008 Harald Hoyer 2.2.9-3 - removed static library, preserve timestamps on install (rhbz#226236) - added modified patch from Michael E. Brown @ Dell, to also