All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] libselinux: support building on older PCRE libs
@ 2013-10-22 14:46 Joe MacDonald
  2013-10-22 14:48 ` Joe MacDonald
  0 siblings, 1 reply; 6+ messages in thread
From: Joe MacDonald @ 2013-10-22 14:46 UTC (permalink / raw)
  To: selinux

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 <joe@deserted.net>
---

This will hit all uses of pcre_free_study() provided label_file.h gets
included somewhere along the way.  Also makes it cleaner to back out when
ancient versions of libpcre fall off the support map and it keeps the code
from being filled with all-caps.

 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 bf0c9e2..7d48832 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_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 */
-- 
1.7.9.5


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

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

* Re: [PATCH] libselinux: support building on older PCRE libs
  2013-10-22 14:46 [PATCH] libselinux: support building on older PCRE libs Joe MacDonald
@ 2013-10-22 14:48 ` Joe MacDonald
  2013-10-22 15:05   ` Joe MacDonald
  0 siblings, 1 reply; 6+ messages in thread
From: Joe MacDonald @ 2013-10-22 14:48 UTC (permalink / raw)
  To: selinux

[-- Attachment #1: Type: text/plain, Size: 1444 bytes --]

[[PATCH] libselinux: support building on older PCRE libs] On 13.10.22 (Tue 10:46) Joe MacDonald wrote:

> 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 <joe@deserted.net>
> ---
> 
> This will hit all uses of pcre_free_study() provided label_file.h gets
> included somewhere along the way.  Also makes it cleaner to back out when
> ancient versions of libpcre fall off the support map and it keeps the code
> from being filled with all-caps.
> 
>  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 bf0c9e2..7d48832 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_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 */

Hmm, actually, no.  That's the same logic I had in the previous #if ...
#endif block but it's wrong for cases where PCRE_MAJOR > 8.  Sorry about
that.

-- 
-Joe MacDonald.
:wq

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

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

* Re: [PATCH] libselinux: support building on older PCRE libs
  2013-10-22 14:48 ` Joe MacDonald
@ 2013-10-22 15:05   ` Joe MacDonald
  2013-10-22 15:56     ` Stephen Smalley
  2013-10-22 16:57     ` [PATCH][v3] " Joe MacDonald
  0 siblings, 2 replies; 6+ messages in thread
From: Joe MacDonald @ 2013-10-22 15:05 UTC (permalink / raw)
  To: selinux

[-- Attachment #1: Type: text/plain, Size: 1749 bytes --]

[Re: [PATCH] libselinux: support building on older PCRE libs] On 13.10.22 (Tue 10:48) Joe MacDonald wrote:

> [[PATCH] libselinux: support building on older PCRE libs] On 13.10.22 (Tue 10:46) Joe MacDonald wrote:
> 
> > 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 <joe@deserted.net>
> > ---
> > 
> > This will hit all uses of pcre_free_study() provided label_file.h gets
> > included somewhere along the way.  Also makes it cleaner to back out when
> > ancient versions of libpcre fall off the support map and it keeps the code
> > from being filled with all-caps.
> > 
> >  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 bf0c9e2..7d48832 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_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 */
> 
> Hmm, actually, no.  That's the same logic I had in the previous #if ...
> #endif block but it's wrong for cases where PCRE_MAJOR > 8.  Sorry about
> that.

Sorry about the noise, this is what I intended and should be okay.  And
I can't even claim it's Monday morning ... :-}

-- 
-Joe MacDonald.
:wq

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

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

* Re: [PATCH] libselinux: support building on older PCRE libs
  2013-10-22 15:05   ` Joe MacDonald
@ 2013-10-22 15:56     ` Stephen Smalley
  2013-10-22 16:57     ` [PATCH][v3] " Joe MacDonald
  1 sibling, 0 replies; 6+ messages in thread
From: Stephen Smalley @ 2013-10-22 15:56 UTC (permalink / raw)
  To: Joe MacDonald; +Cc: selinux

On 10/22/2013 11:05 AM, Joe MacDonald wrote:
> [Re: [PATCH] libselinux: support building on older PCRE libs] On 13.10.22 (Tue 10:48) Joe MacDonald wrote:
> 
>> [[PATCH] libselinux: support building on older PCRE libs] On 13.10.22 (Tue 10:46) Joe MacDonald wrote:
>>
>>> 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 <joe@deserted.net>
>>> ---
>>>
>>> This will hit all uses of pcre_free_study() provided label_file.h gets
>>> included somewhere along the way.  Also makes it cleaner to back out when
>>> ancient versions of libpcre fall off the support map and it keeps the code
>>> from being filled with all-caps.
>>>
>>>  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 bf0c9e2..7d48832 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_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 */
>>
>> Hmm, actually, no.  That's the same logic I had in the previous #if ...
>> #endif block but it's wrong for cases where PCRE_MAJOR > 8.  Sorry about
>> that.
> 
> Sorry about the noise, this is what I intended and should be okay.  And
> I can't even claim it's Monday morning ... :-}

I think you want PCRE_MAJOR < 8 || PCRE_MAJOR == 8 && PCRE_MINOR < 20 to
avoid problems when we get to version 9.



--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

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

* [PATCH][v3] libselinux: support building on older PCRE libs
  2013-10-22 15:05   ` Joe MacDonald
  2013-10-22 15:56     ` Stephen Smalley
@ 2013-10-22 16:57     ` Joe MacDonald
  2013-10-22 18:29       ` Stephen Smalley
  1 sibling, 1 reply; 6+ messages in thread
From: Joe MacDonald @ 2013-10-22 16:57 UTC (permalink / raw)
  To: selinux

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 <joe@deserted.net>
---

[Re: [PATCH] libselinux: support building on older PCRE libs] On 13.10.22 (Tue
11:56) Stephen Smalley wrote:

> I think you want PCRE_MAJOR < 8 || PCRE_MAJOR == 8 && PCRE_MINOR < 20 to
> avoid problems when we get to version 9.

That is exactly what I wanted, thanks Stephen.

-J.

 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 bf0c9e2..0aad3e7 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 */
-- 
1.7.9.5


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

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

* Re: [PATCH][v3] libselinux: support building on older PCRE libs
  2013-10-22 16:57     ` [PATCH][v3] " Joe MacDonald
@ 2013-10-22 18:29       ` Stephen Smalley
  0 siblings, 0 replies; 6+ messages in thread
From: Stephen Smalley @ 2013-10-22 18:29 UTC (permalink / raw)
  To: Joe MacDonald; +Cc: selinux

On 10/22/2013 12:57 PM, Joe MacDonald wrote:
> 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 <joe@deserted.net>

Thanks, applied.  I also applied the stat rename just for cleanliness,
although I think the real problem lies elsewhere.




--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

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

end of thread, other threads:[~2013-10-22 18:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-22 14:46 [PATCH] libselinux: support building on older PCRE libs Joe MacDonald
2013-10-22 14:48 ` Joe MacDonald
2013-10-22 15:05   ` Joe MacDonald
2013-10-22 15:56     ` Stephen Smalley
2013-10-22 16:57     ` [PATCH][v3] " Joe MacDonald
2013-10-22 18:29       ` Stephen Smalley

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.