pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/sysutils/accountsservice



Module Name:    pkgsrc
Committed By:   youri
Date:           Mon Jun 11 23:55:50 UTC 2018

Added Files:
        pkgsrc/sysutils/accountsservice: DESCR Makefile PLIST buildlink3.mk
            distinfo
        pkgsrc/sysutils/accountsservice/patches: patch-data_Makefile.am
            patch-src_daemon.c patch-src_libaccountsservice_act-user.c
            patch-src_user.c patch-src_wtmp-helper.c

Log Message:
sysutils/accountsservice: import accountsservice-0.6.42

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.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 pkgsrc/sysutils/accountsservice/DESCR \
    pkgsrc/sysutils/accountsservice/Makefile \
    pkgsrc/sysutils/accountsservice/PLIST \
    pkgsrc/sysutils/accountsservice/buildlink3.mk \
    pkgsrc/sysutils/accountsservice/distinfo
cvs rdiff -u -r0 -r1.1 \
    pkgsrc/sysutils/accountsservice/patches/patch-data_Makefile.am \
    pkgsrc/sysutils/accountsservice/patches/patch-src_daemon.c \
    pkgsrc/sysutils/accountsservice/patches/patch-src_libaccountsservice_act-user.c \
    pkgsrc/sysutils/accountsservice/patches/patch-src_user.c \
    pkgsrc/sysutils/accountsservice/patches/patch-src_wtmp-helper.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Added files:

