Control: tags -1 pending patch

Hi Ghe,

> I can take a look to it but I can't promise anything about the time. If
> anyone want to do a NMU upload or move it to collab-maint, I'll totally
> supoprt it.

I'm availing myself of your invitation to NMU, and will be uploading an
02.18-0.1 package to the DELAYED/5-days queue shortly.

Please find attached the delta for the debian/ directory.  The upstream
tarball used is the unmodified one retrieved with uscan.

Cheers,
-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                    http://www.debian.org/
slanga...@ubuntu.com                                     vor...@debian.org
diff -uNr lshw-02.17/debian/changelog lshw-02.18/debian/changelog
--- lshw-02.17/debian/changelog	2016-08-15 22:05:56.000000000 +0000
+++ lshw-02.18/debian/changelog	2016-08-15 22:19:32.933899081 +0000
@@ -1,3 +1,21 @@
+lshw (02.18-0.1) yakkety; urgency=medium
+
+  * Non-maintainer upload with permission of the maintainer.
+  * New upstream release.  Closes: #823639, #756921, #746616, #758550,
+    #767023.
+    - Refresh patches for unfortunate new upstream tarball layout.
+    - debian/patches/fat-inspection.patch, debian/patches/smbios-noscan.patch:
+      drop, fixed upstream.
+    - Drop debian/patches/sparc.patch: no longer applies cleanly, and is
+      incorrect (double header inclusion).
+  * debian/patches/Avoid-crash-in-scan_dmi_sysfs-when-running-as-non-ro.patch:
+    patch taken from Ubuntu to fix an upstream regression when running as
+    non-root; thanks to dann frazier <dann.fraz...@canonical.com>
+  * debian/patches/fix-width-handling.patch: Fix regression in detecting
+    platform width.
+
+ -- Steve Langasek <vor...@debian.org>  Mon, 15 Aug 2016 13:42:04 -0700
+
 lshw (02.17-1.1) unstable; urgency=medium
 
   * Non-maintainer upload.
