summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Koegel <eric.koegel@gmail.com>2016-04-10 11:04:30 +0300
committerEric Koegel <eric.koegel@gmail.com>2017-05-04 02:29:07 +0300
commit581d219136fd96f68d1812d8d875b55417537614 (patch)
treeb204bed2c98fe5e20cf9afb578401919e58fb547
parentf4206789097ee6250f5d9a8c7bab4875d44c5670 (diff)
downloadConsoleKit2-581d219136fd96f68d1812d8d875b55417537614.tar.gz
Update udev rules
-rw-r--r--.gitignore3
-rw-r--r--configure.ac2
-rw-r--r--tools/70-udev-acl.rules.in13
-rw-r--r--tools/71-udev-seat.rules.in49
-rw-r--r--tools/73-udev-seat-late.rules.in14
-rw-r--r--tools/Makefile.am6
6 files changed, 84 insertions, 3 deletions
diff --git a/.gitignore b/.gitignore
index b9a2b32..515f51e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -66,5 +66,8 @@ src/test-manager
src/ck-collect-session-info
tools/pam-foreground-compat.ck
tools/70-udev-acl.rules
+tools/71-udev-seat.rules
+tools/73-udev-seat-late.rules
tools/ck-remove-directory
doc/console-kit-daemon.1m
+ConsoleKit2.geany
diff --git a/configure.ac b/configure.ac
index 0b9abd6..01bf6dd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -555,6 +555,8 @@ AC_CONFIG_FILES([
Makefile
src/Makefile
tools/70-udev-acl.rules
+tools/71-udev-seat.rules
+tools/73-udev-seat-late.rules
tools/Makefile
tools/linux/Makefile
tools/freebsd/Makefile
diff --git a/tools/70-udev-acl.rules.in b/tools/70-udev-acl.rules.in
index de6720e..4c26add 100644
--- a/tools/70-udev-acl.rules.in
+++ b/tools/70-udev-acl.rules.in
@@ -1,4 +1,6 @@
# do not edit this file, it will be overwritten on update
+# taken/updated from:
+# https://github.com/systemd/systemd/blob/master/src/login/70-uaccess.rules
# Do not use TAG+="udev-acl" outside of this file. This variable is private to
# udev-acl of this udev release and may be replaced at any time.
@@ -26,7 +28,7 @@ SUBSYSTEM=="block", ENV{ID_CDROM}=="1", TAG+="udev-acl"
SUBSYSTEM=="scsi_generic", SUBSYSTEMS=="scsi", ATTRS{type}=="4|5", TAG+="udev-acl"
# sound devices
-SUBSYSTEM=="sound", TAG+="udev-acl"
+SUBSYSTEM=="sound", TAG+="udev-acl" OPTIONS+="static_node=snd/timer", OPTIONS+="static_node=snd/seq"
# ffado is an userspace driver for firewire sound cards
SUBSYSTEM=="firewire", ENV{ID_FFADO}=="1", TAG+="udev-acl"
@@ -43,7 +45,8 @@ SUBSYSTEM=="firewire", ATTR{units}=="*0x00a02d:0x010001*", TAG+="udev-acl"
SUBSYSTEM=="firewire", ATTR{units}=="*0x00a02d:0x014001*", TAG+="udev-acl"
# DRI video devices
-SUBSYSTEM=="drm", KERNEL=="card*", TAG+="udev-acl"
+SUBSYSTEM=="drm", KERNEL=="card*|renderD*", TAG+="udev-acl"
+SUBSYSTEM=="graphics", KERNEL=="fb*", TAG+="udev-acl"
# KVM
SUBSYSTEM=="misc", KERNEL=="kvm", TAG+="udev-acl"
@@ -51,6 +54,9 @@ SUBSYSTEM=="misc", KERNEL=="kvm", TAG+="udev-acl"
# smart-card readers
ENV{ID_SMARTCARD_READER}=="*?", TAG+="udev-acl"
+# (USB) authentication devices
+ENV{ID_SECURITY_TOKEN}=="?*", TAG+="udev-acl"
+
# PDA devices
ENV{ID_PDA}=="*?", TAG+="udev-acl"
@@ -69,6 +75,9 @@ ENV{DDC_DEVICE}=="*?", TAG+="udev-acl"
# media player raw devices (for user-mode drivers, Android SDK, etc.)
SUBSYSTEM=="usb", ENV{ID_MEDIA_PLAYER}=="?*", TAG+="udev-acl"
+# software-defined radio communication devices
+ENV{ID_SOFTWARE_RADIO}=="?*", TAG+="udev-acl"
+
# apply ACL for all locally logged in users
LABEL="acl_apply", TAG=="udev-acl", TEST=="@RUNDIR@/ConsoleKit/database", \
RUN+="udev-acl --action=$env{ACTION} --device=$env{DEVNAME}"
diff --git a/tools/71-udev-seat.rules.in b/tools/71-udev-seat.rules.in
new file mode 100644
index 0000000..5a695f3
--- /dev/null
+++ b/tools/71-udev-seat.rules.in
@@ -0,0 +1,49 @@
+# do not edit this file, it will be overwritten on update
+# taken/updated from:
+# https://github.com/systemd/systemd/blob/master/src/login/71-seat.rules.in
+
+ACTION=="remove", GOTO="seat_end"
+
+TAG=="udev-acl", SUBSYSTEM!="sound", TAG+="seat"
+SUBSYSTEM=="sound", KERNEL=="card*", TAG+="seat"
+SUBSYSTEM=="input", KERNEL=="input*", TAG+="seat"
+SUBSYSTEM=="graphics", KERNEL=="fb[0-9]*", TAG+="seat", TAG+="master-of-seat"
+SUBSYSTEM=="drm", KERNEL=="card[0-9]*", TAG+="seat", TAG+="master-of-seat"
+SUBSYSTEM=="usb", ATTR{bDeviceClass}=="09", TAG+="seat"
+
+# 'Plugable' USB hub, sound, network, graphics adapter
+SUBSYSTEM=="usb", ATTR{idVendor}=="2230", ATTR{idProduct}=="000[13]", ENV{ID_AUTOSEAT}="1"
+
+# qemu (version 2.4+) has a PCI-PCI bridge (-device pci-bridge-seat) to group
+# devices belonging to one seat. See:
+# http://git.qemu.org/?p=qemu.git;a=blob;f=docs/multiseat.txt
+SUBSYSTEM=="pci", ATTR{vendor}=="0x1b36", ATTR{device}=="0x000a", TAG+="seat", ENV{ID_AUTOSEAT}="1"
+
+# Mimo 720, with integrated USB hub, displaylink graphics, and e2i
+# touchscreen. This device carries no proper VID/PID in the USB hub,
+# but it does carry good ID data in the graphics component, hence we
+# check it from the parent. There's a bit of a race here however,
+# given that the child devices might not exist yet at the time this
+# rule is executed. To work around this we'll trigger the parent from
+# the child if we notice that the parent wasn't recognized yet.
+
+# Match parent
+SUBSYSTEM=="usb", ATTR{idVendor}=="058f", ATTR{idProduct}=="6254", \
+ ATTR{%k.2/idVendor}=="17e9", ATTR{%k.2/idProduct}=="401a", ATTR{%k.2/product}=="mimo inc", \
+ ENV{ID_AUTOSEAT}="1", ENV{ID_AVOID_LOOP}="1"
+
+# Match child, look for parent's ID_AVOID_LOOP
+SUBSYSTEM=="usb", ATTR{idVendor}=="17e9", ATTR{idProduct}=="401a", ATTR{product}=="mimo inc", \
+ ATTR{../idVendor}=="058f", ATTR{../idProduct}=="6254", \
+ IMPORT{parent}="ID_AVOID_LOOP"
+
+# Match child, retrigger parent
+SUBSYSTEM=="usb", ATTR{idVendor}=="17e9", ATTR{idProduct}=="401a", ATTR{product}=="mimo inc", \
+ ATTR{../idVendor}=="058f", ATTR{../idProduct}=="6254", \
+ ENV{ID_AVOID_LOOP}=="", \
+ RUN+="@rootbindir@/udevadm trigger --parent-match=%p/.."
+
+TAG=="seat", ENV{ID_PATH}=="", IMPORT{builtin}="path_id"
+TAG=="seat", ENV{ID_FOR_SEAT}=="", ENV{ID_PATH_TAG}!="", ENV{ID_FOR_SEAT}="$env{SUBSYSTEM}-$env{ID_PATH_TAG}"
+
+LABEL="seat_end"
diff --git a/tools/73-udev-seat-late.rules.in b/tools/73-udev-seat-late.rules.in
new file mode 100644
index 0000000..fdccde4
--- /dev/null
+++ b/tools/73-udev-seat-late.rules.in
@@ -0,0 +1,14 @@
+# do not edit this file, it will be overwritten on update
+# taken/updated from:
+# https://github.com/systemd/systemd/blob/master/src/login/73-seat-late.rules.in
+
+ACTION=="remove", GOTO="seat_late_end"
+
+ENV{ID_SEAT}=="", ENV{ID_AUTOSEAT}=="1", ENV{ID_FOR_SEAT}!="", ENV{ID_SEAT}="seat-$env{ID_FOR_SEAT}"
+ENV{ID_SEAT}=="", IMPORT{parent}="ID_SEAT"
+
+ENV{ID_SEAT}!="", TAG+="$env{ID_SEAT}"
+
+TAG=="udev-acl", ENV{MAJOR}!="", RUN{builtin}+="udev-acl"
+
+LABEL="seat_late_end"
diff --git a/tools/Makefile.am b/tools/Makefile.am
index a181033..914a9a1 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -172,7 +172,11 @@ ck_remove_directory_LDADD = \
if ENABLE_UDEV_ACL
udevrulesdir = $(UDEVDIR)/rules.d
-dist_udevrules_DATA = 70-udev-acl.rules
+dist_udevrules_DATA = \
+ 70-udev-acl.rules \
+ 71-udev-seat.rules \
+ 73-udev-seat-late.rules
+
libexec_PROGRAMS += udev-acl
udev_acl_SOURCES = udev-acl.c