All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Build the SELinux testsuite on systems using the Reference Policy
@ 2016-08-24 12:39 Guido Trentalancia
  2016-08-24 14:11 ` [PATCH v2] " Guido Trentalancia
  2016-08-24 14:12 ` [PATCH v2] " Guido Trentalancia
  0 siblings, 2 replies; 11+ messages in thread
From: Guido Trentalancia @ 2016-08-24 12:39 UTC (permalink / raw)
  To: selinux

Fix the Makefile in the policy subdirectory of the SELinux testsuite
so that it builds correctly on the standard Reference Policy which
does not have the same booleans available on Red Hat.

Signed-off-by: Guido Trentalancia <guido@trentalancia.net>
---
 policy/Makefile |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- selinux-testsuite-git-23082016-orig/policy/Makefile	2016-08-23 20:50:08.527633728 +0200
+++ selinux-testsuite-git-23082016/policy/Makefile	2016-08-24 14:38:08.987455031 +0200
@@ -68,7 +68,7 @@ load_rhel: all
 
 load_general: all
 	# General policy load
-	/usr/sbin/setsebool allow_domain_fd_use=0
+	/usr/sbin/getsebool -a | grep -q allow_domain_fd_use && /usr/sbin/setsebool allow_domain_fd_use=0
 	$(SEMODULE) -i test_policy/test_policy.pp
 
 unload_rhel:
@@ -77,7 +77,7 @@ unload_rhel:
 
 unload_general:
 	# General policy unload
-	/usr/sbin/setsebool allow_domain_fd_use=1
+	/usr/sbin/getsebool -a | grep -q allow_domain_fd_use && /usr/sbin/setsebool allow_domain_fd_use=1
 	$(SEMODULE) -r test_policy
 
 clean:

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

* [PATCH v2] Build the SELinux testsuite on systems using the Reference Policy
  2016-08-24 12:39 [PATCH] Build the SELinux testsuite on systems using the Reference Policy Guido Trentalancia
@ 2016-08-24 14:11 ` Guido Trentalancia
  2016-08-26 17:06   ` Stephen Smalley
  2016-08-24 14:12 ` [PATCH v2] " Guido Trentalancia
  1 sibling, 1 reply; 11+ messages in thread
From: Guido Trentalancia @ 2016-08-24 14:11 UTC (permalink / raw)
  To: selinux

Fix the Makefile in the policy subdirectory of the SELinux testsuite
so that it builds correctly on the standard Reference Policy which
does not have the same booleans available on Red Hat.

Signed-off-by: Guido Trentalancia <guido@trentalancia.net>
---
 policy/Makefile |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- selinux-testsuite-git-23082016-orig/policy/Makefile	2016-08-23 20:50:08.527633728 +0200
+++ selinux-testsuite-git-23082016/policy/Makefile	2016-08-24 14:38:08.987455031 +0200
@@ -68,7 +68,7 @@ load_rhel: all
 
 load_general: all
 	# General policy load
-	/usr/sbin/setsebool allow_domain_fd_use=0
+	/usr/sbin/getsebool -a | grep -q allow_domain_fd_use && /usr/sbin/setsebool allow_domain_fd_use=0 || :
 	$(SEMODULE) -i test_policy/test_policy.pp
 
 unload_rhel:
@@ -77,7 +77,7 @@ unload_rhel:
 
 unload_general:
 	# General policy unload
-	/usr/sbin/setsebool allow_domain_fd_use=1
+	/usr/sbin/getsebool -a | grep -q allow_domain_fd_use && /usr/sbin/setsebool allow_domain_fd_use=1 || :
 	$(SEMODULE) -r test_policy
 
 clean:

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

* [PATCH v2] Build the SELinux testsuite on systems using the Reference Policy
  2016-08-24 12:39 [PATCH] Build the SELinux testsuite on systems using the Reference Policy Guido Trentalancia
  2016-08-24 14:11 ` [PATCH v2] " Guido Trentalancia
