selinux-testsuite: add tests for fsnotify
PATCH 1/1 selinux-testsuite: add tests for fsnotify
Added a suite to test permissions for setting inotify and fanotify watches on filesystem objects. Tests watch, watch_with_perm, and watch_reads permissions.
Signed-off-by Aaron Goidel <[email protected]>
--- policy/Makefile | 4 ++ policy/test_notify.te | 94 +++++++++++++++++++++++++ tests/Makefile | 4 ++ tests/notify/Makefile | 5 ++ tests/notify/test | 133 +++++++++++++++++++++++++++++++++++ tests/notify/test_fanotify.c | 107 ++++++++++++++++++++++++++++ tests/notify/test_inotify.c | 43 +++++++++++ 7 files changed, 390 insertions(+) create mode 100644 policy/test_notify.te create mode 100644 tests/notify/Makefile create mode 100755 tests/notify/test create mode 100644 tests/notify/test_fanotify.c create mode 100644 tests/notify/test_inotify.c
policy/Makefile +4 -0
@@ -71,6 +71,10 @@ ifeq ($(shell grep -q corenet_sctp_bind_all_nodes $(POLDEV)/include/kernel/coren TARGETS += test_sctp.te endif +ifeq ($(shell grep -q all_file_perms.*watch $(POLDEV)/include/support/all_perms.spt && echo true),true) +TARGETS+=test_notify.te +endif + ifeq (x$(DISTRO),$(filter x$(DISTRO),xRHEL4 xRHEL5 xRHEL6)) TARGETS:=$(filter-out test_overlayfs.te test_mqueue.te, $(TARGETS)) endif
policy/test_notify.te new file +94 -0
94 lines not on this page · raw message
tests/Makefile +4 -0
@@ -50,6 +50,10 @@ ifeq ($(shell grep "^SELINUX_INFINIBAND_PKEY_TEST=" infiniband_pkey/ibpkey_test. SUBDIRS += infiniband_pkey endif +ifeq ($(shell grep -q all_file_perms.*watch $(POLDEV)/include/support/all_perms.spt && echo true),true) +SUBDIRS+=notify +endif + ifeq ($(DISTRO),RHEL4) SUBDIRS:=$(filter-out bounds dyntrace dyntrans inet_socket mmap nnp_nosuid overlay unix_socket, $(SUBDIRS)) endif
tests/notify/Makefile new file +5 -0
@@ -0,0 +1,5 @@ +TARGETS=test_inotify test_fanotify + +all: $(TARGETS) +clean: + rm -f $(TARGETS)
tests/notify/test new file +133 -0
133 lines not on this page · raw message
tests/notify/test_fanotify.c new file +107 -0
107 lines not on this page · raw message
tests/notify/test_inotify.c new file +43 -0
43 lines not on this page · raw message
Signature · 1 line
2.21.0