From 8eee8727cb09a9fc14e899b4058fcd108f44a0eb Mon Sep 17 00:00:00 2001 From: Armin Kuster Date: Mon, 6 May 2019 11:36:58 -0700 Subject: smack-test: add smack tests from meta-intel-iot-security ported over smack tests Signed-off-by: Armin Kuster --- recipes-mac/smack/smack-test/notroot.py | 33 +++++++++++++ .../smack/smack-test/smack_test_file_access.sh | 54 ++++++++++++++++++++++ .../test_privileged_change_self_label.sh | 18 ++++++++ recipes-mac/smack/smack-test/test_smack_onlycap.sh | 27 +++++++++++ 4 files changed, 132 insertions(+) create mode 100644 recipes-mac/smack/smack-test/notroot.py create mode 100644 recipes-mac/smack/smack-test/smack_test_file_access.sh create mode 100644 recipes-mac/smack/smack-test/test_privileged_change_self_label.sh create mode 100644 recipes-mac/smack/smack-test/test_smack_onlycap.sh (limited to 'recipes-mac/smack/smack-test') diff --git a/recipes-mac/smack/smack-test/notroot.py b/recipes-mac/smack/smack-test/notroot.py new file mode 100644 index 0000000..f0eb0b5 --- /dev/null +++ b/recipes-mac/smack/smack-test/notroot.py @@ -0,0 +1,33 @@ +#!/usr/bin/env python +# +# Script used for running executables with custom labels, as well as custom uid/gid +# Process label is changed by writing to /proc/self/attr/curent +# +# Script expects user id and group id to exist, and be the same. +# +# From adduser manual: +# """By default, each user in Debian GNU/Linux is given a corresponding group +# with the same name. """ +# +# Usage: root@desk:~# python notroot.py