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