Blame SOURCES/file-localmagic.patch

a2822c
From f25107f625e88726e8ae9d4963573b5a0dda8f4c Mon Sep 17 00:00:00 2001
a2822c
From: Jan Kaluza <hanzz.k@gmail.com>
a2822c
Date: Thu, 15 Dec 2011 16:15:41 +0100
a2822c
Subject: [PATCH] localmagic
a2822c
a2822c
---
a2822c
 src/Makefile.am |    2 +-
a2822c
 src/Makefile.in |    2 +-
a2822c
 2 files changed, 2 insertions(+), 2 deletions(-)
a2822c
a2822c
diff --git a/src/Makefile.am b/src/Makefile.am
a2822c
index cba64ac..5e48dff 100644
a2822c
--- a/src/Makefile.am
a2822c
+++ b/src/Makefile.am
a2822c
@@ -1,4 +1,4 @@
a2822c
-MAGIC = $(pkgdatadir)/magic
a2822c
+MAGIC = /etc/magic:$(pkgdatadir)/magic
a2822c
 lib_LTLIBRARIES = libmagic.la
a2822c
 include_HEADERS = magic.h
a2822c
 
a2822c
diff --git a/magic/magic.local b/magic/magic.local
a2822c
new file mode 100644
a2822c
index 0000000..283a863
a2822c
--- /dev/null
a2822c
+++ b/magic/magic.local
a2822c
@@ -0,0 +1,3 @@
a2822c
+# Magic local data for file(1) command.
a2822c
+# Insert here your local magic data. Format is described in magic(5).
a2822c
+
a2822c
 
a2822c
diff --git a/src/Makefile.in b/src/Makefile.in
a2822c
index 39b1703..3dd92d8 100644
a2822c
--- a/src/Makefile.in
a2822c
+++ b/src/Makefile.in
a2822c
@@ -240,7 +240,7 @@ target_alias = @target_alias@
a2822c
 top_build_prefix = @top_build_prefix@
a2822c
 top_builddir = @top_builddir@
a2822c
 top_srcdir = @top_srcdir@
a2822c
-MAGIC = $(pkgdatadir)/magic
a2822c
+MAGIC = /etc/magic:$(pkgdatadir)/magic
a2822c
 lib_LTLIBRARIES = libmagic.la
a2822c
 include_HEADERS = magic.h
a2822c
 AM_CPPFLAGS = -DMAGIC='"$(MAGIC)"'
a2822c
diff --git a/src/apprentice.c b/src/apprentice.c
a2822c
index b330669..0490642 100644
a2822c
--- a/src/apprentice.c
a2822c
+++ b/src/apprentice.c
a2822c
@@ -281,7 +281,7 @@ apprentice_1(struct magic_set *ms, const char *fn, int action,
a2822c
 
a2822c
 #ifndef COMPILE_ONLY
a2822c
 	if ((rv = apprentice_map(ms, &magic, &nmagic, fn)) == -1) {
a2822c
-		if (ms->flags & MAGIC_CHECK)
a2822c
+		if (ms->flags & MAGIC_CHECK && strcmp("/etc/magic", fn) != 0)
a2822c
 			file_magwarn(ms, "using regular magic file `%s'", fn);
a2822c
 		rv = apprentice_load(ms, &magic, &nmagic, fn, action);
a2822c
 		if (rv != 0)
a2822c
a2822c
-- 
a2822c
1.7.7.4
a2822c