@ 2016-08-24 14:12 ` Guido Trentalancia
  1 sibling, 0 replies; 11+ messages in thread
From: Guido Trentalancia @ 2016-08-24 14:12 UTC (permalink / raw)
  To: selinux

Fix the Makefile in the policy subdirectory of the SELinux testsuite
so that it builds correctly on the standard Reference Policy which
does not have the same booleans available on Red Hat.

Signed-off-by: Guido Trentalancia <guido@trentalancia.net>
---
 policy/Makefile |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- selinux-testsuite-git-23082016-orig/policy/Makefile	2016-08-23 20:50:08.527633728 +0200
+++ selinux-testsuite-git-23082016/policy/Makefile	2016-08-24 14:38:08.987455031 +0200
@@ -68,7 +68,7 @@ load_rhel: all
 
 load_general: all
 	# General policy load
-	/usr/sbin/setsebool allow_domain_fd_use=0
+	/usr/sbin/getsebool -a | grep -q allow_domain_fd_use && /usr/sbin/setsebool allow_domain_fd_use=0 || :
 	$(SEMODULE) -i test_policy/test_policy.pp
 
 unload_rhel:
@@ -77,7 +77,7 @@ unload_rhel:
 
 unload_general:
 	# General policy unload
-	/usr/sbin/setsebool allow_domain_fd_use=1
+	/usr/sbin/getsebool -a | grep -q allow_domain_fd_use && /usr/sbin/setsebool allow_domain_fd_use=1 || :
 	$(SEMODULE) -r test_policy
 
 clean:

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

* Re: [PATCH v2] Build the SELinux testsuite on systems using the Reference Policy
  2016-08-24 14:11 ` [PATCH v2] " Guido Trentalancia
@ 2016-08-26 17:06   ` Stephen Smalley
  2016-08-26 17:40     ` [PATCH v3] " Guido Trentalancia
  0 siblings, 1 reply; 11+ messages in thread
From: Stephen Smalley @ 2016-08-26 17:06 UTC (permalink / raw)
  To: Guido Trentalancia, selinux

On 08/24/2016 10:11 AM, Guido Trentalancia wrote:
> Fix the Makefile in the policy subdirectory of the SELinux testsuite
> so that it builds correctly on the standard Reference Policy which
> does not have the same booleans available on Red Hat.
> 
> Signed-off-by: Guido Trentalancia <guido@trentalancia.net>
> ---
>  policy/Makefile |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> --- selinux-testsuite-git-23082016-orig/policy/Makefile	2016-08-23 20:50:08.527633728 +0200
> +++ selinux-testsuite-git-23082016/policy/Makefile	2016-08-24 14:38:08.987455031 +0200
> @@ -68,7 +68,7 @@ load_rhel: all
>  
>  load_general: all
>  	# General policy load
> -	/usr/sbin/setsebool allow_domain_fd_use=0
> +	/usr/sbin/getsebool -a | grep -q allow_domain_fd_use && /usr/sbin/setsebool allow_domain_fd_use=0 || :
>  	$(SEMODULE) -i test_policy/test_policy.pp

Just test the result of getsebool allow_domain_fd_use.
No need to dump them all and grep for the one you want.
Also, the above didn't work anyway on Fedora because the boolean has
been renamed and getsebool -a lists the new names (the old names can
still be passed to getsebool and setsebool because of the
booleans.subs_dist mapping).

>  
>  unload_rhel:
> @@ -77,7 +77,7 @@ unload_rhel:
>  
>  unload_general:
>  	# General policy unload
> -	/usr/sbin/setsebool allow_domain_fd_use=1
> +	/usr/sbin/getsebool -a | grep -q allow_domain_fd_use && /usr/sbin/setsebool allow_domain_fd_use=1 || :
>  	$(SEMODULE) -r test_policy
>  
>  clean:

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

* [PATCH v3] Build the SELinux testsuite on systems using the Reference Policy
  2016-08-26 17:06   ` Stephen Smalley
@ 2016-08-26 17:40     ` Guido Trentalancia
  2016-08-26 17:49       ` Stephen Smalley
  0 siblings, 1 reply; 11+ messages in thread
From: Guido Trentalancia @ 2016-08-26 17:40 UTC (permalink / raw)
  To: Stephen Smalley, selinux

Fix the Makefile in the policy subdirectory of the SELinux testsuite
so that it builds correctly on the standard Reference Policy which
does not have the same booleans available on Red Hat.

Signed-off-by: Guido Trentalancia <guido@trentalancia.net>
---
 policy/Makefile |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- selinux-testsuite-git-23082016-orig/policy/Makefile	2016-08-23 20:50:08.527633728 +0200
+++ selinux-testsuite-git-23082016/policy/Makefile	2016-08-26 19:37:13.195088500 +0200
@@ -68,7 +69,7 @@ load_rhel: all
 
 load_general: all
 	# General policy load
-	/usr/sbin/setsebool allow_domain_fd_use=0
+	/usr/sbin/getsebool allow_domain_fd_use > /dev/null && /usr/sbin/setsebool allow_domain_fd_use=0 || :
 	$(SEMODULE) -i test_policy/test_policy.pp
 
 unload_rhel:
@@ -77,7 +78,7 @@ unload_rhel:
 
 unload_general:
 	# General policy unload
-	/usr/sbin/setsebool allow_domain_fd_use=1
+	/usr/sbin/getsebool allow_domain_fd_use > /dev/null && /usr/sbin/setsebool allow_domain_fd_use=1 || :
 	$(SEMODULE) -r test_policy
 
 clean:

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

* Re: [PATCH v3] Build the SELinux testsuite on systems using the Reference Policy
  2016-08-26 17:40     ` [PATCH v3] " Guido Trentalancia