diff -uNr lshw-02.17/debian/patches/Avoid-crash-in-scan_dmi_sysfs-when-running-as-non-ro.patch lshw-02.18/debian/patches/Avoid-crash-in-scan_dmi_sysfs-when-running-as-non-ro.patch
--- lshw-02.17/debian/patches/Avoid-crash-in-scan_dmi_sysfs-when-running-as-non-ro.patch	1970-01-01 00:00:00.000000000 +0000
+++ lshw-02.18/debian/patches/Avoid-crash-in-scan_dmi_sysfs-when-running-as-non-ro.patch	2016-08-15 19:08:19.126818011 +0000
@@ -0,0 +1,26 @@
+From: dann frazier <dann.fraz...@canonical.com>
+Date: Thu, 9 Jun 2016 17:40:54 -0600
+Subject: [PATCH] Avoid crash in scan_dmi_sysfs() when running as non-root
+ (#716)
+
+Instead of just checking that the sysfs files exist, make sure we
+can also read them.
+
+Bug: http://ezix.org/project/ticket/716
+Bug-Ubuntu: http://bugs.launchpad.net/bugs/1590994
+Forwarded: https://github.com/lyonel/lshw/pull/14
+Last-Update: 2016-06-13
+
+diff --git a/src/core/dmi.cc b/src/core/dmi.cc
+index ced891a..8bfe86f 100644
+--- a/lshw-B.02.18/src/core/dmi.cc
++++ b/lshw-B.02.18/src/core/dmi.cc
+@@ -1823,7 +1823,7 @@ static bool smbios_entry_point(const u8 *buf, size_t len,
+ 
+ static bool scan_dmi_sysfs(hwNode & n)
+ {
+-  if (!exists(SYSFSDMI "/smbios_entry_point") || !exists(SYSFSDMI "/DMI"))
++  if (access(SYSFSDMI "/smbios_entry_point", R_OK) || access(SYSFSDMI "/DMI", R_OK))
+     return false;
+ 
+   uint32_t table_len = 0;
diff -uNr lshw-02.17/debian/patches/arm-disable-smbios-check.patch lshw-02.18/debian/patches/arm-disable-smbios-check.patch
--- lshw-02.17/debian/patches/arm-disable-smbios-check.patch	2016-08-15 22:05:56.000000000 +0000
+++ lshw-02.18/debian/patches/arm-disable-smbios-check.patch	2016-08-15 19:08:19.126818011 +0000
@@ -1,7 +1,7 @@
 Index: src/core/dmi.cc
 ===================================================================
---- a/src/core/dmi.cc	(revision 2519)
-+++ b/src/core/dmi.cc	(working copy)
+--- a/lshw-B.02.18/src/core/dmi.cc	(revision 2519)
++++ b/lshw-B.02.18/src/core/dmi.cc	(working copy)
 @@ -1752,8 +1752,8 @@
    u16 dmimaj = 0, dmimin = 0;
    currentcpu = 0;
diff -uNr lshw-02.17/debian/patches/bin.patch lshw-02.18/debian/patches/bin.patch
--- lshw-02.17/debian/patches/bin.patch	2016-08-15 22:05:56.000000000 +0000
+++ lshw-02.18/debian/patches/bin.patch	2016-08-15 19:08:19.126818011 +0000
@@ -1,8 +1,8 @@
 Move binaries to /bin instead of /sbin
 It can be executed by normal users without privilegesIndex: lshw-02.14/src/Makefile
 ===================================================================
---- a/src/Makefile
-+++ b/src/Makefile
+--- a/lshw-B.02.18/src/Makefile
++++ b/lshw-B.02.18/src/Makefile
 @@ -6,7 +6,7 @@
  
  DESTDIR?=/
diff -uNr lshw-02.17/debian/patches/cflags.patch lshw-02.18/debian/patches/cflags.patch
--- lshw-02.17/debian/patches/cflags.patch	2016-08-15 22:05:56.000000000 +0000
+++ lshw-02.18/debian/patches/cflags.patch	2016-08-15 19:08:19.126818011 +0000
@@ -2,8 +2,8 @@
 * Don't include debug info
 * Compile using CXX_DEB_FLAGSIndex: lshw-02.14/src/Makefile
 ===================================================================
---- a/src/gui/Makefile
-+++ b/src/gui/Makefile
+--- a/lshw-B.02.18/src/gui/Makefile
++++ b/lshw-B.02.18/src/gui/Makefile
 @@ -8,7 +8,8 @@
  DEFINES=-DPREFIX=\"$(PREFIX)\" -DSBINDIR=\"$(SBINDIR)\" -DMANDIR=\"$(MANDIR)\" -DDATADIR=\"$(DATADIR)\"
  GTKINCLUDES=$(shell pkg-config gtk+-2.0 --cflags)
@@ -14,8 +14,8 @@
  CFLAGS=$(CXXFLAGS) $(DEFINES)
  GTKLIBS=$(shell pkg-config gtk+-2.0 gmodule-2.0 --libs)
  LIBS=-L../core -llshw -lresolv -lsqlite3 $(GTKLIBS)
---- a/src/Makefile
-+++ b/src/Makefile
+--- a/lshw-B.02.18/src/Makefile
++++ b/lshw-B.02.18/src/Makefile
 @@ -21,11 +21,13 @@
  CXX?=c++
  INCLUDES=-I./core/
@@ -32,8 +32,8 @@
  ifneq ($(shell $(LD) --help 2| grep -- --as-needed), )
  	LDFLAGS+= -Wl,--as-needed
  endif
---- a/src/core/Makefile
-+++ b/src/core/Makefile
+--- a/lshw-B.02.18/src/core/Makefile
++++ b/lshw-B.02.18/src/core/Makefile
 @@ -3,7 +3,8 @@
  CXX=c++
  INCLUDES=
diff -uNr lshw-02.17/debian/patches/fat-inspection.patch lshw-02.18/debian/patches/fat-inspection.patch
--- lshw-02.17/debian/patches/fat-inspection.patch	2016-08-15 22:05:56.000000000 +0000
+++ lshw-02.18/debian/patches/fat-inspection.patch	1970-01-01 00:00:00.000000000 +0000
@@ -1,10 +0,0 @@
---- a/src/core/fat.cc
-+++ b/src/core/fat.cc
-@@ -81,6 +81,7 @@
- 			uint8_t dummy2[164];
- 			uint8_t pmagic[2];
- 		} __attribute__((__packed__)) fat32;
-+		char sector[512];	// to make sure the whole struct is at least 512 bytes long
- 	} __attribute__((__packed__)) type;
- } __attribute__((__packed__));
- 
diff -uNr lshw-02.17/debian/patches/fix-manpage.patch lshw-02.18/debian/patches/fix-manpage.patch
--- lshw-02.17/debian/patches/fix-manpage.patch	2016-08-15 22:05:56.000000000 +0000
+++ lshw-02.18/debian/patches/fix-manpage.patch	2016-08-15 19:08:19.130818058 +0000
@@ -1,5 +1,5 @@
---- a/src/lshw.1
-+++ b/src/lshw.1
+--- a/lshw-B.02.18/src/lshw.1
++++ b/lshw-B.02.18/src/lshw.1
 @@ -1,4 +1,4 @@
 -.\\" auto-generated by docbook2man-spec $Revision: 1.2 $
 +.\" auto-generated by docbook2man-spec $Revision: 1.2 $
