|
|
0d9f220 |
diff --git checkpolicy-2.7/Makefile checkpolicy-2.7/Makefile
|
|
|
0d9f220 |
index 68e11f2..4c817cd 100644
|
|
|
0d9f220 |
--- checkpolicy-2.7/Makefile
|
|
|
0d9f220 |
+++ checkpolicy-2.7/Makefile
|
|
|
0d9f220 |
@@ -1,12 +1,9 @@
|
|
|
0d9f220 |
#
|
|
|
0d9f220 |
# Makefile for building the checkpolicy program
|
|
|
0d9f220 |
#
|
|
|
0d9f220 |
-PREFIX ?= $(DESTDIR)/usr
|
|
|
0d9f220 |
+PREFIX ?= /usr
|
|
|
0d9f220 |
BINDIR ?= $(PREFIX)/bin
|
|
|
0d9f220 |
MANDIR ?= $(PREFIX)/share/man
|
|
|
0d9f220 |
-LIBDIR ?= $(PREFIX)/lib
|
|
|
0d9f220 |
-INCLUDEDIR ?= $(PREFIX)/include
|
|
|
0d9f220 |
-LIBSEPOLA ?= $(LIBDIR)/libsepol.a
|
|
|
0d9f220 |
TARGETS = checkpolicy checkmodule
|
|
|
0d9f220 |
|
|
|
0d9f220 |
LEX = flex
|
|
|
0d9f220 |
@@ -14,7 +11,12 @@ YACC = bison -y
|
|
|
0d9f220 |
|
|
|
0d9f220 |
CFLAGS ?= -g -Wall -Werror -Wshadow -O2 -pipe -fno-strict-aliasing
|
|
|
0d9f220 |
|
|
|
0d9f220 |
-override CFLAGS += -I.
|
|
|
0d9f220 |
+# If no specific libsepol.a is specified, fall back on LDFLAGS search path
|
|
|
0d9f220 |
+# Otherwise, as $(LIBSEPOLA) already appears in the dependencies, there
|
|
|
0d9f220 |
+# is no need to define a value for LDLIBS_LIBSEPOLA
|
|
|
0d9f220 |
+ifeq ($(LIBSEPOLA),)
|
|
|
0d9f220 |
+ LDLIBS_LIBSEPOLA := -l:libsepol.a
|
|
|
0d9f220 |
+endif
|
|
|
0d9f220 |
|
|
|
0d9f220 |
CHECKOBJS = y.tab.o lex.yy.o queue.o module_compiler.o parse_util.o \
|
|
|
0d9f220 |
policy_define.o
|
|
|
0d9f220 |
@@ -27,8 +29,10 @@ all: $(TARGETS)
|
|
|
0d9f220 |
$(MAKE) -C test
|
|
|
0d9f220 |
|
|
|
0d9f220 |
checkpolicy: $(CHECKPOLOBJS) $(LIBSEPOLA)
|
|
|
0d9f220 |
+ $(CC) -o $@ $^ $(LDFLAGS) $(LDLIBS_LIBSEPOLA)
|
|
|
0d9f220 |
|
|
|
0d9f220 |
checkmodule: $(CHECKMODOBJS) $(LIBSEPOLA)
|
|
|
0d9f220 |
+ $(CC) -o $@ $^ $(LDFLAGS) $(LDLIBS_LIBSEPOLA)
|
|
|
0d9f220 |
|
|
|
0d9f220 |
%.o: %.c
|
|
|
0d9f220 |
$(CC) $(CFLAGS) -o $@ -c $<
|
|
|
0d9f220 |
@@ -46,15 +50,15 @@ lex.yy.c: policy_scan.l y.tab.c
|
|
|
0d9f220 |
$(LEX) policy_scan.l
|
|
|
0d9f220 |
|
|
|
0d9f220 |
install: all
|
|
|
0d9f220 |
- -mkdir -p $(BINDIR)
|
|
|
0d9f220 |
- -mkdir -p $(MANDIR)/man8
|
|
|
0d9f220 |
- install -m 755 $(TARGETS) $(BINDIR)
|
|
|
0d9f220 |
- install -m 644 checkpolicy.8 $(MANDIR)/man8
|
|
|
0d9f220 |
- install -m 644 checkmodule.8 $(MANDIR)/man8
|
|
|
0d9f220 |
+ -mkdir -p $(DESTDIR)$(BINDIR)
|
|
|
0d9f220 |
+ -mkdir -p $(DESTDIR)$(MANDIR)/man8
|
|
|
0d9f220 |
+ install -m 755 $(TARGETS) $(DESTDIR)$(BINDIR)
|
|
|
0d9f220 |
+ install -m 644 checkpolicy.8 $(DESTDIR)$(MANDIR)/man8
|
|
|
0d9f220 |
+ install -m 644 checkmodule.8 $(DESTDIR)$(MANDIR)/man8
|
|
|
0d9f220 |
|
|
|
0d9f220 |
relabel: install
|
|
|
0d9f220 |
- /sbin/restorecon $(BINDIR)/checkpolicy
|
|
|
0d9f220 |
- /sbin/restorecon $(BINDIR)/checkmodule
|
|
|
0d9f220 |
+ /sbin/restorecon $(DESTDIR)$(BINDIR)/checkpolicy
|
|
|
0d9f220 |
+ /sbin/restorecon $(DESTDIR)$(BINDIR)/checkmodule
|
|
|
0d9f220 |
|
|
|
0d9f220 |
clean:
|
|
|
0d9f220 |
-rm -f $(TARGETS) $(CHECKPOLOBJS) $(CHECKMODOBJS) y.tab.c y.tab.h lex.yy.c
|
|
|
39e0ef5 |
diff --git checkpolicy-2.7/checkmodule.8 checkpolicy-2.7/checkmodule.8
|
|
|
39e0ef5 |
index ee95882..cf76591 100644
|
|
|
39e0ef5 |
--- checkpolicy-2.7/checkmodule.8
|
|
|
39e0ef5 |
+++ checkpolicy-2.7/checkmodule.8
|
|
|
39e0ef5 |
@@ -64,4 +64,4 @@ especially "Configuring the SELinux Policy".
|
|
|
39e0ef5 |
This manual page was copied from the checkpolicy man page
|
|
|
39e0ef5 |
written by Arpad Magosanyi <mag@bunuel.tii.matav.hu>,
|
|
|
39e0ef5 |
and edited by Dan Walsh <dwalsh@redhat.com>.
|
|
|
39e0ef5 |
-The program was written by Stephen Smalley <sds@epoch.ncsc.mil>.
|
|
|
39e0ef5 |
+The program was written by Stephen Smalley <sds@tycho.nsa.gov>.
|
|
|
39e0ef5 |
diff --git checkpolicy-2.7/checkpolicy.8 checkpolicy-2.7/checkpolicy.8
|
|
|
39e0ef5 |
index 7b28696..1c8805d 100644
|
|
|
39e0ef5 |
--- checkpolicy-2.7/checkpolicy.8
|
|
|
39e0ef5 |
+++ checkpolicy-2.7/checkpolicy.8
|
|
|
39e0ef5 |
@@ -58,5 +58,5 @@ especially "Configuring the SELinux Policy".
|
|
|
39e0ef5 |
|
|
|
39e0ef5 |
.SH AUTHOR
|
|
|
39e0ef5 |
This manual page was written by Arpad Magosanyi <mag@bunuel.tii.matav.hu>,
|
|
|
39e0ef5 |
-and edited by Stephen Smalley <sds@epoch.ncsc.mil>.
|
|
|
39e0ef5 |
-The program was written by Stephen Smalley <sds@epoch.ncsc.mil>.
|
|
|
39e0ef5 |
+and edited by Stephen Smalley <sds@tycho.nsa.gov>.
|
|
|
39e0ef5 |
+The program was written by Stephen Smalley <sds@tycho.nsa.gov>.
|
|
|
39e0ef5 |
diff --git checkpolicy-2.7/checkpolicy.c checkpolicy-2.7/checkpolicy.c
|
|
|
bb731d2 |
index b75f2af..fbda455 100644
|
|
|
39e0ef5 |
--- checkpolicy-2.7/checkpolicy.c
|
|
|
39e0ef5 |
+++ checkpolicy-2.7/checkpolicy.c
|
|
|
39e0ef5 |
@@ -1,6 +1,6 @@
|
|
|
39e0ef5 |
|
|
|
39e0ef5 |
/*
|
|
|
39e0ef5 |
- * Author : Stephen Smalley, <sds@epoch.ncsc.mil>
|
|
|
39e0ef5 |
+ * Author : Stephen Smalley, <sds@tycho.nsa.gov>
|
|
|
39e0ef5 |
*/
|
|
|
39e0ef5 |
|
|
|
39e0ef5 |
/*
|
|
|
bb731d2 |
@@ -69,6 +69,9 @@
|
|
|
bb731d2 |
#ifndef IPPROTO_DCCP
|
|
|
bb731d2 |
#define IPPROTO_DCCP 33
|
|
|
bb731d2 |
#endif
|
|
|
bb731d2 |
+#ifndef IPPROTO_SCTP
|
|
|
bb731d2 |
+#define IPPROTO_SCTP 132
|
|
|
bb731d2 |
+#endif
|
|
|
bb731d2 |
#include <arpa/inet.h>
|
|
|
bb731d2 |
#include <fcntl.h>
|
|
|
bb731d2 |
#include <stdio.h>
|
|
|
bb731d2 |
@@ -944,6 +947,8 @@ int main(int argc, char **argv)
|
|
|
bb731d2 |
protocol = IPPROTO_UDP;
|
|
|
bb731d2 |
else if (!strcmp(ans, "dccp") || !strcmp(ans, "DCCP"))
|
|
|
bb731d2 |
protocol = IPPROTO_DCCP;
|
|
|
bb731d2 |
+ else if (!strcmp(ans, "sctp") || !strcmp(ans, "SCTP"))
|
|
|
bb731d2 |
+ protocol = IPPROTO_SCTP;
|
|
|
bb731d2 |
else {
|
|
|
bb731d2 |
printf("unknown protocol\n");
|
|
|
bb731d2 |
break;
|
|
|
39e0ef5 |
diff --git checkpolicy-2.7/policy_define.c checkpolicy-2.7/policy_define.c
|
|
|
bb731d2 |
index f12ebdb..11fd37d 100644
|
|
|
39e0ef5 |
--- checkpolicy-2.7/policy_define.c
|
|
|
39e0ef5 |
+++ checkpolicy-2.7/policy_define.c
|
|
|
39e0ef5 |
@@ -1,5 +1,5 @@
|
|
|
39e0ef5 |
/*
|
|
|
39e0ef5 |
- * Author : Stephen Smalley, <sds@epoch.ncsc.mil>
|
|
|
39e0ef5 |
+ * Author : Stephen Smalley, <sds@tycho.nsa.gov>
|
|
|
39e0ef5 |
*/
|
|
|
39e0ef5 |
|
|
|
39e0ef5 |
/*
|
|
|
bb731d2 |
@@ -40,6 +40,9 @@
|
|
|
bb731d2 |
#ifndef IPPROTO_DCCP
|
|
|
bb731d2 |
#define IPPROTO_DCCP 33
|
|
|
bb731d2 |
#endif
|
|
|
bb731d2 |
+#ifndef IPPROTO_SCTP
|
|
|
bb731d2 |
+#define IPPROTO_SCTP 132
|
|
|
bb731d2 |
+#endif
|
|
|
bb731d2 |
#include <arpa/inet.h>
|
|
|
bb731d2 |
#include <stdlib.h>
|
|
|
bb731d2 |
#include <limits.h>
|
|
|
bb731d2 |
@@ -5004,6 +5007,8 @@ int define_port_context(unsigned int low, unsigned int high)
|
|
|
bb731d2 |
protocol = IPPROTO_UDP;
|
|
|
bb731d2 |
} else if ((strcmp(id, "dccp") == 0) || (strcmp(id, "DCCP") == 0)) {
|
|
|
bb731d2 |
protocol = IPPROTO_DCCP;
|
|
|
bb731d2 |
+ } else if ((strcmp(id, "sctp") == 0) || (strcmp(id, "SCTP") == 0)) {
|
|
|
bb731d2 |
+ protocol = IPPROTO_SCTP;
|
|
|
bb731d2 |
} else {
|
|
|
bb731d2 |
yyerror2("unrecognized protocol %s", id);
|
|
|
bb731d2 |
goto bad;
|
|
|
39e0ef5 |
diff --git checkpolicy-2.7/policy_parse.y checkpolicy-2.7/policy_parse.y
|
|
|
39e0ef5 |
index 6b406c8..247bd4e 100644
|
|
|
39e0ef5 |
--- checkpolicy-2.7/policy_parse.y
|
|
|
39e0ef5 |
+++ checkpolicy-2.7/policy_parse.y
|
|
|
39e0ef5 |
@@ -1,6 +1,6 @@
|
|
|
39e0ef5 |
|
|
|
39e0ef5 |
/*
|
|
|
39e0ef5 |
- * Author : Stephen Smalley, <sds@epoch.ncsc.mil>
|
|
|
39e0ef5 |
+ * Author : Stephen Smalley, <sds@tycho.nsa.gov>
|
|
|
39e0ef5 |
*/
|
|
|
39e0ef5 |
|
|
|
39e0ef5 |
/*
|
|
|
39e0ef5 |
diff --git checkpolicy-2.7/policy_scan.l checkpolicy-2.7/policy_scan.l
|
|
|
39e0ef5 |
index e6c4898..e93ccb6 100644
|
|
|
39e0ef5 |
--- checkpolicy-2.7/policy_scan.l
|
|
|
39e0ef5 |
+++ checkpolicy-2.7/policy_scan.l
|
|
|
39e0ef5 |
@@ -1,6 +1,6 @@
|
|
|
39e0ef5 |
|
|
|
39e0ef5 |
/*
|
|
|
39e0ef5 |
- * Author : Stephen Smalley, <sds@epoch.ncsc.mil>
|
|
|
39e0ef5 |
+ * Author : Stephen Smalley, <sds@tycho.nsa.gov>
|
|
|
39e0ef5 |
*/
|
|
|
39e0ef5 |
|
|
|
39e0ef5 |
/* Updated: David Caplan, <dac@tresys.com>
|
|
|
39e0ef5 |
diff --git checkpolicy-2.7/queue.c checkpolicy-2.7/queue.c
|
|
|
39e0ef5 |
index acc991c..82e6673 100644
|
|
|
39e0ef5 |
--- checkpolicy-2.7/queue.c
|
|
|
39e0ef5 |
+++ checkpolicy-2.7/queue.c
|
|
|
39e0ef5 |
@@ -1,5 +1,5 @@
|
|
|
39e0ef5 |
|
|
|
39e0ef5 |
-/* Author : Stephen Smalley, <sds@epoch.ncsc.mil> */
|
|
|
39e0ef5 |
+/* Author : Stephen Smalley, <sds@tycho.nsa.gov> */
|
|
|
39e0ef5 |
|
|
|
39e0ef5 |
/* FLASK */
|
|
|
39e0ef5 |
|
|
|
39e0ef5 |
diff --git checkpolicy-2.7/queue.h checkpolicy-2.7/queue.h
|
|
|
39e0ef5 |
index 655c94b..60c07fe 100644
|
|
|
39e0ef5 |
--- checkpolicy-2.7/queue.h
|
|
|
39e0ef5 |
+++ checkpolicy-2.7/queue.h
|
|
|
39e0ef5 |
@@ -1,5 +1,5 @@
|
|
|
39e0ef5 |
|
|
|
39e0ef5 |
-/* Author : Stephen Smalley, <sds@epoch.ncsc.mil> */
|
|
|
39e0ef5 |
+/* Author : Stephen Smalley, <sds@tycho.nsa.gov> */
|
|
|
39e0ef5 |
|
|
|
39e0ef5 |
/* FLASK */
|
|
|
39e0ef5 |
|
|
|
0d9f220 |
diff --git checkpolicy-2.7/test/Makefile checkpolicy-2.7/test/Makefile
|
|
|
0d9f220 |
index 59fa446..89e7557 100644
|
|
|
0d9f220 |
--- checkpolicy-2.7/test/Makefile
|
|
|
0d9f220 |
+++ checkpolicy-2.7/test/Makefile
|
|
|
0d9f220 |
@@ -1,19 +1,22 @@
|
|
|
0d9f220 |
#
|
|
|
0d9f220 |
# Makefile for building the dispol program
|
|
|
0d9f220 |
#
|
|
|
0d9f220 |
-PREFIX ?= $(DESTDIR)/usr
|
|
|
0d9f220 |
-BINDIR ?= $(PREFIX)/bin
|
|
|
0d9f220 |
-LIBDIR ?= $(PREFIX)/lib
|
|
|
0d9f220 |
-INCLUDEDIR ?= $(PREFIX)/include
|
|
|
0d9f220 |
-LIBSEPOLA ?= $(LIBDIR)/libsepol.a
|
|
|
0d9f220 |
-
|
|
|
0d9f220 |
CFLAGS ?= -g -Wall -W -Werror -O2 -pipe
|
|
|
0d9f220 |
|
|
|
0d9f220 |
+# If no specific libsepol.a is specified, fall back on LDFLAGS search path
|
|
|
0d9f220 |
+# Otherwise, as $(LIBSEPOLA) already appears in the dependencies, there
|
|
|
0d9f220 |
+# is no need to define a value for LDLIBS_LIBSEPOLA
|
|
|
0d9f220 |
+ifeq ($(LIBSEPOLA),)
|
|
|
0d9f220 |
+ LDLIBS_LIBSEPOLA := -l:libsepol.a
|
|
|
0d9f220 |
+endif
|
|
|
0d9f220 |
+
|
|
|
0d9f220 |
all: dispol dismod
|
|
|
0d9f220 |
|
|
|
0d9f220 |
dispol: dispol.o $(LIBSEPOLA)
|
|
|
0d9f220 |
+ $(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS_LIBSEPOLA)
|
|
|
0d9f220 |
|
|
|
0d9f220 |
dismod: dismod.o $(LIBSEPOLA)
|
|
|
0d9f220 |
+ $(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS_LIBSEPOLA)
|
|
|
0d9f220 |
|
|
|
0d9f220 |
clean:
|
|
|
0d9f220 |
-rm -f dispol dismod *.o
|