From 5ad4a2e5f53e5c3eb2d295dcf2f62d60f5b90599 Mon Sep 17 00:00:00 2001 From: Jan Kaluza Date: Tue, 3 Jan 2012 12:51:19 +0100 Subject: [PATCH] fix #771292 - do not show 'using regular magic file' warning for /etc/magic, because this file is not supposed to be compiled --- file-localmagic.patch | 14 ++++++++++++++ file.spec | 6 +++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/file-localmagic.patch b/file-localmagic.patch index f96b7e7..69f26ca 100644 --- a/file-localmagic.patch +++ b/file-localmagic.patch @@ -41,6 +41,20 @@ index 39b1703..3dd92d8 100644 lib_LTLIBRARIES = libmagic.la include_HEADERS = magic.h AM_CPPFLAGS = -DMAGIC='"$(MAGIC)"' +diff --git a/src/apprentice.c b/src/apprentice.c +index b330669..0490642 100644 +--- a/src/apprentice.c ++++ b/src/apprentice.c +@@ -281,7 +281,7 @@ apprentice_1(struct magic_set *ms, const char *fn, int action, + + #ifndef COMPILE_ONLY + if ((rv = apprentice_map(ms, &magic, &nmagic, fn)) == -1) { +- if (ms->flags & MAGIC_CHECK) ++ if (ms->flags & MAGIC_CHECK && strcmp("/etc/magic", fn) != 0) + file_magwarn(ms, "using regular magic file `%s'", fn); + rv = apprentice_load(ms, &magic, &nmagic, fn, action); + if (rv != 0) + -- 1.7.7.4 diff --git a/file.spec b/file.spec index bf4df7a..f3665b6 100644 --- a/file.spec +++ b/file.spec @@ -5,7 +5,7 @@ Summary: A utility for determining file types Name: file Version: 5.10 -Release: 2%{?dist} +Release: 3%{?dist} License: BSD Group: Applications/File Source0: ftp://ftp.astron.com/pub/file/file-%{version}.tar.gz @@ -152,6 +152,10 @@ rm -rf $RPM_BUILD_ROOT %endif %changelog +* Tue Jan 03 2012 Jan Kaluza - 5.10-3 +- fix #771292 - do not show 'using regular magic file' warning for /etc/magic, + because this file is not supposed to be compiled + * Mon Jan 02 2012 Jan Kaluza - 5.10-2 - fix #770006 - detect tnef files