|
|
fd8bad |
From f25107f625e88726e8ae9d4963573b5a0dda8f4c Mon Sep 17 00:00:00 2001
|
|
|
fd8bad |
From: Jan Kaluza <hanzz.k@gmail.com>
|
|
|
fd8bad |
Date: Thu, 15 Dec 2011 16:15:41 +0100
|
|
|
fd8bad |
Subject: [PATCH] file-localmagic.patch
|
|
|
fd8bad |
|
|
|
fd8bad |
Upstream says it's up to distributions to add a way to support local-magic.
|
|
|
fd8bad |
|
|
|
fd8bad |
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
|
|
|
fd8bad |
---
|
|
|
fd8bad |
magic/magic.local | 3 +++
|
|
|
fd8bad |
src/Makefile.am | 2 +-
|
|
|
fd8bad |
src/Makefile.in | 2 +-
|
|
|
fd8bad |
src/apprentice.c | 2 +-
|
|
|
fd8bad |
4 files changed, 6 insertions(+), 3 deletions(-)
|
|
|
fd8bad |
create mode 100644 magic/magic.local
|
|
|
fd8bad |
|
|
|
fd8bad |
diff --git a/magic/magic.local b/magic/magic.local
|
|
|
fd8bad |
new file mode 100644
|
|
|
fd8bad |
index 0000000..283a863
|
|
|
fd8bad |
--- /dev/null
|
|
|
fd8bad |
+++ b/magic/magic.local
|
|
|
fd8bad |
@@ -0,0 +1,3 @@
|
|
|
fd8bad |
+# Magic local data for file(1) command.
|
|
|
fd8bad |
+# Insert here your local magic data. Format is described in magic(5).
|
|
|
fd8bad |
+
|
|
|
fd8bad |
diff --git a/src/Makefile.am b/src/Makefile.am
|
|
|
fd8bad |
index 155aec4..0f22539 100644
|
|
|
fd8bad |
--- a/src/Makefile.am
|
|
|
fd8bad |
+++ b/src/Makefile.am
|
|
|
fd8bad |
@@ -1,4 +1,4 @@
|
|
|
fd8bad |
-MAGIC = $(pkgdatadir)/magic
|
|
|
fd8bad |
+MAGIC = /etc/magic:$(pkgdatadir)/magic
|
|
|
fd8bad |
lib_LTLIBRARIES = libmagic.la
|
|
|
fd8bad |
nodist_include_HEADERS = magic.h
|
|
|
fd8bad |
|
|
|
fd8bad |
diff --git a/src/Makefile.in b/src/Makefile.in
|
|
|
fd8bad |
index b6eeb20..78dce55 100644
|
|
|
fd8bad |
--- a/src/Makefile.in
|
|
|
fd8bad |
+++ b/src/Makefile.in
|
|
|
fd8bad |
@@ -337,7 +337,7 @@ target_alias = @target_alias@
|
|
|
fd8bad |
top_build_prefix = @top_build_prefix@
|
|
|
fd8bad |
top_builddir = @top_builddir@
|
|
|
fd8bad |
top_srcdir = @top_srcdir@
|
|
|
fd8bad |
-MAGIC = $(pkgdatadir)/magic
|
|
|
fd8bad |
+MAGIC = /etc/magic:$(pkgdatadir)/magic
|
|
|
fd8bad |
lib_LTLIBRARIES = libmagic.la
|
|
|
fd8bad |
nodist_include_HEADERS = magic.h
|
|
|
fd8bad |
AM_CPPFLAGS = -DMAGIC='"$(MAGIC)"'
|
|
|
fd8bad |
diff --git a/src/apprentice.c b/src/apprentice.c
|
|
|
fd8bad |
index e395854..ecc1214 100644
|
|
|
fd8bad |
--- a/src/apprentice.c
|
|
|
fd8bad |
+++ b/src/apprentice.c
|
|
|
fd8bad |
@@ -454,7 +454,7 @@ apprentice_1(struct magic_set *ms, const char *fn, int action)
|
|
|
fd8bad |
if (map == (struct magic_map *)-1)
|
|
|
fd8bad |
return -1;
|
|
|
fd8bad |
if (map == NULL) {
|
|
|
fd8bad |
- if (ms->flags & MAGIC_CHECK)
|
|
|
fd8bad |
+ if (ms->flags & MAGIC_CHECK && strcmp("/etc/magic", fn) != 0)
|
|
|
fd8bad |
file_magwarn(ms, "using regular magic file `%s'", fn);
|
|
|
fd8bad |
map = apprentice_load(ms, fn, action);
|
|
|
fd8bad |
if (map == NULL)
|
|
|
fd8bad |
--
|
|
|
fd8bad |
2.5.5
|
|
|
fd8bad |
|