mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2026-01-31 18:00:26 +01:00
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: <https://mail.gnome.org/archives/desktop-devel-list/2013-March/msg00092.html> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=62585 [trivial whitespace fix -smcv] Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
This commit is contained in:
parent
15b2d2bb25
commit
e25938d527
1 changed files with 3 additions and 2 deletions
|
|
@ -21,6 +21,7 @@
|
|||
*
|
||||
*/
|
||||
#include <config.h>
|
||||
#include <unistd.h>
|
||||
#define DBUS_USERDB_INCLUDES_PRIVATE 1
|
||||
#include "dbus-userdb.h"
|
||||
#include "dbus-test.h"
|
||||
|
|
@ -29,7 +30,6 @@
|
|||
#include <string.h>
|
||||
|
||||
#if HAVE_SYSTEMD
|
||||
#include <systemd/sd-daemon.h>
|
||||
#include <systemd/sd-login.h>
|
||||
#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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue