From d225ab0d21bdfde4ff93464bae8b564630c68600 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Kalu=C5=BEa?= Date: Mon, 19 Jul 2010 15:30:25 +0000 Subject: [PATCH] - fix #599695 - try to get "from" attribute for ELF binaries only from core dumps. --- file-5.04-core-prpsinfo.patch | 33 +++++++++++++++++++++++++++++++++ file.spec | 9 ++++++++- 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 file-5.04-core-prpsinfo.patch diff --git a/file-5.04-core-prpsinfo.patch b/file-5.04-core-prpsinfo.patch new file mode 100644 index 0000000..a68e935 --- /dev/null +++ b/file-5.04-core-prpsinfo.patch @@ -0,0 +1,33 @@ +diff --git a/src/elfclass.h b/src/elfclass.h +index 27817d0..7f3da86 100644 +--- a/src/elfclass.h ++++ b/src/elfclass.h +@@ -35,6 +35,7 @@ + switch (type) { + #ifdef ELFCORE + case ET_CORE: ++ flags |= FLAGS_IS_CORE; + if (dophn_core(ms, clazz, swap, fd, + (off_t)elf_getu(swap, elfhdr.e_phoff), + elf_getu16(swap, elfhdr.e_phnum), +diff --git a/src/readelf.c b/src/readelf.c +index 5915569..24aa28c 100644 +--- a/src/readelf.c ++++ b/src/readelf.c +@@ -286,6 +286,7 @@ private const char os_style_names[][8] = { + #define FLAGS_DID_CORE 1 + #define FLAGS_DID_NOTE 2 + #define FLAGS_DID_CORE_STYLE 4 ++#define FLAGS_IS_CORE 8 + + private int + dophn_core(struct magic_set *ms, int clazz, int swap, int fd, off_t off, +@@ -676,7 +677,7 @@ core: + break; + + default: +- if (xnh_type == NT_PRPSINFO) { ++ if (xnh_type == NT_PRPSINFO && *flags & FLAGS_IS_CORE) { + size_t i, j; + unsigned char c; + /* diff --git a/file.spec b/file.spec index 46d1724..819d5ad 100644 --- a/file.spec +++ b/file.spec @@ -5,7 +5,7 @@ Summary: A utility for determining file types Name: file Version: 5.04 -Release: 11%{?dist} +Release: 12%{?dist} License: BSD Group: Applications/File Source0: ftp://ftp.astron.com/pub/file/file-%{version}.tar.gz @@ -22,6 +22,7 @@ Patch8: file-5.04-core-trim.patch Patch9: file-5.04-retval.patch Patch10: file-5.04-html-regression.patch Patch11: file-5.04-zmachine-magic-update.patch +Patch12: file-5.04-core-prpsinfo.patch Requires: file-libs = %{version}-%{release} BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -96,6 +97,8 @@ file(1) command. %patch10 -p1 #fixes #608922 %patch11 -p1 +#fixes #599695 +%patch12 -p1 iconv -f iso-8859-1 -t utf-8 < doc/libmagic.man > doc/libmagic.man_ touch -r doc/libmagic.man doc/libmagic.man_ @@ -173,6 +176,10 @@ rm -rf $RPM_BUILD_ROOT %endif %changelog +* Thu Jul 19 2010 Jan Kaluza 5.04-12 +- fix #599695 - try to get "from" attribute for ELF binaries + only from core dumps. + * Thu Jul 08 2010 Jan Kaluza 5.04-11 - added docs for file-libs