From 0b191e603cc31ef0aff435fe20d49c7df39dfb8c Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 29 Jun 2011 04:14:43 +0200 Subject: logind: hook uaccess into udev by default --- src/.gitignore | 1 + src/73-seat-late.rules | 15 --------------- src/73-seat-late.rules.in | 17 +++++++++++++++++ src/logind.h | 1 - src/uaccess.c | 6 +++--- 5 files changed, 21 insertions(+), 19 deletions(-) delete mode 100644 src/73-seat-late.rules create mode 100644 src/73-seat-late.rules.in (limited to 'src') diff --git a/src/.gitignore b/src/.gitignore index 4c7d3c8822..de3bb5f100 100644 --- a/src/.gitignore +++ b/src/.gitignore @@ -2,3 +2,4 @@ org.freedesktop.systemd1.policy gnome-ask-password-agent.c systemd-interfaces.c systemadm.c +73-seat-late.rules diff --git a/src/73-seat-late.rules b/src/73-seat-late.rules deleted file mode 100644 index 5a17c814ae..0000000000 --- a/src/73-seat-late.rules +++ /dev/null @@ -1,15 +0,0 @@ -# This file is part of systemd. -# -# systemd is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. - -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}" - -LABEL="seat_late_end" diff --git a/src/73-seat-late.rules.in b/src/73-seat-late.rules.in new file mode 100644 index 0000000000..e93a0e6da9 --- /dev/null +++ b/src/73-seat-late.rules.in @@ -0,0 +1,17 @@ +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. + +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=="uaccess", RUN+="@rootlibexecdir@/systemd-uaccess $env{DEVNAME} $env{ID_SEAT}" + +LABEL="seat_late_end" diff --git a/src/logind.h b/src/logind.h index 8726502c1c..aaa21cddda 100644 --- a/src/logind.h +++ b/src/logind.h @@ -37,7 +37,6 @@ * spawn user systemd * direct client API * verify access to SetIdleHint - * hook up ACL tool for udev * * udev: * drop redundant udev_device_get_is_initialized() use as soon as libudev is fixed diff --git a/src/uaccess.c b/src/uaccess.c index 524e4f0032..392b51604f 100644 --- a/src/uaccess.c +++ b/src/uaccess.c @@ -36,14 +36,14 @@ int main(int argc, char *argv[]) { log_parse_environment(); log_open(); - if (argc != 2) { - log_error("This program expects two argument."); + if (argc < 2 || argc > 3) { + log_error("This program expects one or two arguments."); r = -EINVAL; goto finish; } path = argv[1]; - seat = argv[2]; + seat = argc >= 3 ? argv[2] : "seat0"; p = strappend("/run/systemd/seats/", seat); if (!p) { -- cgit v1.2.3-54-g00ecf