2017-08-30 16:22:40

by Sugar, David

[permalink] [raw]
Subject: [refpolicy] [PATCH 1/1]: Strip spaces from NAME

Strip trailing space(s) from 'NAME' being read from /etc/selinux/config as a trailing space in that name will cause a weird error during the make process for modules built out of tree. This is seen on current RedHat machines which have space in the 'SELINUXTYPE' variable.

---
support/Makefile.devel | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/support/Makefile.devel b/support/Makefile.devel
index a0e8c2a2..d531dd88 100644
--- a/support/Makefile.devel
+++ b/support/Makefile.devel
@@ -8,7 +8,7 @@ EINFO ?= echo
PYTHON ?= python
CUT ?= cut

-NAME ?= $(shell $(AWK) -F= '/^SELINUXTYPE/{ print $$2 }' /etc/selinux/config)
+NAME ?= $(strip $(shell $(AWK) -F= '/^SELINUXTYPE/{ print $$2 }' /etc/selinux/config))
SHAREDIR ?= /usr/share/selinux
HEADERDIR ?= $(SHAREDIR)/$(NAME)/include

--
2.13.5


2017-09-01 01:15:17

by Chris PeBenito

[permalink] [raw]
Subject: [refpolicy] [PATCH 1/1]: Strip spaces from NAME

On 08/30/2017 12:22 PM, David Sugar via refpolicy wrote:
> Strip trailing space(s) from 'NAME' being read from /etc/selinux/config as a trailing space in that name will cause a weird error during the make process for modules built out of tree. This is seen on current RedHat machines which have space in the 'SELINUXTYPE' variable.
>
> ---
> support/Makefile.devel | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/support/Makefile.devel b/support/Makefile.devel
> index a0e8c2a2..d531dd88 100644
> --- a/support/Makefile.devel
> +++ b/support/Makefile.devel
> @@ -8,7 +8,7 @@ EINFO ?= echo
> PYTHON ?= python
> CUT ?= cut
>
> -NAME ?= $(shell $(AWK) -F= '/^SELINUXTYPE/{ print $$2 }' /etc/selinux/config)
> +NAME ?= $(strip $(shell $(AWK) -F= '/^SELINUXTYPE/{ print $$2 }' /etc/selinux/config))
> SHAREDIR ?= /usr/share/selinux
> HEADERDIR ?= $(SHAREDIR)/$(NAME)/include

Merged.

--
Chris PeBenito