From 62141dbb888cca218c7489c769c69ea17fb1efc2 Mon Sep 17 00:00:00 2001 From: Jan Kaluza Date: Wed, 15 May 2013 16:42:12 +0200 Subject: [PATCH] fix #962678 - do not exit if no magic file is loaded, we can still provide useful info without magic file --- file-5.14-no-magic.patch | 13 +++++++++++++ file.spec | 8 +++++++- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 file-5.14-no-magic.patch diff --git a/file-5.14-no-magic.patch b/file-5.14-no-magic.patch new file mode 100644 index 0000000..139e275 --- /dev/null +++ b/file-5.14-no-magic.patch @@ -0,0 +1,13 @@ +diff --git a/src/funcs.c b/src/funcs.c +index 7fc0e5c..4641c8b 100644 +--- a/src/funcs.c ++++ b/src/funcs.c +@@ -301,7 +301,7 @@ file_buffer(struct magic_set *ms, int fd, const char *inname __attribute__ ((unu + protected int + file_reset(struct magic_set *ms) + { +- if (ms->mlist[0] == NULL) { ++ if (ms->mlist == NULL) { + file_error(ms, 0, "no magic files loaded"); + return -1; + } diff --git a/file.spec b/file.spec index c4b0f17..04edb35 100644 --- a/file.spec +++ b/file.spec @@ -3,7 +3,7 @@ Summary: A utility for determining file types Name: file Version: 5.14 -Release: 5%{?dist} +Release: 6%{?dist} License: BSD Group: Applications/File Source0: ftp://ftp.astron.com/pub/file/file-%{version}.tar.gz @@ -20,6 +20,7 @@ Patch7: file-5.14-x86boot.patch Patch8: file-5.14-perl.patch Patch9: file-5.14-elfspace.patch Patch10: file-5.14-bad-fsmagic-space.patch +Patch11: file-5.14-no-magic.patch URL: http://www.darwinsys.com/file/ Requires: file-libs = %{version}-%{release} BuildRequires: zlib-devel @@ -76,6 +77,7 @@ file(1) command. %patch8 -p1 %patch9 -p1 %patch10 -p1 +%patch11 -p1 iconv -f iso-8859-1 -t utf-8 < doc/libmagic.man > doc/libmagic.man_ touch -r doc/libmagic.man doc/libmagic.man_ @@ -156,6 +158,10 @@ cd python %endif %changelog +* Wed May 15 2013 Jan Kaluza - 5.14-6 +- fix #962678 - do not exit if no magic file is loaded, we can still provide + useful info without magic file + * Mon May 13 2013 Jan Kaluza - 5.14-5 - fix #925339 - support aarch64