@ 2016-08-26 17:49       ` Stephen Smalley
  2016-08-26 17:50         ` [PATCH v4] " Guido Trentalancia
  0 siblings, 1 reply; 11+ messages in thread
From: Stephen Smalley @ 2016-08-26 17:49 UTC (permalink / raw)
  To: Guido Trentalancia, selinux

On 08/26/2016 01:40 PM, Guido Trentalancia wrote:
> Fix the Makefile in the policy subdirectory of the SELinux testsuite
> so that it builds correctly on the standard Reference Policy which
> does not have the same booleans available on Red Hat.
> 
> Signed-off-by: Guido Trentalancia <guido@trentalancia.net>
> ---
>  policy/Makefile |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> --- selinux-testsuite-git-23082016-orig/policy/Makefile	2016-08-23 20:50:08.527633728 +0200
> +++ selinux-testsuite-git-23082016/policy/Makefile	2016-08-26 19:37:13.195088500 +0200
> @@ -68,7 +69,7 @@ load_rhel: all
>  
>  load_general: all
>  	# General policy load
> -	/usr/sbin/setsebool allow_domain_fd_use=0
> +	/usr/sbin/getsebool allow_domain_fd_use > /dev/null && /usr/sbin/setsebool allow_domain_fd_use=0 || :
>  	$(SEMODULE) -i test_policy/test_policy.pp

Don't you need 2>&1 as well to suppress error output when the boolean
does not exist?

>  
>  unload_rhel:
> @@ -77,7 +78,7 @@ unload_rhel:
>  
>  unload_general:
>  	# General policy unload
> -	/usr/sbin/setsebool allow_domain_fd_use=1
> +	/usr/sbin/getsebool allow_domain_fd_use > /dev/null && /usr/sbin/setsebool allow_domain_fd_use=1 || :
>  	$(SEMODULE) -r test_policy
>  
>  clean:
> 

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

* [PATCH v4] Build the SELinux testsuite on systems using the Reference Policy
  2016-08-26 17:49       ` Stephen Smalley
@ 2016-08-26 17:50         ` Guido Trentalancia
  2016-08-26 17:58           ` Stephen Smalley
  0 siblings, 1 reply; 11+ messages in thread
From: Guido Trentalancia @ 2016-08-26 17:50 UTC (permalink / raw)
  To: Stephen Smalley, selinux

Fix the Makefile in the policy subdirectory of the SELinux testsuite
so that it builds correctly on the standard Reference Policy which
does not have the same booleans available on Red Hat.

Signed-off-by: Guido Trentalancia <guido@trentalancia.net>
---
 policy/Makefile |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- selinux-testsuite-git-23082016-orig/policy/Makefile	2016-08-23 20:50:08.527633728 +0200
+++ selinux-testsuite-git-23082016/policy/Makefile	2016-08-26 19:37:13.195088500 +0200
@@ -68,7 +69,7 @@ load_rhel: all
 
 load_general: all
 	# General policy load
-	/usr/sbin/setsebool allow_domain_fd_use=0
+	/usr/sbin/getsebool allow_domain_fd_use > /dev/null 2&>1 && /usr/sbin/setsebool allow_domain_fd_use=0 || :
 	$(SEMODULE) -i test_policy/test_policy.pp
 
 unload_rhel:
@@ -77,7 +78,7 @@ unload_rhel:
 
 unload_general:
 	# General policy unload
-	/usr/sbin/setsebool allow_domain_fd_use=1
+	/usr/sbin/getsebool allow_domain_fd_use > /dev/null 2&>1 && /usr/sbin/setsebool allow_domain_fd_use=1 || :
 	$(SEMODULE) -r test_policy
 
 clean:

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

* Re: [PATCH v4] Build the SELinux testsuite on systems using the Reference Policy
  2016-08-26 17:50         ` [PATCH v4] " Guido Trentalancia
