From 4ee94183dc2439a46bc9eac09509bf97a0d945fd Mon Sep 17 00:00:00 2001 From: kwm Date: Sat, 15 Mar 2014 14:48:11 +0000 Subject: Update to 0.6.35, with getpwent() upstream patch. Hackout WTMP crap (being worked on) git-svn-id: svn://creme-brulee.marcuscom.com/ports/trunk@19139 df743ca5-7f9a-e211-a948-0013205c9059 --- sysutils/accountsservice/Makefile | 8 +- sysutils/accountsservice/distinfo | 4 +- sysutils/accountsservice/files/patch-configure | 21 ++++ .../accountsservice/files/patch-src_Makefile.in | 13 +++ sysutils/accountsservice/files/patch-src_daemon.c | 107 ++++++++++---------- .../accountsservice/files/patch-src_fgetpwent.c | 111 +++++++++++++++++++++ .../files/patch-src_user-classify.c | 18 ++++ sysutils/accountsservice/files/patch-src_user.c | 42 ++++++-- sysutils/accountsservice/pkg-plist | 21 ++++ 9 files changed, 274 insertions(+), 71 deletions(-) create mode 100644 sysutils/accountsservice/files/patch-configure create mode 100644 sysutils/accountsservice/files/patch-src_Makefile.in create mode 100644 sysutils/accountsservice/files/patch-src_fgetpwent.c create mode 100644 sysutils/accountsservice/files/patch-src_user-classify.c (limited to 'sysutils/accountsservice') diff --git a/sysutils/accountsservice/Makefile b/sysutils/accountsservice/Makefile index 794639e06..bffae7955 100644 --- a/sysutils/accountsservice/Makefile +++ b/sysutils/accountsservice/Makefile @@ -3,8 +3,7 @@ # $MCom$ PORTNAME= accountsservice -PORTVERSION= 0.6.24 -PORTREVISION= 3 +PORTVERSION= 0.6.35 CATEGORIES= sysutils devel MASTER_SITES= http://www.freedesktop.org/software/${PORTNAME}/ @@ -14,12 +13,11 @@ COMMENT= D-Bus interface for user account query and manipulation LIB_DEPENDS= libdbus-glib-1.so:${PORTSDIR}/devel/dbus-glib \ libpolkit-gobject-1.so:${PORTSDIR}/sysutils/polkit -USE_XZ= yes USE_GNOME= glib20 gnomehier intlhack introspection:build libxslt -USES= gettext gmake pathfix pkgconfig +USES= gettext gmake libtool pathfix pkgconfig tar:xz GNU_CONFIGURE= yes USE_LDCONFIG= yes -CONFIGURE_ARGS= --disable-systemd --localstatedir=/var/ --disable-vala +CONFIGURE_ARGS= --disable-systemd --localstatedir=/var/ CPPFLAGS+= -I${LOCALBASE}/include LDFLAGS+= -L${LOCALBASE}/lib diff --git a/sysutils/accountsservice/distinfo b/sysutils/accountsservice/distinfo index 6986b26ee..5ff7f0146 100644 --- a/sysutils/accountsservice/distinfo +++ b/sysutils/accountsservice/distinfo @@ -1,2 +1,2 @@ -SHA256 (accountsservice-0.6.24.tar.xz) = f2c0886c5d6d80453eebd4a91e6081231cde6cc436d55b9425d2cc0332a85623 -SIZE (accountsservice-0.6.24.tar.xz) = 332928 +SHA256 (accountsservice-0.6.35.tar.xz) = 65a1c7013c9c6785c7feb710ee940bb297207dabdb93561fdfdd140e0dfd3038 +SIZE (accountsservice-0.6.35.tar.xz) = 360824 diff --git a/sysutils/accountsservice/files/patch-configure b/sysutils/accountsservice/files/patch-configure new file mode 100644 index 000000000..cbf3790af --- /dev/null +++ b/sysutils/accountsservice/files/patch-configure @@ -0,0 +1,21 @@ +--- 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-src_Makefile.in b/sysutils/accountsservice/files/patch-src_Makefile.in new file mode 100644 index 000000000..98efb907a --- /dev/null +++ b/sysutils/accountsservice/files/patch-src_Makefile.in @@ -0,0 +1,13 @@ +--- src/Makefile.in.orig 2014-03-15 15:02:34.000000000 +0100 ++++ src/Makefile.in 2014-03-15 15:03:04.000000000 +0100 +@@ -435,6 +435,10 @@ + libaccounts-generated.la \ + $(POLKIT_LIBS) + ++EXTRA_DIST = \ ++ fgetpwent.c \ ++ $(NULL) ++ + CLEANFILES = \ + $(BUILT_SOURCES) \ + *.gcda \ diff --git a/sysutils/accountsservice/files/patch-src_daemon.c b/sysutils/accountsservice/files/patch-src_daemon.c index f102cde17..3d8ddfc04 100644 --- a/sysutils/accountsservice/files/patch-src_daemon.c +++ b/sysutils/accountsservice/files/patch-src_daemon.c @@ -1,34 +1,58 @@ ---- src/daemon.c.orig 2012-08-16 19:03:51.000000000 +0000 -+++ src/daemon.c 2012-10-08 19:05:09.000000000 +0000 -@@ -68,6 +68,7 @@ - "nobody4", - "noaccess", - "postgres", -+ "pgsql", - "pvm", - "rpm", - "nfsnobody", -@@ -77,6 +78,7 @@ - "games", - "man", - "at", -+ "saned", - NULL - }; +--- src/daemon.c.orig 2013-10-15 22:25:19.000000000 +0200 ++++ src/daemon.c 2014-03-15 15:33:49.000000000 +0100 +@@ -50,9 +50,8 @@ + #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" + #ifdef HAVE_UTMPX_H +-#define PATH_WTMP _PATH_WTMPX + #endif -@@ -304,7 +306,11 @@ + enum { +@@ -73,7 +72,7 @@ + GFileMonitor *group_monitor; + GFileMonitor *gdm_monitor; + #ifdef HAVE_UTMPX_H +- GFileMonitor *wtmp_monitor; ++// GFileMonitor *wtmp_monitor; + #endif - /* Every iteration */ - fp = *state; -+#ifdef HAVE_FGETPWENT - pwent = fgetpwent (fp); -+#else -+ pwent = getpwent (); + guint reload_id; +@@ -162,6 +161,10 @@ + g_free (previous_login); + } + ++#ifndef HAVE_FGETPWENT ++#include "fgetpwent.c" +#endif - if (pwent != NULL) { - return pwent; - } -@@ -1030,20 +1036,18 @@ ++ + static struct passwd * + entry_generator_wtmp (GHashTable *users, + gpointer *state) +@@ -183,7 +186,7 @@ + return NULL; + } + #else +- utmpxname (PATH_WTMP); ++// utmpxname (PATH_WTMP); + setutxent (); + #endif + *state = g_new (WTmpGeneratorState, 1); +@@ -697,11 +700,6 @@ + PATH_GROUP, + on_users_monitor_changed); + +-#ifdef HAVE_UTMPX_H +- daemon->priv->wtmp_monitor = setup_monitor (daemon, +- PATH_WTMP, +- on_users_monitor_changed); +-#endif + + daemon->priv->gdm_monitor = setup_monitor (daemon, + PATH_GDM_CUSTOM, +@@ -1061,20 +1059,18 @@ sys_log (context, "create user '%s'", cd->user_name); @@ -44,11 +68,11 @@ + argv[5] = cd->real_name; if (cd->account_type == ACCOUNT_TYPE_ADMINISTRATOR) { - argv[4] = "-G"; -- argv[5] = "wheel"; +- argv[5] = ADMIN_GROUP; - argv[6] = "--"; - argv[7] = cd->user_name; + argv[6] = "-G"; -+ argv[7] = "wheel"; ++ argv[7] = ADMIN_GROUP; argv[8] = NULL; } else if (cd->account_type == ACCOUNT_TYPE_STANDARD) { @@ -57,26 +81,3 @@ argv[6] = NULL; } else { -@@ -1250,16 +1254,15 @@ - g_remove (filename); - g_free (filename); - -- argv[0] = "/usr/sbin/userdel"; -+ argv[0] = "/usr/sbin/pw"; - if (ud->remove_files) { -- argv[1] = "-f"; -- argv[2] = "-r"; -- argv[3] = "--"; -- argv[4] = pwent->pw_name; -- argv[5] = NULL; -+ argv[1] = "userdel"; -+ argv[2] = pwent->pw_name; -+ argv[3] = "-r"; -+ argv[4] = NULL; - } - else { -- argv[1] = "--"; -+ argv[1] = "userdel"; - argv[2] = pwent->pw_name; - argv[3] = NULL; - } diff --git a/sysutils/accountsservice/files/patch-src_fgetpwent.c b/sysutils/accountsservice/files/patch-src_fgetpwent.c new file mode 100644 index 000000000..ae48ff2d4 --- /dev/null +++ b/sysutils/accountsservice/files/patch-src_fgetpwent.c @@ -0,0 +1,111 @@ +--- src/fgetpwent.c.orig 2014-03-15 15:05:11.000000000 +0100 ++++ src/fgetpwent.c 2014-03-15 15:02:41.000000000 +0100 +@@ -0,0 +1,108 @@ ++/* ++ * Copyright (C) 2013 Canonical Limited ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 3 of the licence, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ++ * ++ * Authors: Ryan Lortie ++ */ ++ ++static gchar * ++fgetpwent_getline (FILE *fp) ++{ ++ static GString str; ++ ++ /* We could be "more clever" here and avoid the strlen() but this is a ++ * clear case of dumb is better. ++ */ ++ str.len = 0; ++ while (!str.len || str.str[str.len - 1] != '\n') ++ { ++ if (str.allocated_len < str.len + 32) ++ { ++ str.allocated_len = str.len + 32; ++ str.str = g_realloc (str.str, str.allocated_len); ++ } ++ ++ if (fgets (str.str + str.len, str.allocated_len - str.len, fp) == NULL) ++ return NULL; ++ ++ str.len = strlen (str.str + str.len) + str.len; ++ } ++ ++ /* chomp the '\n' */ ++ str.str[str.len - 1] = '\0'; ++ ++ return str.str; ++} ++ ++static struct passwd * ++fgetpwent (FILE *fp) ++{ ++ static struct passwd pw; ++ guint64 intval; ++ gchar *line; ++ ++ /* In case of failure, we ignore the line and start again */ ++again: ++ line = fgetpwent_getline (fp); ++ if (!line) ++ return NULL; ++ ++ while (g_ascii_isspace (*line)) ++ line++; ++ ++ /* comments, empty lines */ ++ if (line[0] == '#' || line[0] == '\0') ++ goto again; ++ ++ /* username */ ++ pw.pw_name = line; ++ if (!(line = strchr (line, ':'))) ++ goto again; ++ *line++ = '\0'; ++ ++ /* password */ ++ pw.pw_passwd = line; ++ if (!(line = strchr (line, ':'))) ++ goto again; ++ *line++ = '\0'; ++ ++ /* uid */ ++ pw.pw_uid = intval = g_ascii_strtoull (line, &line, 10); ++ if (pw.pw_uid != intval || *line++ != ':') ++ goto again; ++ ++ /* gid */ ++ pw.pw_gid = intval = g_ascii_strtoull (line, &line, 10); ++ if (pw.pw_gid != intval || *line++ != ':') ++ goto again; ++ ++ /* gecos */ ++ pw.pw_gecos = line; ++ if (!(line = strchr (line, ':'))) ++ goto again; ++ *line++ = '\0'; ++ ++ /* home directory */ ++ pw.pw_dir = line; ++ if (!(line = strchr (line, ':'))) ++ goto again; ++ *line++ = '\0'; ++ ++ /* shell */ ++ pw.pw_shell = line; ++ ++ return &pw; ++} diff --git a/sysutils/accountsservice/files/patch-src_user-classify.c b/sysutils/accountsservice/files/patch-src_user-classify.c new file mode 100644 index 000000000..ae8aae3d3 --- /dev/null +++ b/sysutils/accountsservice/files/patch-src_user-classify.c @@ -0,0 +1,18 @@ +--- src/user-classify.c.orig 2014-03-15 15:09:59.000000000 +0100 ++++ src/user-classify.c 2014-03-15 15:11:06.000000000 +0100 +@@ -44,6 +44,7 @@ + "nobody4", + "noaccess", + "postgres", ++ "pgsql", + "pvm", + "rpm", + "nfsnobody", +@@ -53,6 +54,7 @@ + "games", + "man", + "at", ++ "saned", + "gdm", + "gnome-initial-setup" + }; diff --git a/sysutils/accountsservice/files/patch-src_user.c b/sysutils/accountsservice/files/patch-src_user.c index 1cb68ea3e..9a5dd9a58 100644 --- a/sysutils/accountsservice/files/patch-src_user.c +++ b/sysutils/accountsservice/files/patch-src_user.c @@ -1,6 +1,6 @@ ---- src/user.c.orig 2012-08-16 19:03:51.000000000 +0000 -+++ src/user.c 2012-10-08 19:13:02.000000000 +0000 -@@ -546,11 +546,11 @@ +--- 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); @@ -17,7 +17,7 @@ argv[5] = NULL; error = NULL; -@@ -620,11 +620,11 @@ +@@ -947,11 +947,11 @@ "change name of user '%s' (%d) to '%s'", old_name, user->uid, name); @@ -34,7 +34,27 @@ argv[5] = NULL; error = NULL; -@@ -964,11 +964,11 @@ +@@ -1229,13 +1229,12 @@ + "change home directory of user '%s' (%d) to '%s'", + user->user_name, user->uid, 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[6] = NULL; ++ argv[0] = "/usr/sbin/pw"; ++ argv[1] = "-d"; ++ argv[2] = home_dir; ++ argv[3] = "-n"; ++ argv[4] = user->user_name; ++ 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); @@ -51,7 +71,7 @@ argv[5] = NULL; error = NULL; -@@ -1224,11 +1224,10 @@ +@@ -1551,11 +1550,10 @@ sys_log (context, "%s account of user '%s' (%d)", locked ? "locking" : "unlocking", user->user_name, user->uid); @@ -67,7 +87,7 @@ error = NULL; if (!spawn_with_login_uid (context, argv, &error)) { -@@ -1315,11 +1314,11 @@ +@@ -1664,11 +1662,11 @@ g_free (groups); @@ -84,7 +104,7 @@ argv[5] = NULL; g_string_free (str, FALSE); -@@ -1386,10 +1385,8 @@ +@@ -1735,10 +1733,8 @@ mode == PASSWORD_MODE_NONE) { argv[0] = "/usr/bin/passwd"; @@ -97,7 +117,7 @@ error = NULL; if (!spawn_with_login_uid (context, argv, &error)) { -@@ -1399,12 +1396,11 @@ +@@ -1748,12 +1744,11 @@ } if (mode == PASSWORD_MODE_SET_AT_LOGIN) { @@ -114,7 +134,7 @@ error = NULL; if (!spawn_with_login_uid (context, argv, &error)) { -@@ -1428,11 +1424,10 @@ +@@ -1777,11 +1772,10 @@ } } else if (user->locked) { @@ -130,7 +150,7 @@ error = NULL; if (!spawn_with_login_uid (context, argv, &error)) { -@@ -1503,12 +1498,11 @@ +@@ -1852,12 +1846,11 @@ g_object_freeze_notify (G_OBJECT (user)); diff --git a/sysutils/accountsservice/pkg-plist b/sysutils/accountsservice/pkg-plist index 1d40aa30b..538132121 100644 --- a/sysutils/accountsservice/pkg-plist +++ b/sysutils/accountsservice/pkg-plist @@ -8,12 +8,26 @@ lib/libaccountsservice.a lib/libaccountsservice.la lib/libaccountsservice.so lib/libaccountsservice.so.0 +lib/libaccountsservice.so.0.0.0 libdata/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/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/index.sgml +share/gtk-doc/html/libaccountsservice/left.png +share/gtk-doc/html/libaccountsservice/libaccountsservice.devhelp2 +share/gtk-doc/html/libaccountsservice/right.png +share/gtk-doc/html/libaccountsservice/style.css +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 @@ -34,9 +48,11 @@ 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 @@ -66,12 +82,17 @@ share/polkit-1/actions/org.freedesktop.accounts.policy @dirrmtry share/locale/sr@latin @dirrmtry share/locale/kk/LC_MESSAGES @dirrmtry share/locale/kk +@dirrmtry share/locale/ia/LC_MESSAGES +@dirrmtry share/locale/ia @dirrmtry share/locale/ca@valencia/LC_MESSAGES @dirrmtry share/locale/ca@valencia @dirrmtry share/locale/bn_IN/LC_MESSAGES @dirrmtry share/locale/bn_IN @dirrmtry share/locale/bg_BG/LC_MESSAGES @dirrmtry share/locale/bg_BG +@dirrmtry share/gtk-doc/html/libaccountsservice +@dirrmtry share/gtk-doc/html +@dirrmtry share/gtk-doc @dirrm include/accountsservice-1.0/act @dirrm include/accountsservice-1.0 @cwd / -- cgit v1.2.3