Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 May 2021 08:28:40 GMT
From:      Mateusz Piotrowski <0mp@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: ffb1311e5672 - main - sysutils/accountsservice: Update to 0.6.55
Message-ID:  <202105250828.14P8SedM053555@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by 0mp:

URL: https://cgit.FreeBSD.org/ports/commit/?id=ffb1311e56725702208e807cfc63c8163c6b4a52

commit ffb1311e56725702208e807cfc63c8163c6b4a52
Author:     Olivier Duchateau <olivierd@FreeBSD.org>
AuthorDate: 2021-05-24 15:38:38 +0000
Commit:     Mateusz Piotrowski <0mp@FreeBSD.org>
CommitDate: 2021-05-25 08:28:07 +0000

    sysutils/accountsservice: Update to 0.6.55
    
    This update also fixes the userdel functionality.
    
    PR:             249445
    Reviewed by:    0mp
    Approved by:    maintainer timeout
    MFH:            2021Q2
    Security:       75aae50b-9e3c-11eb-9bc3-8c164582fbac
    Security:       CVE-2018-14036
---
 sysutils/accountsservice/Makefile                  |  30 +--
 sysutils/accountsservice/distinfo                  |   6 +-
 sysutils/accountsservice/files/patch-configure     |  21 --
 sysutils/accountsservice/files/patch-meson.build   |  16 ++
 .../files/patch-meson__post__install.py            |  13 +
 sysutils/accountsservice/files/patch-src_daemon.c  | 282 ++++++++++++++++++++-
 .../files/patch-src_libaccountsservice_act-user.c  |  11 +
 .../accountsservice/files/patch-src_meson.build    |  13 +
 sysutils/accountsservice/files/patch-src_user.c    | 190 ++++++++++----
 sysutils/accountsservice/files/patch-src_user.h    |  27 ++
 .../accountsservice/files/patch-src_wtmp-helper.h  |  10 +
 sysutils/accountsservice/pkg-descr                 |   6 +-
 sysutils/accountsservice/pkg-install               |   9 -
 sysutils/accountsservice/pkg-plist                 |  51 ++--
 14 files changed, 540 insertions(+), 145 deletions(-)

diff --git a/sysutils/accountsservice/Makefile b/sysutils/accountsservice/Makefile
index 86751efc375b..04c8893a3d36 100644
--- a/sysutils/accountsservice/Makefile
+++ b/sysutils/accountsservice/Makefile
@@ -1,7 +1,7 @@
 # Created by: Koop Mast <kwm@FreeBSD.org>
 
 PORTNAME=	accountsservice
-PORTVERSION=	0.6.42
+PORTVERSION=	0.6.55
 CATEGORIES=	sysutils devel
 MASTER_SITES=	http://www.freedesktop.org/software/${PORTNAME}/
 
@@ -11,28 +11,18 @@ COMMENT=	D-Bus interface for user account query and manipulation
 LICENSE=	GPLv3+
 LICENSE_FILE=	${WRKSRC}/COPYING
 
-LIB_DEPENDS=	libdbus-glib-1.so:devel/dbus-glib \
-		libpolkit-gobject-1.so:sysutils/polkit
+BUILD_DEPENDS=	dbus>0:devel/dbus
+LIB_DEPENDS=	libpolkit-gobject-1.so:sysutils/polkit
 
-USE_GNOME=	glib20 intlhack introspection:build libxslt
-USES=		cpe gettext gmake gnome libtool localbase:ldflags pathfix \
+USE_GNOME=	glib20 intltool introspection:build libxslt
+USES=		cpe gettext gnome localbase:ldflags meson \
 		pkgconfig tar:xz
 CPE_VENDOR=	ray_stode
-GNU_CONFIGURE=	yes
 USE_LDCONFIG=	yes
-CONFIGURE_ARGS=	--disable-systemd --localstatedir=/var/
-INSTALL_TARGET=	install-strip
-
-# XXX HACK! this file isn't present on the pristine jails of the builders
-# and configure breaks without it. Beter solutions welcome.
-.if defined(PACKAGE_BUILDING)
-CONFIGURE_ENV+=	ac_cv_file__var_log_utx_log=yes
-.endif
-
-post-patch:
-	@${REINPLACE_CMD} -e 's|/etc/gdm/custom.conf|${LOCALBASE}/etc/gdm/custom.conf|g' \
-		${WRKSRC}/src/daemon.c
-	@${REINPLACE_CMD} -e 's|/lib/AccountsService|/db/AccountsService|g' \
-		${WRKSRC}/src/user.c ${WRKSRC}/src/Makefile.in
+MESON_ARGS=	-Dsystemdsystemunitdir=no \
+		-Dgdmconffile=${LOCALBASE}/etc/gdm/custom.conf \
+		-Dsystemd=false \
+		-Delogind=false \
+		-Dlocalstatedir=/var
 
 .include <bsd.port.mk>
