* [PATCH] selinux-testsuite: fix RHEL detection
@ 2015-02-06 22:34 Paul Moore
2015-02-09 16:13 ` Stephen Smalley
0 siblings, 1 reply; 3+ messages in thread
From: Paul Moore @ 2015-02-06 22:34 UTC (permalink / raw)
To: selinux
The redhat-release package is not consistently named across RHEL
releases, use the /etc/redhat-release instead to detect the RHEL
version.
Signed-off-by: Paul Moore <pmoore@redhat.com>
---
tests/Makefile | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/tests/Makefile b/tests/Makefile
index 3838e14..7c27787 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -1,18 +1,19 @@
-REDHAT_RELEASE=$(shell rpm -q redhat-release)
+RHEL_VER=$(shell cat /etc/redhat-release)
+RHEL_VER_PREFIX=Red Hat Enterprise Linux Server release
SUBDIRS_COMMON:=domain_trans entrypoint execshare exectrace execute_no_trans fdreceive inherit link mkdir msg open ptrace readlink relabel rename rxdir sem setattr setnice shm sigkill stat sysctl task_create task_setnice task_setscheduler task_getscheduler task_getsid task_getpgid task_setpgid wait file ioctl capable_file capable_net capable_sys
SUBDIRS:= $(SUBDIRS_COMMON) dyntrans dyntrace bounds nnp
-ifeq (redhat-release-4, $(findstring redhat-release-4, $(REDHAT_RELEASE)))
+ifeq ($(RHEL_VER_PREFIX)4, $(findstring $(RHEL_VER_PREFIX)4, $(RHEL_VER)))
SUBDIRS:=$(SUBDIRS_COMMON)
endif
-ifeq (redhat-release-5, $(findstring redhat-release-5, $(REDHAT_RELEASE)))
+ifeq ($(RHEL_VER_PREFIX)5, $(findstring $(RHEL_VER_PREFIX)5, $(RHEL_VER)))
SUBDIRS:=$(SUBDIRS_COMMON) dyntrace dyntrans
endif
-ifeq (redhat-release-6, $(findstring redhat-release-6, $(REDHAT_RELEASE)))
+ifeq ($(RHEL_VER_PREFIX)6, $(findstring $(RHEL_VER_PREFIX)6, $(RHEL_VER)))
SUBDIRS:=$(SUBDIRS_COMMON) dyntrace dyntrans bounds
endif
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] selinux-testsuite: fix RHEL detection
2015-02-06 22:34 [PATCH] selinux-testsuite: fix RHEL detection Paul Moore
@ 2015-02-09 16:13 ` Stephen Smalley
2015-02-09 17:07 ` Paul Moore
0 siblings, 1 reply; 3+ messages in thread
From: Stephen Smalley @ 2015-02-09 16:13 UTC (permalink / raw)
To: Paul Moore; +Cc: selinux
Doesn't RHEL have variants other than Server?
On Fri, Feb 6, 2015 at 5:34 PM, Paul Moore <pmoore@redhat.com> wrote:
> The redhat-release package is not consistently named across RHEL
> releases, use the /etc/redhat-release instead to detect the RHEL
> version.
>
> Signed-off-by: Paul Moore <pmoore@redhat.com>
> ---
> tests/Makefile | 9 +++++----
> 1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/tests/Makefile b/tests/Makefile
> index 3838e14..7c27787 100644
> --- a/tests/Makefile
> +++ b/tests/Makefile
> @@ -1,18 +1,19 @@
> -REDHAT_RELEASE=$(shell rpm -q redhat-release)
> +RHEL_VER=$(shell cat /etc/redhat-release)
> +RHEL_VER_PREFIX=Red Hat Enterprise Linux Server release
>
> SUBDIRS_COMMON:=domain_trans entrypoint execshare exectrace execute_no_trans fdreceive inherit link mkdir msg open ptrace readlink relabel rename rxdir sem setattr setnice shm sigkill stat sysctl task_create task_setnice task_setscheduler task_getscheduler task_getsid task_getpgid task_setpgid wait file ioctl capable_file capable_net capable_sys
>
> SUBDIRS:= $(SUBDIRS_COMMON) dyntrans dyntrace bounds nnp
>
> -ifeq (redhat-release-4, $(findstring redhat-release-4, $(REDHAT_RELEASE)))
> +ifeq ($(RHEL_VER_PREFIX)4, $(findstring $(RHEL_VER_PREFIX)4, $(RHEL_VER)))
> SUBDIRS:=$(SUBDIRS_COMMON)
> endif
>
> -ifeq (redhat-release-5, $(findstring redhat-release-5, $(REDHAT_RELEASE)))
> +ifeq ($(RHEL_VER_PREFIX)5, $(findstring $(RHEL_VER_PREFIX)5, $(RHEL_VER)))
> SUBDIRS:=$(SUBDIRS_COMMON) dyntrace dyntrans
> endif
>
> -ifeq (redhat-release-6, $(findstring redhat-release-6, $(REDHAT_RELEASE)))
> +ifeq ($(RHEL_VER_PREFIX)6, $(findstring $(RHEL_VER_PREFIX)6, $(RHEL_VER)))
> SUBDIRS:=$(SUBDIRS_COMMON) dyntrace dyntrans bounds
> endif
>
>
> _______________________________________________
> 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] 3+ messages in thread
* Re: [PATCH] selinux-testsuite: fix RHEL detection
2015-02-09 16:13 ` Stephen Smalley
@ 2015-02-09 17:07 ` Paul Moore
0 siblings, 0 replies; 3+ messages in thread
From: Paul Moore @ 2015-02-09 17:07 UTC (permalink / raw)
To: Stephen Smalley; +Cc: selinux
On Monday, February 09, 2015 11:13:02 AM Stephen Smalley wrote:
> Doesn't RHEL have variants other than Server?
Good point. I'll look into the other variants.
> On Fri, Feb 6, 2015 at 5:34 PM, Paul Moore <pmoore@redhat.com> wrote:
> > The redhat-release package is not consistently named across RHEL
> > releases, use the /etc/redhat-release instead to detect the RHEL
> > version.
> >
> > Signed-off-by: Paul Moore <pmoore@redhat.com>
> > ---
> >
> > tests/Makefile | 9 +++++----
> > 1 file changed, 5 insertions(+), 4 deletions(-)
> >
> > diff --git a/tests/Makefile b/tests/Makefile
> > index 3838e14..7c27787 100644
> > --- a/tests/Makefile
> > +++ b/tests/Makefile
> > @@ -1,18 +1,19 @@
> > -REDHAT_RELEASE=$(shell rpm -q redhat-release)
> > +RHEL_VER=$(shell cat /etc/redhat-release)
> > +RHEL_VER_PREFIX=Red Hat Enterprise Linux Server release
> >
> > SUBDIRS_COMMON:=domain_trans entrypoint execshare exectrace
> > execute_no_trans fdreceive inherit link mkdir msg open ptrace readlink
> > relabel rename rxdir sem setattr setnice shm sigkill stat sysctl
> > task_create task_setnice task_setscheduler task_getscheduler task_getsid
> > task_getpgid task_setpgid wait file ioctl capable_file capable_net
> > capable_sys
> >
> > SUBDIRS:= $(SUBDIRS_COMMON) dyntrans dyntrace bounds nnp
> >
> > -ifeq (redhat-release-4, $(findstring redhat-release-4,
> > $(REDHAT_RELEASE)))
> > +ifeq ($(RHEL_VER_PREFIX)4, $(findstring $(RHEL_VER_PREFIX)4,
> > $(RHEL_VER)))
> >
> > SUBDIRS:=$(SUBDIRS_COMMON)
> >
> > endif
> >
> > -ifeq (redhat-release-5, $(findstring redhat-release-5,
> > $(REDHAT_RELEASE)))
> > +ifeq ($(RHEL_VER_PREFIX)5, $(findstring $(RHEL_VER_PREFIX)5,
> > $(RHEL_VER)))
> >
> > SUBDIRS:=$(SUBDIRS_COMMON) dyntrace dyntrans
> >
> > endif
> >
> > -ifeq (redhat-release-6, $(findstring redhat-release-6,
> > $(REDHAT_RELEASE)))
> > +ifeq ($(RHEL_VER_PREFIX)6, $(findstring $(RHEL_VER_PREFIX)6,
> > $(RHEL_VER)))
> >
> > SUBDIRS:=$(SUBDIRS_COMMON) dyntrace dyntrans bounds
> >
> > endif
> >
> > _______________________________________________
> > 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.
--
paul moore
security @ redhat
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-02-09 17:07 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-06 22:34 [PATCH] selinux-testsuite: fix RHEL detection Paul Moore
2015-02-09 16:13 ` Stephen Smalley
2015-02-09 17:07 ` Paul Moore
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.