[systemd-commits] 2 commits - Makefile.am src/login units/.gitignore units/user at .service.in units/user at .service.m4.in

Kay Sievers kay at kemper.freedesktop.org
Wed Jan 8 02:11:59 PST 2014


 Makefile.am               |   11 ++++++++++-
 src/login/pam-module.c    |   32 ++++++++++++++++++++++++++++++++
 units/.gitignore          |    1 -
 units/user at .service.in    |   17 +++++++++++++++++
 units/user at .service.m4.in |   22 ----------------------
 5 files changed, 59 insertions(+), 24 deletions(-)

New commits:
commit 2b197ae21c4a3571024fba1886eeeb87c0dfcf03
Author: Kay Sievers <kay at vrfy.org>
Date:   Wed Jan 8 18:10:39 2014 +0800

    dbus1-generator: install user version

diff --git a/Makefile.am b/Makefile.am
index 725a375..9836eb8 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1782,6 +1782,15 @@ systemd_dbus1_generator_LDADD = \
 	libsystemd-shared.la \
 	libsystemd-bus-internal.la
 
+dbus1-generator-install-hook:
+	$(AM_V_LN)$(LN_S) -f $(systemgeneratordir)/systemd-dbus1-generator $(DESTDIR)$(usergeneratordir)/systemd-dbus1-generator
+
+dbus1-generator-uninstall-hook:
+	rm -f $(DESTDIR)$(usergeneratordir)/systemd-dbus1-generator
+
+INSTALL_EXEC_HOOKS += dbus1-generator-install-hook
+UNINSTALL_EXEC_HOOKS += dbus1-generator-uninstall-hook
+
 # ------------------------------------------------------------------------------
 systemd_rc_local_generator_SOURCES = \
 	src/rc-local-generator/rc-local-generator.c

commit 8b255ecd99dfee4e27b40a075b15d1e117f819fa
Author: Kay Sievers <kay at vrfy.org>
Date:   Mon Jan 6 08:00:16 2014 +0400

    pam_systemd: export DBUS_SESSION_BUS_ADDRESS

diff --git a/Makefile.am b/Makefile.am
index 7a15942..725a375 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -494,7 +494,7 @@ EXTRA_DIST += \
 	units/user/systemd-exit.service.in \
 	units/systemd-fsck at .service.in \
 	units/systemd-fsck-root.service.in \
-	units/user at .service.m4.in \
+	units/user at .service.in \
 	units/systemd-udevd.service \
 	units/systemd-udev-trigger.service \
 	units/systemd-udev-settle.service \
diff --git a/src/login/pam-module.c b/src/login/pam-module.c
index 89623aa..c67e677 100644
--- a/src/login/pam-module.c
+++ b/src/login/pam-module.c
@@ -164,6 +164,30 @@ static int get_seat_from_display(const char *display, const char **seat, uint32_
         return 0;
 }
 
+static int export_legacy_dbus_address(
+                pam_handle_t *handle,
+                uid_t uid,
+                const char *runtime) {
+
+#ifdef ENABLE_KDBUS
+        _cleanup_free_ char *s = NULL;
+        int r;
+
+        if (asprintf(&s, "kernel:path=/dev/kdbus/%lu-user/bus;unix:path=%s/bus",
+                     (unsigned long) uid, runtime) < 0) {
+                pam_syslog(handle, LOG_ERR, "Failed to set bus variable.");
+                return PAM_BUF_ERR;
+        }
+
+        r = pam_misc_setenv(handle, "DBUS_SESSION_BUS_ADDRESS", s, 0);
+        if (r != PAM_SUCCESS) {
+                pam_syslog(handle, LOG_ERR, "Failed to set bus variable.");
+                return r;
+        }
+#endif
+        return PAM_SUCCESS;
+}
+
 _public_ PAM_EXTERN int pam_sm_open_session(
                 pam_handle_t *handle,
                 int flags,
@@ -232,6 +256,10 @@ _public_ PAM_EXTERN int pam_sm_open_session(
                                 pam_syslog(handle, LOG_ERR, "Failed to set runtime dir.");
                                 return r;
                         }
+
+                        r = export_legacy_dbus_address(handle, pw->pw_uid, rt);
+                        if (r != PAM_SUCCESS)
+                                return r;
                 }
 
                 return PAM_SUCCESS;
@@ -386,6 +414,10 @@ _public_ PAM_EXTERN int pam_sm_open_session(
                         pam_syslog(handle, LOG_ERR, "Failed to set runtime dir.");
                         return r;
                 }
+
+                r = export_legacy_dbus_address(handle, pw->pw_uid, runtime_path);
+                if (r != PAM_SUCCESS)
+                        return r;
         }
 
         if (!isempty(seat)) {
diff --git a/units/.gitignore b/units/.gitignore
index cb9fa1c..76c4cb3 100644
--- a/units/.gitignore
+++ b/units/.gitignore
@@ -65,5 +65,4 @@
 /systemd-update-utmp.service
 /systemd-user-sessions.service
 /systemd-vconsole-setup.service
-/user at .service.m4
 /user at .service
diff --git a/units/user at .service.in b/units/user at .service.in
new file mode 100644
index 0000000..c2d495f
--- /dev/null
+++ b/units/user at .service.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 Lesser General Public License as published by
+#  the Free Software Foundation; either version 2.1 of the License, or
+#  (at your option) any later version.
+
+[Unit]
+Description=User Manager for %i
+After=systemd-user-sessions.service
+
+[Service]
+User=%i
+PAMName=systemd-user
+Type=notify
+ExecStart=- at rootlibexecdir@/systemd --user
+Slice=user-%i.slice
diff --git a/units/user at .service.m4.in b/units/user at .service.m4.in
deleted file mode 100644
index 7b7d52b..0000000
--- a/units/user at .service.m4.in
+++ /dev/null
@@ -1,22 +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 Lesser General Public License as published by
-#  the Free Software Foundation; either version 2.1 of the License, or
-#  (at your option) any later version.
-
-[Unit]
-Description=User Manager for %I
-After=systemd-user-sessions.service
-
-[Service]
-User=%I
-PAMName=systemd-user
-Type=notify
-ExecStart=- at rootlibexecdir@/systemd --user
-m4_ifdef(`ENABLE_KDBUS',
-Environment=DBUS_SESSION_BUS_ADDRESS=kernel:path=/dev/kdbus/%I-user/bus;unix:path=/run/user/%I/bus
-,m4_dnl
-Environment=DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%I/bus
-)m4_dnl
-Slice=user-%i.slice



More information about the systemd-commits mailing list