@ 2016-08-26 17:58           ` Stephen Smalley
  2016-08-26 18:36             ` [PATCH v5] " Guido Trentalancia
  0 siblings, 1 reply; 11+ messages in thread
From: Stephen Smalley @ 2016-08-26 17:58 UTC (permalink / raw)
  To: Guido Trentalancia, selinux

On 08/26/2016 01:50 PM, Guido Trentalancia wrote:
> Fix the Makefile in the policy subdirectory of the SELinux testsuite
> so that it builds correctly on the standard Reference Policy which
> does not have the same booleans available on Red Hat.
> 
> Signed-off-by: Guido Trentalancia <guido@trentalancia.net>
> ---
>  policy/Makefile |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> --- selinux-testsuite-git-23082016-orig/policy/Makefile	2016-08-23 20:50:08.527633728 +0200
> +++ selinux-testsuite-git-23082016/policy/Makefile	2016-08-26 19:37:13.195088500 +0200
> @@ -68,7 +69,7 @@ load_rhel: all
>  
>  load_general: all
>  	# General policy load
> -	/usr/sbin/setsebool allow_domain_fd_use=0
> +	/usr/sbin/getsebool allow_domain_fd_use > /dev/null 2&>1 && /usr/sbin/setsebool allow_domain_fd_use=0 || :

Hmm...doesn't seem to be executing the setsebool command now; boolean is
left unchanged and the corresponding tests fail.

>  	$(SEMODULE) -i test_policy/test_policy.pp
>  
>  unload_rhel:
> @@ -77,7 +78,7 @@ unload_rhel:
>  
>  unload_general:
>  	# General policy unload
> -	/usr/sbin/setsebool allow_domain_fd_use=1
> +	/usr/sbin/getsebool allow_domain_fd_use > /dev/null 2&>1 && /usr/sbin/setsebool allow_domain_fd_use=1 || :
>  	$(SEMODULE) -r test_policy
>  
>  clean:
> 

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

* [PATCH v5] Build the SELinux testsuite on systems using the Reference Policy
  2016-08-26 17:58           ` Stephen Smalley
@ 2016-08-26 18:36             ` Guido Trentalancia
  2016-09-01 12:38               ` Stephen Smalley
  0 siblings, 1 reply; 11+ messages in thread
From: Guido Trentalancia @ 2016-08-26 18:36 UTC (permalink / raw)
  To: Stephen Smalley, selinux

Sorry about that ! I did not test it properly because I was hitting a
problem with the policy...

The following one should work, although it's slightly noisy...

Fix the Makefile in the policy subdirectory of the SELinux testsuite
so that it builds correctly on the standard Reference Policy which
does not have the same booleans available on Red Hat.

Previous versions were not working within the Makefile.

Signed-off-by: Guido Trentalancia <guido@trentalancia.net>
---
 policy/Makefile |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- selinux-testsuite-git-23082016-orig/policy/Makefile	2016-08-23 20:50:08.527633728 +0200
+++ selinux-testsuite-git-23082016/policy/Makefile	2016-08-26 20:33:01.677418513 +0200
@@ -68,7 +69,7 @@ load_rhel: all
 
 load_general: all
 	# General policy load
-	/usr/sbin/setsebool allow_domain_fd_use=0
+	@-/usr/sbin/setsebool allow_domain_fd_use=0
 	$(SEMODULE) -i test_policy/test_policy.pp
 
 unload_rhel:
@@ -77,7 +78,7 @@ unload_rhel:
 
 unload_general:
 	# General policy unload
-	/usr/sbin/setsebool allow_domain_fd_use=1
+	@-/usr/sbin/setsebool allow_domain_fd_use=1
 	$(SEMODULE) -r test_policy
 
 clean:

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

* Re: [PATCH v5] Build the SELinux testsuite on systems using the Reference Policy
  2016-08-26 18:36             ` [PATCH v5] " Guido Trentalancia
@ 2016-09-01 12:38               ` Stephen Smalley
  2016-09-01 12:39                 ` Guido Trentalancia
  0 siblings, 1 reply; 11+ messages in thread
From: Stephen Smalley @ 2016-09-01 12:38 UTC (permalink / raw)
  To: Guido Trentalancia, selinux

On 08/26/2016 02:36 PM, Guido Trentalancia wrote:
> Sorry about that ! I did not test it properly because I was hitting a
> problem with the policy...
> 
> The following one should work, although it's slightly noisy...
> 
> Fix the Makefile in the policy subdirectory of the SELinux testsuite
> so that it builds correctly on the standard Reference Policy which
> does not have the same booleans available on Red Hat.
> 
> Previous versions were not working within the Makefile.
> 
> Signed-off-by: Guido Trentalancia <guido@trentalancia.net>

