Hello community, here is the log from the commit of package accountsservice for openSUSE:Factory checked in at 2016-10-10 17:32:56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/accountsservice (Old) and /work/SRC/openSUSE:Factory/.accountsservice.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "accountsservice" Changes: -------- --- /work/SRC/openSUSE:Factory/accountsservice/accountsservice.changes 2016-09-21 18:29:58.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.accountsservice.new/accountsservice.changes 2016-10-10 17:32:57.000000000 +0200 @@ -1,0 +2,9 @@ +Sat Sep 24 20:41:41 UTC 2016 - [email protected] + +- Update to version 0.6.43: + + Fix logout times in login-history. + + Increase performance in large deployments. + + Memory leak fix. + + Exclude nologin users from user list. + +------------------------------------------------------------------- Old: ---- accountsservice-0.6.42.tar.xz New: ---- accountsservice-0.6.43.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ accountsservice.spec ++++++ --- /var/tmp/diff_new_pack.9OlaWP/_old 2016-10-10 17:32:58.000000000 +0200 +++ /var/tmp/diff_new_pack.9OlaWP/_new 2016-10-10 17:32:58.000000000 +0200 @@ -17,7 +17,7 @@ Name: accountsservice -Version: 0.6.42 +Version: 0.6.43 Release: 0 Summary: D-Bus Service to Manipulate User Account Information License: GPL-3.0+ ++++++ accountsservice-0.6.42.tar.xz -> accountsservice-0.6.43.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/accountsservice-0.6.42/NEWS new/accountsservice-0.6.43/NEWS --- old/accountsservice-0.6.42/NEWS 2016-06-09 16:17:01.000000000 +0200 +++ new/accountsservice-0.6.43/NEWS 2016-09-20 18:21:53.000000000 +0200 @@ -1,3 +1,10 @@ +Changes in 0.6.43 +================= +* Fix logout times in login-history +* increase performance in large deployments +* memory leak fix +* exclude nologin users from user list + Changes in 0.6.42 ================= * wtmp fixes on solaris diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/accountsservice-0.6.42/aclocal.m4 new/accountsservice-0.6.43/aclocal.m4 --- old/accountsservice-0.6.42/aclocal.m4 2016-06-09 16:17:23.000000000 +0200 +++ new/accountsservice-0.6.43/aclocal.m4 2016-09-20 18:22:37.000000000 +0200 @@ -834,8 +834,8 @@ ]) # nls.m4 serial 5 (gettext-0.18) -dnl Copyright (C) 1995-2003, 2005-2006, 2008-2014 Free Software Foundation, -dnl Inc. +dnl Copyright (C) 1995-2003, 2005-2006, 2008-2014, 2016 Free Software +dnl Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -867,7 +867,7 @@ ]) dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- -dnl serial 11 (pkg-config-0.29.1) +dnl serial 11 (pkg-config-0.29) dnl dnl Copyright © 2004 Scott James Remnant <[email protected]>. dnl Copyright © 2012-2015 Dan Nicholson <[email protected]> @@ -909,7 +909,7 @@ dnl See the "Since" comment for each macro you use to see what version dnl of the macros you require. m4_defun([PKG_PREREQ], -[m4_define([PKG_MACROS_VERSION], [0.29.1]) +[m4_define([PKG_MACROS_VERSION], [0.29]) m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])]) ])dnl PKG_PREREQ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/accountsservice-0.6.42/config.h.in new/accountsservice-0.6.43/config.h.in --- old/accountsservice-0.6.42/config.h.in 2016-06-09 16:17:26.000000000 +0200 +++ new/accountsservice-0.6.43/config.h.in 2016-09-20 18:22:40.000000000 +0200 @@ -35,6 +35,9 @@ /* Define if the GNU gettext() function is already present or preinstalled. */ #undef HAVE_GETTEXT +/* Define i getusershell() is available */ +#undef HAVE_GETUSERSHELL + /* Define to 1 if you have the <inttypes.h> header file. */ #undef HAVE_INTTYPES_H diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/accountsservice-0.6.42/configure new/accountsservice-0.6.43/configure --- old/accountsservice-0.6.42/configure 2016-06-09 16:17:25.000000000 +0200 +++ new/accountsservice-0.6.43/configure 2016-09-20 18:22:39.000000000 +0200 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for AccountsService 0.6.42. +# Generated by GNU Autoconf 2.69 for AccountsService 0.6.43. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. @@ -587,8 +587,8 @@ # Identity of this package. PACKAGE_NAME='AccountsService' PACKAGE_TARNAME='accountsservice' -PACKAGE_VERSION='0.6.42' -PACKAGE_STRING='AccountsService 0.6.42' +PACKAGE_VERSION='0.6.43' +PACKAGE_STRING='AccountsService 0.6.43' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1442,7 +1442,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures AccountsService 0.6.42 to adapt to many kinds of systems. +\`configure' configures AccountsService 0.6.43 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1512,7 +1512,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of AccountsService 0.6.42:";; + short | recursive ) echo "Configuration of AccountsService 0.6.43:";; esac cat <<\_ACEOF @@ -1663,7 +1663,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -AccountsService configure 0.6.42 +AccountsService configure 0.6.43 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2074,7 +2074,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by AccountsService $as_me 0.6.42, which was +It was created by AccountsService $as_me 0.6.43, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2937,7 +2937,7 @@ # Define the identity of the package. PACKAGE='accountsservice' - VERSION='0.6.42' + VERSION='0.6.43' cat >>confdefs.h <<_ACEOF @@ -15142,6 +15142,54 @@ _ACEOF +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getusershell in -lc" >&5 +$as_echo_n "checking for getusershell in -lc... " >&6; } +if ${ac_cv_lib_c_getusershell+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lc $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char getusershell (); +int +main () +{ +return getusershell (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_c_getusershell=yes +else + ac_cv_lib_c_getusershell=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_getusershell" >&5 +$as_echo "$ac_cv_lib_c_getusershell" >&6; } +if test "x$ac_cv_lib_c_getusershell" = xyes; then : + have_getusershell=yes +else + have_getusershell=no +fi + +if test x$have_getusershell = xyes; then + +$as_echo "#define HAVE_GETUSERSHELL 1" >>confdefs.h + +fi + @@ -16368,7 +16416,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by AccountsService $as_me 0.6.42, which was +This file was extended by AccountsService $as_me 0.6.43, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -16434,7 +16482,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -AccountsService config.status 0.6.42 +AccountsService config.status 0.6.43 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/accountsservice-0.6.42/configure.ac new/accountsservice-0.6.43/configure.ac --- old/accountsservice-0.6.42/configure.ac 2016-06-09 16:17:02.000000000 +0200 +++ new/accountsservice-0.6.43/configure.ac 2016-09-20 18:22:13.000000000 +0200 @@ -1,4 +1,4 @@ -AC_INIT([AccountsService],[0.6.42]) +AC_INIT([AccountsService],[0.6.43]) AM_INIT_AUTOMAKE([1.11.2 no-dist-gzip dist-xz tar-ustar foreign]) GETTEXT_PACKAGE=accounts-service @@ -213,6 +213,11 @@ fi AC_DEFINE_UNQUOTED([PATH_WTMP], [$wtmpx_found], [Path to wtmpx file]) +AC_CHECK_LIB(c, getusershell, have_getusershell=yes, have_getusershell=no) +if test x$have_getusershell = xyes; then + AC_DEFINE(HAVE_GETUSERSHELL, 1, [Define i getusershell() is available]) +fi + dnl --------------------------------------------------------------------------- dnl - gtk-doc Documentation dnl --------------------------------------------------------------------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/accountsservice-0.6.42/doc/dbus/AccountsService.xml new/accountsservice-0.6.43/doc/dbus/AccountsService.xml --- old/accountsservice-0.6.42/doc/dbus/AccountsService.xml 2016-06-09 16:17:31.000000000 +0200 +++ new/accountsservice-0.6.43/doc/dbus/AccountsService.xml 2016-09-20 18:22:47.000000000 +0200 @@ -6,8 +6,8 @@ <book id="index"> <bookinfo> - <title>AccountsService 0.6.42 Documentation</title> - <releaseinfo>Version 0.6.42</releaseinfo> + <title>AccountsService 0.6.43 Documentation</title> + <releaseinfo>Version 0.6.43</releaseinfo> <authorgroup> <author> <firstname>Matthias</firstname> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/accountsservice-0.6.42/doc/libaccountsservice/html/ActUser.html new/accountsservice-0.6.43/doc/libaccountsservice/html/ActUser.html --- old/accountsservice-0.6.42/doc/libaccountsservice/html/ActUser.html 2016-06-09 16:17:41.000000000 +0200 +++ new/accountsservice-0.6.43/doc/libaccountsservice/html/ActUser.html 2016-09-20 18:23:15.000000000 +0200 @@ -8,7 +8,7 @@ <link rel="up" href="ch01.html" title="libaccountsservice"> <link rel="prev" href="ch01.html" title="libaccountsservice"> <link rel="next" href="ActUserManager.html" title="ActUserManager"> -<meta name="generator" content="GTK-Doc V1.25 (XML mode)"> +<meta name="generator" content="GTK-Doc V1.25.1 (XML mode)"> <link rel="stylesheet" href="style.css" type="text/css"> </head> <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> @@ -1997,6 +1997,6 @@ </div> </div> <div class="footer"> -<hr>Generated by GTK-Doc V1.25</div> +<hr>Generated by GTK-Doc V1.25.1</div> </body> </html> \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/accountsservice-0.6.42/doc/libaccountsservice/html/ActUserManager.html new/accountsservice-0.6.43/doc/libaccountsservice/html/ActUserManager.html --- old/accountsservice-0.6.42/doc/libaccountsservice/html/ActUserManager.html 2016-06-09 16:17:41.000000000 +0200 +++ new/accountsservice-0.6.43/doc/libaccountsservice/html/ActUserManager.html 2016-09-20 18:23:15.000000000 +0200 @@ -8,7 +8,7 @@ <link rel="up" href="ch01.html" title="libaccountsservice"> <link rel="prev" href="ActUser.html" title="ActUser"> <link rel="next" href="api-index-full.html" title="API Index"> -<meta name="generator" content="GTK-Doc V1.25 (XML mode)"> +<meta name="generator" content="GTK-Doc V1.25.1 (XML mode)"> <link rel="stylesheet" href="style.css" type="text/css"> </head> <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> @@ -1268,6 +1268,6 @@ </div> </div> <div class="footer"> -<hr>Generated by GTK-Doc V1.25</div> +<hr>Generated by GTK-Doc V1.25.1</div> </body> </html> \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/accountsservice-0.6.42/doc/libaccountsservice/html/annotation-glossary.html new/accountsservice-0.6.43/doc/libaccountsservice/html/annotation-glossary.html --- old/accountsservice-0.6.42/doc/libaccountsservice/html/annotation-glossary.html 2016-06-09 16:17:41.000000000 +0200 +++ new/accountsservice-0.6.43/doc/libaccountsservice/html/annotation-glossary.html 2016-09-20 18:23:15.000000000 +0200 @@ -7,7 +7,7 @@ <link rel="home" href="index.html" title="libaccountsservice Reference Manual"> <link rel="up" href="index.html" title="libaccountsservice Reference Manual"> <link rel="prev" href="api-index-full.html" title="API Index"> -<meta name="generator" content="GTK-Doc V1.25 (XML mode)"> +<meta name="generator" content="GTK-Doc V1.25.1 (XML mode)"> <link rel="stylesheet" href="style.css" type="text/css"> </head> <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> @@ -50,6 +50,6 @@ <dd class="glossdef"><p>Don't free data after the code is done.</p></dd> </div> <div class="footer"> -<hr>Generated by GTK-Doc V1.25</div> +<hr>Generated by GTK-Doc V1.25.1</div> </body> </html> \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/accountsservice-0.6.42/doc/libaccountsservice/html/api-index-full.html new/accountsservice-0.6.43/doc/libaccountsservice/html/api-index-full.html --- old/accountsservice-0.6.42/doc/libaccountsservice/html/api-index-full.html 2016-06-09 16:17:41.000000000 +0200 +++ new/accountsservice-0.6.43/doc/libaccountsservice/html/api-index-full.html 2016-09-20 18:23:15.000000000 +0200 @@ -8,7 +8,7 @@ <link rel="up" href="index.html" title="libaccountsservice Reference Manual"> <link rel="prev" href="ActUserManager.html" title="ActUserManager"> <link rel="next" href="annotation-glossary.html" title="Annotation Glossary"> -<meta name="generator" content="GTK-Doc V1.25 (XML mode)"> +<meta name="generator" content="GTK-Doc V1.25.1 (XML mode)"> <link rel="stylesheet" href="style.css" type="text/css"> </head> <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> @@ -405,6 +405,6 @@ <dd></dd> </div> <div class="footer"> -<hr>Generated by GTK-Doc V1.25</div> +<hr>Generated by GTK-Doc V1.25.1</div> </body> </html> \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/accountsservice-0.6.42/doc/libaccountsservice/html/ch01.html new/accountsservice-0.6.43/doc/libaccountsservice/html/ch01.html --- old/accountsservice-0.6.42/doc/libaccountsservice/html/ch01.html 2016-06-09 16:17:41.000000000 +0200 +++ new/accountsservice-0.6.43/doc/libaccountsservice/html/ch01.html 2016-09-20 18:23:15.000000000 +0200 @@ -8,7 +8,7 @@ <link rel="up" href="index.html" title="libaccountsservice Reference Manual"> <link rel="prev" href="index.html" title="libaccountsservice Reference Manual"> <link rel="next" href="ActUser.html" title="ActUser"> -<meta name="generator" content="GTK-Doc V1.25 (XML mode)"> +<meta name="generator" content="GTK-Doc V1.25.1 (XML mode)"> <link rel="stylesheet" href="style.css" type="text/css"> </head> <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> @@ -32,6 +32,6 @@ </dl></div> </div> <div class="footer"> -<hr>Generated by GTK-Doc V1.25</div> +<hr>Generated by GTK-Doc V1.25.1</div> </body> </html> \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/accountsservice-0.6.42/doc/libaccountsservice/html/index.html new/accountsservice-0.6.43/doc/libaccountsservice/html/index.html --- old/accountsservice-0.6.42/doc/libaccountsservice/html/index.html 2016-06-09 16:17:41.000000000 +0200 +++ new/accountsservice-0.6.43/doc/libaccountsservice/html/index.html 2016-09-20 18:23:15.000000000 +0200 @@ -6,7 +6,7 @@ <meta name="generator" content="DocBook XSL Stylesheets V1.78.1"> <link rel="home" href="index.html" title="libaccountsservice Reference Manual"> <link rel="next" href="ch01.html" title="libaccountsservice"> -<meta name="generator" content="GTK-Doc V1.25 (XML mode)"> +<meta name="generator" content="GTK-Doc V1.25.1 (XML mode)"> <link rel="stylesheet" href="style.css" type="text/css"> </head> <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> @@ -30,6 +30,6 @@ </dl></div> </div> <div class="footer"> -<hr>Generated by GTK-Doc V1.25</div> +<hr>Generated by GTK-Doc V1.25.1</div> </body> </html> \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/accountsservice-0.6.42/src/accounts-generated.c new/accountsservice-0.6.43/src/accounts-generated.c --- old/accountsservice-0.6.42/src/accounts-generated.c 2016-06-09 16:17:39.000000000 +0200 +++ new/accountsservice-0.6.43/src/accounts-generated.c 2016-09-20 18:22:58.000000000 +0200 @@ -1,5 +1,5 @@ /* - * Generated by gdbus-codegen 2.48.1. DO NOT EDIT. + * Generated by gdbus-codegen 2.49.6. DO NOT EDIT. * * The license of this code is the same as for the source it was derived from. */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/accountsservice-0.6.42/src/accounts-generated.h new/accountsservice-0.6.43/src/accounts-generated.h --- old/accountsservice-0.6.42/src/accounts-generated.h 2016-06-09 16:17:39.000000000 +0200 +++ new/accountsservice-0.6.43/src/accounts-generated.h 2016-09-20 18:22:58.000000000 +0200 @@ -1,5 +1,5 @@ /* - * Generated by gdbus-codegen 2.48.1. DO NOT EDIT. + * Generated by gdbus-codegen 2.49.6. DO NOT EDIT. * * The license of this code is the same as for the source it was derived from. */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/accountsservice-0.6.42/src/accounts-user-generated.c new/accountsservice-0.6.43/src/accounts-user-generated.c --- old/accountsservice-0.6.42/src/accounts-user-generated.c 2016-06-09 16:17:39.000000000 +0200 +++ new/accountsservice-0.6.43/src/accounts-user-generated.c 2016-09-20 18:22:58.000000000 +0200 @@ -1,5 +1,5 @@ /* - * Generated by gdbus-codegen 2.48.1. DO NOT EDIT. + * Generated by gdbus-codegen 2.49.6. DO NOT EDIT. * * The license of this code is the same as for the source it was derived from. */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/accountsservice-0.6.42/src/accounts-user-generated.h new/accountsservice-0.6.43/src/accounts-user-generated.h --- old/accountsservice-0.6.42/src/accounts-user-generated.h 2016-06-09 16:17:39.000000000 +0200 +++ new/accountsservice-0.6.43/src/accounts-user-generated.h 2016-09-20 18:22:58.000000000 +0200 @@ -1,5 +1,5 @@ /* - * Generated by gdbus-codegen 2.48.1. DO NOT EDIT. + * Generated by gdbus-codegen 2.49.6. DO NOT EDIT. * * The license of this code is the same as for the source it was derived from. */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/accountsservice-0.6.42/src/daemon.c new/accountsservice-0.6.43/src/daemon.c --- old/accountsservice-0.6.42/src/daemon.c 2015-02-25 14:51:44.000000000 +0100 +++ new/accountsservice-0.6.43/src/daemon.c 2016-09-06 21:48:50.000000000 +0200 @@ -29,6 +29,9 @@ #include <fcntl.h> #include <sys/wait.h> #include <pwd.h> +#ifdef HAVE_SHADOW_H +#include <shadow.h> +#endif #include <unistd.h> #include <errno.h> #include <sys/types.h> @@ -75,7 +78,7 @@ GHashTable *extension_ifaces; }; -typedef struct passwd * (* EntryGeneratorFunc) (GHashTable *, gpointer *); +typedef struct passwd * (* EntryGeneratorFunc) (GHashTable *, gpointer *, struct spwd **shadow_entry); static void daemon_accounts_accounts_iface_init (AccountsAccountsIface *iface); @@ -132,38 +135,107 @@ #include "fgetpwent.c" #endif +#ifndef MAX_LOCAL_USERS +#define MAX_LOCAL_USERS 50 +#endif + static struct passwd * -entry_generator_fgetpwent (GHashTable *users, - gpointer *state) +entry_generator_fgetpwent (GHashTable *users, + gpointer *state, + struct spwd **spent) { struct passwd *pwent; - FILE *fp; + + struct { + struct spwd spbuf; + char buf[1024]; + } *shadow_entry_buffers; + + struct { + FILE *fp; + GHashTable *users; + } *generator_state; /* First iteration */ if (*state == NULL) { - *state = fp = fopen (PATH_PASSWD, "r"); + GHashTable *shadow_users = NULL; + FILE *fp; + struct spwd *shadow_entry; + + fp = fopen (PATH_SHADOW, "r"); if (fp == NULL) { + g_warning ("Unable to open %s: %s", PATH_SHADOW, g_strerror (errno)); + return NULL; + } + + shadow_users = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); + + do { + int ret = 0; + + shadow_entry_buffers = g_malloc0 (sizeof (*shadow_entry_buffers)); + + ret = fgetspent_r (fp, &shadow_entry_buffers->spbuf, shadow_entry_buffers->buf, sizeof (shadow_entry_buffers->buf), &shadow_entry); + if (ret == 0) { + g_hash_table_insert (shadow_users, g_strdup (shadow_entry->sp_namp), shadow_entry_buffers); + } else { + g_free (shadow_entry_buffers); + + if (errno != EINTR) { + break; + } + } + } while (shadow_entry != NULL); + + fclose (fp); + + if (g_hash_table_size (shadow_users) == 0) { + g_clear_pointer (&shadow_users, g_hash_table_unref); + return NULL; + } + + fp = fopen (PATH_PASSWD, "r"); + if (fp == NULL) { + g_clear_pointer (&shadow_users, g_hash_table_unref); g_warning ("Unable to open %s: %s", PATH_PASSWD, g_strerror (errno)); return NULL; } + + generator_state = g_malloc0 (sizeof (*generator_state)); + generator_state->fp = fp; + generator_state->users = shadow_users; + + *state = generator_state; } /* Every iteration */ - fp = *state; - pwent = fgetpwent (fp); - if (pwent != NULL) { - return pwent; + generator_state = *state; + + if (g_hash_table_size (users) < MAX_LOCAL_USERS) { + pwent = fgetpwent (generator_state->fp); + if (pwent != NULL) { + 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; + } + } } /* Last iteration */ - fclose (fp); + fclose (generator_state->fp); + g_hash_table_unref (generator_state->users); + g_free (generator_state); *state = NULL; + return NULL; } static struct passwd * -entry_generator_cachedir (GHashTable *users, - gpointer *state) +entry_generator_cachedir (GHashTable *users, + gpointer *state, + struct spwd **shadow_entry) { struct passwd *pwent; const gchar *name; @@ -205,10 +277,13 @@ if (regular) { pwent = getpwnam (name); - if (pwent == NULL) + if (pwent == NULL) { g_debug ("user '%s' in cache dir but not present on system", name); - else + } else { + *shadow_entry = getspnam (pwent->pw_name); + return pwent; + } } } @@ -237,17 +312,19 @@ { gpointer generator_state = NULL; struct passwd *pwent; + struct spwd *spent = NULL; User *user = NULL; g_assert (entry_generator != NULL); for (;;) { - pwent = entry_generator (users, &generator_state); + spent = NULL; + pwent = entry_generator (users, &generator_state, &spent); if (pwent == NULL) break; /* Skip system users... */ - if (!user_classify_is_human (pwent->pw_uid, pwent->pw_name, pwent->pw_shell, NULL)) { + if (!user_classify_is_human (pwent->pw_uid, pwent->pw_name, pwent->pw_shell, spent? spent->sp_pwdp : NULL)) { g_debug ("skipping user: %s", pwent->pw_name); continue; } @@ -266,7 +343,7 @@ /* freeze & update users not already in the new list */ g_object_freeze_notify (G_OBJECT (user)); - user_update_from_pwent (user, pwent); + user_update_from_pwent (user, pwent, spent); g_hash_table_insert (users, g_strdup (user_get_user_name (user)), user); g_debug ("loaded user: %s", user_get_user_name (user)); @@ -312,9 +389,10 @@ g_hash_table_add (local, name); /* Now add/update users from other sources, possibly non-local */ - load_entries (daemon, users, wtmp_helper_entry_generator); load_entries (daemon, users, entry_generator_cachedir); + wtmp_helper_update_login_frequencies (users); + /* Mark which users are local, which are not */ g_hash_table_iter_init (&iter, users); while (g_hash_table_iter_next (&iter, &name, (gpointer *)&user)) @@ -638,12 +716,13 @@ static User * add_new_user_for_pwent (Daemon *daemon, - struct passwd *pwent) + struct passwd *pwent, + struct spwd *spent) { User *user; user = user_new (daemon, pwent->pw_uid); - user_update_from_pwent (user, pwent); + user_update_from_pwent (user, pwent, spent); user_register (user); g_hash_table_insert (daemon->priv->users, @@ -670,8 +749,11 @@ user = g_hash_table_lookup (daemon->priv->users, pwent->pw_name); - if (user == NULL) - user = add_new_user_for_pwent (daemon, pwent); + if (user == NULL) { + struct spwd *spent; + spent = getspnam (pwent->pw_name); + user = add_new_user_for_pwent (daemon, pwent, spent); + } return user; } @@ -691,8 +773,11 @@ user = g_hash_table_lookup (daemon->priv->users, pwent->pw_name); - if (user == NULL) - user = add_new_user_for_pwent (daemon, pwent); + if (user == NULL) { + struct spwd *spent; + spent = getspnam (pwent->pw_name); + user = add_new_user_for_pwent (daemon, pwent, spent); + } return user; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/accountsservice-0.6.42/src/libaccountsservice/accountsservice.pc new/accountsservice-0.6.43/src/libaccountsservice/accountsservice.pc --- old/accountsservice-0.6.42/src/libaccountsservice/accountsservice.pc 2016-06-09 16:17:31.000000000 +0200 +++ new/accountsservice-0.6.43/src/libaccountsservice/accountsservice.pc 2016-09-20 18:22:47.000000000 +0200 @@ -5,6 +5,6 @@ Name: Accounts Service Description: Client Library for communicating with accounts service -Version: 0.6.42 +Version: 0.6.43 Libs: -L${libdir} -laccountsservice Cflags: -I${includedir}/accountsservice-1.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/accountsservice-0.6.42/src/libaccountsservice/ck-manager-generated.c new/accountsservice-0.6.43/src/libaccountsservice/ck-manager-generated.c --- old/accountsservice-0.6.42/src/libaccountsservice/ck-manager-generated.c 2016-06-09 16:17:39.000000000 +0200 +++ new/accountsservice-0.6.43/src/libaccountsservice/ck-manager-generated.c 2016-09-20 18:22:58.000000000 +0200 @@ -1,5 +1,5 @@ /* - * Generated by gdbus-codegen 2.48.1. DO NOT EDIT. + * Generated by gdbus-codegen 2.49.6. DO NOT EDIT. * * The license of this code is the same as for the source it was derived from. */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/accountsservice-0.6.42/src/libaccountsservice/ck-manager-generated.h new/accountsservice-0.6.43/src/libaccountsservice/ck-manager-generated.h --- old/accountsservice-0.6.42/src/libaccountsservice/ck-manager-generated.h 2016-06-09 16:17:39.000000000 +0200 +++ new/accountsservice-0.6.43/src/libaccountsservice/ck-manager-generated.h 2016-09-20 18:22:58.000000000 +0200 @@ -1,5 +1,5 @@ /* - * Generated by gdbus-codegen 2.48.1. DO NOT EDIT. + * Generated by gdbus-codegen 2.49.6. DO NOT EDIT. * * The license of this code is the same as for the source it was derived from. */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/accountsservice-0.6.42/src/libaccountsservice/ck-seat-generated.c new/accountsservice-0.6.43/src/libaccountsservice/ck-seat-generated.c --- old/accountsservice-0.6.42/src/libaccountsservice/ck-seat-generated.c 2016-06-09 16:17:39.000000000 +0200 +++ new/accountsservice-0.6.43/src/libaccountsservice/ck-seat-generated.c 2016-09-20 18:22:58.000000000 +0200 @@ -1,5 +1,5 @@ /* - * Generated by gdbus-codegen 2.48.1. DO NOT EDIT. + * Generated by gdbus-codegen 2.49.6. DO NOT EDIT. * * The license of this code is the same as for the source it was derived from. */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/accountsservice-0.6.42/src/libaccountsservice/ck-seat-generated.h new/accountsservice-0.6.43/src/libaccountsservice/ck-seat-generated.h --- old/accountsservice-0.6.42/src/libaccountsservice/ck-seat-generated.h 2016-06-09 16:17:39.000000000 +0200 +++ new/accountsservice-0.6.43/src/libaccountsservice/ck-seat-generated.h 2016-09-20 18:22:58.000000000 +0200 @@ -1,5 +1,5 @@ /* - * Generated by gdbus-codegen 2.48.1. DO NOT EDIT. + * Generated by gdbus-codegen 2.49.6. DO NOT EDIT. * * The license of this code is the same as for the source it was derived from. */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/accountsservice-0.6.42/src/libaccountsservice/ck-session-generated.c new/accountsservice-0.6.43/src/libaccountsservice/ck-session-generated.c --- old/accountsservice-0.6.42/src/libaccountsservice/ck-session-generated.c 2016-06-09 16:17:39.000000000 +0200 +++ new/accountsservice-0.6.43/src/libaccountsservice/ck-session-generated.c 2016-09-20 18:22:58.000000000 +0200 @@ -1,5 +1,5 @@ /* - * Generated by gdbus-codegen 2.48.1. DO NOT EDIT. + * Generated by gdbus-codegen 2.49.6. DO NOT EDIT. * * The license of this code is the same as for the source it was derived from. */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/accountsservice-0.6.42/src/libaccountsservice/ck-session-generated.h new/accountsservice-0.6.43/src/libaccountsservice/ck-session-generated.h --- old/accountsservice-0.6.42/src/libaccountsservice/ck-session-generated.h 2016-06-09 16:17:39.000000000 +0200 +++ new/accountsservice-0.6.43/src/libaccountsservice/ck-session-generated.h 2016-09-20 18:22:58.000000000 +0200 @@ -1,5 +1,5 @@ /* - * Generated by gdbus-codegen 2.48.1. DO NOT EDIT. + * Generated by gdbus-codegen 2.49.6. DO NOT EDIT. * * The license of this code is the same as for the source it was derived from. */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/accountsservice-0.6.42/src/main.c new/accountsservice-0.6.43/src/main.c --- old/accountsservice-0.6.42/src/main.c 2013-10-15 22:25:19.000000000 +0200 +++ new/accountsservice-0.6.43/src/main.c 2016-09-06 19:31:50.000000000 +0200 @@ -121,6 +121,8 @@ message ? message : "(NULL) message"); ret = write (1, string->str, string->len); + + g_string_free (string, TRUE); } static void diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/accountsservice-0.6.42/src/user-classify.c new/accountsservice-0.6.43/src/user-classify.c --- old/accountsservice-0.6.42/src/user-classify.c 2014-03-20 19:16:56.000000000 +0100 +++ new/accountsservice-0.6.43/src/user-classify.c 2016-09-06 21:49:14.000000000 +0200 @@ -25,6 +25,7 @@ #include "user-classify.h" #include <string.h> +#include <unistd.h> static const char *default_excludes[] = { "bin", @@ -84,44 +85,10 @@ #ifdef ENABLE_USER_HEURISTICS static gboolean user_classify_is_excluded_by_heuristics (const gchar *username, - const gchar *shell, const gchar *password_hash) { gboolean ret = FALSE; - if (shell != NULL) { - char *basename, *nologin_basename, *false_basename; - -#ifdef HAVE_GETUSERSHELL - char *valid_shell; - - ret = TRUE; - setusershell (); - while ((valid_shell = getusershell ()) != NULL) { - if (g_strcmp0 (shell, valid_shell) != 0) - continue; - ret = FALSE; - } - endusershell (); -#endif - - basename = g_path_get_basename (shell); - nologin_basename = g_path_get_basename (PATH_NOLOGIN); - false_basename = g_path_get_basename (PATH_FALSE); - - if (shell[0] == '\0') { - ret = TRUE; - } else if (g_strcmp0 (basename, nologin_basename) == 0) { - ret = TRUE; - } else if (g_strcmp0 (basename, false_basename) == 0) { - ret = TRUE; - } - - g_free (basename); - g_free (nologin_basename); - g_free (false_basename); - } - if (password_hash != NULL) { /* skip over the account-is-locked '!' prefix if present */ if (password_hash[0] == '!') @@ -148,6 +115,43 @@ } #endif /* ENABLE_USER_HEURISTICS */ +static gboolean +is_invalid_shell (const char *shell) +{ + char *basename, *nologin_basename, *false_basename; + int ret = FALSE; + +#ifdef HAVE_GETUSERSHELL + char *valid_shell; + + setusershell (); + while ((valid_shell = getusershell ()) != NULL) { + if (g_strcmp0 (shell, valid_shell) != 0) + continue; + ret = FALSE; + } + endusershell (); +#endif + + basename = g_path_get_basename (shell); + nologin_basename = g_path_get_basename (PATH_NOLOGIN); + false_basename = g_path_get_basename (PATH_FALSE); + + if (shell[0] == '\0') { + ret = TRUE; + } else if (g_strcmp0 (basename, nologin_basename) == 0) { + ret = TRUE; + } else if (g_strcmp0 (basename, false_basename) == 0) { + ret = TRUE; + } + + g_free (basename); + g_free (nologin_basename); + g_free (false_basename); + + return ret; +} + gboolean user_classify_is_human (uid_t uid, const gchar *username, @@ -157,10 +161,13 @@ if (user_classify_is_blacklisted (username)) return FALSE; + if (shell != NULL && is_invalid_shell (shell)) + return FALSE; + #ifdef ENABLE_USER_HEURISTICS /* only do heuristics on the range 500-1000 to catch one off migration problems in Fedora */ if (uid >= 500 && uid < MINIMUM_UID) { - if (!user_classify_is_excluded_by_heuristics (username, shell, password_hash)) + if (!user_classify_is_excluded_by_heuristics (username, password_hash)) return TRUE; } #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/accountsservice-0.6.42/src/user.c new/accountsservice-0.6.43/src/user.c --- old/accountsservice-0.6.42/src/user.c 2016-01-11 16:42:31.000000000 +0100 +++ new/accountsservice-0.6.43/src/user.c 2016-09-06 21:48:50.000000000 +0200 @@ -122,9 +122,6 @@ account_type_from_pwent (struct passwd *pwent) { struct group *grp; - gid_t wheel; - gid_t *groups; - gint ngroups; gint i; if (pwent->pw_uid == 0) { @@ -137,29 +134,21 @@ g_debug (ADMIN_GROUP " group not found"); 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); + for (i = 0; grp->gr_mem[i] != NULL; i++) { + if (g_strcmp0 (grp->gr_mem[i], pwent->pw_name) == 0) { return ACCOUNT_TYPE_ADMINISTRATOR; } } - g_free (groups); - return ACCOUNT_TYPE_STANDARD; } void user_update_from_pwent (User *user, - struct passwd *pwent) + struct passwd *pwent, + struct spwd *spent) { -#ifdef HAVE_SHADOW_H - struct spwd *spent; -#endif gchar *real_name; gboolean changed; const gchar *passwd; @@ -258,11 +247,8 @@ } passwd = NULL; -#ifdef HAVE_SHADOW_H - spent = getspnam (pwent->pw_name); if (spent) passwd = spent->sp_pwdp; -#endif if (passwd && passwd[0] == '!') { locked = TRUE; @@ -284,13 +270,11 @@ mode = PASSWORD_MODE_NONE; } -#ifdef HAVE_SHADOW_H if (spent) { if (spent->sp_lstchg == 0) { mode = PASSWORD_MODE_SET_AT_LOGIN; } } -#endif if (user->password_mode != mode) { user->password_mode = mode; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/accountsservice-0.6.42/src/user.h new/accountsservice-0.6.43/src/user.h --- old/accountsservice-0.6.42/src/user.h 2013-10-15 22:25:19.000000000 +0200 +++ new/accountsservice-0.6.43/src/user.h 2016-09-06 19:31:50.000000000 +0200 @@ -22,6 +22,7 @@ #include <sys/types.h> #include <pwd.h> +#include <shadow.h> #include <glib.h> #include <gio/gio.h> @@ -54,7 +55,8 @@ uid_t uid); void user_update_from_pwent (User *user, - struct passwd *pwent); + struct passwd *pwent, + struct spwd *spent); void user_update_from_keyfile (User *user, GKeyFile *keyfile); void user_update_local_account_property (User *user, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/accountsservice-0.6.42/src/wtmp-helper.c new/accountsservice-0.6.43/src/wtmp-helper.c --- old/accountsservice-0.6.42/src/wtmp-helper.c 2016-01-27 19:38:21.000000000 +0100 +++ new/accountsservice-0.6.43/src/wtmp-helper.c 2016-09-06 21:48:50.000000000 +0200 @@ -41,11 +41,6 @@ gint64 logout_time; } UserPreviousLogin; -typedef struct { - GHashTable *login_hash; - GHashTable *logout_hash; -} WTmpGeneratorState; - static void user_previous_login_free (UserPreviousLogin *previous_login) { @@ -73,9 +68,8 @@ return TRUE; } -struct passwd * -wtmp_helper_entry_generator (GHashTable *users, - gpointer *state) +void +wtmp_helper_update_login_frequencies (GHashTable *users) { GHashTable *login_hash, *logout_hash; struct utmpx *wtmp_entry; @@ -83,33 +77,30 @@ gpointer key, value; struct passwd *pwent; User *user; - WTmpGeneratorState *state_data; GVariantBuilder *builder, *builder2; GList *l; - if (*state == NULL) { - /* First iteration */ - - if (!wtmp_helper_start ()) { - return NULL; - } - - *state = g_new (WTmpGeneratorState, 1); - state_data = *state; - state_data->login_hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); - state_data->logout_hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); + if (!wtmp_helper_start ()) { + return; } - /* Every iteration */ - state_data = *state; - login_hash = state_data->login_hash; - logout_hash = state_data->logout_hash; + login_hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); + logout_hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); + while ((wtmp_entry = getutxent ())) { UserAccounting *accounting; UserPreviousLogin *previous_login; + gboolean shutdown_or_reboot = FALSE; + + if (g_str_equal (wtmp_entry->ut_line, "~")) { + if (g_str_equal (wtmp_entry->ut_user, "shutdown") || + g_str_equal (wtmp_entry->ut_user, "reboot")) { + shutdown_or_reboot = TRUE; + } + } - if (wtmp_entry->ut_type == BOOT_TIME) { - /* Set boot time for missing logout records */ + if (wtmp_entry->ut_type == BOOT_TIME || shutdown_or_reboot) { + /* Set shutdown, reboot, or boot time for missing logout records */ g_hash_table_iter_init (&iter, logout_hash); while (g_hash_table_iter_next (&iter, &key, &value)) { previous_login = (UserPreviousLogin *) value; @@ -165,8 +156,6 @@ accounting->previous_logins = g_list_prepend (accounting->previous_logins, previous_login); g_hash_table_insert (logout_hash, g_strdup (wtmp_entry->ut_line), previous_login); - - return pwent; } /* Last iteration */ @@ -204,9 +193,6 @@ g_hash_table_unref (login_hash); g_hash_table_unref (logout_hash); - g_free (state_data); - *state = NULL; - return NULL; } const gchar * @@ -217,13 +203,6 @@ #else /* HAVE_UTMPX_H */ -struct passwd * -wtmp_helper_entry_generator (GHashTable *users, - gpointer *state) -{ - return NULL; -} - const gchar * wtmp_helper_get_path_for_monitor (void) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/accountsservice-0.6.42/src/wtmp-helper.h new/accountsservice-0.6.43/src/wtmp-helper.h --- old/accountsservice-0.6.42/src/wtmp-helper.h 2014-03-20 19:16:56.000000000 +0100 +++ new/accountsservice-0.6.43/src/wtmp-helper.h 2016-09-06 21:48:50.000000000 +0200 @@ -23,9 +23,9 @@ #include <glib.h> #include <pwd.h> +#include <shadow.h> const gchar * wtmp_helper_get_path_for_monitor (void); -struct passwd * wtmp_helper_entry_generator (GHashTable *users, - gpointer *state); +void wtmp_helper_update_login_frequencies (GHashTable *users); #endif /* __WTMP_HELPER_H__ */
