From 2864f757dddaba5b062d3c4701b7093c1168d1d5 Mon Sep 17 00:00:00 2001 From: Joe MacDonald Date: Tue, 22 Oct 2013 12:57:36 -0400 Subject: [PATCH] libselinux: support building on older PCRE libs Versions of PCRE prior to 8.20 did not have pcre_free_study(). In its absence, use pcre_free() instead. Signed-off-by: Joe MacDonald --- libselinux/src/label_file.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libselinux/src/label_file.h b/libselinux/src/label_file.h index bf0c9e24..0aad3e7c 100644 --- a/libselinux/src/label_file.h +++ b/libselinux/src/label_file.h @@ -8,6 +8,11 @@ #define SELINUX_MAGIC_COMPILED_FCONTEXT 0xf97cff8a #define SELINUX_COMPILED_FCONTEXT_MAX_VERS 1 +/* Prior to verison 8.20, libpcre did not have pcre_free_study() */ +#if (PCRE_MAJOR < 8 || (PCRE_MAJOR == 8 && PCRE_MINOR < 20)) +#define pcre_free_study pcre_free +#endif + /* A file security context specification. */ struct spec { struct selabel_lookup_rec lr; /* holds contexts for lookup result */