[apparmor] [PATCH v3 3/7] tests: Test the shutdown permission in unix_socket
Tyler Hicks
tyhicks at canonical.com
Tue Sep 23 00:09:13 UTC 2014
The server will now do a shutdown() on its socket in order to test the
AppArmor 'shutdown' unix rule permission.
Signed-off-by: Tyler Hicks <tyhicks at canonical.com>
---
* No changes since v2
tests/regression/apparmor/unix_socket.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/tests/regression/apparmor/unix_socket.c b/tests/regression/apparmor/unix_socket.c
index 34d1b9e..1b89c45 100644
--- a/tests/regression/apparmor/unix_socket.c
+++ b/tests/regression/apparmor/unix_socket.c
@@ -217,6 +217,12 @@ int main (int argc, char *argv[])
exit(1);
}
+ rc = shutdown(sock, SHUT_RDWR);
+ if (rc == -1) {
+ perror("FAIL - shutdown");
+ exit(1);
+ }
+
printf("PASS\n");
exit(0);
}
--
2.1.0
More information about the AppArmor
mailing list