Index: sysutils/accountsservice/Makefile =================================================================== --- sysutils/accountsservice/Makefile +++ sysutils/accountsservice/Makefile @@ -1,13 +1,9 @@ PORTNAME= accountsservice -PORTVERSION= 0.6.55 -PORTREVISION= 3 +PORTVERSION= 22.08.8 CATEGORIES= sysutils devel -MASTER_SITES= http://www.freedesktop.org/software/${PORTNAME}/ +MASTER_SITES= https://www.freedesktop.org/software/${PORTNAME}/ -PATCH_SITES= https://gitlab.freedesktop.org/${PORTNAME}/${PORTNAME}/-/commit/ -PATCHFILES+= ac9b14f1c1bb.patch:-p1 # https://gitlab.freedesktop.org/accountsservice/accountsservice/-/merge_requests/82 - -MAINTAINER= kwm@FreeBSD.org +MAINTAINER= desktop@FreeBSD.org COMMENT= D-Bus interface for user account query and manipulation WWW= https://gitlab.freedesktop.org/accountsservice/accountsservice @@ -15,16 +11,16 @@ LICENSE_FILE= ${WRKSRC}/COPYING BUILD_DEPENDS= dbus>0:devel/dbus -LIB_DEPENDS= libpolkit-gobject-1.so:sysutils/polkit +LIB_DEPENDS= libpolkit-gobject-1.so:sysutils/polkit \ + libconsolekit.so:sysutils/consolekit2 USES= cpe gettext gnome localbase:ldflags meson pkgconfig tar:xz CPE_VENDOR= freedesktop USE_GNOME= glib20 intltool libxslt introspection:build USE_LDCONFIG= yes -MESON_ARGS= -Delogind=false \ +MESON_ARGS= -Dconsolekit=true \ -Dgdmconffile=${LOCALBASE}/etc/gdm/custom.conf \ -Dlocalstatedir=/var \ - -Dsystemd=false \ -Dsystemdsystemunitdir=no .include Index: sysutils/accountsservice/distinfo =================================================================== --- sysutils/accountsservice/distinfo +++ sysutils/accountsservice/distinfo @@ -1,5 +1,3 @@ -TIMESTAMP = 1600462353 -SHA256 (accountsservice-0.6.55.tar.xz) = ff2b2419a7e06bd9cb335ffe391c7409b49a0f0130b890bd54692a3986699c9b -SIZE (accountsservice-0.6.55.tar.xz) = 97972 -SHA256 (ac9b14f1c1bb.patch) = 2a369203c0f9d091ab1d6ff46c3b9ab88c345ed27e314f04a867ccc4b33e2be2 -SIZE (ac9b14f1c1bb.patch) = 723 +TIMESTAMP = 1670776865 +SHA256 (accountsservice-22.08.8.tar.xz) = 909997a76919fe7dc138a9a01cea70bd622d5a932dbc9fb13010113023a7a391 +SIZE (accountsservice-22.08.8.tar.xz) = 102672 Index: sysutils/accountsservice/files/patch-meson.build =================================================================== --- sysutils/accountsservice/files/patch-meson.build +++ sysutils/accountsservice/files/patch-meson.build @@ -1,16 +1,31 @@ ---- meson.build.orig 2018-09-29 12:54:53 UTC +--- meson.build.orig 2022-01-28 20:47:34 UTC +++ meson.build -@@ -82,8 +82,11 @@ if cc.has_header_symbol('utmpx.h', 'WTMPX_FILENAME', p - elif cc.has_header_symbol('paths.h', '_PATH_WTMPX') +@@ -57,6 +57,7 @@ config_h.set_quoted('GETTEXT_PACKAGE', act_gettext) + + # headers + check_headers = [ ++ 'crypt.h', + 'paths.h', + 'shadow.h', + 'utmpx.h', +@@ -102,7 +103,6 @@ elif cc.has_header_symbol('paths.h', '_PATH_WTMPX') config_h.set('PATH_WTMP', '_PATH_WTMPX') else -- assert(run_command('test', '-e', '/var/log/utx.log').returncode() == 0, 'Do not know which filename to watch for wtmp changes') -- config_h.set_quoted('PATH_WTMP', '/var/log/utx.log') -+ # Ugly hack for jails builders! -+ _system = host_machine.system().to_lower() -+ if _system.contains('freebsd') -+ config_h.set_quoted('PATH_WTMP', '/var/log/utx.log') -+ endif + path_wtmp = '/var/log/utx.log' +- assert(run_command('test', '-e', path_wtmp).returncode() == 0, 'Do not know which filename to watch for wtmp changes') + config_h.set_quoted('PATH_WTMP', path_wtmp) + endif + +@@ -207,10 +207,8 @@ config_h.set('MINIMUM_UID', get_option('minimum_uid')) + gdm_conf_file = get_option('gdmconffile') + config_h.set_quoted('PATH_GDM_CUSTOM', gdm_conf_file) + +-if get_option('elogind') +- logind_dep = dependency('libelogind', version: '>= 229.4') +-else +- logind_dep = dependency('libsystemd', version: '>= 186') ++if get_option('consolekit') ++ logind_dep = dependency('libconsolekit', version: '>= 1.2.0') endif - # compiler flags + subdir('data') Index: sysutils/accountsservice/files/patch-meson__options.txt =================================================================== --- /dev/null +++ sysutils/accountsservice/files/patch-meson__options.txt @@ -0,0 +1,11 @@ +--- meson_options.txt.orig 2022-01-28 20:47:34 UTC ++++ meson_options.txt +@@ -5,7 +5,7 @@ option('admin_group', type: 'string', value: '', descr + option('extra_admin_groups', type: 'array', value: [], description: 'Comma-separated list of extra groups that administrator users are part of') + option('minimum_uid', type: 'integer', value: 1000, description: 'Set minimum uid for human users') + +-option('elogind', type: 'boolean', value: false, description: 'Use elogind') ++option('consolekit', type: 'boolean', value: true, description: 'Use ConsoleKit2') + + option('introspection', type: 'boolean', value: true, description: 'Enable introspection for this build') + option('vapi', type: 'boolean', value: true, description : 'Enable Vala bindings for this build') Index: sysutils/accountsservice/files/patch-meson__post__install.py =================================================================== --- sysutils/accountsservice/files/patch-meson__post__install.py +++ sysutils/accountsservice/files/patch-meson__post__install.py @@ -1,11 +1,13 @@ ---- meson_post_install.py.orig 2019-04-23 15:16:09 UTC +--- meson_post_install.py.orig 2022-02-15 21:53:55 UTC +++ meson_post_install.py -@@ -9,8 +9,8 @@ localstatedir = os.path.normpath(destdir + os.sep + sy +@@ -9,9 +9,9 @@ localstatedir = os.path.normpath(destdir + os.sep + sy # FIXME: meson will not track the creation of these directories # https://github.com/mesonbuild/meson/blob/master/mesonbuild/scripts/uninstall.py#L39 dst_dirs = [ +- (os.path.join(localstatedir, 'lib'), 0o755), - (os.path.join(localstatedir, 'lib', 'AccountsService', 'icons'), 0o775), - (os.path.join(localstatedir, 'lib', 'AccountsService', 'users'), 0o700), ++ (os.path.join(localstatedir, 'db'), 0o755), + (os.path.join(localstatedir, 'db', 'AccountsService', 'icons'), 0o775), + (os.path.join(localstatedir, 'db', 'AccountsService', 'users'), 0o700), ] Index: sysutils/accountsservice/files/patch-src_daemon.c =================================================================== --- sysutils/accountsservice/files/patch-src_daemon.c +++ sysutils/accountsservice/files/patch-src_daemon.c @@ -1,6 +1,6 @@ ---- src/daemon.c.orig 2018-09-26 13:20:49 UTC +--- src/daemon.c.orig 2022-01-28 20:47:34 UTC +++ src/daemon.c -@@ -79,7 +79,11 @@ typedef struct { +@@ -84,7 +84,11 @@ typedef struct { GHashTable *extension_ifaces; } DaemonPrivate; @@ -10,9 +10,9 @@ +typedef struct passwd * (* EntryGeneratorFunc) (Daemon *, GHashTable *, gpointer *); +#endif - static void daemon_accounts_accounts_iface_init (AccountsAccountsIface *iface); - -@@ -154,17 +158,25 @@ remove_cache_files (const gchar *user_name) + typedef struct { + Daemon *daemon; +@@ -168,17 +172,25 @@ remove_cache_files (const gchar *user_name) } static struct passwd * @@ -38,7 +38,7 @@ struct { FILE *fp; -@@ -175,6 +187,7 @@ entry_generator_fgetpwent (Daemon *daemon, +@@ -189,6 +201,7 @@ entry_generator_fgetpwent (Daemon *daemon, if (*state == NULL) { GHashTable *shadow_users = NULL; FILE *fp; @@ -46,7 +46,7 @@ struct spwd *shadow_entry; fp = fopen (PATH_SHADOW, "r"); -@@ -208,6 +221,7 @@ entry_generator_fgetpwent (Daemon *daemon, +@@ -222,6 +235,7 @@ entry_generator_fgetpwent (Daemon *daemon, g_clear_pointer (&shadow_users, g_hash_table_unref); return NULL; } @@ -54,7 +54,7 @@ fp = fopen (PATH_PASSWD, "r"); if (fp == NULL) { -@@ -229,12 +243,17 @@ entry_generator_fgetpwent (Daemon *daemon, +@@ -243,6 +257,7 @@ entry_generator_fgetpwent (Daemon *daemon, if (g_hash_table_size (users) < MAX_LOCAL_USERS) { pwent = fgetpwent (generator_state->fp); if (pwent != NULL) { @@ -62,17 +62,23 @@ shadow_entry_buffers = g_hash_table_lookup (generator_state->users, pwent->pw_name); if (shadow_entry_buffers != NULL) { - *spent = &shadow_entry_buffers->spbuf; +@@ -255,7 +270,15 @@ entry_generator_fgetpwent (Daemon *daemon, + + return entry_generator_fgetpwent (daemon, users, state, spent); } - return pwent; +#else -+ if (!generator_state->users || g_hash_table_lookup (generator_state->users, pwent->pw_name)) -+ return pwent; ++ /* Skip system users... */ ++ if (!user_classify_is_human (pwent->pw_uid, pwent->pw_name, pwent->pw_shell, NULL)) { ++ g_debug ("skipping user: %s", pwent->pw_name); + ++ return entry_generator_fgetpwent (daemon, users, state); ++ } +#endif ++ + return pwent; } } - -@@ -248,10 +267,16 @@ entry_generator_fgetpwent (Daemon *daemon, +@@ -270,10 +293,16 @@ entry_generator_fgetpwent (Daemon *daemon, } static struct passwd * @@ -89,7 +95,7 @@ { struct passwd *pwent; g_autoptr(GError) error = NULL; -@@ -293,7 +318,9 @@ entry_generator_cachedir (Daemon *daemon, +@@ -315,7 +344,9 @@ entry_generator_cachedir (Daemon *daemon, errno = 0; pwent = getpwnam (name); if (pwent != NULL) { @@ -99,7 +105,7 @@ return pwent; } else if (errno == 0) { -@@ -329,10 +356,16 @@ entry_generator_cachedir (Daemon *daemon, +@@ -345,10 +376,16 @@ entry_generator_cachedir (Daemon *daemon, } static struct passwd * @@ -116,7 +122,7 @@ { DaemonPrivate *priv = daemon_get_instance_private (daemon); struct passwd *pwent; -@@ -360,7 +393,9 @@ entry_generator_requested_users (Daemon *daemon, +@@ -376,7 +413,9 @@ entry_generator_requested_users (Daemon *daemon, if (pwent == NULL) { g_debug ("user '%s' requested previously but not present on system", name); } else { @@ -126,7 +132,7 @@ return pwent; } -@@ -383,19 +418,29 @@ load_entries (Daemon *daemon, +@@ -399,14 +438,20 @@ load_entries (Daemon *daemon, DaemonPrivate *priv = daemon_get_instance_private (daemon); gpointer generator_state = NULL; struct passwd *pwent; @@ -147,16 +153,7 @@ if (pwent == NULL) break; - /* Skip system users... */ -+#ifdef HAVE_SHADOW_H - if (!explicitly_requested && !user_classify_is_human (pwent->pw_uid, pwent->pw_name, pwent->pw_shell, spent? spent->sp_pwdp : NULL)) { -+#else -+ if (!explicitly_requested && !user_classify_is_human (pwent->pw_uid, pwent->pw_name, pwent->pw_shell, NULL)) { -+#endif - g_debug ("skipping user: %s", pwent->pw_name); - continue; - } -@@ -417,7 +462,11 @@ load_entries (Daemon *daemon, +@@ -427,7 +472,11 @@ load_entries (Daemon *daemon, /* freeze & update users not already in the new list */ g_object_freeze_notify (G_OBJECT (user)); @@ -168,7 +165,7 @@ g_hash_table_insert (users, g_strdup (user_get_user_name (user)), user); g_debug ("loaded user: %s", user_get_user_name (user)); -@@ -823,15 +872,24 @@ throw_error (GDBusMethodInvocation *context, +@@ -841,15 +890,24 @@ throw_error (GDBusMethodInvocation *context, } static User * @@ -193,7 +190,7 @@ user_register (user); g_hash_table_insert (priv->users, -@@ -860,9 +918,13 @@ daemon_local_find_user_by_id (Daemon *daemon, +@@ -878,9 +936,13 @@ daemon_local_find_user_by_id (Daemon *daemon, user = g_hash_table_lookup (priv->users, pwent->pw_name); if (user == NULL) { @@ -207,7 +204,7 @@ priv->explicitly_requested_users = g_list_append (priv->explicitly_requested_users, g_strdup (pwent->pw_name)); -@@ -888,9 +950,13 @@ daemon_local_find_user_by_name (Daemon *daemon, +@@ -906,9 +968,13 @@ daemon_local_find_user_by_name (Daemon *daemon, user = g_hash_table_lookup (priv->users, pwent->pw_name); if (user == NULL) { @@ -221,7 +218,7 @@ priv->explicitly_requested_users = g_list_append (priv->explicitly_requested_users, g_strdup (pwent->pw_name)); -@@ -1095,10 +1161,12 @@ daemon_create_user_authorized_cb (Daemon +@@ -1102,10 +1168,12 @@ daemon_create_user_authorized_cb (Daemon sys_log (context, "create user '%s'", cd->user_name); @@ -236,11 +233,11 @@ + argv[4] = "-c"; + argv[5] = cd->real_name; if (cd->account_type == ACCOUNT_TYPE_ADMINISTRATOR) { - if (EXTRA_ADMIN_GROUPS != NULL && EXTRA_ADMIN_GROUPS[0] != '\0') - admin_groups = g_strconcat (ADMIN_GROUP, ",", -@@ -1106,15 +1174,11 @@ daemon_create_user_authorized_cb (Daemon - else - admin_groups = g_strdup (ADMIN_GROUP); + g_auto(GStrv) admin_groups_array = NULL; + g_autoptr(GStrvBuilder) admin_groups_builder = g_strv_builder_new (); +@@ -1126,15 +1194,11 @@ daemon_create_user_authorized_cb (Daemon + admin_groups_array = g_strv_builder_end (admin_groups_builder); + admin_groups = g_strjoinv (",", admin_groups_array); - argv[4] = "-G"; - argv[5] = admin_groups; @@ -256,18 +253,18 @@ argv[6] = NULL; } else { -@@ -1281,7 +1345,7 @@ daemon_delete_user_authorized_cb (Daemon +@@ -1298,7 +1362,7 @@ daemon_delete_user_authorized_cb (Daemon DeleteUserData *ud = data; g_autoptr(GError) error = NULL; struct passwd *pwent; - const gchar *argv[6]; + const gchar *argv[5]; + const gchar *homedir; + gchar *resolved_homedir; User *user; - - pwent = getpwuid (ud->uid); -@@ -1307,19 +1371,16 @@ daemon_delete_user_authorized_cb (Daemon - - user_set_saved (user, FALSE); +@@ -1335,19 +1399,16 @@ daemon_delete_user_authorized_cb (Daemon + } + free (resolved_homedir); - argv[0] = "/usr/sbin/userdel"; + argv[0] = "/usr/sbin/pw"; Index: sysutils/accountsservice/files/patch-src_libaccountsservice_act-user-manager.c =================================================================== --- sysutils/accountsservice/files/patch-src_libaccountsservice_act-user-manager.c +++ sysutils/accountsservice/files/patch-src_libaccountsservice_act-user-manager.c @@ -1,18 +1,564 @@ -Obtained from: - https://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/ports/sysutils/accountsservice/patches/patch-src_libaccountsservice_act-user-manager_c - -$OpenBSD: patch-src_libaccountsservice_act-user-manager_c,v 1.2 2021/08/30 19:15:24 ajacoutot Exp $ - -REVERT: (breaks listing users in gdm and gnome-cc and unlocking screenshield) -From c7fa612023a163e8b2352e1170c6df3fceb19b27 Mon Sep 17 00:00:00 2001 -From: Ray Strode -Date: Thu, 19 Jul 2018 13:14:09 -0400 -Subject: [PATCH] lib: don't set loaded state until seat is fetched - -Index: src/libaccountsservice/act-user-manager.c ---- src/libaccountsservice/act-user-manager.c.orig +--- src/libaccountsservice/act-user-manager.c.orig 2022-01-28 20:47:34 UTC +++ src/libaccountsservice/act-user-manager.c -@@ -2547,7 +2547,7 @@ maybe_set_is_loaded (ActUserManager *manager) +@@ -40,7 +40,7 @@ + #include + #include + #include +-#include ++#include + + #include "act-user-manager.h" + #include "act-user-private.h" +@@ -99,9 +99,6 @@ typedef struct + char *id; + char *session_id; + guint load_idle_id; +- sd_login_monitor *session_monitor; +- GInputStream *session_monitor_stream; +- guint session_monitor_source_id; + } ActUserManagerSeat; + + typedef enum { +@@ -158,6 +155,8 @@ typedef struct + GDBusConnection *connection; + AccountsAccounts *accounts_proxy; + ++ LibConsoleKit *ck; ++ + ActUserManagerSeat seat; + + GSList *new_sessions; +@@ -246,6 +245,71 @@ act_user_manager_error_quark (void) + return (GQuark) ret; + } + ++static gint ++consolekit_get_sessions (gchar ***sessions) ++{ ++ g_autoptr(GDBusConnection) connection = NULL; ++ g_autoptr(GVariant) variant = NULL; ++ g_autoptr(GError) error = NULL; ++ ++ connection = g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, &error); ++ if (connection == NULL) { ++ g_warning ("Failed to get system bus: %s", error->message); ++ return -1; ++ } ++ ++ variant = g_dbus_connection_call_sync (connection, ++ "org.freedesktop.ConsoleKit", ++ "/org/freedesktop/ConsoleKit/Manager", ++ "org.freedesktop.ConsoleKit.Manager", ++ "GetSessions", ++ NULL, ++ G_VARIANT_TYPE ("(ao)"), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, NULL, &error); ++ if (variant == NULL) { ++ g_warning ("Failed to call GetSessions: %s", ++ error->message); ++ return -1; ++ } ++ ++ g_variant_get (variant, "(^ao)", sessions); ++ return g_strv_length (*sessions); ++} ++ ++static gint ++consolekit_uid_get_sessions (uid_t uid, ++ gchar ***sessions) ++{ ++ g_autoptr(GDBusConnection) connection = NULL; ++ g_autoptr(GVariant) variant = NULL; ++ g_autoptr(GError) error = NULL; ++ ++ connection = g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, &error); ++ if (connection == NULL) { ++ g_warning ("Failed to get system bus: %s", error->message); ++ return -1; ++ } ++ ++ variant = g_dbus_connection_call_sync (connection, ++ "org.freedesktop.ConsoleKit", ++ "/org/freedesktop/ConsoleKit/Manager", ++ "org.freedesktop.ConsoleKit.Manager", ++ "GetSessionsForUnixUser", ++ g_variant_new ("(u)", uid), ++ G_VARIANT_TYPE ("(ao)"), ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, NULL, &error); ++ if (variant == NULL) { ++ g_warning ("Failed to call GetSessionsForUnixUser: %s", ++ error->message); ++ return -1; ++ } ++ ++ g_variant_get (variant, "(^ao)", sessions); ++ return g_strv_length (*sessions); ++} ++ + static gboolean + activate_systemd_session_id (ActUserManager *manager, + const char *seat_id, +@@ -262,13 +326,13 @@ activate_systemd_session_id (ActUserManager *manager, + } + + reply = g_dbus_connection_call_sync (connection, +- "org.freedesktop.login1", +- "/org/freedesktop/login1", +- "org.freedesktop.login1.Manager", ++ "org.freedesktop.ConsoleKit", ++ "/org/freedesktop/ConsoleKit/Manager", ++ "org.freedesktop.ConsoleKit.Manager", + "ActivateSessionOnSeat", + g_variant_new ("(ss)", +- seat_id, +- session_id), ++ session_id, ++ seat_id), + NULL, + G_DBUS_CALL_FLAGS_NONE, + -1, +@@ -286,14 +350,24 @@ static gboolean + session_is_login_window (ActUserManager *manager, + const char *session_id) + { +- int res; ++ ActUserManagerPrivate *priv = act_user_manager_get_instance_private (manager); ++ gboolean res; + g_autofree gchar *session_class = NULL; ++ g_autoptr(GError) error = NULL; + +- res = sd_session_get_class (session_id, &session_class); +- if (res < 0) { +- g_debug ("failed to determine class of session %s: %s", +- session_id, +- strerror (-res)); ++ g_return_val_if_fail (ACT_IS_USER_MANAGER (manager), FALSE); ++ ++ res = lib_consolekit_session_get_class (priv->ck, session_id, ++ &session_class, &error); ++ if (!res) { ++ if (error != NULL) { ++ g_debug ("failed to determine class of session %s: %s", ++ session_id, ++ error->message); ++ } else { ++ g_debug ("failed to determine class of session %s", ++ session_id); ++ } + return FALSE; + } + +@@ -305,17 +379,22 @@ session_is_on_our_seat (ActUserManager *manager, + const char *session_id) + { + ActUserManagerPrivate *priv = act_user_manager_get_instance_private (manager); +- int res; ++ gboolean res; + g_autofree gchar *session_seat = NULL; ++ g_autoptr(GError) error = NULL; + +- res = sd_session_get_seat (session_id, &session_seat); +- if (res == -ENODATA) { ++ res = lib_consolekit_session_get_seat (priv->ck, session_id, ++ &session_seat, &error); ++ if (!res) { ++ if (error != NULL) { ++ g_debug ("failed to determine seat of session %s: %s", ++ session_id, ++ error->message); ++ } else { ++ g_debug ("failed to determine seat of session %s", ++ session_id); ++ } + return FALSE; +- } else if (res < 0) { +- g_debug ("failed to determine seat of session %s: %s", +- session_id, +- strerror (-res)); +- return FALSE; + } + + return g_strcmp0 (priv->seat.id, session_seat) == 0; +@@ -356,12 +435,19 @@ static gboolean + _can_activate_systemd_sessions (ActUserManager *manager) + { + ActUserManagerPrivate *priv = act_user_manager_get_instance_private (manager); +- int res; ++ gboolean res; ++ g_autoptr(GError) error = NULL; + +- res = sd_seat_can_multi_session (priv->seat.id); +- if (res < 0) { +- g_warning ("unable to determine if seat %s can activate sessions: %s", +- priv->seat.id, strerror (-res)); ++ res = lib_consolekit_seat_can_multi_session (priv->ck, ++ priv->seat.id, &error); ++ if (!res) { ++ if (error != NULL) { ++ g_warning ("unable to determine if seat %s can activate sessions: %s", ++ priv->seat.id, error->message); ++ } else { ++ g_warning ("unable to determine if seat %s can activate sessions", ++ priv->seat.id); ++ } + return FALSE; + } + +@@ -510,17 +596,27 @@ queue_load_seat_incrementally (ActUserManager *manager + } + + static gboolean +-_systemd_session_is_graphical (const char *session_id) ++_consolekit_session_is_graphical (ActUserManager *manager, ++ const char *session_id) + { ++ ActUserManagerPrivate *priv = act_user_manager_get_instance_private (manager); + const gchar * const graphical_session_types[] = { "wayland", "x11", "mir", NULL }; +- int saved_errno; ++ gboolean res; + g_autofree gchar *type = NULL; ++ g_autoptr(GError) error = NULL; + +- saved_errno = sd_session_get_type (session_id, &type); +- if (saved_errno < 0) { +- g_warning ("Couldn't get type for session '%s': %s", +- session_id, +- g_strerror (-saved_errno)); ++ g_return_val_if_fail (ACT_IS_USER_MANAGER (manager), FALSE); ++ ++ res = lib_consolekit_session_get_type (priv->ck, session_id, ++ &type, &error); ++ if (!res) { ++ if (error != NULL) { ++ g_warning ("Couldn't get type for session '%s': %s", ++ session_id, error->message); ++ } else { ++ g_warning ("Couldn't get type for session '%s'", ++ session_id); ++ } + return FALSE; + } + +@@ -535,23 +631,33 @@ _systemd_session_is_graphical (const char *session_id) + } + + static gboolean +-_systemd_session_is_active (const char *session_id) ++_consolekit_session_is_active (ActUserManager *manager, ++ const char *session_id) + { ++ ActUserManagerPrivate *priv = act_user_manager_get_instance_private (manager); + const gchar * const active_states[] = { "active", "online", NULL }; +- int saved_errno; ++ gboolean res; + g_autofree gchar *state = NULL; ++ g_autoptr(GError) error = NULL; + ++ g_return_val_if_fail (ACT_IS_USER_MANAGER (manager), FALSE); ++ + /* + * display sessions can be 'closing' if they are logged out but some + * processes are lingering; we shouldn't consider these (this is + * checking for a race condition since we specified that we want online + * sessions only) + */ +- saved_errno = sd_session_get_state (session_id, &state); +- if (saved_errno < 0) { +- g_warning ("Couldn't get state for session '%s': %s", +- session_id, +- g_strerror (-saved_errno)); ++ res = lib_consolekit_session_get_state (priv->ck, session_id, ++ &state, &error); ++ if (!res) { ++ if (error != NULL) { ++ g_warning ("Couldn't get state for session '%s': %s", ++ session_id, error->message); ++ } else { ++ g_warning ("Couldn't get state for session '%s'", ++ session_id); ++ } + return FALSE; + } + +@@ -564,23 +670,18 @@ _systemd_session_is_active (const char *session_id) + } + + static gboolean +-_find_graphical_systemd_session (char **session_id) ++_find_graphical_consolekit_session (ActUserManager *manager, ++ char **session_id) + { + char *local_session_id = NULL; + g_auto(GStrv) sessions = NULL; + int n_sessions; + +- /* filter level 0 means to include inactive and active sessions +- * (>0 would mean to return only the active session, and <0 would mean to +- * include closing sessions too) +- */ +- static int filter_level = 0; +- + g_return_val_if_fail (session_id != NULL, FALSE); + + g_debug ("Finding a graphical session for user %d", getuid ()); + +- n_sessions = sd_uid_get_sessions (getuid (), filter_level, &sessions); ++ n_sessions = consolekit_uid_get_sessions (getuid (), &sessions); + + if (n_sessions < 0) { + g_critical ("Failed to get sessions for user %d", getuid ()); +@@ -590,10 +691,10 @@ _find_graphical_systemd_session (char **session_id) + for (int i = 0; i < n_sessions; ++i) { + g_debug ("Considering session '%s'", sessions[i]); + +- if (!_systemd_session_is_graphical (sessions[i])) ++ if (!_consolekit_session_is_graphical (manager, sessions[i])) + continue; + +- if (!_systemd_session_is_active (sessions[i])) ++ if (!_consolekit_session_is_active (manager, sessions[i])) + continue; + + /* +@@ -615,23 +716,29 @@ static void + get_seat_id_for_current_session (ActUserManager *manager) + { + ActUserManagerPrivate *priv = act_user_manager_get_instance_private (manager); +- int res; ++ gboolean res; + g_autofree gchar *seat_id = NULL; ++ g_autoptr(GError) error = NULL; + + if (priv->seat.session_id == NULL) { +- if (!_find_graphical_systemd_session (&priv->seat.session_id)) { ++ if (!_find_graphical_consolekit_session (manager, ++ &priv->seat.session_id)) { + g_warning ("Could not get session"); + return; + } + } + +- res = sd_session_get_seat (priv->seat.session_id, &seat_id); ++ res = lib_consolekit_session_get_seat (priv->ck, ++ priv->seat.session_id, ++ &seat_id, &error); + +- if (res == -ENODATA) { +- seat_id = NULL; +- } else if (res < 0) { +- g_warning ("Could not get current seat: %s", +- strerror (-res)); ++ if (!res) { ++ if (error != NULL) { ++ g_warning ("Could not get current seat: %s", ++ error->message); ++ } else { ++ g_warning ("Could not get current seat"); ++ } + unload_seat (manager); + return; + } +@@ -1082,7 +1189,7 @@ get_current_session_id (ActUserManager *manager) + ActUserManagerPrivate *priv = act_user_manager_get_instance_private (manager); + g_autofree gchar *session_id = NULL; + +- if (!_find_graphical_systemd_session (&session_id)) { ++ if (!_find_graphical_consolekit_session (manager, &session_id)) { + g_debug ("Failed to identify the current session"); + unload_seat (manager); + return; +@@ -1138,15 +1245,27 @@ unload_new_session (ActUserManagerNewSession *new_sess + static void + get_uid_for_new_session (ActUserManagerNewSession *new_session) + { +- uid_t uid; +- int res; ++ ActUserManager *manager; ++ uid_t uid; ++ gboolean res; ++ g_autoptr(GError) error = NULL; + +- res = sd_session_get_uid (new_session->id, &uid); ++ manager = ACT_USER_MANAGER (new_session->manager); ++ ActUserManagerPrivate *priv = act_user_manager_get_instance_private (manager); + +- if (res < 0) { +- g_debug ("Failed to get uid of session '%s': %s", +- new_session->id, +- strerror (-res)); ++ res = lib_consolekit_session_get_uid (priv->ck, ++ new_session->id, ++ &uid, &error); ++ ++ if (!res) { ++ if (error != NULL) { ++ g_debug ("Failed to get uid of session '%s': %s", ++ new_session->id, ++ error->message); ++ } else { ++ g_debug ("Failed to get uid of session '%s'", ++ new_session->id); ++ } + unload_new_session (new_session); + return; + } +@@ -1309,16 +1428,26 @@ load_included_usernames (ActUserManager *manager) + static void + get_x11_display_for_new_session (ActUserManagerNewSession *new_session) + { ++ ActUserManager *manager; + g_autofree gchar *session_type = NULL; + g_autofree gchar *x11_display = NULL; +- int res; ++ gboolean res; ++ g_autoptr(GError) error = NULL; + +- res = sd_session_get_type (new_session->id, +- &session_type); +- if (res < 0) { +- g_debug ("ActUserManager: Failed to get the type of session '%s': %s", +- new_session->id, +- strerror (-res)); ++ manager = ACT_USER_MANAGER (new_session->manager); ++ ActUserManagerPrivate *priv = act_user_manager_get_instance_private (manager); ++ ++ res = lib_consolekit_session_get_type (priv->ck, ++ new_session->id, ++ &session_type, &error); ++ if (!res) { ++ if (error != NULL) { ++ g_debug ("ActUserManager: Failed to get the type of session '%s': %s", ++ new_session->id, error->message); ++ } else { ++ g_debug ("ActUserManager: Failed to get the type of session '%s'", ++ new_session->id); ++ } + unload_new_session (new_session); + return; + } +@@ -1332,12 +1461,17 @@ get_x11_display_for_new_session (ActUserManagerNewSess + goto done; + } + +- res = sd_session_get_display (new_session->id, +- &x11_display); +- if (res < 0) { +- g_debug ("ActUserManager: Failed to get the x11 display of session '%s': %s", +- new_session->id, +- strerror (-res)); ++ res = lib_consolekit_session_get_display (priv->ck, ++ new_session->id, ++ &x11_display, &error); ++ if (!res) { ++ if (error != NULL) { ++ g_debug ("ActUserManager: Failed to get the x11 display of session '%s': %s", ++ new_session->id, error->message); ++ } else { ++ g_debug ("ActUserManager: Failed to get the x11 display of session '%s'", ++ new_session->id); ++ } + g_debug ("ActUserManager: Treating X11 display as blank"); + x11_display = strdup (""); + } else { +@@ -1562,12 +1696,15 @@ _remove_stale_systemd_sessions (ActUserManager *manage + static void + reload_systemd_sessions (ActUserManager *manager) + { ++ ActUserManagerPrivate *priv = act_user_manager_get_instance_private (manager); + int res; + int i; + g_auto(GStrv) sessions = NULL; + g_autoptr(GHashTable) systemd_sessions = NULL; + +- res = sd_get_sessions (&sessions); ++ g_return_if_fail (ACT_IS_USER_MANAGER (manager)); ++ ++ res = consolekit_get_sessions (&sessions); + if (res < 0) { + g_debug ("Failed to determine sessions: %s", strerror (-res)); + return; +@@ -1581,9 +1718,11 @@ reload_systemd_sessions (ActUserManager *manager) + g_autofree gchar *state = NULL; + g_autofree gchar *session_class = NULL; + +- res = sd_session_get_state (sessions[i], &state); +- if (res < 0) { +- g_debug ("Failed to determine state of session %s: %s", sessions[i], strerror (-res)); ++ if (!lib_consolekit_session_get_state (priv->ck, ++ sessions[i], ++ &state, ++ NULL)) { ++ g_debug ("Failed to determine state of session %s", sessions[i]); + continue; + } + +@@ -1591,9 +1730,11 @@ reload_systemd_sessions (ActUserManager *manager) + continue; + } + +- res = sd_session_get_class (sessions[i], &session_class); +- if (res < 0) { +- g_debug ("Failed to determine class of session %s: %s", sessions[i], strerror (-res)); ++ if (!lib_consolekit_session_get_class (priv->ck, ++ sessions[i], ++ &session_class, ++ NULL)) { ++ g_debug ("Failed to determine class of session %s", sessions[i]); + continue; + } + +@@ -1612,45 +1753,18 @@ reload_systemd_sessions (ActUserManager *manager) + _remove_stale_systemd_sessions (manager, systemd_sessions); + } + +-static gboolean +-on_session_monitor_event (GPollableInputStream *stream, +- ActUserManager *manager) +-{ +- ActUserManagerPrivate *priv = act_user_manager_get_instance_private (manager); +- sd_login_monitor_flush (priv->seat.session_monitor); +- reload_systemd_sessions (manager); +- return TRUE; +-} +- + static void + _monitor_for_systemd_session_changes (ActUserManager *manager) + { + ActUserManagerPrivate *priv = act_user_manager_get_instance_private (manager); +- int res; +- int fd; +- GSource *source; + +- res = sd_login_monitor_new ("session", &priv->seat.session_monitor); ++ priv->ck = lib_consolekit_new (); + +- if (res < 0) { +- g_warning ("Failed to monitor logind session changes: %s", +- strerror (-res)); ++ if (priv->ck == NULL) { ++ g_warning ("Failed to connect to the ConsoleKit2 daemon"); + unload_seat (manager); + return; + } +- +- fd = sd_login_monitor_get_fd (priv->seat.session_monitor); +- +- priv->seat.session_monitor_stream = g_unix_input_stream_new (fd, FALSE); +- source = g_pollable_input_stream_create_source (G_POLLABLE_INPUT_STREAM (priv->seat.session_monitor_stream), +- NULL); +- g_source_set_callback (source, +- (GSourceFunc) +- on_session_monitor_event, +- manager, +- NULL); +- priv->seat.session_monitor_source_id = g_source_attach (source, NULL); +- g_source_unref (source); + } + + static void +@@ -2034,7 +2148,7 @@ maybe_set_is_loaded (ActUserManager *manager) /* Don't set is_loaded yet unless the seat is already loaded enough * or failed to load. */ @@ -21,4 +567,22 @@ g_debug ("ActUserManager: Seat loaded, so now setting loaded property"); } else if (priv->seat.state == ACT_USER_MANAGER_SEAT_STATE_UNLOADED) { g_debug ("ActUserManager: Seat wouldn't load, so giving up on it and setting loaded property"); - +@@ -2513,16 +2627,8 @@ act_user_manager_finalize (GObject *object) + g_source_remove (priv->seat.load_idle_id); + } + +- if (priv->seat.session_monitor != NULL) { +- sd_login_monitor_unref (priv->seat.session_monitor); +- } +- +- if (priv->seat.session_monitor_stream != NULL) { +- g_object_unref (priv->seat.session_monitor_stream); +- } +- +- if (priv->seat.session_monitor_source_id != 0) { +- g_source_remove (priv->seat.session_monitor_source_id); ++ if (priv->ck != NULL) { ++ g_object_unref (priv->ck); + } + + if (priv->accounts_proxy != NULL) { Index: sysutils/accountsservice/files/patch-src_libaccountsservice_act-user.c =================================================================== --- sysutils/accountsservice/files/patch-src_libaccountsservice_act-user.c +++ sysutils/accountsservice/files/patch-src_libaccountsservice_act-user.c @@ -1,11 +1,12 @@ ---- src/libaccountsservice/act-user.c.orig 2018-04-04 13:59:42 UTC +--- src/libaccountsservice/act-user.c.orig 2022-01-28 20:47:34 UTC +++ src/libaccountsservice/act-user.c -@@ -26,8 +26,6 @@ +@@ -26,7 +26,9 @@ #include #include --#include -- ++#ifdef HAVE_CRYPT_H + #include ++#endif + #include #include - #include Index: sysutils/accountsservice/files/patch-src_meson.build =================================================================== --- sysutils/accountsservice/files/patch-src_meson.build +++ sysutils/accountsservice/files/patch-src_meson.build @@ -1,9 +1,9 @@ ---- src/meson.build.orig 2018-09-29 12:54:53 UTC +--- src/meson.build.orig 2022-01-28 20:47:34 UTC +++ src/meson.build -@@ -26,8 +26,8 @@ deps = [ - cflags = [ +@@ -28,8 +28,8 @@ cflags = [ '-DLOCALSTATEDIR="@0@"'.format(act_localstatedir), '-DDATADIR="@0@"'.format(act_datadir), + '-DSYSCONFDIR="@0@"'.format(act_sysconfdir), - '-DICONDIR="@0@"'.format(join_paths(act_localstatedir, 'lib', 'AccountsService', 'icons')), - '-DUSERDIR="@0@"'.format(join_paths(act_localstatedir, 'lib', 'AccountsService', 'users')), + '-DICONDIR="@0@"'.format(join_paths(act_localstatedir, 'db', 'AccountsService', 'icons')), Index: sysutils/accountsservice/files/patch-src_user.h =================================================================== --- sysutils/accountsservice/files/patch-src_user.h +++ sysutils/accountsservice/files/patch-src_user.h @@ -1,19 +1,12 @@ ---- src/user.h.orig 2016-09-06 17:31:50 UTC +--- src/user.h.orig 2022-01-28 20:47:34 UTC +++ src/user.h -@@ -22,7 +22,9 @@ +@@ -54,11 +54,16 @@ typedef enum { - #include - #include -+#ifdef HAVE_SHADOW_H - #include -+#endif - - #include - #include -@@ -54,9 +56,14 @@ GType user_get_type (void) G_G + GType user_get_type (void) G_GNUC_CONST; User * user_new (Daemon *daemon, - uid_t uid); +- uid_t uid); ++ uid_t uid); +#ifdef HAVE_SHADOW_H void user_update_from_pwent (User *user, struct passwd *pwent, @@ -22,6 +15,6 @@ +void user_update_from_pwent (User *user, + struct passwd *pwent); +#endif - void user_update_from_keyfile (User *user, - GKeyFile *keyfile); + void user_update_from_cache (User *user); void user_update_local_account_property (User *user, + gboolean local); Index: sysutils/accountsservice/files/patch-src_user.c =================================================================== --- sysutils/accountsservice/files/patch-src_user.c +++ sysutils/accountsservice/files/patch-src_user.c @@ -1,6 +1,6 @@ ---- src/user.c.orig 2018-04-20 20:52:07 UTC +--- src/user.c.orig 2022-01-28 20:47:34 UTC +++ src/user.c -@@ -138,9 +138,14 @@ user_reset_icon_file (User *user) +@@ -396,9 +396,14 @@ user_update_from_template (User *user) } void @@ -15,7 +15,7 @@ { g_autofree gchar *real_name = NULL; gboolean is_system_account; -@@ -199,8 +204,10 @@ user_update_from_pwent (User *user, +@@ -460,8 +465,10 @@ user_update_from_pwent (User *user, accounts_user_set_shell (ACCOUNTS_USER (user), pwent->pw_shell); passwd = NULL; @@ -26,7 +26,7 @@ if (passwd && passwd[0] == '!') { locked = TRUE; -@@ -218,6 +225,7 @@ user_update_from_pwent (User *user, +@@ -479,6 +486,7 @@ user_update_from_pwent (User *user, mode = PASSWORD_MODE_NONE; } @@ -34,34 +34,34 @@ if (spent) { if (spent->sp_lstchg == 0) { mode = PASSWORD_MODE_SET_AT_LOGIN; -@@ -231,6 +239,9 @@ user_update_from_pwent (User *user, +@@ -495,6 +503,9 @@ user_update_from_pwent (User *user, user->days_after_expiration_until_lock = spent->sp_inact; user->account_expiration_policy_known = TRUE; } +#else -+ user->expiration_time = pwent->pw_expire; ++ user->user_expiration_time = g_date_time_new_from_unix_utc(pwent->pw_expire); +#endif accounts_user_set_password_mode (ACCOUNTS_USER (user), mode); is_system_account = !user_classify_is_human (accounts_user_get_uid (ACCOUNTS_USER (user)), -@@ -813,11 +824,11 @@ user_change_real_name_authorized_cb (Daemon - accounts_user_get_uid (ACCOUNTS_USER (user)), - name); +@@ -1141,11 +1152,11 @@ user_change_real_name_authorized_cb (Daemon + new_gecos = g_strdup (name); + } - argv[0] = "/usr/sbin/usermod"; - argv[1] = "-c"; -- argv[2] = name; +- argv[2] = new_gecos; - argv[3] = "--"; - argv[4] = accounts_user_get_user_name (ACCOUNTS_USER (user)); + argv[0] = "/usr/sbin/pw"; + argv[1] = "usermod"; + argv[2] = accounts_user_get_user_name (ACCOUNTS_USER (user)); + argv[3] = "-c"; -+ argv[4] = name; ++ argv[4] = new_gecos; argv[5] = NULL; if (!spawn_with_login_uid (context, argv, &error)) { -@@ -882,11 +893,11 @@ user_change_user_name_authorized_cb (Daemon +@@ -1214,11 +1225,11 @@ user_change_user_name_authorized_cb (Daemon accounts_user_get_uid (ACCOUNTS_USER (user)), name); @@ -78,16 +78,16 @@ argv[5] = NULL; if (!spawn_with_login_uid (context, argv, &error)) { -@@ -1183,7 +1194,7 @@ user_change_home_dir_authorized_cb (Daemon +@@ -1610,7 +1621,7 @@ user_change_home_dir_authorized_cb (Daemon { gchar *home_dir = data; g_autoptr(GError) error = NULL; - const gchar *argv[7]; -+ const gchar *argv[6]; ++ const gchar *argv[8]; if (g_strcmp0 (accounts_user_get_home_directory (ACCOUNTS_USER (user)), home_dir) != 0) { sys_log (context, -@@ -1192,13 +1203,12 @@ user_change_home_dir_authorized_cb (Daemon +@@ -1619,13 +1630,14 @@ user_change_home_dir_authorized_cb (Daemon accounts_user_get_uid (ACCOUNTS_USER (user)), home_dir); @@ -99,15 +99,17 @@ - argv[5] = accounts_user_get_user_name (ACCOUNTS_USER (user)); - argv[6] = NULL; + argv[0] = "/usr/sbin/pw"; -+ argv[1] = "-d"; -+ argv[2] = home_dir; -+ argv[3] = "-n"; -+ argv[4] = accounts_user_get_user_name (ACCOUNTS_USER (user)); -+ argv[5] = NULL; ++ argv[1] = "usermod"; ++ argv[2] = "-n"; ++ argv[3] = accounts_user_get_user_name (ACCOUNTS_USER (user)); ++ argv[4] = "-d"; ++ argv[5] = home_dir; ++ argv[6] = "-m"; ++ argv[7] = NULL; if (!spawn_with_login_uid (context, argv, &error)) { throw_error (context, ERROR_FAILED, "running '%s' failed: %s", argv[0], error->message); -@@ -1249,11 +1259,11 @@ user_change_shell_authorized_cb (Daemon +@@ -1675,11 +1687,11 @@ user_change_shell_authorized_cb (Daemon accounts_user_get_uid (ACCOUNTS_USER (user)), shell); @@ -124,7 +126,7 @@ argv[5] = NULL; if (!spawn_with_login_uid (context, argv, &error)) { -@@ -1456,7 +1466,7 @@ user_change_locked_authorized_cb (Daemon +@@ -1888,7 +1900,7 @@ user_change_locked_authorized_cb (Daemon { gboolean locked = GPOINTER_TO_INT (data); g_autoptr(GError) error = NULL; @@ -133,23 +135,31 @@ if (accounts_user_get_locked (ACCOUNTS_USER (user)) != locked) { sys_log (context, -@@ -1464,11 +1474,10 @@ user_change_locked_authorized_cb (Daemon +@@ -1896,11 +1908,10 @@ user_change_locked_authorized_cb (Daemon locked ? "locking" : "unlocking", accounts_user_get_user_name (ACCOUNTS_USER (user)), accounts_user_get_uid (ACCOUNTS_USER (user))); - argv[0] = "/usr/sbin/usermod"; -- argv[1] = locked ? "-L" : "-U"; ++ argv[0] = "/usr/sbin/pw"; + argv[1] = locked ? "-L" : "-U"; - argv[2] = "--"; - argv[3] = accounts_user_get_user_name (ACCOUNTS_USER (user)); - argv[4] = NULL; -+ argv[0] = "/usr/sbin/pw"; -+ argv[1] = locked ? "lock" : "unlock"; + argv[2] = accounts_user_get_user_name (ACCOUNTS_USER (user)); + argv[3] = NULL; if (!spawn_with_login_uid (context, argv, &error)) { throw_error (context, ERROR_FAILED, "running '%s' failed: %s", argv[0], error->message); -@@ -1589,11 +1598,11 @@ user_change_account_type_authorized_cb (Daemon +@@ -1973,7 +1984,7 @@ user_change_account_type_authorized_cb (Daemon + gsize n_extra_admin_groups_gids = 0; + gid_t admin_gid; + gint i; +- const gchar *argv[6]; ++ const gchar *argv[7]; + + if (((AccountType) accounts_user_get_account_type (ACCOUNTS_USER (user))) != account_type) { + sys_log (context, +@@ -2018,11 +2029,11 @@ user_change_account_type_authorized_cb (Daemon g_free (groups); @@ -166,7 +176,7 @@ argv[5] = NULL; if (!spawn_with_login_uid (context, argv, &error)) { -@@ -1643,7 +1652,7 @@ user_change_password_mode_authorized_cb (Daemon +@@ -2071,7 +2082,7 @@ user_change_password_mode_authorized_cb (Daemon { PasswordMode mode = GPOINTER_TO_INT (data); g_autoptr(GError) error = NULL; @@ -175,7 +185,7 @@ if (((PasswordMode) accounts_user_get_password_mode (ACCOUNTS_USER (user))) != mode) { sys_log (context, -@@ -1658,10 +1667,8 @@ user_change_password_mode_authorized_cb (Daemon +@@ -2086,10 +2097,8 @@ user_change_password_mode_authorized_cb (Daemon mode == PASSWORD_MODE_NONE) { argv[0] = "/usr/bin/passwd"; @@ -188,7 +198,7 @@ if (!spawn_with_login_uid (context, argv, &error)) { throw_error (context, ERROR_FAILED, "running '%s' failed: %s", argv[0], error->message); -@@ -1669,12 +1676,11 @@ user_change_password_mode_authorized_cb (Daemon +@@ -2097,12 +2106,11 @@ user_change_password_mode_authorized_cb (Daemon } if (mode == PASSWORD_MODE_SET_AT_LOGIN) { @@ -205,44 +215,29 @@ if (!spawn_with_login_uid (context, argv, &error)) { throw_error (context, ERROR_FAILED, "running '%s' failed: %s", argv[0], error->message); -@@ -1690,11 +1696,10 @@ user_change_password_mode_authorized_cb (Daemon - accounts_user_set_locked (ACCOUNTS_USER (user), FALSE); - } - else if (accounts_user_get_locked (ACCOUNTS_USER (user))) { -- argv[0] = "/usr/sbin/usermod"; -- argv[1] = "-U"; -- argv[2] = "--"; -- argv[3] = accounts_user_get_user_name (ACCOUNTS_USER (user)); -- argv[4] = NULL; -+ argv[0] = "/usr/sbin/pw"; -+ argv[1] = "unlock"; -+ argv[2] = accounts_user_get_user_name (ACCOUNTS_USER (user)); -+ argv[3] = NULL; - - if (!spawn_with_login_uid (context, argv, &error)) { - throw_error (context, ERROR_FAILED, "running '%s' failed: %s", argv[0], error->message); -@@ -1759,7 +1764,7 @@ user_change_password_authorized_cb (Daemon +@@ -2186,7 +2194,7 @@ user_change_password_authorized_cb (Daemon { gchar **strings = data; g_autoptr(GError) error = NULL; - const gchar *argv[6]; -+ const gchar *argv[5]; ++ const gchar *argv[4]; sys_log (context, "set password and hint of user '%s' (%d)", -@@ -1768,12 +1773,11 @@ user_change_password_authorized_cb (Daemon +@@ -2195,12 +2203,10 @@ user_change_password_authorized_cb (Daemon g_object_freeze_notify (G_OBJECT (user)); - argv[0] = "/usr/sbin/usermod"; -+ argv[0] = "/usr/sbin/chpass"; - argv[1] = "-p"; - argv[2] = strings[0]; +- argv[1] = "-p"; +- argv[2] = strings[0]; - argv[3] = "--"; - argv[4] = accounts_user_get_user_name (ACCOUNTS_USER (user)); - argv[5] = NULL; -+ argv[3] = accounts_user_get_user_name (ACCOUNTS_USER (user)); -+ argv[4] = NULL; ++ argv[0] = "/usr/bin/passwd"; ++ argv[1] = strings[0]; ++ argv[2] = accounts_user_get_user_name (ACCOUNTS_USER (user)); ++ argv[3] = NULL; if (!spawn_with_login_uid (context, argv, &error)) { throw_error (context, ERROR_FAILED, "running '%s' failed: %s", argv[0], error->message); Index: sysutils/accountsservice/files/patch-src_wtmp-helper.h =================================================================== --- sysutils/accountsservice/files/patch-src_wtmp-helper.h +++ /dev/null @@ -1,10 +0,0 @@ ---- src/wtmp-helper.h.orig 2016-09-06 19:48:50 UTC -+++ src/wtmp-helper.h -@@ -23,7 +23,6 @@ - - #include - #include --#include - - const gchar * wtmp_helper_get_path_for_monitor (void); - void wtmp_helper_update_login_frequencies (GHashTable *users); Index: sysutils/accountsservice/pkg-plist =================================================================== --- sysutils/accountsservice/pkg-plist +++ sysutils/accountsservice/pkg-plist @@ -1,4 +1,3 @@ -etc/dbus-1/system.d/org.freedesktop.Accounts.conf include/accountsservice-1.0/act/act-user-enum-types.h include/accountsservice-1.0/act/act-user-manager.h include/accountsservice-1.0/act/act-user.h @@ -9,9 +8,12 @@ lib/libaccountsservice.so.0.0.0 libdata/pkgconfig/accountsservice.pc libexec/accounts-daemon +%%DATADIR%%/user-templates/administrator +%%DATADIR%%/user-templates/standard share/dbus-1/interfaces/org.freedesktop.Accounts.User.xml share/dbus-1/interfaces/org.freedesktop.Accounts.xml share/dbus-1/system-services/org.freedesktop.Accounts.service +share/dbus-1/system.d/org.freedesktop.Accounts.conf share/gir-1.0/AccountsService-1.0.gir share/locale/af/LC_MESSAGES/accounts-service.mo share/locale/ar/LC_MESSAGES/accounts-service.mo @@ -88,6 +90,8 @@ share/locale/zh_HK/LC_MESSAGES/accounts-service.mo share/locale/zh_TW/LC_MESSAGES/accounts-service.mo share/polkit-1/actions/org.freedesktop.accounts.policy +share/vala/vapi/accountsservice.deps +share/vala/vapi/accountsservice.vapi @dir(,,0775) /var/db/AccountsService/icons @dir(,,0700) /var/db/AccountsService/users @dir /var/db/AccountsService