From: Martin Pitt Date: Thu, 21 Mar 2013 08:24:21 +0000 (+0100) Subject: Fix test for logind availability X-Git-Tag: dbus-1.7.2~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e25938d52731e1dc59b4aeaaec186578f8cd16af;p=thirdparty%2Fdbus.git Fix test for logind availability sd_booted() is not an appropriate check for whether we should talk to logind, test for /run/systemd/seats/ instead. For details, see: Bug: https://bugs.freedesktop.org/show_bug.cgi?id=62585 [trivial whitespace fix -smcv] Reviewed-by: Simon McVittie --- diff --git a/dbus/dbus-userdb-util.c b/dbus/dbus-userdb-util.c index 16bf22910..5af009221 100644 --- a/dbus/dbus-userdb-util.c +++ b/dbus/dbus-userdb-util.c @@ -21,6 +21,7 @@ * */ #include +#include #define DBUS_USERDB_INCLUDES_PRIVATE 1 #include "dbus-userdb.h" #include "dbus-test.h" @@ -29,7 +30,6 @@ #include #if HAVE_SYSTEMD -#include #include #endif @@ -55,7 +55,8 @@ _dbus_is_console_user (dbus_uid_t uid, dbus_bool_t result = FALSE; #ifdef HAVE_SYSTEMD - if (sd_booted () > 0) + /* check if we have logind */ + if (access ("/run/systemd/seats/", F_OK) >= 0) { int r;