|
|
c53a52 |
From 95c993ff6bdfe92a7f519c4db60157a421e65b38 Mon Sep 17 00:00:00 2001
|
|
|
c53a52 |
From: Siteshwar Vashisht <svashisht@redhat.com>
|
|
|
c53a52 |
Date: Thu, 21 Feb 2019 15:26:38 +0100
|
|
|
c53a52 |
Subject: [PATCH] Upstream says it's up to distributions to add a way to
|
|
|
c53a52 |
support local-magic.
|
|
|
c53a52 |
|
|
|
c53a52 |
---
|
|
|
c53a52 |
magic/magic.local | 3 +++
|
|
|
c53a52 |
src/Makefile.am | 2 +-
|
|
|
c53a52 |
src/Makefile.in | 2 +-
|
|
|
c53a52 |
src/apprentice.c | 2 +-
|
|
|
c53a52 |
4 files changed, 6 insertions(+), 3 deletions(-)
|
|
|
c53a52 |
create mode 100644 magic/magic.local
|
|
|
c53a52 |
|
|
|
c53a52 |
diff --git a/magic/magic.local b/magic/magic.local
|
|
|
c53a52 |
new file mode 100644
|
|
|
c53a52 |
index 0000000..283a863
|
|
|
c53a52 |
--- /dev/null
|
|
|
c53a52 |
+++ b/magic/magic.local
|
|
|
c53a52 |
@@ -0,0 +1,3 @@
|
|
|
c53a52 |
+# Magic local data for file(1) command.
|
|
|
c53a52 |
+# Insert here your local magic data. Format is described in magic(5).
|
|
|
c53a52 |
+
|
|
|
c53a52 |
diff --git a/src/Makefile.am b/src/Makefile.am
|
|
|
c53a52 |
index 3f67f2c..b43cb8e 100644
|
|
|
c53a52 |
--- a/src/Makefile.am
|
|
|
c53a52 |
+++ b/src/Makefile.am
|
|
|
c53a52 |
@@ -1,4 +1,4 @@
|
|
|
c53a52 |
-MAGIC = $(pkgdatadir)/magic
|
|
|
c53a52 |
+MAGIC = /etc/magic:$(pkgdatadir)/magic
|
|
|
c53a52 |
lib_LTLIBRARIES = libmagic.la
|
|
|
c53a52 |
nodist_include_HEADERS = magic.h
|
|
|
c53a52 |
|
|
|
c53a52 |
diff --git a/src/Makefile.in b/src/Makefile.in
|
|
|
c53a52 |
index 59f3b5e..a8f56cf 100644
|
|
|
c53a52 |
--- a/src/Makefile.in
|
|
|
c53a52 |
+++ b/src/Makefile.in
|
|
|
c53a52 |
@@ -356,7 +356,7 @@ target_alias = @target_alias@
|
|
|
c53a52 |
top_build_prefix = @top_build_prefix@
|
|
|
c53a52 |
top_builddir = @top_builddir@
|
|
|
c53a52 |
top_srcdir = @top_srcdir@
|
|
|
c53a52 |
-MAGIC = $(pkgdatadir)/magic
|
|
|
c53a52 |
+MAGIC = /etc/magic:$(pkgdatadir)/magic
|
|
|
c53a52 |
lib_LTLIBRARIES = libmagic.la
|
|
|
c53a52 |
nodist_include_HEADERS = magic.h
|
|
|
c53a52 |
AM_CPPFLAGS = -DMAGIC='"$(MAGIC)"'
|
|
|
c53a52 |
diff --git a/src/apprentice.c b/src/apprentice.c
|
|
|
c53a52 |
index 1437bcc..b609dd1 100644
|
|
|
c53a52 |
--- a/src/apprentice.c
|
|
|
c53a52 |
+++ b/src/apprentice.c
|
|
|
c53a52 |
@@ -460,7 +460,7 @@ apprentice_1(struct magic_set *ms, const char *fn, int action)
|
|
|
c53a52 |
#ifndef COMPILE_ONLY
|
|
|
c53a52 |
map = apprentice_map(ms, fn);
|
|
|
c53a52 |
if (map == NULL) {
|
|
|
c53a52 |
- if (ms->flags & MAGIC_CHECK)
|
|
|
c53a52 |
+ if (ms->flags & MAGIC_CHECK && strcmp("/etc/magic", fn) != 0)
|
|
|
c53a52 |
file_magwarn(ms, "using regular magic file `%s'", fn);
|
|
|
c53a52 |
map = apprentice_load(ms, fn, action);
|
|
|
c53a52 |
if (map == NULL)
|
|
|
c53a52 |
--
|
|
|
c53a52 |
2.25.4
|
|
|
c53a52 |
|