linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] plausible: fix compilation on RHEL 5.x due to missing magic define
@ 2016-10-20  7:25 Thomas De Schampheleire
  2016-10-25 17:23 ` Theodore Ts'o
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas De Schampheleire @ 2016-10-20  7:25 UTC (permalink / raw)
  To: linux-ext4; +Cc: Thomas De Schampheleire

From: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>

RHEL 5.x does have magic.h, but it does not define all expected symbols. In
particular, the NO_CHECK symbols were only added in file 4.20 and RHEL 5.x
is using 4.17.

Add substitute defines to allow continued usage of magic but without the
requested exclude checks.

Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
---
 lib/support/plausible.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

Note: instead of filling in the actual (current) values for these defines, we
could also have filled them with zero as libmagic will not recognize them
anyway.

diff --git a/lib/support/plausible.c b/lib/support/plausible.c
index 6f0c4bc..0636061 100644
--- a/lib/support/plausible.c
+++ b/lib/support/plausible.c
@@ -43,6 +43,17 @@ static const char *(*dl_magic_file)(magic_t, const char *);
 static int (*dl_magic_load)(magic_t, const char *);
 static void (*dl_magic_close)(magic_t);
 
+/*
+ * NO_CHECK functionality was only added in file 4.20.
+ * Older systems like RHEL 5.x still have file 4.17
+ */
+#ifndef MAGIC_NO_CHECK_COMPRESS
+#define MAGIC_NO_CHECK_COMPRESS 0x0001000
+#endif
+#ifndef MAGIC_NO_CHECK_ELF
+#define MAGIC_NO_CHECK_ELF 0x0010000
+#endif
+
 #ifdef HAVE_DLOPEN
 #include <dlfcn.h>
 
-- 
2.7.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: plausible: fix compilation on RHEL 5.x due to missing magic define
  2016-10-20  7:25 [PATCH] plausible: fix compilation on RHEL 5.x due to missing magic define Thomas De Schampheleire
@ 2016-10-25 17:23 ` Theodore Ts'o
  0 siblings, 0 replies; 2+ messages in thread
From: Theodore Ts'o @ 2016-10-25 17:23 UTC (permalink / raw)
  To: Thomas De Schampheleire; +Cc: linux-ext4, Thomas De Schampheleire

On Thu, Oct 20, 2016 at 09:25:05AM +0200, Thomas De Schampheleire wrote:
> From: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
> 
> RHEL 5.x does have magic.h, but it does not define all expected symbols. In
> particular, the NO_CHECK symbols were only added in file 4.20 and RHEL 5.x
> is using 4.17.
> 
> Add substitute defines to allow continued usage of magic but without the
> requested exclude checks.
> 
> Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>

Thanks, applied.

					- Ted

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-10-25 17:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-20  7:25 [PATCH] plausible: fix compilation on RHEL 5.x due to missing magic define Thomas De Schampheleire
2016-10-25 17:23 ` Theodore Ts'o

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).