logind: hook uaccess into udev by default
authorLennart Poettering <lennart@poettering.net>
Wed, 29 Jun 2011 02:14:43 +0000 (04:14 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 29 Jun 2011 02:14:43 +0000 (04:14 +0200)
Makefile.am
src/.gitignore
src/73-seat-late.rules [deleted file]
src/73-seat-late.rules.in [new file with mode: 0644]
src/logind.h
src/uaccess.c

index 940892c5a963eb337fd0be7cb190981b9d0f62a9..8da2e1bbeed2d164afff5bb45a0883908c9ca3c3 100644 (file)
@@ -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 $@
index 4c7d3c8822d4e226a82f462c4df9d93664554acf..de3bb5f10019d230607a5f554d8c37025d776bf0 100644 (file)
@@ -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 (file)
index 5a17c81..0000000
+++ /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 (file)
index 0000000..e93a0e6
--- /dev/null
@@ -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"
index 8726502c1c8e953d911eb7d4ee603c40d92db6b0..aaa21cddda643e181c0bd96773e25a49914b2c42 100644 (file)
@@ -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
index 524e4f0032f2aa2d3046055940bf04509254ac7b..392b51604f38d896184a361167bb78580b38b19c 100644 (file)
@@ -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) {