diff --git a/file-5.04-core-trim.patch b/file-5.04-core-trim.patch new file mode 100644 index 0000000..731cf9c --- /dev/null +++ b/file-5.04-core-trim.patch @@ -0,0 +1,28 @@ +--- file-4.26.OLD/src/readelf.c 2008-07-26 17:03:55.000000000 +0200 ++++ file-4.26/src/readelf.c 2008-12-03 17:16:57.000000000 +0100 +@@ -738,6 +738,25 @@ core: + /* + * Well, that worked. + */ ++ ++ /* ++ * Try next offsets, in case this match is ++ * in the middle of a string. ++ */ ++ size_t k; ++ for (k = i + 1 ; k < NOFFSETS ; k++) { ++ if (prpsoffsets(k) >= prpsoffsets(i)) ++ continue; ++ size_t no; ++ int adjust = 1; ++ for (no = doff + prpsoffsets(k); ++ no < doff + prpsoffsets(i); no++) ++ adjust = adjust ++ && isprint(nbuf[no]); ++ if (adjust) ++ i = k; ++ } ++ + cname = (unsigned char *) + &nbuf[doff + prpsoffsets(i)]; + for (cp = cname; *cp && isprint(*cp); cp++) diff --git a/file.spec b/file.spec index b76961a..98a919b 100644 --- a/file.spec +++ b/file.spec @@ -5,7 +5,7 @@ Summary: A utility for determining file types Name: file Version: 5.04 -Release: 6%{?dist} +Release: 7%{?dist} License: BSD Group: Applications/File Source0: ftp://ftp.astron.com/pub/file/file-%{version}.tar.gz @@ -18,6 +18,7 @@ Patch4: file-5.04-ruby-modules.patch Patch5: file-5.04-filesystem.patch Patch6: file-5.04-separ.patch Patch7: file-5.04-squashfs.patch +Patch8: file-5.04-core-trim.patch Requires: file-libs = %{version}-%{release} BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -85,6 +86,8 @@ file(1) command. %patch6 -p1 #fixes #550212 %patch7 -p1 +#fixes #566305 +%patch8 -p1 iconv -f iso-8859-1 -t utf-8 < doc/libmagic.man > doc/libmagic.man_ touch -r doc/libmagic.man doc/libmagic.man_ @@ -161,6 +164,9 @@ rm -rf $RPM_BUILD_ROOT %endif %changelog +* Wed Apr 07 2010 Daniel Novotny 5.04-7 +- fix #566305 - "file" may trim too much of command line from core file + * Wed Mar 24 2010 Daniel Novotny 5.04-6 - fix #550212 - 'file' gives bad meta-data for squashfs-4.0