From f2aaae610229ed38718553ea2d0e2b8d9d5cd07c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sun, 15 May 2016 13:41:41 +0200 Subject: Add recommended patches --- debian/changelog | 13 +++ debian/control | 2 +- debian/patches/0001-hurd.patch | 16 ++++ debian/patches/0005-build.patch | 25 +++++ debian/patches/01-ansi-c.patch | 17 ---- debian/patches/0100-ansi-c.patch | 17 ++++ debian/patches/0105-dmidecode-avoid-sigbus.patch | 50 ++++++++++ debian/patches/0110-nosysfs.patch | 32 +++++++ .../patches/0115-no_smbios_DMI_entry_point.patch | 55 +++++++++++ debian/patches/0120-return_actual_data_size.patch | 103 +++++++++++++++++++++ ...se_read_file_to_read_DMI_table_from_sysfs.patch | 78 ++++++++++++++++ .../0130-use_DWORD_for_table_max_size.patch | 27 ++++++ debian/patches/0135-hide_fixup_msg.patch | 46 +++++++++ debian/patches/02-hurd.patch | 16 ---- debian/patches/03-build.patch | 25 ----- debian/patches/05-dmidecode-avoid-sigbus.patch | 50 ---------- debian/patches/series | 14 ++- 17 files changed, 473 insertions(+), 113 deletions(-) create mode 100644 debian/patches/0001-hurd.patch create mode 100644 debian/patches/0005-build.patch delete mode 100644 debian/patches/01-ansi-c.patch create mode 100644 debian/patches/0100-ansi-c.patch create mode 100644 debian/patches/0105-dmidecode-avoid-sigbus.patch create mode 100644 debian/patches/0110-nosysfs.patch create mode 100644 debian/patches/0115-no_smbios_DMI_entry_point.patch create mode 100644 debian/patches/0120-return_actual_data_size.patch create mode 100644 debian/patches/0125-use_read_file_to_read_DMI_table_from_sysfs.patch create mode 100644 debian/patches/0130-use_DWORD_for_table_max_size.patch create mode 100644 debian/patches/0135-hide_fixup_msg.patch delete mode 100644 debian/patches/02-hurd.patch delete mode 100644 debian/patches/03-build.patch delete mode 100644 debian/patches/05-dmidecode-avoid-sigbus.patch (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 77b7b34..6941903 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,16 @@ +dmidecode (3.0-3) UNRELEASED; urgency=medium + + * Rename patches. + * Add recommended patches from upstream: + - 0110-nosysfs.patch + - 0115-no_smbios_DMI_entry_point.patch + - 0120-return_actual_data_size.patch + - 0125-use_read_file_to_read_DMI_table_from_sysfs.patch + - 0130-use_DWORD_for_table_max_size.patch + - 0135-hide_fixup_msg.patch + + -- Jörg Frings-Fürst Sun, 15 May 2016 13:33:37 +0200 + dmidecode (3.0-2) unstable; urgency=medium * New debian/patches/05-dmidecode-avoid-sigbus.patch (Closes: #796963): diff --git a/debian/control b/debian/control index cff9ae8..bfd78d6 100644 --- a/debian/control +++ b/debian/control @@ -3,7 +3,7 @@ Section: utils Priority: optional Maintainer: Jörg Frings-Fürst Build-Depends: debhelper (>= 9) -Standards-Version: 3.9.6 +Standards-Version: 3.9.7 Vcs-Browser: http://anonscm.debian.org/cgit/collab-maint/dmidecode.git Vcs-Git: git://anonscm.debian.org/collab-maint/dmidecode.git Homepage: http://dmidecode.nongnu.org/ diff --git a/debian/patches/0001-hurd.patch b/debian/patches/0001-hurd.patch new file mode 100644 index 0000000..236cdea --- /dev/null +++ b/debian/patches/0001-hurd.patch @@ -0,0 +1,16 @@ +Author: Svante Signell +Description: Enable build of all targets on GNU/Hurd (Closes: #643649). + +Index: trunk/Makefile +=================================================================== +--- trunk.orig/Makefile ++++ trunk/Makefile +@@ -43,7 +43,7 @@ INSTALL_PROGRAM := $(INSTALL) -m 755 + RM := rm -f + + # BSD make provides $MACHINE, but GNU make doesn't +-MACHINE ?= $(shell uname -m 2>/dev/null) ++MACHINE ?= $(shell uname -m 2>/dev/null | cut - -d- -f 1) + + # These programs are only useful on x86 + PROGRAMS-i386 := biosdecode ownership vpddecode diff --git a/debian/patches/0005-build.patch b/debian/patches/0005-build.patch new file mode 100644 index 0000000..b9361eb --- /dev/null +++ b/debian/patches/0005-build.patch @@ -0,0 +1,25 @@ +Author: Daniel Baumann +Description: Avoid overwriting build environment rather than to just extend it. + +Index: trunk/Makefile +=================================================================== +--- trunk.orig/Makefile ++++ trunk/Makefile +@@ -13,7 +13,7 @@ + # + + CC = gcc +-CFLAGS = -W -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual \ ++CFLAGS += -W -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual \ + -Wcast-align -Wwrite-strings -Wmissing-prototypes -Winline -Wundef + + # Let lseek and mmap support 64-bit wide offsets +@@ -27,7 +27,7 @@ CFLAGS += -O2 + #CFLAGS += -g + + # Pass linker flags here +-LDFLAGS = ++#LDFLAGS = + + DESTDIR = + prefix = /usr/local diff --git a/debian/patches/01-ansi-c.patch b/debian/patches/01-ansi-c.patch deleted file mode 100644 index fecd6bb..0000000 --- a/debian/patches/01-ansi-c.patch +++ /dev/null @@ -1,17 +0,0 @@ -Author: Petter Reinholdtsen -Description: - Make sure the code compiles when using -ansi. Renames non-ANSI C 'inline' to - '__inline'. - -diff -Naurp dmidecode.orig/types.h dmidecode/types.h ---- dmidecode.orig/types.h 2011-09-27 17:09:22.211059414 +0200 -+++ dmidecode/types.h 2011-09-27 17:21:35.362694344 +0200 -@@ -32,7 +32,7 @@ typedef struct { - #endif - - #ifdef ALIGNMENT_WORKAROUND --static inline u64 U64(u32 low, u32 high) -+static __inline u64 U64(u32 low, u32 high) - { - u64 self; - diff --git a/debian/patches/0100-ansi-c.patch b/debian/patches/0100-ansi-c.patch new file mode 100644 index 0000000..fecd6bb --- /dev/null +++ b/debian/patches/0100-ansi-c.patch @@ -0,0 +1,17 @@ +Author: Petter Reinholdtsen +Description: + Make sure the code compiles when using -ansi. Renames non-ANSI C 'inline' to + '__inline'. + +diff -Naurp dmidecode.orig/types.h dmidecode/types.h +--- dmidecode.orig/types.h 2011-09-27 17:09:22.211059414 +0200 ++++ dmidecode/types.h 2011-09-27 17:21:35.362694344 +0200 +@@ -32,7 +32,7 @@ typedef struct { + #endif + + #ifdef ALIGNMENT_WORKAROUND +-static inline u64 U64(u32 low, u32 high) ++static __inline u64 U64(u32 low, u32 high) + { + u64 self; + diff --git a/debian/patches/0105-dmidecode-avoid-sigbus.patch b/debian/patches/0105-dmidecode-avoid-sigbus.patch new file mode 100644 index 0000000..518d972 --- /dev/null +++ b/debian/patches/0105-dmidecode-avoid-sigbus.patch @@ -0,0 +1,50 @@ +Description: Avoid SIGBUS on mmap failure + mmap will fail with SIGBUS if trying to map a non-existent portion of + a file. While this should never happen with /dev/mem, it can happen if + passing a regular file with option -d. While people should no longer + do that, failure gracefully seems better than crashing. So check for + the file size before calling mmap. +Author: Jean Delvare +Origin: https://savannah.nongnu.org/bugs/download.php?file_id=35008 +Bug: https://savannah.nongnu.org/bugs/index.php?46066 +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=796963 +Last-Update: 2015-10-01 +---- +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +--- dmidecode.orig/util.c 2015-09-29 11:27:02.136566009 +0200 ++++ dmidecode/util.c 2015-09-29 11:37:24.746191083 +0200 +@@ -152,6 +152,7 @@ void *mem_chunk(off_t base, size_t len, + void *p; + int fd; + #ifdef USE_MMAP ++ struct stat statbuf; + off_t mmoffset; + void *mmp; + #endif +@@ -169,6 +170,26 @@ void *mem_chunk(off_t base, size_t len, + } + + #ifdef USE_MMAP ++ if (fstat(fd, &statbuf) == -1) ++ { ++ fprintf(stderr, "%s: ", devmem); ++ perror("stat"); ++ free(p); ++ return NULL; ++ } ++ ++ /* ++ * mmap() will fail with SIGBUS if trying to map beyond the end of ++ * the file. ++ */ ++ if (S_ISREG(statbuf.st_mode) && base + (off_t)len > statbuf.st_size) ++ { ++ fprintf(stderr, "mmap: Can't map beyond end of file %s\n", ++ devmem); ++ free(p); ++ return NULL; ++ } ++ + #ifdef _SC_PAGESIZE + mmoffset = base % sysconf(_SC_PAGESIZE); + #else diff --git a/debian/patches/0110-nosysfs.patch b/debian/patches/0110-nosysfs.patch new file mode 100644 index 0000000..04c710a --- /dev/null +++ b/debian/patches/0110-nosysfs.patch @@ -0,0 +1,32 @@ +From 33b5aafc6ee6b5de9f2526fb1cf4b14d1e16e4f0 Mon Sep 17 00:00:00 2001 +From: Roy Franz +Date: Thu, 01 Oct 2015 06:41:43 +0000 +Subject: Add "--no-sysfs" option description to -h output + +A description of --no-sysfs was not added to the output of "-h" when +the feature was added, so add it now. +--- +Index: trunk/CHANGELOG +=================================================================== +--- trunk.orig/CHANGELOG ++++ trunk/CHANGELOG +@@ -1,3 +1,7 @@ ++2015-10-01 Roy Franz ++ ++ * dmiopt.c: Add "--no-sysfs" option description to -h output. ++ + 2015-09-03 Jean Delvare + + * version.h: Set version to 3.0. +Index: trunk/dmiopt.c +=================================================================== +--- trunk.orig/dmiopt.c ++++ trunk/dmiopt.c +@@ -314,6 +314,7 @@ void print_help(void) + " -u, --dump Do not decode the entries\n" + " --dump-bin FILE Dump the DMI data to a binary file\n" + " --from-dump FILE Read the DMI data from a binary file\n" ++ " --no-sysfs Do not attempt to read DMI data from sysfs files\n" + " -V, --version Display the version and exit\n"; + + printf("%s", help); diff --git a/debian/patches/0115-no_smbios_DMI_entry_point.patch b/debian/patches/0115-no_smbios_DMI_entry_point.patch new file mode 100644 index 0000000..ecbfc11 --- /dev/null +++ b/debian/patches/0115-no_smbios_DMI_entry_point.patch @@ -0,0 +1,55 @@ +From bf7bad24ce141dab5b5acc3ffb98ce5fe4a8e0f9 Mon Sep 17 00:00:00 2001 +From: Xie XiuQi +Date: Wed, 21 Oct 2015 13:12:50 +0000 +Subject: Fix 'No SMBIOS nor DMI entry point found' on SMBIOS3 + +address_from_efi may return a SMBIOS or SMBIOS3 format entry +point, so add this condition. +--- +Index: trunk/AUTHORS +=================================================================== +--- trunk.orig/AUTHORS ++++ trunk/AUTHORS +@@ -19,6 +19,7 @@ Jarod Wilson + Anton Arapov + Roy Franz + Tyler Bell ++Xie XiuQi + + MANY THANKS TO (IN CHRONOLOGICAL ORDER) + Werner Heuser +Index: trunk/CHANGELOG +=================================================================== +--- trunk.orig/CHANGELOG ++++ trunk/CHANGELOG +@@ -1,3 +1,7 @@ ++2015-10-21 Xie XiuQi ++ ++ * dmidecode.c: Handle SMBIOS 3.0 entry points on EFI systems. ++ + 2015-10-01 Roy Franz + + * dmiopt.c: Add "--no-sysfs" option description to -h output. +Index: trunk/dmidecode.c +=================================================================== +--- trunk.orig/dmidecode.c ++++ trunk/dmidecode.c +@@ -4864,8 +4864,16 @@ int main(int argc, char * const argv[]) + goto exit_free; + } + +- if (smbios_decode(buf, opt.devmem, 0)) +- found++; ++ if (memcmp(buf, "_SM3_", 5) == 0) ++ { ++ if (smbios3_decode(buf, opt.devmem, 0)) ++ found++; ++ } ++ else if (memcmp(buf, "_SM_", 4) == 0) ++ { ++ if (smbios_decode(buf, opt.devmem, 0)) ++ found++; ++ } + goto done; + + memory_scan: diff --git a/debian/patches/0120-return_actual_data_size.patch b/debian/patches/0120-return_actual_data_size.patch new file mode 100644 index 0000000..dc539d9 --- /dev/null +++ b/debian/patches/0120-return_actual_data_size.patch @@ -0,0 +1,103 @@ +From de9a74e1c60210bee229fcf55b1678a99d1b44dd Mon Sep 17 00:00:00 2001 +From: Jean Delvare +Date: Mon, 02 Nov 2015 08:45:26 +0000 +Subject: Let read_file return the actual data size + +Let read_file return the actual data size to the caller. This gives +the caller the possibility to check that the data size is as expected +and large enough for the purpose, and report to the user if not. +--- +Index: trunk/CHANGELOG +=================================================================== +--- trunk.orig/CHANGELOG ++++ trunk/CHANGELOG +@@ -1,3 +1,8 @@ ++2015-11-02 Jean Delvare ++ ++ * dmidecode.c, util.c, util.h: Let read_file return the actual data ++ size. ++ + 2015-10-21 Xie XiuQi + + * dmidecode.c: Handle SMBIOS 3.0 entry points on EFI systems. +Index: trunk/dmidecode.c +=================================================================== +--- trunk.orig/dmidecode.c ++++ trunk/dmidecode.c +@@ -4748,6 +4748,7 @@ int main(int argc, char * const argv[]) + int ret = 0; /* Returned value */ + int found = 0; + off_t fp; ++ size_t size; + int efi; + u8 *buf; + +@@ -4817,8 +4818,9 @@ 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(0x20, SYS_ENTRY_FILE)) != NULL) ++ && (buf = read_file(&size, SYS_ENTRY_FILE)) != NULL) + { + if (!(opt.flags & FLAG_QUIET)) + printf("Getting SMBIOS data from sysfs.\n"); +Index: trunk/util.c +=================================================================== +--- trunk.orig/util.c ++++ trunk/util.c +@@ -94,10 +94,11 @@ int checksum(const u8 *buf, size_t len) + * needs to be freed by the caller. + * This provides a similar usage model to mem_chunk() + * +- * Returns pointer to buffer of max_len bytes, or NULL on error ++ * Returns pointer to buffer of max_len bytes, or NULL on error, and ++ * sets max_len to the length actually read. + * + */ +-void *read_file(size_t max_len, const char *filename) ++void *read_file(size_t *max_len, const char *filename) + { + int fd; + size_t r2 = 0; +@@ -115,7 +116,7 @@ void *read_file(size_t max_len, const ch + return(NULL); + } + +- if ((p = malloc(max_len)) == NULL) ++ if ((p = malloc(*max_len)) == NULL) + { + perror("malloc"); + return NULL; +@@ -123,7 +124,7 @@ void *read_file(size_t max_len, const ch + + do + { +- r = read(fd, p + r2, max_len - r2); ++ r = read(fd, p + r2, *max_len - r2); + if (r == -1) + { + if (errno != EINTR) +@@ -140,6 +141,8 @@ void *read_file(size_t max_len, const ch + while (r != 0); + + close(fd); ++ *max_len = r2; ++ + return p; + } + +Index: trunk/util.h +=================================================================== +--- trunk.orig/util.h ++++ trunk/util.h +@@ -25,7 +25,7 @@ + #define ARRAY_SIZE(x) (sizeof(x)/sizeof((x)[0])) + + int checksum(const u8 *buf, size_t len); +-void *read_file(size_t len, const char *filename); ++void *read_file(size_t *len, const char *filename); + void *mem_chunk(off_t base, size_t len, const char *devmem); + int write_dump(size_t base, size_t len, const void *data, const char *dumpfile, int add); + u64 u64_range(u64 start, u64 end); diff --git a/debian/patches/0125-use_read_file_to_read_DMI_table_from_sysfs.patch b/debian/patches/0125-use_read_file_to_read_DMI_table_from_sysfs.patch new file mode 100644 index 0000000..fe01f63 --- /dev/null +++ b/debian/patches/0125-use_read_file_to_read_DMI_table_from_sysfs.patch @@ -0,0 +1,78 @@ +From 364055211b1956539c6a6268e111e244e1292c8c Mon Sep 17 00:00:00 2001 +From: Jean Delvare +Date: Mon, 02 Nov 2015 08:45:31 +0000 +Subject: dmidecode: Use read_file() to read the DMI table from sysfs + +We shouldn't use mem_chunk() to read the DMI table from sysfs. This +will fail for SMBIOS v3 implementations which specify a maximum length +for the table rather than its exact length. The kernel will trim the +table to the actual length, so the DMI file will be shorter than the +length announced in entry point. + +read_file() fits the bill in this case, as it deals with end of file +nicely. + +This also helps with corrupted DMI tables, as the kernel will not +export the part of the table that it wasn't able to parse, effectively +trimming it. + +This fixes bug #46176: +https://savannah.nongnu.org/bugs/?46176 +Unexpected end of file error +--- +Index: trunk/CHANGELOG +=================================================================== +--- trunk.orig/CHANGELOG ++++ trunk/CHANGELOG +@@ -2,6 +2,9 @@ + + * dmidecode.c, util.c, util.h: Let read_file return the actual data + size. ++ * dmidecode.c: Use read_file to read the DMI table from sysfs. ++ This fixes Savannah bug #46176: ++ https://savannah.nongnu.org/bugs/?46176 + + 2015-10-21 Xie XiuQi + +Index: trunk/dmidecode.c +=================================================================== +--- trunk.orig/dmidecode.c ++++ trunk/dmidecode.c +@@ -4521,16 +4521,29 @@ static void dmi_table(off_t base, u32 le + printf("\n"); + } + +- /* +- * When we are reading the DMI table from sysfs, we want to print +- * the address of the table (done above), but the offset of the +- * data in the file is 0. When reading from /dev/mem, the offset +- * in the file is the address. +- */ + if (flags & FLAG_NO_FILE_OFFSET) +- base = 0; ++ { ++ /* ++ * When reading from sysfs, the file may be shorter than ++ * announced. For SMBIOS v3 this is expcted, as we only know ++ * the maximum table size, not the actual table size. For older ++ * implementations (and for SMBIOS v3 too), this would be the ++ * result of the kernel truncating the table on parse error. ++ */ ++ size_t size = len; ++ buf = read_file(&size, devmem); ++ if (!(opt.flags & FLAG_QUIET) && num && size != (size_t)len) ++ { ++ printf("Wrong DMI structures length: %u bytes " ++ "announced, only %lu bytes available.\n", ++ len, (unsigned long)size); ++ } ++ len = size; ++ } ++ else ++ buf = mem_chunk(base, len, devmem); + +- if ((buf = mem_chunk(base, len, devmem)) == NULL) ++ if (buf == NULL) + { + fprintf(stderr, "Table is unreachable, sorry." + #ifndef USE_MMAP diff --git a/debian/patches/0130-use_DWORD_for_table_max_size.patch b/debian/patches/0130-use_DWORD_for_table_max_size.patch new file mode 100644 index 0000000..715d137 --- /dev/null +++ b/debian/patches/0130-use_DWORD_for_table_max_size.patch @@ -0,0 +1,27 @@ +From ab02b117511230e46bbef7febbd854b9c832c13c Mon Sep 17 00:00:00 2001 +From: Xie XiuQi +Date: Mon, 01 Feb 2016 08:30:31 +0000 +Subject: Use DWORD for Structure table maximum size in SMBIOS3 + +0Ch DWORD "Structure table maximum size" + +Maximum size of SMBIOS Structure Table, pointed to by +the Structure Table Address, in bytes. The actual size is +guaranteed to be less or equal to the maximum size. + +Signed-off-by: Xie XiuQi +Signed-off-by: Jean Delvare +--- +Index: trunk/dmidecode.c +=================================================================== +--- trunk.orig/dmidecode.c ++++ trunk/dmidecode.c +@@ -4612,7 +4612,7 @@ static int smbios3_decode(u8 *buf, const + } + + dmi_table(((off_t)offset.h << 32) | offset.l, +- WORD(buf + 0x0C), 0, ver, devmem, flags | FLAG_STOP_AT_EOT); ++ DWORD(buf + 0x0C), 0, ver, devmem, flags | FLAG_STOP_AT_EOT); + + if (opt.flags & FLAG_DUMP_BIN) + { diff --git a/debian/patches/0135-hide_fixup_msg.patch b/debian/patches/0135-hide_fixup_msg.patch new file mode 100644 index 0000000..ff3122c --- /dev/null +++ b/debian/patches/0135-hide_fixup_msg.patch @@ -0,0 +1,46 @@ +From cff11afa886a0147d734b650755d232b5e7f2099 Mon Sep 17 00:00:00 2001 +From: Jean Delvare +Date: Tue, 03 May 2016 13:32:21 +0000 +Subject: dmidecode: Hide irrelevant fixup message + +Only display the message about type 34 length fixup if the entry in +question is going to be displayed. Otherwise it's only confusing. + +This fixes bug #109024: +http://savannah.nongnu.org/support/?109024 + +Fixes: 3f70b3515d91 ("dmidecode: Fix up invalid DMI type 34 structure length") +--- +Index: trunk/dmidecode.c +=================================================================== +--- trunk.orig/dmidecode.c ++++ trunk/dmidecode.c +@@ -2946,7 +2946,7 @@ static void dmi_64bit_memory_error_addre + * first 5 characters of the device name to be trimmed. It's easy to + * check and fix, so do it, but warn. + */ +-static void dmi_fixup_type_34(struct dmi_header *h) ++static void dmi_fixup_type_34(struct dmi_header *h, int display) + { + u8 *p = h->data; + +@@ -2954,7 +2954,9 @@ static void dmi_fixup_type_34(struct dmi + if (h->length == 0x10 + && is_printable(p + 0x0B, 0x10 - 0x0B)) + { +- printf("Invalid entry length (%u). Fixed up to %u.\n", 0x10, 0x0B); ++ if (!(opt.flags & FLAG_QUIET) && display) ++ printf("Invalid entry length (%u). Fixed up to %u.\n", ++ 0x10, 0x0B); + h->length = 0x0B; + } + } +@@ -4443,7 +4445,7 @@ static void dmi_table_decode(u8 *buf, u3 + + /* Fixup a common mistake */ + if (h.type == 34) +- dmi_fixup_type_34(&h); ++ dmi_fixup_type_34(&h, display); + + /* look for the next handle */ + next = data + h.length; diff --git a/debian/patches/02-hurd.patch b/debian/patches/02-hurd.patch deleted file mode 100644 index 236cdea..0000000 --- a/debian/patches/02-hurd.patch +++ /dev/null @@ -1,16 +0,0 @@ -Author: Svante Signell -Description: Enable build of all targets on GNU/Hurd (Closes: #643649). - -Index: trunk/Makefile -=================================================================== ---- trunk.orig/Makefile -+++ trunk/Makefile -@@ -43,7 +43,7 @@ INSTALL_PROGRAM := $(INSTALL) -m 755 - RM := rm -f - - # BSD make provides $MACHINE, but GNU make doesn't --MACHINE ?= $(shell uname -m 2>/dev/null) -+MACHINE ?= $(shell uname -m 2>/dev/null | cut - -d- -f 1) - - # These programs are only useful on x86 - PROGRAMS-i386 := biosdecode ownership vpddecode diff --git a/debian/patches/03-build.patch b/debian/patches/03-build.patch deleted file mode 100644 index b9361eb..0000000 --- a/debian/patches/03-build.patch +++ /dev/null @@ -1,25 +0,0 @@ -Author: Daniel Baumann -Description: Avoid overwriting build environment rather than to just extend it. - -Index: trunk/Makefile -=================================================================== ---- trunk.orig/Makefile -+++ trunk/Makefile -@@ -13,7 +13,7 @@ - # - - CC = gcc --CFLAGS = -W -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual \ -+CFLAGS += -W -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual \ - -Wcast-align -Wwrite-strings -Wmissing-prototypes -Winline -Wundef - - # Let lseek and mmap support 64-bit wide offsets -@@ -27,7 +27,7 @@ CFLAGS += -O2 - #CFLAGS += -g - - # Pass linker flags here --LDFLAGS = -+#LDFLAGS = - - DESTDIR = - prefix = /usr/local diff --git a/debian/patches/05-dmidecode-avoid-sigbus.patch b/debian/patches/05-dmidecode-avoid-sigbus.patch deleted file mode 100644 index 518d972..0000000 --- a/debian/patches/05-dmidecode-avoid-sigbus.patch +++ /dev/null @@ -1,50 +0,0 @@ -Description: Avoid SIGBUS on mmap failure - mmap will fail with SIGBUS if trying to map a non-existent portion of - a file. While this should never happen with /dev/mem, it can happen if - passing a regular file with option -d. While people should no longer - do that, failure gracefully seems better than crashing. So check for - the file size before calling mmap. -Author: Jean Delvare -Origin: https://savannah.nongnu.org/bugs/download.php?file_id=35008 -Bug: https://savannah.nongnu.org/bugs/index.php?46066 -Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=796963 -Last-Update: 2015-10-01 ----- -This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ ---- dmidecode.orig/util.c 2015-09-29 11:27:02.136566009 +0200 -+++ dmidecode/util.c 2015-09-29 11:37:24.746191083 +0200 -@@ -152,6 +152,7 @@ void *mem_chunk(off_t base, size_t len, - void *p; - int fd; - #ifdef USE_MMAP -+ struct stat statbuf; - off_t mmoffset; - void *mmp; - #endif -@@ -169,6 +170,26 @@ void *mem_chunk(off_t base, size_t len, - } - - #ifdef USE_MMAP -+ if (fstat(fd, &statbuf) == -1) -+ { -+ fprintf(stderr, "%s: ", devmem); -+ perror("stat"); -+ free(p); -+ return NULL; -+ } -+ -+ /* -+ * mmap() will fail with SIGBUS if trying to map beyond the end of -+ * the file. -+ */ -+ if (S_ISREG(statbuf.st_mode) && base + (off_t)len > statbuf.st_size) -+ { -+ fprintf(stderr, "mmap: Can't map beyond end of file %s\n", -+ devmem); -+ free(p); -+ return NULL; -+ } -+ - #ifdef _SC_PAGESIZE - mmoffset = base % sysconf(_SC_PAGESIZE); - #else diff --git a/debian/patches/series b/debian/patches/series index 41f2000..1916e4c 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,4 +1,10 @@ -01-ansi-c.patch -02-hurd.patch -03-build.patch -05-dmidecode-avoid-sigbus.patch +0100-ansi-c.patch +0001-hurd.patch +0005-build.patch +0105-dmidecode-avoid-sigbus.patch +0110-nosysfs.patch +0115-no_smbios_DMI_entry_point.patch +0120-return_actual_data_size.patch +0125-use_read_file_to_read_DMI_table_from_sysfs.patch +0130-use_DWORD_for_table_max_size.patch +0135-hide_fixup_msg.patch -- cgit v1.2.3