Index: pkgsrc/sysutils/accountsservice/DESCR
diff -u /dev/null pkgsrc/sysutils/accountsservice/DESCR:1.1
--- /dev/null   Mon Jun 11 23:55:50 2018
+++ pkgsrc/sysutils/accountsservice/DESCR       Mon Jun 11 23:55:50 2018
@@ -0,0 +1,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.
Index: pkgsrc/sysutils/accountsservice/Makefile
diff -u /dev/null pkgsrc/sysutils/accountsservice/Makefile:1.1
--- /dev/null   Mon Jun 11 23:55:50 2018
+++ pkgsrc/sysutils/accountsservice/Makefile    Mon Jun 11 23:55:50 2018
@@ -0,0 +1,43 @@
+# $NetBSD: Makefile,v 1.1 2018/06/11 23:55:50 youri Exp $
+
+DISTNAME=      accountsservice-0.6.42
+CATEGORIES=    sysutils
+MASTER_SITES=  http://www.freedesktop.org/software/accountsservice/
+EXTRACT_SUFX=  .tar.xz
+
+MAINTAINER=    youri%NetBSD.org@localhost
+HOMEPAGE=      http://www.freedesktop.org/software/accountsservice/
+COMMENT=       Set of D-Bus interfaces for accessing account information
+LICENSE=       gnu-gpl-v3
+
+GNU_CONFIGURE= yes
+USE_LIBTOOL=   yes
+USE_TOOLS+=    pkg-config intltool gmake autoconf autoreconf automake
+
+EGDIR=         ${PREFIX}/share/examples/accountsservice
+
+CONFIGURE_ARGS+=       --disable-systemd \
+                       --sysconfdir=${EGDIR}
+
+LDFLAGS.NetBSD+=       -lutil # pw_getpwconf
+
+ALL_ENV+=      EGDIR=${EGDIR}
+
+PKGCONFIG_OVERRIDE+=   src/libaccountsservice/accountsservice.pc.in
+
+MAKE_DIRS+=    ${PKG_SYSCONFDIR}/dbus-1/system.d
+
+CONF_FILES+=   ${EGDIR}/dbus-1/system.d/org.freedesktop.Accounts.conf \
+               ${PKG_SYSCONFDIR}/dbus-1/system.d/org.freedesktop.Accounts.conf
+
+SUBST_CLASSES+=                gdm
+SUBST_FILES.gdm=       src/daemon.c
+SUBST_STAGE.gdm=       post-patch
+SUBST_SED.gdm=         -e 's,/etc/gdm/custom.conf,${PKG_SYSCONFDIR}/gdm/custom.conf,g'
+
+BUILD_DEPENDS+=        gdbus-codegen-[0-9]*:../../devel/gdbus-codegen
+
+.include "../../devel/gobject-introspection/buildlink3.mk"
+.include "../../security/polkit/buildlink3.mk"
+.include "../../devel/glib2/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
Index: pkgsrc/sysutils/accountsservice/PLIST
diff -u /dev/null pkgsrc/sysutils/accountsservice/PLIST:1.1
--- /dev/null   Mon Jun 11 23:55:50 2018
+++ pkgsrc/sysutils/accountsservice/PLIST       Mon Jun 11 23:55:50 2018
@@ -0,0 +1,79 @@
+@comment $NetBSD: PLIST,v 1.1 2018/06/11 23:55:50 youri Exp $
+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
+include/accountsservice-1.0/act/act.h
+lib/girepository-1.0/AccountsService-1.0.typelib
+lib/libaccountsservice.la
+lib/pkgconfig/accountsservice.pc
+libexec/accounts-daemon
+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/examples/accountsservice/dbus-1/system.d/org.freedesktop.Accounts.conf
+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/ar/LC_MESSAGES/accounts-service.mo
+share/locale/bg_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/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_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/fi/LC_MESSAGES/accounts-service.mo
+share/locale/fr/LC_MESSAGES/accounts-service.mo
+share/locale/ga/LC_MESSAGES/accounts-service.mo
+share/locale/gl/LC_MESSAGES/accounts-service.mo
+share/locale/he/LC_MESSAGES/accounts-service.mo
+share/locale/hi/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
+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/ko/LC_MESSAGES/accounts-service.mo
+share/locale/lt/LC_MESSAGES/accounts-service.mo
+share/locale/lv/LC_MESSAGES/accounts-service.mo
+share/locale/nl/LC_MESSAGES/accounts-service.mo
+share/locale/pa/LC_MESSAGES/accounts-service.mo
+share/locale/pl/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/sr/LC_MESSAGES/accounts-service.mo
+share/locale/sr@latin/LC_MESSAGES/accounts-service.mo
+share/locale/sv/LC_MESSAGES/accounts-service.mo
+share/locale/te/LC_MESSAGES/accounts-service.mo
+share/locale/tr/LC_MESSAGES/accounts-service.mo
+share/locale/uk/LC_MESSAGES/accounts-service.mo
+share/locale/vi/LC_MESSAGES/accounts-service.mo
+share/locale/wa/LC_MESSAGES/accounts-service.mo
+share/locale/zh_CN/LC_MESSAGES/accounts-service.mo
+share/locale/zh_TW/LC_MESSAGES/accounts-service.mo
+share/polkit-1/actions/org.freedesktop.accounts.policy
+@pkgdir var/lib/AccountsService/users
+@pkgdir var/lib/AccountsService/icons
Index: pkgsrc/sysutils/accountsservice/buildlink3.mk
diff -u /dev/null pkgsrc/sysutils/accountsservice/buildlink3.mk:1.1
--- /dev/null   Mon Jun 11 23:55:50 2018
+++ pkgsrc/sysutils/accountsservice/buildlink3.mk       Mon Jun 11 23:55:50 2018
@@ -0,0 +1,17 @@
+# $NetBSD: buildlink3.mk,v 1.1 2018/06/11 23:55:50 youri Exp $
+
+BUILDLINK_TREE+=       accountsservice
+
+.if !defined(ACCOUNTSSERVICE_BUILDLINK3_MK)
+ACCOUNTSSERVICE_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.accountsservice+=        accountsservice>=0.6.40
+BUILDLINK_PKGSRCDIR.accountsservice?=  ../../sysutils/accountsservice
+
+.include "../../devel/gobject-introspection/buildlink3.mk"
+
+.include "../../security/polkit/buildlink3.mk"
+.include "../../devel/glib2/buildlink3.mk"
+.endif # ACCOUNTSSERVICE_BUILDLINK3_MK
+
+BUILDLINK_TREE+=       -accountsservice
Index: pkgsrc/sysutils/accountsservice/distinfo
diff -u /dev/null pkgsrc/sysutils/accountsservice/distinfo:1.1
--- /dev/null   Mon Jun 11 23:55:50 2018
+++ pkgsrc/sysutils/accountsservice/distinfo    Mon Jun 11 23:55:50 2018
@@ -0,0 +1,11 @@
+$NetBSD: distinfo,v 1.1 2018/06/11 23:55:50 youri Exp $
+
+SHA1 (accountsservice-0.6.42.tar.xz) = 4461347acf3878e100afcc2e3f960fb2c9fd87f4
+RMD160 (accountsservice-0.6.42.tar.xz) = 72b3025468b855d50517729530a92e5cb31ca82e
+SHA512 (accountsservice-0.6.42.tar.xz) = b31d77b88793a8264d32963a98ad446537292a134a3f80fabb4e2ce30f796e5f3066d02a27515c993133fa493b511a6abba6ff1a7827b5a54ea6a4f62a7b6fc9
+Size (accountsservice-0.6.42.tar.xz) = 380500 bytes
+SHA1 (patch-data_Makefile.am) = b059cd214a346adb371e4a006f497d652c9d9234
+SHA1 (patch-src_daemon.c) = b39c9e4fe82b086002d760eb191de55ac791dc91
+SHA1 (patch-src_libaccountsservice_act-user.c) = 50015cd0d4c32d1b97efa3620697790cca1db541
+SHA1 (patch-src_user.c) = a55c2daf41a8c833de4af0517d353d3fcb73beff
+SHA1 (patch-src_wtmp-helper.c) = eb32d598784f31e9baac44bd63ab248f5873c9c3