diff -uNr lshw-02.17/debian/patches/fix-width-handling.patch lshw-02.18/debian/patches/fix-width-handling.patch
--- lshw-02.17/debian/patches/fix-width-handling.patch	1970-01-01 00:00:00.000000000 +0000
+++ lshw-02.18/debian/patches/fix-width-handling.patch	2016-08-15 22:20:24.018517243 +0000
@@ -0,0 +1,21 @@
+Description: Fix regression in detecting platform width
+ LONG_BIT is not an argument to sysconf(), it is a static variable that is
+ set to either 32 or 64 bits.  Revert this upstream change so that we
+ actually query with _SC_LONG_BIT and get a correct answer, instead of
+ always getting -1 bits as our answer.
+Author: Steve Langasek <steve.langa...@canonical.com>
+Forwarded-Upstream: not-needed
+
+Index: lshw-02.18/lshw-B.02.18/src/core/abi.cc
+===================================================================
+--- lshw-02.18.orig/lshw-B.02.18/src/core/abi.cc
++++ lshw-02.18/lshw-B.02.18/src/core/abi.cc
+@@ -20,7 +20,7 @@
+ bool scan_abi(hwNode & system)
+ {
+   // are we compiled as 32- or 64-bit process ?
+-  system.setWidth(sysconf(LONG_BIT));
++  system.setWidth(sysconf(_SC_LONG_BIT));
+ 
+   pushd(PROC_SYS);
+ 
diff -uNr lshw-02.17/debian/patches/gcc45.gcc lshw-02.18/debian/patches/gcc45.gcc
--- lshw-02.17/debian/patches/gcc45.gcc	2016-08-15 22:05:56.000000000 +0000
+++ lshw-02.18/debian/patches/gcc45.gcc	2016-08-15 19:08:42.871095926 +0000
@@ -1,7 +1,7 @@
 Include headers to build under gcc-4.3Index: lshw-02.14/src/core/cdrom.cc
 ===================================================================
---- a/src/core/cdrom.cc
-+++ b/src/core/cdrom.cc
+--- a/lshw-B.02.18/src/core/cdrom.cc
++++ b/lshw-B.02.18/src/core/cdrom.cc
 @@ -25,6 +25,7 @@
  #include <unistd.h>
  #include <limits.h>
@@ -10,8 +10,8 @@
  
  __ID("@(#) $Id: cdrom.cc 1923 2008-02-10 23:04:53Z lyonel $");
  
---- a/src/core/cpuid.cc
-+++ b/src/core/cpuid.cc
+--- a/lshw-B.02.18/src/core/cpuid.cc
++++ b/lshw-B.02.18/src/core/cpuid.cc
 @@ -7,6 +7,7 @@
  #include <fcntl.h>
  #include <sys/stat.h>
@@ -20,8 +20,8 @@
  
  __ID("@(#) $Id: cpuid.cc 2151 2010-03-15 20:26:20Z lyonel $");
  
---- a/src/core/cpuinfo.cc
-+++ b/src/core/cpuinfo.cc
+--- a/lshw-B.02.18/src/core/cpuinfo.cc
++++ b/lshw-B.02.18/src/core/cpuinfo.cc
 @@ -5,6 +5,7 @@
  #include <sys/stat.h>
  #include <fcntl.h>
@@ -30,8 +30,8 @@
  #include <stdio.h>
  #include <stdlib.h>
  #include <vector>
---- a/src/core/fb.cc
-+++ b/src/core/fb.cc
+--- a/lshw-B.02.18/src/core/fb.cc
++++ b/lshw-B.02.18/src/core/fb.cc
 @@ -14,6 +14,7 @@
  #include <stdio.h>
  #include <string.h>
@@ -40,8 +40,8 @@
  
  __ID("@(#) $Id: fb.cc 2038 2008-09-05 19:53:35Z lyonel $");
  
---- a/src/core/hw.cc
-+++ b/src/core/hw.cc
+--- a/lshw-B.02.18/src/core/hw.cc
++++ b/lshw-B.02.18/src/core/hw.cc
 @@ -19,6 +19,9 @@
  #include <unistd.h>
  #include <limits.h>
@@ -52,8 +52,8 @@
  
  using namespace hw;
  
---- a/src/core/ideraid.cc
-+++ b/src/core/ideraid.cc
+--- a/lshw-B.02.18/src/core/ideraid.cc
++++ b/lshw-B.02.18/src/core/ideraid.cc
 @@ -20,6 +20,7 @@
  #include <string.h>
  #include <dirent.h>
@@ -62,8 +62,8 @@
  #include <vector>
  #include <linux/hdreg.h>
  #include <regex.h>
---- a/src/core/mounts.cc
-+++ b/src/core/mounts.cc
+--- a/lshw-B.02.18/src/core/mounts.cc
++++ b/lshw-B.02.18/src/core/mounts.cc
 @@ -14,7 +14,7 @@
  #include <stdlib.h>
  #include <string.h>
@@ -73,8 +73,8 @@
  
  __ID("@(#) $Id: mounts.cc 2066 2009-02-12 19:24:33Z lyonel $");
  
---- a/src/core/osutils.cc
-+++ b/src/core/osutils.cc
+--- a/lshw-B.02.18/src/core/osutils.cc
++++ b/lshw-B.02.18/src/core/osutils.cc
 @@ -3,6 +3,7 @@
  #include <sstream>
  #include <iomanip>
@@ -83,8 +83,8 @@
  #include <fcntl.h>
  #include <sys/stat.h>
  #include <unistd.h>
---- a/src/core/partitions.cc
-+++ b/src/core/partitions.cc
+--- a/lshw-B.02.18/src/core/partitions.cc
++++ b/lshw-B.02.18/src/core/partitions.cc
 @@ -21,6 +21,8 @@
  #include "volumes.h"
  #include "osutils.h"
@@ -94,8 +94,8 @@
  #include <sys/types.h>
  #include <sys/stat.h>
  #include <fcntl.h>
---- a/src/core/pci.cc
-+++ b/src/core/pci.cc
+--- a/lshw-B.02.18/src/core/pci.cc
++++ b/lshw-B.02.18/src/core/pci.cc
 @@ -12,6 +12,8 @@
  #include <string.h>
  #include <stdlib.h>
@@ -105,8 +105,8 @@
  
  __ID("@(#) $Id: pci.cc 2496 2012-05-15 08:00:13Z lyonel $");
  
---- a/src/core/pcmcia-legacy.cc
-+++ b/src/core/pcmcia-legacy.cc
+--- a/lshw-B.02.18/src/core/pcmcia-legacy.cc
++++ b/lshw-B.02.18/src/core/pcmcia-legacy.cc
 @@ -9,6 +9,7 @@
  #include <stdio.h>
  #include <string.h>
@@ -115,8 +115,8 @@
  
  __ID("@(#) $Id: pcmcia-legacy.cc 2038 2008-09-05 19:53:35Z lyonel $");
  
---- a/src/core/pcmcia.cc
-+++ b/src/core/pcmcia.cc
+--- a/lshw-B.02.18/src/core/pcmcia.cc
++++ b/lshw-B.02.18/src/core/pcmcia.cc
 @@ -6,6 +6,8 @@
  #include <sys/stat.h>
  #include <fcntl.h>
@@ -126,8 +126,8 @@
  #include <stdio.h>
  #include <stdlib.h>
  #include <string.h>
---- a/src/core/smp.cc
-+++ b/src/core/smp.cc
+--- a/lshw-B.02.18/src/core/smp.cc
++++ b/lshw-B.02.18/src/core/smp.cc
 @@ -11,6 +11,7 @@
  #include <fcntl.h>
  #include <string.h>
@@ -136,8 +136,8 @@
  
  #include "osutils.h"
  
---- a/src/core/spd.cc
-+++ b/src/core/spd.cc
+--- a/lshw-B.02.18/src/core/spd.cc
++++ b/lshw-B.02.18/src/core/spd.cc
 @@ -9,6 +9,7 @@
  #include <string>
  #include <dirent.h>
@@ -146,8 +146,8 @@
  
  __ID("@(#) $Id: spd.cc 1936 2008-03-23 12:29:29Z lyonel $");
  
---- a/src/core/usb.cc
-+++ b/src/core/usb.cc
+--- a/lshw-B.02.18/src/core/usb.cc
++++ b/lshw-B.02.18/src/core/usb.cc
 @@ -14,6 +14,7 @@
  #include "heuristics.h"
  #include "options.h"
@@ -164,8 +164,8 @@
  
  #define PROCBUSUSBDEVICES "/proc/bus/usb/devices"
  #define SYSKERNELDEBUGUSBDEVICES "/sys/kernel/debug/usb/devices"
---- a/src/core/volumes.cc
-+++ b/src/core/volumes.cc
+--- a/lshw-B.02.18/src/core/volumes.cc
++++ b/lshw-B.02.18/src/core/volumes.cc
 @@ -21,6 +21,7 @@
  #include <unistd.h>
  #include <stdint.h>
@@ -174,8 +174,8 @@
  
  __ID("@(#) $Id: volumes.cc 2488 2012-02-22 00:23:47Z lyonel $");
  
---- a/src/gui/engine.cc
-+++ b/src/gui/engine.cc
+--- a/lshw-B.02.18/src/gui/engine.cc
++++ b/lshw-B.02.18/src/gui/engine.cc
 @@ -6,6 +6,8 @@
  #include "osutils.h"
  #include "options.h"
@@ -185,8 +185,8 @@
  #include <iostream>
  #include <fstream>
  #include <sys/utsname.h>
---- a/src/gui/print-gui.cc
-+++ b/src/gui/print-gui.cc
+--- a/lshw-B.02.18/src/gui/print-gui.cc
++++ b/lshw-B.02.18/src/gui/print-gui.cc
 @@ -10,6 +10,7 @@
  #include "version.h"
  #include "osutils.h"
diff -uNr lshw-02.17/debian/patches/lshw-X.patch lshw-02.18/debian/patches/lshw-X.patch
--- lshw-02.17/debian/patches/lshw-X.patch	2016-08-15 22:05:56.000000000 +0000
+++ lshw-02.18/debian/patches/lshw-X.patch	2016-08-15 19:08:19.130818058 +0000
@@ -1,14 +1,14 @@
 Sanitize error when trying to run GUI without XIndex: lshw-02.14/src/gui/integration/console.apps
 ===================================================================
---- a/src/gui/integration/console.apps
-+++ b/src/gui/integration/console.apps
+--- a/lshw-B.02.18/src/gui/integration/console.apps
++++ b/lshw-B.02.18/src/gui/integration/console.apps
 @@ -1,3 +1,3 @@
  USER=root
 -PROGRAM=/usr/sbin/gtk-lshw
 +PROGRAM=/usr/sbin/lshw-gtk
  SESSION=true
---- a/src/gui/integration/gtk-lshw.desktop
-+++ b/src/gui/integration/gtk-lshw.desktop
+--- a/lshw-B.02.18/src/gui/integration/gtk-lshw.desktop
++++ b/lshw-B.02.18/src/gui/integration/gtk-lshw.desktop
 @@ -3,7 +3,7 @@
  Comment=HardWare LiSter
  Categories=Application;System;X-Red-Hat-Base;X-Fedora;
@@ -18,8 +18,8 @@
  Type=Application
  Terminal=false
  Encoding=UTF-8
---- a/src/lshw.cc
-+++ b/src/lshw.cc
+--- a/lshw-B.02.18/src/lshw.cc
++++ b/lshw-B.02.18/src/lshw.cc
 @@ -11,6 +11,7 @@
  #include <string.h>
  #include <stdlib.h>
diff -uNr lshw-02.17/debian/patches/lshw-common.patch lshw-02.18/debian/patches/lshw-common.patch
--- lshw-02.17/debian/patches/lshw-common.patch	2016-08-15 22:05:56.000000000 +0000
+++ lshw-02.18/debian/patches/lshw-common.patch	2016-08-15 19:08:19.130818058 +0000
@@ -1,7 +1,7 @@
 Added paths to look for device idsIndex: lshw-02.14/src/core/pci.cc
 ===================================================================
---- a/src/core/pci.cc
-+++ b/src/core/pci.cc
+--- a/lshw-B.02.18/src/core/pci.cc
++++ b/lshw-B.02.18/src/core/pci.cc
 @@ -18,6 +18,7 @@
  #define PROC_BUS_PCI "/proc/bus/pci"
  #define SYS_BUS_PCI "/sys/bus/pci"
@@ -10,8 +10,8 @@
  
  #define PCI_CLASS_REVISION      0x08              /* High 24 bits are class, low 8 revision */
  #define PCI_VENDOR_ID           0x00    /* 16 bits */
---- a/src/core/usb.cc
-+++ b/src/core/usb.cc
+--- a/lshw-B.02.18/src/core/usb.cc
++++ b/lshw-B.02.18/src/core/usb.cc
 @@ -28,6 +28,7 @@
  #define PROCBUSUSBDEVICES "/proc/bus/usb/devices"
  #define SYSKERNELDEBUGUSBDEVICES "/sys/kernel/debug/usb/devices"
diff -uNr lshw-02.17/debian/patches/lshw-devictree-assume-untyped-cpu-is-cpu.patch lshw-02.18/debian/patches/lshw-devictree-assume-untyped-cpu-is-cpu.patch
--- lshw-02.17/debian/patches/lshw-devictree-assume-untyped-cpu-is-cpu.patch	2016-08-15 22:05:56.000000000 +0000
+++ lshw-02.18/debian/patches/lshw-devictree-assume-untyped-cpu-is-cpu.patch	2016-08-15 19:08:19.130818058 +0000
@@ -1,5 +1,5 @@
---- a/src/core/device-tree.cc.orig	2013-05-07 14:57:16.400177000 -0400
-+++ b/src/core/device-tree.cc	2013-05-07 15:01:51.710177000 -0400
+--- a/lshw-B.02.18/src/core/device-tree.cc.orig	2013-05-07 14:57:16.400177000 -0400
++++ b/lshw-B.02.18/src/core/device-tree.cc	2013-05-07 15:01:51.710177000 -0400
 @@ -193,7 +193,8 @@
        struct dirent **cachelist;
        int ncache;
diff -uNr lshw-02.17/debian/patches/lshw-gtk.patch lshw-02.18/debian/patches/lshw-gtk.patch
--- lshw-02.17/debian/patches/lshw-gtk.patch	2016-08-15 22:05:56.000000000 +0000
+++ lshw-02.18/debian/patches/lshw-gtk.patch	2016-08-15 19:08:19.130818058 +0000
@@ -1,7 +1,7 @@
 Modified install directoriesIndex: lshw-02.14/src/Makefile
 ===================================================================
---- a/src/Makefile
-+++ b/src/Makefile
+--- a/lshw-B.02.18/src/Makefile
++++ b/lshw-B.02.18/src/Makefile
 @@ -104,8 +104,8 @@
  
  install-gui: gui
diff -uNr lshw-02.17/debian/patches/privacy.patch lshw-02.18/debian/patches/privacy.patch
--- lshw-02.17/debian/patches/privacy.patch	2016-08-15 22:05:56.000000000 +0000
+++ lshw-02.18/debian/patches/privacy.patch	2016-08-15 19:08:19.130818058 +0000
@@ -1,7 +1,7 @@
 Doesn't look for new version on inte to avoid privacy issuesIndex: lshw-02.14/src/core/version.cc
 ===================================================================
---- a/src/core/version.cc
-+++ b/src/core/version.cc
+--- a/lshw-B.02.18/src/core/version.cc
++++ b/lshw-B.02.18/src/core/version.cc
 @@ -112,6 +112,8 @@
  {
    static char *latest = NULL;
diff -uNr lshw-02.17/debian/patches/series lshw-02.18/debian/patches/series
--- lshw-02.17/debian/patches/series	2016-08-15 22:05:56.000000000 +0000
+++ lshw-02.18/debian/patches/series	2016-08-15 22:19:26.857825545 +0000
@@ -7,8 +7,7 @@
 gcc45.gcc
 lshw-X.patch
 privacy.patch
-sparc.patch
 spelling-error.patch
 fix-manpage.patch
-smbios-noscan.patch
-fat-inspection.patch
+Avoid-crash-in-scan_dmi_sysfs-when-running-as-non-ro.patch
+fix-width-handling.patch
diff -uNr lshw-02.17/debian/patches/smbios-noscan.patch lshw-02.18/debian/patches/smbios-noscan.patch
--- lshw-02.17/debian/patches/smbios-noscan.patch	2016-08-15 22:05:56.000000000 +0000
+++ lshw-02.18/debian/patches/smbios-noscan.patch	1970-01-01 00:00:00.000000000 +0000
@@ -1,178 +0,0 @@
---- a/src/core/dmi.cc
-+++ b/src/core/dmi.cc
-@@ -1717,9 +1717,56 @@
- }
- 
- 
--long get_efi_systab_smbios()
-+struct dmi_info {
-+  u8 smmajver;
-+  u8 smminver;
-+  u16 dmimaj;
-+  u16 dmimin;
-+};
-+
-+
-+static bool parse_dmi_header(u32 addr, int fd, hwNode & n, struct dmi_info *dmi)
-+{
-+  unsigned char buf[20];
-+  u32 mmoffset = 0;
-+  void *mmp = NULL;
-+
-+  mmoffset = addr % getpagesize();
-+  mmp = mmap(0, mmoffset + 0x20, PROT_READ, MAP_SHARED, fd, addr - mmoffset);
-+  memset(buf, 0, sizeof(buf));
-+  if (mmp != MAP_FAILED)
-+  {
-+    memcpy(buf, (u8 *) mmp + mmoffset, sizeof(buf));
-+    munmap(mmp, mmoffset + 0x20);
-+  }
-+  if (mmp == MAP_FAILED)
-+  {
-+    return false;
-+  }
-+  else if (memcmp(buf, "_SM_", 4) == 0)
-+  {
-+    // SMBIOS
-+    dmi->smmajver = buf[6];
-+    dmi->smminver = buf[7];
-+  }
-+  else if (dmi->smmajver && (memcmp(buf, "_DMI_", 5) == 0)
-+           && checksum(buf, 0x0F))
-+  {
-+    u16 num = buf[13] << 8 | buf[12];
-+    u16 len = buf[7] << 8 | buf[6];
-+    u32 base = buf[11] << 24 | buf[10] << 16 | buf[9] << 8 | buf[8];
-+    dmi->dmimaj = buf[14] ? buf[14] >> 4 : dmi->smmajver;
-+    dmi->dmimin = buf[14] ? buf[14] & 0x0F : dmi->smminver;
-+    dmi_table(fd, base, len, num, n, dmi->dmimaj, dmi->dmimin);
-+  }
-+
-+  return true;
-+}
-+
-+
-+u32 get_efi_systab_smbios()
- {
--  long result = 0;
-+  u32 result = 0;
-   vector < string > sysvars;
- 
-   if (loadfile("/sys/firmware/efi/systab", sysvars) || loadfile("/proc/efi/systab", sysvars))
-@@ -1731,7 +1778,8 @@
- 
-     if ((variable[0] == "SMBIOS") && (variable.size() == 2))
-     {
--      sscanf(variable[1].c_str(), "%lx", &result);
-+      sscanf(variable[1].c_str(), "%x", &result);
-+      break;
-     }
-   }
- 
-@@ -1741,20 +1789,11 @@
- 
- bool scan_dmi(hwNode & n)
- {
--  unsigned char buf[20];
--  int fd = open("/dev/mem",
--    O_RDONLY);
--  long fp = get_efi_systab_smbios();
--  u32 mmoffset = 0;
--  void *mmp = NULL;
--  bool efi = true;
--  u8 smmajver = 0, smminver = 0;
--  u16 dmimaj = 0, dmimin = 0;
-+  int fd = open("/dev/mem", O_RDONLY);
-+  u32 fp = get_efi_systab_smbios();
-+  struct dmi_info dmi = {0, 0, 0, 0};
-   currentcpu = 0;
--
--#if defined(__arm__) || defined (__hppa__) 
--  return false;		// SMBIOS not supported on PA-RISC and ARM machines
--#endif
-+  bool ret = false;
- 
-   if (sizeof(u8) != 1 || sizeof(u16) != 2 || sizeof(u32) != 4)
- // compiler incompatibility
-@@ -1762,61 +1801,40 @@
-   if (fd == -1)
-     return false;
- 
--  if (fp <= 0)
-+  if (fp != 0)
-   {
--    efi = false;
--    fp = 0xE0000L;                                /* default value for non-EFI capable platforms */
-+    ret = parse_dmi_header(fp, fd, n, &dmi);
-   }
--
--  fp -= 16;
--  while (efi || (fp < 0xFFFE0))
-+  else
-   {
--    fp += 16;
--    mmoffset = fp % getpagesize();
--    mmp = mmap(0, mmoffset + 0x20, PROT_READ, MAP_SHARED, fd, fp - mmoffset);
--    memset(buf, 0, sizeof(buf));
--    if (mmp != MAP_FAILED)
--    {
--      memcpy(buf, (u8 *) mmp + mmoffset, sizeof(buf));
--      munmap(mmp, mmoffset + 0x20);
--    }
--    if (mmp == MAP_FAILED)
-+#if defined(__i386__) || defined (__x86_64__)
-+    // 0xF0000-0xFFFF0 is the search tange for non-(U)EFI platforms,
-+    for (fp = 0xF0000L; fp <= 0xFFFF0 ; fp +=0x10)
-     {
--      close(fd);
--      return false;
--    }
--    else if (memcmp(buf, "_SM_", 4) == 0)
--    {
--// SMBIOS
--      smmajver = buf[6];
--      smminver = buf[7];
--    }
--    else if (smmajver && (memcmp(buf, "_DMI_", 5) == 0) && checksum(buf, 0x0F))
--    {
--      u16 num = buf[13] << 8 | buf[12];
--      u16 len = buf[7] << 8 | buf[6];
--      u32 base = buf[11] << 24 | buf[10] << 16 | buf[9] << 8 | buf[8];
--      dmimaj = buf[14] ? buf[14] >> 4 : smmajver;
--      dmimin = buf[14] ? buf[14] & 0x0F : smminver;
--      dmi_table(fd, base, len, num, n, dmimaj, dmimin);
--
--      if (efi)
--        break;                                    // we don't need to search the memory for EFI systems
-+      ret = parse_dmi_header(fp, fd, n, &dmi);
-+      if (dmi.smmajver + dmi.dmimaj != 0)
-+        break;
-     }
-+#else // ! (defined(__i386__) || defined (__x86_64__))
-+    // Only x86 platforms can scan memory for table
-+    ret = false;
-+#endif
-   }
-+
-   close(fd);
--  if (smmajver != 0)
-+
-+  if (dmi.smmajver != 0)
-   {
-     char buffer[20];
--    snprintf(buffer, sizeof(buffer), "%d.%d", smmajver, smminver);
-+    snprintf(buffer, sizeof(buffer), "%d.%d", dmi.smmajver, dmi.smminver);
-     n.addCapability("smbios-"+string(buffer), "SMBIOS version "+string(buffer));
-   }
--  if (dmimaj != 0)
-+  if (dmi.dmimaj != 0)
-   {
-     char buffer[20];
--    snprintf(buffer, sizeof(buffer), "%d.%d", dmimaj, dmimin);
-+    snprintf(buffer, sizeof(buffer), "%d.%d", dmi.dmimaj, dmi.dmimin);
-     n.addCapability("dmi-"+string(buffer), "DMI version "+string(buffer));
-   }
- 
--  return true;
-+  return ret;
- }
diff -uNr lshw-02.17/debian/patches/sparc.patch lshw-02.18/debian/patches/sparc.patch
--- lshw-02.17/debian/patches/sparc.patch	2016-08-15 22:05:56.000000000 +0000
+++ lshw-02.18/debian/patches/sparc.patch	1970-01-01 00:00:00.000000000 +0000
@@ -1,12 +0,0 @@
-Include library to compile properly under sparc platformIndex: lshw-02.14/src/core/abi.cc
-===================================================================
---- a/src/core/abi.cc
-+++ b/src/core/abi.cc
-@@ -11,6 +11,7 @@
- #include <unistd.h>
- #include <stdlib.h>
- #include <dirent.h>
-+#include <stdlib.h>
- 
- __ID("@(#) $Id: mem.cc 1352 2006-05-27 23:54:13Z ezix $");
- 
diff -uNr lshw-02.17/debian/patches/spelling-error.patch lshw-02.18/debian/patches/spelling-error.patch
--- lshw-02.17/debian/patches/spelling-error.patch	2016-08-15 22:05:56.000000000 +0000
+++ lshw-02.18/debian/patches/spelling-error.patch	2016-08-15 19:08:19.130818058 +0000
@@ -1,5 +1,5 @@
---- a/src/core/network.cc
-+++ b/src/core/network.cc
+--- a/lshw-B.02.18/src/core/network.cc
++++ b/lshw-B.02.18/src/core/network.cc
 @@ -414,7 +414,7 @@
          if(ecmd.supported & SUPPORTED_BNC)
            interface.addCapability("bnc", _("BNC"));
diff -uNr lshw-02.17/debian/patches/wget.patch lshw-02.18/debian/patches/wget.patch
--- lshw-02.17/debian/patches/wget.patch	2016-08-15 22:05:56.000000000 +0000
+++ lshw-02.18/debian/patches/wget.patch	2016-08-15 19:08:19.130818058 +0000
@@ -1,8 +1,8 @@
 Avoid downloading of files from inet at build time
 This is provided by hwdata packageIndex: lshw-02.14/src/Makefile
 ===================================================================
---- a/src/Makefile
-+++ b/src/Makefile
+--- a/lshw-B.02.18/src/Makefile
++++ b/lshw-B.02.18/src/Makefile
 @@ -82,16 +82,16 @@
  	docbook2man $<
  
diff -uNr lshw-02.17/debian/rules lshw-02.18/debian/rules
--- lshw-02.17/debian/rules	2016-08-15 22:05:56.000000000 +0000
+++ lshw-02.18/debian/rules	2016-08-15 20:52:42.790354895 +0000
@@ -26,6 +26,9 @@
 endif
 
 
+uver=B.02.18
+srcdir=lshw-$(uver)/src
+
 configure: configure-stamp
 configure-stamp:
 	dh_testdir
@@ -40,8 +43,8 @@
 	dh_testdir
 
 	# Add here commands to compile the package.
-	$(MAKE) -C src core
-	$(MAKE) -C src gui
+	$(MAKE) -C $(srcdir) core
+	$(MAKE) -C $(srcdir) gui
 	#/usr/bin/docbook-to-man debian/lshw.sgml > lshw.1
 	touch build-stamp
 
@@ -51,7 +54,7 @@
 	rm -f build-stamp configure-stamp
 
 	# Add here commands to clean up after the build process.
-	[ ! -f Makefile ] || $(MAKE) -C src clean 
+	$(MAKE) -C $(srcdir) clean 
 
 	dh_clean
 
@@ -62,8 +65,8 @@
 	dh_installdirs
 
 	# Add here commands to install the package into debian/lshw.
-	$(MAKE) install DESTDIR=$(CURDIR)/debian/lshw
-	$(MAKE) install-gui DESTDIR=$(CURDIR)/debian/lshw-gtk
+	$(MAKE) -C $(srcdir) install DESTDIR=$(CURDIR)/debian/lshw
+	$(MAKE) -C $(srcdir) install-gui DESTDIR=$(CURDIR)/debian/lshw-gtk
 
 	# data files supplied by pciutils and usbutils
 	rm -rf $(CURDIR)/debian/lshw/usr/share/lshw

Attachment: signature.asc
Description: PGP signature

Reply via email to