diff --git a/sysutils/accountsservice/distinfo b/sysutils/accountsservice/distinfo
index c933d57be71f..71694a1bde05 100644
--- a/sysutils/accountsservice/distinfo
+++ b/sysutils/accountsservice/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1468052689
-SHA256 (accountsservice-0.6.42.tar.xz) = e56494c2f18627900b57234e5628923cc16a37bf8fd16b06c46118d6ae9c007e
-SIZE (accountsservice-0.6.42.tar.xz) = 380500
+TIMESTAMP = 1600462353
+SHA256 (accountsservice-0.6.55.tar.xz) = ff2b2419a7e06bd9cb335ffe391c7409b49a0f0130b890bd54692a3986699c9b
+SIZE (accountsservice-0.6.55.tar.xz) = 97972
diff --git a/sysutils/accountsservice/files/patch-configure b/sysutils/accountsservice/files/patch-configure
deleted file mode 100644
index cbf3790afc2b..000000000000
--- a/sysutils/accountsservice/files/patch-configure
+++ /dev/null
@@ -1,21 +0,0 @@
---- configure.orig	2014-03-15 15:02:28.000000000 +0100
-+++ configure	2014-03-15 15:03:01.000000000 +0100
-@@ -14527,6 +14527,18 @@
- done
- 
- 
-+for ac_func in fgetpwent
-+do :
-+  ac_fn_c_check_func "$LINENO" "fgetpwent" "ac_cv_func_fgetpwent"
-+if test "x$ac_cv_func_fgetpwent" = xyes; then :
-+  cat >>confdefs.h <<_ACEOF
-+#define HAVE_FGETPWENT 1
-+_ACEOF
-+
-+fi
-+done
-+
-+
- 
- 
- 
diff --git a/sysutils/accountsservice/files/patch-meson.build b/sysutils/accountsservice/files/patch-meson.build
new file mode 100644
index 000000000000..13ecb2d1e712
--- /dev/null
+++ b/sysutils/accountsservice/files/patch-meson.build
@@ -0,0 +1,16 @@
+--- meson.build.orig	2018-09-29 12:54:53 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')
+   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
+ endif
+ 
+ # compiler flags
diff --git a/sysutils/accountsservice/files/patch-meson__post__install.py b/sysutils/accountsservice/files/patch-meson__post__install.py
new file mode 100644
index 000000000000..e0d71f5e7c41
--- /dev/null
+++ b/sysutils/accountsservice/files/patch-meson__post__install.py
@@ -0,0 +1,13 @@
+--- meson_post_install.py.orig	2019-04-23 15:16:09 UTC
++++ meson_post_install.py
+@@ -9,8 +9,8 @@ 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', 'AccountsService', 'icons'), 0o775),
+-  (os.path.join(localstatedir, 'lib', 'AccountsService', 'users'), 0o700),
++  (os.path.join(localstatedir, 'db', 'AccountsService', 'icons'), 0o775),
++  (os.path.join(localstatedir, 'db', 'AccountsService', 'users'), 0o700),
+ ]
+ 
+ for (dst_dir, dst_dir_mode) in dst_dirs:
diff --git a/sysutils/accountsservice/files/patch-src_daemon.c b/sysutils/accountsservice/files/patch-src_daemon.c
index 29226ddd111f..3a7131000a89 100644
--- a/sysutils/accountsservice/files/patch-src_daemon.c
+++ b/sysutils/accountsservice/files/patch-src_daemon.c
@@ -1,15 +1,227 @@
---- src/daemon.c.orig	2014-03-23 09:36:37.194365289 +0000
-+++ src/daemon.c	2014-03-23 09:36:39.836364714 +0000
-@@ -48,7 +48,7 @@
- #define PATH_PASSWD "/etc/passwd"
- #define PATH_SHADOW "/etc/shadow"
- #define PATH_GROUP "/etc/group"
--#define PATH_GDM_CUSTOM "/etc/gdm/custom.conf"
-+#define PATH_GDM_CUSTOM "/usr/local/etc/gdm/custom.conf"
- 
- enum {
-         PROP_0,
-@@ -892,20 +892,18 @@
+--- src/daemon.c.orig	2018-09-26 13:20:49 UTC
++++ src/daemon.c
+@@ -79,7 +79,11 @@ typedef struct {
+         GHashTable *extension_ifaces;
+ } DaemonPrivate;
+ 
++#ifdef HAVE_SHADOW_H
+ typedef struct passwd * (* EntryGeneratorFunc) (Daemon *, GHashTable *, gpointer *, struct spwd **shadow_entry);
++#else
++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)
+ }
+ 
+ static struct passwd *
++#ifdef HAVE_SHADOW_H
+ entry_generator_fgetpwent (Daemon       *daemon,
+                            GHashTable   *users,
+                            gpointer     *state,
+                            struct spwd **spent)
++#else
++entry_generator_fgetpwent (Daemon       *daemon,
++                           GHashTable   *users,
++                           gpointer     *state)
++#endif
+ {
+         struct passwd *pwent;
+ 
++#ifdef HAVE_SHADOW_H
+         struct {
+                 struct spwd spbuf;
+                 char buf[1024];
+         } *shadow_entry_buffers;
++#endif
+ 
+         struct {
+                 FILE *fp;
+@@ -175,6 +187,7 @@ entry_generator_fgetpwent (Daemon       *daemon,
+         if (*state == NULL) {
+                 GHashTable *shadow_users = NULL;
+                 FILE *fp;
++#ifdef HAVE_SHADOW_H
+                 struct spwd *shadow_entry;
+ 
+                 fp = fopen (PATH_SHADOW, "r");
+@@ -208,6 +221,7 @@ entry_generator_fgetpwent (Daemon       *daemon,
+                         g_clear_pointer (&shadow_users, g_hash_table_unref);
+                         return NULL;
+                 }
++#endif
+ 
+                 fp = fopen (PATH_PASSWD, "r");
+                 if (fp == NULL) {
+@@ -229,12 +243,17 @@ entry_generator_fgetpwent (Daemon       *daemon,
+         if (g_hash_table_size (users) < MAX_LOCAL_USERS) {
+                 pwent = fgetpwent (generator_state->fp);
+                 if (pwent != NULL) {
++#ifdef HAVE_SHADOW_H
+                         shadow_entry_buffers = g_hash_table_lookup (generator_state->users, pwent->pw_name);
+ 
+                         if (shadow_entry_buffers != NULL) {
+                             *spent = &shadow_entry_buffers->spbuf;
+                         }
+                         return pwent;
++#else
++                        if (!generator_state->users || g_hash_table_lookup (generator_state->users, pwent->pw_name))
++                            return pwent;
++#endif
+                 }
+         }
+ 
+@@ -248,10 +267,16 @@ entry_generator_fgetpwent (Daemon       *daemon,
+ }
+ 
+ static struct passwd *
++#ifdef HAVE_SHADOW_H
+ entry_generator_cachedir (Daemon       *daemon,
+                           GHashTable   *users,
+                           gpointer     *state,
+                           struct spwd **shadow_entry)
++#else
++entry_generator_cachedir (Daemon       *daemon,
++                          GHashTable   *users,
++                          gpointer     *state)
++#endif
+ {
+         struct passwd *pwent;
+         g_autoptr(GError) error = NULL;
+@@ -293,7 +318,9 @@ entry_generator_cachedir (Daemon       *daemon,
+                         errno = 0;
+                         pwent = getpwnam (name);
+                         if (pwent != NULL) {
++#ifdef HAVE_SHADOW_H
+                                 *shadow_entry = getspnam (pwent->pw_name);
++#endif
+ 
+                                 return pwent;
+                         } else if (errno == 0) {
+@@ -329,10 +356,16 @@ entry_generator_cachedir (Daemon       *daemon,
+ }
+ 
+ static struct passwd *
++#ifdef HAVE_SHADOW_H
+ entry_generator_requested_users (Daemon       *daemon,
+                                  GHashTable   *users,
+                                  gpointer     *state,
+                                  struct spwd **shadow_entry)
++#else
++entry_generator_requested_users (Daemon       *daemon,
++                                 GHashTable   *users,
++                                 gpointer     *state)
++#endif
+ {
+         DaemonPrivate *priv = daemon_get_instance_private (daemon);
+         struct passwd *pwent;
+@@ -360,7 +393,9 @@ entry_generator_requested_users (Daemon       *daemon,
+                                 if (pwent == NULL) {
+                                         g_debug ("user '%s' requested previously but not present on system", name);
+                                 } else {
++#ifdef HAVE_SHADOW_H
+                                         *shadow_entry = getspnam (pwent->pw_name);
++#endif
+ 
+                                         return pwent;
+                                 }
+@@ -383,19 +418,29 @@ load_entries (Daemon             *daemon,
+         DaemonPrivate *priv = daemon_get_instance_private (daemon);
+         gpointer generator_state = NULL;
+         struct passwd *pwent;
++#ifdef HAVE_SHADOW_H
+         struct spwd *spent = NULL;
++#endif
+         User *user = NULL;
+ 
+         g_assert (entry_generator != NULL);
+ 
+         for (;;) {
++#ifdef HAVE_SHADOW_H
+                 spent = NULL;
+                 pwent = entry_generator (daemon, users, &generator_state, &spent);
++#else
++                pwent = entry_generator (daemon, users, &generator_state);
++#endif
+                 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,
+ 
+                         /* freeze & update users not already in the new list */
+                         g_object_freeze_notify (G_OBJECT (user));
++#ifdef HAVE_SHADOW_H
+                         user_update_from_pwent (user, pwent, spent);
++#else
++                        user_update_from_pwent (user, pwent);
++#endif
+ 
+                         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,
+ }
+ 
+ static User *
++#ifdef HAVE_SHADOW_H
+ add_new_user_for_pwent (Daemon        *daemon,
+                         struct passwd *pwent,
+                         struct spwd   *spent)
++#else
++add_new_user_for_pwent (Daemon        *daemon,
++                        struct passwd *pwent)
++#endif
+ {
+         DaemonPrivate *priv = daemon_get_instance_private (daemon);
+         User *user;
+ 
+         user = user_new (daemon, pwent->pw_uid);
++#ifdef HAVE_SHADOW_H
+         user_update_from_pwent (user, pwent, spent);
++#else
++        user_update_from_pwent (user, pwent);
++#endif
+         user_register (user);
+ 
+         g_hash_table_insert (priv->users,
+@@ -860,9 +918,13 @@ daemon_local_find_user_by_id (Daemon *daemon,
+         user = g_hash_table_lookup (priv->users, pwent->pw_name);
+ 
+         if (user == NULL) {
++#ifdef HAVE_SHADOW_H
+                 struct spwd *spent;
+                 spent = getspnam (pwent->pw_name);
+                 user = add_new_user_for_pwent (daemon, pwent, spent);
++#else
++                user = add_new_user_for_pwent (daemon, pwent);
++#endif
+ 
+                 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,
+         user = g_hash_table_lookup (priv->users, pwent->pw_name);
+ 
+         if (user == NULL) {
++#ifdef HAVE_SHADOW_H
+                 struct spwd *spent;
+                 spent = getspnam (pwent->pw_name);
+                 user = add_new_user_for_pwent (daemon, pwent, spent);
++#else
++                user = add_new_user_for_pwent (daemon, pwent);
++#endif
+ 
+                 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              
  
          sys_log (context, "create user '%s'", cd->user_name);
  
@@ -24,12 +236,18 @@
 +        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);
+ 
 -                argv[4] = "-G";
--                argv[5] = ADMIN_GROUP;
+-                argv[5] = admin_groups;
 -                argv[6] = "--";
 -                argv[7] = cd->user_name;
 +                argv[6] = "-G";
-+                argv[7] = ADMIN_GROUP;
++                argv[7] = admin_groups;
                  argv[8] = NULL;
          }
          else if (cd->account_type == ACCOUNT_TYPE_STANDARD) {
@@ -38,3 +256,39 @@
                  argv[6] = NULL;
          }
          else {
+@@ -1281,7 +1345,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];
+         User *user;
+ 
+         pwent = getpwuid (ud->uid);
+@@ -1307,19 +1371,16 @@ daemon_delete_user_authorized_cb (Daemon              
+ 
+         user_set_saved (user, FALSE);
+ 
+-        argv[0] = "/usr/sbin/userdel";
++        argv[0] = "/usr/sbin/pw";
++        argv[1] = "userdel";
+         if (ud->remove_files) {
+-                argv[1] = "-f";
+-                argv[2] = "-r";
+-                argv[3] = "--";
+-                argv[4] = pwent->pw_name;
+-                argv[5] = NULL;
++                argv[2] = pwent->pw_name;
++                argv[3] = "-r";
++                argv[4] = NULL;
+         }
+         else {
+-                argv[1] = "-f";
+-                argv[2] = "--";
+-                argv[3] = pwent->pw_name;
+-                argv[4] = NULL;
++                argv[2] = pwent->pw_name;
++                argv[3] = NULL;
+         }
+ 
+         if (!spawn_with_login_uid (context, argv, &error)) {
diff --git a/sysutils/accountsservice/files/patch-src_libaccountsservice_act-user.c b/sysutils/accountsservice/files/patch-src_libaccountsservice_act-user.c
new file mode 100644
index 000000000000..f8b4dfae0ce7
--- /dev/null
+++ b/sysutils/accountsservice/files/patch-src_libaccountsservice_act-user.c
@@ -0,0 +1,11 @@
+--- src/libaccountsservice/act-user.c.orig	2018-04-04 13:59:42 UTC
++++ src/libaccountsservice/act-user.c
+@@ -26,8 +26,6 @@
+ #include <sys/stat.h>
+ #include <unistd.h>
+ 
+-#include <crypt.h>
+-
+ #include <glib.h>
+ #include <glib/gi18n.h>
+ #include <gio/gio.h>
diff --git a/sysutils/accountsservice/files/patch-src_meson.build b/sysutils/accountsservice/files/patch-src_meson.build
new file mode 100644
index 000000000000..9687666febae
--- /dev/null
+++ b/sysutils/accountsservice/files/patch-src_meson.build
@@ -0,0 +1,13 @@
+--- src/meson.build.orig	2018-09-29 12:54:53 UTC
++++ src/meson.build
+@@ -26,8 +26,8 @@ deps = [
+ cflags = [
+   '-DLOCALSTATEDIR="@0@"'.format(act_localstatedir),
+   '-DDATADIR="@0@"'.format(act_datadir),
+-  '-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')),
++  '-DUSERDIR="@0@"'.format(join_paths(act_localstatedir, 'db', 'AccountsService', 'users')),
+ ]
+ 
+ libaccounts_generated = static_library(
diff --git a/sysutils/accountsservice/files/patch-src_user.c b/sysutils/accountsservice/files/patch-src_user.c
index 9a5dd9a588af..bf8b2708e969 100644
--- a/sysutils/accountsservice/files/patch-src_user.c
+++ b/sysutils/accountsservice/files/patch-src_user.c
@@ -1,93 +1,155 @@
---- src/user.c.orig	2014-03-15 15:16:49.000000000 +0100
-+++ src/user.c	2014-03-15 15:31:57.000000000 +0100
-@@ -873,11 +873,11 @@
-                          "change real name of user '%s' (%d) to '%s'",
-                          user->user_name, user->uid, name);
+--- src/user.c.orig	2018-04-20 20:52:07 UTC
++++ src/user.c
+@@ -138,9 +138,14 @@ user_reset_icon_file (User *user)
+ }
+ 
+ void
++#ifdef HAVE_SHADOW_H
+ user_update_from_pwent (User          *user,
+                         struct passwd *pwent,
+                         struct spwd   *spent)
++#else
++user_update_from_pwent (User          *user,
++                        struct passwd *pwent)
++#endif
+ {
+         g_autofree gchar *real_name = NULL;
+         gboolean is_system_account;
+@@ -199,8 +204,10 @@ user_update_from_pwent (User          *user,
+         accounts_user_set_shell (ACCOUNTS_USER (user), pwent->pw_shell);
+ 
+         passwd = NULL;
++#ifdef HAVE_SHADOW_H
+         if (spent)
+                 passwd = spent->sp_pwdp;
++#endif
+ 
+         if (passwd && passwd[0] == '!') {
+                 locked = TRUE;
+@@ -218,6 +225,7 @@ user_update_from_pwent (User          *user,
+                 mode = PASSWORD_MODE_NONE;
+         }
+ 
++#ifdef HAVE_SHADOW_H
+         if (spent) {
+                 if (spent->sp_lstchg == 0) {
+                         mode = PASSWORD_MODE_SET_AT_LOGIN;
+@@ -231,6 +239,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;
++#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);
  
 -                argv[0] = "/usr/sbin/usermod";
 -                argv[1] = "-c";
 -                argv[2] = name;
 -                argv[3] = "--";
--                argv[4] = user->user_name;
+-                argv[4] = accounts_user_get_user_name (ACCOUNTS_USER (user));
 +                argv[0] = "/usr/sbin/pw";
 +                argv[1] = "usermod";
-+                argv[2] = user->user_name;
++                argv[2] = accounts_user_get_user_name (ACCOUNTS_USER (user));
 +                argv[3] = "-c";
 +                argv[4] = name;
                  argv[5] = NULL;
  
-                 error = NULL;
-@@ -947,11 +947,11 @@
-                          "change name of user '%s' (%d) to '%s'",
-                          old_name, user->uid, name);
+                 if (!spawn_with_login_uid (context, argv, &error)) {
+@@ -882,11 +893,11 @@ user_change_user_name_authorized_cb (Daemon           
+                          accounts_user_get_uid (ACCOUNTS_USER (user)),
+                          name);
  
 -                argv[0] = "/usr/sbin/usermod";
 -                argv[1] = "-l";
 -                argv[2] = name;
 -                argv[3] = "--";
--                argv[4] = user->user_name;
+-                argv[4] = accounts_user_get_user_name (ACCOUNTS_USER (user));
 +                argv[0] = "/usr/sbin/pw";
 +                argv[1] = "usermod";
-+                argv[2] = user->user_name;
++                argv[2] = accounts_user_get_user_name (ACCOUNTS_USER (user));
 +                argv[3] = "-n";
 +                argv[4] = name;
                  argv[5] = NULL;
  
-                 error = NULL;
-@@ -1229,13 +1229,12 @@
-                          "change home directory of user '%s' (%d) to '%s'",
-                          user->user_name, user->uid, home_dir);
+                 if (!spawn_with_login_uid (context, argv, &error)) {
+@@ -1183,7 +1194,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];
+ 
+         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            
+                          accounts_user_get_uid (ACCOUNTS_USER (user)),
+                          home_dir);
  
 -                argv[0] = "/usr/sbin/usermod";
 -                argv[1] = "-m";
 -                argv[2] = "-d";
 -                argv[3] = home_dir;
 -                argv[4] = "--";
--                argv[5] = user->user_name;
+-                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] = user->user_name;
++                argv[4] = accounts_user_get_user_name (ACCOUNTS_USER (user));
 +                argv[5] = NULL;
  
-                 error = NULL;
                  if (!spawn_with_login_uid (context, argv, &error)) {
-@@ -1291,11 +1290,11 @@
-                          "change shell of user '%s' (%d) to '%s'",
-                          user->user_name, user->uid, shell);
+                         throw_error (context, ERROR_FAILED, "running '%s' failed: %s", argv[0], error->message);
+@@ -1249,11 +1259,11 @@ user_change_shell_authorized_cb (Daemon               
+                          accounts_user_get_uid (ACCOUNTS_USER (user)),
+                          shell);
  
 -                argv[0] = "/usr/sbin/usermod";
 -                argv[1] = "-s";
 -                argv[2] = shell;
 -                argv[3] = "--";
--                argv[4] = user->user_name;
+-                argv[4] = accounts_user_get_user_name (ACCOUNTS_USER (user));
 +                argv[0] = "/usr/sbin/pw";
 +                argv[1] = "usermod";
-+                argv[2] = user->user_name;
++                argv[2] = accounts_user_get_user_name (ACCOUNTS_USER (user));
 +                argv[3] = "-s";
 +                argv[4] = shell;
                  argv[5] = NULL;
  
-                 error = NULL;
-@@ -1551,11 +1550,10 @@
+                 if (!spawn_with_login_uid (context, argv, &error)) {
+@@ -1456,7 +1466,7 @@ user_change_locked_authorized_cb (Daemon              
+ {
+         gboolean locked = GPOINTER_TO_INT (data);
+         g_autoptr(GError) error = NULL;
+-        const gchar *argv[5];
++        const gchar *argv[4];
+ 
+         if (accounts_user_get_locked (ACCOUNTS_USER (user)) != locked) {
                  sys_log (context,
-                          "%s account of user '%s' (%d)",
-                          locked ? "locking" : "unlocking", user->user_name, user->uid);
+@@ -1464,11 +1474,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[2] = "--";
--                argv[3] = user->user_name;
+-                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] = user->user_name;
++                argv[2] = accounts_user_get_user_name (ACCOUNTS_USER (user));
 +                argv[3] = NULL;
  
-                 error = NULL;
                  if (!spawn_with_login_uid (context, argv, &error)) {
-@@ -1664,11 +1662,11 @@
+                         throw_error (context, ERROR_FAILED, "running '%s' failed: %s", argv[0], error->message);
+@@ -1589,11 +1598,11 @@ user_change_account_type_authorized_cb (Daemon        
  
                  g_free (groups);
  
@@ -95,29 +157,38 @@
 -                argv[1] = "-G";
 -                argv[2] = str->str;
 -                argv[3] = "--";
--                argv[4] = user->user_name;
+-                argv[4] = accounts_user_get_user_name (ACCOUNTS_USER (user));
 +                argv[0] = "/usr/sbin/pw";
 +                argv[1] = "usermod";
-+                argv[2] = user->user_name;
++                argv[2] = accounts_user_get_user_name (ACCOUNTS_USER (user));
 +                argv[3] = "-G";
 +                argv[4] = str->str;
                  argv[5] = NULL;
  
-                 g_string_free (str, FALSE);
-@@ -1735,10 +1733,8 @@
+                 if (!spawn_with_login_uid (context, argv, &error)) {
+@@ -1643,7 +1652,7 @@ user_change_password_mode_authorized_cb (Daemon       
+ {
+         PasswordMode mode = GPOINTER_TO_INT (data);
+         g_autoptr(GError) error = NULL;
+-        const gchar *argv[6];
++        const gchar *argv[5];
+ 
+         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       
                      mode == PASSWORD_MODE_NONE) {
  
                          argv[0] = "/usr/bin/passwd";
 -                        argv[1] = "-d";
 -                        argv[2] = "--";
--                        argv[3] = user->user_name;
+-                        argv[3] = accounts_user_get_user_name (ACCOUNTS_USER (user));
 -                        argv[4] = NULL;
-+                        argv[1] = user->user_name;
++                        argv[1] = accounts_user_get_user_name (ACCOUNTS_USER (user));
 +                        argv[2] = NULL;
  
-                         error = NULL;
                          if (!spawn_with_login_uid (context, argv, &error)) {
-@@ -1748,12 +1744,11 @@
+                                 throw_error (context, ERROR_FAILED, "running '%s' failed: %s", argv[0], error->message);
+@@ -1669,12 +1676,11 @@ user_change_password_mode_authorized_cb (Daemon       
                          }
  
                          if (mode == PASSWORD_MODE_SET_AT_LOGIN) {
@@ -127,42 +198,51 @@
 +                                argv[1] = "-e";
                                  argv[2] = "0";
 -                                argv[3] = "--";
--                                argv[4] = user->user_name;
+-                                argv[4] = accounts_user_get_user_name (ACCOUNTS_USER (user));
 -                                argv[5] = NULL;
-+                                argv[3] = user->user_name;
++                                argv[3] = accounts_user_get_user_name (ACCOUNTS_USER (user));
 +                                argv[4] = NULL;
  
-                                 error = NULL;
                                  if (!spawn_with_login_uid (context, argv, &error)) {
-@@ -1777,11 +1772,10 @@
-                         }
+                                         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 (user->locked) {
+                 else if (accounts_user_get_locked (ACCOUNTS_USER (user))) {
 -                        argv[0] = "/usr/sbin/usermod";
 -                        argv[1] = "-U";
 -                        argv[2] = "--";
--                        argv[3] = user->user_name;
+-                        argv[3] = accounts_user_get_user_name (ACCOUNTS_USER (user));
 -                        argv[4] = NULL;
 +                        argv[0] = "/usr/sbin/pw";
 +                        argv[1] = "unlock";
-+                        argv[2] = user->user_name;
++                        argv[2] = accounts_user_get_user_name (ACCOUNTS_USER (user));
 +                        argv[3] = NULL;
  
-                         error = NULL;
                          if (!spawn_with_login_uid (context, argv, &error)) {
-@@ -1852,12 +1846,11 @@
+                                 throw_error (context, ERROR_FAILED, "running '%s' failed: %s", argv[0], error->message);
+@@ -1759,7 +1764,7 @@ user_change_password_authorized_cb (Daemon            
+ {
+         gchar **strings = data;
+         g_autoptr(GError) error = NULL;
+-        const gchar *argv[6];
++        const gchar *argv[5];
+ 
+         sys_log (context,
+                  "set password and hint of user '%s' (%d)",
+@@ -1768,12 +1773,11 @@ user_change_password_authorized_cb (Daemon            
  
          g_object_freeze_notify (G_OBJECT (user));
  
 -        argv[0] = "/usr/sbin/usermod";
-+        argv[0] = "/usr/bin/chpass";
++        argv[0] = "/usr/sbin/chpass";
          argv[1] = "-p";
          argv[2] = strings[0];
 -        argv[3] = "--";
--        argv[4] = user->user_name;
+-        argv[4] = accounts_user_get_user_name (ACCOUNTS_USER (user));
 -        argv[5] = NULL;
-+        argv[3] = user->user_name;
++        argv[3] = accounts_user_get_user_name (ACCOUNTS_USER (user));
 +        argv[4] = NULL;
  
-         error = NULL;
          if (!spawn_with_login_uid (context, argv, &error)) {
+                 throw_error (context, ERROR_FAILED, "running '%s' failed: %s", argv[0], error->message);
diff --git a/sysutils/accountsservice/files/patch-src_user.h b/sysutils/accountsservice/files/patch-src_user.h
new file mode 100644
index 000000000000..fa8454f7518c
--- /dev/null
+++ b/sysutils/accountsservice/files/patch-src_user.h
@@ -0,0 +1,27 @@
+--- src/user.h.orig	2016-09-06 17:31:50 UTC
++++ src/user.h
+@@ -22,7 +22,9 @@
+ 
+ #include <sys/types.h>
+ #include <pwd.h>
++#ifdef HAVE_SHADOW_H
+ #include <shadow.h>
++#endif
+ 
+ #include <glib.h>
+ #include <gio/gio.h>
+@@ -54,9 +56,14 @@ GType          user_get_type                (void) G_G
+ User *         user_new                     (Daemon        *daemon,
+                                              uid_t          uid);
+ 
++#ifdef HAVE_SHADOW_H
+ void           user_update_from_pwent       (User          *user,
+                                              struct passwd *pwent,
+                                              struct spwd   *spent);
++#else
++void           user_update_from_pwent       (User          *user,
++                                             struct passwd *pwent);
++#endif
+ void           user_update_from_keyfile     (User          *user,
+                                              GKeyFile      *keyfile);
+ void           user_update_local_account_property (User          *user,
diff --git a/sysutils/accountsservice/files/patch-src_wtmp-helper.h b/sysutils/accountsservice/files/patch-src_wtmp-helper.h
new file mode 100644
index 000000000000..ab14253510ac
--- /dev/null
+++ b/sysutils/accountsservice/files/patch-src_wtmp-helper.h
@@ -0,0 +1,10 @@
+--- src/wtmp-helper.h.orig	2016-09-06 19:48:50 UTC
++++ src/wtmp-helper.h
+@@ -23,7 +23,6 @@
+ 
+ #include <glib.h>
+ #include <pwd.h>
+-#include <shadow.h>
+ 
+ const gchar *           wtmp_helper_get_path_for_monitor                (void);
+ void                    wtmp_helper_update_login_frequencies            (GHashTable *users);
diff --git a/sysutils/accountsservice/pkg-descr b/sysutils/accountsservice/pkg-descr
index afd9fd7e3dac..f18aadd89c52 100644
--- a/sysutils/accountsservice/pkg-descr
+++ b/sysutils/accountsservice/pkg-descr
@@ -3,7 +3,7 @@ The AccountsService project provides
  o  A set of D-Bus interfaces for querying and manipulating
     user account information.
 
- o  An implementation of these interfaces based on the usermod(8),
-    useradd(8) and userdel(8) commands.
+ o  An implementation of these interfaces based on the pw(8)
+    command.
 
-WWW: https://cgit.freedesktop.org/accountsservice/
+WWW: https://gitlab.freedesktop.org/accountsservice/accountsservice
diff --git a/sysutils/accountsservice/pkg-install b/sysutils/accountsservice/pkg-install
deleted file mode 100644
index 65319d21350f..000000000000
--- a/sysutils/accountsservice/pkg-install
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh
-
-case $2 in
-POST-INSTALL)
-	/bin/mkdir -p /var/db/AccountsService/users/
-	/bin/mkdir -p /var/db/AccountsService/icons/
-	exit 0
-	;;
-esac
diff --git a/sysutils/accountsservice/pkg-plist b/sysutils/accountsservice/pkg-plist
index cb362dad0f43..c9b64a57e942 100644
--- a/sysutils/accountsservice/pkg-plist
+++ b/sysutils/accountsservice/pkg-plist
@@ -4,7 +4,6 @@ include/accountsservice-1.0/act/act-user-manager.h
 include/accountsservice-1.0/act/act-user.h
 include/accountsservice-1.0/act/act.h
 lib/girepository-1.0/AccountsService-1.0.typelib
-lib/libaccountsservice.a
 lib/libaccountsservice.so
 lib/libaccountsservice.so.0
 lib/libaccountsservice.so.0.0.0
@@ -14,40 +13,38 @@ 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/gir-1.0/AccountsService-1.0.gir
-share/gtk-doc/html/libaccountsservice/ActUser.html
-share/gtk-doc/html/libaccountsservice/ActUserManager.html
-share/gtk-doc/html/libaccountsservice/annotation-glossary.html
-share/gtk-doc/html/libaccountsservice/api-index-full.html
-share/gtk-doc/html/libaccountsservice/ch01.html
-share/gtk-doc/html/libaccountsservice/home.png
-share/gtk-doc/html/libaccountsservice/index.html
-share/gtk-doc/html/libaccountsservice/left-insensitive.png
-share/gtk-doc/html/libaccountsservice/left.png
-share/gtk-doc/html/libaccountsservice/libaccountsservice.devhelp2
-share/gtk-doc/html/libaccountsservice/right-insensitive.png
-share/gtk-doc/html/libaccountsservice/right.png
-share/gtk-doc/html/libaccountsservice/style.css
-share/gtk-doc/html/libaccountsservice/up-insensitive.png
-share/gtk-doc/html/libaccountsservice/up.png
+share/locale/af/LC_MESSAGES/accounts-service.mo
 share/locale/ar/LC_MESSAGES/accounts-service.mo
-share/locale/bg_BG/LC_MESSAGES/accounts-service.mo
+share/locale/as/LC_MESSAGES/accounts-service.mo
+share/locale/ast/LC_MESSAGES/accounts-service.mo
+share/locale/az/LC_MESSAGES/accounts-service.mo
+share/locale/be/LC_MESSAGES/accounts-service.mo
+share/locale/bg/LC_MESSAGES/accounts-service.mo
 share/locale/bn_IN/LC_MESSAGES/accounts-service.mo
 share/locale/ca/LC_MESSAGES/accounts-service.mo
 share/locale/ca@valencia/LC_MESSAGES/accounts-service.mo
 share/locale/cs/LC_MESSAGES/accounts-service.mo
+share/locale/cy/LC_MESSAGES/accounts-service.mo
 share/locale/da/LC_MESSAGES/accounts-service.mo
 share/locale/de/LC_MESSAGES/accounts-service.mo
 share/locale/el/LC_MESSAGES/accounts-service.mo
+share/locale/en/LC_MESSAGES/accounts-service.mo
 share/locale/en_GB/LC_MESSAGES/accounts-service.mo
 share/locale/eo/LC_MESSAGES/accounts-service.mo
 share/locale/es/LC_MESSAGES/accounts-service.mo
-share/locale/fa_IR/LC_MESSAGES/accounts-service.mo
+share/locale/et/LC_MESSAGES/accounts-service.mo
+share/locale/eu/LC_MESSAGES/accounts-service.mo
+share/locale/fa/LC_MESSAGES/accounts-service.mo
 share/locale/fi/LC_MESSAGES/accounts-service.mo
+share/locale/fo/LC_MESSAGES/accounts-service.mo
 share/locale/fr/LC_MESSAGES/accounts-service.mo
+share/locale/fur/LC_MESSAGES/accounts-service.mo
 share/locale/ga/LC_MESSAGES/accounts-service.mo
 share/locale/gl/LC_MESSAGES/accounts-service.mo
+share/locale/gu/LC_MESSAGES/accounts-service.mo
 share/locale/he/LC_MESSAGES/accounts-service.mo
 share/locale/hi/LC_MESSAGES/accounts-service.mo
+share/locale/hr/LC_MESSAGES/accounts-service.mo
 share/locale/hu/LC_MESSAGES/accounts-service.mo
 share/locale/ia/LC_MESSAGES/accounts-service.mo
 share/locale/id/LC_MESSAGES/accounts-service.mo
@@ -55,28 +52,42 @@ share/locale/it/LC_MESSAGES/accounts-service.mo
 share/locale/ja/LC_MESSAGES/accounts-service.mo
 share/locale/ka/LC_MESSAGES/accounts-service.mo
 share/locale/kk/LC_MESSAGES/accounts-service.mo
+share/locale/kn/LC_MESSAGES/accounts-service.mo
 share/locale/ko/LC_MESSAGES/accounts-service.mo
+share/locale/ky/LC_MESSAGES/accounts-service.mo
 share/locale/lt/LC_MESSAGES/accounts-service.mo
 share/locale/lv/LC_MESSAGES/accounts-service.mo
+share/locale/ml/LC_MESSAGES/accounts-service.mo
+share/locale/mr/LC_MESSAGES/accounts-service.mo
+share/locale/ms/LC_MESSAGES/accounts-service.mo
+share/locale/nb/LC_MESSAGES/accounts-service.mo
 share/locale/nl/LC_MESSAGES/accounts-service.mo
+share/locale/nn/LC_MESSAGES/accounts-service.mo
+share/locale/oc/LC_MESSAGES/accounts-service.mo
+share/locale/or/LC_MESSAGES/accounts-service.mo
 share/locale/pa/LC_MESSAGES/accounts-service.mo
 share/locale/pl/LC_MESSAGES/accounts-service.mo
+share/locale/pt/LC_MESSAGES/accounts-service.mo
 share/locale/pt_BR/LC_MESSAGES/accounts-service.mo
 share/locale/ro/LC_MESSAGES/accounts-service.mo
 share/locale/ru/LC_MESSAGES/accounts-service.mo
 share/locale/sk/LC_MESSAGES/accounts-service.mo
 share/locale/sl/LC_MESSAGES/accounts-service.mo
+share/locale/sq/LC_MESSAGES/accounts-service.mo
*** 19 LINES SKIPPED ***



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202105250828.14P8SedM053555>