Index: pkgsrc/sysutils/accountsservice/patches/patch-data_Makefile.am
diff -u /dev/null pkgsrc/sysutils/accountsservice/patches/patch-data_Makefile.am:1.1
--- /dev/null   Mon Jun 11 23:55:50 2018
+++ pkgsrc/sysutils/accountsservice/patches/patch-data_Makefile.am      Mon Jun 11 23:55:50 2018
@@ -0,0 +1,16 @@
+$NetBSD: patch-data_Makefile.am,v 1.1 2018/06/11 23:55:50 youri Exp $
+
+Use the pkgsrc specific solution to handle /etc files with the CONF_FILES
+framework.
+
+--- data/Makefile.am.orig      2014-11-04 03:46:00.000000000 +0000
++++ data/Makefile.am
+@@ -4,7 +4,7 @@ dbusif_DATA = \
+       org.freedesktop.Accounts.xml            \
+       org.freedesktop.Accounts.User.xml
+ 
+-dbusconfdir   = $(sysconfdir)/dbus-1/system.d
++dbusconfdir   = ${EGDIR}/dbus-1/system.d
+ dbusconf_DATA = org.freedesktop.Accounts.conf
+ 
+ servicedir       = $(datadir)/dbus-1/system-services
Index: pkgsrc/sysutils/accountsservice/patches/patch-src_daemon.c
diff -u /dev/null pkgsrc/sysutils/accountsservice/patches/patch-src_daemon.c:1.1
--- /dev/null   Mon Jun 11 23:55:50 2018
+++ pkgsrc/sysutils/accountsservice/patches/patch-src_daemon.c  Mon Jun 11 23:55:50 2018
@@ -0,0 +1,82 @@
+$NetBSD: patch-src_daemon.c,v 1.1 2018/06/11 23:55:50 youri Exp $
+
+Add NetBSD backend inspired from OpenBSD ports.
+
+--- src/daemon.c.orig  2015-02-25 13:51:44.000000000 +0000
++++ src/daemon.c
+@@ -29,6 +29,7 @@
+ #include <fcntl.h>
+ #include <sys/wait.h>
+ #include <pwd.h>
++#include <grp.h>
+ #include <unistd.h>
+ #include <errno.h>
+ #include <sys/types.h>
+@@ -46,9 +47,13 @@
+ #include "util.h"
+ 
+ #define PATH_PASSWD "/etc/passwd"
++#if defined(HAVE_SHADOW_H)
+ #define PATH_SHADOW "/etc/shadow"
++#elif defined(__NetBSD__)
++#define PATH_SHADOW "/etc/master.passwd"
++#endif
+ #define PATH_GROUP "/etc/group"
+ #define PATH_GDM_CUSTOM "/etc/gdm/custom.conf"
+ 
+ enum {
+         PROP_0,
+@@ -1083,6 +1088,34 @@ daemon_delete_user_authorized_cb (Daemon
+                 return;
+         }
+ 
++/*
++ * Under NetBSD there is no /etc/login.defs (for USERGROUPS_ENAB), so
++ * we need to explicitely remove the user's group if it contains no more
++ * members and matches the username.
++ */
++#ifdef __NetBSD__
++        struct group *grp;
++        GError *grperror;
++        const gchar *grpargv[3];
++
++        grp = getgrnam (pwent->pw_name);
++
++        if ((grp != NULL) && (*grp->gr_name == *pwent->pw_name) && (*grp->gr_mem == NULL)) {
++                sys_log (context, "delete group '%d'", pwent->pw_gid);
++
++                grpargv[0] = "/usr/sbin/groupdel";
++                grpargv[1] = pwent->pw_name;
++                grpargv[2] = NULL;
++
++                grperror = NULL;
++                if (!spawn_with_login_uid (context, grpargv, &grperror)) {
++                    throw_error (context, ERROR_FAILED, "running '%s' failed: %s", grpargv[0], grperror->message);
++                    g_error_free (grperror);
++                    return;
++                }
++        }
++#endif
++
+         sys_log (context, "delete user '%s' (%d)", pwent->pw_name, ud->uid);
+ 
+         if (daemon->priv->autologin != NULL) {
+@@ -1108,11 +1141,18 @@ daemon_delete_user_authorized_cb (Daemon
+ 
+         argv[0] = "/usr/sbin/userdel";
+         if (ud->remove_files) {
++#ifdef __NetBSD__
++                argv[1] = "-r";
++                argv[2] = "--";
++                argv[3] = pwent->pw_name;
++                argv[4] = NULL;
++#else
+                 argv[1] = "-f";
+                 argv[2] = "-r";
+                 argv[3] = "--";
+                 argv[4] = pwent->pw_name;
+                 argv[5] = NULL;
++#endif
+         }
+         else {
+                 argv[1] = "-f";
Index: pkgsrc/sysutils/accountsservice/patches/patch-src_libaccountsservice_act-user.c
diff -u /dev/null pkgsrc/sysutils/accountsservice/patches/patch-src_libaccountsservice_act-user.c:1.1
--- /dev/null   Mon Jun 11 23:55:50 2018
+++ pkgsrc/sysutils/accountsservice/patches/patch-src_libaccountsservice_act-user.c     Mon Jun 11 23:55:50 2018
@@ -0,0 +1,70 @@
+$NetBSD: patch-src_libaccountsservice_act-user.c,v 1.1 2018/06/11 23:55:50 youri Exp $
+
+Add NetBSD backend.
+
+--- src/libaccountsservice/act-user.c.orig     2018-05-25 23:09:35.000000000 +0000
++++ src/libaccountsservice/act-user.c
+@@ -25,6 +25,7 @@
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <unistd.h>
++#include <errno.h>
+ 
+ #include <glib.h>
+ #include <glib/gi18n.h>
+@@ -1818,8 +1819,29 @@ salt_char (GRand *rand)
+ }
+ 
+ static gchar *
+-make_crypted (const gchar *plain)
++make_crypted (const gchar *username, const gchar *plain)
+ {
++#ifdef __NetBSD__
++        char salt[_PASSWORD_LEN+1];
++        char option[LINE_MAX], *key, *opt;
++      struct passwd *pw;
++
++      if (!(pw = getpwnam(username))) {
++                errx(EXIT_FAILURE, "can't get pw for %s", username);
++        }
++
++
++        pw_getpwconf(option, sizeof(option), pw, "localcipher");
++        opt = option;
++        key = strsep(&opt, ",");
++
++        if (pw_gensalt(salt, _PASSWORD_LEN, key, opt) == -1) {
++                errx(EXIT_FAILURE, "Failed to pw_gensalt: %s", strerror(errno));
++        }
++
++      gchar *result = g_strdup (crypt (plain, salt));
++
++#else
+         GString *salt;
+         gchar *result;
+         GRand *rand;
+@@ -1830,6 +1852,7 @@ make_crypted (const gchar *plain)
+ 
+         /* SHA 256 */
+         g_string_append (salt, "$6$");
++
+         for (i = 0; i < 16; i++) {
+                 g_string_append_c (salt, salt_char (rand));
+         }
+@@ -1839,6 +1862,7 @@ make_crypted (const gchar *plain)
+ 
+         g_string_free (salt, TRUE);
+         g_rand_free (rand);
++#endif
+ 
+         return result;
+ }
+@@ -1866,7 +1890,7 @@ act_user_set_password (ActUser          
+         g_return_if_fail (password != NULL);
+         g_return_if_fail (ACCOUNTS_IS_USER (user->accounts_proxy));
+ 
+-        crypted = make_crypted (password);
++        crypted = make_crypted (user->user_name, password);
+         if (!accounts_user_call_set_password_sync (user->accounts_proxy,
+                                                    crypted,
+                                                    hint,
Index: pkgsrc/sysutils/accountsservice/patches/patch-src_user.c
diff -u /dev/null pkgsrc/sysutils/accountsservice/patches/patch-src_user.c:1.1
--- /dev/null   Mon Jun 11 23:55:50 2018
+++ pkgsrc/sysutils/accountsservice/patches/patch-src_user.c    Mon Jun 11 23:55:50 2018
@@ -0,0 +1,143 @@
+$NetBSD: patch-src_user.c,v 1.1 2018/06/11 23:55:50 youri Exp $
+
+Add NetBSD backend inspired from OpenBSD ports.
+
+--- src/user.c.orig    2016-01-11 15:42:31.000000000 +0000
++++ src/user.c
+@@ -138,17 +138,14 @@ account_type_from_pwent (struct passwd *
+                 return ACCOUNT_TYPE_STANDARD;
+         }
+         wheel = grp->gr_gid;
+-
+         ngroups = get_user_groups (pwent->pw_name, pwent->pw_gid, &groups);
+ 
+         for (i = 0; i < ngroups; i++) {
+                 if (groups[i] == wheel) {
+-                        g_free (groups);
+                         return ACCOUNT_TYPE_ADMINISTRATOR;
+                 }
+         }
+ 
+-        g_free (groups);
+ 
+         return ACCOUNT_TYPE_STANDARD;
+ }
+@@ -159,6 +156,8 @@ user_update_from_pwent (User          *u
+ {
+ #ifdef HAVE_SHADOW_H
+         struct spwd *spent;
++#else
++      struct passwd *pw;
+ #endif
+         gchar *real_name;
+         gboolean changed;
+@@ -264,7 +263,23 @@ user_update_from_pwent (User          *u
+                 passwd = spent->sp_pwdp;
+ #endif
+ 
++#ifdef __NetBSD__
++        pw = getpwnam (pwent->pw_name);
++        if (pw)
++                passwd = pw->pw_passwd;
++        if (g_strcmp0(passwd, "skey") == 0)
++                passwd = NULL;
++#endif
++
++
++/* On NetBSD, a locked account has it's password
++ * prepended by "*LOCKED*"
++ */
++#ifdef __NetBSD__
++        if (passwd && passwd[0] == '*') {
++#else
+         if (passwd && passwd[0] == '!') {
++#endif
+                 locked = TRUE;
+         }
+         else {
+@@ -1546,17 +1561,30 @@ user_change_locked_authorized_cb (Daemon
+ {
+         gboolean locked = GPOINTER_TO_INT (data);
+         GError *error;
++#ifdef __NetBSD__
++      const gchar *argv[6];
++#else
+         const gchar *argv[5];
++#endif
+ 
+         if (user->locked != locked) {
+                 sys_log (context,
+                          "%s account of user '%s' (%d)",
+                          locked ? "locking" : "unlocking", user->user_name, user->uid);
++#ifdef __NetBSD__
++                argv[0] = "/usr/sbin/usermod";
++              argv[1] = "-C";
++                argv[2] = locked ? "yes" : "no";
++                argv[3] = "--";
++                argv[4] = user->user_name;
++                argv[5] = NULL;
++#else
+                 argv[0] = "/usr/sbin/usermod";
+                 argv[1] = locked ? "-L" : "-U";
+                 argv[2] = "--";
+                 argv[3] = user->user_name;
+                 argv[4] = NULL;
++#endif
+ 
+                 error = NULL;
+                 if (!spawn_with_login_uid (context, argv, &error)) {
+@@ -1650,11 +1678,16 @@ user_change_account_type_authorized_cb (
+                 for (i = 0; i < ngroups; i++) {
+                         if (groups[i] == wheel)
+                                 continue;
++
+                         g_string_append_printf (str, "%d,", groups[i]);
+                 }
+                 switch (account_type) {
+                 case ACCOUNT_TYPE_ADMINISTRATOR:
++#ifdef __NetBSD__
++                        g_string_append_printf (str, "%s", "wheel");
++#else
+                         g_string_append_printf (str, "%d", wheel);
++#endif
+                         break;
+                 case ACCOUNT_TYPE_STANDARD:
+                 default:
+@@ -1735,6 +1768,8 @@ user_change_password_mode_authorized_cb 
+                 if (mode == PASSWORD_MODE_SET_AT_LOGIN ||
+                     mode == PASSWORD_MODE_NONE) {
+ 
++/* Find a way to remove the password properly XXX */
++#ifndef __NetBSD__
+                         argv[0] = "/usr/bin/passwd";
+                         argv[1] = "-d";
+                         argv[2] = "--";
+@@ -1768,6 +1803,7 @@ user_change_password_mode_authorized_cb 
+                         user->password_hint = NULL;
+ 
+                         g_object_notify (G_OBJECT (user), "password-hint");
++#endif
+ 
+                         /* removing the password has the side-effect of
+                          * unlocking the account
+@@ -1778,11 +1814,20 @@ user_change_password_mode_authorized_cb 
+                         }
+                 }
+                 else if (user->locked) {
++#ifdef __NetBSD__
++                        argv[0] = "/usr/sbin/usermod";
++                      argv[1] = "-C";
++                        argv[2] = "no";
++                        argv[3] = "--";
++                        argv[4] = user->user_name;
++                        argv[5] = NULL;
++#else
+                         argv[0] = "/usr/sbin/usermod";
+                         argv[1] = "-U";
+                         argv[2] = "--";
+                         argv[3] = user->user_name;
+                         argv[4] = NULL;
++#endif
+ 
+                         error = NULL;
+                         if (!spawn_with_login_uid (context, argv, &error)) {
Index: pkgsrc/sysutils/accountsservice/patches/patch-src_wtmp-helper.c
diff -u /dev/null pkgsrc/sysutils/accountsservice/patches/patch-src_wtmp-helper.c:1.1
--- /dev/null   Mon Jun 11 23:55:50 2018
+++ pkgsrc/sysutils/accountsservice/patches/patch-src_wtmp-helper.c     Mon Jun 11 23:55:50 2018
@@ -0,0 +1,17 @@
+$NetBSD: patch-src_wtmp-helper.c,v 1.1 2018/06/11 23:55:50 youri Exp $
+
+NetBSD call WTMPX_FILENAME _PATH_WTMPX.
+
+--- src/wtmp-helper.c.orig     2016-01-27 18:38:21.000000000 +0000
++++ src/wtmp-helper.c
+@@ -27,6 +27,10 @@
+ 
+ #ifdef HAVE_UTMPX_H
+ 
++#ifdef __NetBSD__
++#define WTMPX_FILENAME        _PATH_WTMPX
++#endif
++
+ #include <utmpx.h>
+ 
+ typedef struct {



Home | Main Index | Thread Index | Old Index