From 0b191e603cc31ef0aff435fe20d49c7df39dfb8c Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 29 Jun 2011 04:14:43 +0200 Subject: [PATCH] logind: hook uaccess into udev by default --- Makefile.am | 10 ++++++++-- src/.gitignore | 1 + src/{73-seat-late.rules => 73-seat-late.rules.in} | 2 ++ src/logind.h | 1 - src/uaccess.c | 6 +++--- 5 files changed, 14 insertions(+), 6 deletions(-) rename src/{73-seat-late.rules => 73-seat-late.rules.in} (86%) diff --git a/Makefile.am b/Makefile.am index 940892c5a..8da2e1bbe 100644 --- a/Makefile.am +++ b/Makefile.am @@ -218,9 +218,11 @@ dist_dbussystemservice_DATA = \ dist_udevrules_DATA = \ src/70-uaccess.rules \ src/71-seat.rules \ - src/73-seat-late.rules \ src/99-systemd.rules +nodist_udevrules_DATA = \ + src/73-seat-late.rules + dbusinterface_DATA = \ org.freedesktop.systemd1.Manager.xml \ org.freedesktop.systemd1.Job.xml \ @@ -404,7 +406,8 @@ EXTRA_DIST = \ units/quotacheck.service.in \ systemd.pc.in \ introspect.awk \ - src/org.freedesktop.systemd1.policy.in + src/org.freedesktop.systemd1.policy.in \ + src/73-seat-late.rules.in if ENABLE_BINFMT EXTRA_DIST += \ @@ -1306,6 +1309,9 @@ man/%: man/%.in Makefile src/%.policy: src/%.policy.in Makefile $(SED_PROCESS) +src/%.rules: src/%.rules.in Makefile + $(SED_PROCESS) + M4_PROCESS_SYSTEM = \ $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \ $(M4) -P $(M4_DISTRO_FLAG) -DFOR_SYSTEM=1 < $< > $@ || rm $@ diff --git a/src/.gitignore b/src/.gitignore index 4c7d3c882..de3bb5f10 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.in similarity index 86% rename from src/73-seat-late.rules rename to src/73-seat-late.rules.in index 5a17c814a..e93a0e6da 100644 --- a/src/73-seat-late.rules +++ b/src/73-seat-late.rules.in @@ -12,4 +12,6 @@ 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 8726502c1..aaa21cddd 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 524e4f003..392b51604 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) { -- 2.30.2