Thanks, applied.

> ---
>  policy/Makefile |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> --- selinux-testsuite-git-23082016-orig/policy/Makefile	2016-08-23 20:50:08.527633728 +0200
> +++ selinux-testsuite-git-23082016/policy/Makefile	2016-08-26 20:33:01.677418513 +0200
> @@ -68,7 +69,7 @@ load_rhel: all
>  
>  load_general: all
>  	# General policy load
> -	/usr/sbin/setsebool allow_domain_fd_use=0
> +	@-/usr/sbin/setsebool allow_domain_fd_use=0
>  	$(SEMODULE) -i test_policy/test_policy.pp
>  
>  unload_rhel:
> @@ -77,7 +78,7 @@ unload_rhel:
>  
>  unload_general:
>  	# General policy unload
> -	/usr/sbin/setsebool allow_domain_fd_use=1
> +	@-/usr/sbin/setsebool allow_domain_fd_use=1
>  	$(SEMODULE) -r test_policy
>  
>  clean:
> _______________________________________________
> Selinux mailing list
> Selinux@tycho.nsa.gov
> To unsubscribe, send email to Selinux-leave@tycho.nsa.gov.
> To get help, send an email containing "help" to Selinux-request@tycho.nsa.gov.
> 

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

* Re: [PATCH v5] Build the SELinux testsuite on systems using the Reference Policy
  2016-09-01 12:38               ` Stephen Smalley
@ 2016-09-01 12:39                 ` Guido Trentalancia
  0 siblings, 0 replies; 11+ messages in thread
From: Guido Trentalancia @ 2016-09-01 12:39 UTC (permalink / raw)
  To: selinux

Hello Stephen.

Thanks very much for applying the patch.

Guido

On Thu, 01/09/2016 at 08.38 -0400, Stephen Smalley wrote:
> On 08/26/2016 02:36 PM, Guido Trentalancia wrote:
> > 
> > Sorry about that ! I did not test it properly because I was hitting
> > a
> > problem with the policy...
> > 
> > The following one should work, although it's slightly noisy...
> > 
> > Fix the Makefile in the policy subdirectory of the SELinux
> > testsuite
> > so that it builds correctly on the standard Reference Policy which
> > does not have the same booleans available on Red Hat.
> > 
> > Previous versions were not working within the Makefile.
> > 
> > Signed-off-by: Guido Trentalancia <guido@trentalancia.net>
> 
> Thanks, applied.


> > 
> > ---
> >  policy/Makefile |    4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > --- selinux-testsuite-git-23082016-orig/policy/Makefile	2016
> > -08-23 20:50:08.527633728 +0200
> > +++ selinux-testsuite-git-23082016/policy/Makefile	2016-08-
> > 26 20:33:01.677418513 +0200
> > @@ -68,7 +69,7 @@ load_rhel: all
> >  
> >  load_general: all
> >  	# General policy load
> > -	/usr/sbin/setsebool allow_domain_fd_use=0
> > +	@-/usr/sbin/setsebool allow_domain_fd_use=0
> >  	$(SEMODULE) -i test_policy/test_policy.pp
> >  
> >  unload_rhel:
> > @@ -77,7 +78,7 @@ unload_rhel:
> >  
> >  unload_general:
> >  	# General policy unload
> > -	/usr/sbin/setsebool allow_domain_fd_use=1
> > +	@-/usr/sbin/setsebool allow_domain_fd_use=1
> >  	$(SEMODULE) -r test_policy
> >  
> >  clean:
> > 

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

end of thread, other threads:[~2016-09-01 12:39 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-24 12:39 [PATCH] Build the SELinux testsuite on systems using the Reference Policy Guido Trentalancia
2016-08-24 14:11 ` [PATCH v2] " Guido Trentalancia
2016-08-26 17:06   ` Stephen Smalley
2016-08-26 17:40     ` [PATCH v3] " Guido Trentalancia
2016-08-26 17:49       ` Stephen Smalley
2016-08-26 17:50         ` [PATCH v4] " Guido Trentalancia
2016-08-26 17:58           ` Stephen Smalley
2016-08-26 18:36             ` [PATCH v5] " Guido Trentalancia
2016-09-01 12:38               ` Stephen Smalley
2016-09-01 12:39                 ` Guido Trentalancia
2016-08-24 14:12 ` [PATCH v2] " Guido Trentalancia

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.