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