*
*/
#include <config.h>
+#include <unistd.h>
#define DBUS_USERDB_INCLUDES_PRIVATE 1
#include "dbus-userdb.h"
#include "dbus-test.h"
#include <string.h>
#if HAVE_SYSTEMD
-#include <systemd/sd-daemon.h>
#include <systemd/sd-login.h>
#endif
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;
#endif /* HAVE_CONSOLE_OWNER_FILE */
- _dbus_user_database_lock_system ();
+ if (!_dbus_user_database_lock_system ())
+ {
+ _DBUS_SET_OOM (error);
+ return FALSE;
+ }
db = _dbus_user_database_get_system ();
if (db == NULL)
{
DBusUserDatabase *db;
const DBusGroupInfo *info;
- _dbus_user_database_lock_system ();
+
+ /* FIXME: this can't distinguish ENOMEM from other errors */
+ if (!_dbus_user_database_lock_system ())
+ return FALSE;
db = _dbus_user_database_get_system ();
if (db == NULL)
{
DBusUserDatabase *db;
const DBusUserInfo *info;
- _dbus_user_database_lock_system ();
+
+ /* FIXME: this can't distinguish ENOMEM from other errors */
+ if (!_dbus_user_database_lock_system ())
+ return FALSE;
db = _dbus_user_database_get_system ();
if (db == NULL)
*group_ids = NULL;
*n_group_ids = 0;
- _dbus_user_database_lock_system ();
+ /* FIXME: this can't distinguish ENOMEM from other errors */
+ if (!_dbus_user_database_lock_system ())
+ return FALSE;
db = _dbus_user_database_get_system ();
if (db == NULL)