[systemd-devel] [PATCH] Smack enabled systems need /dev special devices correctly labeled
Michael Demeter
michael.demeter at intel.com
Fri Oct 11 16:47:03 PDT 2013
- Add AC_DEFINE for HAVE_SMACK to configure.ac
- Add Check for smack in Makefile.am to include smack default rules
- Add smack default rules to label /dev/xxx correctly for access
Change-Id: Iab07eb632b487b9ac4567cd08d0da6879709d44f
Signed-off-by: Michael Demeter <michael.demeter at intel.com>
---
Makefile.am | 5 +++++
configure.ac | 1 +
rules/55-udev-smack-default.rules | 18 ++++++++++++++++++
3 files changed, 24 insertions(+)
create mode 100644 rules/55-udev-smack-default.rules
diff --git a/Makefile.am b/Makefile.am
index e8be76b..bd397c4 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1943,6 +1943,11 @@ dist_udevrules_DATA += \
rules/80-net-name-slot.rules \
rules/95-udev-late.rules
+if HAVE_SMACK
+dist_udevrules_DATA += \
+ rules/55-udev-smack-default.rules
+endif
+
dist_udevhwdb_DATA = \
hwdb/20-pci-vendor-model.hwdb \
hwdb/20-pci-classes.hwdb \
diff --git a/configure.ac b/configure.ac
index 091fe20..facd931 100644
--- a/configure.ac
+++ b/configure.ac
@@ -472,6 +472,7 @@ AS_HELP_STRING([--with-smack-run-label=STRING],
if test "x${have_smack}" = xyes ; then
AC_DEFINE(HAVE_SMACK, 1, [Define if SMACK is available])
+ AM_CONDITIONAL([HAVE_SMACK], [true])
fi
# ------------------------------------------------------------------------------
diff --git a/rules/55-udev-smack-default.rules b/rules/55-udev-smack-default.rules
new file mode 100644
index 0000000..6df90bb
--- /dev/null
+++ b/rules/55-udev-smack-default.rules
@@ -0,0 +1,18 @@
+# do not edit this file, it will be overwritten on update
+
+KERNEL=="null",SMACK="*"
+KERNEL=="zero",SMACK="*"
+KERNEL=="console",SMACK="*"
+KERNEL=="kmsg",SMACK="*"
+KERNEL=="video0",SMACK="*"
+KERNEL=="card0",SMACK="*"
+
+
+SUBSYSTEM=="tty", KERNEL=="ptmx", GROUP="tty", MODE="0666", SMACK="*"
+SUBSYSTEM=="tty", KERNEL=="tty", GROUP="tty", MODE="0666", SMACK="*"
+SUBSYSTEM=="tty", KERNEL=="tty[0-9]*", GROUP="tty", MODE="0620", SMACK="*"
+SUBSYSTEM=="vc", KERNEL=="vcs*|vcsa*", GROUP="tty", SMACK="*"
+KERNEL=="tty[A-Z]*[0-9]|pppox[0-9]*|ircomm[0-9]*|noz[0-9]*|rfcomm[0-9]*",
+GROUP="dialout", SMACK="*"
+
+SUBSYSTEM=="input", KERNEL=="ts[0-9]*|uinput", MODE="0640", SMACK="*"
--
1.8.1.2
More information about the systemd-devel
mailing list