selinux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] selinux: use kernel definition of PF_MAX in scripts
@ 2019-03-12 18:47 Johannes Brechtmann
  2019-03-12 20:16 ` Stephen Smalley
  0 siblings, 1 reply; 3+ messages in thread
From: Johannes Brechtmann @ 2019-03-12 18:47 UTC (permalink / raw)
  To: Paul Moore, Stephen Smalley, Eric Paris, selinux, linux-kernel

From 1892b9ff8045bac6fe166802b2d8a8a3111c1e0c Mon Sep 17 00:00:00 2001
From: Johannes Brechtmann <johannes@jnbr.me>
Date: Tue, 12 Mar 2019 17:50:12 +0100
Subject: [PATCH] selinux: use kernel definition of PF_MAX in scripts

Building selinux scripts of old releases on a current host fails with:

    In file included from scripts/selinux/genheaders/genheaders.c:19:
    ./security/selinux/include/classmap.h:245:2: error: #error New
    address family defined, please update secclass_map.

Fix the issue by including linux/socket.h from kernel instead of
sys/socket.h from host.

Signed-off-by: Johannes Brechtmann <johannes@jnbr.me>
---
 scripts/selinux/genheaders/genheaders.c | 2 +-
 scripts/selinux/mdp/mdp.c               | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/selinux/genheaders/genheaders.c b/scripts/selinux/genheaders/genheaders.c
index 1ceedea847dd..6db7e07fbc4c 100644
--- a/scripts/selinux/genheaders/genheaders.c
+++ b/scripts/selinux/genheaders/genheaders.c
@@ -9,7 +9,7 @@
 #include <string.h>
 #include <errno.h>
 #include <ctype.h>
-#include <sys/socket.h>
+#include <linux/socket.h>
 
 struct security_class_mapping {
 	const char *name;
diff --git a/scripts/selinux/mdp/mdp.c b/scripts/selinux/mdp/mdp.c
index 073fe7537f6c..744d9fc9c0bd 100644
--- a/scripts/selinux/mdp/mdp.c
+++ b/scripts/selinux/mdp/mdp.c
@@ -32,7 +32,7 @@
 #include <stdlib.h>
 #include <unistd.h>
 #include <string.h>
-#include <sys/socket.h>
+#include <linux/socket.h>
 
 static void usage(char *name)
 {
-- 
2.21.0


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

* Re: [PATCH] selinux: use kernel definition of PF_MAX in scripts
  2019-03-12 18:47 [PATCH] selinux: use kernel definition of PF_MAX in scripts Johannes Brechtmann
@ 2019-03-12 20:16 ` Stephen Smalley
  2019-03-18 22:59   ` Paul Moore
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Smalley @ 2019-03-12 20:16 UTC (permalink / raw)
  To: Johannes Brechtmann, Paul Moore, Eric Paris, selinux, linux-kernel

On 3/12/19 2:47 PM, Johannes Brechtmann wrote:
>  From 1892b9ff8045bac6fe166802b2d8a8a3111c1e0c Mon Sep 17 00:00:00 2001
> From: Johannes Brechtmann <johannes@jnbr.me>
> Date: Tue, 12 Mar 2019 17:50:12 +0100
> Subject: [PATCH] selinux: use kernel definition of PF_MAX in scripts
> 
> Building selinux scripts of old releases on a current host fails with:
> 
>      In file included from scripts/selinux/genheaders/genheaders.c:19:
>      ./security/selinux/include/classmap.h:245:2: error: #error New
>      address family defined, please update secclass_map.
> 
> Fix the issue by including linux/socket.h from kernel instead of
> sys/socket.h from host.
> 
> Signed-off-by: Johannes Brechtmann <johannes@jnbr.me>

Thanks, but already covered by
https://lore.kernel.org/selinux/20190225005528.28371-1-paulo@paulo.ac/

> ---
>   scripts/selinux/genheaders/genheaders.c | 2 +-
>   scripts/selinux/mdp/mdp.c               | 2 +-
>   2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/scripts/selinux/genheaders/genheaders.c b/scripts/selinux/genheaders/genheaders.c
> index 1ceedea847dd..6db7e07fbc4c 100644
> --- a/scripts/selinux/genheaders/genheaders.c
> +++ b/scripts/selinux/genheaders/genheaders.c
> @@ -9,7 +9,7 @@
>   #include <string.h>
>   #include <errno.h>
>   #include <ctype.h>
> -#include <sys/socket.h>
> +#include <linux/socket.h>
>   
>   struct security_class_mapping {
>   	const char *name;
> diff --git a/scripts/selinux/mdp/mdp.c b/scripts/selinux/mdp/mdp.c
> index 073fe7537f6c..744d9fc9c0bd 100644
> --- a/scripts/selinux/mdp/mdp.c
> +++ b/scripts/selinux/mdp/mdp.c
> @@ -32,7 +32,7 @@
>   #include <stdlib.h>
>   #include <unistd.h>
>   #include <string.h>
> -#include <sys/socket.h>
> +#include <linux/socket.h>
>   
>   static void usage(char *name)
>   {
> 


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

* Re: [PATCH] selinux: use kernel definition of PF_MAX in scripts
  2019-03-12 20:16 ` Stephen Smalley
@ 2019-03-18 22:59   ` Paul Moore
  0 siblings, 0 replies; 3+ messages in thread
From: Paul Moore @ 2019-03-18 22:59 UTC (permalink / raw)
  To: Johannes Brechtmann; +Cc: Eric Paris, selinux, Stephen Smalley, linux-kernel

On Tue, Mar 12, 2019 at 4:21 PM Stephen Smalley <sds@tycho.nsa.gov> wrote:
> On 3/12/19 2:47 PM, Johannes Brechtmann wrote:
> >  From 1892b9ff8045bac6fe166802b2d8a8a3111c1e0c Mon Sep 17 00:00:00 2001
> > From: Johannes Brechtmann <johannes@jnbr.me>
> > Date: Tue, 12 Mar 2019 17:50:12 +0100
> > Subject: [PATCH] selinux: use kernel definition of PF_MAX in scripts
> >
> > Building selinux scripts of old releases on a current host fails with:
> >
> >      In file included from scripts/selinux/genheaders/genheaders.c:19:
> >      ./security/selinux/include/classmap.h:245:2: error: #error New
> >      address family defined, please update secclass_map.
> >
> > Fix the issue by including linux/socket.h from kernel instead of
> > sys/socket.h from host.
> >
> > Signed-off-by: Johannes Brechtmann <johannes@jnbr.me>
>
> Thanks, but already covered by
> https://lore.kernel.org/selinux/20190225005528.28371-1-paulo@paulo.ac/

... and as of right now, the fix has been merged into selinux/next.

-- 
paul moore
www.paul-moore.com

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

end of thread, other threads:[~2019-03-18 23:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-12 18:47 [PATCH] selinux: use kernel definition of PF_MAX in scripts Johannes Brechtmann
2019-03-12 20:16 ` Stephen Smalley
2019-03-18 22:59   ` Paul Moore

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).