summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-01-24 05:47:37 +0100
committerLennart Poettering <lennart@poettering.net>2013-01-24 05:47:37 +0100
commitd239d84aa384a532e1056ec1d09fef16d843b8eb (patch)
treeea24057cf8c221e6a720dadcfbbaf42ec66d1180
parentbfb7ec0ebab18a0bc8a99997f541c980a323c867 (diff)
loginctl: show seat master and uaccess devices in seat-status output
-rw-r--r--src/login/sysfs-show.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/login/sysfs-show.c b/src/login/sysfs-show.c
index d113ec3e43..da34c3ade8 100644
--- a/src/login/sysfs-show.c
+++ b/src/login/sysfs-show.c
@@ -45,6 +45,7 @@ static int show_sysfs_one(
struct udev_device *d;
const char *sn, *name, *sysfs, *subsystem, *sysname;
char *l, *k;
+ bool is_master, uaccess;
sysfs = udev_list_entry_get_name(*item);
if (!path_startswith(sysfs, sub))
@@ -60,13 +61,16 @@ static int show_sysfs_one(
if (isempty(sn))
sn = "seat0";
- /* fixme, also check for tag 'seat' here */
+ /* Explicitly also check for tag 'seat' here */
if (!streq(seat, sn) || !udev_device_has_tag(d, "seat")) {
udev_device_unref(d);
*item = udev_list_entry_get_next(*item);
continue;
}
+ is_master = udev_device_has_tag(d, "seat-master");
+ uaccess = udev_device_has_tag(d, "uaccess");
+
name = udev_device_get_sysattr_value(d, "name");
if (!name)
name = udev_device_get_sysattr_value(d, "id");
@@ -110,7 +114,8 @@ static int show_sysfs_one(
free(k);
if (asprintf(&l,
- "(%s:%s)%s%s%s",
+ "%s%s%s:%s%s%s%s",
+ is_master ? "[MASTER] " : "", uaccess ? "[ACL] " : "",
subsystem, sysname,
name ? " \"" : "", name ? name : "", name ? "\"" : "") < 0) {
udev_device_unref(d);