i1. Capability of making seats without framebuffer devices<br> logind.c: The seat is now activated by any device with udev tag "seat-master"<br> <a href="http://71-seat.rules.in" target="_blank">71-seat.rules.in</a>: All framebuffer devices have this tag<br>
multi-seat-x.c: if the seat does not have a framebuffer device, runs X as a proxy, adding -sharevts only<br> if the seat has a framebuffer device, makes a special config for X (like it did before)<br> <br>i2. Supporting of acls on devices shared between all seats (like /dev/snd/seq)<br>
These devices have "shared" udev tag in addition to "uaccess"<br> <br> A user gets permitions on it when he activates a session on any seat.<br> He/she losses the permitions when no his/her active sessions more exist<br>
<br> <a href="http://71-seat.rules.in" target="_blank">71-seat.rules.in</a>: sets "ONE_SEAT" env var to "Y" for all devices with "seat" tag<br> <a href="http://73-seat-late.rules.in" target="_blank">73-seat-late.rules.in</a>: inherits "ONE_SEAT" env from the parent device.<br>
sets "shared" tag to all devices with "uaccess" tag with neither "ONE_SEAT" nor "ID_SEAT" env<br> logind-acl.c: changes acl on shared devices regardless to their seats<br> logind-seat.c: when a user removes an active sessions, checks are other active sessions of this user (on other seats) exists<br>
<div class="gmail_quote">
<br></div>diff -Naur systemd.old/src/login/<a href="http://71-seat.rules.in">71-seat.rules.in</a> systemd.new/src/login/<a href="http://71-seat.rules.in">71-seat.rules.in</a><br>--- systemd.old/src/login/<a href="http://71-seat.rules.in">71-seat.rules.in</a> 2012-12-14 22:51:19.361720536 +0400<br>
+++ systemd.new/src/login/<a href="http://71-seat.rules.in">71-seat.rules.in</a> 2012-12-14 23:07:14.116893094 +0400<br>@@ -11,6 +11,7 @@<br> SUBSYSTEM=="sound", KERNEL=="card*", TAG+="seat"<br>
SUBSYSTEM=="input", KERNEL=="input*", TAG+="seat"<br> SUBSYSTEM=="graphics", KERNEL=="fb[0-9]*", TAG+="seat"<br>+SUBSYSTEM=="graphics", KERNEL=="fb[0-9]*", TAG+="seat-master"<br>
SUBSYSTEM=="usb", ATTR{bDeviceClass}=="09", TAG+="seat"<br> <br> # 'Plugable' USB hub, sound, network, graphics adapter<br>@@ -42,6 +43,7 @@<br> <br> TAG=="seat", ENV{ID_PATH}=="", IMPORT{builtin}="path_id"<br>
TAG=="seat", ENV{ID_FOR_SEAT}=="", ENV{ID_PATH_TAG}!="", ENV{ID_FOR_SEAT}="$env{SUBSYSTEM}-$env{ID_PATH_TAG}"<br>+TAG=="seat", ENV{ONE_SEAT}="Y"<br> <br> SUBSYSTEM=="input", ATTR{name}=="Wiebetech LLC Wiebetech", RUN+="@rootbindir@/loginctl lock-sessions"<br>
<br>diff -Naur systemd.old/src/login/<a href="http://73-seat-late.rules.in">73-seat-late.rules.in</a> systemd.new/src/login/<a href="http://73-seat-late.rules.in">73-seat-late.rules.in</a><br>--- systemd.old/src/login/<a href="http://73-seat-late.rules.in">73-seat-late.rules.in</a> 2012-12-14 22:51:19.361720536 +0400<br>
+++ systemd.new/src/login/<a href="http://73-seat-late.rules.in">73-seat-late.rules.in</a> 2012-12-14 23:08:22.548039895 +0400<br>@@ -14,4 +14,7 @@<br> <br> TAG=="uaccess", ENV{MAJOR}!="", RUN{builtin}+="uaccess"<br>
<br>+ENV{ONE_SEAT}=="", IMPORT{parent}="ONE_SEAT"<br>+TAG=="uaccess", ENV{ONE_SEAT}!="Y", ENV{ID_SEAT}=="", TAG+="shared"<br>+<br> LABEL="seat_late_end"<br>
diff -Naur systemd.old/src/login/logind-acl.c systemd.new/src/login/logind-acl.c<br>--- systemd.old/src/login/logind-acl.c 2012-12-14 22:51:19.361720536 +0400<br>+++ systemd.new/src/login/logind-acl.c 2012-12-14 23:10:59.457079493 +0400<br>
@@ -174,7 +174,7 @@<br> int devnode_acl_all(struct udev *udev,<br> const char *seat,<br> bool flush,<br>- bool del, uid_t old_uid,<br>+ bool del, bool del_shared, uid_t old_uid,<br>
bool add, uid_t new_uid) {<br> <br> struct udev_list_entry *item = NULL, *first = NULL;<br>@@ -208,6 +208,7 @@<br> udev_list_entry_foreach(item, first) {<br> struct udev_device *d;<br>
const char *node, *sn;<br>+ bool is_shared;<br> <br> d = udev_device_new_from_syspath(udev, udev_list_entry_get_name(item));<br> if (!d) {<br>@@ -215,13 +216,20 @@<br>
goto finish;<br> }<br> <br>- sn = udev_device_get_property_value(d, "ID_SEAT");<br>- if (isempty(sn))<br>- sn = "seat0";<br>
-<br>- if (!streq(seat, sn)) {<br>- udev_device_unref(d);<br>- continue;<br>+ // all devices with shared tag are accessible with all seats<br>+ is_shared = udev_device_has_tag(d, "shared");<br>
+ <br>+ if (is_shared) {<br>+ sn = "shared";<br>+ } else {<br>+ sn = udev_device_get_property_value(d, "ID_SEAT");<br>
+ if (isempty(sn))<br>+ sn = "seat0";<br>+<br>+ if (!streq(seat, sn)) {<br>+ udev_device_unref(d);<br>+ continue;<br>
+ }<br> }<br> <br> node = udev_device_get_devnode(d);<br>@@ -233,7 +241,7 @@<br> <br> log_debug("Fixing up %s for seat %s...", node, sn);<br> <br>
- r = devnode_acl(node, flush, del, old_uid, add, new_uid);<br>+ r = devnode_acl(node, flush, is_shared ? del_shared : del, old_uid, add, new_uid);<br> udev_device_unref(d);<br>
<br> if (r < 0)<br>diff -Naur systemd.old/src/login/logind-acl.h systemd.new/src/login/logind-acl.h<br>--- systemd.old/src/login/logind-acl.h 2012-12-14 22:51:19.361720536 +0400<br>+++ systemd.new/src/login/logind-acl.h 2012-12-14 23:11:39.936573058 +0400<br>
@@ -35,7 +35,7 @@<br> int devnode_acl_all(struct udev *udev,<br> const char *seat,<br> bool flush,<br>- bool del, uid_t old_uid,<br>+ bool del, bool del_shared, uid_t old_uid,<br>
bool add, uid_t new_uid);<br> #else<br> <br>diff -Naur systemd.old/src/login/logind.c systemd.new/src/login/logind.c<br>--- systemd.old/src/login/logind.c 2012-12-14 22:51:19.362720524 +0400<br>+++ systemd.new/src/login/logind.c 2012-12-14 23:13:03.296530203 +0400<br>
@@ -450,11 +450,7 @@<br> goto finish;<br> }<br> <br>- r = udev_enumerate_add_match_subsystem(e, "graphics");<br>- if (r < 0)<br>- goto finish;<br>-<br>- r = udev_enumerate_add_match_tag(e, "seat");<br>
+ r = udev_enumerate_add_match_tag(e, "seat-master");<br> if (r < 0)<br> goto finish;<br> <br>@@ -1286,11 +1282,7 @@<br> if (!m->udev_seat_monitor)<br> return -ENOMEM;<br>
<br>- r = udev_monitor_filter_add_match_tag(m->udev_seat_monitor, "seat");<br>- if (r < 0)<br>- return r;<br>-<br>- r = udev_monitor_filter_add_match_subsystem_devtype(m->udev_seat_monitor, "graphics", NULL);<br>
+ r = udev_monitor_filter_add_match_tag(m->udev_seat_monitor, "seat-master");<br> if (r < 0)<br> return r;<br> <br>diff -Naur systemd.old/src/login/logind-seat.c systemd.new/src/login/logind-seat.c<br>
--- systemd.old/src/login/logind-seat.c 2012-12-14 22:51:19.362720524 +0400<br>+++ systemd.new/src/login/logind-seat.c 2012-12-14 23:15:16.307860909 +0400<br>@@ -225,7 +225,10 @@<br> r = devnode_acl_all(s->manager->udev,<br>
s->id,<br> false,<br>- !!old_active, old_active ? old_active->user->uid : 0,<br>+ !!old_active, <br>+ // delete acl on shared devices only if no other active sessions<br>
+ old_active && user_get_state(old_active->user) != USER_ACTIVE,<br>+ old_active ? old_active->user->uid : 0,<br> !!s->active, s->active ? s->active->user->uid : 0);<br>
<br> if (r < 0)<br><br>