diff -Nru accountsservice-0.6.45/aclocal.m4 accountsservice-0.6.50/aclocal.m4 --- accountsservice-0.6.45/aclocal.m4 2017-03-27 20:32:57.000000000 +0200 +++ accountsservice-0.6.50/aclocal.m4 2018-07-10 17:25:04.000000000 +0200 @@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.15 -*- Autoconf -*- +# generated automatically by aclocal 1.15.1 -*- Autoconf -*- -# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# Copyright (C) 1996-2017 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -47,7 +47,10 @@ # # Modified to require ngettext # Matthias Clasen 08/06/2004 -# + +# Increment this whenever this file is changed. +#serial 1 + # We need this here as well, since someone might use autoconf-2.5x # to configure GLib then an older version to configure a package # using AM_GLIB_GNU_GETTEXT @@ -119,6 +122,51 @@ AC_SUBST($1)dnl ]) +dnl Checks for special options needed on Mac OS X. +dnl Defines INTL_MACOSX_LIBS. +dnl +dnl Copied from intlmacosx.m4 in gettext, GPL. +dnl Copyright (C) 2004-2013 Free Software Foundation, Inc. +glib_DEFUN([glib_gt_INTL_MACOSX], +[ + dnl Check for API introduced in Mac OS X 10.2. + AC_CACHE_CHECK([for CFPreferencesCopyAppValue], + [gt_cv_func_CFPreferencesCopyAppValue], + [gt_save_LIBS="$LIBS" + LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include ]], + [[CFPreferencesCopyAppValue(NULL, NULL)]])], + [gt_cv_func_CFPreferencesCopyAppValue=yes], + [gt_cv_func_CFPreferencesCopyAppValue=no]) + LIBS="$gt_save_LIBS"]) + if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then + AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], [1], + [Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in the CoreFoundation framework.]) + fi + dnl Check for API introduced in Mac OS X 10.3. + AC_CACHE_CHECK([for CFLocaleCopyCurrent], [gt_cv_func_CFLocaleCopyCurrent], + [gt_save_LIBS="$LIBS" + LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include ]], + [[CFLocaleCopyCurrent();]])], + [gt_cv_func_CFLocaleCopyCurrent=yes], + [gt_cv_func_CFLocaleCopyCurrent=no]) + LIBS="$gt_save_LIBS"]) + if test $gt_cv_func_CFLocaleCopyCurrent = yes; then + AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], [1], + [Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the CoreFoundation framework.]) + fi + INTL_MACOSX_LIBS= + if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then + INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation" + fi + AC_SUBST([INTL_MACOSX_LIBS]) +]) + # GLIB_WITH_NLS #----------------- glib_DEFUN([GLIB_WITH_NLS], @@ -132,6 +180,8 @@ XGETTEXT=: INTLLIBS= + glib_gt_INTL_MACOSX + AC_CHECK_HEADER(libintl.h, [gt_cv_func_dgettext_libintl="no" libintl_extra_libs="" @@ -215,7 +265,7 @@ fi if test "$gt_cv_func_dgettext_libintl" = "yes"; then - INTLLIBS="-lintl $libintl_extra_libs" + INTLLIBS="-lintl $libintl_extra_libs $INTL_MACOSX_LIBS" fi if test "$gt_cv_have_gettext" = "yes"; then @@ -457,7 +507,32 @@ fi]) -dnl -*- mode: autoconf -*- +# -*- mode: autoconf -*- +# +# gtk-doc.m4 - configure macro to check for gtk-doc +# Copyright (C) 2003 James Henstridge +# 2007-2017 Stefan Sauer +# +# 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 License, 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, see . +# +# As a special exception, the above copyright owner gives unlimited +# permission to copy, distribute and modify the configure scripts that +# are the output of Autoconf when processing the Macro. You need not +# follow the terms of the GNU General Public License when using or +# distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. # serial 2 @@ -866,32 +941,63 @@ AC_SUBST([USE_NLS]) ]) -# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- -# serial 1 (pkg-config-0.24) -# -# Copyright © 2004 Scott James Remnant . -# -# 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 2 of the License, 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. +# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- +# serial 11 (pkg-config-0.29.1) -# PKG_PROG_PKG_CONFIG([MIN-VERSION]) -# ---------------------------------- +dnl Copyright © 2004 Scott James Remnant . +dnl Copyright © 2012-2015 Dan Nicholson +dnl +dnl This program is free software; you can redistribute it and/or modify +dnl it under the terms of the GNU General Public License as published by +dnl the Free Software Foundation; either version 2 of the License, or +dnl (at your option) any later version. +dnl +dnl This program is distributed in the hope that it will be useful, but +dnl WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +dnl General Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License +dnl along with this program; if not, write to the Free Software +dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +dnl 02111-1307, USA. +dnl +dnl As a special exception to the GNU General Public License, if you +dnl distribute this file as part of a program that contains a +dnl configuration script generated by Autoconf, you may include it under +dnl the same distribution terms that you use for the rest of that +dnl program. + +dnl PKG_PREREQ(MIN-VERSION) +dnl ----------------------- +dnl Since: 0.29 +dnl +dnl Verify that the version of the pkg-config macros are at least +dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's +dnl installed version of pkg-config, this checks the developer's version +dnl of pkg.m4 when generating configure. +dnl +dnl To ensure that this macro is defined, also add: +dnl m4_ifndef([PKG_PREREQ], +dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])]) +dnl +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_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 + +dnl PKG_PROG_PKG_CONFIG([MIN-VERSION]) +dnl ---------------------------------- +dnl Since: 0.16 +dnl +dnl Search for the pkg-config tool and set the PKG_CONFIG variable to +dnl first found in the path. Checks that the version of pkg-config found +dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is +dnl used since that's the first version where most current features of +dnl pkg-config existed. AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) @@ -913,18 +1019,19 @@ PKG_CONFIG="" fi fi[]dnl -])# PKG_PROG_PKG_CONFIG +])dnl PKG_PROG_PKG_CONFIG -# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) -# -# Check to see whether a particular set of modules exists. Similar -# to PKG_CHECK_MODULES(), but does not set variables or print errors. -# -# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) -# only at the first occurence in configure.ac, so if the first place -# it's called might be skipped (such as if it is within an "if", you -# have to call PKG_CHECK_EXISTS manually -# -------------------------------------------------------------- +dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +dnl ------------------------------------------------------------------- +dnl Since: 0.18 +dnl +dnl Check to see whether a particular set of modules exists. Similar to +dnl PKG_CHECK_MODULES(), but does not set variables or print errors. +dnl +dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +dnl only at the first occurence in configure.ac, so if the first place +dnl it's called might be skipped (such as if it is within an "if", you +dnl have to call PKG_CHECK_EXISTS manually AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ @@ -934,8 +1041,10 @@ $3])dnl fi]) -# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) -# --------------------------------------------- +dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) +dnl --------------------------------------------- +dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting +dnl pkg_failed based on the result. m4_define([_PKG_CONFIG], [if test -n "$$1"; then pkg_cv_[]$1="$$1" @@ -947,10 +1056,11 @@ else pkg_failed=untried fi[]dnl -])# _PKG_CONFIG +])dnl _PKG_CONFIG -# _PKG_SHORT_ERRORS_SUPPORTED -# ----------------------------- +dnl _PKG_SHORT_ERRORS_SUPPORTED +dnl --------------------------- +dnl Internal check to see if pkg-config supports short errors. AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then @@ -958,19 +1068,17 @@ else _pkg_short_errors_supported=no fi[]dnl -])# _PKG_SHORT_ERRORS_SUPPORTED +])dnl _PKG_SHORT_ERRORS_SUPPORTED -# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], -# [ACTION-IF-NOT-FOUND]) -# -# -# Note that if there is a possibility the first call to -# PKG_CHECK_MODULES might not happen, you should be sure to include an -# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac -# -# -# -------------------------------------------------------------- +dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], +dnl [ACTION-IF-NOT-FOUND]) +dnl -------------------------------------------------------------- +dnl Since: 0.4.0 +dnl +dnl Note that if there is a possibility the first call to +dnl PKG_CHECK_MODULES might not happen, you should be sure to include an +dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl @@ -1024,15 +1132,40 @@ AC_MSG_RESULT([yes]) $3 fi[]dnl -])# PKG_CHECK_MODULES +])dnl PKG_CHECK_MODULES + + +dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], +dnl [ACTION-IF-NOT-FOUND]) +dnl --------------------------------------------------------------------- +dnl Since: 0.29 +dnl +dnl Checks for existence of MODULES and gathers its build flags with +dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags +dnl and VARIABLE-PREFIX_LIBS from --libs. +dnl +dnl Note that if there is a possibility the first call to +dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to +dnl include an explicit call to PKG_PROG_PKG_CONFIG in your +dnl configure.ac. +AC_DEFUN([PKG_CHECK_MODULES_STATIC], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +_save_PKG_CONFIG=$PKG_CONFIG +PKG_CONFIG="$PKG_CONFIG --static" +PKG_CHECK_MODULES($@) +PKG_CONFIG=$_save_PKG_CONFIG[]dnl +])dnl PKG_CHECK_MODULES_STATIC + -# PKG_INSTALLDIR(DIRECTORY) -# ------------------------- -# Substitutes the variable pkgconfigdir as the location where a module -# should install pkg-config .pc files. By default the directory is -# $libdir/pkgconfig, but the default can be changed by passing -# DIRECTORY. The user can override through the --with-pkgconfigdir -# parameter. +dnl PKG_INSTALLDIR([DIRECTORY]) +dnl ------------------------- +dnl Since: 0.27 +dnl +dnl Substitutes the variable pkgconfigdir as the location where a module +dnl should install pkg-config .pc files. By default the directory is +dnl $libdir/pkgconfig, but the default can be changed by passing +dnl DIRECTORY. The user can override through the --with-pkgconfigdir +dnl parameter. AC_DEFUN([PKG_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) m4_pushdef([pkg_description], @@ -1043,16 +1176,18 @@ AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) -]) dnl PKG_INSTALLDIR +])dnl PKG_INSTALLDIR -# PKG_NOARCH_INSTALLDIR(DIRECTORY) -# ------------------------- -# Substitutes the variable noarch_pkgconfigdir as the location where a -# module should install arch-independent pkg-config .pc files. By -# default the directory is $datadir/pkgconfig, but the default can be -# changed by passing DIRECTORY. The user can override through the -# --with-noarch-pkgconfigdir parameter. +dnl PKG_NOARCH_INSTALLDIR([DIRECTORY]) +dnl -------------------------------- +dnl Since: 0.27 +dnl +dnl Substitutes the variable noarch_pkgconfigdir as the location where a +dnl module should install arch-independent pkg-config .pc files. By +dnl default the directory is $datadir/pkgconfig, but the default can be +dnl changed by passing DIRECTORY. The user can override through the +dnl --with-noarch-pkgconfigdir parameter. AC_DEFUN([PKG_NOARCH_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) m4_pushdef([pkg_description], @@ -1063,13 +1198,15 @@ AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) -]) dnl PKG_NOARCH_INSTALLDIR +])dnl PKG_NOARCH_INSTALLDIR -# PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, -# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) -# ------------------------------------------- -# Retrieves the value of the pkg-config variable for the given module. +dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, +dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +dnl ------------------------------------------- +dnl Since: 0.28 +dnl +dnl Retrieves the value of the pkg-config variable for the given module. AC_DEFUN([PKG_CHECK_VAR], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl @@ -1078,17 +1215,16 @@ AS_VAR_COPY([$1], [pkg_cv_][$1]) AS_VAR_IF([$1], [""], [$5], [$4])dnl -])# PKG_CHECK_VAR +])dnl PKG_CHECK_VAR -# PKG_WITH_MODULES(VARIABLE-PREFIX, MODULES, -# [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND], -# [DESCRIPTION], [DEFAULT]) -# -# Prepare a "--with-" configure option using the lowercase [VARIABLE-PREFIX] -# name, merging the behaviour of AC_ARG_WITH and PKG_CHECK_MODULES in a single -# macro -# -# -------------------------------------------------------------- +dnl PKG_WITH_MODULES(VARIABLE-PREFIX, MODULES, +dnl [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND], +dnl [DESCRIPTION], [DEFAULT]) +dnl ------------------------------------------ +dnl +dnl Prepare a "--with-" configure option using the lowercase +dnl [VARIABLE-PREFIX] name, merging the behaviour of AC_ARG_WITH and +dnl PKG_CHECK_MODULES in a single macro. AC_DEFUN([PKG_WITH_MODULES], [ m4_pushdef([with_arg], m4_tolower([$1])) @@ -1118,43 +1254,38 @@ m4_popdef([description]) m4_popdef([def_arg]) -]) dnl PKG_WITH_MODULES +])dnl PKG_WITH_MODULES -# PKG_HAVE_WITH_MODULES(VARIABLE-PREFIX, MODULES, -# [DESCRIPTION], [DEFAULT]) -# -# Convenience macro to trigger AM_CONDITIONAL after -# PKG_WITH_MODULES check. -# -# HAVE_[VARIABLE-PREFIX] is exported as make variable. -# -# -------------------------------------------------------------- +dnl PKG_HAVE_WITH_MODULES(VARIABLE-PREFIX, MODULES, +dnl [DESCRIPTION], [DEFAULT]) +dnl ----------------------------------------------- +dnl +dnl Convenience macro to trigger AM_CONDITIONAL after PKG_WITH_MODULES +dnl check._[VARIABLE-PREFIX] is exported as make variable. AC_DEFUN([PKG_HAVE_WITH_MODULES], [ PKG_WITH_MODULES([$1],[$2],,,[$3],[$4]) AM_CONDITIONAL([HAVE_][$1], [test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"]) -]) +])dnl PKG_HAVE_WITH_MODULES -# PKG_HAVE_DEFINE_WITH_MODULES(VARIABLE-PREFIX, MODULES, -# [DESCRIPTION], [DEFAULT]) -# -# Convenience macro to run AM_CONDITIONAL and AC_DEFINE after -# PKG_WITH_MODULES check. -# -# HAVE_[VARIABLE-PREFIX] is exported as make and preprocessor variable. -# -# -------------------------------------------------------------- +dnl PKG_HAVE_DEFINE_WITH_MODULES(VARIABLE-PREFIX, MODULES, +dnl [DESCRIPTION], [DEFAULT]) +dnl ------------------------------------------------------ +dnl +dnl Convenience macro to run AM_CONDITIONAL and AC_DEFINE after +dnl PKG_WITH_MODULES check. HAVE_[VARIABLE-PREFIX] is exported as make +dnl and preprocessor variable. AC_DEFUN([PKG_HAVE_DEFINE_WITH_MODULES], [ PKG_HAVE_WITH_MODULES([$1],[$2],[$3],[$4]) AS_IF([test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"], [AC_DEFINE([HAVE_][$1], 1, [Enable ]m4_tolower([$1])[ support])]) -]) +])dnl PKG_HAVE_DEFINE_WITH_MODULES -# Copyright (C) 2002-2014 Free Software Foundation, Inc. +# Copyright (C) 2002-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1169,7 +1300,7 @@ [am__api_version='1.15' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.15], [], +m4_if([$1], [1.15.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -1185,14 +1316,14 @@ # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.15])dnl +[AM_AUTOMAKE_VERSION([1.15.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# Copyright (C) 2001-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1244,7 +1375,7 @@ # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997-2014 Free Software Foundation, Inc. +# Copyright (C) 1997-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1275,7 +1406,7 @@ Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# Copyright (C) 1999-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1466,7 +1597,7 @@ # Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# Copyright (C) 1999-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1542,7 +1673,7 @@ # Do all the work for Automake. -*- Autoconf -*- -# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# Copyright (C) 1996-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1739,7 +1870,7 @@ done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# Copyright (C) 2001-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1760,7 +1891,7 @@ fi AC_SUBST([install_sh])]) -# Copyright (C) 2003-2014 Free Software Foundation, Inc. +# Copyright (C) 2003-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1782,7 +1913,7 @@ # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering -# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# Copyright (C) 1996-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1817,7 +1948,7 @@ # Check to see how 'make' treats includes. -*- Autoconf -*- -# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# Copyright (C) 2001-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1867,7 +1998,7 @@ # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997-2014 Free Software Foundation, Inc. +# Copyright (C) 1997-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1906,7 +2037,7 @@ # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# Copyright (C) 2001-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1935,7 +2066,7 @@ AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) -# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# Copyright (C) 1999-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1982,7 +2113,7 @@ # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) -# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# Copyright (C) 2001-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -2001,7 +2132,7 @@ # Check to make sure that the build environment is sane. -*- Autoconf -*- -# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# Copyright (C) 1996-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -2082,7 +2213,7 @@ rm -f conftest.file ]) -# Copyright (C) 2009-2014 Free Software Foundation, Inc. +# Copyright (C) 2009-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -2142,7 +2273,7 @@ _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) -# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# Copyright (C) 2001-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -2170,7 +2301,7 @@ INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006-2014 Free Software Foundation, Inc. +# Copyright (C) 2006-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -2189,7 +2320,7 @@ # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004-2014 Free Software Foundation, Inc. +# Copyright (C) 2004-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, diff -Nru accountsservice-0.6.45/AUTHORS accountsservice-0.6.50/AUTHORS --- accountsservice-0.6.45/AUTHORS 2012-12-19 15:42:47.000000000 +0100 +++ accountsservice-0.6.50/AUTHORS 2018-04-04 15:59:42.000000000 +0200 @@ -1 +1,2 @@ Matthias Clasen +Ray Strode diff -Nru accountsservice-0.6.45/compile accountsservice-0.6.50/compile --- accountsservice-0.6.45/compile 2017-02-10 07:47:11.000000000 +0100 +++ accountsservice-0.6.50/compile 2018-02-09 09:27:34.000000000 +0100 @@ -1,9 +1,9 @@ -#! /bin/sh +#!/bin/sh # Wrapper for compilers which do not understand '-c -o'. -scriptversion=2012-10-14.11; # UTC +scriptversion=2016-01-11.22; # UTC -# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# Copyright (C) 1999-2017 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify @@ -255,7 +255,8 @@ echo "compile $scriptversion" exit $? ;; - cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) + cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ + icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac @@ -342,6 +343,6 @@ # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: diff -Nru accountsservice-0.6.45/config.guess accountsservice-0.6.50/config.guess --- accountsservice-0.6.45/config.guess 2017-02-10 07:47:11.000000000 +0100 +++ accountsservice-0.6.50/config.guess 2018-02-09 09:27:34.000000000 +0100 @@ -1,8 +1,8 @@ -#! /bin/sh +#!/bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2016 Free Software Foundation, Inc. +# Copyright 1992-2017 Free Software Foundation, Inc. -timestamp='2016-10-02' +timestamp='2017-08-08' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -50,7 +50,7 @@ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2016 Free Software Foundation, Inc. +Copyright 1992-2017 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -259,6 +259,9 @@ *:Sortix:*:*) echo ${UNAME_MACHINE}-unknown-sortix exit ;; + *:Redox:*:*) + echo ${UNAME_MACHINE}-unknown-redox + exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) @@ -837,10 +840,11 @@ UNAME_PROCESSOR=`/usr/bin/uname -p` case ${UNAME_PROCESSOR} in amd64) - echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - *) - echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + UNAME_PROCESSOR=x86_64 ;; + i386) + UNAME_PROCESSOR=i586 ;; esac + echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin @@ -1303,14 +1307,21 @@ if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi + # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc + if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_PPC >/dev/null + then + UNAME_PROCESSOR=powerpc + fi fi elif test "$UNAME_PROCESSOR" = i386 ; then # Avoid executing cc on OS X 10.9, as it ships with a stub @@ -1334,15 +1345,18 @@ *:QNX:*:4*) echo i386-pc-qnx exit ;; - NEO-?:NONSTOP_KERNEL:*:*) + NEO-*:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} exit ;; NSE-*:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; - NSR-?:NONSTOP_KERNEL:*:*) + NSR-*:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; + NSX-*:NONSTOP_KERNEL:*:*) + echo nsx-tandem-nsk${UNAME_RELEASE} + exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; @@ -1418,8 +1432,8 @@ $0: unable to guess system type This script (version $timestamp), has failed to recognize the -operating system you are using. If your script is old, overwrite -config.guess and config.sub with the latest versions from: +operating system you are using. If your script is old, overwrite *all* +copies of config.guess and config.sub with the latest versions from: http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess and diff -Nru accountsservice-0.6.45/config.h.in accountsservice-0.6.50/config.h.in --- accountsservice-0.6.45/config.h.in 2017-03-27 20:33:00.000000000 +0200 +++ accountsservice-0.6.50/config.h.in 2018-07-10 17:25:07.000000000 +0200 @@ -9,12 +9,23 @@ /* System vs. human user heuristics enabled */ #undef ENABLE_USER_HEURISTICS +/* Define to the list of extra groups administrator users are part of */ +#undef EXTRA_ADMIN_GROUPS + /* the gettext translation domain */ #undef GETTEXT_PACKAGE /* Define to 1 if you have the `bind_textdomain_codeset' function. */ #undef HAVE_BIND_TEXTDOMAIN_CODESET +/* Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the + CoreFoundation framework. */ +#undef HAVE_CFLOCALECOPYCURRENT + +/* Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in + the CoreFoundation framework. */ +#undef HAVE_CFPREFERENCESCOPYAPPVALUE + /* Define to 1 if you have the `dcgettext' function. */ #undef HAVE_DCGETTEXT @@ -113,6 +124,9 @@ /* Define to the version of this package. */ #undef PACKAGE_VERSION +/* GDM configuration file */ +#undef PATH_GDM_CUSTOM + /* Path to wtmpx file */ #undef PATH_WTMP diff -Nru accountsservice-0.6.45/config.sub accountsservice-0.6.50/config.sub --- accountsservice-0.6.45/config.sub 2017-02-10 07:47:11.000000000 +0100 +++ accountsservice-0.6.50/config.sub 2018-02-09 09:27:34.000000000 +0100 @@ -1,8 +1,8 @@ -#! /bin/sh +#!/bin/sh # Configuration validation subroutine script. -# Copyright 1992-2016 Free Software Foundation, Inc. +# Copyright 1992-2017 Free Software Foundation, Inc. -timestamp='2016-09-05' +timestamp='2017-04-02' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -67,7 +67,7 @@ version="\ GNU config.sub ($timestamp) -Copyright 1992-2016 Free Software Foundation, Inc. +Copyright 1992-2017 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -263,7 +263,7 @@ | fido | fr30 | frv | ft32 \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ - | i370 | i860 | i960 | ia64 \ + | i370 | i860 | i960 | ia16 | ia64 \ | ip2k | iq2000 \ | k1om \ | le32 | le64 \ @@ -301,6 +301,7 @@ | open8 | or1k | or1knd | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ + | pru \ | pyramid \ | riscv32 | riscv64 \ | rl78 | rx \ @@ -314,6 +315,7 @@ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | visium \ + | wasm32 \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) @@ -387,7 +389,7 @@ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ - | i*86-* | i860-* | i960-* | ia64-* \ + | i*86-* | i860-* | i960-* | ia16-* | ia64-* \ | ip2k-* | iq2000-* \ | k1om-* \ | le32-* | le64-* \ @@ -428,6 +430,7 @@ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ + | pru-* \ | pyramid-* \ | riscv32-* | riscv64-* \ | rl78-* | romp-* | rs6000-* | rx-* \ @@ -444,6 +447,7 @@ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | visium-* \ + | wasm32-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ @@ -946,6 +950,9 @@ nsr-tandem) basic_machine=nsr-tandem ;; + nsx-tandem) + basic_machine=nsx-tandem + ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf @@ -1241,6 +1248,9 @@ basic_machine=a29k-wrs os=-vxworks ;; + wasm32) + basic_machine=wasm32-unknown + ;; w65*) basic_machine=w65-wdc os=-none @@ -1395,7 +1405,7 @@ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -chorusos* | -chorusrdb* | -cegcc* \ + | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ @@ -1407,7 +1417,7 @@ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ - | -onefs* | -tirtos* | -phoenix*) + | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) @@ -1636,6 +1646,9 @@ sparc-* | *-sun) os=-sunos4.1.1 ;; + pru-*) + os=-elf + ;; *-be) os=-beos ;; diff -Nru accountsservice-0.6.45/configure accountsservice-0.6.50/configure --- accountsservice-0.6.45/configure 2017-03-27 20:32:59.000000000 +0200 +++ accountsservice-0.6.50/configure 2018-07-10 17:25:06.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.45. +# Generated by GNU Autoconf 2.69 for AccountsService 0.6.50. # # # 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.45' -PACKAGE_STRING='AccountsService 0.6.45' +PACKAGE_VERSION='0.6.50' +PACKAGE_STRING='AccountsService 0.6.50' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -635,6 +635,8 @@ HAVE_SYSTEMD_FALSE HAVE_SYSTEMD_TRUE systemdsystemunitdir +ELOGIND_LIBS +ELOGIND_CFLAGS SYSTEMD_LIBS SYSTEMD_CFLAGS XSLTPROC @@ -674,15 +676,13 @@ INTROSPECTION_GENERATE INTROSPECTION_COMPILER INTROSPECTION_SCANNER -LIBACCOUNTSSERVICE_CFLAGS -LIBACCOUNTSSERVICE_LIBS MAINT MAINTAINER_MODE_FALSE MAINTAINER_MODE_TRUE -POLKIT_LIBS -POLKIT_CFLAGS -GIO_LIBS -GIO_CFLAGS +ACCOUNTS_DAEMON_LIBS +ACCOUNTS_DAEMON_CFLAGS +LIBACCOUNTSSERVICE_LIBS +LIBACCOUNTSSERVICE_CFLAGS LT_AGE LT_REVISION LT_CURRENT @@ -760,6 +760,7 @@ GMSGFMT MSGFMT_OPTS MSGFMT +INTL_MACOSX_LIBS USE_NLS PKG_CONFIG_LIBDIR PKG_CONFIG_PATH @@ -867,6 +868,7 @@ enable_maintainer_mode enable_introspection enable_admin_group +with_extra_admin_groups enable_user_heuristics with_minimum_uid enable_coverage @@ -877,7 +879,9 @@ enable_gtk_doc_pdf enable_docbook_docs enable_systemd +enable_elogind with_systemdsystemunitdir +with_gdmconffile ' ac_precious_vars='build_alias host_alias @@ -892,16 +896,18 @@ PKG_CONFIG_PATH PKG_CONFIG_LIBDIR LT_SYS_LIBRARY_PATH -GIO_CFLAGS -GIO_LIBS -POLKIT_CFLAGS -POLKIT_LIBS +LIBACCOUNTSSERVICE_CFLAGS +LIBACCOUNTSSERVICE_LIBS +ACCOUNTS_DAEMON_CFLAGS +ACCOUNTS_DAEMON_LIBS GTKDOC_DEPS_CFLAGS GTKDOC_DEPS_LIBS XMLTO XMLTO_FLAGS SYSTEMD_CFLAGS -SYSTEMD_LIBS' +SYSTEMD_LIBS +ELOGIND_CFLAGS +ELOGIND_LIBS' # Initialize some variables set by options. @@ -1442,7 +1448,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.45 to adapt to many kinds of systems. +\`configure' configures AccountsService 0.6.50 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1512,7 +1518,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of AccountsService 0.6.45:";; + short | recursive ) echo "Configuration of AccountsService 0.6.50:";; esac cat <<\_ACEOF @@ -1548,6 +1554,7 @@ --enable-gtk-doc-pdf build documentation in pdf format [[default=no]] --enable-docbook-docs build documentation (requires xmlto) --enable-systemd Use systemd + --enable-elogind Use elogind Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -1560,10 +1567,14 @@ --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified). + --with-extra-admin-groups + Comma-separated list of extra groups that + administrator users are part of --with-minimum-uid Set minimum uid for human users --with-html-dir=PATH path to installed docs --with-systemdsystemunitdir=DIR Directory for systemd service files + --with-gdmconffile=FILE GDM configuration file, default=/etc/gdm/custom.conf Some influential environment variables: CC C compiler command @@ -1581,11 +1592,14 @@ path overriding pkg-config's built-in search path LT_SYS_LIBRARY_PATH User-defined run-time library search path. - GIO_CFLAGS C compiler flags for GIO, overriding pkg-config - GIO_LIBS linker flags for GIO, overriding pkg-config - POLKIT_CFLAGS - C compiler flags for POLKIT, overriding pkg-config - POLKIT_LIBS linker flags for POLKIT, overriding pkg-config + LIBACCOUNTSSERVICE_CFLAGS + C compiler flags for LIBACCOUNTSSERVICE, overriding pkg-config + LIBACCOUNTSSERVICE_LIBS + linker flags for LIBACCOUNTSSERVICE, overriding pkg-config + ACCOUNTS_DAEMON_CFLAGS + C compiler flags for ACCOUNTS_DAEMON, overriding pkg-config + ACCOUNTS_DAEMON_LIBS + linker flags for ACCOUNTS_DAEMON, overriding pkg-config GTKDOC_DEPS_CFLAGS C compiler flags for GTKDOC_DEPS, overriding pkg-config GTKDOC_DEPS_LIBS @@ -1596,6 +1610,10 @@ C compiler flags for SYSTEMD, overriding pkg-config SYSTEMD_LIBS linker flags for SYSTEMD, overriding pkg-config + ELOGIND_CFLAGS + C compiler flags for ELOGIND, overriding pkg-config + ELOGIND_LIBS + linker flags for ELOGIND, overriding pkg-config Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. @@ -1663,7 +1681,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -AccountsService configure 0.6.45 +AccountsService configure 0.6.50 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2074,7 +2092,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.45, which was +It was created by AccountsService $as_me 0.6.50, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2937,7 +2955,7 @@ # Define the identity of the package. PACKAGE='accountsservice' - VERSION='0.6.45' + VERSION='0.6.50' cat >>confdefs.h <<_ACEOF @@ -5597,6 +5615,82 @@ XGETTEXT=: INTLLIBS= + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFPreferencesCopyAppValue" >&5 +$as_echo_n "checking for CFPreferencesCopyAppValue... " >&6; } +if ${gt_cv_func_CFPreferencesCopyAppValue+:} false; then : + $as_echo_n "(cached) " >&6 +else + gt_save_LIBS="$LIBS" + LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +CFPreferencesCopyAppValue(NULL, NULL) + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gt_cv_func_CFPreferencesCopyAppValue=yes +else + gt_cv_func_CFPreferencesCopyAppValue=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$gt_save_LIBS" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFPreferencesCopyAppValue" >&5 +$as_echo "$gt_cv_func_CFPreferencesCopyAppValue" >&6; } + if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then + +$as_echo "#define HAVE_CFPREFERENCESCOPYAPPVALUE 1" >>confdefs.h + + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFLocaleCopyCurrent" >&5 +$as_echo_n "checking for CFLocaleCopyCurrent... " >&6; } +if ${gt_cv_func_CFLocaleCopyCurrent+:} false; then : + $as_echo_n "(cached) " >&6 +else + gt_save_LIBS="$LIBS" + LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +CFLocaleCopyCurrent(); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gt_cv_func_CFLocaleCopyCurrent=yes +else + gt_cv_func_CFLocaleCopyCurrent=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$gt_save_LIBS" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFLocaleCopyCurrent" >&5 +$as_echo "$gt_cv_func_CFLocaleCopyCurrent" >&6; } + if test $gt_cv_func_CFLocaleCopyCurrent = yes; then + +$as_echo "#define HAVE_CFLOCALECOPYCURRENT 1" >>confdefs.h + + fi + INTL_MACOSX_LIBS= + if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then + INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation" + fi + + + ac_fn_c_check_header_mongrel "$LINENO" "libintl.h" "ac_cv_header_libintl_h" "$ac_includes_default" if test "x$ac_cv_header_libintl_h" = xyes; then : gt_cv_func_dgettext_libintl="no" @@ -5937,7 +6031,7 @@ fi if test "$gt_cv_func_dgettext_libintl" = "yes"; then - INTLLIBS="-lintl $libintl_extra_libs" + INTLLIBS="-lintl $libintl_extra_libs $INTL_MACOSX_LIBS" fi if test "$gt_cv_have_gettext" = "yes"; then @@ -14475,19 +14569,19 @@ pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GIO" >&5 -$as_echo_n "checking for GIO... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBACCOUNTSSERVICE" >&5 +$as_echo_n "checking for LIBACCOUNTSSERVICE... " >&6; } -if test -n "$GIO_CFLAGS"; then - pkg_cv_GIO_CFLAGS="$GIO_CFLAGS" +if test -n "$LIBACCOUNTSSERVICE_CFLAGS"; then + pkg_cv_LIBACCOUNTSSERVICE_CFLAGS="$LIBACCOUNTSSERVICE_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gio-2.0 >= 2.37.3 gio-unix-2.0\""; } >&5 - ($PKG_CONFIG --exists --print-errors "gio-2.0 >= 2.37.3 gio-unix-2.0") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.44 gio-2.0 >= 2.37.3 gio-unix-2.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.44 gio-2.0 >= 2.37.3 gio-unix-2.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_GIO_CFLAGS=`$PKG_CONFIG --cflags "gio-2.0 >= 2.37.3 gio-unix-2.0" 2>/dev/null` + pkg_cv_LIBACCOUNTSSERVICE_CFLAGS=`$PKG_CONFIG --cflags "glib-2.0 >= 2.44 gio-2.0 >= 2.37.3 gio-unix-2.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -14495,16 +14589,16 @@ else pkg_failed=untried fi -if test -n "$GIO_LIBS"; then - pkg_cv_GIO_LIBS="$GIO_LIBS" +if test -n "$LIBACCOUNTSSERVICE_LIBS"; then + pkg_cv_LIBACCOUNTSSERVICE_LIBS="$LIBACCOUNTSSERVICE_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gio-2.0 >= 2.37.3 gio-unix-2.0\""; } >&5 - ($PKG_CONFIG --exists --print-errors "gio-2.0 >= 2.37.3 gio-unix-2.0") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.44 gio-2.0 >= 2.37.3 gio-unix-2.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.44 gio-2.0 >= 2.37.3 gio-unix-2.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_GIO_LIBS=`$PKG_CONFIG --libs "gio-2.0 >= 2.37.3 gio-unix-2.0" 2>/dev/null` + pkg_cv_LIBACCOUNTSSERVICE_LIBS=`$PKG_CONFIG --libs "glib-2.0 >= 2.44 gio-2.0 >= 2.37.3 gio-unix-2.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -14525,22 +14619,22 @@ _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - GIO_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gio-2.0 >= 2.37.3 gio-unix-2.0" 2>&1` + LIBACCOUNTSSERVICE_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "glib-2.0 >= 2.44 gio-2.0 >= 2.37.3 gio-unix-2.0" 2>&1` else - GIO_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gio-2.0 >= 2.37.3 gio-unix-2.0" 2>&1` + LIBACCOUNTSSERVICE_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "glib-2.0 >= 2.44 gio-2.0 >= 2.37.3 gio-unix-2.0" 2>&1` fi # Put the nasty error message in config.log where it belongs - echo "$GIO_PKG_ERRORS" >&5 + echo "$LIBACCOUNTSSERVICE_PKG_ERRORS" >&5 - as_fn_error $? "Package requirements (gio-2.0 >= 2.37.3 gio-unix-2.0) were not met: + as_fn_error $? "Package requirements (glib-2.0 >= 2.44 gio-2.0 >= 2.37.3 gio-unix-2.0) were not met: -$GIO_PKG_ERRORS +$LIBACCOUNTSSERVICE_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. -Alternatively, you may set the environment variables GIO_CFLAGS -and GIO_LIBS to avoid the need to call pkg-config. +Alternatively, you may set the environment variables LIBACCOUNTSSERVICE_CFLAGS +and LIBACCOUNTSSERVICE_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 @@ -14551,34 +14645,34 @@ is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. -Alternatively, you may set the environment variables GIO_CFLAGS -and GIO_LIBS to avoid the need to call pkg-config. +Alternatively, you may set the environment variables LIBACCOUNTSSERVICE_CFLAGS +and LIBACCOUNTSSERVICE_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else - GIO_CFLAGS=$pkg_cv_GIO_CFLAGS - GIO_LIBS=$pkg_cv_GIO_LIBS + LIBACCOUNTSSERVICE_CFLAGS=$pkg_cv_LIBACCOUNTSSERVICE_CFLAGS + LIBACCOUNTSSERVICE_LIBS=$pkg_cv_LIBACCOUNTSSERVICE_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for POLKIT" >&5 -$as_echo_n "checking for POLKIT... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ACCOUNTS_DAEMON" >&5 +$as_echo_n "checking for ACCOUNTS_DAEMON... " >&6; } -if test -n "$POLKIT_CFLAGS"; then - pkg_cv_POLKIT_CFLAGS="$POLKIT_CFLAGS" +if test -n "$ACCOUNTS_DAEMON_CFLAGS"; then + pkg_cv_ACCOUNTS_DAEMON_CFLAGS="$ACCOUNTS_DAEMON_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gio-unix-2.0 polkit-gobject-1\""; } >&5 - ($PKG_CONFIG --exists --print-errors "gio-unix-2.0 polkit-gobject-1") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.44 gio-unix-2.0 polkit-gobject-1\""; } >&5 + ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.44 gio-unix-2.0 polkit-gobject-1") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_POLKIT_CFLAGS=`$PKG_CONFIG --cflags "gio-unix-2.0 polkit-gobject-1" 2>/dev/null` + pkg_cv_ACCOUNTS_DAEMON_CFLAGS=`$PKG_CONFIG --cflags "glib-2.0 >= 2.44 gio-unix-2.0 polkit-gobject-1" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -14586,16 +14680,16 @@ else pkg_failed=untried fi -if test -n "$POLKIT_LIBS"; then - pkg_cv_POLKIT_LIBS="$POLKIT_LIBS" +if test -n "$ACCOUNTS_DAEMON_LIBS"; then + pkg_cv_ACCOUNTS_DAEMON_LIBS="$ACCOUNTS_DAEMON_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gio-unix-2.0 polkit-gobject-1\""; } >&5 - ($PKG_CONFIG --exists --print-errors "gio-unix-2.0 polkit-gobject-1") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.44 gio-unix-2.0 polkit-gobject-1\""; } >&5 + ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.44 gio-unix-2.0 polkit-gobject-1") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_POLKIT_LIBS=`$PKG_CONFIG --libs "gio-unix-2.0 polkit-gobject-1" 2>/dev/null` + pkg_cv_ACCOUNTS_DAEMON_LIBS=`$PKG_CONFIG --libs "glib-2.0 >= 2.44 gio-unix-2.0 polkit-gobject-1" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -14616,22 +14710,22 @@ _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - POLKIT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gio-unix-2.0 polkit-gobject-1" 2>&1` + ACCOUNTS_DAEMON_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "glib-2.0 >= 2.44 gio-unix-2.0 polkit-gobject-1" 2>&1` else - POLKIT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gio-unix-2.0 polkit-gobject-1" 2>&1` + ACCOUNTS_DAEMON_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "glib-2.0 >= 2.44 gio-unix-2.0 polkit-gobject-1" 2>&1` fi # Put the nasty error message in config.log where it belongs - echo "$POLKIT_PKG_ERRORS" >&5 + echo "$ACCOUNTS_DAEMON_PKG_ERRORS" >&5 - as_fn_error $? "Package requirements (gio-unix-2.0 polkit-gobject-1) were not met: + as_fn_error $? "Package requirements (glib-2.0 >= 2.44 gio-unix-2.0 polkit-gobject-1) were not met: -$POLKIT_PKG_ERRORS +$ACCOUNTS_DAEMON_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. -Alternatively, you may set the environment variables POLKIT_CFLAGS -and POLKIT_LIBS to avoid the need to call pkg-config. +Alternatively, you may set the environment variables ACCOUNTS_DAEMON_CFLAGS +and ACCOUNTS_DAEMON_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 @@ -14642,15 +14736,15 @@ is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. -Alternatively, you may set the environment variables POLKIT_CFLAGS -and POLKIT_LIBS to avoid the need to call pkg-config. +Alternatively, you may set the environment variables ACCOUNTS_DAEMON_CFLAGS +and ACCOUNTS_DAEMON_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else - POLKIT_CFLAGS=$pkg_cv_POLKIT_CFLAGS - POLKIT_LIBS=$pkg_cv_POLKIT_LIBS + ACCOUNTS_DAEMON_CFLAGS=$pkg_cv_ACCOUNTS_DAEMON_CFLAGS + ACCOUNTS_DAEMON_LIBS=$pkg_cv_ACCOUNTS_DAEMON_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } @@ -14680,12 +14774,6 @@ -# client library dependencies -LIBACCOUNTSSERVICE_LIBS="$GIO_LIBS" - -LIBACCOUNTSSERVICE_CFLAGS="$GIO_CFLAGS" - - @@ -14842,6 +14930,20 @@ _ACEOF + +# Check whether --with-extra-admin-groups was given. +if test "${with_extra_admin_groups+set}" = set; then : + withval=$with_extra_admin_groups; +else + with_extra_admin_groups="" +fi + + +cat >>confdefs.h <<_ACEOF +#define EXTRA_ADMIN_GROUPS "$with_extra_admin_groups" +_ACEOF + + # Check whether --enable-user-heuristics was given. if test "${enable_user_heuristics+set}" = set; then : enableval=$enable_user_heuristics; if test "$enableval" = yes; then @@ -15686,7 +15788,12 @@ -# systemd +# systemd or elogind + +have_systemd=no + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use systemd" >&5 +$as_echo_n "checking whether to use systemd... " >&6; } # Check whether --enable-systemd was given. if test "${enable_systemd+set}" = set; then : @@ -15696,6 +15803,9 @@ fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_systemd" >&5 +$as_echo "$enable_systemd" >&6; } + if test x$enable_systemd != xno; then pkg_failed=no @@ -15756,11 +15866,31 @@ # Put the nasty error message in config.log where it belongs echo "$SYSTEMD_PKG_ERRORS" >&5 - have_systemd=no + as_fn_error $? "Package requirements (libsystemd >= 186) were not met: + +$SYSTEMD_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables SYSTEMD_CFLAGS +and SYSTEMD_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } - have_systemd=no + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables SYSTEMD_CFLAGS +and SYSTEMD_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see . +See \`config.log' for more details" "$LINENO" 5; } else SYSTEMD_CFLAGS=$pkg_cv_SYSTEMD_CFLAGS SYSTEMD_LIBS=$pkg_cv_SYSTEMD_LIBS @@ -15768,13 +15898,8 @@ $as_echo "yes" >&6; } have_systemd=yes fi -else - have_systemd=no fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use systemd" >&5 -$as_echo_n "checking whether to use systemd... " >&6; } - if test x$enable_systemd = xauto ; then if test x$have_systemd = xno ; then enable_systemd=no @@ -15783,24 +15908,149 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_systemd" >&5 -$as_echo "$enable_systemd" >&6; } +have_elogind=no + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use elogind" >&5 +$as_echo_n "checking whether to use elogind... " >&6; } + +# Check whether --enable-elogind was given. +if test "${enable_elogind+set}" = set; then : + enableval=$enable_elogind; enable_elogind=$enableval +else + enable_elogind=no +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_elogind" >&5 +$as_echo "$enable_elogind" >&6; } if test x$enable_systemd = xyes; then if test x$have_systemd = xno; then - as_fn_error $? "Systemd support explicitly required, but systemd not found" "$LINENO" 5 + as_fn_error $? "Systemd support explicitly requested, but libsystemd not found" "$LINENO" 5 + fi + + if test x$enable_elogind = xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: elogind support requested, but systemd was found." >&5 +$as_echo "$as_me: WARNING: elogind support requested, but systemd was found." >&2;} + as_fn_error $? "Disable either elogind or systemd support." "$LINENO" 5 fi + + + + LIBACCOUNTSSERVICE_LIBS="$LIBACCOUNTSSERVICE_LIBS $SYSTEMD_LIBS" + LIBACCOUNTSSERVICE_CFLAGS="$LIBACCOUNTSSERVICE_CFLAGS $SYSTEMD_CFLAGS" + + $as_echo "#define HAVE_SYSTEMD 1" >>confdefs.h fi +if test "x$enable_elogind" != "xno"; then + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ELOGIND" >&5 +$as_echo_n "checking for ELOGIND... " >&6; } + +if test -n "$ELOGIND_CFLAGS"; then + pkg_cv_ELOGIND_CFLAGS="$ELOGIND_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libelogind >= 229.4\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libelogind >= 229.4") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_ELOGIND_CFLAGS=`$PKG_CONFIG --cflags "libelogind >= 229.4" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$ELOGIND_LIBS"; then + pkg_cv_ELOGIND_LIBS="$ELOGIND_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libelogind >= 229.4\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libelogind >= 229.4") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_ELOGIND_LIBS=`$PKG_CONFIG --libs "libelogind >= 229.4" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi -LIBACCOUNTSSERVICE_LIBS="$LIBACCOUNTSSERVICE_LIBS $SYSTEMD_LIBS" -LIBACCOUNTSSERVICE_CFLAGS="$LIBACCOUNTSSERVICE_CFLAGS $SYSTEMD_CFLAGS" -if test "x$have_systemd" != "xno" ; then +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + ELOGIND_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libelogind >= 229.4" 2>&1` + else + ELOGIND_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libelogind >= 229.4" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$ELOGIND_PKG_ERRORS" >&5 + + as_fn_error $? "Package requirements (libelogind >= 229.4) were not met: + +$ELOGIND_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables ELOGIND_CFLAGS +and ELOGIND_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details." "$LINENO" 5 +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables ELOGIND_CFLAGS +and ELOGIND_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see . +See \`config.log' for more details" "$LINENO" 5; } +else + ELOGIND_CFLAGS=$pkg_cv_ELOGIND_CFLAGS + ELOGIND_LIBS=$pkg_cv_ELOGIND_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + have_elogind=yes +fi + + if test "x$have_elogind" != "xyes"; then + as_fn_error $? "elogind support requested, but libelogind not found" "$LINENO" 5 + else + + + + LIBACCOUNTSSERVICE_LIBS="$LIBACCOUNTSSERVICE_LIBS $ELOGIND_LIBS" + LIBACCOUNTSSERVICE_CFLAGS="$LIBACCOUNTSSERVICE_CFLAGS $ELOGIND_CFLAGS" + fi +fi + +if test "x${have_systemd}" != "xno" -o "x${have_elogind}" != "xno" ; then $as_echo "#define WITH_SYSTEMD 1" >>confdefs.h @@ -15830,6 +16080,20 @@ fi + +# Check whether --with-gdmconffile was given. +if test "${with_gdmconffile+set}" = set; then : + withval=$with_gdmconffile; gdmconffile=${withval} +else + gdmconffile=/etc/gdm/custom.conf +fi + + +cat >>confdefs.h <<_ACEOF +#define PATH_GDM_CUSTOM "$gdmconffile" +_ACEOF + + ac_config_headers="$ac_config_headers config.h" ac_config_files="$ac_config_files Makefile po/Makefile.in data/Makefile src/Makefile src/libaccountsservice/Makefile src/libaccountsservice/accountsservice.pc doc/Makefile doc/dbus/Makefile doc/dbus/AccountsService.xml doc/libaccountsservice/Makefile" @@ -16416,7 +16680,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.45, which was +This file was extended by AccountsService $as_me 0.6.50, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -16482,7 +16746,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.45 +AccountsService config.status 0.6.50 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -18215,6 +18479,10 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: ** Administrator group: $enable_admin_group" >&5 $as_echo "$as_me: ** Administrator group: $enable_admin_group" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: ** Extra administrator groups: $with_extra_admin_groups" >&5 +$as_echo "$as_me: ** Extra administrator groups: $with_extra_admin_groups" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: ** GDM configuration: $gdmconffile" >&5 +$as_echo "$as_me: ** GDM configuration: $gdmconffile" >&6;} echo diff -Nru accountsservice-0.6.45/configure.ac accountsservice-0.6.50/configure.ac --- accountsservice-0.6.45/configure.ac 2017-03-27 20:32:19.000000000 +0200 +++ accountsservice-0.6.50/configure.ac 2018-07-10 17:24:03.000000000 +0200 @@ -1,4 +1,4 @@ -AC_INIT([AccountsService],[0.6.45]) +AC_INIT([AccountsService],[0.6.50]) AM_INIT_AUTOMAKE([1.11.2 no-dist-gzip dist-xz tar-ustar foreign]) GETTEXT_PACKAGE=accounts-service @@ -25,17 +25,11 @@ AC_SUBST(LT_REVISION) AC_SUBST(LT_AGE) -PKG_CHECK_MODULES(GIO, gio-2.0 >= 2.37.3 gio-unix-2.0) -PKG_CHECK_MODULES(POLKIT, gio-unix-2.0 polkit-gobject-1) +PKG_CHECK_MODULES(LIBACCOUNTSSERVICE, glib-2.0 >= 2.44 gio-2.0 >= 2.37.3 gio-unix-2.0) +PKG_CHECK_MODULES(ACCOUNTS_DAEMON, glib-2.0 >= 2.44 gio-unix-2.0 polkit-gobject-1) AM_MAINTAINER_MODE([enable]) -# client library dependencies -LIBACCOUNTSSERVICE_LIBS="$GIO_LIBS" -AC_SUBST(LIBACCOUNTSSERVICE_LIBS) -LIBACCOUNTSSERVICE_CFLAGS="$GIO_CFLAGS" -AC_SUBST(LIBACCOUNTSSERVICE_CFLAGS) - GOBJECT_INTROSPECTION_CHECK([0.9.12]) dnl --------------------------------------------------------------------------- @@ -54,6 +48,11 @@ ]) AC_DEFINE_UNQUOTED([ADMIN_GROUP], ["$enable_admin_group"], [Define to the group for administrator users]) +AC_ARG_WITH(extra-admin-groups, + [AS_HELP_STRING([--with-extra-admin-groups],[Comma-separated list of extra groups that administrator users are part of])], + ,with_extra_admin_groups="") +AC_DEFINE_UNQUOTED([EXTRA_ADMIN_GROUPS], ["$with_extra_admin_groups"], [Define to the list of extra groups administrator users are part of]) + AC_ARG_ENABLE(user-heuristics, [AS_HELP_STRING([--enable-user-heuristics],[Enable heuristics for guessing system vs. human users in the range 500-minimum-uid])], [if test "$enableval" = yes; then @@ -264,22 +263,24 @@ dnl --------------------------------------------------------------------------- AC_PATH_PROG([XSLTPROC], [xsltproc]) -# systemd +# systemd or elogind + +have_systemd=no + +AC_MSG_CHECKING([whether to use systemd]) AC_ARG_ENABLE([systemd], AS_HELP_STRING([--enable-systemd], [Use systemd]), [enable_systemd=$enableval], [enable_systemd=auto]) +AC_MSG_RESULT($enable_systemd) + if test x$enable_systemd != xno; then - PKG_CHECK_MODULES(SYSTEMD, [libsystemd >= 186], - [have_systemd=yes], [have_systemd=no]) -else - have_systemd=no + PKG_CHECK_MODULES(SYSTEMD, [libsystemd >= 186], + [have_systemd=yes]) fi -AC_MSG_CHECKING([whether to use systemd]) - if test x$enable_systemd = xauto ; then if test x$have_systemd = xno ; then enable_systemd=no @@ -288,21 +289,54 @@ fi fi -AC_MSG_RESULT($enable_systemd) +have_elogind=no + +AC_MSG_CHECKING([whether to use elogind]) + +AC_ARG_ENABLE([elogind], + AS_HELP_STRING([--enable-elogind], [Use elogind]), + [enable_elogind=$enableval], + [enable_elogind=no]) + +AC_MSG_RESULT($enable_elogind) if test x$enable_systemd = xyes; then if test x$have_systemd = xno; then - AC_MSG_ERROR([Systemd support explicitly required, but systemd not found]) + AC_MSG_ERROR([Systemd support explicitly requested, but libsystemd not found]) + fi + + dnl Requesting to use the elogind session tracker makes no sense where + dnl systemd-login is (or might be) running. + if test x$enable_elogind = xyes; then + AC_MSG_WARN([elogind support requested, but systemd was found.]) + AC_MSG_ERROR([Disable either elogind or systemd support.]) fi + + AC_SUBST(SYSTEMD_CFLAGS) + AC_SUBST(SYSTEMD_LIBS) + + LIBACCOUNTSSERVICE_LIBS="$LIBACCOUNTSSERVICE_LIBS $SYSTEMD_LIBS" + LIBACCOUNTSSERVICE_CFLAGS="$LIBACCOUNTSSERVICE_CFLAGS $SYSTEMD_CFLAGS" + AC_DEFINE(HAVE_SYSTEMD, 1, [Define if systemd is used]) fi -AC_SUBST(SYSTEMD_CFLAGS) -AC_SUBST(SYSTEMD_LIBS) -LIBACCOUNTSSERVICE_LIBS="$LIBACCOUNTSSERVICE_LIBS $SYSTEMD_LIBS" -LIBACCOUNTSSERVICE_CFLAGS="$LIBACCOUNTSSERVICE_CFLAGS $SYSTEMD_CFLAGS" +if test "x$enable_elogind" != "xno"; then + PKG_CHECK_MODULES(ELOGIND, [libelogind >= 229.4], + [have_elogind=yes]) -if test "x$have_systemd" != "xno" ; then + if test "x$have_elogind" != "xyes"; then + AC_MSG_ERROR([elogind support requested, but libelogind not found]) + else + AC_SUBST(ELOGIND_CFLAGS) + AC_SUBST(ELOGIND_LIBS) + + LIBACCOUNTSSERVICE_LIBS="$LIBACCOUNTSSERVICE_LIBS $ELOGIND_LIBS" + LIBACCOUNTSSERVICE_CFLAGS="$LIBACCOUNTSSERVICE_CFLAGS $ELOGIND_CFLAGS" + fi +fi + +if test "x${have_systemd}" != "xno" -o "x${have_elogind}" != "xno" ; then AC_DEFINE(WITH_SYSTEMD, 1, [Define to enable systemd support]) fi @@ -318,6 +352,11 @@ fi AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != "xno" ]) +AC_ARG_WITH(gdmconffile, + AS_HELP_STRING([--with-gdmconffile=FILE], [GDM configuration file, default=/etc/gdm/custom.conf]), + gdmconffile=${withval}, gdmconffile=/etc/gdm/custom.conf) +AC_DEFINE_UNQUOTED([PATH_GDM_CUSTOM], ["$gdmconffile"], [GDM configuration file]) + AC_CONFIG_HEADERS([config.h]) AC_CONFIG_FILES([ Makefile @@ -341,6 +380,8 @@ AC_MSG_NOTICE([** DocBook documentation build disabled]) fi AC_MSG_NOTICE([** Administrator group: $enable_admin_group]) + AC_MSG_NOTICE([** Extra administrator groups: $with_extra_admin_groups]) + AC_MSG_NOTICE([** GDM configuration: $gdmconffile]) echo diff -Nru accountsservice-0.6.45/data/accounts-daemon.service.in accountsservice-0.6.50/data/accounts-daemon.service.in --- accountsservice-0.6.45/data/accounts-daemon.service.in 2017-03-27 18:50:42.000000000 +0200 +++ accountsservice-0.6.50/data/accounts-daemon.service.in 2018-04-04 15:59:42.000000000 +0200 @@ -11,7 +11,6 @@ Type=dbus BusName=org.freedesktop.Accounts ExecStart=@libexecdir@/accounts-daemon -StandardOutput=syslog Environment=GVFS_DISABLE_FUSE=1 Environment=GIO_USE_VFS=local Environment=GVFS_REMOTE_VOLUME_MONITOR_IGNORE=1 diff -Nru accountsservice-0.6.45/data/Makefile.in accountsservice-0.6.50/data/Makefile.in --- accountsservice-0.6.45/data/Makefile.in 2017-03-27 20:33:02.000000000 +0200 +++ accountsservice-0.6.50/data/Makefile.in 2018-07-10 17:25:07.000000000 +0200 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -155,6 +155,8 @@ am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACCOUNTS_DAEMON_CFLAGS = @ACCOUNTS_DAEMON_CFLAGS@ +ACCOUNTS_DAEMON_LIBS = @ACCOUNTS_DAEMON_LIBS@ ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ @@ -182,11 +184,11 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ +ELOGIND_CFLAGS = @ELOGIND_CFLAGS@ +ELOGIND_LIBS = @ELOGIND_LIBS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ -GIO_CFLAGS = @GIO_CFLAGS@ -GIO_LIBS = @GIO_LIBS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ @@ -212,6 +214,7 @@ INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ @@ -260,8 +263,6 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POFILES = @POFILES@ -POLKIT_CFLAGS = @POLKIT_CFLAGS@ -POLKIT_LIBS = @POLKIT_LIBS@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ diff -Nru accountsservice-0.6.45/data/org.freedesktop.accounts.policy.in accountsservice-0.6.50/data/org.freedesktop.accounts.policy.in --- accountsservice-0.6.45/data/org.freedesktop.accounts.policy.in 2017-03-27 18:50:42.000000000 +0200 +++ accountsservice-0.6.50/data/org.freedesktop.accounts.policy.in 2018-04-04 15:59:42.000000000 +0200 @@ -17,6 +17,16 @@ + + <_description>Change your own user password + <_message>Authentication is required to change your own user password + + auth_admin + auth_admin + auth_admin + + + <_description>Manage user accounts <_message>Authentication is required to change user data diff -Nru accountsservice-0.6.45/data/org.freedesktop.Accounts.xml accountsservice-0.6.50/data/org.freedesktop.Accounts.xml --- accountsservice-0.6.45/data/org.freedesktop.Accounts.xml 2012-12-19 15:42:47.000000000 +0100 +++ accountsservice-0.6.50/data/org.freedesktop.Accounts.xml 2018-04-04 15:59:42.000000000 +0200 @@ -71,7 +71,6 @@ The username for the new user - The real name for the new user @@ -222,6 +221,36 @@ + + + + + + + Whether or not the system has no users + + + + + + + + + + Whether or not the system has multiple users + + + + + + + + + + Users to automatically log in as + + + diff -Nru accountsservice-0.6.45/debian/changelog accountsservice-0.6.50/debian/changelog --- accountsservice-0.6.45/debian/changelog 2017-12-18 03:42:18.000000000 +0100 +++ accountsservice-0.6.50/debian/changelog 2018-09-18 11:11:58.000000000 +0200 @@ -1,3 +1,25 @@ +accountsservice (0.6.50-0ubuntu1) UNRELEASED; urgency=medium + + * New upstream release + * debian/control: + - Bump minimum version of libglib2.0-dev + * debian/rules: + * debian/patches/0005-gdm_config_file_path.patch: + - Set config file using configure args + * debian/libaccountsservice0.symbols: + - Updated + * debian/patches/0001-Move-cache-cleanup-out-into-a-common-function-and-cl.patch: + * debian/patches/0002-On-startup-clean-out-the-data-of-removed-users.patch: + * debian/patches/1002-dont-override-standardoutput.patch: + - Applied upstream + * debian/patches/0015-debian-nologin-path.patch: + - No longer needed + * debian/patches/0008-nopasswdlogin-group.patch: + * debian/patches/2001-filtering_out_users.patch: + - Remove unused patches + + -- Robert Ancell Tue, 18 Sep 2018 11:11:58 +0200 + accountsservice (0.6.45-1ubuntu1) bionic; urgency=medium * Merge with Debian, remaining Ubuntu changes: diff -Nru accountsservice-0.6.45/debian/control accountsservice-0.6.50/debian/control --- accountsservice-0.6.45/debian/control 2017-12-18 03:42:18.000000000 +0100 +++ accountsservice-0.6.50/debian/control 2018-09-18 11:11:58.000000000 +0200 @@ -13,7 +13,7 @@ gtk-doc-tools, intltool, libgirepository1.0-dev (>= 0.9.12), - libglib2.0-dev (>= 2.37.3), + libglib2.0-dev (>= 2.44), libpolkit-gobject-1-dev, libsystemd-dev (>= 209) [linux-any], xmlto diff -Nru accountsservice-0.6.45/debian/libaccountsservice0.symbols accountsservice-0.6.50/debian/libaccountsservice0.symbols --- accountsservice-0.6.45/debian/libaccountsservice0.symbols 2017-12-18 03:42:18.000000000 +0100 +++ accountsservice-0.6.50/debian/libaccountsservice0.symbols 2018-09-18 11:11:58.000000000 +0200 @@ -27,10 +27,14 @@ accounts_accounts_complete_find_user_by_name@Base 0.6.18 accounts_accounts_complete_list_cached_users@Base 0.6.18 accounts_accounts_complete_uncache_user@Base 0.6.24 + accounts_accounts_dup_automatic_login_users@Base 0.6.50 accounts_accounts_dup_daemon_version@Base 0.6.18 accounts_accounts_emit_user_added@Base 0.6.18 accounts_accounts_emit_user_deleted@Base 0.6.18 + accounts_accounts_get_automatic_login_users@Base 0.6.50 accounts_accounts_get_daemon_version@Base 0.6.18 + accounts_accounts_get_has_multiple_users@Base 0.6.50 + accounts_accounts_get_has_no_users@Base 0.6.50 accounts_accounts_get_type@Base 0.6.18 accounts_accounts_interface_info@Base 0.6.18 accounts_accounts_override_properties@Base 0.6.18 @@ -41,7 +45,10 @@ accounts_accounts_proxy_new_for_bus_finish@Base 0.6.18 accounts_accounts_proxy_new_for_bus_sync@Base 0.6.18 accounts_accounts_proxy_new_sync@Base 0.6.18 + accounts_accounts_set_automatic_login_users@Base 0.6.50 accounts_accounts_set_daemon_version@Base 0.6.18 + accounts_accounts_set_has_multiple_users@Base 0.6.50 + accounts_accounts_set_has_no_users@Base 0.6.50 accounts_accounts_skeleton_get_type@Base 0.6.18 accounts_accounts_skeleton_new@Base 0.6.18 accounts_user_call_get_password_expiration_policy@Base 0.6.45 diff -Nru accountsservice-0.6.45/debian/patches/0001-formats-locale-property.patch accountsservice-0.6.50/debian/patches/0001-formats-locale-property.patch --- accountsservice-0.6.45/debian/patches/0001-formats-locale-property.patch 2017-12-18 03:42:18.000000000 +0100 +++ accountsservice-0.6.50/debian/patches/0001-formats-locale-property.patch 2018-09-18 11:11:58.000000000 +0200 @@ -1,12 +1,20 @@ -Description: Addition of FormatsLocale property and SetFormatsLocale method. -Forwarded: https://bugs.freedesktop.org/42857 -Author: Gunnar Hjalmarsson -Last-Update: 2011-11-12 +From c319f3f2048d0f2c3009361c0a6004de64a8e31e Mon Sep 17 00:00:00 2001 +From: Gunnar Hjalmarsson +Date: Thu, 21 Dec 2017 15:03:24 +1300 +Subject: [PATCH 01/12] Addition of FormatsLocale property and SetFormatsLocale + method -Index: accountsservice-0.6.45/data/org.freedesktop.Accounts.User.xml -=================================================================== ---- accountsservice-0.6.45.orig/data/org.freedesktop.Accounts.User.xml -+++ accountsservice-0.6.45/data/org.freedesktop.Accounts.User.xml +--- + data/org.freedesktop.Accounts.User.xml | 45 +++++++++++++++++++ + src/libaccountsservice/act-user.c | 55 +++++++++++++++++++++++ + src/libaccountsservice/act-user.h | 3 ++ + src/user.c | 60 ++++++++++++++++++++++++++ + 4 files changed, 163 insertions(+) + +diff --git a/data/org.freedesktop.Accounts.User.xml b/data/org.freedesktop.Accounts.User.xml +index 4ab989a..0856974 100644 +--- a/data/org.freedesktop.Accounts.User.xml ++++ b/data/org.freedesktop.Accounts.User.xml @@ -150,6 +150,41 @@ @@ -49,12 +57,10 @@ -@@ -666,6 +701,16 @@ - - +@@ -668,6 +703,16 @@ -+ -+ + + + + + @@ -63,14 +69,16 @@ + + + - - ++ ++ -Index: accountsservice-0.6.45/src/libaccountsservice/act-user.c -=================================================================== ---- accountsservice-0.6.45.orig/src/libaccountsservice/act-user.c -+++ accountsservice-0.6.45/src/libaccountsservice/act-user.c -@@ -93,6 +93,7 @@ enum { + + +diff --git a/src/libaccountsservice/act-user.c b/src/libaccountsservice/act-user.c +index 7162221..b2db572 100644 +--- a/src/libaccountsservice/act-user.c ++++ b/src/libaccountsservice/act-user.c +@@ -95,6 +95,7 @@ enum { PROP_LOGIN_HISTORY, PROP_ICON_FILE, PROP_LANGUAGE, @@ -78,50 +86,25 @@ PROP_X_SESSION, PROP_IS_LOADED }; -@@ -122,6 +123,7 @@ struct _ActUser { - char *location; - char *icon_file; - char *language; -+ char *formats_locale; - char *x_session; - GList *our_sessions; - GList *other_sessions; -@@ -308,6 +310,9 @@ act_user_get_property (GObject *objec - case PROP_LANGUAGE: - g_value_set_string (value, user->language); - break; -+ case PROP_FORMATS_LOCALE: -+ g_value_set_string (value, user->formats_locale); -+ break; - case PROP_X_SESSION: - g_value_set_string (value, user->x_session); - break; -@@ -464,6 +469,13 @@ act_user_class_init (ActUserClass *class +@@ -386,6 +387,13 @@ act_user_class_init (ActUserClass *class) + "User's locale.", NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); - g_object_class_install_property (gobject_class, ++ g_object_class_install_property (gobject_class, + PROP_FORMATS_LOCALE, + g_param_spec_string ("formats_locale", + "Regional Formats", + "User's regional formats.", + NULL, + G_PARAM_READABLE)); -+ g_object_class_install_property (gobject_class, + g_object_class_install_property (gobject_class, PROP_X_SESSION, g_param_spec_string ("x-session", - "X session", -@@ -583,6 +595,7 @@ act_user_finalize (GObject *object) - g_free (user->location); - if (user->login_history) - g_variant_unref (user->login_history); -+ g_free (user->formats_locale); - - if (user->accounts_proxy != NULL) { - g_object_unref (user->accounts_proxy); -@@ -1052,6 +1065,22 @@ act_user_get_language (ActUser *user) +@@ -1007,6 +1015,25 @@ act_user_get_language (ActUser *user) + return accounts_user_get_language (user->accounts_proxy); } - /** ++/** + * act_user_get_formats_locale: + * @user: a #ActUser + * @@ -134,37 +117,19 @@ +{ + g_return_val_if_fail (ACT_IS_USER (user), NULL); + -+ return user->formats_locale; ++ if (user->accounts_proxy == NULL) ++ return NULL; ++ ++ return accounts_user_get_formats_locale (user->accounts_proxy); +} + -+/** + /** * act_user_get_x_session: * @user: a #ActUser - * -@@ -1279,6 +1308,17 @@ collect_props (const gchar *key, - user->language = g_strdup (new_language); - g_object_notify (G_OBJECT (user), "language"); - } -+ -+ } else if (strcmp (key, "FormatsLocale") == 0) { -+ const char *new_formats_locale; -+ -+ new_formats_locale = g_variant_get_string (value, NULL); -+ if (g_strcmp0 (user->formats_locale, new_formats_locale) != 0) { -+ g_free (user->formats_locale); -+ user->formats_locale = g_strdup (new_formats_locale); -+ g_object_notify (G_OBJECT (user), "formats_locale"); -+ } -+ - } else if (strcmp (key, "XSession") == 0) { - const char *new_x_session; - -@@ -1616,6 +1656,35 @@ act_user_get_password_expiration_policy - g_error_free (error); - return; +@@ -1253,6 +1280,34 @@ act_user_get_password_expiration_policy (ActUser *user, } -+} -+ + } + +/** + * act_user_set_formats_locale: + * @user: the user object to alter. @@ -178,7 +143,7 @@ +act_user_set_formats_locale (ActUser *user, + const char *formats_locale) +{ -+ GError *error = NULL; ++ g_autoptr(GError) error = NULL; + + g_return_if_fail (ACT_IS_USER (user)); + g_return_if_fail (formats_locale != NULL); @@ -189,17 +154,18 @@ + NULL, + &error)) { + g_warning ("SetFormatsLocale call failed: %s", error->message); -+ g_error_free (error); + return; + } - } - ++} ++ /** -Index: accountsservice-0.6.45/src/libaccountsservice/act-user.h -=================================================================== ---- accountsservice-0.6.45.orig/src/libaccountsservice/act-user.h -+++ accountsservice-0.6.45/src/libaccountsservice/act-user.h -@@ -77,6 +77,7 @@ gboolean act_user_is_local_account + * act_user_set_email: + * @user: the user object to alter. +diff --git a/src/libaccountsservice/act-user.h b/src/libaccountsservice/act-user.h +index c685fcc..7ffa32c 100644 +--- a/src/libaccountsservice/act-user.h ++++ b/src/libaccountsservice/act-user.h +@@ -77,6 +77,7 @@ gboolean act_user_is_local_account (ActUser *user); gboolean act_user_is_nonexistent (ActUser *user); const char *act_user_get_icon_file (ActUser *user); const char *act_user_get_language (ActUser *user); @@ -207,7 +173,7 @@ const char *act_user_get_x_session (ActUser *user); const char *act_user_get_primary_session_id (ActUser *user); -@@ -96,6 +97,8 @@ void act_user_set_email +@@ -96,6 +97,8 @@ void act_user_set_email (ActUser *user, const char *email); void act_user_set_language (ActUser *user, const char *language); @@ -216,54 +182,38 @@ void act_user_set_x_session (ActUser *user, const char *x_session); void act_user_set_location (ActUser *user, -Index: accountsservice-0.6.45/src/user.c -=================================================================== ---- accountsservice-0.6.45.orig/src/user.c -+++ accountsservice-0.6.45/src/user.c -@@ -58,6 +58,7 @@ enum { - PROP_SHELL, - PROP_EMAIL, - PROP_LANGUAGE, -+ PROP_FORMATS_LOCALE, - PROP_X_SESSION, - PROP_LOCATION, - PROP_LOGIN_FREQUENCY, -@@ -93,6 +94,7 @@ struct User { - gchar *shell; - gchar *email; - gchar *language; -+ gchar *formats_locale; - gchar *x_session; - gchar *location; - guint64 login_frequency; -@@ -319,6 +321,13 @@ user_update_from_keyfile (User *user - g_object_notify (G_OBJECT (user), "language"); +diff --git a/src/user.c b/src/user.c +index 174530f..88778cb 100644 +--- a/src/user.c ++++ b/src/user.c +@@ -256,6 +256,12 @@ user_update_from_keyfile (User *user, + g_clear_pointer (&s, g_free); } + s = g_key_file_get_string (keyfile, "User", "FormatsLocale", NULL); + if (s != NULL) { -+ g_free (user->formats_locale); -+ user->formats_locale = s; -+ g_object_notify (G_OBJECT (user), "formats-locale"); ++ accounts_user_set_formats_locale (ACCOUNTS_USER (user), s); ++ g_clear_pointer (&s, g_free); + } + s = g_key_file_get_string (keyfile, "User", "XSession", NULL); if (s != NULL) { - g_free (user->x_session); -@@ -402,6 +411,9 @@ user_save_to_keyfile (User *user, - if (user->language) - g_key_file_set_string (keyfile, "User", "Language", user->language); + accounts_user_set_xsession (ACCOUNTS_USER (user), s); +@@ -326,6 +332,9 @@ user_save_to_keyfile (User *user, + if (accounts_user_get_language (ACCOUNTS_USER (user))) + g_key_file_set_string (keyfile, "User", "Language", accounts_user_get_language (ACCOUNTS_USER (user))); -+ if (user->formats_locale) -+ g_key_file_set_string (keyfile, "User", "FormatsLocale", user->formats_locale); ++ if (accounts_user_get_formats_locale (ACCOUNTS_USER (user))) ++ g_key_file_set_string (keyfile, "User", "FormatsLocale", accounts_user_get_formats_locale (ACCOUNTS_USER (user))); + - if (user->x_session) - g_key_file_set_string (keyfile, "User", "XSession", user->x_session); + if (accounts_user_get_xsession (ACCOUNTS_USER (user))) + g_key_file_set_string (keyfile, "User", "XSession", accounts_user_get_xsession (ACCOUNTS_USER (user))); -@@ -1104,6 +1116,61 @@ user_set_language (AccountsUser +@@ -1023,6 +1032,56 @@ user_set_language (AccountsUser *auser, + return TRUE; } - static void ++static void +user_change_formats_locale_authorized_cb (Daemon *daemon, + User *user, + GDBusMethodInvocation *context, @@ -272,21 +222,16 @@ +{ + gchar *formats_locale = data; + -+ if (g_strcmp0 (user->formats_locale, formats_locale) != 0) { -+ g_free (user->formats_locale); -+ user->formats_locale = g_strdup (formats_locale); ++ if (g_strcmp0 (accounts_user_get_formats_locale (ACCOUNTS_USER (user)), formats_locale) != 0) { ++ accounts_user_set_formats_locale (ACCOUNTS_USER (user), formats_locale); + + save_extra_data (user); -+ -+ accounts_user_emit_changed (ACCOUNTS_USER (user)); -+ -+ g_object_notify (G_OBJECT (user), "formats_locale"); + } + + accounts_user_complete_set_formats_locale (ACCOUNTS_USER (user), context); +} + -+gboolean ++static gboolean +user_set_formats_locale (AccountsUser *auser, + GDBusMethodInvocation *context, + const gchar *formats_locale) @@ -301,7 +246,7 @@ + return FALSE; + } + -+ if (user->uid == (uid_t) uid) ++ if (accounts_user_get_uid (ACCOUNTS_USER (user)) == (uid_t) uid) + action_id = "org.freedesktop.accounts.change-own-user-data"; + else + action_id = "org.freedesktop.accounts.user-administration"; @@ -318,39 +263,10 @@ + return TRUE; +} + -+static void + static void user_change_x_session_authorized_cb (Daemon *daemon, User *user, - GDBusMethodInvocation *context, -@@ -2209,6 +2276,7 @@ user_finalize (GObject *object) - g_free (user->default_icon_file); - g_free (user->email); - g_free (user->language); -+ g_free (user->formats_locale); - g_free (user->x_session); - g_free (user->location); - g_free (user->password_hint); -@@ -2235,6 +2303,9 @@ user_set_property (GObject *object, - case PROP_LANGUAGE: - user->language = g_value_dup_string (value); - break; -+ case PROP_FORMATS_LOCALE: -+ user->formats_locale = g_value_dup_string (value); -+ break; - case PROP_X_SESSION: - user->x_session = g_value_dup_string (value); - break; -@@ -2303,6 +2374,9 @@ user_get_property (GObject *object, - case PROP_LANGUAGE: - g_value_set_string (value, user->language); - break; -+ case PROP_FORMATS_LOCALE: -+ g_value_set_string (value, user->formats_locale); -+ break; - case PROP_X_SESSION: - g_value_set_string (value, user->x_session); - break; -@@ -2366,6 +2440,7 @@ user_accounts_user_iface_init (AccountsU +@@ -1981,6 +2040,7 @@ user_accounts_user_iface_init (AccountsUserIface *iface) iface->handle_set_account_type = user_set_account_type; iface->handle_set_automatic_login = user_set_automatic_login; iface->handle_set_email = user_set_email; @@ -358,11 +274,6 @@ iface->handle_set_home_directory = user_set_home_directory; iface->handle_set_icon_file = user_set_icon_file; iface->handle_set_language = user_set_language; -@@ -2414,6 +2489,7 @@ user_init (User *user) - user->default_icon_file = NULL; - user->email = NULL; - user->language = NULL; -+ user->formats_locale = NULL; - user->x_session = NULL; - user->location = NULL; - user->password_mode = PASSWORD_MODE_REGULAR; +-- +2.17.1 + diff -Nru accountsservice-0.6.45/debian/patches/0001-Move-cache-cleanup-out-into-a-common-function-and-cl.patch accountsservice-0.6.50/debian/patches/0001-Move-cache-cleanup-out-into-a-common-function-and-cl.patch --- accountsservice-0.6.45/debian/patches/0001-Move-cache-cleanup-out-into-a-common-function-and-cl.patch 2017-12-18 03:42:18.000000000 +0100 +++ accountsservice-0.6.50/debian/patches/0001-Move-cache-cleanup-out-into-a-common-function-and-cl.patch 1970-01-01 01:00:00.000000000 +0100 @@ -1,82 +0,0 @@ -From a8a5328ca84ad48c83e53525b5e5edf5058ccfba Mon Sep 17 00:00:00 2001 -From: Gunnar Hjalmarsson -Date: Wed, 5 Feb 2014 14:42:22 +0000 -Subject: [PATCH 1/2] Move cache cleanup out into a common function and clean - up icon too - -https://bugs.freedesktop.org/show_bug.cgi?id=72596 ---- - src/daemon.c | 32 ++++++++++++++++---------------- - 1 file changed, 16 insertions(+), 16 deletions(-) - -Index: accountsservice-0.6.45/src/daemon.c -=================================================================== ---- accountsservice-0.6.45.orig/src/daemon.c -+++ accountsservice-0.6.45/src/daemon.c -@@ -140,6 +140,20 @@ error_get_type (void) - #define MAX_LOCAL_USERS 50 - #endif - -+static void -+remove_cache_files (const gchar *user_name) -+{ -+ gchar *filename; -+ -+ filename = g_build_filename (USERDIR, user_name, NULL); -+ g_remove (filename); -+ g_free (filename); -+ -+ filename = g_build_filename (ICONDIR, user_name, NULL); -+ g_remove (filename); -+ g_free (filename); -+} -+ - static struct passwd * - entry_generator_fgetpwent (Daemon *daemon, - GHashTable *users, -@@ -1146,7 +1160,6 @@ daemon_uncache_user_authorized_cb (Daemo - gpointer data) - { - const gchar *user_name = data; -- gchar *filename; - User *user; - - sys_log (context, "uncache user '%s'", user_name); -@@ -1161,13 +1174,7 @@ daemon_uncache_user_authorized_cb (Daemo - /* Always use the canonical user name looked up */ - user_name = user_get_user_name (user); - -- filename = g_build_filename (USERDIR, user_name, NULL); -- g_remove (filename); -- g_free (filename); -- -- filename = g_build_filename (ICONDIR, user_name, NULL); -- g_remove (filename); -- g_free (filename); -+ remove_cache_files (user_name); - - accounts_accounts_complete_uncache_user (NULL, context); - -@@ -1207,7 +1214,6 @@ daemon_delete_user_authorized_cb (Daemon - { - DeleteUserData *ud = data; - GError *error; -- gchar *filename; - struct passwd *pwent; - const gchar *argv[6]; - -@@ -1234,13 +1240,7 @@ daemon_delete_user_authorized_cb (Daemon - - } - -- filename = g_build_filename (USERDIR, pwent->pw_name, NULL); -- g_remove (filename); -- g_free (filename); -- -- filename = g_build_filename (ICONDIR, pwent->pw_name, NULL); -- g_remove (filename); -- g_free (filename); -+ remove_cache_files (pwent->pw_name); - - argv[0] = "/usr/sbin/userdel"; - if (ud->remove_files) { diff -Nru accountsservice-0.6.45/debian/patches/0002-create-and-manage-groups-like-on-a-debian-system.patch accountsservice-0.6.50/debian/patches/0002-create-and-manage-groups-like-on-a-debian-system.patch --- accountsservice-0.6.45/debian/patches/0002-create-and-manage-groups-like-on-a-debian-system.patch 2017-12-18 03:42:18.000000000 +0100 +++ accountsservice-0.6.50/debian/patches/0002-create-and-manage-groups-like-on-a-debian-system.patch 2018-09-18 11:11:58.000000000 +0200 @@ -1,23 +1,31 @@ +From 7c01e532c9bf3094f5a8d3c6c485e889eee3243b Mon Sep 17 00:00:00 2001 From: Frederic Peters -Bug-Debian: http://bugs.debian.org/618764 -Forwarded: not-needed -Description: Create and manage groups like on a debian system. +Date: Thu, 21 Dec 2017 15:03:57 +1300 +Subject: [PATCH 02/12] Create and manage groups like on a debian system. + --- - src/daemon.c | 22 ++++++---------------- - src/user.c | 16 ++++++++-------- - src/util.c | 42 ++++++++++++++++++++++++++++++++++++++++++ - src/util.h | 9 +++++++++ - 4 files changed, 65 insertions(+), 24 deletions(-) + src/daemon.c | 28 ++++++---------------------- + src/util.c | 40 ++++++++++++++++++++++++++++++++++++++++ + src/util.h | 9 +++++++++ + 3 files changed, 55 insertions(+), 22 deletions(-) +diff --git a/src/daemon.c b/src/daemon.c +index 2851ed6..f5d1aaf 100644 --- a/src/daemon.c +++ b/src/daemon.c -@@ -976,22 +976,8 @@ +@@ -1075,34 +1075,18 @@ daemon_create_user_authorized_cb (Daemon *daemon, argv[1] = "-m"; argv[2] = "-c"; argv[3] = 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, ",", +- EXTRA_ADMIN_GROUPS, NULL); +- 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[8] = NULL; @@ -34,9 +42,8 @@ + argv[4] = cd->user_name; + argv[5] = NULL; - error = NULL; if (!spawn_with_login_uid (context, argv, &error)) { -@@ -1000,6 +986,10 @@ + throw_error (context, ERROR_FAILED, "running '%s' failed: %s", argv[0], error->message); return; } @@ -47,47 +54,11 @@ user = daemon_local_find_user_by_name (daemon, cd->user_name); user_update_local_account_property (user, TRUE); user_update_system_account_property (user, FALSE); ---- a/src/user.c -+++ b/src/user.c -@@ -1611,7 +1611,7 @@ - gid_t *groups; - gint ngroups; - GString *str; -- gid_t wheel; -+ gid_t admin; - struct group *grp; - gint i; - const gchar *argv[6]; -@@ -1623,22 +1623,22 @@ - - grp = getgrnam (ADMIN_GROUP); - if (grp == NULL) { -- throw_error (context, ERROR_FAILED, "failed to set account type: wheel group not found"); -+ throw_error (context, ERROR_FAILED, "failed to set account type: admin group not found"); - return; - } -- wheel = grp->gr_gid; -+ admin = grp->gr_gid; - - ngroups = get_user_groups (user->user_name, user->gid, &groups); - - str = g_string_new (""); - for (i = 0; i < ngroups; i++) { -- if (groups[i] == wheel) -+ if (groups[i] == admin) - continue; - g_string_append_printf (str, "%d,", groups[i]); - } - switch (account_type) { - case ACCOUNT_TYPE_ADMINISTRATOR: -- g_string_append_printf (str, "%d", wheel); -+ g_string_append_printf (str, "%d", admin); - break; - case ACCOUNT_TYPE_STANDARD: - default: +diff --git a/src/util.c b/src/util.c +index 0372b4b..684a58d 100644 --- a/src/util.c +++ b/src/util.c -@@ -313,3 +313,45 @@ +@@ -289,3 +289,43 @@ get_caller_uid (GDBusMethodInvocation *context, return TRUE; } @@ -97,18 +68,17 @@ + const char *user_name, + const char *group_name) +{ -+ GError *error; -+ gchar *argv[4]; ++ g_autoptr(GError) error = NULL; ++ const gchar *argv[4]; + -+ argv[0] = (gchar*) "/usr/sbin/adduser"; -+ argv[1] = (gchar*) user_name; -+ argv[2] = (gchar*) group_name; ++ argv[0] = "/usr/sbin/adduser"; ++ argv[1] = user_name; ++ argv[2] = group_name; + argv[3] = NULL; + + error = NULL; + if (!spawn_with_login_uid (context, argv, &error)) { + g_warning ("failed to add user %s to group %s", user_name, group_name); -+ g_error_free (error); + return; + } +} @@ -118,24 +88,25 @@ + const char *user_name, + const char *group_name) +{ -+ GError *error; -+ gchar *argv[4]; ++ g_autoptr(GError) error = NULL; ++ const gchar *argv[4]; + -+ argv[0] = (gchar*) "/usr/sbin/deluser"; -+ argv[1] = (gchar*) user_name; -+ argv[2] = (gchar*) group_name; ++ argv[0] = "/usr/sbin/deluser"; ++ argv[1] = user_name; ++ argv[2] = group_name; + argv[3] = NULL; + + error = NULL; + if (!spawn_with_login_uid (context, argv, &error)) { + g_warning ("failed to remove user %s from group %s", user_name, group_name); -+ g_error_free (error); + return; + } +} +diff --git a/src/util.h b/src/util.h +index 41ba545..c243c29 100644 --- a/src/util.h +++ b/src/util.h -@@ -40,6 +40,15 @@ +@@ -40,6 +40,15 @@ gint get_user_groups (const gchar *username, gid_t group, gid_t **groups); @@ -151,3 +122,6 @@ G_END_DECLS #endif /* __UTIL_H__ */ +-- +2.17.1 + diff -Nru accountsservice-0.6.45/debian/patches/0002-On-startup-clean-out-the-data-of-removed-users.patch accountsservice-0.6.50/debian/patches/0002-On-startup-clean-out-the-data-of-removed-users.patch --- accountsservice-0.6.45/debian/patches/0002-On-startup-clean-out-the-data-of-removed-users.patch 2017-12-18 03:42:18.000000000 +0100 +++ accountsservice-0.6.50/debian/patches/0002-On-startup-clean-out-the-data-of-removed-users.patch 1970-01-01 01:00:00.000000000 +0100 @@ -1,38 +0,0 @@ -From 9e27ad175331ab99cc18a43d4d9259da7d1695d1 Mon Sep 17 00:00:00 2001 -From: Gunnar Hjalmarsson -Date: Wed, 5 Feb 2014 14:45:19 +0000 -Subject: [PATCH 2/2] On startup, clean out the data of removed users - -https://bugs.freedesktop.org/show_bug.cgi?id=72596 ---- - src/daemon.c | 12 +++++++++--- - 1 file changed, 9 insertions(+), 3 deletions(-) - -Index: accountsservice-0.6.45/src/daemon.c -=================================================================== ---- accountsservice-0.6.45.orig/src/daemon.c -+++ accountsservice-0.6.45/src/daemon.c -@@ -293,14 +293,20 @@ entry_generator_cachedir (Daemon * - g_free (filename); - - if (regular) { -+ errno = 0; - pwent = getpwnam (name); -- if (pwent == NULL) { -- g_debug ("user '%s' in cache dir but not present on system", name); -- } else { -+ if (pwent != NULL) { - *shadow_entry = getspnam (pwent->pw_name); - - return pwent; - } -+ else if (errno == 0) { -+ g_debug ("user '%s' in cache dir but not present on system, removing", name); -+ remove_cache_files (name); -+ } -+ else -+ g_warning ("failed to check if user '%s' in cache dir is present on system: %s", -+ name, g_strerror (errno)); - } - } - diff -Nru accountsservice-0.6.45/debian/patches/0005-gdm_config_file_path.patch accountsservice-0.6.50/debian/patches/0005-gdm_config_file_path.patch --- accountsservice-0.6.45/debian/patches/0005-gdm_config_file_path.patch 2017-12-18 03:42:18.000000000 +0100 +++ accountsservice-0.6.50/debian/patches/0005-gdm_config_file_path.patch 1970-01-01 01:00:00.000000000 +0100 @@ -1,22 +0,0 @@ -Description: Fix path to the GDM configuration file, which is different - in Debian/Ubuntu. -Author: Josselin Mouette -Bug-Debian: http://bugs.debian.org/627311 -Bug: https://bugs.freedesktop.org/show_bug.cgi?id=49993 ---- - src/daemon.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -Index: accountsservice-0.6.45/src/daemon.c -=================================================================== ---- accountsservice-0.6.45.orig/src/daemon.c -+++ accountsservice-0.6.45/src/daemon.c -@@ -51,7 +51,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 "/etc/gdm3/custom.conf" - - enum { - PROP_0, diff -Nru accountsservice-0.6.45/debian/patches/0006-adduser_instead_of_useradd.patch accountsservice-0.6.50/debian/patches/0006-adduser_instead_of_useradd.patch --- accountsservice-0.6.45/debian/patches/0006-adduser_instead_of_useradd.patch 2017-12-18 03:42:18.000000000 +0100 +++ accountsservice-0.6.50/debian/patches/0006-adduser_instead_of_useradd.patch 2018-09-18 11:11:58.000000000 +0200 @@ -1,14 +1,18 @@ -Author: Alessio Treglia -Description: Replace useradd with adduser to comply with Debian Policy. -Bug-Ubuntu: https://launchpad.net/bugs/810907 -Forwarded: no +From f9a5a1a297bee6fe393f42cbc39325372be8c501 Mon Sep 17 00:00:00 2001 +From: Alessio Treglia +Date: Thu, 21 Dec 2017 15:05:01 +1300 +Subject: [PATCH 03/12] Replace useradd with adduser to comply with Debian + Policy. + --- - src/daemon.c | 13 +++++++------ + src/daemon.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) +diff --git a/src/daemon.c b/src/daemon.c +index f5d1aaf..69fb5b6 100644 --- a/src/daemon.c +++ b/src/daemon.c -@@ -972,12 +972,13 @@ +@@ -1071,12 +1071,13 @@ daemon_create_user_authorized_cb (Daemon *daemon, sys_log (context, "create user '%s'", cd->user_name); @@ -26,5 +30,8 @@ + argv[5] = cd->user_name; + argv[6] = NULL; - error = NULL; if (!spawn_with_login_uid (context, argv, &error)) { + throw_error (context, ERROR_FAILED, "running '%s' failed: %s", argv[0], error->message); +-- +2.17.1 + diff -Nru accountsservice-0.6.45/debian/patches/0007-add-lightdm-support.patch accountsservice-0.6.50/debian/patches/0007-add-lightdm-support.patch --- accountsservice-0.6.45/debian/patches/0007-add-lightdm-support.patch 2017-12-18 03:42:18.000000000 +0100 +++ accountsservice-0.6.50/debian/patches/0007-add-lightdm-support.patch 2018-09-18 11:11:58.000000000 +0200 @@ -1,45 +1,46 @@ -Description: Support setting/reading LightDM autologin setings -Author: Michael Terry -Bug: https://bugs.freedesktop.org/show_bug.cgi?id=40020 -Bug-Ubuntu: https://launchpad.net/bugs/798962 -Reviewed-by: Alessio Treglia -Last-Update: 2012-04-30 +From e9219ed9e4700cb4bbf961fdbef93063b8fa04e5 Mon Sep 17 00:00:00 2001 +From: Michael Terry +Date: Thu, 21 Dec 2017 15:08:44 +1300 +Subject: [PATCH 04/12] Support setting/reading LightDM autologin setings + --- - src/daemon.c | 143 ++++++++++++++++++++++++++++++++++++++++++++++++++++++----- - 1 file changed, 132 insertions(+), 11 deletions(-) + src/daemon.c | 127 +++++++++++++++++++++++++++++++++++++++++++++++---- + 1 file changed, 117 insertions(+), 10 deletions(-) +diff --git a/src/daemon.c b/src/daemon.c +index 69fb5b6..af340eb 100644 --- a/src/daemon.c +++ b/src/daemon.c -@@ -1344,10 +1344,10 @@ +@@ -1419,11 +1419,11 @@ daemon_local_check_auth (Daemon *daemon, + g_object_unref (subject); } - gboolean +-gboolean -load_autologin (Daemon *daemon, - gchar **name, - gboolean *enabled, - GError **error) ++static gboolean +load_autologin_gdm (Daemon *daemon, + gchar **name, + gboolean *enabled, + GError **error) { - GKeyFile *keyfile; - GError *local_error; -@@ -1390,23 +1390,89 @@ - return TRUE; + g_autoptr(GKeyFile) keyfile = NULL; + GError *local_error = NULL; +@@ -1459,21 +1459,81 @@ load_autologin (Daemon *daemon, } --static gboolean + static gboolean -save_autologin (Daemon *daemon, - const gchar *name, - gboolean enabled, -+gboolean +load_autologin_lightdm (Daemon *daemon, + gchar **name, + gboolean *enabled, + GError **error) +{ -+ GKeyFile *keyfile; ++ g_autoptr(GKeyFile) keyfile = NULL; + const gchar *filename; + + filename = "/etc/lightdm/lightdm.conf"; @@ -49,15 +50,12 @@ + filename, + G_KEY_FILE_KEEP_COMMENTS, + error)) { -+ g_key_file_free (keyfile); + return FALSE; + } + + *name = g_key_file_get_string (keyfile, "SeatDefaults", "autologin-user", error); + *enabled = (*error == NULL && (*name) && (*name)[0] != 0); + -+ g_key_file_free (keyfile); -+ + return (*error == NULL); +} + @@ -66,8 +64,8 @@ + gchar **name, + gboolean *enabled, GError **error) - { -+ GDBusProxy *proxy; ++{ ++ g_autoptr(GDBusProxy) proxy = NULL; + + /* First, determine whether we should load GDM or LightDM values by + checking if GDM is running. */ @@ -82,12 +80,10 @@ + NULL, /* GCancellable */ + NULL); /* GError */ + -+ if (proxy != NULL) { -+ g_object_unref (proxy); ++ if (proxy != NULL) + return load_autologin_gdm (daemon, name, enabled, error); -+ } else { ++ else + return load_autologin_lightdm (daemon, name, enabled, error); -+ } +} + +static gboolean @@ -95,11 +91,11 @@ + const gchar *name, + gboolean enabled, + GError **error) -+{ - GKeyFile *keyfile; - gchar *data; + { + g_autoptr(GKeyFile) keyfile = NULL; + g_autofree gchar *data = NULL; gboolean result; -+ GError *local_error = NULL; ++ g_autoptr(GError) local_error = NULL; + + if (!g_file_test ("/etc/gdm3", G_FILE_TEST_EXISTS)) + return TRUE; /* not an error, just not installed */ @@ -109,20 +105,17 @@ PATH_GDM_CUSTOM, G_KEY_FILE_KEEP_COMMENTS, - error)) { -- g_key_file_free (keyfile); - return FALSE; + &local_error)) { + /* It's OK for custom.conf to not exist, we will make it */ + if (!g_error_matches (local_error, G_FILE_ERROR, G_FILE_ERROR_NOENT)) { -+ g_propagate_error (error, local_error); -+ g_key_file_free (keyfile); ++ g_propagate_error (error, g_steal_pointer (&local_error)); + return FALSE; + } -+ g_error_free (local_error); } g_key_file_set_string (keyfile, "daemon", "AutomaticLoginEnable", enabled ? "True" : "False"); -@@ -1421,6 +1487,61 @@ +@@ -1485,6 +1545,53 @@ save_autologin (Daemon *daemon, return result; } @@ -132,11 +125,10 @@ + gboolean enabled, + GError **error) +{ -+ GKeyFile *keyfile; ++ g_autoptr(GKeyFile) keyfile = NULL; + const gchar *filename; -+ gchar *data; -+ gboolean result; -+ GError *local_error = NULL; ++ g_autofree gchar *data = NULL; ++ g_autoptr(GError) local_error = NULL; + + if (!g_file_test ("/etc/lightdm", G_FILE_TEST_EXISTS)) + return TRUE; /* not an error, just not installed */ @@ -150,22 +142,15 @@ + &local_error)) { + /* It's OK for custom.conf to not exist, we will make it */ + if (!g_error_matches (local_error, G_FILE_ERROR, G_FILE_ERROR_NOENT)) { -+ g_propagate_error (error, local_error); -+ g_key_file_free (keyfile); ++ g_propagate_error (error, g_steal_pointer (&local_error)); + return FALSE; + } -+ g_error_free (local_error); + } + + g_key_file_set_string (keyfile, "SeatDefaults", "autologin-user", enabled ? name : ""); + + data = g_key_file_to_data (keyfile, NULL, NULL); -+ result = g_file_set_contents (filename, data, -1, error); -+ -+ g_key_file_free (keyfile); -+ g_free (data); -+ -+ return result; ++ return g_file_set_contents (filename, data, -1, error); +} + +static gboolean @@ -184,3 +169,6 @@ gboolean daemon_local_set_automatic_login (Daemon *daemon, User *user, +-- +2.17.1 + diff -Nru accountsservice-0.6.45/debian/patches/0008-nopasswdlogin-group.patch accountsservice-0.6.50/debian/patches/0008-nopasswdlogin-group.patch --- accountsservice-0.6.45/debian/patches/0008-nopasswdlogin-group.patch 2017-12-18 03:42:18.000000000 +0100 +++ accountsservice-0.6.50/debian/patches/0008-nopasswdlogin-group.patch 1970-01-01 01:00:00.000000000 +0100 @@ -1,79 +0,0 @@ -Description: When setting a user to have no password, also add them to the 'nopasswdlogin' group. -Author: Michael Terry -Bug-Ubuntu: https://launchpad.net/bugs/815271 - ---- - src/user.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 46 insertions(+) - -Index: accountsservice-0.6.40/src/user.c -=================================================================== ---- accountsservice-0.6.40.orig/src/user.c -+++ accountsservice-0.6.40/src/user.c -@@ -1825,6 +1825,21 @@ user_change_password_mode_authorized_cb - return; - } - -+ if (mode == PASSWORD_MODE_NONE) { -+ argv[0] = "/usr/bin/gpasswd"; -+ argv[1] = "-a"; -+ argv[2] = user->user_name; -+ argv[3] = "nopasswdlogin"; -+ 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); -+ g_error_free (error); -+ return; -+ } -+ } -+ - if (mode == PASSWORD_MODE_SET_AT_LOGIN) { - argv[0] = "/usr/bin/chage"; - argv[1] = "-d"; -@@ -1872,6 +1887,23 @@ user_change_password_mode_authorized_cb - g_object_notify (G_OBJECT (user), "locked"); - } - -+ /* Remember to remove user from nopasswdlogin group if we're -+ switching away from no-password mode */ -+ if (user->password_mode == PASSWORD_MODE_NONE) { -+ argv[0] = "/usr/bin/gpasswd"; -+ argv[1] = "-d"; -+ argv[2] = user->user_name; -+ argv[3] = "nopasswdlogin"; -+ 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); -+ g_error_free (error); -+ return; -+ } -+ } -+ - user->password_mode = mode; - - g_object_notify (G_OBJECT (user), "password-mode"); -@@ -1939,6 +1971,20 @@ user_change_password_authorized_cb (Daem - - error = NULL; - if (!spawn_with_login_uid (context, argv, &error)) { -+ throw_error (context, ERROR_FAILED, "running '%s' failed: %s", argv[0], error->message); -+ g_error_free (error); -+ return; -+ } -+ -+ /* Drop user from nopasswdlogin group */ -+ argv[0] = "/usr/bin/gpasswd"; -+ argv[1] = "-d"; -+ argv[2] = user->user_name; -+ argv[3] = "nopasswdlogin"; -+ 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); - g_error_free (error); - return; diff -Nru accountsservice-0.6.45/debian/patches/0009-language-tools.patch accountsservice-0.6.50/debian/patches/0009-language-tools.patch --- accountsservice-0.6.45/debian/patches/0009-language-tools.patch 2017-12-18 03:42:18.000000000 +0100 +++ accountsservice-0.6.50/debian/patches/0009-language-tools.patch 2018-09-18 11:11:58.000000000 +0200 @@ -1,11 +1,36 @@ -Description: Help files for dealing with language/locale settings. -Author: Gunnar Hjalmarsson +From 183f999bda873e49555a84a4dd4bc530b9330a8b Mon Sep 17 00:00:00 2001 +From: Gunnar Hjalmarsson +Date: Thu, 21 Dec 2017 15:09:24 +1300 +Subject: [PATCH 05/12] Help files for dealing with language/locale settings. -Index: accountsservice-0.6.40/configure.ac -=================================================================== ---- accountsservice-0.6.40.orig/configure.ac -+++ accountsservice-0.6.40/configure.ac -@@ -294,6 +294,7 @@ AC_CONFIG_FILES([ +--- + configure.ac | 1 + + data/Makefile.am | 1 + + data/langtools/Makefile.am | 17 ++++++ + data/langtools/language-options | 84 ++++++++++++++++++++++++++++++ + data/langtools/language-validate | 82 +++++++++++++++++++++++++++++ + data/langtools/language2locale | 70 +++++++++++++++++++++++++ + data/langtools/locale2papersize | 18 +++++++ + data/langtools/main-countries | 28 ++++++++++ + data/langtools/save-to-pam-env | 40 ++++++++++++++ + data/langtools/set-language-helper | 27 ++++++++++ + data/langtools/update-langlist | 48 +++++++++++++++++ + 11 files changed, 416 insertions(+) + create mode 100644 data/langtools/Makefile.am + create mode 100644 data/langtools/language-options + create mode 100644 data/langtools/language-validate + create mode 100644 data/langtools/language2locale + create mode 100644 data/langtools/locale2papersize + create mode 100644 data/langtools/main-countries + create mode 100644 data/langtools/save-to-pam-env + create mode 100644 data/langtools/set-language-helper + create mode 100644 data/langtools/update-langlist + +diff --git a/configure.ac b/configure.ac +index 06cb5d7..beca5e8 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -362,6 +362,7 @@ AC_CONFIG_FILES([ Makefile po/Makefile.in data/Makefile @@ -13,85 +38,43 @@ src/Makefile src/libaccountsservice/Makefile src/libaccountsservice/accountsservice.pc -Index: accountsservice-0.6.40/data/langtools/language2locale -=================================================================== +diff --git a/data/Makefile.am b/data/Makefile.am +index 521c6c2..c90fae5 100644 +--- a/data/Makefile.am ++++ b/data/Makefile.am +@@ -1,3 +1,4 @@ ++SUBDIRS = langtools + + dbusifdir = $(datadir)/dbus-1/interfaces + dbusif_DATA = \ +diff --git a/data/langtools/Makefile.am b/data/langtools/Makefile.am +new file mode 100644 +index 0000000..ca345e0 --- /dev/null -+++ accountsservice-0.6.40/data/langtools/language2locale -@@ -0,0 +1,70 @@ -+#!/bin/sh -e -+# -+# - takes the first choice language in the LANGUAGE priority list as argument -+# - outputs locale name corresponding to that language -+ -+lang=$1 -+locale_name= -+ -+test -n "$lang" || exit 1 -+ -+# remove codeset if any -+if [ "$lang" != "${lang%.*}" ]; then -+ lang=$( echo $lang | sed -r 's/([^.]+)[^@]+(.*)/\1\2/' ) -+fi -+ -+langtoolsdir=/usr/share/language-tools -+ -+langcode=${lang%%[_@]*} -+locales= -+for loc in $( locale -a | grep -F .utf8 ); do -+ # skip locales for other languages -+ if [ $langcode = ${loc%%[._@]*} ]; then -+ loc=${loc%.*}${loc#*.utf8} -+ locales="$locales $loc" -+ fi -+done -+ -+# exact match -+for loc in $locales; do -+ if [ $lang = $loc ]; then -+ locale_name=$( echo $loc | sed -r 's/([^@]+)/\1.UTF-8/' ) -+ break -+ fi -+done -+ -+if [ -z "$locale_name" -a $lang = ${lang%_[A-Z]*} ]; then -+ -+ # try the "main" country code if any -+ main_country= -+ while read line; do -+ if [ "${line%%[[:space:]]*}" = $langcode ]; then -+ main_country=${line##*[[:space:]]} -+ if [ $lang != ${lang#*@} ]; then -+ main_country=$main_country@${lang#*@} -+ fi -+ break -+ fi -+ done < $langtoolsdir/main-countries -+ if [ -n "$main_country" ]; then -+ for loc in $locales; do -+ if [ $main_country = $loc ]; then -+ locale_name=$( echo $loc | sed -r 's/([^@]+)/\1.UTF-8/' ) -+ break -+ fi -+ done -+ fi ++++ b/data/langtools/Makefile.am +@@ -0,0 +1,17 @@ ++langtoolsdir = ${datadir}/language-tools + -+ # try out fitting locale with any country code -+ if [ -z "$locale_name" -a $langcode != 'zh' ]; then -+ for loc in $locales; do -+ if [ "${loc%%[_@]*}" = $langcode ]; then -+ locale_name=$( echo $loc | sed -r 's/([^@]+)/\1.UTF-8/' ) -+ break -+ fi -+ done -+ fi -+fi ++install-data-hook: ++ if test '!' -d $(DESTDIR)$(langtoolsdir); then \ ++ $(mkinstalldirs) $(DESTDIR)$(langtoolsdir); \ ++ chmod 755 $(DESTDIR)$(langtoolsdir); \ ++ fi + -+echo $locale_name ++ $(INSTALL_SCRIPT) language-options $(DESTDIR)$(langtoolsdir)/language-options ++ $(INSTALL_SCRIPT) language-validate $(DESTDIR)$(langtoolsdir)/language-validate ++ $(INSTALL_SCRIPT) language2locale $(DESTDIR)$(langtoolsdir)/language2locale ++ $(INSTALL_SCRIPT) locale2papersize $(DESTDIR)$(langtoolsdir)/locale2papersize ++ $(INSTALL_DATA) main-countries $(DESTDIR)$(langtoolsdir)/main-countries ++ $(INSTALL_SCRIPT) save-to-pam-env $(DESTDIR)$(langtoolsdir)/save-to-pam-env ++ $(INSTALL_SCRIPT) set-language-helper $(DESTDIR)$(langtoolsdir)/set-language-helper ++ $(INSTALL_SCRIPT) update-langlist $(DESTDIR)$(langtoolsdir)/update-langlist + -Index: accountsservice-0.6.40/data/langtools/language-options -=================================================================== +diff --git a/data/langtools/language-options b/data/langtools/language-options +new file mode 100644 +index 0000000..b1cc1f3 --- /dev/null -+++ accountsservice-0.6.40/data/langtools/language-options ++++ b/data/langtools/language-options @@ -0,0 +1,84 @@ +#!/usr/bin/perl +use strict; @@ -177,10 +160,11 @@ +# print the resulting list of language options +print join("\n", sort keys %intersection) || 'en'; + -Index: accountsservice-0.6.40/data/langtools/language-validate -=================================================================== +diff --git a/data/langtools/language-validate b/data/langtools/language-validate +new file mode 100644 +index 0000000..b87c132 --- /dev/null -+++ accountsservice-0.6.40/data/langtools/language-validate ++++ b/data/langtools/language-validate @@ -0,0 +1,82 @@ +#!/bin/sh -e + @@ -264,10 +248,87 @@ + +echo $validated_language + -Index: accountsservice-0.6.40/data/langtools/locale2papersize -=================================================================== +diff --git a/data/langtools/language2locale b/data/langtools/language2locale +new file mode 100644 +index 0000000..874b357 --- /dev/null -+++ accountsservice-0.6.40/data/langtools/locale2papersize ++++ b/data/langtools/language2locale +@@ -0,0 +1,70 @@ ++#!/bin/sh -e ++# ++# - takes the first choice language in the LANGUAGE priority list as argument ++# - outputs locale name corresponding to that language ++ ++lang=$1 ++locale_name= ++ ++test -n "$lang" || exit 1 ++ ++# remove codeset if any ++if [ "$lang" != "${lang%.*}" ]; then ++ lang=$( echo $lang | sed -r 's/([^.]+)[^@]+(.*)/\1\2/' ) ++fi ++ ++langtoolsdir=/usr/share/language-tools ++ ++langcode=${lang%%[_@]*} ++locales= ++for loc in $( locale -a | grep -F .utf8 ); do ++ # skip locales for other languages ++ if [ $langcode = ${loc%%[._@]*} ]; then ++ loc=${loc%.*}${loc#*.utf8} ++ locales="$locales $loc" ++ fi ++done ++ ++# exact match ++for loc in $locales; do ++ if [ $lang = $loc ]; then ++ locale_name=$( echo $loc | sed -r 's/([^@]+)/\1.UTF-8/' ) ++ break ++ fi ++done ++ ++if [ -z "$locale_name" -a $lang = ${lang%_[A-Z]*} ]; then ++ ++ # try the "main" country code if any ++ main_country= ++ while read line; do ++ if [ "${line%%[[:space:]]*}" = $langcode ]; then ++ main_country=${line##*[[:space:]]} ++ if [ $lang != ${lang#*@} ]; then ++ main_country=$main_country@${lang#*@} ++ fi ++ break ++ fi ++ done < $langtoolsdir/main-countries ++ if [ -n "$main_country" ]; then ++ for loc in $locales; do ++ if [ $main_country = $loc ]; then ++ locale_name=$( echo $loc | sed -r 's/([^@]+)/\1.UTF-8/' ) ++ break ++ fi ++ done ++ fi ++ ++ # try out fitting locale with any country code ++ if [ -z "$locale_name" -a $langcode != 'zh' ]; then ++ for loc in $locales; do ++ if [ "${loc%%[_@]*}" = $langcode ]; then ++ locale_name=$( echo $loc | sed -r 's/([^@]+)/\1.UTF-8/' ) ++ break ++ fi ++ done ++ fi ++fi ++ ++echo $locale_name ++ +diff --git a/data/langtools/locale2papersize b/data/langtools/locale2papersize +new file mode 100644 +index 0000000..3fcc13b +--- /dev/null ++++ b/data/langtools/locale2papersize @@ -0,0 +1,18 @@ +#!/bin/sh -e +# @@ -287,10 +348,11 @@ + +echo $size + -Index: accountsservice-0.6.40/data/langtools/main-countries -=================================================================== +diff --git a/data/langtools/main-countries b/data/langtools/main-countries +new file mode 100644 +index 0000000..c6bbd32 --- /dev/null -+++ accountsservice-0.6.40/data/langtools/main-countries ++++ b/data/langtools/main-countries @@ -0,0 +1,28 @@ +# If multiple country codes are present among the available locales for +# a language, we may want to map the language code to the language's @@ -320,32 +382,11 @@ +ti ti_ER +tr tr_TR + -Index: accountsservice-0.6.40/data/langtools/Makefile.am -=================================================================== ---- /dev/null -+++ accountsservice-0.6.40/data/langtools/Makefile.am -@@ -0,0 +1,17 @@ -+langtoolsdir = ${datadir}/language-tools -+ -+install-data-hook: -+ if test '!' -d $(DESTDIR)$(langtoolsdir); then \ -+ $(mkinstalldirs) $(DESTDIR)$(langtoolsdir); \ -+ chmod 755 $(DESTDIR)$(langtoolsdir); \ -+ fi -+ -+ $(INSTALL_SCRIPT) language-options $(DESTDIR)$(langtoolsdir)/language-options -+ $(INSTALL_SCRIPT) language-validate $(DESTDIR)$(langtoolsdir)/language-validate -+ $(INSTALL_SCRIPT) language2locale $(DESTDIR)$(langtoolsdir)/language2locale -+ $(INSTALL_SCRIPT) locale2papersize $(DESTDIR)$(langtoolsdir)/locale2papersize -+ $(INSTALL_DATA) main-countries $(DESTDIR)$(langtoolsdir)/main-countries -+ $(INSTALL_SCRIPT) save-to-pam-env $(DESTDIR)$(langtoolsdir)/save-to-pam-env -+ $(INSTALL_SCRIPT) set-language-helper $(DESTDIR)$(langtoolsdir)/set-language-helper -+ $(INSTALL_SCRIPT) update-langlist $(DESTDIR)$(langtoolsdir)/update-langlist -+ -Index: accountsservice-0.6.40/data/langtools/save-to-pam-env -=================================================================== +diff --git a/data/langtools/save-to-pam-env b/data/langtools/save-to-pam-env +new file mode 100644 +index 0000000..2492957 --- /dev/null -+++ accountsservice-0.6.40/data/langtools/save-to-pam-env ++++ b/data/langtools/save-to-pam-env @@ -0,0 +1,40 @@ +#!/bin/sh -e +# @@ -371,7 +412,7 @@ + fi +} + -+cd "$homedir" ++cd "$homedir" +if [ -n "$language_list" ]; then + save_to_pam_env 'LANGUAGE' $language_list + save_to_pam_env 'LANG' $locale_name @@ -383,14 +424,15 @@ + papersize=$( $langtoolsdir/locale2papersize $locale_name ) + save_to_pam_env 'PAPERSIZE' $papersize + echo $locale_name -+fi ++fi + +exit 0 + -Index: accountsservice-0.6.40/data/langtools/set-language-helper -=================================================================== +diff --git a/data/langtools/set-language-helper b/data/langtools/set-language-helper +new file mode 100644 +index 0000000..efbb394 --- /dev/null -+++ accountsservice-0.6.40/data/langtools/set-language-helper ++++ b/data/langtools/set-language-helper @@ -0,0 +1,27 @@ +#!/bin/sh -e + @@ -419,10 +461,11 @@ + +echo $validated_language + -Index: accountsservice-0.6.40/data/langtools/update-langlist -=================================================================== +diff --git a/data/langtools/update-langlist b/data/langtools/update-langlist +new file mode 100644 +index 0000000..317a60b --- /dev/null -+++ accountsservice-0.6.40/data/langtools/update-langlist ++++ b/data/langtools/update-langlist @@ -0,0 +1,48 @@ +#!/bin/sh -e +# @@ -472,12 +515,6 @@ + +echo $renewed_langlist + -Index: accountsservice-0.6.40/data/Makefile.am -=================================================================== ---- accountsservice-0.6.40.orig/data/Makefile.am -+++ accountsservice-0.6.40/data/Makefile.am -@@ -1,3 +1,4 @@ -+SUBDIRS = langtools - - dbusifdir = $(datadir)/dbus-1/interfaces - dbusif_DATA = \ +-- +2.17.1 + diff -Nru accountsservice-0.6.45/debian/patches/0010-set-language.patch accountsservice-0.6.50/debian/patches/0010-set-language.patch --- accountsservice-0.6.45/debian/patches/0010-set-language.patch 2017-12-18 03:42:18.000000000 +0100 +++ accountsservice-0.6.50/debian/patches/0010-set-language.patch 2018-09-18 11:11:58.000000000 +0200 @@ -1,11 +1,37 @@ -Description: Save user language and regional formats settings to ~/.pam_environment. -Author: Gunnar Hjalmarsson +From f9988cd827c01006437d2b93e10dfa0f84c6d93b Mon Sep 17 00:00:00 2001 +From: Gunnar Hjalmarsson +Date: Thu, 21 Dec 2017 15:09:54 +1300 +Subject: [PATCH 06/12] Save user language and regional formats settings to + ~/.pam_environment. -Index: accountsservice-0.6.45/src/user.c -=================================================================== ---- accountsservice-0.6.45.orig/src/user.c -+++ accountsservice-0.6.45/src/user.c -@@ -1059,6 +1059,307 @@ user_set_email (AccountsUser *a +--- + src/user.c | 386 ++++++++++++++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 379 insertions(+), 7 deletions(-) + +diff --git a/src/user.c b/src/user.c +index 88778cb..ef578b7 100644 +--- a/src/user.c ++++ b/src/user.c +@@ -726,6 +726,8 @@ user_changed (User *user) + accounts_user_emit_changed (ACCOUNTS_USER (user)); + } + ++static gchar *user_get_fallback_value (User *user, const gchar *property); ++ + User * + user_new (Daemon *daemon, + uid_t uid) +@@ -736,6 +738,9 @@ user_new (Daemon *daemon, + user->daemon = daemon; + accounts_user_set_uid (ACCOUNTS_USER (user), uid); + ++ accounts_user_set_language (ACCOUNTS_USER (user), user_get_fallback_value (user, "Language")); ++ accounts_user_set_formats_locale (ACCOUNTS_USER (user), user_get_fallback_value (user, "FormatsLocale")); ++ + return user; + } + +@@ -981,6 +986,307 @@ user_set_email (AccountsUser *auser, return TRUE; } @@ -16,7 +42,7 @@ + g_warning ("setresgid() failed"); + return FALSE; + } -+ if (setresuid (user->uid, user->uid, -1) != 0) { ++ if (setresuid (accounts_user_get_uid (ACCOUNTS_USER (user)), accounts_user_get_uid (ACCOUNTS_USER (user)), -1) != 0) { + g_warning ("setresuid() failed"); + return FALSE; + } @@ -192,7 +218,7 @@ + system_language = user_language_validate (user, tmp); + fallback_value = system_language; + } -+ ++ + if (g_strcmp0 (property, "FormatsLocale") == 0) { + gchar *tmp = NULL; + if (lctime) @@ -229,7 +255,7 @@ + return NULL; + + program = g_build_path ("/", "/usr/share/language-tools", script, NULL); -+ gchar *command[] = { program, user->home_dir, data, NULL }; ++ const gchar *command[] = { program, accounts_user_get_home_directory (ACCOUNTS_USER (user)), data, NULL }; + + /* test for odd characters in arguments */ + for (i = 1; i <= 2; i++) { @@ -243,7 +269,7 @@ + if (!user_drop_privileges_to_user (user)) + goto out; + ret = g_spawn_sync ( NULL, -+ command, ++ (gchar **)command, + NULL, + G_SPAWN_STDERR_TO_DEV_NULL, + NULL, @@ -280,7 +306,7 @@ + failures when HOME is on NFS */ + user_drop_privileges_to_user (user); + -+ GDir* homedir = g_dir_open (user->home_dir, 0, NULL); ++ GDir* homedir = g_dir_open (accounts_user_get_home_directory (ACCOUNTS_USER (user)), 0, NULL); + + if (homedir == NULL) { // HOME not found + user_regain_privileges (); @@ -288,7 +314,7 @@ + } else { + do { + const gchar *entry = g_dir_read_name (homedir); -+ gchar *path_to_entry = g_build_path ("/", user->home_dir, entry, NULL); ++ gchar *path_to_entry = g_build_path ("/", accounts_user_get_home_directory (ACCOUNTS_USER (user)), entry, NULL); + if (g_file_test (path_to_entry, G_FILE_TEST_IS_SYMLINK)) { + g_free (path_to_entry); + continue; @@ -313,14 +339,15 @@ static void user_change_language_authorized_cb (Daemon *daemon, User *user, -@@ -1066,11 +1367,78 @@ user_change_language_authorized_cb (Daem +@@ -988,14 +1294,77 @@ user_change_language_authorized_cb (Daemon *daemon, gpointer data) { - gchar *language = data; ++ const gchar *language = accounts_user_get_language (ACCOUNTS_USER (user)); + const gchar *fallback_language = user_get_fallback_value (user, "Language"); -+ gboolean is_language_changed = (user->language && g_strcmp0 (user->language, data) != 0) -+ || (!user->language && g_strcmp0 (data, fallback_language) != 0); ++ gboolean is_language_changed = (language && g_strcmp0 (language, data) != 0) ++ || (!language && g_strcmp0 (data, fallback_language) != 0); + + if (!user_HOME_available (user)) { + @@ -337,17 +364,12 @@ + data, + "set-language-helper", + context); -+ if (language != NULL) { -+ g_free (user->language); -+ user->language = language; -+ } ++ if (language != NULL) ++ accounts_user_set_language (ACCOUNTS_USER (user), language); + -+ gchar *locale = NULL; - -- if (g_strcmp0 (user->language, language) != 0) { -- g_free (user->language); -- user->language = g_strdup (language); -+ if (!user->formats_locale) { ++ g_autofree gchar *locale = NULL; ++ ++ if (!accounts_user_get_formats_locale (ACCOUNTS_USER (user))) { + + /* set the user formats (certain LC_* variables) explicitly + in order to prevent surprises when LANG is changed */ @@ -364,83 +386,58 @@ + fclose (fp); + } + if (locale == NULL) { -+ GError *error = NULL; ++ g_autoptr(GError) error = NULL; + const gchar *program = "/usr/share/language-tools/language2locale"; + if (!user_drop_privileges_to_user (user)) + goto out1; -+ gchar *command = g_strconcat (program, " ", fallback_language, NULL); ++ g_autofree gchar *command = g_strconcat (program, " ", fallback_language, NULL); + gboolean ret = g_spawn_command_line_sync (command, &locale, NULL, NULL, &error); + user_regain_privileges (); + if (!ret) { + throw_error (context, ERROR_FAILED, + "language-to-locale conversion failed: %s", error->message); -+ g_error_free (error); + locale = NULL; + } -+ g_free (command); + } + } -+ + +- if (g_strcmp0 (accounts_user_get_language (ACCOUNTS_USER (user)), language) != 0) { +- accounts_user_set_language (ACCOUNTS_USER (user), language); + if (locale != NULL && strlen (locale) > 0) { + gchar *formats_locale = user_update_environment (user, + user_locale_validate (user, locale, context), + "save-to-pam-env", + context); -+ if (formats_locale != NULL) { -+ g_free (user->formats_locale); -+ user->formats_locale = formats_locale; -+ } ++ if (formats_locale != NULL) ++ accounts_user_set_formats_locale (ACCOUNTS_USER (user), formats_locale); + } +out1: -+ g_free (locale); save_extra_data (user); - -@@ -1079,6 +1447,7 @@ user_change_language_authorized_cb (Daem - g_object_notify (G_OBJECT (user), "language"); } +out2: accounts_user_complete_set_language (ACCOUNTS_USER (user), context); } -@@ -1122,11 +1491,15 @@ user_change_formats_locale_authorized_cb +@@ -1039,10 +1408,13 @@ user_change_formats_locale_authorized_cb (Daemon *daemon, gpointer data) { - gchar *formats_locale = data; - -- if (g_strcmp0 (user->formats_locale, formats_locale) != 0) { -- g_free (user->formats_locale); -- user->formats_locale = g_strdup (formats_locale); -+ if (g_strcmp0 (user->formats_locale, data) != 0) { +- if (g_strcmp0 (accounts_user_get_formats_locale (ACCOUNTS_USER (user)), formats_locale) != 0) { +- accounts_user_set_formats_locale (ACCOUNTS_USER (user), formats_locale); ++ if (g_strcmp0 (accounts_user_get_formats_locale (ACCOUNTS_USER (user)), data) != 0) { + gchar *formats_locale = user_update_environment (user, + user_locale_validate (user, data, context), + "save-to-pam-env", + context); -+ if (formats_locale != NULL) { -+ g_free (user->formats_locale); -+ user->formats_locale = formats_locale; -+ } ++ if (formats_locale != NULL) ++ accounts_user_set_formats_locale (ACCOUNTS_USER (user), formats_locale); save_extra_data (user); - -@@ -2372,10 +2745,16 @@ user_get_property (GObject *object, - g_value_set_string (value, user->email); - break; - case PROP_LANGUAGE: -- g_value_set_string (value, user->language); -+ if (user->language) -+ g_value_set_string (value, user->language); -+ else -+ g_value_set_string (value, user_get_fallback_value (user, "Language")); - break; - case PROP_FORMATS_LOCALE: -- g_value_set_string (value, user->formats_locale); -+ if (user->formats_locale) -+ g_value_set_string (value, user->formats_locale); -+ else -+ g_value_set_string (value, user_get_fallback_value (user, "FormatsLocale")); - break; - case PROP_X_SESSION: - g_value_set_string (value, user->x_session); + } +-- +2.17.1 + diff -Nru accountsservice-0.6.45/debian/patches/0011-add-background-file-support.patch accountsservice-0.6.50/debian/patches/0011-add-background-file-support.patch --- accountsservice-0.6.45/debian/patches/0011-add-background-file-support.patch 2017-12-18 03:42:18.000000000 +0100 +++ accountsservice-0.6.50/debian/patches/0011-add-background-file-support.patch 2018-09-18 11:11:58.000000000 +0200 @@ -1,11 +1,19 @@ -Description: Add support for a BackgroundFile property, similar to IconFile. -Author: Michael Terry -Bug-Ubuntu: https://launchpad.net/bugs/844081 +From 87bf7e8e06fb7e7d44e0cb86662a04d50ffe666b Mon Sep 17 00:00:00 2001 +From: Michael Terry +Date: Thu, 21 Dec 2017 15:11:01 +1300 +Subject: [PATCH 07/12] Add support for a BackgroundFile property, similar to + IconFile -Index: accountsservice-0.6.45/data/org.freedesktop.Accounts.User.xml -=================================================================== ---- accountsservice-0.6.45.orig/data/org.freedesktop.Accounts.User.xml -+++ accountsservice-0.6.45/data/org.freedesktop.Accounts.User.xml +--- + data/org.freedesktop.Accounts.User.xml | 45 ++++++++++++++ + src/libaccountsservice/act-user.c | 55 +++++++++++++++++ + src/user.c | 81 ++++++++++++++++++++++++++ + 3 files changed, 181 insertions(+) + +diff --git a/data/org.freedesktop.Accounts.User.xml b/data/org.freedesktop.Accounts.User.xml +index 0856974..103661c 100644 +--- a/data/org.freedesktop.Accounts.User.xml ++++ b/data/org.freedesktop.Accounts.User.xml @@ -331,6 +331,41 @@ @@ -48,12 +56,10 @@ -@@ -768,6 +803,16 @@ - - +@@ -770,6 +805,16 @@ -+ -+ + + + + + @@ -62,14 +68,16 @@ + + + - - ++ ++ -Index: accountsservice-0.6.45/src/libaccountsservice/act-user.c -=================================================================== ---- accountsservice-0.6.45.orig/src/libaccountsservice/act-user.c -+++ accountsservice-0.6.45/src/libaccountsservice/act-user.c -@@ -91,6 +91,7 @@ enum { + + +diff --git a/src/libaccountsservice/act-user.c b/src/libaccountsservice/act-user.c +index b2db572..d20c3df 100644 +--- a/src/libaccountsservice/act-user.c ++++ b/src/libaccountsservice/act-user.c +@@ -93,6 +93,7 @@ enum { PROP_LOGIN_FREQUENCY, PROP_LOGIN_TIME, PROP_LOGIN_HISTORY, @@ -77,50 +85,25 @@ PROP_ICON_FILE, PROP_LANGUAGE, PROP_FORMATS_LOCALE, -@@ -121,6 +122,7 @@ struct _ActUser { - char *shell; - char *email; - char *location; -+ char *background_file; - char *icon_file; - char *language; - char *formats_locale; -@@ -304,6 +306,9 @@ act_user_get_property (GObject *objec - case PROP_LOCATION: - g_value_set_string (value, user->location); - break; -+ case PROP_BACKGROUND_FILE: -+ g_value_set_string (value, user->background_file); -+ break; - case PROP_ICON_FILE: - g_value_set_string (value, user->icon_file); - break; -@@ -455,6 +460,13 @@ act_user_class_init (ActUserClass *class +@@ -373,6 +374,13 @@ act_user_class_init (ActUserClass *class) + G_VARIANT_TYPE ("a(xxa{sv})"), NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); - g_object_class_install_property (gobject_class, ++ g_object_class_install_property (gobject_class, + PROP_BACKGROUND_FILE, + g_param_spec_string ("background-file", + "Background File", + "The path to a background for this user.", + NULL, + G_PARAM_READABLE)); -+ g_object_class_install_property (gobject_class, + g_object_class_install_property (gobject_class, PROP_ICON_FILE, g_param_spec_string ("icon-file", - "Icon File", -@@ -585,6 +597,7 @@ act_user_finalize (GObject *object) - - g_free (user->user_name); - g_free (user->real_name); -+ g_free (user->background_file); - g_free (user->icon_file); - g_free (user->language); - g_free (user->object_path); -@@ -1033,6 +1046,22 @@ act_user_is_nonexistent (ActUser *user +@@ -977,6 +985,25 @@ act_user_is_nonexistent (ActUser *user) + return user->nonexistent; } - /** ++/** + * act_user_get_background_file: + * @user: a #ActUser + * @@ -133,35 +116,19 @@ +{ + g_return_val_if_fail (ACT_IS_USER (user), NULL); + -+ return user->background_file; ++ if (user->accounts_proxy == NULL) ++ return NULL; ++ ++ return accounts_user_get_background_file (user->accounts_proxy); +} + -+/** + /** * act_user_get_icon_file: * @user: a #ActUser - * -@@ -1290,6 +1319,15 @@ collect_props (const gchar *key, - user->login_history = g_variant_ref (new_login_history); - g_object_notify (G_OBJECT (user), "login-history"); - } -+ } else if (strcmp (key, "BackgroundFile") == 0) { -+ const char *new_background_file; -+ -+ new_background_file = g_variant_get_string (value, NULL); -+ if (g_strcmp0 (user->background_file, new_background_file) != 0) { -+ g_free (user->background_file); -+ user->background_file = g_strdup (new_background_file); -+ g_object_notify (G_OBJECT (user), "background-file"); -+ } - } else if (strcmp (key, "IconFile") == 0) { - const char *new_icon_file; - -@@ -1743,6 +1781,35 @@ act_user_set_language (ActUser *user, - g_error_free (error); - return; +@@ -1364,6 +1391,34 @@ act_user_set_language (ActUser *user, } -+} -+ + } + +/** + * act_user_set_background_file: + * @user: the user object to alter. @@ -175,7 +142,7 @@ +act_user_set_background_file (ActUser *user, + const char *background_file) +{ -+ GError *error = NULL; ++ g_autoptr(GError) error = NULL; + + g_return_if_fail (ACT_IS_USER (user)); + g_return_if_fail (background_file != NULL); @@ -186,68 +153,53 @@ + NULL, + &error)) { + g_warning ("SetBackgroundFile call failed: %s", error->message); -+ g_error_free (error); + return; + } - } - ++} ++ /** -Index: accountsservice-0.6.45/src/user.c -=================================================================== ---- accountsservice-0.6.45.orig/src/user.c -+++ accountsservice-0.6.45/src/user.c -@@ -64,6 +64,7 @@ enum { - PROP_LOGIN_FREQUENCY, - PROP_LOGIN_TIME, - PROP_LOGIN_HISTORY, -+ PROP_BACKGROUND_FILE, - PROP_ICON_FILE, - PROP_LOCKED, - PROP_PASSWORD_MODE, -@@ -98,6 +99,7 @@ struct User { - gchar *x_session; - gchar *location; - guint64 login_frequency; -+ gchar *background_file; - gint64 login_time; - gint64 expiration_time; - gint64 last_change_time; -@@ -356,6 +358,13 @@ user_update_from_keyfile (User *user - g_object_notify (G_OBJECT (user), "password-hint"); + * act_user_set_x_session: + * @user: the user object to alter. +diff --git a/src/user.c b/src/user.c +index ef578b7..4b2edca 100644 +--- a/src/user.c ++++ b/src/user.c +@@ -286,6 +286,12 @@ user_update_from_keyfile (User *user, + g_clear_pointer (&s, g_free); } + s = g_key_file_get_string (keyfile, "User", "Background", NULL); + if (s != NULL) { -+ g_free (user->background_file); -+ user->background_file = s; -+ g_object_notify (G_OBJECT (user), "background-file"); ++ accounts_user_set_background_file (ACCOUNTS_USER (user), s); ++ g_clear_pointer (&s, g_free); + } + s = g_key_file_get_string (keyfile, "User", "Icon", NULL); if (s != NULL) { - g_free (user->icon_file); -@@ -423,6 +432,9 @@ user_save_to_keyfile (User *user, - if (user->password_hint) - g_key_file_set_string (keyfile, "User", "PasswordHint", user->password_hint); + accounts_user_set_icon_file (ACCOUNTS_USER (user), s); +@@ -344,6 +350,9 @@ user_save_to_keyfile (User *user, + if (accounts_user_get_password_hint (ACCOUNTS_USER (user))) + g_key_file_set_string (keyfile, "User", "PasswordHint", accounts_user_get_password_hint (ACCOUNTS_USER (user))); -+ if (user->background_file) -+ g_key_file_set_string (keyfile, "User", "Background", user->background_file); ++ if (accounts_user_get_background_file (ACCOUNTS_USER (user))) ++ g_key_file_set_string (keyfile, "User", "Background", accounts_user_get_background_file (ACCOUNTS_USER (user))); + - if (user->icon_file) - g_key_file_set_string (keyfile, "User", "Icon", user->icon_file); + if (accounts_user_get_icon_file (ACCOUNTS_USER (user))) + g_key_file_set_string (keyfile, "User", "Icon", accounts_user_get_icon_file (ACCOUNTS_USER (user))); -@@ -1834,6 +1846,86 @@ become_user (gpointer data) +@@ -1729,6 +1738,77 @@ become_user (gpointer data) + } } - static void ++static void +user_change_background_file_authorized_cb (Daemon *daemon, + User *user, + GDBusMethodInvocation *context, + gpointer data) +{ -+ gchar *filename; -+ GFile *file; -+ GFileInfo *info; ++ g_autofree gchar *filename = NULL; ++ g_autoptr(GFile) file = NULL; ++ g_autoptr(GFileInfo) info = NULL; + GFileType type; + + filename = g_strdup (data); @@ -265,30 +217,21 @@ + 0, NULL, NULL); + type = g_file_info_get_file_type (info); + -+ g_object_unref (info); -+ g_object_unref (file); -+ + if (type != G_FILE_TYPE_REGULAR) { + g_debug ("not a regular file\n"); + throw_error (context, ERROR_FAILED, "file '%s' is not a regular file", filename); -+ g_free (filename); + return; + } + +background_saved: -+ g_free (user->background_file); -+ user->background_file = filename; ++ accounts_user_set_background_file (ACCOUNTS_USER (user), filename); + + save_extra_data (user); + -+ accounts_user_emit_changed (ACCOUNTS_USER (user)); -+ -+ g_object_notify (G_OBJECT (user), "background-file"); -+ + accounts_user_complete_set_background_file (ACCOUNTS_USER (user), context); +} + -+gboolean ++static gboolean +user_set_background_file (AccountsUser *auser, + GDBusMethodInvocation *context, + const gchar *filename) @@ -302,7 +245,7 @@ + return FALSE; + } + -+ if (user->uid == (uid_t) uid) ++ if (accounts_user_get_uid (ACCOUNTS_USER (user)) == (uid_t) uid) + action_id = "org.freedesktop.accounts.change-own-user-data"; + else + action_id = "org.freedesktop.accounts.user-administration"; @@ -319,29 +262,10 @@ + return TRUE; +} + -+static void + static void user_change_icon_file_authorized_cb (Daemon *daemon, User *user, - GDBusMethodInvocation *context, -@@ -2647,6 +2739,7 @@ user_finalize (GObject *object) - g_free (user->shell); - g_free (user->icon_file); - g_free (user->default_icon_file); -+ g_free (user->background_file); - g_free (user->email); - g_free (user->language); - g_free (user->formats_locale); -@@ -2762,6 +2855,9 @@ user_get_property (GObject *object, - case PROP_LOCATION: - g_value_set_string (value, user->location); - break; -+ case PROP_BACKGROUND_FILE: -+ g_value_set_string (value, user->background_file); -+ break; - case PROP_ICON_FILE: - if (user->icon_file) - g_value_set_string (value, user->icon_file); -@@ -2818,6 +2914,7 @@ user_accounts_user_iface_init (AccountsU +@@ -2411,6 +2491,7 @@ user_accounts_user_iface_init (AccountsUserIface *iface) { iface->handle_set_account_type = user_set_account_type; iface->handle_set_automatic_login = user_set_automatic_login; @@ -349,11 +273,6 @@ iface->handle_set_email = user_set_email; iface->handle_set_formats_locale = user_set_formats_locale; iface->handle_set_home_directory = user_set_home_directory; -@@ -2864,6 +2961,7 @@ user_init (User *user) - user->account_type = ACCOUNT_TYPE_STANDARD; - user->home_dir = NULL; - user->shell = NULL; -+ user->background_file = NULL; - user->icon_file = NULL; - user->default_icon_file = NULL; - user->email = NULL; +-- +2.17.1 + diff -Nru accountsservice-0.6.45/debian/patches/0012-add-keyboard-layout-support.patch accountsservice-0.6.50/debian/patches/0012-add-keyboard-layout-support.patch --- accountsservice-0.6.45/debian/patches/0012-add-keyboard-layout-support.patch 2017-12-18 03:42:18.000000000 +0100 +++ accountsservice-0.6.50/debian/patches/0012-add-keyboard-layout-support.patch 2018-09-18 11:11:58.000000000 +0200 @@ -1,11 +1,19 @@ -Description: Add XKeyboardLayouts property to report a user's keyboard layouts, largely for LightDM's benefit. -Author: Michael Terry -Bug-Ubuntu: https://launchpad.net/bugs/915468 +From 106f216adfdf8a31aeb2d6d9794f6b4e0301598e Mon Sep 17 00:00:00 2001 +From: Michael Terry +Date: Thu, 21 Dec 2017 15:11:19 +1300 +Subject: [PATCH 08/12] Add XKeyboardLayouts property to report a user's + keyboard layouts, largely for LightDM's benefit. -Index: accountsservice-0.6.45/data/org.freedesktop.Accounts.User.xml -=================================================================== ---- accountsservice-0.6.45.orig/data/org.freedesktop.Accounts.User.xml -+++ accountsservice-0.6.45/data/org.freedesktop.Accounts.User.xml +--- + data/org.freedesktop.Accounts.User.xml | 45 +++++++++++++++++++++ + src/libaccountsservice/act-user.c | 55 ++++++++++++++++++++++++++ + src/user.c | 55 ++++++++++++++++++++++++++ + 3 files changed, 155 insertions(+) + +diff --git a/data/org.freedesktop.Accounts.User.xml b/data/org.freedesktop.Accounts.User.xml +index 103661c..550804c 100644 +--- a/data/org.freedesktop.Accounts.User.xml ++++ b/data/org.freedesktop.Accounts.User.xml @@ -331,6 +331,41 @@ @@ -48,12 +56,10 @@ -@@ -803,6 +838,16 @@ - - +@@ -805,6 +840,16 @@ -+ -+ + + + + + @@ -62,75 +68,151 @@ + + + - - ++ ++ -Index: accountsservice-0.6.45/src/user.c -=================================================================== ---- accountsservice-0.6.45.orig/src/user.c -+++ accountsservice-0.6.45/src/user.c -@@ -64,6 +64,7 @@ enum { + + +diff --git a/src/libaccountsservice/act-user.c b/src/libaccountsservice/act-user.c +index d20c3df..3f71650 100644 +--- a/src/libaccountsservice/act-user.c ++++ b/src/libaccountsservice/act-user.c +@@ -93,6 +93,7 @@ enum { PROP_LOGIN_FREQUENCY, PROP_LOGIN_TIME, PROP_LOGIN_HISTORY, + PROP_X_KEYBOARD_LAYOUTS, PROP_BACKGROUND_FILE, PROP_ICON_FILE, - PROP_LOCKED, -@@ -99,6 +100,7 @@ struct User { - gchar *x_session; - gchar *location; - guint64 login_frequency; -+ gchar **x_keyboard_layouts; - gchar *background_file; - gint64 login_time; - gint64 expiration_time; -@@ -358,6 +360,13 @@ user_update_from_keyfile (User *user - g_object_notify (G_OBJECT (user), "password-hint"); + PROP_LANGUAGE, +@@ -374,6 +375,13 @@ act_user_class_init (ActUserClass *class) + G_VARIANT_TYPE ("a(xxa{sv})"), + NULL, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); ++ g_object_class_install_property (gobject_class, ++ PROP_X_KEYBOARD_LAYOUTS, ++ g_param_spec_boxed ("xkeyboard-layouts", ++ "Keyboard layouts", ++ "The name of keyboard layouts for this user.", ++ G_TYPE_STRV, ++ G_PARAM_READABLE)); + g_object_class_install_property (gobject_class, + PROP_BACKGROUND_FILE, + g_param_spec_string ("background-file", +@@ -985,6 +993,25 @@ act_user_is_nonexistent (ActUser *user) + return user->nonexistent; + } + ++/** ++ * act_user_get_x_keyboard_layouts: ++ * @user: a #ActUser ++ * ++ * Returns the name of the account keyboard layouts belonging to @user. ++ * ++ * Returns: (transfer none): names of keyboard layouts ++ */ ++const char * const * ++act_user_get_x_keyboard_layouts (ActUser *user) ++{ ++ g_return_val_if_fail (ACT_IS_USER (user), NULL); ++ ++ if (user->accounts_proxy == NULL) ++ return NULL; ++ ++ return accounts_user_get_xkeyboard_layouts (user->accounts_proxy); ++} ++ + /** + * act_user_get_background_file: + * @user: a #ActUser +@@ -1307,6 +1334,34 @@ act_user_get_password_expiration_policy (ActUser *user, } + } -+ s = g_key_file_get_string_list (keyfile, "User", "XKeyboardLayouts", NULL, NULL); -+ if (s != NULL) { -+ g_strfreev (user->x_keyboard_layouts); -+ user->x_keyboard_layouts = s; -+ g_object_notify (G_OBJECT (user), "xkeyboard-layouts"); ++/** ++ * act_user_set_x_keyboard_layouts: ++ * @user: the user object to alter. ++ * @keyboard_layouts: names of keyboard layouts ++ * ++ * Assigns a new set of keyboard layouts for @user. ++ * ++ * Note this function is synchronous and ignores errors. ++ **/ ++void ++act_user_set_x_keyboard_layouts (ActUser *user, ++ const char * const *keyboard_layouts) ++{ ++ g_autoptr(GError) error = NULL; ++ ++ g_return_if_fail (ACT_IS_USER (user)); ++ g_return_if_fail (keyboard_layouts != NULL); ++ g_return_if_fail (ACCOUNTS_IS_USER (user->accounts_proxy)); ++ ++ if (!accounts_user_call_set_xkeyboard_layouts_sync (user->accounts_proxy, ++ keyboard_layouts, ++ NULL, ++ &error)) { ++ g_warning ("SetXKeyboardLayouts call failed: %s", error->message); ++ return; ++ } ++} ++ + /** + * act_user_set_formats_locale: + * @user: the user object to alter. +diff --git a/src/user.c b/src/user.c +index 4b2edca..e28f81a 100644 +--- a/src/user.c ++++ b/src/user.c +@@ -247,6 +247,7 @@ user_update_from_keyfile (User *user, + GKeyFile *keyfile) + { + gchar *s; ++ gchar **layouts; + + g_object_freeze_notify (G_OBJECT (user)); + +@@ -286,6 +287,12 @@ user_update_from_keyfile (User *user, + g_clear_pointer (&s, g_free); + } + ++ layouts = g_key_file_get_string_list (keyfile, "User", "XKeyboardLayouts", NULL, NULL); ++ if (layouts != NULL) { ++ accounts_user_set_xkeyboard_layouts (ACCOUNTS_USER (user), (const gchar * const *) layouts); ++ g_strfreev (layouts); + } + s = g_key_file_get_string (keyfile, "User", "Background", NULL); if (s != NULL) { - g_free (user->background_file); -@@ -432,6 +441,9 @@ user_save_to_keyfile (User *user, - if (user->password_hint) - g_key_file_set_string (keyfile, "User", "PasswordHint", user->password_hint); + accounts_user_set_background_file (ACCOUNTS_USER (user), s); +@@ -350,6 +357,9 @@ user_save_to_keyfile (User *user, + if (accounts_user_get_password_hint (ACCOUNTS_USER (user))) + g_key_file_set_string (keyfile, "User", "PasswordHint", accounts_user_get_password_hint (ACCOUNTS_USER (user))); -+ if (user->x_keyboard_layouts) -+ g_key_file_set_string_list (keyfile, "User", "XKeyboardLayouts", (const gchar * const *) user->x_keyboard_layouts, g_strv_length (user->x_keyboard_layouts)); ++ if (accounts_user_get_xkeyboard_layouts (ACCOUNTS_USER (user))) ++ g_key_file_set_string_list (keyfile, "User", "XKeyboardLayouts", (const gchar * const *) accounts_user_get_xkeyboard_layouts (ACCOUNTS_USER (user)), g_strv_length ((gchar **) accounts_user_get_xkeyboard_layouts (ACCOUNTS_USER (user)))); + - if (user->background_file) - g_key_file_set_string (keyfile, "User", "Background", user->background_file); + if (accounts_user_get_background_file (ACCOUNTS_USER (user))) + g_key_file_set_string (keyfile, "User", "Background", accounts_user_get_background_file (ACCOUNTS_USER (user))); -@@ -1846,6 +1858,55 @@ become_user (gpointer data) +@@ -1738,6 +1748,50 @@ become_user (gpointer data) + } } - static void ++static void +user_change_x_keyboard_layouts_authorized_cb (Daemon *daemon, + User *user, + GDBusMethodInvocation *context, + gpointer data) +{ -+ g_strfreev (user->x_keyboard_layouts); -+ user->x_keyboard_layouts = g_strdupv (data); ++ accounts_user_set_xkeyboard_layouts (ACCOUNTS_USER (user), data); + + save_extra_data (user); + -+ accounts_user_emit_changed (ACCOUNTS_USER (user)); -+ -+ g_object_notify (G_OBJECT (user), "xkeyboard-layouts"); -+ + accounts_user_complete_set_xkeyboard_layouts (ACCOUNTS_USER (user), context); +} + -+gboolean ++static gboolean +user_set_xkeyboard_layouts (AccountsUser *auser, + GDBusMethodInvocation *context, + const gchar * const *layouts) @@ -144,7 +226,7 @@ + return FALSE; + } + -+ if (user->uid == (uid_t) uid) ++ if (accounts_user_get_uid (ACCOUNTS_USER (user)) == (uid_t) uid) + action_id = "org.freedesktop.accounts.change-own-user-data"; + else + action_id = "org.freedesktop.accounts.user-administration"; @@ -155,203 +237,23 @@ + TRUE, + user_change_x_keyboard_layouts_authorized_cb, + context, -+ g_strdupv (layouts), ++ g_strdupv ((gchar **)layouts), + (GDestroyNotify)g_strfreev); + + return TRUE; +} + -+static void + static void user_change_background_file_authorized_cb (Daemon *daemon, User *user, - GDBusMethodInvocation *context, -@@ -2737,6 +2798,7 @@ user_finalize (GObject *object) - g_free (user->real_name); - g_free (user->home_dir); - g_free (user->shell); -+ g_strfreev (user->x_keyboard_layouts); - g_free (user->icon_file); - g_free (user->default_icon_file); - g_free (user->background_file); -@@ -2855,6 +2917,9 @@ user_get_property (GObject *object, - case PROP_LOCATION: - g_value_set_string (value, user->location); - break; -+ case PROP_X_KEYBOARD_LAYOUTS: -+ g_value_set_boxed (value, g_strdupv (user->x_keyboard_layouts)); -+ break; - case PROP_BACKGROUND_FILE: - g_value_set_string (value, user->background_file); - break; -@@ -2928,6 +2993,7 @@ user_accounts_user_iface_init (AccountsU +@@ -2505,6 +2559,7 @@ user_accounts_user_iface_init (AccountsUserIface *iface) iface->handle_set_real_name = user_set_real_name; iface->handle_set_shell = user_set_shell; iface->handle_set_user_name = user_set_user_name; + iface->handle_set_xkeyboard_layouts = user_set_xkeyboard_layouts; iface->handle_set_xsession = user_set_x_session; iface->handle_get_password_expiration_policy = user_get_password_expiration_policy; - iface->get_uid = user_real_get_uid; -@@ -2961,6 +3027,7 @@ user_init (User *user) - user->account_type = ACCOUNT_TYPE_STANDARD; - user->home_dir = NULL; - user->shell = NULL; -+ user->x_keyboard_layouts = NULL; - user->background_file = NULL; - user->icon_file = NULL; - user->default_icon_file = NULL; -Index: accountsservice-0.6.45/src/libaccountsservice/act-user.c -=================================================================== ---- accountsservice-0.6.45.orig/src/libaccountsservice/act-user.c -+++ accountsservice-0.6.45/src/libaccountsservice/act-user.c -@@ -91,6 +91,7 @@ enum { - PROP_LOGIN_FREQUENCY, - PROP_LOGIN_TIME, - PROP_LOGIN_HISTORY, -+ PROP_X_KEYBOARD_LAYOUTS, - PROP_BACKGROUND_FILE, - PROP_ICON_FILE, - PROP_LANGUAGE, -@@ -122,6 +123,7 @@ struct _ActUser { - char *shell; - char *email; - char *location; -+ char **x_keyboard_layouts; - char *background_file; - char *icon_file; - char *language; -@@ -306,6 +308,9 @@ act_user_get_property (GObject *objec - case PROP_LOCATION: - g_value_set_string (value, user->location); - break; -+ case PROP_X_KEYBOARD_LAYOUTS: -+ g_value_set_boxed (value, g_strdupv (user->x_keyboard_layouts)); -+ break; - case PROP_BACKGROUND_FILE: - g_value_set_string (value, user->background_file); - break; -@@ -460,6 +465,13 @@ act_user_class_init (ActUserClass *class - NULL, - G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); - g_object_class_install_property (gobject_class, -+ PROP_X_KEYBOARD_LAYOUTS, -+ g_param_spec_boxed ("xkeyboard-layouts", -+ "Keyboard layouts", -+ "The name of keyboard layouts for this user.", -+ G_TYPE_STRV, -+ G_PARAM_READABLE)); -+ g_object_class_install_property (gobject_class, - PROP_BACKGROUND_FILE, - g_param_spec_string ("background-file", - "Background File", -@@ -597,6 +609,7 @@ act_user_finalize (GObject *object) - - g_free (user->user_name); - g_free (user->real_name); -+ g_strfreev (user->x_keyboard_layouts); - g_free (user->background_file); - g_free (user->icon_file); - g_free (user->language); -@@ -1046,6 +1059,22 @@ act_user_is_nonexistent (ActUser *user } - - /** -+ * act_user_get_x_keyboard_layouts: -+ * @user: a #ActUser -+ * -+ * Returns the name of the account keyboard layouts belonging to @user. -+ * -+ * Returns: (transfer none): names of keyboard layouts -+ */ -+const char * const * -+act_user_get_x_keyboard_layouts (ActUser *user) -+{ -+ g_return_val_if_fail (ACT_IS_USER (user), NULL); -+ -+ return (const char * const *) user->x_keyboard_layouts; -+} -+ -+/** - * act_user_get_background_file: - * @user: a #ActUser - * -@@ -1167,6 +1196,28 @@ act_user_get_primary_session_id (ActUser - return user->our_sessions->data; - } - -+static gboolean -+strv_equal (const char **a, const char **b) -+{ -+ gint i; -+ gboolean same = TRUE; -+ -+ if (a == b) -+ return TRUE; -+ else if (a == NULL || b == NULL) -+ return FALSE; -+ -+ for (i = 0; a[i]; i++) { -+ if (g_strcmp0 (a[i], b[i]) != 0) -+ return FALSE; -+ } -+ -+ if (g_strcmp0 (a[i], b[i]) != 0) -+ return FALSE; -+ -+ return TRUE; -+} -+ - static void - collect_props (const gchar *key, - GVariant *value, -@@ -1319,6 +1370,15 @@ collect_props (const gchar *key, - user->login_history = g_variant_ref (new_login_history); - g_object_notify (G_OBJECT (user), "login-history"); - } -+ } else if (strcmp (key, "XKeyboardLayouts") == 0) { -+ const char **new_x_keyboard_layouts; -+ -+ new_x_keyboard_layouts = g_variant_get_strv (value, NULL); -+ if (!strv_equal (user->x_keyboard_layouts, new_x_keyboard_layouts)) { -+ g_strfreev (user->x_keyboard_layouts); -+ user->x_keyboard_layouts = g_strdupv (new_x_keyboard_layouts); -+ g_object_notify (G_OBJECT (user), "xkeyboard-layouts"); -+ } - } else if (strcmp (key, "BackgroundFile") == 0) { - const char *new_background_file; - -@@ -1694,6 +1754,35 @@ act_user_get_password_expiration_policy - g_error_free (error); - return; - } -+} -+ -+/** -+ * act_user_set_x_keyboard_layouts: -+ * @user: the user object to alter. -+ * @keyboard_layouts: names of keyboard layouts -+ * -+ * Assigns a new set of keyboard layouts for @user. -+ * -+ * Note this function is synchronous and ignores errors. -+ **/ -+void -+act_user_set_x_keyboard_layouts (ActUser *user, -+ const char * const *keyboard_layouts) -+{ -+ GError *error = NULL; -+ -+ g_return_if_fail (ACT_IS_USER (user)); -+ g_return_if_fail (keyboard_layouts != NULL); -+ g_return_if_fail (ACCOUNTS_IS_USER (user->accounts_proxy)); -+ -+ if (!accounts_user_call_set_xkeyboard_layouts_sync (user->accounts_proxy, -+ keyboard_layouts, -+ NULL, -+ &error)) { -+ g_warning ("SetXKeyboardLayouts call failed: %s", error->message); -+ g_error_free (error); -+ return; -+ } - } - - /** +-- +2.17.1 + diff -Nru accountsservice-0.6.45/debian/patches/0013-add-has-message-support.patch accountsservice-0.6.50/debian/patches/0013-add-has-message-support.patch --- accountsservice-0.6.45/debian/patches/0013-add-has-message-support.patch 2017-12-18 03:42:18.000000000 +0100 +++ accountsservice-0.6.50/debian/patches/0013-add-has-message-support.patch 2018-09-18 11:11:58.000000000 +0200 @@ -1,10 +1,19 @@ -Description: Add XHasMessages property to report if a user had unread messages, largely for LightDM's benefit. -Author: Michael Terry +From e645a2deeb0c8e4fdfb40f62e43516da08c79f0f Mon Sep 17 00:00:00 2001 +From: Michael Terry +Date: Thu, 21 Dec 2017 15:11:37 +1300 +Subject: [PATCH 09/12] Add XHasMessages property to report if a user had + unread messages, largely for LightDM's benefit. -Index: accountsservice-0.6.45/data/org.freedesktop.Accounts.User.xml -=================================================================== ---- accountsservice-0.6.45.orig/data/org.freedesktop.Accounts.User.xml -+++ accountsservice-0.6.45/data/org.freedesktop.Accounts.User.xml +--- + data/org.freedesktop.Accounts.User.xml | 45 +++++++++++++++++++++ + src/libaccountsservice/act-user.c | 55 ++++++++++++++++++++++++++ + src/user.c | 43 ++++++++++++++++++++ + 3 files changed, 143 insertions(+) + +diff --git a/data/org.freedesktop.Accounts.User.xml b/data/org.freedesktop.Accounts.User.xml +index 550804c..0e04b8f 100644 +--- a/data/org.freedesktop.Accounts.User.xml ++++ b/data/org.freedesktop.Accounts.User.xml @@ -331,6 +331,41 @@ @@ -47,12 +56,10 @@ -@@ -838,6 +873,16 @@ - - +@@ -840,6 +875,16 @@ -+ -+ + + + + + @@ -61,14 +68,16 @@ + + + - - ++ ++ -Index: accountsservice-0.6.45/src/libaccountsservice/act-user.c -=================================================================== ---- accountsservice-0.6.45.orig/src/libaccountsservice/act-user.c -+++ accountsservice-0.6.45/src/libaccountsservice/act-user.c -@@ -91,6 +91,7 @@ enum { + + +diff --git a/src/libaccountsservice/act-user.c b/src/libaccountsservice/act-user.c +index 3f71650..4c83fd7 100644 +--- a/src/libaccountsservice/act-user.c ++++ b/src/libaccountsservice/act-user.c +@@ -93,6 +93,7 @@ enum { PROP_LOGIN_FREQUENCY, PROP_LOGIN_TIME, PROP_LOGIN_HISTORY, @@ -76,42 +85,33 @@ PROP_X_KEYBOARD_LAYOUTS, PROP_BACKGROUND_FILE, PROP_ICON_FILE, -@@ -140,6 +141,7 @@ struct _ActUser { - - guint uid_set : 1; +@@ -117,6 +118,7 @@ struct _ActUser { + GList *our_sessions; + GList *other_sessions; + guint x_has_messages : 1; guint is_loaded : 1; - guint locked : 1; - guint automatic_login : 1; -@@ -308,6 +310,9 @@ act_user_get_property (GObject *objec - case PROP_LOCATION: - g_value_set_string (value, user->location); - break; -+ case PROP_X_HAS_MESSAGES: -+ g_value_set_boolean (value, user->x_has_messages); -+ break; - case PROP_X_KEYBOARD_LAYOUTS: - g_value_set_boxed (value, g_strdupv (user->x_keyboard_layouts)); - break; -@@ -465,6 +470,13 @@ act_user_class_init (ActUserClass *class + guint nonexistent : 1; + }; +@@ -375,6 +377,13 @@ act_user_class_init (ActUserClass *class) + G_VARIANT_TYPE ("a(xxa{sv})"), NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); - g_object_class_install_property (gobject_class, ++ g_object_class_install_property (gobject_class, + PROP_X_HAS_MESSAGES, + g_param_spec_boolean ("xhas-messages", + "Has Messages", + "Whether the user has messages waiting.", + FALSE, + G_PARAM_READABLE)); -+ g_object_class_install_property (gobject_class, + g_object_class_install_property (gobject_class, PROP_X_KEYBOARD_LAYOUTS, g_param_spec_boxed ("xkeyboard-layouts", - "Keyboard layouts", -@@ -1059,6 +1071,22 @@ act_user_is_nonexistent (ActUser *user +@@ -993,6 +1002,25 @@ act_user_is_nonexistent (ActUser *user) + return user->nonexistent; } - /** ++/** + * act_user_get_x_has_messages: + * @user: a #ActUser + * @@ -124,34 +124,19 @@ +{ + g_return_val_if_fail (ACT_IS_USER (user), FALSE); + -+ return user->x_has_messages; ++ if (user->accounts_proxy == NULL) ++ return FALSE; ++ ++ return accounts_user_get_xhas_messages (user->accounts_proxy); +} + -+/** + /** * act_user_get_x_keyboard_layouts: * @user: a #ActUser - * -@@ -1370,6 +1398,14 @@ collect_props (const gchar *key, - user->login_history = g_variant_ref (new_login_history); - g_object_notify (G_OBJECT (user), "login-history"); - } -+ } else if (strcmp (key, "XHasMessages") == 0) { -+ gboolean new_has_messages; -+ -+ new_has_messages = g_variant_get_boolean (value); -+ if (new_has_messages != user->x_has_messages) { -+ user->x_has_messages = new_has_messages; -+ g_object_notify (G_OBJECT (user), "xhas-messages"); -+ } - } else if (strcmp (key, "XKeyboardLayouts") == 0) { - const char **new_x_keyboard_layouts; - -@@ -1754,6 +1790,34 @@ act_user_get_password_expiration_policy - g_error_free (error); - return; +@@ -1334,6 +1362,33 @@ act_user_get_password_expiration_policy (ActUser *user, } -+} -+ + } + +/** + * act_user_set_x_has_messages: + * @user: the user object to alter. @@ -165,61 +150,43 @@ +act_user_set_x_has_messages (ActUser *user, + gboolean has_messages) +{ -+ GError *error = NULL; ++ g_autoptr(GError) error = NULL; + + g_return_if_fail (ACT_IS_USER (user)); + g_return_if_fail (ACCOUNTS_IS_USER (user->accounts_proxy)); + -+ if (!accounts_user_call_set_xhas_messages_sync (user->accounts_proxy, -+ has_messages, -+ NULL, -+ &error)) { ++ if (!accounts_user_call_set_xhas_messages_sync (user->accounts_proxy, ++ has_messages, ++ NULL, ++ &error)) { + g_warning ("SetXHasMessages call failed: %s", error->message); -+ g_error_free (error); + return; + } - } - ++} ++ /** -Index: accountsservice-0.6.45/src/user.c -=================================================================== ---- accountsservice-0.6.45.orig/src/user.c -+++ accountsservice-0.6.45/src/user.c -@@ -64,6 +64,7 @@ enum { - PROP_LOGIN_FREQUENCY, - PROP_LOGIN_TIME, - PROP_LOGIN_HISTORY, -+ PROP_X_HAS_MESSAGES, - PROP_X_KEYBOARD_LAYOUTS, - PROP_BACKGROUND_FILE, - PROP_ICON_FILE, -@@ -100,6 +101,7 @@ struct User { - gchar *x_session; - gchar *location; - guint64 login_frequency; -+ gboolean x_has_messages; - gchar **x_keyboard_layouts; - gchar *background_file; - gint64 login_time; -@@ -1858,6 +1860,52 @@ become_user (gpointer data) + * act_user_set_x_keyboard_layouts: + * @user: the user object to alter. +diff --git a/src/user.c b/src/user.c +index e28f81a..8af685f 100644 +--- a/src/user.c ++++ b/src/user.c +@@ -1748,6 +1748,48 @@ become_user (gpointer data) + } } - static void ++static void +user_change_x_has_messages_authorized_cb (Daemon *daemon, + User *user, + GDBusMethodInvocation *context, + gpointer data) +{ -+ user->x_has_messages = GPOINTER_TO_INT (data); -+ -+ accounts_user_emit_changed (ACCOUNTS_USER (user)); -+ -+ g_object_notify (G_OBJECT (user), "xhas-messages"); ++ accounts_user_set_xhas_messages (ACCOUNTS_USER (user), GPOINTER_TO_INT (data)); + + accounts_user_complete_set_xhas_messages (ACCOUNTS_USER (user), context); +} + -+gboolean ++static gboolean +user_set_xhas_messages (AccountsUser *auser, + GDBusMethodInvocation *context, + gboolean has_messages) @@ -233,7 +200,7 @@ + return FALSE; + } + -+ if (user->uid == (uid_t) uid) ++ if (accounts_user_get_uid (ACCOUNTS_USER (user)) == (uid_t) uid) + action_id = "org.freedesktop.accounts.change-own-user-data"; + else + action_id = "org.freedesktop.accounts.user-administration"; @@ -250,21 +217,10 @@ + return TRUE; +} + -+static void + static void user_change_x_keyboard_layouts_authorized_cb (Daemon *daemon, User *user, - GDBusMethodInvocation *context, -@@ -2917,6 +2965,9 @@ user_get_property (GObject *object, - case PROP_LOCATION: - g_value_set_string (value, user->location); - break; -+ case PROP_X_HAS_MESSAGES: -+ g_value_set_boolean (value, user->x_has_messages); -+ break; - case PROP_X_KEYBOARD_LAYOUTS: - g_value_set_boxed (value, g_strdupv (user->x_keyboard_layouts)); - break; -@@ -2993,6 +3044,7 @@ user_accounts_user_iface_init (AccountsU +@@ -2559,6 +2601,7 @@ user_accounts_user_iface_init (AccountsUserIface *iface) iface->handle_set_real_name = user_set_real_name; iface->handle_set_shell = user_set_shell; iface->handle_set_user_name = user_set_user_name; @@ -272,11 +228,6 @@ iface->handle_set_xkeyboard_layouts = user_set_xkeyboard_layouts; iface->handle_set_xsession = user_set_x_session; iface->handle_get_password_expiration_policy = user_get_password_expiration_policy; -@@ -3027,6 +3079,7 @@ user_init (User *user) - user->account_type = ACCOUNT_TYPE_STANDARD; - user->home_dir = NULL; - user->shell = NULL; -+ user->x_has_messages = FALSE; - user->x_keyboard_layouts = NULL; - user->background_file = NULL; - user->icon_file = NULL; +-- +2.17.1 + diff -Nru accountsservice-0.6.45/debian/patches/0015-debian-nologin-path.patch accountsservice-0.6.50/debian/patches/0015-debian-nologin-path.patch --- accountsservice-0.6.45/debian/patches/0015-debian-nologin-path.patch 2017-12-18 03:42:18.000000000 +0100 +++ accountsservice-0.6.50/debian/patches/0015-debian-nologin-path.patch 1970-01-01 01:00:00.000000000 +0100 @@ -1,19 +0,0 @@ -Description: Use debian specific path for nologin executable -Author: Laurent Bigonville -Forwarded: not-needed -Origin: vendor -Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=805086 - -Index: accountsservice-0.6.45/src/user-classify.c -=================================================================== ---- accountsservice-0.6.45.orig/src/user-classify.c -+++ accountsservice-0.6.45/src/user-classify.c -@@ -58,7 +58,7 @@ static const char *default_excludes[] = - "gnome-initial-setup" - }; - --#define PATH_NOLOGIN "/sbin/nologin" -+#define PATH_NOLOGIN "/usr/sbin/nologin" - #define PATH_FALSE "/bin/false" - - static gboolean diff -Nru accountsservice-0.6.45/debian/patches/0016-add-input-sources-support.patch accountsservice-0.6.50/debian/patches/0016-add-input-sources-support.patch --- accountsservice-0.6.45/debian/patches/0016-add-input-sources-support.patch 2017-12-18 03:42:18.000000000 +0100 +++ accountsservice-0.6.50/debian/patches/0016-add-input-sources-support.patch 2018-09-18 11:11:58.000000000 +0200 @@ -1,19 +1,19 @@ -From eebb604999d40ee4d3151536e6e4086735556378 Mon Sep 17 00:00:00 2001 +From 6dab56f2ed348f14d55666d4d631fd77d4f86144 Mon Sep 17 00:00:00 2001 From: William Hua Date: Fri, 26 Jul 2013 10:10:11 -0400 -Subject: [PATCH] Store input sources in user objects. +Subject: [PATCH 10/12] Store input sources in user objects. --- data/org.freedesktop.Accounts.User.xml | 45 +++++++ - src/libaccountsservice/act-user.c | 82 +++++++++++++ + src/libaccountsservice/act-user.c | 56 ++++++++ src/libaccountsservice/act-user.h | 3 + - src/user.c | 212 +++++++++++++++++++++++++++++++++ - 4 files changed, 342 insertions(+) + src/user.c | 171 +++++++++++++++++++++++++ + 4 files changed, 275 insertions(+) -Index: accountsservice-0.6.45/data/org.freedesktop.Accounts.User.xml -=================================================================== ---- accountsservice-0.6.45.orig/data/org.freedesktop.Accounts.User.xml -+++ accountsservice-0.6.45/data/org.freedesktop.Accounts.User.xml +diff --git a/data/org.freedesktop.Accounts.User.xml b/data/org.freedesktop.Accounts.User.xml +index 0e04b8f..2bfc17a 100644 +--- a/data/org.freedesktop.Accounts.User.xml ++++ b/data/org.freedesktop.Accounts.User.xml @@ -185,6 +185,41 @@ @@ -56,12 +56,10 @@ -@@ -816,6 +851,16 @@ - - +@@ -818,6 +853,16 @@ -+ -+ + + + + + @@ -70,14 +68,16 @@ + + + - - ++ ++ -Index: accountsservice-0.6.45/src/libaccountsservice/act-user.c -=================================================================== ---- accountsservice-0.6.45.orig/src/libaccountsservice/act-user.c -+++ accountsservice-0.6.45/src/libaccountsservice/act-user.c -@@ -97,6 +97,7 @@ enum { + + +diff --git a/src/libaccountsservice/act-user.c b/src/libaccountsservice/act-user.c +index 4c83fd7..31a0437 100644 +--- a/src/libaccountsservice/act-user.c ++++ b/src/libaccountsservice/act-user.c +@@ -99,6 +99,7 @@ enum { PROP_ICON_FILE, PROP_LANGUAGE, PROP_FORMATS_LOCALE, @@ -85,28 +85,11 @@ PROP_X_SESSION, PROP_IS_LOADED }; -@@ -129,6 +130,7 @@ struct _ActUser { - char *icon_file; - char *language; - char *formats_locale; -+ GVariant *input_sources; - char *x_session; - GList *our_sessions; - GList *other_sessions; -@@ -328,6 +330,9 @@ act_user_get_property (GObject *objec - case PROP_FORMATS_LOCALE: - g_value_set_string (value, user->formats_locale); - break; -+ case PROP_INPUT_SOURCES: -+ g_value_set_variant (value, user->input_sources); -+ break; - case PROP_X_SESSION: - g_value_set_string (value, user->x_session); - break; -@@ -512,6 +517,14 @@ act_user_class_init (ActUserClass *class +@@ -419,6 +420,14 @@ act_user_class_init (ActUserClass *class) + "User's regional formats.", NULL, G_PARAM_READABLE)); - g_object_class_install_property (gobject_class, ++ g_object_class_install_property (gobject_class, + PROP_INPUT_SOURCES, + g_param_spec_variant ("input-sources", + "Input sources", @@ -114,23 +97,14 @@ + G_VARIANT_TYPE ("aa{ss}"), + NULL, + G_PARAM_READABLE)); -+ g_object_class_install_property (gobject_class, + g_object_class_install_property (gobject_class, PROP_X_SESSION, g_param_spec_string ("x-session", - "X session", -@@ -631,6 +644,8 @@ act_user_finalize (GObject *object) - g_free (user->shell); - g_free (user->email); - g_free (user->location); -+ if (user->input_sources) -+ g_variant_unref (user->input_sources); - if (user->login_history) - g_variant_unref (user->login_history); - g_free (user->formats_locale); -@@ -1167,6 +1182,22 @@ act_user_get_formats_locale (ActUser *us +@@ -1116,6 +1125,25 @@ act_user_get_formats_locale (ActUser *user) + return accounts_user_get_formats_locale (user->accounts_proxy); } - /** ++/** + * act_user_get_input_sources: + * @user: a #ActUser + * @@ -143,55 +117,19 @@ +{ + g_return_val_if_fail (ACT_IS_USER (user), NULL); + -+ return user->input_sources; ++ if (user->accounts_proxy == NULL) ++ return NULL; ++ ++ return accounts_user_get_input_sources (user->accounts_proxy); +} + -+/** + /** * act_user_get_x_session: * @user: a #ActUser - * -@@ -1453,6 +1484,19 @@ collect_props (const gchar *key, - g_object_notify (G_OBJECT (user), "formats_locale"); - } - -+ } else if (strcmp (key, "InputSources") == 0) { -+ GVariant *sources; -+ -+ g_variant_get (value, "@aa{ss}", &sources); -+ -+ if (!user->input_sources || !g_variant_equal (sources, user->input_sources)) { -+ if (user->input_sources) -+ g_variant_unref (user->input_sources); -+ user->input_sources = g_variant_ref (sources); -+ g_object_notify (G_OBJECT (user), "input-sources"); -+ } -+ -+ g_variant_unref (sources); - } else if (strcmp (key, "XSession") == 0) { - const char *new_x_session; - -@@ -1708,6 +1752,15 @@ _act_user_load_from_user (ActUser *us - user->language = g_strdup (user_to_copy->language); - g_object_notify (G_OBJECT (user), "language"); - -+ if (user_to_copy->input_sources != user->input_sources) { -+ if (user->input_sources) -+ g_variant_unref (user->input_sources); -+ user->input_sources = user_to_copy->input_sources; -+ if (user->input_sources) -+ g_variant_ref (user->input_sources); -+ g_object_notify (G_OBJECT (user), "input-sources"); -+ } -+ - g_free (user->x_session); - user->x_session = g_strdup (user_to_copy->x_session); - g_object_notify (G_OBJECT (user), "x-session"); -@@ -1905,6 +1958,35 @@ act_user_set_email (ActUser *user, - g_error_free (error); - return; +@@ -1473,6 +1501,34 @@ act_user_set_email (ActUser *user, } -+} -+ + } + +/** + * act_user_set_input_sources: + * @user: the user object to alter. @@ -205,7 +143,7 @@ +act_user_set_input_sources (ActUser *user, + GVariant *sources) +{ -+ GError *error = NULL; ++ g_autoptr(GError) error = NULL; + + g_return_if_fail (ACT_IS_USER (user)); + g_return_if_fail (ACCOUNTS_IS_USER (user->accounts_proxy)); @@ -216,17 +154,18 @@ + NULL, + &error)) { + g_warning ("SetInputSources call failed: %s", error->message); -+ g_error_free (error); + return; + } - } - ++} ++ /** -Index: accountsservice-0.6.45/src/libaccountsservice/act-user.h -=================================================================== ---- accountsservice-0.6.45.orig/src/libaccountsservice/act-user.h -+++ accountsservice-0.6.45/src/libaccountsservice/act-user.h -@@ -78,6 +78,7 @@ gboolean act_user_is_nonexistent + * act_user_set_language: + * @user: the user object to alter. +diff --git a/src/libaccountsservice/act-user.h b/src/libaccountsservice/act-user.h +index 7ffa32c..a11faf0 100644 +--- a/src/libaccountsservice/act-user.h ++++ b/src/libaccountsservice/act-user.h +@@ -78,6 +78,7 @@ gboolean act_user_is_nonexistent (ActUser *user); const char *act_user_get_icon_file (ActUser *user); const char *act_user_get_language (ActUser *user); const char *act_user_get_formats_locale (ActUser *user); @@ -234,7 +173,7 @@ const char *act_user_get_x_session (ActUser *user); const char *act_user_get_primary_session_id (ActUser *user); -@@ -99,6 +100,8 @@ void act_user_set_language +@@ -99,6 +100,8 @@ void act_user_set_language (ActUser *user, const char *language); void act_user_set_formats_locale (ActUser *user, const char *formats_locale); @@ -243,28 +182,12 @@ void act_user_set_x_session (ActUser *user, const char *x_session); void act_user_set_location (ActUser *user, -Index: accountsservice-0.6.45/src/user.c -=================================================================== ---- accountsservice-0.6.45.orig/src/user.c -+++ accountsservice-0.6.45/src/user.c -@@ -59,6 +59,7 @@ enum { - PROP_EMAIL, - PROP_LANGUAGE, - PROP_FORMATS_LOCALE, -+ PROP_INPUT_SOURCES, - PROP_X_SESSION, - PROP_LOCATION, - PROP_LOGIN_FREQUENCY, -@@ -98,6 +99,7 @@ struct User { - gchar *email; - gchar *language; - gchar *formats_locale; -+ GVariant *input_sources; - gchar *x_session; - gchar *location; - guint64 login_frequency; -@@ -311,6 +313,75 @@ user_update_from_pwent (User *u - accounts_user_emit_changed (ACCOUNTS_USER (user)); +diff --git a/src/user.c b/src/user.c +index 8af685f..c52eff6 100644 +--- a/src/user.c ++++ b/src/user.c +@@ -242,6 +242,75 @@ user_update_from_pwent (User *user, + g_object_thaw_notify (G_OBJECT (user)); } +static gint @@ -339,22 +262,20 @@ void user_update_from_keyfile (User *user, GKeyFile *keyfile) -@@ -334,6 +405,11 @@ user_update_from_keyfile (User *user - g_object_notify (G_OBJECT (user), "formats-locale"); +@@ -263,6 +332,8 @@ user_update_from_keyfile (User *user, + g_clear_pointer (&s, g_free); } -+ if (user->input_sources != NULL) -+ g_variant_unref (user->input_sources); -+ user->input_sources = key_file_get_input_sources (keyfile); -+ g_object_notify (G_OBJECT (user), "input-sources"); ++ accounts_user_set_input_sources (ACCOUNTS_USER (user), key_file_get_input_sources (keyfile)); + s = g_key_file_get_string (keyfile, "User", "XSession", NULL); if (s != NULL) { - g_free (user->x_session); -@@ -420,6 +496,51 @@ user_update_system_account_property (Use + accounts_user_set_xsession (ACCOUNTS_USER (user), s); +@@ -333,6 +404,51 @@ user_update_system_account_property (User *user, + accounts_user_set_system_account (ACCOUNTS_USER (user), system); } - static void ++static void +key_file_set_input_sources (GKeyFile *key_file, + GVariant *input_sources) +{ @@ -399,24 +320,24 @@ + } +} + -+static void + static void user_save_to_keyfile (User *user, GKeyFile *keyfile) - { -@@ -434,6 +555,9 @@ user_save_to_keyfile (User *user, - if (user->formats_locale) - g_key_file_set_string (keyfile, "User", "FormatsLocale", user->formats_locale); +@@ -348,6 +464,9 @@ user_save_to_keyfile (User *user, + if (accounts_user_get_formats_locale (ACCOUNTS_USER (user))) + g_key_file_set_string (keyfile, "User", "FormatsLocale", accounts_user_get_formats_locale (ACCOUNTS_USER (user))); -+ if (user->input_sources) -+ key_file_set_input_sources (keyfile, user->input_sources); ++ if (accounts_user_get_input_sources (ACCOUNTS_USER (user))) ++ key_file_set_input_sources (keyfile, accounts_user_get_input_sources (ACCOUNTS_USER (user))); + - if (user->x_session) - g_key_file_set_string (keyfile, "User", "XSession", user->x_session); + if (accounts_user_get_xsession (ACCOUNTS_USER (user))) + g_key_file_set_string (keyfile, "User", "XSession", accounts_user_get_xsession (ACCOUNTS_USER (user))); -@@ -1570,6 +1694,67 @@ user_set_formats_locale (AccountsUser +@@ -1473,6 +1592,57 @@ user_set_formats_locale (AccountsUser *auser, + return TRUE; } - static void ++static void +user_change_input_sources_authorized_cb (Daemon *daemon, + User *user, + GDBusMethodInvocation *context, @@ -425,22 +346,12 @@ +{ + GVariant *sources = data; + -+ if (sources != user->input_sources && -+ (!sources || !user->input_sources || -+ !g_variant_equal (sources, user->input_sources))) { -+ if (user->input_sources) -+ g_variant_unref (user->input_sources); -+ -+ user->input_sources = sources; -+ -+ if (user->input_sources) -+ g_variant_ref (user->input_sources); ++ if (sources != accounts_user_get_input_sources (ACCOUNTS_USER (user)) && ++ (!sources || !accounts_user_get_input_sources (ACCOUNTS_USER (user)) || ++ !g_variant_equal (sources, accounts_user_get_input_sources (ACCOUNTS_USER (user))))) { ++ accounts_user_set_input_sources (ACCOUNTS_USER (user), sources); + + save_extra_data (user); -+ -+ accounts_user_emit_changed (ACCOUNTS_USER (user)); -+ -+ g_object_notify (G_OBJECT (user), "input-sources"); + } + + accounts_user_complete_set_input_sources (ACCOUNTS_USER (user), context); @@ -460,7 +371,7 @@ + return FALSE; + } + -+ if (user->uid == (uid_t) uid) ++ if (accounts_user_get_uid (ACCOUNTS_USER (user)) == (uid_t) uid) + action_id = "org.freedesktop.accounts.change-own-user-data"; + else + action_id = "org.freedesktop.accounts.user-administration"; @@ -477,71 +388,10 @@ + return TRUE; +} + -+static void + static void user_change_x_session_authorized_cb (Daemon *daemon, User *user, - GDBusMethodInvocation *context, -@@ -2763,6 +2948,12 @@ user_real_get_language (AccountsUser *us - return USER (user)->language; - } - -+static GVariant * -+user_real_get_input_sources (AccountsUser *user) -+{ -+ return USER (user)->input_sources; -+} -+ - static const gchar * - user_real_get_xsession (AccountsUser *user) - { -@@ -2860,6 +3051,9 @@ user_finalize (GObject *object) - if (user->login_history) - g_variant_unref (user->login_history); - -+ if (user->input_sources) -+ g_variant_unref (user->input_sources); -+ - if (G_OBJECT_CLASS (user_parent_class)->finalize) - (*G_OBJECT_CLASS (user_parent_class)->finalize) (object); - } -@@ -2871,6 +3065,7 @@ user_set_property (GObject *object, - GParamSpec *pspec) - { - User *user = USER (object); -+ GVariant *variant; - - switch (param_id) { - case PROP_ACCOUNT_TYPE: -@@ -2882,6 +3077,18 @@ user_set_property (GObject *object, - case PROP_FORMATS_LOCALE: - user->formats_locale = g_value_dup_string (value); - break; -+ case PROP_INPUT_SOURCES: -+ variant = g_value_get_variant (value); -+ -+ if (variant != user->input_sources) { -+ if (user->input_sources) -+ g_variant_unref (user->input_sources); -+ user->input_sources = variant; -+ if (user->input_sources) -+ g_variant_ref (user->input_sources); -+ } -+ -+ break; - case PROP_X_SESSION: - user->x_session = g_value_dup_string (value); - break; -@@ -2959,6 +3166,9 @@ user_get_property (GObject *object, - else - g_value_set_string (value, user_get_fallback_value (user, "FormatsLocale")); - break; -+ case PROP_INPUT_SOURCES: -+ g_value_set_variant (value, user->input_sources); -+ break; - case PROP_X_SESSION: - g_value_set_string (value, user->x_session); - break; -@@ -3036,6 +3246,7 @@ user_accounts_user_iface_init (AccountsU +@@ -2593,6 +2763,7 @@ user_accounts_user_iface_init (AccountsUserIface *iface) iface->handle_set_home_directory = user_set_home_directory; iface->handle_set_icon_file = user_set_icon_file; iface->handle_set_language = user_set_language; @@ -549,19 +399,6 @@ iface->handle_set_location = user_set_location; iface->handle_set_locked = user_set_locked; iface->handle_set_password = user_set_password; -@@ -3056,6 +3267,7 @@ user_accounts_user_iface_init (AccountsU - iface->get_shell = user_real_get_shell; - iface->get_email = user_real_get_email; - iface->get_language = user_real_get_language; -+ iface->get_input_sources = user_real_get_input_sources; - iface->get_xsession = user_real_get_xsession; - iface->get_location = user_real_get_location; - iface->get_login_frequency = user_real_get_login_frequency; -@@ -3087,6 +3299,7 @@ user_init (User *user) - user->email = NULL; - user->language = NULL; - user->formats_locale = NULL; -+ user->input_sources = NULL; - user->x_session = NULL; - user->location = NULL; - user->password_mode = PASSWORD_MODE_REGULAR; +-- +2.17.1 + diff -Nru accountsservice-0.6.45/debian/patches/0020-support-login.defs.patch accountsservice-0.6.50/debian/patches/0020-support-login.defs.patch --- accountsservice-0.6.45/debian/patches/0020-support-login.defs.patch 2017-12-18 03:42:18.000000000 +0100 +++ accountsservice-0.6.50/debian/patches/0020-support-login.defs.patch 2018-09-18 11:11:58.000000000 +0200 @@ -1,13 +1,20 @@ -Origin: http://cgit.freedesktop.org/accountsservice/patch/?id=ba13b59cb91ec67c86b3e3fb390d91db01df8963 -Forwarded: not-needed -Description: This patch is a reversion of upstream commit linked above. Ubuntu would still like to support login.defs, which is used in at least Ubuntu Touch. +From 3e5c7ab2290444982ba912a5acc5751870c75dfd Mon Sep 17 00:00:00 2001 +From: Robert Ancell +Date: Thu, 21 Dec 2017 15:14:39 +1300 +Subject: [PATCH 11/12] Ubuntu would still like to support login.defs, which is + used in at least Ubuntu Touch. -Index: accountsservice-0.6.45/configure.ac -=================================================================== ---- accountsservice-0.6.45.orig/configure.ac -+++ accountsservice-0.6.45/configure.ac -@@ -55,17 +55,11 @@ AS_IF([test x$enable_admin_group = xauto - AC_DEFINE_UNQUOTED([ADMIN_GROUP], ["$enable_admin_group"], [Define to the group for administrator users]) +--- + configure.ac | 8 +-- + src/user-classify.c | 144 ++++++++++++++++++++++++++++---------------- + 2 files changed, 93 insertions(+), 59 deletions(-) + +diff --git a/configure.ac b/configure.ac +index beca5e8..2a765b9 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -54,17 +54,11 @@ AC_ARG_WITH(extra-admin-groups, + AC_DEFINE_UNQUOTED([EXTRA_ADMIN_GROUPS], ["$with_extra_admin_groups"], [Define to the list of extra groups administrator users are part of]) AC_ARG_ENABLE(user-heuristics, - [AS_HELP_STRING([--enable-user-heuristics],[Enable heuristics for guessing system vs. human users in the range 500-minimum-uid])], @@ -25,10 +32,10 @@ dnl --------------------------------------------------------------------------- dnl - coverage dnl --------------------------------------------------------------------------- -Index: accountsservice-0.6.45/src/user-classify.c -=================================================================== ---- accountsservice-0.6.45.orig/src/user-classify.c -+++ accountsservice-0.6.45/src/user-classify.c +diff --git a/src/user-classify.c b/src/user-classify.c +index 9db1c9a..4aae6e3 100644 +--- a/src/user-classify.c ++++ b/src/user-classify.c @@ -27,6 +27,7 @@ #include #include @@ -37,12 +44,10 @@ static const char *default_excludes[] = { "bin", "root", -@@ -57,10 +58,16 @@ static const char *default_excludes[] = +@@ -54,10 +55,14 @@ static const char *default_excludes[] = { "gnome-initial-setup" }; -+#define PATH_NOLOGIN "/sbin/nologin" -+#define PATH_FALSE "/bin/false" + static gboolean -user_classify_is_blacklisted (const char *username) @@ -55,16 +60,13 @@ if (exclusions == NULL) { guint i; -@@ -76,19 +83,6 @@ user_classify_is_blacklisted (const char +@@ -73,16 +78,6 @@ user_classify_is_blacklisted (const char *username) return TRUE; } - return FALSE; -} - --#define PATH_NOLOGIN "/sbin/nologin" --#define PATH_FALSE "/bin/false" -- -#ifdef ENABLE_USER_HEURISTICS -static gboolean -user_classify_is_excluded_by_heuristics (const gchar *username, @@ -75,7 +77,7 @@ if (password_hash != NULL) { /* skip over the account-is-locked '!' prefix if present */ if (password_hash[0] == '!') -@@ -113,69 +107,110 @@ user_classify_is_excluded_by_heuristics +@@ -107,62 +102,107 @@ user_classify_is_excluded_by_heuristics (const gchar *username, return ret; } @@ -89,8 +91,21 @@ + const gchar *key, + uid_t *result) { -- char *basename, *nologin_basename, *false_basename; +- g_autofree gchar *basename = NULL; - int ret = FALSE; +- +-#ifdef HAVE_GETUSERSHELL +- /* getusershell returns a whitelist of valid shells. +- * assume the shell is invalid unless there is a match */ +- ret = TRUE; +- char *valid_shell; +- +- setusershell (); +- while ((valid_shell = getusershell ()) != NULL) { +- if (g_strcmp0 (shell, valid_shell) != 0) +- continue; +- ret = FALSE; +- break; + gsize key_len; + gint64 value; + gchar *end; @@ -104,19 +119,7 @@ + contents += key_len; + break; + } - --#ifdef HAVE_GETUSERSHELL -- /* getusershell returns a whitelist of valid shells. -- * assume the shell is invalid unless there is a match */ -- ret = TRUE; -- char *valid_shell; -- -- setusershell (); -- while ((valid_shell = getusershell ()) != NULL) { -- if (g_strcmp0 (shell, valid_shell) != 0) -- continue; -- ret = FALSE; -- break; ++ + /* Didn't find it. Find the end of the line. */ + contents = strchr (contents, '\n'); + @@ -134,31 +137,23 @@ - /* always check for false and nologin since they are sometimes included by getusershell */ - 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 TRUE; +- } else if (g_strcmp0 (basename, "nologin") == 0) { +- return TRUE; +- } else if (g_strcmp0 (basename, "false") == 0) { +- return TRUE; + /* 'contents' now points at the whitespace character just after + * the field name. strtoll can deal with that. + */ + value = g_ascii_strtoll (contents, &end, 10); - -- return ret; ++ + if (*end && !g_ascii_isspace (*end)) { + g_warning ("Trailing junk after '%s' field in login.defs", key); + return FALSE; -+ } -+ + } + +- return ret; + if (value <= 0 || value >= G_MAXINT32) { + g_warning ("Value for '%s' field out of range", key); + return FALSE; @@ -167,28 +162,25 @@ + *result = value; + + return TRUE; - } - ++} ++ +static void +user_classify_read_login_defs (uid_t *min_uid) +{ -+ GError *error = NULL; -+ char *contents; ++ g_autoptr(GError) error = NULL; ++ g_autofree gchar *contents = NULL; + + if (!g_file_get_contents ("/etc/login.defs", &contents, NULL, &error)) { + g_warning ("Could not open /etc/login.defs: %s. Falling back to default minimum human uid of %d", + error->message, (int) *min_uid); -+ g_error_free (error); + return; + } + + if (!user_classify_parse_login_defs_field (contents, "UID_MIN", min_uid)) { + g_warning ("Could not find UID_MIN value in login.defs. Using default of %d", (int) *min_uid); + } -+ -+ g_free (contents); -+} -+ + } + +static gboolean +user_classify_is_in_human_range (const gchar *username, + uid_t uid) @@ -234,3 +226,6 @@ - - return uid >= MINIMUM_UID; } +-- +2.17.1 + diff -Nru accountsservice-0.6.45/debian/patches/0021-support-extrausers.patch accountsservice-0.6.50/debian/patches/0021-support-extrausers.patch --- accountsservice-0.6.45/debian/patches/0021-support-extrausers.patch 2017-12-18 03:42:18.000000000 +0100 +++ accountsservice-0.6.50/debian/patches/0021-support-extrausers.patch 2018-09-18 11:11:58.000000000 +0200 @@ -1,10 +1,17 @@ -Description: In addition to watching /etc/{passwd,shadow,group}, also watch those same files in /var/lib/extrausers/, if they exist. -Author: Michael Terry +From c976711155c7ceaf3000c6bd564849a920d4c0cf Mon Sep 17 00:00:00 2001 +From: Michael Terry +Date: Thu, 21 Dec 2017 15:15:05 +1300 +Subject: [PATCH 12/12] In addition to watching /etc/{passwd,shadow,group}, + also watch those same files in /var/lib/extrausers/, if they exist. -Index: accountsservice-0.6.45/src/daemon.c -=================================================================== ---- accountsservice-0.6.45.orig/src/daemon.c -+++ accountsservice-0.6.45/src/daemon.c +--- + src/daemon.c | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +diff --git a/src/daemon.c b/src/daemon.c +index af340eb..8583ec3 100644 +--- a/src/daemon.c ++++ b/src/daemon.c @@ -51,6 +51,9 @@ #define PATH_PASSWD "/etc/passwd" #define PATH_SHADOW "/etc/shadow" @@ -12,9 +19,9 @@ +#define PATH_EXTRAUSERS_PASSWD "/var/lib/extrausers/passwd" +#define PATH_EXTRAUSERS_SHADOW "/var/lib/extrausers/shadow" +#define PATH_EXTRAUSERS_GROUP "/var/lib/extrausers/group" - #define PATH_GDM_CUSTOM "/etc/gdm3/custom.conf" enum { + PROP_0, @@ -69,6 +72,9 @@ struct DaemonPrivate { GFileMonitor *passwd_monitor; GFileMonitor *shadow_monitor; @@ -25,7 +32,7 @@ GFileMonitor *gdm_monitor; GFileMonitor *wtmp_monitor; -@@ -679,6 +685,16 @@ daemon_init (Daemon *daemon) +@@ -713,6 +719,16 @@ daemon_init (Daemon *daemon) PATH_GROUP, on_users_monitor_changed); @@ -42,3 +49,6 @@ daemon->priv->wtmp_monitor = setup_monitor (daemon, wtmp_helper_get_path_for_monitor (), on_users_monitor_changed); +-- +2.17.1 + diff -Nru accountsservice-0.6.45/debian/patches/1002-dont-override-standardoutput.patch accountsservice-0.6.50/debian/patches/1002-dont-override-standardoutput.patch --- accountsservice-0.6.45/debian/patches/1002-dont-override-standardoutput.patch 2017-12-18 03:42:18.000000000 +0100 +++ accountsservice-0.6.50/debian/patches/1002-dont-override-standardoutput.patch 1970-01-01 01:00:00.000000000 +0100 @@ -1,17 +0,0 @@ -Subject: Don't override DefaultStandardOutput. -Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=741124 -Forwarded: no ---- - data/accounts-daemon.service.in | 1 - - 1 file changed, 1 deletion(-) - ---- a/data/accounts-daemon.service.in -+++ b/data/accounts-daemon.service.in -@@ -11,7 +11,6 @@ - Type=dbus - BusName=org.freedesktop.Accounts - ExecStart=@libexecdir@/accounts-daemon --StandardOutput=syslog - Environment=GVFS_DISABLE_FUSE=1 - Environment=GIO_USE_VFS=local - Environment=GVFS_REMOTE_VOLUME_MONITOR_IGNORE=1 diff -Nru accountsservice-0.6.45/debian/patches/2001-filtering_out_users.patch accountsservice-0.6.50/debian/patches/2001-filtering_out_users.patch --- accountsservice-0.6.45/debian/patches/2001-filtering_out_users.patch 2017-12-18 03:42:18.000000000 +0100 +++ accountsservice-0.6.50/debian/patches/2001-filtering_out_users.patch 1970-01-01 01:00:00.000000000 +0100 @@ -1,234 +0,0 @@ -Description: Filter out users which have an UID lower than UID_MIN specified in - /etc/login.defs -Author: Alessio Treglia -Forwarded: no -Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=673095 ---- - src/daemon.c | 129 ++++++++++++++++++++++++++++++----------------------------- - src/daemon.h | 3 - - src/user.c | 3 - - 3 files changed, 68 insertions(+), 67 deletions(-) - ---- accountsservice.orig/src/daemon.c -+++ accountsservice/src/daemon.c -@@ -50,10 +50,15 @@ - #define PATH_NOLOGIN "/sbin/nologin" - #define PATH_FALSE "/bin/false" - #define PATH_GDM_CUSTOM "/etc/gdm3/daemon.conf" -+#define PATH_LOGIN_DEFS "/etc/login.defs" - #ifdef HAVE_UTMPX_H - #define PATH_WTMP _PATH_WTMPX - #endif - -+#ifndef FALLBACK_MINIMAL_UID -+#define FALLBACK_MINIMAL_UID 500 -+#endif -+ - static const char *default_excludes[] = { - "bin", - "root", -@@ -96,6 +101,7 @@ struct DaemonPrivate { - - GHashTable *users; - GHashTable *exclusions; -+ uid_t minimal_uid; - - User *autologin; - -@@ -168,73 +174,18 @@ error_get_type (void) - gboolean - daemon_local_user_is_excluded (Daemon *daemon, - const gchar *username, -- const gchar *shell, -- const gchar *password_hash) -+ uid_t uid) - { -- int ret; - - if (g_hash_table_lookup (daemon->priv->exclusions, username)) { - return TRUE; - } - -- 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] == '!') -- password_hash++; -- -- if (password_hash[0] != '\0') { -- /* modern hashes start with "$n$" */ -- if (password_hash[0] == '$') { -- if (strlen (password_hash) < 4) -- ret = TRUE; -- -- /* DES crypt is base64 encoded [./A-Za-z0-9]* -- */ -- } else if (!g_ascii_isalnum (password_hash[0]) && -- password_hash[0] != '.' && -- password_hash[0] != '/') { -- ret = TRUE; -- } -- } -- -+ if (uid < daemon->priv->minimal_uid) { -+ return TRUE; - } - -- return ret; -+ return FALSE; - } - - #ifdef HAVE_UTMPX_H -@@ -516,7 +467,7 @@ load_entries (Daemon *daemon - break; - - /* Skip system users... */ -- if (daemon_local_user_is_excluded (daemon, pwent->pw_name, pwent->pw_shell, NULL)) { -+ if (daemon_local_user_is_excluded (daemon, pwent->pw_name, pwent->pw_uid)) { - g_debug ("skipping user: %s", pwent->pw_name); - continue; - } -@@ -743,6 +694,59 @@ on_gdm_monitor_changed (GFileMonitor - queue_reload_autologin (daemon); - } - -+static uid_t -+get_minimal_uid (void) -+{ -+ GError *error; -+ char *contents; -+ gboolean contents_loaded; -+ const char *uid_min_string, *start_of_uid_string; -+ char *end; -+ uid_t uid = FALLBACK_MINIMAL_UID; -+ gint64 uid_as_number; -+ -+ error = NULL; -+ contents = NULL; -+ contents_loaded = g_file_get_contents (PATH_LOGIN_DEFS, &contents, NULL, &error); -+ if (!contents_loaded) { -+ g_debug ("unable to read " PATH_LOGIN_DEFS ": %s", error->message); -+ g_error_free (error); -+ goto out; -+ } -+ -+ uid_min_string = strstr (contents, "UID_MIN"); -+ -+ if (uid_min_string == NULL || -+ (uid_min_string != contents && uid_min_string[-1] != '\n')) { -+ g_debug (PATH_LOGIN_DEFS " does not have a UID_MIN field"); -+ goto out; -+ } -+ -+ start_of_uid_string = uid_min_string + strlen ("UID_MIN"); -+ -+ if (start_of_uid_string == '\0') { -+ g_debug (PATH_LOGIN_DEFS " contains UID_MIN key with no value"); -+ goto out; -+ } -+ -+ -+ uid_as_number = g_ascii_strtoll (start_of_uid_string, &end, 10); -+ if (!g_ascii_isspace (*end) && *end != '\0') { -+ g_debug (PATH_LOGIN_DEFS " contains non-numerical value for UID_MIN"); -+ goto out; -+ } -+ -+ if (uid_as_number < 0 || ((uid_t) uid_as_number) != uid_as_number) { -+ g_debug (PATH_LOGIN_DEFS " contains out-of-range value for UID_MIN"); -+ goto out; -+ } -+ -+ uid = (uid_t) uid_as_number; -+out: -+ g_free (contents); -+ return uid; -+} -+ - static void - daemon_init (Daemon *daemon) - { -@@ -752,6 +756,7 @@ daemon_init (Daemon *daemon) - - daemon->priv = DAEMON_GET_PRIVATE (daemon); - -+ daemon->priv->minimal_uid = get_minimal_uid (); - daemon->priv->exclusions = g_hash_table_new_full (g_str_hash, - g_str_equal, - g_free, -@@ -1075,16 +1080,14 @@ finish_list_cached_users (gpointer user_ - const gchar *name; - User *user; - uid_t uid; -- const gchar *shell; - - object_paths = g_ptr_array_new (); - - g_hash_table_iter_init (&iter, data->daemon->priv->users); - while (g_hash_table_iter_next (&iter, (gpointer *)&name, (gpointer *)&user)) { - uid = user_get_uid (user); -- shell = user_get_shell (user); - -- if (daemon_local_user_is_excluded (data->daemon, name, shell, NULL)) { -+ if (daemon_local_user_is_excluded (data->daemon, name, uid)) { - g_debug ("user %s %ld excluded", name, (long) uid); - continue; - } ---- accountsservice.orig/src/daemon.h -+++ accountsservice/src/daemon.h -@@ -78,8 +78,7 @@ User *daemon_local_find_user_by_name (Da - User *daemon_local_get_automatic_login_user (Daemon *daemon); - gboolean daemon_local_user_is_excluded (Daemon *daemon, - const gchar *name, -- const gchar *shell, -- const gchar *password_hash); -+ uid_t uid); - - typedef void (*AuthorizedCallback) (Daemon *daemon, - User *user, ---- accountsservice.orig/src/user.c -+++ accountsservice/src/user.c -@@ -290,8 +290,7 @@ user_update_from_pwent (User *u - */ - user->system_account = daemon_local_user_is_excluded (user->daemon, - user->user_name, -- pwent->pw_shell, -- passwd); -+ pwent->pw_uid); - - g_object_thaw_notify (G_OBJECT (user)); - diff -Nru accountsservice-0.6.45/debian/patches/series accountsservice-0.6.50/debian/patches/series --- accountsservice-0.6.45/debian/patches/series 2017-12-18 03:42:18.000000000 +0100 +++ accountsservice-0.6.50/debian/patches/series 2018-09-18 11:11:58.000000000 +0200 @@ -1,6 +1,5 @@ 0001-formats-locale-property.patch 0002-create-and-manage-groups-like-on-a-debian-system.patch -0005-gdm_config_file_path.patch 0006-adduser_instead_of_useradd.patch 0007-add-lightdm-support.patch 0009-language-tools.patch @@ -9,9 +8,5 @@ 0012-add-keyboard-layout-support.patch 0013-add-has-message-support.patch 0016-add-input-sources-support.patch -0001-Move-cache-cleanup-out-into-a-common-function-and-cl.patch -0002-On-startup-clean-out-the-data-of-removed-users.patch 0020-support-login.defs.patch 0021-support-extrausers.patch -1002-dont-override-standardoutput.patch -0015-debian-nologin-path.patch diff -Nru accountsservice-0.6.45/debian/rules accountsservice-0.6.50/debian/rules --- accountsservice-0.6.45/debian/rules 2017-12-18 03:42:18.000000000 +0100 +++ accountsservice-0.6.50/debian/rules 2018-09-18 11:11:58.000000000 +0200 @@ -23,7 +23,8 @@ --enable-gtk-doc \ --enable-static=no \ --libexecdir=/usr/lib/accountsservice \ - --with-systemdsystemunitdir=/lib/systemd/system + --with-systemdsystemunitdir=/lib/systemd/system \ + --with-gdmconffile=/etc/gdm3/custom.conf # Disabled to avoid FTBFS override_dh_auto_test: diff -Nru accountsservice-0.6.45/depcomp accountsservice-0.6.50/depcomp --- accountsservice-0.6.45/depcomp 2017-02-10 07:47:11.000000000 +0100 +++ accountsservice-0.6.50/depcomp 2018-02-09 09:27:34.000000000 +0100 @@ -1,9 +1,9 @@ -#! /bin/sh +#!/bin/sh # depcomp - compile a program generating dependencies as side-effects -scriptversion=2013-05-30.07; # UTC +scriptversion=2016-01-11.22; # UTC -# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# Copyright (C) 1999-2017 Free Software Foundation, Inc. # 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 @@ -786,6 +786,6 @@ # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: diff -Nru accountsservice-0.6.45/doc/dbus/AccountsService.xml accountsservice-0.6.50/doc/dbus/AccountsService.xml --- accountsservice-0.6.45/doc/dbus/AccountsService.xml 2017-03-27 20:33:18.000000000 +0200 +++ accountsservice-0.6.50/doc/dbus/AccountsService.xml 2018-07-10 17:25:14.000000000 +0200 @@ -6,8 +6,8 @@ - AccountsService 0.6.45 Documentation - Version 0.6.45 + AccountsService 0.6.50 Documentation + Version 0.6.50 Matthias diff -Nru accountsservice-0.6.45/doc/dbus/Makefile.in accountsservice-0.6.50/doc/dbus/Makefile.in --- accountsservice-0.6.45/doc/dbus/Makefile.in 2017-03-27 20:33:02.000000000 +0200 +++ accountsservice-0.6.50/doc/dbus/Makefile.in 2018-07-10 17:25:08.000000000 +0200 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -153,6 +153,8 @@ am__DIST_COMMON = $(srcdir)/AccountsService.xml.in \ $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACCOUNTS_DAEMON_CFLAGS = @ACCOUNTS_DAEMON_CFLAGS@ +ACCOUNTS_DAEMON_LIBS = @ACCOUNTS_DAEMON_LIBS@ ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ @@ -180,11 +182,11 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ +ELOGIND_CFLAGS = @ELOGIND_CFLAGS@ +ELOGIND_LIBS = @ELOGIND_LIBS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ -GIO_CFLAGS = @GIO_CFLAGS@ -GIO_LIBS = @GIO_LIBS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ @@ -210,6 +212,7 @@ INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ @@ -258,8 +261,6 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POFILES = @POFILES@ -POLKIT_CFLAGS = @POLKIT_CFLAGS@ -POLKIT_LIBS = @POLKIT_LIBS@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ diff -Nru accountsservice-0.6.45/doc/dbus/org.freedesktop.Accounts.ref.xml accountsservice-0.6.50/doc/dbus/org.freedesktop.Accounts.ref.xml --- accountsservice-0.6.45/doc/dbus/org.freedesktop.Accounts.ref.xml 2017-03-27 20:08:48.000000000 +0200 +++ accountsservice-0.6.50/doc/dbus/org.freedesktop.Accounts.ref.xml 2018-05-10 19:45:28.000000000 +0200 @@ -40,7 +40,10 @@ Properties - 'DaemonVersion' read 's' + 'DaemonVersion' read 's' +'HasNoUsers' read 'b' +'HasMultipleUsers' read 'b' +'AutomaticLoginUsers' read 'ao' @@ -132,5 +135,23 @@ The version of the running daemon. + <anchor role="function" id="Accounts:HasNoUsers"/>The "HasNoUsers" propertyHasNoUsersAccounts'HasNoUsers' read 'b' + + + Whether or not the system has no users + + + <anchor role="function" id="Accounts:HasMultipleUsers"/>The "HasMultipleUsers" propertyHasMultipleUsersAccounts'HasMultipleUsers' read 'b' + + + Whether or not the system has multiple users + + + <anchor role="function" id="Accounts:AutomaticLoginUsers"/>The "AutomaticLoginUsers" propertyAutomaticLoginUsersAccounts'AutomaticLoginUsers' read 'ao' + + + Users to automatically log in as + + diff -Nru accountsservice-0.6.45/doc/libaccountsservice/html/ActUser.html accountsservice-0.6.50/doc/libaccountsservice/html/ActUser.html --- accountsservice-0.6.45/doc/libaccountsservice/html/ActUser.html 2017-03-27 20:33:44.000000000 +0200 +++ accountsservice-0.6.50/doc/libaccountsservice/html/ActUser.html 2018-07-10 17:27:02.000000000 +0200 @@ -8,7 +8,7 @@ - + @@ -44,7 +44,7 @@ -gint +gint act_user_collate () @@ -60,7 +60,7 @@ -gboolean +gboolean act_user_get_automatic_login () @@ -103,7 +103,7 @@ -gboolean +gboolean act_user_get_locked () @@ -118,7 +118,7 @@ -const GVariant * +const GVariant * act_user_get_login_history () @@ -126,7 +126,7 @@ -gint64 +gint64 act_user_get_login_time () @@ -134,13 +134,21 @@ -guint +guint act_user_get_num_sessions () + +guint + + +act_user_get_num_sessions_anywhere () + + + const char * @@ -148,6 +156,14 @@ + +void + + +act_user_get_password_expiration_policy () + + + const char * @@ -207,7 +223,7 @@ -gboolean +gboolean act_user_is_loaded () @@ -215,7 +231,7 @@ -gboolean +gboolean act_user_is_local_account () @@ -223,7 +239,7 @@ -gboolean +gboolean act_user_is_logged_in () @@ -231,7 +247,23 @@ -gboolean +gboolean + + +act_user_is_logged_in_anywhere () + + + + +gboolean + + +act_user_is_nonexistent () + + + + +gboolean act_user_is_system_account () @@ -354,123 +386,123 @@ -gint +gint account-type Read -gboolean +gboolean automatic-login Read -gchar * +gchar * email Read -gchar * +gchar * home-directory Read -gchar * +gchar * icon-file Read -gboolean +gboolean is-loaded Read -gchar * +gchar * language Read -gboolean +gboolean local-account Read -gchar * +gchar * location Read -gboolean +gboolean locked Read -gint +gint login-frequency Read -GVariant * +GVariant * login-history Read -gint64 +gint64 login-time Read -gboolean +gboolean nonexistent Read -gchar * +gchar * password-hint Read -gint +gint password-mode Read -gchar * +gchar * real-name Read -gchar * +gchar * shell Read -gboolean +gboolean system-account Read -gint +gint uid Read -gchar * +gchar * user-name Read -gchar * +gchar * x-session Read @@ -524,7 +556,7 @@

Object Hierarchy

-
    GObject
+
    GObject
     ╰── ActUser
 
@@ -536,7 +568,7 @@

Functions

act_user_collate ()

-
gint
+
gint
 act_user_collate (ActUser *user1,
                   ActUser *user2);

Organize the user by login frequency and names.

@@ -602,7 +634,7 @@

act_user_get_automatic_login ()

-
gboolean
+
gboolean
 act_user_get_automatic_login (ActUser *user);

Returns whether or not ActUser is automatically logged in at boot time.

@@ -622,7 +654,7 @@

Returns

-

TRUE or FALSE

+

TRUE or FALSE


@@ -649,7 +681,7 @@

Returns

-

a pointer to an array of characters which must not be modified or +

a pointer to an array of characters which must not be modified or freed, or NULL.

[transfer none]

@@ -678,7 +710,7 @@

Returns

-

a pointer to an array of characters which must not be modified or +

a pointer to an array of characters which must not be modified or freed, or NULL.

[transfer none]

@@ -707,7 +739,7 @@

Returns

-

a path to an icon.

+

a path to an icon.

[transfer none]

@@ -735,7 +767,7 @@

Returns

-

a path to an icon.

+

a path to an icon.

[transfer none]

@@ -763,7 +795,7 @@

Returns

-

a pointer to an array of characters which must not be modified or +

a pointer to an array of characters which must not be modified or freed, or NULL.

[transfer none]

@@ -771,7 +803,7 @@

act_user_get_locked ()

-
gboolean
+
gboolean
 act_user_get_locked (ActUser *user);

Returns whether or not the ActUser account is locked.

@@ -791,7 +823,7 @@

Returns

-

TRUE or FALSE

+

TRUE or FALSE


@@ -824,11 +856,10 @@

act_user_get_login_history ()

-
const GVariant *
+
const GVariant *
 act_user_get_login_history (ActUser *user);
-

Assigns a new email to user +

Returns the login history for user .

-

Note this function is synchronous and ignores errors.

Parameters

@@ -837,35 +868,24 @@ - - + - - - - - - + - - +

user

the user object to query.

 

expiration_time

time users passwor expires -last_change_time -, -min_days_between_changes -, -max_days_between_changes -, -days_to_warn -, -days_after_expiration_until_lock -)

a ActUser

 
+
+

Returns

+

a pointer to GVariant of type "a(xxa{sv})" +which must not be modified or freed, or NULL.

+

[transfer none]

+

act_user_get_login_time ()

-
gint64
+
gint64
 act_user_get_login_time (ActUser *user);

Returns the last login time for user .

@@ -886,14 +906,13 @@

Returns

-

the login time.

-

[transfer none]

+

the login time


act_user_get_num_sessions ()

-
guint
+
guint
 act_user_get_num_sessions (ActUser *user);

Get the number of sessions for a user that are graphical and on the same seat as the session of the calling process.

@@ -919,6 +938,35 @@

+

act_user_get_num_sessions_anywhere ()

+
guint
+act_user_get_num_sessions_anywhere (ActUser *user);
+

Get the number of sessions for a user on any seat of any type. +See also act_user_get_num_sessions().

+

(Currently, this function is only implemented for systemd-logind. +For ConsoleKit, it is equivalent to act_user_get_num_sessions.)

+
+

Parameters

+
+++++ + + + + + +

user

a user

 
+
+
+

Returns

+

the number of sessions

+
+
+
+

act_user_get_object_path ()

const char *
 act_user_get_object_path (ActUser *user);
@@ -944,12 +992,74 @@

Returns

-

the object path of the user.

+

the object path of the user.

[transfer none]


+

act_user_get_password_expiration_policy ()

+
void
+act_user_get_password_expiration_policy
+                               (ActUser *user,
+                                gint64 *expiration_time,
+                                gint64 *last_change_time,
+                                gint64 *min_days_between_changes,
+                                gint64 *max_days_between_changes,
+                                gint64 *days_to_warn,
+                                gint64 *days_after_expiration_until_lock);
+

Get the password expiration policy for a user.

+

Note this function is synchronous and ignores errors.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

user

the user object to query.

 

expiration_time

location to write time users password expires

 

last_change_time

location to write time users password was last changed.

 

min_days_between_changes

location to write minimum number of days needed between password changes.

 

max_days_between_changes

location to write maximum number of days password can stay unchanged.

 

days_to_warn

location to write number of days to warn user password is about to expire.

 

days_after_expiration_until_lock

location to write number of days account will be locked after password expires.

 
+
+
+
+

act_user_get_password_hint ()

const char *
 act_user_get_password_hint (ActUser *user);
@@ -972,7 +1082,7 @@

Returns

-

a pointer to an array of characters which must not be modified or +

a pointer to an array of characters which must not be modified or freed, or NULL.

[transfer none]

@@ -1032,7 +1142,7 @@

Returns

-

the id of the primary session of the user.

+

the id of the primary session of the user.

[transfer none]

@@ -1060,7 +1170,7 @@

Returns

-

a pointer to an array of characters which must not be modified or +

a pointer to an array of characters which must not be modified or freed, or NULL.

[transfer none]

@@ -1089,7 +1199,7 @@

Returns

-

a pointer to an array of characters which must not be modified or +

a pointer to an array of characters which must not be modified or freed, or NULL.

[transfer none]

@@ -1119,8 +1229,7 @@

Returns

a pointer to an array of characters which must not be modified or -freed, or NULL.

-

[transfer none]

+freed, or NULL.


@@ -1147,7 +1256,7 @@

Returns

-

a pointer to an array of characters which must not be modified or +

a pointer to an array of characters which must not be modified or freed, or NULL.

[transfer none]

@@ -1176,17 +1285,17 @@

Returns

-

a path to an icon.

+

a path to an icon.

[transfer none]


act_user_is_loaded ()

-
gboolean
+
gboolean
 act_user_is_loaded (ActUser *user);

Determines whether or not the user object is loaded and ready to read from. -“is-loaded” property must be TRUE before calling +“is-loaded” property must be TRUE before calling act_user_manager_list_users()

Parameters

@@ -1205,13 +1314,13 @@

Returns

-

TRUE or FALSE

+

TRUE or FALSE


act_user_is_local_account ()

-
gboolean
+
gboolean
 act_user_is_local_account (ActUser *user);

Retrieves whether the user is a local account or not.

@@ -1231,14 +1340,13 @@

Returns

-

TRUE if the user is local.

-

[transfer none]

+

TRUE if the user is local


act_user_is_logged_in ()

-
gboolean
+
gboolean
 act_user_is_logged_in (ActUser *user);

Returns whether or not ActUser is currently graphically logged in on the same seat as the seat of the session of the calling process.

@@ -1259,13 +1367,68 @@

Returns

-

TRUE or FALSE

+

TRUE or FALSE

+
+ +
+
+

act_user_is_logged_in_anywhere ()

+
gboolean
+act_user_is_logged_in_anywhere (ActUser *user);
+

Returns whether or not ActUser is currently logged in in any way +whatsoever. See also act_user_is_logged_in().

+

(Currently, this function is only implemented for systemd-logind. +For ConsoleKit, it is equivalent to act_user_is_logged_in.)

+
+

Parameters

+
+++++ + + + + + +

user

a ActUser

 
+
+
+

Returns

+

TRUE or FALSE

+
+
+
+
+

act_user_is_nonexistent ()

+
gboolean
+act_user_is_nonexistent (ActUser *user);
+

Retrieves whether the user is nonexistent or not.

+
+

Parameters

+
+++++ + + + + + +

user

the user object to examine.

 
+
+
+

Returns

+

TRUE if the user is nonexistent


act_user_is_system_account ()

-
gboolean
+
gboolean
 act_user_is_system_account (ActUser *user);

Returns whether or not ActUser represents a 'system account' like 'root' or 'nobody'.

@@ -1286,7 +1449,7 @@

Returns

-

TRUE or FALSE

+

TRUE or FALSE


@@ -1326,8 +1489,8 @@

act_user_set_automatic_login ()

void
 act_user_set_automatic_login (ActUser *user,
-                              gboolean enabled);
-

If enabled is set to TRUE then this user will automatically be logged in + gboolean enabled); +

If enabled is set to TRUE then this user will automatically be logged in at boot up time. Only one user can be configured to auto login at any given time, so subsequent calls to act_user_set_automatic_login() override previous calls.

@@ -1488,7 +1651,7 @@

act_user_set_locked ()

void
 act_user_set_locked (ActUser *user,
-                     gboolean locked);
+ gboolean locked);

Note this function is synchronous and ignores errors.

Parameters

@@ -1518,8 +1681,8 @@

act_user_set_password ()

void
 act_user_set_password (ActUser *user,
-                       const gchar *password,
-                       const gchar *hint);
+ const gchar *password, + const gchar *hint);

Changes the password of user to password . @@ -1559,7 +1722,7 @@

act_user_set_password_hint ()

void
 act_user_set_password_hint (ActUser *user,
-                            const gchar *hint);
+ const gchar *hint);

@@ -1777,7 +1940,7 @@

Property Details

The “account-type” property

-
  “account-type”             gint
+
  “account-type”             gint

The account type for this user.

Flags: Read

Allowed values: [0,1]

@@ -1786,7 +1949,7 @@

The “automatic-login” property

-
  “automatic-login”          gboolean
+
  “automatic-login”          gboolean

Automatic Login.

Flags: Read

Default value: FALSE

@@ -1794,7 +1957,7 @@

The “email” property

-
  “email”                    gchar *
+
  “email”                    gchar *

The email address for this user.

Flags: Read

Default value: NULL

@@ -1802,7 +1965,7 @@

The “home-directory” property

-
  “home-directory”           gchar *
+
  “home-directory”           gchar *

The home directory for this user.

Flags: Read

Default value: NULL

@@ -1810,7 +1973,7 @@

The “icon-file” property

-
  “icon-file”                gchar *
+
  “icon-file”                gchar *

The path to an icon for this user.

Flags: Read

Default value: NULL

@@ -1818,7 +1981,7 @@

The “is-loaded” property

-
  “is-loaded”                gboolean
+
  “is-loaded”                gboolean

Determines whether or not the user object is loaded and ready to read from.

Flags: Read

Default value: FALSE

@@ -1826,7 +1989,7 @@

The “language” property

-
  “language”                 gchar *
+
  “language”                 gchar *

User's locale.

Flags: Read

Default value: NULL

@@ -1834,7 +1997,7 @@

The “local-account” property

-
  “local-account”            gboolean
+
  “local-account”            gboolean

Local Account.

Flags: Read

Default value: FALSE

@@ -1842,7 +2005,7 @@

The “location” property

-
  “location”                 gchar *
+
  “location”                 gchar *

The location of this user.

Flags: Read

Default value: NULL

@@ -1850,7 +2013,7 @@

The “locked” property

-
  “locked”                   gboolean
+
  “locked”                   gboolean

Locked.

Flags: Read

Default value: FALSE

@@ -1858,7 +2021,7 @@

The “login-frequency” property

-
  “login-frequency”          gint
+
  “login-frequency”          gint

login frequency.

Flags: Read

Allowed values: >= 0

@@ -1867,7 +2030,7 @@

The “login-history” property

-
  “login-history”            GVariant *
+
  “login-history”            GVariant *

The login history for this user.

Flags: Read

Allowed values: GVariant<a(xxa{sv})>

@@ -1876,7 +2039,7 @@

The “login-time” property

-
  “login-time”               gint64
+
  “login-time”               gint64

The last login time for this user.

Flags: Read

Allowed values: >= 0

@@ -1885,7 +2048,7 @@

The “nonexistent” property

-
  “nonexistent”              gboolean
+
  “nonexistent”              gboolean

Determines whether or not the user object represents a valid user account.

Flags: Read

Default value: FALSE

@@ -1893,7 +2056,7 @@

The “password-hint” property

-
  “password-hint”            gchar *
+
  “password-hint”            gchar *

Hint to help this user remember his password.

Flags: Read

Default value: NULL

@@ -1901,7 +2064,7 @@

The “password-mode” property

-
  “password-mode”            gint
+
  “password-mode”            gint

The password mode for this user.

Flags: Read

Allowed values: [0,2]

@@ -1910,7 +2073,7 @@

The “real-name” property

-
  “real-name”                gchar *
+
  “real-name”                gchar *

The real name to display for this user.

Flags: Read

Default value: NULL

@@ -1918,7 +2081,7 @@

The “shell” property

-
  “shell”                    gchar *
+
  “shell”                    gchar *

The shell for this user.

Flags: Read

Default value: NULL

@@ -1926,7 +2089,7 @@

The “system-account” property

-
  “system-account”           gboolean
+
  “system-account”           gboolean

System Account.

Flags: Read

Default value: FALSE

@@ -1934,7 +2097,7 @@

The “uid” property

-
  “uid”                      gint
+
  “uid”                      gint

The UID for this user.

Flags: Read

Allowed values: >= 0

@@ -1943,7 +2106,7 @@

The “user-name” property

-
  “user-name”                gchar *
+
  “user-name”                gchar *

The login name for this user.

Flags: Read

Default value: NULL

@@ -1951,7 +2114,7 @@

The “x-session” property

-
  “x-session”                gchar *
+
  “x-session”                gchar *

User's X session.

Flags: Read

Default value: NULL

@@ -1962,8 +2125,8 @@

The “changed” signal

void
-user_function (ActUser *arg0,
-               gpointer user_data)
+user_function (ActUser *actuser, + gpointer user_data)

Emitted when the user accounts changes in some way.

Parameters

@@ -1986,8 +2149,8 @@

The “sessions-changed” signal

void
-user_function (ActUser *arg0,
-               gpointer user_data)
+user_function (ActUser *actuser, + gpointer user_data)

Emitted when the list of sessions for this user changes.

Parameters

@@ -2009,6 +2172,6 @@
+
Generated by GTK-Doc V1.28
\ No newline at end of file diff -Nru accountsservice-0.6.45/doc/libaccountsservice/html/ActUserManager.html accountsservice-0.6.50/doc/libaccountsservice/html/ActUserManager.html --- accountsservice-0.6.45/doc/libaccountsservice/html/ActUserManager.html 2017-03-27 20:33:44.000000000 +0200 +++ accountsservice-0.6.50/doc/libaccountsservice/html/ActUserManager.html 2018-07-10 17:27:02.000000000 +0200 @@ -8,7 +8,7 @@ - + @@ -44,7 +44,7 @@ -gboolean +gboolean act_user_manager_activate_user_session () @@ -76,7 +76,7 @@ -gboolean +gboolean act_user_manager_can_switch () @@ -108,7 +108,7 @@ -gboolean +gboolean act_user_manager_delete_user () @@ -124,7 +124,7 @@ -gboolean +gboolean act_user_manager_delete_user_finish () @@ -156,7 +156,7 @@ -gboolean +gboolean act_user_manager_goto_login_session () @@ -164,7 +164,7 @@ -GSList * +GSList * act_user_manager_list_users () @@ -172,7 +172,7 @@ -gboolean +gboolean act_user_manager_no_service () @@ -180,12 +180,28 @@ -gboolean +gboolean act_user_manager_uncache_user () + + +void + + +act_user_manager_uncache_user_async () + + + + +gboolean + + +act_user_manager_uncache_user_finish () + +
@@ -199,22 +215,22 @@ -gpointer +gpointer exclude-usernames-list Read / Write -gboolean +gboolean has-multiple-users -Read +Read / Write -gpointer +gpointer include-usernames-list Read / Write -gboolean +gboolean is-loaded Read @@ -278,7 +294,7 @@

Object Hierarchy

-
    GObject
+
    GObject
     ╰── ActUserManager
 
@@ -293,7 +309,7 @@

Functions

act_user_manager_activate_user_session ()

-
gboolean
+
gboolean
 act_user_manager_activate_user_session
                                (ActUserManager *manager,
                                 ActUser *user);
@@ -331,7 +347,7 @@
ActUser *
 act_user_manager_cache_user (ActUserManager *manager,
                              const char *username,
-                             GError **error);
+ GError **error);

Caches a user account so it shows up via act_user_manager_list_users().

Parameters

@@ -354,7 +370,7 @@

error

-

a GError

+

a GError

  @@ -362,7 +378,7 @@

Returns

-

user object.

+

user object.

[transfer full]

@@ -371,10 +387,10 @@

act_user_manager_cache_user_async ()

void
 act_user_manager_cache_user_async (ActUserManager *manager,
-                                   const gchar *username,
-                                   GCancellable *cancellable,
-                                   GAsyncReadyCallback callback,
-                                   gpointer user_data);
+ const gchar *username, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data);

Asynchronously caches a user account so it shows up via act_user_manager_list_users().

For more details, see act_user_manager_cache_user(), which @@ -400,34 +416,34 @@

cancellable

-

optional GCancellable object, +

optional GCancellable object, NULL to ignore.

[allow-none]

callback

-

a GAsyncReadyCallback to call +

a GAsyncReadyCallback to call when the request is satisfied.

[scope async]

user_data

-

the data to pass to callback +

the data to pass to callback .

[closure]
-

Since: 0.6.27

+

Since: 0.6.27


act_user_manager_cache_user_finish ()

ActUser *
 act_user_manager_cache_user_finish (ActUserManager *manager,
-                                    GAsyncResult *result,
-                                    GError **error);
+ GAsyncResult *result, + GError **error);

Finishes an asynchronous user caching.

See act_user_manager_cache_user_async().

@@ -446,12 +462,12 @@

result

-

a GAsyncResult

+

a GAsyncResult

 

error

-

a GError

+

a GError

  @@ -459,15 +475,15 @@

Returns

-

user object.

+

user object.

[transfer full]

-

Since: 0.6.27

+

Since: 0.6.27


act_user_manager_can_switch ()

-
gboolean
+
gboolean
 act_user_manager_can_switch (ActUserManager *manager);

Check whether the user can switch to another session.

@@ -498,7 +514,7 @@ const char *username, const char *fullname, ActUserAccountType accounttype, - GError **error);
+ GError **error);

Creates a user account on the system.

Parameters

@@ -531,7 +547,7 @@

error

-

a GError

+

a GError

  @@ -539,7 +555,7 @@

Returns

-

user object.

+

user object.

[transfer full]

@@ -548,12 +564,12 @@

act_user_manager_create_user_async ()

void
 act_user_manager_create_user_async (ActUserManager *manager,
-                                    const gchar *username,
-                                    const gchar *fullname,
+                                    const gchar *username,
+                                    const gchar *fullname,
                                     ActUserAccountType accounttype,
-                                    GCancellable *cancellable,
-                                    GAsyncReadyCallback callback,
-                                    gpointer user_data);
+ GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data);

Asynchronously creates a user account on the system.

For more details, see act_user_manager_create_user(), which is the synchronous version of this call.

@@ -588,34 +604,34 @@

cancellable

-

optional GCancellable object, +

optional GCancellable object, NULL to ignore.

[allow-none]

callback

-

a GAsyncReadyCallback to call +

a GAsyncReadyCallback to call when the request is satisfied.

[scope async]

user_data

-

the data to pass to callback +

the data to pass to callback .

[closure]
-

Since: 0.6.27

+

Since: 0.6.27


act_user_manager_create_user_finish ()

ActUser *
 act_user_manager_create_user_finish (ActUserManager *manager,
-                                     GAsyncResult *result,
-                                     GError **error);
+ GAsyncResult *result, + GError **error);

Finishes an asynchronous user creation.

See act_user_manager_create_user_async().

@@ -634,12 +650,12 @@

result

-

a GAsyncResult

+

a GAsyncResult

 

error

-

a GError

+

a GError

  @@ -647,19 +663,19 @@

Returns

-

user object.

+

user object.

[transfer full]

-

Since: 0.6.27

+

Since: 0.6.27


act_user_manager_delete_user ()

-
gboolean
+
gboolean
 act_user_manager_delete_user (ActUserManager *manager,
                               ActUser *user,
-                              gboolean remove_files,
-                              GError **error);
+ gboolean remove_files, + GError **error);

Deletes a user account on the system.

Parameters

@@ -682,12 +698,12 @@

remove_files

-

TRUE to delete the users home directory

+

TRUE to delete the users home directory

 

error

-

a GError

+

a GError

  @@ -695,7 +711,7 @@

Returns

-

TRUE if the user account was successfully deleted

+

TRUE if the user account was successfully deleted


@@ -704,10 +720,10 @@
void
 act_user_manager_delete_user_async (ActUserManager *manager,
                                     ActUser *user,
-                                    gboolean remove_files,
-                                    GCancellable *cancellable,
-                                    GAsyncReadyCallback callback,
-                                    gpointer user_data);
+ gboolean remove_files, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data);

Asynchronously deletes a user account from the system.

For more details, see act_user_manager_delete_user(), which is the synchronous version of this call.

@@ -732,39 +748,39 @@

remove_files

-

TRUE to delete the users home directory

+

TRUE to delete the users home directory

 

cancellable

-

optional GCancellable object, +

optional GCancellable object, NULL to ignore.

[allow-none]

callback

-

a GAsyncReadyCallback to call +

a GAsyncReadyCallback to call when the request is satisfied.

[scope async]

user_data

-

the data to pass to callback +

the data to pass to callback .

[closure]
-

Since: 0.6.27

+

Since: 0.6.27


act_user_manager_delete_user_finish ()

-
gboolean
+
gboolean
 act_user_manager_delete_user_finish (ActUserManager *manager,
-                                     GAsyncResult *result,
-                                     GError **error);
+ GAsyncResult *result, + GError **error);

Finishes an asynchronous user account deletion.

See act_user_manager_delete_user_async().

@@ -783,12 +799,12 @@

result

-

a GAsyncResult

+

a GAsyncResult

 

error

-

a GError

+

a GError

  @@ -796,9 +812,9 @@

Returns

-

TRUE if the user account was successfully deleted

+

TRUE if the user account was successfully deleted

-

Since: 0.6.27

+

Since: 0.6.27


@@ -807,11 +823,11 @@ act_user_manager_get_default (void);

Returns the user manager singleton instance. Calling this function will automatically being loading the user list if it isn't loaded already. -The “is-loaded” property will be set to TRUE when the users +The “is-loaded” property will be set to TRUE when the users are finished loading and then act_user_manager_list_users() can be called.

Returns

-

user manager object.

+

user manager object.

[transfer none]

@@ -825,7 +841,7 @@ from manager . Trying to use this object before its -“is-loaded” property is TRUE will result in undefined +“is-loaded” property is TRUE will result in undefined behavior.

Parameters

@@ -851,7 +867,7 @@

Returns

-

ActUser object.

+

ActUser object.

[transfer none]

@@ -864,7 +880,7 @@

Retrieves a pointer to the ActUser object for the user with the given uid from manager . Trying to use this object before its -“is-loaded” property is TRUE will result in undefined +“is-loaded” property is TRUE will result in undefined behavior.

Parameters

@@ -890,14 +906,14 @@

Returns

-

ActUser object.

+

ActUser object.

[transfer none]


act_user_manager_goto_login_session ()

-
gboolean
+
gboolean
 act_user_manager_goto_login_session (ActUserManager *manager);

Switch the display to the login manager.

@@ -923,7 +939,7 @@

act_user_manager_list_users ()

-
GSList *
+
GSList *
 act_user_manager_list_users (ActUserManager *manager);

Get a list of system user accounts

@@ -943,14 +959,14 @@

Returns

-

List of ActUser objects.

+

List of ActUser objects.

[element-type ActUser][transfer container]


act_user_manager_no_service ()

-
gboolean
+
gboolean
 act_user_manager_no_service (ActUserManager *manager);

Check whether or not the accounts service is running.

@@ -976,10 +992,10 @@

act_user_manager_uncache_user ()

-
gboolean
+
gboolean
 act_user_manager_uncache_user (ActUserManager *manager,
                                const char *username,
-                               GError **error);
+ GError **error);

Releases all metadata about a user account, including icon, language and session. If the user account is from a remote server and the user has never logged in before, then that @@ -1005,7 +1021,7 @@

error

-

a GError

+

a GError

  @@ -1013,8 +1029,60 @@

Returns

-

TRUE if successful, otherwise FALSE

+

TRUE if successful, otherwise FALSE

+
+
+
+
+

act_user_manager_uncache_user_async ()

+
void
+act_user_manager_uncache_user_async (ActUserManager *manager,
+                                     const gchar *username,
+                                     GCancellable *cancellable,
+                                     GAsyncReadyCallback callback,
+                                     gpointer user_data);
+
+
+
+

act_user_manager_uncache_user_finish ()

+
gboolean
+act_user_manager_uncache_user_finish (ActUserManager *manager,
+                                      GAsyncResult *result,
+                                      GError **error);
+

Finishes an asynchronous user uncaching.

+

See act_user_manager_uncache_user_async().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

manager

a ActUserManager

 

result

a GAsyncResult

 

error

a GError

 
+
+
+

Returns

+

TRUE if the user account was successfully uncached

+

Since: 0.6.39

@@ -1088,29 +1156,29 @@

Property Details

The “exclude-usernames-list” property

-
  “exclude-usernames-list”   gpointer
+
  “exclude-usernames-list”   gpointer

Usernames who are specifically excluded.

Flags: Read / Write


The “has-multiple-users” property

-
  “has-multiple-users”       gboolean
+
  “has-multiple-users”       gboolean

Whether more than one normal user is present.

-

Flags: Read

+

Flags: Read / Write

Default value: FALSE


The “include-usernames-list” property

-
  “include-usernames-list”   gpointer
+
  “include-usernames-list”   gpointer

Usernames who are specifically included.

Flags: Read / Write


The “is-loaded” property

-
  “is-loaded”                gboolean
+
  “is-loaded”                gboolean

Determines whether or not the manager object is loaded and ready to read from.

Flags: Read

Default value: FALSE

@@ -1123,7 +1191,7 @@
void
 user_function (ActUserManager *gobject,
                ActUser        *user,
-               gpointer        user_data)
+ gpointer user_data)

Emitted when a user is added to the user manager.

Parameters

@@ -1160,7 +1228,7 @@
void
 user_function (ActUserManager *gobject,
                ActUser        *user,
-               gpointer        user_data)
+ gpointer user_data)

One of the users has changed

Parameters

@@ -1197,7 +1265,7 @@
void
 user_function (ActUserManager *gobject,
                ActUser        *user,
-               gpointer        user_data)
+ gpointer user_data)

One of the users has logged in or out.

Parameters

@@ -1234,7 +1302,7 @@
void
 user_function (ActUserManager *gobject,
                ActUser        *user,
-               gpointer        user_data)
+ gpointer user_data)

Emitted when a user is removed from the user manager.

Parameters

@@ -1268,6 +1336,6 @@
+
Generated by GTK-Doc V1.28
\ No newline at end of file diff -Nru accountsservice-0.6.45/doc/libaccountsservice/html/annotation-glossary.html accountsservice-0.6.50/doc/libaccountsservice/html/annotation-glossary.html --- accountsservice-0.6.45/doc/libaccountsservice/html/annotation-glossary.html 2017-03-27 20:33:44.000000000 +0200 +++ accountsservice-0.6.50/doc/libaccountsservice/html/annotation-glossary.html 2018-07-10 17:27:02.000000000 +0200 @@ -6,8 +6,8 @@ - - + + @@ -23,7 +23,7 @@ T Home -Prev +Prev
@@ -50,6 +50,6 @@

Don't free data after the code is done.

+
Generated by GTK-Doc V1.28
\ No newline at end of file diff -Nru accountsservice-0.6.45/doc/libaccountsservice/html/api-index-0-6-27.html accountsservice-0.6.50/doc/libaccountsservice/html/api-index-0-6-27.html --- accountsservice-0.6.45/doc/libaccountsservice/html/api-index-0-6-27.html 1970-01-01 01:00:00.000000000 +0100 +++ accountsservice-0.6.50/doc/libaccountsservice/html/api-index-0-6-27.html 2018-07-10 17:27:02.000000000 +0200 @@ -0,0 +1,54 @@ + + + + +Index of new symbols in 0.6.27: libaccountsservice Reference Manual + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -Nru accountsservice-0.6.45/doc/libaccountsservice/html/api-index-0-6-39.html accountsservice-0.6.50/doc/libaccountsservice/html/api-index-0-6-39.html --- accountsservice-0.6.45/doc/libaccountsservice/html/api-index-0-6-39.html 1970-01-01 01:00:00.000000000 +0100 +++ accountsservice-0.6.50/doc/libaccountsservice/html/api-index-0-6-39.html 2018-07-10 17:27:02.000000000 +0200 @@ -0,0 +1,34 @@ + + + + +Index of new symbols in 0.6.39: libaccountsservice Reference Manual + + + + + + + + + + + + + + + + +
+

+Index of new symbols in 0.6.39

+

U

+
+act_user_manager_uncache_user_finish, function in ActUserManager +
+
+
+ + + \ No newline at end of file diff -Nru accountsservice-0.6.45/doc/libaccountsservice/html/api-index-full.html accountsservice-0.6.50/doc/libaccountsservice/html/api-index-full.html --- accountsservice-0.6.45/doc/libaccountsservice/html/api-index-full.html 2017-03-27 20:33:44.000000000 +0200 +++ accountsservice-0.6.50/doc/libaccountsservice/html/api-index-full.html 2018-07-10 17:27:02.000000000 +0200 @@ -7,8 +7,8 @@ - - + + @@ -17,7 +17,7 @@ Home Prev -Next +Next

@@ -224,10 +224,18 @@
+act_user_get_num_sessions_anywhere, function in ActUser +
+
+
act_user_get_object_path, function in ActUser
+act_user_get_password_expiration_policy, function in ActUser +
+
+
act_user_get_password_hint, function in ActUser
@@ -272,6 +280,14 @@
+act_user_is_logged_in_anywhere, function in ActUser +
+
+
+act_user_is_nonexistent, function in ActUser +
+
+
act_user_is_system_account, function in ActUser
@@ -352,6 +368,14 @@
+act_user_manager_uncache_user_async, function in ActUserManager +
+
+
+act_user_manager_uncache_user_finish, function in ActUserManager +
+
+
act_user_set_account_type, function in ActUser
@@ -405,6 +429,6 @@

+
Generated by GTK-Doc V1.28
\ No newline at end of file diff -Nru accountsservice-0.6.45/doc/libaccountsservice/html/ch01.html accountsservice-0.6.50/doc/libaccountsservice/html/ch01.html --- accountsservice-0.6.45/doc/libaccountsservice/html/ch01.html 2017-03-27 20:33:44.000000000 +0200 +++ accountsservice-0.6.50/doc/libaccountsservice/html/ch01.html 2018-07-10 17:27:02.000000000 +0200 @@ -8,7 +8,7 @@ - + @@ -32,6 +32,6 @@
+
Generated by GTK-Doc V1.28
\ No newline at end of file diff -Nru accountsservice-0.6.45/doc/libaccountsservice/html/index.html accountsservice-0.6.50/doc/libaccountsservice/html/index.html --- accountsservice-0.6.45/doc/libaccountsservice/html/index.html 2017-03-27 20:33:44.000000000 +0200 +++ accountsservice-0.6.50/doc/libaccountsservice/html/index.html 2018-07-10 17:27:02.000000000 +0200 @@ -6,7 +6,7 @@ - + @@ -26,10 +26,12 @@
API Index
+
Index of new symbols in 0.6.27
+
Index of new symbols in 0.6.39
Annotation Glossary
+
Generated by GTK-Doc V1.28
\ No newline at end of file diff -Nru accountsservice-0.6.45/doc/libaccountsservice/html/libaccountsservice.devhelp2 accountsservice-0.6.50/doc/libaccountsservice/html/libaccountsservice.devhelp2 --- accountsservice-0.6.45/doc/libaccountsservice/html/libaccountsservice.devhelp2 2017-03-27 20:33:43.000000000 +0200 +++ accountsservice-0.6.50/doc/libaccountsservice/html/libaccountsservice.devhelp2 2018-07-10 17:27:01.000000000 +0200 @@ -6,6 +6,8 @@ + + @@ -22,7 +24,9 @@ + + @@ -34,6 +38,8 @@ + + @@ -93,6 +99,8 @@ + + diff -Nru accountsservice-0.6.45/doc/libaccountsservice/html/style.css accountsservice-0.6.50/doc/libaccountsservice/html/style.css --- accountsservice-0.6.45/doc/libaccountsservice/html/style.css 2017-03-27 20:33:43.000000000 +0200 +++ accountsservice-0.6.50/doc/libaccountsservice/html/style.css 2018-07-10 17:27:01.000000000 +0200 @@ -30,6 +30,10 @@ vertical-align: top; } +span.nowrap { + white-space: nowrap; +} + div.gallery-float { float: left; diff -Nru accountsservice-0.6.45/doc/libaccountsservice/libaccountsservice-docs.xml accountsservice-0.6.50/doc/libaccountsservice/libaccountsservice-docs.xml --- accountsservice-0.6.45/doc/libaccountsservice/libaccountsservice-docs.xml 2016-06-27 20:00:14.000000000 +0200 +++ accountsservice-0.6.50/doc/libaccountsservice/libaccountsservice-docs.xml 2018-04-04 15:59:42.000000000 +0200 @@ -19,6 +19,14 @@ API Index + + Index of new symbols in 0.6.27 + + + + Index of new symbols in 0.6.39 + + diff -Nru accountsservice-0.6.45/doc/libaccountsservice/libaccountsservice-sections.txt accountsservice-0.6.50/doc/libaccountsservice/libaccountsservice-sections.txt --- accountsservice-0.6.45/doc/libaccountsservice/libaccountsservice-sections.txt 2017-03-27 20:33:43.000000000 +0200 +++ accountsservice-0.6.50/doc/libaccountsservice/libaccountsservice-sections.txt 2018-07-10 17:27:01.000000000 +0200 @@ -16,7 +16,9 @@ act_user_get_login_history act_user_get_login_time act_user_get_num_sessions +act_user_get_num_sessions_anywhere act_user_get_object_path +act_user_get_password_expiration_policy act_user_get_password_hint act_user_get_password_mode act_user_get_primary_session_id @@ -28,6 +30,8 @@ act_user_is_loaded act_user_is_local_account act_user_is_logged_in +act_user_is_logged_in_anywhere +act_user_is_nonexistent act_user_is_system_account act_user_set_account_type act_user_set_automatic_login @@ -73,6 +77,8 @@ act_user_manager_list_users act_user_manager_no_service act_user_manager_uncache_user +act_user_manager_uncache_user_async +act_user_manager_uncache_user_finish ActUserManagerClass ACT_IS_USER_MANAGER diff -Nru accountsservice-0.6.45/doc/libaccountsservice/Makefile.am accountsservice-0.6.50/doc/libaccountsservice/Makefile.am --- accountsservice-0.6.45/doc/libaccountsservice/Makefile.am 2016-06-27 20:00:14.000000000 +0200 +++ accountsservice-0.6.50/doc/libaccountsservice/Makefile.am 2018-04-04 15:59:42.000000000 +0200 @@ -20,11 +20,11 @@ GTKDOC_CFLAGS= \ -I$(top_srcdir)/src/libaccountsservice \ - $(GIO_CFLAGS) + $(LIBACCOUNTSSERVICE_CFLAGS) GTKDOC_LIBS= \ $(top_builddir)/src/libaccountsservice/libaccountsservice.la \ - $(GIO_LIBS) + $(LIBACCOUNTSSERVICE_LIBS) include $(top_srcdir)/gtk-doc.make diff -Nru accountsservice-0.6.45/doc/libaccountsservice/Makefile.in accountsservice-0.6.50/doc/libaccountsservice/Makefile.in --- accountsservice-0.6.45/doc/libaccountsservice/Makefile.in 2017-03-27 20:33:02.000000000 +0200 +++ accountsservice-0.6.50/doc/libaccountsservice/Makefile.in 2018-07-10 17:25:08.000000000 +0200 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -15,6 +15,24 @@ @SET_MAKE@ # -*- mode: makefile -*- +# +# gtk-doc.make - make rules for gtk-doc +# Copyright (C) 2003 James Henstridge +# 2004-2007 Damon Chaplin +# 2007-2017 Stefan Sauer +# +# 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 License, 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, see . #################################### # Everything below here is generic # @@ -128,6 +146,8 @@ am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/gtk-doc.make DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACCOUNTS_DAEMON_CFLAGS = @ACCOUNTS_DAEMON_CFLAGS@ +ACCOUNTS_DAEMON_LIBS = @ACCOUNTS_DAEMON_LIBS@ ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ @@ -155,11 +175,11 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ +ELOGIND_CFLAGS = @ELOGIND_CFLAGS@ +ELOGIND_LIBS = @ELOGIND_LIBS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ -GIO_CFLAGS = @GIO_CFLAGS@ -GIO_LIBS = @GIO_LIBS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ @@ -185,6 +205,7 @@ INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ @@ -233,8 +254,6 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POFILES = @POFILES@ -POLKIT_CFLAGS = @POLKIT_CFLAGS@ -POLKIT_LIBS = @POLKIT_LIBS@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ @@ -323,11 +342,11 @@ GTKDOC_CFLAGS = \ -I$(top_srcdir)/src/libaccountsservice \ - $(GIO_CFLAGS) + $(LIBACCOUNTSSERVICE_CFLAGS) GTKDOC_LIBS = \ $(top_builddir)/src/libaccountsservice/libaccountsservice.la \ - $(GIO_LIBS) + $(LIBACCOUNTSSERVICE_LIBS) @GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_CC = $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_CC = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -378,34 +397,34 @@ @GTK_DOC_BUILD_PDF_TRUE@PDF_BUILD_STAMP = pdf-build.stamp #### setup #### -GTK_DOC_V_SETUP = $(GTK_DOC_V_SETUP_$(V)) -GTK_DOC_V_SETUP_ = $(GTK_DOC_V_SETUP_$(AM_DEFAULT_VERBOSITY)) +GTK_DOC_V_SETUP = $(GTK_DOC_V_SETUP_@AM_V@) +GTK_DOC_V_SETUP_ = $(GTK_DOC_V_SETUP_@AM_DEFAULT_V@) GTK_DOC_V_SETUP_0 = @echo " DOC Preparing build"; #### scan #### -GTK_DOC_V_SCAN = $(GTK_DOC_V_SCAN_$(V)) -GTK_DOC_V_SCAN_ = $(GTK_DOC_V_SCAN_$(AM_DEFAULT_VERBOSITY)) +GTK_DOC_V_SCAN = $(GTK_DOC_V_SCAN_@AM_V@) +GTK_DOC_V_SCAN_ = $(GTK_DOC_V_SCAN_@AM_DEFAULT_V@) GTK_DOC_V_SCAN_0 = @echo " DOC Scanning header files"; -GTK_DOC_V_INTROSPECT = $(GTK_DOC_V_INTROSPECT_$(V)) -GTK_DOC_V_INTROSPECT_ = $(GTK_DOC_V_INTROSPECT_$(AM_DEFAULT_VERBOSITY)) +GTK_DOC_V_INTROSPECT = $(GTK_DOC_V_INTROSPECT_@AM_V@) +GTK_DOC_V_INTROSPECT_ = $(GTK_DOC_V_INTROSPECT_@AM_DEFAULT_V@) GTK_DOC_V_INTROSPECT_0 = @echo " DOC Introspecting gobjects"; #### xml #### -GTK_DOC_V_XML = $(GTK_DOC_V_XML_$(V)) -GTK_DOC_V_XML_ = $(GTK_DOC_V_XML_$(AM_DEFAULT_VERBOSITY)) +GTK_DOC_V_XML = $(GTK_DOC_V_XML_@AM_V@) +GTK_DOC_V_XML_ = $(GTK_DOC_V_XML_@AM_DEFAULT_V@) GTK_DOC_V_XML_0 = @echo " DOC Building XML"; #### html #### -GTK_DOC_V_HTML = $(GTK_DOC_V_HTML_$(V)) -GTK_DOC_V_HTML_ = $(GTK_DOC_V_HTML_$(AM_DEFAULT_VERBOSITY)) +GTK_DOC_V_HTML = $(GTK_DOC_V_HTML_@AM_V@) +GTK_DOC_V_HTML_ = $(GTK_DOC_V_HTML_@AM_DEFAULT_V@) GTK_DOC_V_HTML_0 = @echo " DOC Building HTML"; -GTK_DOC_V_XREF = $(GTK_DOC_V_XREF_$(V)) -GTK_DOC_V_XREF_ = $(GTK_DOC_V_XREF_$(AM_DEFAULT_VERBOSITY)) +GTK_DOC_V_XREF = $(GTK_DOC_V_XREF_@AM_V@) +GTK_DOC_V_XREF_ = $(GTK_DOC_V_XREF_@AM_DEFAULT_V@) GTK_DOC_V_XREF_0 = @echo " DOC Fixing cross-references"; #### pdf #### -GTK_DOC_V_PDF = $(GTK_DOC_V_PDF_$(V)) -GTK_DOC_V_PDF_ = $(GTK_DOC_V_PDF_$(AM_DEFAULT_VERBOSITY)) +GTK_DOC_V_PDF = $(GTK_DOC_V_PDF_@AM_V@) +GTK_DOC_V_PDF_ = $(GTK_DOC_V_PDF_@AM_DEFAULT_V@) GTK_DOC_V_PDF_0 = @echo " DOC Building PDF"; all: all-am @@ -624,38 +643,38 @@ setup-build.stamp: -$(GTK_DOC_V_SETUP)if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ - files=`echo $(SETUP_FILES) $(DOC_MODULE).types`; \ - if test "x$$files" != "x" ; then \ - for file in $$files ; do \ - destdir=`dirname $(abs_builddir)/$$file`; \ - test -d "$$destdir" || mkdir -p "$$destdir"; \ - test -f $(abs_srcdir)/$$file && \ - cp -pf $(abs_srcdir)/$$file $(abs_builddir)/$$file || true; \ - done; \ - fi; \ + files=`echo $(SETUP_FILES) $(DOC_MODULE).types`; \ + if test "x$$files" != "x" ; then \ + for file in $$files ; do \ + destdir=`dirname $(abs_builddir)/$$file`; \ + test -d "$$destdir" || mkdir -p "$$destdir"; \ + test -f $(abs_srcdir)/$$file && \ + cp -pf $(abs_srcdir)/$$file $(abs_builddir)/$$file || true; \ + done; \ + fi; \ fi $(AM_V_at)touch setup-build.stamp scan-build.stamp: setup-build.stamp $(HFILE_GLOB) $(CFILE_GLOB) $(GTK_DOC_V_SCAN)_source_dir='' ; \ for i in $(DOC_SOURCE_DIR) ; do \ - _source_dir="$${_source_dir} --source-dir=$$i" ; \ + _source_dir="$${_source_dir} --source-dir=$$i" ; \ done ; \ gtkdoc-scan --module=$(DOC_MODULE) --ignore-headers="$(IGNORE_HFILES)" $${_source_dir} $(SCAN_OPTIONS) $(EXTRA_HFILES) $(GTK_DOC_V_INTROSPECT)if grep -l '^..*$$' $(DOC_MODULE).types > /dev/null 2>&1 ; then \ - scanobj_options=""; \ - gtkdoc-scangobj 2>&1 --help | grep >/dev/null "\-\-verbose"; \ - if test "$$?" = "0"; then \ - if test "x$(V)" = "x1"; then \ - scanobj_options="--verbose"; \ - fi; \ + scanobj_options=""; \ + gtkdoc-scangobj 2>&1 --help | grep >/dev/null "\-\-verbose"; \ + if test "$$?" = "0"; then \ + if test "x$(V)" = "x1"; then \ + scanobj_options="--verbose"; \ fi; \ - CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" \ - gtkdoc-scangobj $(SCANGOBJ_OPTIONS) $$scanobj_options --module=$(DOC_MODULE); \ + fi; \ + CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" \ + gtkdoc-scangobj $(SCANGOBJ_OPTIONS) $$scanobj_options --module=$(DOC_MODULE); \ else \ - for i in $(SCANOBJ_FILES) ; do \ - test -f $$i || touch $$i ; \ - done \ + for i in $(SCANOBJ_FILES) ; do \ + test -f $$i || touch $$i ; \ + done \ fi $(AM_V_at)touch scan-build.stamp @@ -665,7 +684,7 @@ sgml-build.stamp: setup-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(HFILE_GLOB) $(CFILE_GLOB) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt $(expand_content_files) xml/gtkdocentities.ent $(GTK_DOC_V_XML)_source_dir='' ; \ for i in $(DOC_SOURCE_DIR) ; do \ - _source_dir="$${_source_dir} --source-dir=$$i" ; \ + _source_dir="$${_source_dir} --source-dir=$$i" ; \ done ; \ gtkdoc-mkdb --module=$(DOC_MODULE) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $${_source_dir} $(MKDB_OPTIONS) $(AM_V_at)touch sgml-build.stamp @@ -673,6 +692,9 @@ sgml.stamp: sgml-build.stamp @true +$(DOC_MAIN_SGML_FILE): sgml-build.stamp + @true + xml/gtkdocentities.ent: Makefile $(GTK_DOC_V_XML)$(MKDIR_P) $(@D) && ( \ echo ""; \ @@ -700,12 +722,8 @@ cd html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE) -@test "x$(HTML_IMAGES)" = "x" || \ for file in $(HTML_IMAGES) ; do \ - if test -f $(abs_srcdir)/$$file ; then \ - cp $(abs_srcdir)/$$file $(abs_builddir)/html; \ - fi; \ - if test -f $(abs_builddir)/$$file ; then \ - cp $(abs_builddir)/$$file $(abs_builddir)/html; \ - fi; \ + test -f $(abs_srcdir)/$$file && cp $(abs_srcdir)/$$file $(abs_builddir)/html; \ + test -f $(abs_builddir)/$$file && cp $(abs_builddir)/$$file $(abs_builddir)/html; \ done; $(GTK_DOC_V_XREF)gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS) $(AM_V_at)touch html-build.stamp diff -Nru accountsservice-0.6.45/doc/Makefile.in accountsservice-0.6.50/doc/Makefile.in --- accountsservice-0.6.45/doc/Makefile.in 2017-03-27 20:33:02.000000000 +0200 +++ accountsservice-0.6.50/doc/Makefile.in 2018-07-10 17:25:07.000000000 +0200 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -182,6 +182,8 @@ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" +ACCOUNTS_DAEMON_CFLAGS = @ACCOUNTS_DAEMON_CFLAGS@ +ACCOUNTS_DAEMON_LIBS = @ACCOUNTS_DAEMON_LIBS@ ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ @@ -209,11 +211,11 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ +ELOGIND_CFLAGS = @ELOGIND_CFLAGS@ +ELOGIND_LIBS = @ELOGIND_LIBS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ -GIO_CFLAGS = @GIO_CFLAGS@ -GIO_LIBS = @GIO_LIBS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ @@ -239,6 +241,7 @@ INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ @@ -287,8 +290,6 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POFILES = @POFILES@ -POLKIT_CFLAGS = @POLKIT_CFLAGS@ -POLKIT_LIBS = @POLKIT_LIBS@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ diff -Nru accountsservice-0.6.45/gtk-doc.make accountsservice-0.6.50/gtk-doc.make --- accountsservice-0.6.45/gtk-doc.make 2017-02-10 21:19:40.000000000 +0100 +++ accountsservice-0.6.50/gtk-doc.make 2017-11-01 21:20:45.000000000 +0100 @@ -1,4 +1,22 @@ # -*- mode: makefile -*- +# +# gtk-doc.make - make rules for gtk-doc +# Copyright (C) 2003 James Henstridge +# 2004-2007 Damon Chaplin +# 2007-2017 Stefan Sauer +# +# 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 License, 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, see . #################################### # Everything below here is generic # @@ -81,55 +99,54 @@ #### setup #### -GTK_DOC_V_SETUP=$(GTK_DOC_V_SETUP_$(V)) -GTK_DOC_V_SETUP_=$(GTK_DOC_V_SETUP_$(AM_DEFAULT_VERBOSITY)) +GTK_DOC_V_SETUP=$(GTK_DOC_V_SETUP_@AM_V@) +GTK_DOC_V_SETUP_=$(GTK_DOC_V_SETUP_@AM_DEFAULT_V@) GTK_DOC_V_SETUP_0=@echo " DOC Preparing build"; setup-build.stamp: -$(GTK_DOC_V_SETUP)if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ - files=`echo $(SETUP_FILES) $(DOC_MODULE).types`; \ - if test "x$$files" != "x" ; then \ - for file in $$files ; do \ - destdir=`dirname $(abs_builddir)/$$file`; \ - test -d "$$destdir" || mkdir -p "$$destdir"; \ - test -f $(abs_srcdir)/$$file && \ - cp -pf $(abs_srcdir)/$$file $(abs_builddir)/$$file || true; \ - done; \ - fi; \ + files=`echo $(SETUP_FILES) $(DOC_MODULE).types`; \ + if test "x$$files" != "x" ; then \ + for file in $$files ; do \ + destdir=`dirname $(abs_builddir)/$$file`; \ + test -d "$$destdir" || mkdir -p "$$destdir"; \ + test -f $(abs_srcdir)/$$file && \ + cp -pf $(abs_srcdir)/$$file $(abs_builddir)/$$file || true; \ + done; \ + fi; \ fi $(AM_V_at)touch setup-build.stamp - #### scan #### -GTK_DOC_V_SCAN=$(GTK_DOC_V_SCAN_$(V)) -GTK_DOC_V_SCAN_=$(GTK_DOC_V_SCAN_$(AM_DEFAULT_VERBOSITY)) +GTK_DOC_V_SCAN=$(GTK_DOC_V_SCAN_@AM_V@) +GTK_DOC_V_SCAN_=$(GTK_DOC_V_SCAN_@AM_DEFAULT_V@) GTK_DOC_V_SCAN_0=@echo " DOC Scanning header files"; -GTK_DOC_V_INTROSPECT=$(GTK_DOC_V_INTROSPECT_$(V)) -GTK_DOC_V_INTROSPECT_=$(GTK_DOC_V_INTROSPECT_$(AM_DEFAULT_VERBOSITY)) +GTK_DOC_V_INTROSPECT=$(GTK_DOC_V_INTROSPECT_@AM_V@) +GTK_DOC_V_INTROSPECT_=$(GTK_DOC_V_INTROSPECT_@AM_DEFAULT_V@) GTK_DOC_V_INTROSPECT_0=@echo " DOC Introspecting gobjects"; scan-build.stamp: setup-build.stamp $(HFILE_GLOB) $(CFILE_GLOB) $(GTK_DOC_V_SCAN)_source_dir='' ; \ for i in $(DOC_SOURCE_DIR) ; do \ - _source_dir="$${_source_dir} --source-dir=$$i" ; \ + _source_dir="$${_source_dir} --source-dir=$$i" ; \ done ; \ gtkdoc-scan --module=$(DOC_MODULE) --ignore-headers="$(IGNORE_HFILES)" $${_source_dir} $(SCAN_OPTIONS) $(EXTRA_HFILES) $(GTK_DOC_V_INTROSPECT)if grep -l '^..*$$' $(DOC_MODULE).types > /dev/null 2>&1 ; then \ - scanobj_options=""; \ - gtkdoc-scangobj 2>&1 --help | grep >/dev/null "\-\-verbose"; \ - if test "$$?" = "0"; then \ - if test "x$(V)" = "x1"; then \ - scanobj_options="--verbose"; \ - fi; \ + scanobj_options=""; \ + gtkdoc-scangobj 2>&1 --help | grep >/dev/null "\-\-verbose"; \ + if test "$$?" = "0"; then \ + if test "x$(V)" = "x1"; then \ + scanobj_options="--verbose"; \ fi; \ - CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" \ - gtkdoc-scangobj $(SCANGOBJ_OPTIONS) $$scanobj_options --module=$(DOC_MODULE); \ + fi; \ + CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" \ + gtkdoc-scangobj $(SCANGOBJ_OPTIONS) $$scanobj_options --module=$(DOC_MODULE); \ else \ - for i in $(SCANOBJ_FILES) ; do \ - test -f $$i || touch $$i ; \ - done \ + for i in $(SCANOBJ_FILES) ; do \ + test -f $$i || touch $$i ; \ + done \ fi $(AM_V_at)touch scan-build.stamp @@ -138,14 +155,14 @@ #### xml #### -GTK_DOC_V_XML=$(GTK_DOC_V_XML_$(V)) -GTK_DOC_V_XML_=$(GTK_DOC_V_XML_$(AM_DEFAULT_VERBOSITY)) +GTK_DOC_V_XML=$(GTK_DOC_V_XML_@AM_V@) +GTK_DOC_V_XML_=$(GTK_DOC_V_XML_@AM_DEFAULT_V@) GTK_DOC_V_XML_0=@echo " DOC Building XML"; sgml-build.stamp: setup-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(HFILE_GLOB) $(CFILE_GLOB) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt $(expand_content_files) xml/gtkdocentities.ent $(GTK_DOC_V_XML)_source_dir='' ; \ for i in $(DOC_SOURCE_DIR) ; do \ - _source_dir="$${_source_dir} --source-dir=$$i" ; \ + _source_dir="$${_source_dir} --source-dir=$$i" ; \ done ; \ gtkdoc-mkdb --module=$(DOC_MODULE) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $${_source_dir} $(MKDB_OPTIONS) $(AM_V_at)touch sgml-build.stamp @@ -153,6 +170,9 @@ sgml.stamp: sgml-build.stamp @true +$(DOC_MAIN_SGML_FILE): sgml-build.stamp + @true + xml/gtkdocentities.ent: Makefile $(GTK_DOC_V_XML)$(MKDIR_P) $(@D) && ( \ echo ""; \ @@ -166,12 +186,12 @@ #### html #### -GTK_DOC_V_HTML=$(GTK_DOC_V_HTML_$(V)) -GTK_DOC_V_HTML_=$(GTK_DOC_V_HTML_$(AM_DEFAULT_VERBOSITY)) +GTK_DOC_V_HTML=$(GTK_DOC_V_HTML_@AM_V@) +GTK_DOC_V_HTML_=$(GTK_DOC_V_HTML_@AM_DEFAULT_V@) GTK_DOC_V_HTML_0=@echo " DOC Building HTML"; -GTK_DOC_V_XREF=$(GTK_DOC_V_XREF_$(V)) -GTK_DOC_V_XREF_=$(GTK_DOC_V_XREF_$(AM_DEFAULT_VERBOSITY)) +GTK_DOC_V_XREF=$(GTK_DOC_V_XREF_@AM_V@) +GTK_DOC_V_XREF_=$(GTK_DOC_V_XREF_@AM_DEFAULT_V@) GTK_DOC_V_XREF_0=@echo " DOC Fixing cross-references"; html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) $(expand_content_files) @@ -190,20 +210,16 @@ cd html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE) -@test "x$(HTML_IMAGES)" = "x" || \ for file in $(HTML_IMAGES) ; do \ - if test -f $(abs_srcdir)/$$file ; then \ - cp $(abs_srcdir)/$$file $(abs_builddir)/html; \ - fi; \ - if test -f $(abs_builddir)/$$file ; then \ - cp $(abs_builddir)/$$file $(abs_builddir)/html; \ - fi; \ + test -f $(abs_srcdir)/$$file && cp $(abs_srcdir)/$$file $(abs_builddir)/html; \ + test -f $(abs_builddir)/$$file && cp $(abs_builddir)/$$file $(abs_builddir)/html; \ done; $(GTK_DOC_V_XREF)gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS) $(AM_V_at)touch html-build.stamp #### pdf #### -GTK_DOC_V_PDF=$(GTK_DOC_V_PDF_$(V)) -GTK_DOC_V_PDF_=$(GTK_DOC_V_PDF_$(AM_DEFAULT_VERBOSITY)) +GTK_DOC_V_PDF=$(GTK_DOC_V_PDF_@AM_V@) +GTK_DOC_V_PDF_=$(GTK_DOC_V_PDF_@AM_DEFAULT_V@) GTK_DOC_V_PDF_0=@echo " DOC Building PDF"; pdf-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) $(expand_content_files) diff -Nru accountsservice-0.6.45/install-sh accountsservice-0.6.50/install-sh --- accountsservice-0.6.45/install-sh 2017-02-10 07:47:11.000000000 +0100 +++ accountsservice-0.6.50/install-sh 2018-02-09 09:27:34.000000000 +0100 @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2013-12-25.23; # UTC +scriptversion=2016-01-11.22; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -496,6 +496,6 @@ # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: diff -Nru accountsservice-0.6.45/ltmain.sh accountsservice-0.6.50/ltmain.sh --- accountsservice-0.6.45/ltmain.sh 2017-02-11 05:04:27.000000000 +0100 +++ accountsservice-0.6.50/ltmain.sh 2018-04-20 14:52:48.000000000 +0200 @@ -7272,10 +7272,12 @@ # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization + # -specs=* GCC specs files # -stdlib=* select c++ std lib with clang -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ - -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*) + -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \ + -specs=*) func_quote_for_eval "$arg" arg=$func_quote_for_eval_result func_append compile_command " $arg" diff -Nru accountsservice-0.6.45/Makefile.in accountsservice-0.6.50/Makefile.in --- accountsservice-0.6.45/Makefile.in 2017-03-27 20:33:01.000000000 +0200 +++ accountsservice-0.6.50/Makefile.in 2018-07-10 17:25:07.000000000 +0200 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -205,6 +205,8 @@ am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print +ACCOUNTS_DAEMON_CFLAGS = @ACCOUNTS_DAEMON_CFLAGS@ +ACCOUNTS_DAEMON_LIBS = @ACCOUNTS_DAEMON_LIBS@ ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ @@ -232,11 +234,11 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ +ELOGIND_CFLAGS = @ELOGIND_CFLAGS@ +ELOGIND_LIBS = @ELOGIND_LIBS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ -GIO_CFLAGS = @GIO_CFLAGS@ -GIO_LIBS = @GIO_LIBS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ @@ -262,6 +264,7 @@ INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ @@ -310,8 +313,6 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POFILES = @POFILES@ -POLKIT_CFLAGS = @POLKIT_CFLAGS@ -POLKIT_LIBS = @POLKIT_LIBS@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ diff -Nru accountsservice-0.6.45/missing accountsservice-0.6.50/missing --- accountsservice-0.6.45/missing 2017-02-10 07:47:11.000000000 +0100 +++ accountsservice-0.6.50/missing 2018-02-09 09:27:34.000000000 +0100 @@ -1,9 +1,9 @@ -#! /bin/sh +#!/bin/sh # Common wrapper for a few potentially missing GNU programs. -scriptversion=2013-10-28.13; # UTC +scriptversion=2016-01-11.22; # UTC -# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# Copyright (C) 1996-2017 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify @@ -210,6 +210,6 @@ # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: diff -Nru accountsservice-0.6.45/NEWS accountsservice-0.6.50/NEWS --- accountsservice-0.6.45/NEWS 2017-03-27 20:32:01.000000000 +0200 +++ accountsservice-0.6.50/NEWS 2018-07-10 17:23:17.000000000 +0200 @@ -1,3 +1,41 @@ +Changes in 0.6.50 +================= +* Fix insufficient path check on user icon files +* Fix is-logged-in status for wayland sessions +* Fix user enumeration when system accounts are mixed in + +Changes in 0.6.49 +================= +* Fix crash on startup from previous compiler warning fix + +Changes in 0.6.48 +================= +* Fix crash when adding admin user +* Fix crash when user is removed +* performance improvements handling really large wtmp files +* compiler warning fix + +Changes in 0.6.47 +================= +* Fix problem where libaccountsservice users weren't getting + property change updates +* Reduce memory usage of cached users in daemon process +* Drop premature user-added/user-removed signals that + erroneously get emitted before ListCachedUsers call finishes. + +Changes in 0.6.46 +================= +* Fix systemd unit file to use default standard output +* performance improvements +* leak fixes +* crash fixes +* support extra groups for admin users +* add policy that allows admins to allow users to change their own password +* introspection fixes +* elogind support +* decruftification of username blacklist +* Translation updates + Changes in 0.6.45 ================= * wrap password expiration info in libaccountsservice api diff -Nru accountsservice-0.6.45/po/bg_BG.po accountsservice-0.6.50/po/bg_BG.po --- accountsservice-0.6.45/po/bg_BG.po 2012-12-19 15:42:47.000000000 +0100 +++ accountsservice-0.6.50/po/bg_BG.po 1970-01-01 01:00:00.000000000 +0100 @@ -1,60 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: accounts service\n" -"Report-Msgid-Bugs-To: http://bugs.freedesktop.org/\n" -"POT-Creation-Date: 2011-03-17 14:45-0400\n" -"PO-Revision-Date: 2011-03-17 18:52+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Bulgarian (Bulgaria) (http://www.transifex.com/projects/p/freedesktop/language/bg_BG/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: bg_BG\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: ../data/org.freedesktop.accounts.policy.in.h:1 -msgid "Authentication is required to change the login screen configuration" -msgstr "" - -#: ../data/org.freedesktop.accounts.policy.in.h:2 -msgid "Authentication is required to change user data" -msgstr "" - -#: ../data/org.freedesktop.accounts.policy.in.h:3 -msgid "Authentication is required to change your own user data" -msgstr "" - -#: ../data/org.freedesktop.accounts.policy.in.h:4 -msgid "Change the login screen configuration" -msgstr "" - -#: ../data/org.freedesktop.accounts.policy.in.h:5 -msgid "Change your own user data" -msgstr "" - -#: ../data/org.freedesktop.accounts.policy.in.h:6 -msgid "Manage user accounts" -msgstr "" - -#: ../src/main.c:141 -msgid "Output version information and exit" -msgstr "" - -#: ../src/main.c:142 -msgid "Replace existing instance" -msgstr "" - -#: ../src/main.c:143 -msgid "Enable debugging code" -msgstr "" - -#: ../src/main.c:163 -msgid "" -"Provides D-Bus interfaces for querying and manipulating\n" -"user account information." -msgstr "" diff -Nru accountsservice-0.6.45/po/bg.po accountsservice-0.6.50/po/bg.po --- accountsservice-0.6.45/po/bg.po 1970-01-01 01:00:00.000000000 +0100 +++ accountsservice-0.6.50/po/bg.po 2018-04-04 15:59:42.000000000 +0200 @@ -0,0 +1,60 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: accounts service\n" +"Report-Msgid-Bugs-To: http://bugs.freedesktop.org/\n" +"POT-Creation-Date: 2011-03-17 14:45-0400\n" +"PO-Revision-Date: 2011-03-17 18:52+0000\n" +"Last-Translator: FULL NAME \n" +"Language-Team: Bulgarian (Bulgaria) (http://www.transifex.com/projects/p/freedesktop/language/bg_BG/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: bg_BG\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: ../data/org.freedesktop.accounts.policy.in.h:1 +msgid "Authentication is required to change the login screen configuration" +msgstr "" + +#: ../data/org.freedesktop.accounts.policy.in.h:2 +msgid "Authentication is required to change user data" +msgstr "" + +#: ../data/org.freedesktop.accounts.policy.in.h:3 +msgid "Authentication is required to change your own user data" +msgstr "" + +#: ../data/org.freedesktop.accounts.policy.in.h:4 +msgid "Change the login screen configuration" +msgstr "" + +#: ../data/org.freedesktop.accounts.policy.in.h:5 +msgid "Change your own user data" +msgstr "" + +#: ../data/org.freedesktop.accounts.policy.in.h:6 +msgid "Manage user accounts" +msgstr "" + +#: ../src/main.c:141 +msgid "Output version information and exit" +msgstr "" + +#: ../src/main.c:142 +msgid "Replace existing instance" +msgstr "" + +#: ../src/main.c:143 +msgid "Enable debugging code" +msgstr "" + +#: ../src/main.c:163 +msgid "" +"Provides D-Bus interfaces for querying and manipulating\n" +"user account information." +msgstr "" diff -Nru accountsservice-0.6.45/po/fa_IR.po accountsservice-0.6.50/po/fa_IR.po --- accountsservice-0.6.45/po/fa_IR.po 2012-12-19 15:42:47.000000000 +0100 +++ accountsservice-0.6.50/po/fa_IR.po 1970-01-01 01:00:00.000000000 +0100 @@ -1,60 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: accounts service\n" -"Report-Msgid-Bugs-To: http://bugs.freedesktop.org/\n" -"POT-Creation-Date: 2011-03-17 14:45-0400\n" -"PO-Revision-Date: 2011-03-17 18:52+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Persian (Iran) (http://www.transifex.com/projects/p/freedesktop/language/fa_IR/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: fa_IR\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: ../data/org.freedesktop.accounts.policy.in.h:1 -msgid "Authentication is required to change the login screen configuration" -msgstr "" - -#: ../data/org.freedesktop.accounts.policy.in.h:2 -msgid "Authentication is required to change user data" -msgstr "" - -#: ../data/org.freedesktop.accounts.policy.in.h:3 -msgid "Authentication is required to change your own user data" -msgstr "" - -#: ../data/org.freedesktop.accounts.policy.in.h:4 -msgid "Change the login screen configuration" -msgstr "" - -#: ../data/org.freedesktop.accounts.policy.in.h:5 -msgid "Change your own user data" -msgstr "" - -#: ../data/org.freedesktop.accounts.policy.in.h:6 -msgid "Manage user accounts" -msgstr "" - -#: ../src/main.c:141 -msgid "Output version information and exit" -msgstr "" - -#: ../src/main.c:142 -msgid "Replace existing instance" -msgstr "" - -#: ../src/main.c:143 -msgid "Enable debugging code" -msgstr "" - -#: ../src/main.c:163 -msgid "" -"Provides D-Bus interfaces for querying and manipulating\n" -"user account information." -msgstr "" diff -Nru accountsservice-0.6.45/po/fa.po accountsservice-0.6.50/po/fa.po --- accountsservice-0.6.45/po/fa.po 1970-01-01 01:00:00.000000000 +0100 +++ accountsservice-0.6.50/po/fa.po 2018-04-04 15:59:42.000000000 +0200 @@ -0,0 +1,60 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: accounts service\n" +"Report-Msgid-Bugs-To: http://bugs.freedesktop.org/\n" +"POT-Creation-Date: 2011-03-17 14:45-0400\n" +"PO-Revision-Date: 2011-03-17 18:52+0000\n" +"Last-Translator: FULL NAME \n" +"Language-Team: Persian (Iran) (http://www.transifex.com/projects/p/freedesktop/language/fa_IR/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: fa_IR\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#: ../data/org.freedesktop.accounts.policy.in.h:1 +msgid "Authentication is required to change the login screen configuration" +msgstr "" + +#: ../data/org.freedesktop.accounts.policy.in.h:2 +msgid "Authentication is required to change user data" +msgstr "" + +#: ../data/org.freedesktop.accounts.policy.in.h:3 +msgid "Authentication is required to change your own user data" +msgstr "" + +#: ../data/org.freedesktop.accounts.policy.in.h:4 +msgid "Change the login screen configuration" +msgstr "" + +#: ../data/org.freedesktop.accounts.policy.in.h:5 +msgid "Change your own user data" +msgstr "" + +#: ../data/org.freedesktop.accounts.policy.in.h:6 +msgid "Manage user accounts" +msgstr "" + +#: ../src/main.c:141 +msgid "Output version information and exit" +msgstr "" + +#: ../src/main.c:142 +msgid "Replace existing instance" +msgstr "" + +#: ../src/main.c:143 +msgid "Enable debugging code" +msgstr "" + +#: ../src/main.c:163 +msgid "" +"Provides D-Bus interfaces for querying and manipulating\n" +"user account information." +msgstr "" diff -Nru accountsservice-0.6.45/po/LINGUAS accountsservice-0.6.50/po/LINGUAS --- accountsservice-0.6.45/po/LINGUAS 2012-12-19 15:42:47.000000000 +0100 +++ accountsservice-0.6.50/po/LINGUAS 2018-04-04 15:59:42.000000000 +0200 @@ -1,5 +1,5 @@ ar -bg_BG +bg bn_IN ca ca@valencia @@ -10,7 +10,7 @@ en_GB eo es -fa_IR +fa fi fr ga diff -Nru accountsservice-0.6.45/src/accounts-generated.c accountsservice-0.6.50/src/accounts-generated.c --- accountsservice-0.6.45/src/accounts-generated.c 2017-03-27 20:33:36.000000000 +0200 +++ accountsservice-0.6.50/src/accounts-generated.c 2018-07-10 17:26:57.000000000 +0200 @@ -1,7 +1,8 @@ /* - * Generated by gdbus-codegen 2.51.5. DO NOT EDIT. + * Generated by gdbus-codegen 2.56.1. DO NOT EDIT. * - * The license of this code is the same as for the source it was derived from. + * The license of this code is the same as for the D-Bus interface description + * it was derived from. */ #ifdef HAVE_CONFIG_H @@ -395,18 +396,9 @@ NULL }; -static const GDBusAnnotationInfo _accounts_accounts_method_create_user_annotation_info_1 = -{ - -1, - (gchar *) "org.freedesktop.DBus.GLib.Async", - (gchar *) "", - NULL -}; - static const GDBusAnnotationInfo * const _accounts_accounts_method_create_user_annotation_info_pointers[] = { &_accounts_accounts_method_create_user_annotation_info_0, - &_accounts_accounts_method_create_user_annotation_info_1, NULL }; @@ -672,9 +664,51 @@ FALSE }; +static const _ExtendedGDBusPropertyInfo _accounts_accounts_property_info_has_no_users = +{ + { + -1, + (gchar *) "HasNoUsers", + (gchar *) "b", + G_DBUS_PROPERTY_INFO_FLAGS_READABLE, + NULL + }, + "has-no-users", + FALSE +}; + +static const _ExtendedGDBusPropertyInfo _accounts_accounts_property_info_has_multiple_users = +{ + { + -1, + (gchar *) "HasMultipleUsers", + (gchar *) "b", + G_DBUS_PROPERTY_INFO_FLAGS_READABLE, + NULL + }, + "has-multiple-users", + FALSE +}; + +static const _ExtendedGDBusPropertyInfo _accounts_accounts_property_info_automatic_login_users = +{ + { + -1, + (gchar *) "AutomaticLoginUsers", + (gchar *) "ao", + G_DBUS_PROPERTY_INFO_FLAGS_READABLE, + NULL + }, + "automatic-login-users", + FALSE +}; + static const _ExtendedGDBusPropertyInfo * const _accounts_accounts_property_info_pointers[] = { &_accounts_accounts_property_info_daemon_version, + &_accounts_accounts_property_info_has_no_users, + &_accounts_accounts_property_info_has_multiple_users, + &_accounts_accounts_property_info_automatic_login_users, NULL }; @@ -707,7 +741,7 @@ /** * accounts_accounts_override_properties: - * @klass: The class structure for a #GObject-derived class. + * @klass: The class structure for a #GObject derived class. * @property_id_begin: The property id to assign to the first overridden property. * * Overrides all #GObject properties in the #AccountsAccounts interface for a concrete class. @@ -719,6 +753,9 @@ accounts_accounts_override_properties (GObjectClass *klass, guint property_id_begin) { g_object_class_override_property (klass, property_id_begin++, "daemon-version"); + g_object_class_override_property (klass, property_id_begin++, "has-no-users"); + g_object_class_override_property (klass, property_id_begin++, "has-multiple-users"); + g_object_class_override_property (klass, property_id_begin++, "automatic-login-users"); return property_id_begin - 1; } @@ -740,7 +777,10 @@ * @handle_find_user_by_name: Handler for the #AccountsAccounts::handle-find-user-by-name signal. * @handle_list_cached_users: Handler for the #AccountsAccounts::handle-list-cached-users signal. * @handle_uncache_user: Handler for the #AccountsAccounts::handle-uncache-user signal. + * @get_automatic_login_users: Getter for the #AccountsAccounts:automatic-login-users property. * @get_daemon_version: Getter for the #AccountsAccounts:daemon-version property. + * @get_has_multiple_users: Getter for the #AccountsAccounts:has-multiple-users property. + * @get_has_no_users: Getter for the #AccountsAccounts:has-no-users property. * @user_added: Handler for the #AccountsAccounts::user-added signal. * @user_deleted: Handler for the #AccountsAccounts::user-deleted signal. * @@ -748,7 +788,7 @@ */ typedef AccountsAccountsIface AccountsAccountsInterface; -G_DEFINE_INTERFACE (AccountsAccounts, accounts_accounts, G_TYPE_OBJECT); +G_DEFINE_INTERFACE (AccountsAccounts, accounts_accounts, G_TYPE_OBJECT) static void accounts_accounts_default_init (AccountsAccountsIface *iface) @@ -966,6 +1006,33 @@ */ g_object_interface_install_property (iface, g_param_spec_string ("daemon-version", "DaemonVersion", "DaemonVersion", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + /** + * AccountsAccounts:has-no-users: + * + * Represents the D-Bus property "HasNoUsers". + * + * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side. + */ + g_object_interface_install_property (iface, + g_param_spec_boolean ("has-no-users", "HasNoUsers", "HasNoUsers", FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + /** + * AccountsAccounts:has-multiple-users: + * + * Represents the D-Bus property "HasMultipleUsers". + * + * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side. + */ + g_object_interface_install_property (iface, + g_param_spec_boolean ("has-multiple-users", "HasMultipleUsers", "HasMultipleUsers", FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + /** + * AccountsAccounts:automatic-login-users: + * + * Represents the D-Bus property "AutomaticLoginUsers". + * + * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side. + */ + g_object_interface_install_property (iface, + g_param_spec_boxed ("automatic-login-users", "AutomaticLoginUsers", "AutomaticLoginUsers", G_TYPE_STRV, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); } /** @@ -1020,6 +1087,119 @@ } /** + * accounts_accounts_get_has_no_users: (skip) + * @object: A #AccountsAccounts. + * + * Gets the value of the "HasNoUsers" D-Bus property. + * + * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. + * + * Returns: The property value. + */ +gboolean +accounts_accounts_get_has_no_users (AccountsAccounts *object) +{ + return ACCOUNTS_ACCOUNTS_GET_IFACE (object)->get_has_no_users (object); +} + +/** + * accounts_accounts_set_has_no_users: (skip) + * @object: A #AccountsAccounts. + * @value: The value to set. + * + * Sets the "HasNoUsers" D-Bus property to @value. + * + * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side. + */ +void +accounts_accounts_set_has_no_users (AccountsAccounts *object, gboolean value) +{ + g_object_set (G_OBJECT (object), "has-no-users", value, NULL); +} + +/** + * accounts_accounts_get_has_multiple_users: (skip) + * @object: A #AccountsAccounts. + * + * Gets the value of the "HasMultipleUsers" D-Bus property. + * + * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. + * + * Returns: The property value. + */ +gboolean +accounts_accounts_get_has_multiple_users (AccountsAccounts *object) +{ + return ACCOUNTS_ACCOUNTS_GET_IFACE (object)->get_has_multiple_users (object); +} + +/** + * accounts_accounts_set_has_multiple_users: (skip) + * @object: A #AccountsAccounts. + * @value: The value to set. + * + * Sets the "HasMultipleUsers" D-Bus property to @value. + * + * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side. + */ +void +accounts_accounts_set_has_multiple_users (AccountsAccounts *object, gboolean value) +{ + g_object_set (G_OBJECT (object), "has-multiple-users", value, NULL); +} + +/** + * accounts_accounts_get_automatic_login_users: (skip) + * @object: A #AccountsAccounts. + * + * Gets the value of the "AutomaticLoginUsers" D-Bus property. + * + * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. + * + * The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use accounts_accounts_dup_automatic_login_users() if on another thread. + * + * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object. + */ +const gchar *const * +accounts_accounts_get_automatic_login_users (AccountsAccounts *object) +{ + return ACCOUNTS_ACCOUNTS_GET_IFACE (object)->get_automatic_login_users (object); +} + +/** + * accounts_accounts_dup_automatic_login_users: (skip) + * @object: A #AccountsAccounts. + * + * Gets a copy of the "AutomaticLoginUsers" D-Bus property. + * + * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side. + * + * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_strfreev(). + */ +gchar ** +accounts_accounts_dup_automatic_login_users (AccountsAccounts *object) +{ + gchar **value; + g_object_get (G_OBJECT (object), "automatic-login-users", &value, NULL); + return value; +} + +/** + * accounts_accounts_set_automatic_login_users: (skip) + * @object: A #AccountsAccounts. + * @value: The value to set. + * + * Sets the "AutomaticLoginUsers" D-Bus property to @value. + * + * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side. + */ +void +accounts_accounts_set_automatic_login_users (AccountsAccounts *object, const gchar *const *value) +{ + g_object_set (G_OBJECT (object), "automatic-login-users", value, NULL); +} + +/** * accounts_accounts_emit_user_added: * @object: A #AccountsAccounts. * @arg_user: Argument to pass with the signal. @@ -1052,7 +1232,7 @@ /** * accounts_accounts_call_list_cached_users: * @proxy: A #AccountsAccountsProxy. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * @@ -1082,7 +1262,7 @@ /** * accounts_accounts_call_list_cached_users_finish: * @proxy: A #AccountsAccountsProxy. - * @out_users: (out): Return location for return parameter or %NULL to ignore. + * @out_users: (out) (array zero-terminated=1): Return location for return parameter or %NULL to ignore. * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to accounts_accounts_call_list_cached_users(). * @error: Return location for error or %NULL. * @@ -1112,8 +1292,8 @@ /** * accounts_accounts_call_list_cached_users_sync: * @proxy: A #AccountsAccountsProxy. - * @out_users: (out): Return location for return parameter or %NULL to ignore. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @out_users: (out) (array zero-terminated=1): Return location for return parameter or %NULL to ignore. + * @cancellable: (nullable): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the ListCachedUsers() D-Bus method on @proxy. The calling thread is blocked until a reply is received. @@ -1151,7 +1331,7 @@ * accounts_accounts_call_find_user_by_id: * @proxy: A #AccountsAccountsProxy. * @arg_id: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * @@ -1215,7 +1395,7 @@ * @proxy: A #AccountsAccountsProxy. * @arg_id: Argument to pass with the method invocation. * @out_user: (out): Return location for return parameter or %NULL to ignore. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the FindUserById() D-Bus method on @proxy. The calling thread is blocked until a reply is received. @@ -1255,7 +1435,7 @@ * accounts_accounts_call_find_user_by_name: * @proxy: A #AccountsAccountsProxy. * @arg_name: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * @@ -1319,7 +1499,7 @@ * @proxy: A #AccountsAccountsProxy. * @arg_name: Argument to pass with the method invocation. * @out_user: (out): Return location for return parameter or %NULL to ignore. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the FindUserByName() D-Bus method on @proxy. The calling thread is blocked until a reply is received. @@ -1361,7 +1541,7 @@ * @arg_name: Argument to pass with the method invocation. * @arg_fullname: Argument to pass with the method invocation. * @arg_accountType: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * @@ -1431,7 +1611,7 @@ * @arg_fullname: Argument to pass with the method invocation. * @arg_accountType: Argument to pass with the method invocation. * @out_user: (out): Return location for return parameter or %NULL to ignore. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the CreateUser() D-Bus method on @proxy. The calling thread is blocked until a reply is received. @@ -1475,7 +1655,7 @@ * accounts_accounts_call_cache_user: * @proxy: A #AccountsAccountsProxy. * @arg_name: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * @@ -1539,7 +1719,7 @@ * @proxy: A #AccountsAccountsProxy. * @arg_name: Argument to pass with the method invocation. * @out_user: (out): Return location for return parameter or %NULL to ignore. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the CacheUser() D-Bus method on @proxy. The calling thread is blocked until a reply is received. @@ -1579,7 +1759,7 @@ * accounts_accounts_call_uncache_user: * @proxy: A #AccountsAccountsProxy. * @arg_name: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * @@ -1639,7 +1819,7 @@ * accounts_accounts_call_uncache_user_sync: * @proxy: A #AccountsAccountsProxy. * @arg_name: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the UncacheUser() D-Bus method on @proxy. The calling thread is blocked until a reply is received. @@ -1678,7 +1858,7 @@ * @proxy: A #AccountsAccountsProxy. * @arg_id: Argument to pass with the method invocation. * @arg_removeFiles: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * @@ -1741,7 +1921,7 @@ * @proxy: A #AccountsAccountsProxy. * @arg_id: Argument to pass with the method invocation. * @arg_removeFiles: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the DeleteUser() D-Bus method on @proxy. The calling thread is blocked until a reply is received. @@ -1943,11 +2123,11 @@ #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 G_DEFINE_TYPE_WITH_CODE (AccountsAccountsProxy, accounts_accounts_proxy, G_TYPE_DBUS_PROXY, G_ADD_PRIVATE (AccountsAccountsProxy) - G_IMPLEMENT_INTERFACE (ACCOUNTS_TYPE_ACCOUNTS, accounts_accounts_proxy_iface_init)); + G_IMPLEMENT_INTERFACE (ACCOUNTS_TYPE_ACCOUNTS, accounts_accounts_proxy_iface_init)) #else G_DEFINE_TYPE_WITH_CODE (AccountsAccountsProxy, accounts_accounts_proxy, G_TYPE_DBUS_PROXY, - G_IMPLEMENT_INTERFACE (ACCOUNTS_TYPE_ACCOUNTS, accounts_accounts_proxy_iface_init)); + G_IMPLEMENT_INTERFACE (ACCOUNTS_TYPE_ACCOUNTS, accounts_accounts_proxy_iface_init)) #endif static void @@ -1966,7 +2146,7 @@ { const _ExtendedGDBusPropertyInfo *info; GVariant *variant; - g_assert (prop_id != 0 && prop_id - 1 < 1); + g_assert (prop_id != 0 && prop_id - 1 < 4); info = _accounts_accounts_property_info_pointers[prop_id - 1]; variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (object), info->parent_struct.name); if (info->use_gvariant) @@ -2013,7 +2193,7 @@ { const _ExtendedGDBusPropertyInfo *info; GVariant *variant; - g_assert (prop_id != 0 && prop_id - 1 < 1); + g_assert (prop_id != 0 && prop_id - 1 < 4); info = _accounts_accounts_property_info_pointers[prop_id - 1]; variant = g_dbus_gvalue_to_gvariant (value, G_VARIANT_TYPE (info->parent_struct.signature)); g_dbus_proxy_call (G_DBUS_PROXY (object), @@ -2110,6 +2290,55 @@ return value; } +static gboolean +accounts_accounts_proxy_get_has_no_users (AccountsAccounts *object) +{ + AccountsAccountsProxy *proxy = ACCOUNTS_ACCOUNTS_PROXY (object); + GVariant *variant; + gboolean value = 0; + variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "HasNoUsers"); + if (variant != NULL) + { + value = g_variant_get_boolean (variant); + g_variant_unref (variant); + } + return value; +} + +static gboolean +accounts_accounts_proxy_get_has_multiple_users (AccountsAccounts *object) +{ + AccountsAccountsProxy *proxy = ACCOUNTS_ACCOUNTS_PROXY (object); + GVariant *variant; + gboolean value = 0; + variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "HasMultipleUsers"); + if (variant != NULL) + { + value = g_variant_get_boolean (variant); + g_variant_unref (variant); + } + return value; +} + +static const gchar *const * +accounts_accounts_proxy_get_automatic_login_users (AccountsAccounts *object) +{ + AccountsAccountsProxy *proxy = ACCOUNTS_ACCOUNTS_PROXY (object); + GVariant *variant; + const gchar *const *value = NULL; + value = g_datalist_get_data (&proxy->priv->qdata, "AutomaticLoginUsers"); + if (value != NULL) + return value; + variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "AutomaticLoginUsers"); + if (variant != NULL) + { + value = g_variant_get_objv (variant, NULL); + g_datalist_set_data_full (&proxy->priv->qdata, "AutomaticLoginUsers", (gpointer) value, g_free); + g_variant_unref (variant); + } + return value; +} + static void accounts_accounts_proxy_init (AccountsAccountsProxy *proxy) { @@ -2148,15 +2377,18 @@ accounts_accounts_proxy_iface_init (AccountsAccountsIface *iface) { iface->get_daemon_version = accounts_accounts_proxy_get_daemon_version; + iface->get_has_no_users = accounts_accounts_proxy_get_has_no_users; + iface->get_has_multiple_users = accounts_accounts_proxy_get_has_multiple_users; + iface->get_automatic_login_users = accounts_accounts_proxy_get_automatic_login_users; } /** * accounts_accounts_proxy_new: * @connection: A #GDBusConnection. * @flags: Flags from the #GDBusProxyFlags enumeration. - * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. + * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. * @object_path: An object path. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied. * @user_data: User data to pass to @callback. * @@ -2209,9 +2441,9 @@ * accounts_accounts_proxy_new_sync: * @connection: A #GDBusConnection. * @flags: Flags from the #GDBusProxyFlags enumeration. - * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. + * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. * @object_path: An object path. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @error: Return location for error or %NULL * * Synchronously creates a proxy for the D-Bus interface org.freedesktop.Accounts. See g_dbus_proxy_new_sync() for more details. @@ -2246,7 +2478,7 @@ * @flags: Flags from the #GDBusProxyFlags enumeration. * @name: A bus name (well-known or unique). * @object_path: An object path. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied. * @user_data: User data to pass to @callback. * @@ -2301,7 +2533,7 @@ * @flags: Flags from the #GDBusProxyFlags enumeration. * @name: A bus name (well-known or unique). * @object_path: An object path. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @error: Return location for error or %NULL * * Like accounts_accounts_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection. @@ -2610,11 +2842,11 @@ #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 G_DEFINE_TYPE_WITH_CODE (AccountsAccountsSkeleton, accounts_accounts_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON, G_ADD_PRIVATE (AccountsAccountsSkeleton) - G_IMPLEMENT_INTERFACE (ACCOUNTS_TYPE_ACCOUNTS, accounts_accounts_skeleton_iface_init)); + G_IMPLEMENT_INTERFACE (ACCOUNTS_TYPE_ACCOUNTS, accounts_accounts_skeleton_iface_init)) #else G_DEFINE_TYPE_WITH_CODE (AccountsAccountsSkeleton, accounts_accounts_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON, - G_IMPLEMENT_INTERFACE (ACCOUNTS_TYPE_ACCOUNTS, accounts_accounts_skeleton_iface_init)); + G_IMPLEMENT_INTERFACE (ACCOUNTS_TYPE_ACCOUNTS, accounts_accounts_skeleton_iface_init)) #endif static void @@ -2622,7 +2854,7 @@ { AccountsAccountsSkeleton *skeleton = ACCOUNTS_ACCOUNTS_SKELETON (object); guint n; - for (n = 0; n < 1; n++) + for (n = 0; n < 4; n++) g_value_unset (&skeleton->priv->properties[n]); g_free (skeleton->priv->properties); g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free); @@ -2640,7 +2872,7 @@ GParamSpec *pspec G_GNUC_UNUSED) { AccountsAccountsSkeleton *skeleton = ACCOUNTS_ACCOUNTS_SKELETON (object); - g_assert (prop_id != 0 && prop_id - 1 < 1); + g_assert (prop_id != 0 && prop_id - 1 < 4); g_mutex_lock (&skeleton->priv->lock); g_value_copy (&skeleton->priv->properties[prop_id - 1], value); g_mutex_unlock (&skeleton->priv->lock); @@ -2758,7 +2990,7 @@ GParamSpec *pspec) { AccountsAccountsSkeleton *skeleton = ACCOUNTS_ACCOUNTS_SKELETON (object); - g_assert (prop_id != 0 && prop_id - 1 < 1); + g_assert (prop_id != 0 && prop_id - 1 < 4); g_mutex_lock (&skeleton->priv->lock); g_object_freeze_notify (object); if (!_g_value_equal (value, &skeleton->priv->properties[prop_id - 1])) @@ -2783,8 +3015,11 @@ g_mutex_init (&skeleton->priv->lock); skeleton->priv->context = g_main_context_ref_thread_default (); - skeleton->priv->properties = g_new0 (GValue, 1); + skeleton->priv->properties = g_new0 (GValue, 4); g_value_init (&skeleton->priv->properties[0], G_TYPE_STRING); + g_value_init (&skeleton->priv->properties[1], G_TYPE_BOOLEAN); + g_value_init (&skeleton->priv->properties[2], G_TYPE_BOOLEAN); + g_value_init (&skeleton->priv->properties[3], G_TYPE_STRV); } static const gchar * @@ -2798,6 +3033,39 @@ return value; } +static gboolean +accounts_accounts_skeleton_get_has_no_users (AccountsAccounts *object) +{ + AccountsAccountsSkeleton *skeleton = ACCOUNTS_ACCOUNTS_SKELETON (object); + gboolean value; + g_mutex_lock (&skeleton->priv->lock); + value = g_value_get_boolean (&(skeleton->priv->properties[1])); + g_mutex_unlock (&skeleton->priv->lock); + return value; +} + +static gboolean +accounts_accounts_skeleton_get_has_multiple_users (AccountsAccounts *object) +{ + AccountsAccountsSkeleton *skeleton = ACCOUNTS_ACCOUNTS_SKELETON (object); + gboolean value; + g_mutex_lock (&skeleton->priv->lock); + value = g_value_get_boolean (&(skeleton->priv->properties[2])); + g_mutex_unlock (&skeleton->priv->lock); + return value; +} + +static const gchar *const * +accounts_accounts_skeleton_get_automatic_login_users (AccountsAccounts *object) +{ + AccountsAccountsSkeleton *skeleton = ACCOUNTS_ACCOUNTS_SKELETON (object); + const gchar *const *value; + g_mutex_lock (&skeleton->priv->lock); + value = g_value_get_boxed (&(skeleton->priv->properties[3])); + g_mutex_unlock (&skeleton->priv->lock); + return value; +} + static void accounts_accounts_skeleton_class_init (AccountsAccountsSkeletonClass *klass) { @@ -2830,6 +3098,9 @@ iface->user_added = _accounts_accounts_on_signal_user_added; iface->user_deleted = _accounts_accounts_on_signal_user_deleted; iface->get_daemon_version = accounts_accounts_skeleton_get_daemon_version; + iface->get_has_no_users = accounts_accounts_skeleton_get_has_no_users; + iface->get_has_multiple_users = accounts_accounts_skeleton_get_has_multiple_users; + iface->get_automatic_login_users = accounts_accounts_skeleton_get_automatic_login_users; } /** diff -Nru accountsservice-0.6.45/src/accounts-generated.h accountsservice-0.6.50/src/accounts-generated.h --- accountsservice-0.6.45/src/accounts-generated.h 2017-03-27 20:33:36.000000000 +0200 +++ accountsservice-0.6.50/src/accounts-generated.h 2018-07-10 17:26:57.000000000 +0200 @@ -1,7 +1,8 @@ /* - * Generated by gdbus-codegen 2.51.5. DO NOT EDIT. + * Generated by gdbus-codegen 2.56.1. DO NOT EDIT. * - * The license of this code is the same as for the source it was derived from. + * The license of this code is the same as for the D-Bus interface description + * it was derived from. */ #ifndef __ACCOUNTS_GENERATED_H__ @@ -67,8 +68,14 @@ GDBusMethodInvocation *invocation, const gchar *arg_name); + const gchar *const * (*get_automatic_login_users) (AccountsAccounts *object); + const gchar * (*get_daemon_version) (AccountsAccounts *object); + gboolean (*get_has_multiple_users) (AccountsAccounts *object); + + gboolean (*get_has_no_users) (AccountsAccounts *object); + void (*user_added) ( AccountsAccounts *object, const gchar *arg_user); @@ -280,6 +287,16 @@ gchar *accounts_accounts_dup_daemon_version (AccountsAccounts *object); void accounts_accounts_set_daemon_version (AccountsAccounts *object, const gchar *value); +gboolean accounts_accounts_get_has_no_users (AccountsAccounts *object); +void accounts_accounts_set_has_no_users (AccountsAccounts *object, gboolean value); + +gboolean accounts_accounts_get_has_multiple_users (AccountsAccounts *object); +void accounts_accounts_set_has_multiple_users (AccountsAccounts *object, gboolean value); + +const gchar *const *accounts_accounts_get_automatic_login_users (AccountsAccounts *object); +gchar **accounts_accounts_dup_automatic_login_users (AccountsAccounts *object); +void accounts_accounts_set_automatic_login_users (AccountsAccounts *object, const gchar *const *value); + /* ---- */ diff -Nru accountsservice-0.6.45/src/accounts-user-generated.c accountsservice-0.6.50/src/accounts-user-generated.c --- accountsservice-0.6.45/src/accounts-user-generated.c 2017-03-27 20:33:36.000000000 +0200 +++ accountsservice-0.6.50/src/accounts-user-generated.c 2018-07-10 17:26:57.000000000 +0200 @@ -1,7 +1,8 @@ /* - * Generated by gdbus-codegen 2.51.5. DO NOT EDIT. + * Generated by gdbus-codegen 2.56.1. DO NOT EDIT. * - * The license of this code is the same as for the source it was derived from. + * The license of this code is the same as for the D-Bus interface description + * it was derived from. */ #ifdef HAVE_CONFIG_H @@ -1300,7 +1301,7 @@ /** * accounts_user_override_properties: - * @klass: The class structure for a #GObject-derived class. + * @klass: The class structure for a #GObject derived class. * @property_id_begin: The property id to assign to the first overridden property. * * Overrides all #GObject properties in the #AccountsUser interface for a concrete class. @@ -1387,7 +1388,7 @@ */ typedef AccountsUserIface AccountsUserInterface; -G_DEFINE_INTERFACE (AccountsUser, accounts_user, G_TYPE_OBJECT); +G_DEFINE_INTERFACE (AccountsUser, accounts_user, G_TYPE_OBJECT) static void accounts_user_default_init (AccountsUserIface *iface) @@ -2820,7 +2821,7 @@ * accounts_user_call_set_user_name: * @proxy: A #AccountsUserProxy. * @arg_name: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * @@ -2880,7 +2881,7 @@ * accounts_user_call_set_user_name_sync: * @proxy: A #AccountsUserProxy. * @arg_name: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the SetUserName() D-Bus method on @proxy. The calling thread is blocked until a reply is received. @@ -2918,7 +2919,7 @@ * accounts_user_call_set_real_name: * @proxy: A #AccountsUserProxy. * @arg_name: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * @@ -2978,7 +2979,7 @@ * accounts_user_call_set_real_name_sync: * @proxy: A #AccountsUserProxy. * @arg_name: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the SetRealName() D-Bus method on @proxy. The calling thread is blocked until a reply is received. @@ -3016,7 +3017,7 @@ * accounts_user_call_set_email: * @proxy: A #AccountsUserProxy. * @arg_email: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * @@ -3076,7 +3077,7 @@ * accounts_user_call_set_email_sync: * @proxy: A #AccountsUserProxy. * @arg_email: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the SetEmail() D-Bus method on @proxy. The calling thread is blocked until a reply is received. @@ -3114,7 +3115,7 @@ * accounts_user_call_set_language: * @proxy: A #AccountsUserProxy. * @arg_language: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * @@ -3174,7 +3175,7 @@ * accounts_user_call_set_language_sync: * @proxy: A #AccountsUserProxy. * @arg_language: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the SetLanguage() D-Bus method on @proxy. The calling thread is blocked until a reply is received. @@ -3212,7 +3213,7 @@ * accounts_user_call_set_xsession: * @proxy: A #AccountsUserProxy. * @arg_x_session: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * @@ -3272,7 +3273,7 @@ * accounts_user_call_set_xsession_sync: * @proxy: A #AccountsUserProxy. * @arg_x_session: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the SetXSession() D-Bus method on @proxy. The calling thread is blocked until a reply is received. @@ -3310,7 +3311,7 @@ * accounts_user_call_set_location: * @proxy: A #AccountsUserProxy. * @arg_location: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * @@ -3370,7 +3371,7 @@ * accounts_user_call_set_location_sync: * @proxy: A #AccountsUserProxy. * @arg_location: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the SetLocation() D-Bus method on @proxy. The calling thread is blocked until a reply is received. @@ -3408,7 +3409,7 @@ * accounts_user_call_set_home_directory: * @proxy: A #AccountsUserProxy. * @arg_homedir: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * @@ -3468,7 +3469,7 @@ * accounts_user_call_set_home_directory_sync: * @proxy: A #AccountsUserProxy. * @arg_homedir: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the SetHomeDirectory() D-Bus method on @proxy. The calling thread is blocked until a reply is received. @@ -3506,7 +3507,7 @@ * accounts_user_call_set_shell: * @proxy: A #AccountsUserProxy. * @arg_shell: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * @@ -3566,7 +3567,7 @@ * accounts_user_call_set_shell_sync: * @proxy: A #AccountsUserProxy. * @arg_shell: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the SetShell() D-Bus method on @proxy. The calling thread is blocked until a reply is received. @@ -3604,7 +3605,7 @@ * accounts_user_call_set_icon_file: * @proxy: A #AccountsUserProxy. * @arg_filename: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * @@ -3664,7 +3665,7 @@ * accounts_user_call_set_icon_file_sync: * @proxy: A #AccountsUserProxy. * @arg_filename: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the SetIconFile() D-Bus method on @proxy. The calling thread is blocked until a reply is received. @@ -3702,7 +3703,7 @@ * accounts_user_call_set_locked: * @proxy: A #AccountsUserProxy. * @arg_locked: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * @@ -3762,7 +3763,7 @@ * accounts_user_call_set_locked_sync: * @proxy: A #AccountsUserProxy. * @arg_locked: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the SetLocked() D-Bus method on @proxy. The calling thread is blocked until a reply is received. @@ -3800,7 +3801,7 @@ * accounts_user_call_set_account_type: * @proxy: A #AccountsUserProxy. * @arg_accountType: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * @@ -3860,7 +3861,7 @@ * accounts_user_call_set_account_type_sync: * @proxy: A #AccountsUserProxy. * @arg_accountType: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the SetAccountType() D-Bus method on @proxy. The calling thread is blocked until a reply is received. @@ -3898,7 +3899,7 @@ * accounts_user_call_set_password_mode: * @proxy: A #AccountsUserProxy. * @arg_mode: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * @@ -3958,7 +3959,7 @@ * accounts_user_call_set_password_mode_sync: * @proxy: A #AccountsUserProxy. * @arg_mode: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the SetPasswordMode() D-Bus method on @proxy. The calling thread is blocked until a reply is received. @@ -3997,7 +3998,7 @@ * @proxy: A #AccountsUserProxy. * @arg_password: Argument to pass with the method invocation. * @arg_hint: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * @@ -4060,7 +4061,7 @@ * @proxy: A #AccountsUserProxy. * @arg_password: Argument to pass with the method invocation. * @arg_hint: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the SetPassword() D-Bus method on @proxy. The calling thread is blocked until a reply is received. @@ -4100,7 +4101,7 @@ * accounts_user_call_set_password_hint: * @proxy: A #AccountsUserProxy. * @arg_hint: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * @@ -4160,7 +4161,7 @@ * accounts_user_call_set_password_hint_sync: * @proxy: A #AccountsUserProxy. * @arg_hint: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the SetPasswordHint() D-Bus method on @proxy. The calling thread is blocked until a reply is received. @@ -4198,7 +4199,7 @@ * accounts_user_call_set_automatic_login: * @proxy: A #AccountsUserProxy. * @arg_enabled: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * @@ -4258,7 +4259,7 @@ * accounts_user_call_set_automatic_login_sync: * @proxy: A #AccountsUserProxy. * @arg_enabled: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the SetAutomaticLogin() D-Bus method on @proxy. The calling thread is blocked until a reply is received. @@ -4295,7 +4296,7 @@ /** * accounts_user_call_get_password_expiration_policy: * @proxy: A #AccountsUserProxy. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * @@ -4376,7 +4377,7 @@ * @out_max_days_between_changes: (out): Return location for return parameter or %NULL to ignore. * @out_days_to_warn: (out): Return location for return parameter or %NULL to ignore. * @out_days_after_expiration_until_lock: (out): Return location for return parameter or %NULL to ignore. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the GetPasswordExpirationPolicy() D-Bus method on @proxy. The calling thread is blocked until a reply is received. @@ -4751,11 +4752,11 @@ #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 G_DEFINE_TYPE_WITH_CODE (AccountsUserProxy, accounts_user_proxy, G_TYPE_DBUS_PROXY, G_ADD_PRIVATE (AccountsUserProxy) - G_IMPLEMENT_INTERFACE (ACCOUNTS_TYPE_USER, accounts_user_proxy_iface_init)); + G_IMPLEMENT_INTERFACE (ACCOUNTS_TYPE_USER, accounts_user_proxy_iface_init)) #else G_DEFINE_TYPE_WITH_CODE (AccountsUserProxy, accounts_user_proxy, G_TYPE_DBUS_PROXY, - G_IMPLEMENT_INTERFACE (ACCOUNTS_TYPE_USER, accounts_user_proxy_iface_init)); + G_IMPLEMENT_INTERFACE (ACCOUNTS_TYPE_USER, accounts_user_proxy_iface_init)) #endif static void @@ -5264,9 +5265,9 @@ * accounts_user_proxy_new: * @connection: A #GDBusConnection. * @flags: Flags from the #GDBusProxyFlags enumeration. - * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. + * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. * @object_path: An object path. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied. * @user_data: User data to pass to @callback. * @@ -5319,9 +5320,9 @@ * accounts_user_proxy_new_sync: * @connection: A #GDBusConnection. * @flags: Flags from the #GDBusProxyFlags enumeration. - * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. + * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. * @object_path: An object path. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @error: Return location for error or %NULL * * Synchronously creates a proxy for the D-Bus interface org.freedesktop.Accounts.User. See g_dbus_proxy_new_sync() for more details. @@ -5356,7 +5357,7 @@ * @flags: Flags from the #GDBusProxyFlags enumeration. * @name: A bus name (well-known or unique). * @object_path: An object path. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied. * @user_data: User data to pass to @callback. * @@ -5411,7 +5412,7 @@ * @flags: Flags from the #GDBusProxyFlags enumeration. * @name: A bus name (well-known or unique). * @object_path: An object path. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @error: Return location for error or %NULL * * Like accounts_user_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection. @@ -5694,11 +5695,11 @@ #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 G_DEFINE_TYPE_WITH_CODE (AccountsUserSkeleton, accounts_user_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON, G_ADD_PRIVATE (AccountsUserSkeleton) - G_IMPLEMENT_INTERFACE (ACCOUNTS_TYPE_USER, accounts_user_skeleton_iface_init)); + G_IMPLEMENT_INTERFACE (ACCOUNTS_TYPE_USER, accounts_user_skeleton_iface_init)) #else G_DEFINE_TYPE_WITH_CODE (AccountsUserSkeleton, accounts_user_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON, - G_IMPLEMENT_INTERFACE (ACCOUNTS_TYPE_USER, accounts_user_skeleton_iface_init)); + G_IMPLEMENT_INTERFACE (ACCOUNTS_TYPE_USER, accounts_user_skeleton_iface_init)) #endif static void diff -Nru accountsservice-0.6.45/src/accounts-user-generated.h accountsservice-0.6.50/src/accounts-user-generated.h --- accountsservice-0.6.45/src/accounts-user-generated.h 2017-03-27 20:33:36.000000000 +0200 +++ accountsservice-0.6.50/src/accounts-user-generated.h 2018-07-10 17:26:57.000000000 +0200 @@ -1,7 +1,8 @@ /* - * Generated by gdbus-codegen 2.51.5. DO NOT EDIT. + * Generated by gdbus-codegen 2.56.1. DO NOT EDIT. * - * The license of this code is the same as for the source it was derived from. + * The license of this code is the same as for the D-Bus interface description + * it was derived from. */ #ifndef __ACCOUNTS_USER_GENERATED_H__ diff -Nru accountsservice-0.6.45/src/daemon.c accountsservice-0.6.50/src/daemon.c --- accountsservice-0.6.45/src/daemon.c 2017-03-27 20:05:12.000000000 +0200 +++ accountsservice-0.6.50/src/daemon.c 2018-06-13 18:39:06.000000000 +0200 @@ -51,7 +51,6 @@ #define PATH_PASSWD "/etc/passwd" #define PATH_SHADOW "/etc/shadow" #define PATH_GROUP "/etc/group" -#define PATH_GDM_CUSTOM "/etc/gdm/custom.conf" enum { PROP_0, @@ -62,6 +61,7 @@ GDBusConnection *bus_connection; GHashTable *users; + gsize number_of_normal_users; GList *explicitly_requested_users; User *autologin; @@ -87,8 +87,10 @@ #define DAEMON_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_DAEMON, DaemonPrivate)) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (Daemon, g_object_unref) + static const GDBusErrorEntry accounts_error_entries[] = -{ +{ { ERROR_FAILED, "org.freedesktop.Accounts.Error.Failed" }, { ERROR_USER_EXISTS, "org.freedesktop.Accounts.Error.UserExists" }, { ERROR_USER_DOES_NOT_EXIST, "org.freedesktop.Accounts.Error.UserDoesNotExist" }, @@ -140,6 +142,19 @@ #define MAX_LOCAL_USERS 50 #endif +static void +remove_cache_files (const gchar *user_name) +{ + g_autofree gchar *user_filename = NULL; + g_autofree gchar *icon_filename = NULL; + + user_filename = g_build_filename (USERDIR, user_name, NULL); + g_remove (user_filename); + + icon_filename = g_build_filename (ICONDIR, user_name, NULL); + g_remove (icon_filename); +} + static struct passwd * entry_generator_fgetpwent (Daemon *daemon, GHashTable *users, @@ -220,8 +235,8 @@ if (shadow_entry_buffers != NULL) { *spent = &shadow_entry_buffers->spbuf; - return pwent; } + return pwent; } } @@ -241,12 +256,10 @@ struct spwd **shadow_entry) { struct passwd *pwent; - const gchar *name; - GError *error = NULL; - gchar *filename; + g_autoptr(GError) error = NULL; gboolean regular; GHashTableIter iter; - GKeyFile *key_file; + const gchar *name; User *user; GDir *dir; @@ -256,7 +269,6 @@ if (error != NULL) { if (!g_error_matches (error, G_FILE_ERROR, G_FILE_ERROR_NOENT)) g_warning ("couldn't list user cache directory: %s", USERDIR); - g_error_free (error); return NULL; } } @@ -269,6 +281,9 @@ */ dir = *state; while (TRUE) { + const gchar *name; + g_autofree gchar *filename = NULL; + name = g_dir_read_name (dir); if (name == NULL) break; @@ -276,16 +291,21 @@ /* Only load files in this directory */ filename = g_build_filename (USERDIR, name, NULL); regular = g_file_test (filename, G_FILE_TEST_IS_REGULAR); - g_free (filename); if (regular) { + errno = 0; pwent = getpwnam (name); - if (pwent == NULL) { - g_debug ("user '%s' in cache dir but not present on system", name); - } else { + if (pwent != NULL) { *shadow_entry = getspnam (pwent->pw_name); return pwent; + } else if (errno == 0) { + g_debug ("user '%s' in cache dir but not present on system, removing", name); + remove_cache_files (name); + } + else { + g_warning ("failed to check if user '%s' in cache dir is present on system: %s", + name, g_strerror (errno)); } } } @@ -296,12 +316,13 @@ /* Update all the users from the files in the cache dir */ g_hash_table_iter_init (&iter, users); while (g_hash_table_iter_next (&iter, (gpointer *)&name, (gpointer *)&user)) { + g_autofree gchar *filename = NULL; + g_autoptr(GKeyFile) key_file = NULL; + filename = g_build_filename (USERDIR, name, NULL); key_file = g_key_file_new (); if (g_key_file_load_from_file (key_file, filename, 0, NULL)) user_update_from_keyfile (user, key_file); - g_key_file_unref (key_file); - g_free (filename); } *state = NULL; @@ -356,7 +377,7 @@ static void load_entries (Daemon *daemon, GHashTable *users, - gboolean allow_system_users, + gboolean explicitly_requested, EntryGeneratorFunc entry_generator) { gpointer generator_state = NULL; @@ -373,29 +394,37 @@ break; /* Skip system users... */ - if (!allow_system_users && !user_classify_is_human (pwent->pw_uid, pwent->pw_name, pwent->pw_shell, spent? spent->sp_pwdp : NULL)) { + if (!explicitly_requested && !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; } - /* ignore duplicate entries */ - if (g_hash_table_lookup (users, pwent->pw_name)) { - continue; - } + /* Only process users that haven't been processed yet. + * We do always make sure entries get promoted + * to "cached" status if they are supposed to be + */ + + user = g_hash_table_lookup (users, pwent->pw_name); - user = g_hash_table_lookup (daemon->priv->users, pwent->pw_name); if (user == NULL) { - user = user_new (daemon, pwent->pw_uid); - } else { - g_object_ref (user); - } + user = g_hash_table_lookup (daemon->priv->users, pwent->pw_name); + if (user == NULL) { + user = user_new (daemon, pwent->pw_uid); + } else { + g_object_ref (user); + } + + /* freeze & update users not already in the new list */ + g_object_freeze_notify (G_OBJECT (user)); + user_update_from_pwent (user, pwent, spent); - /* freeze & update users not already in the new list */ - g_object_freeze_notify (G_OBJECT (user)); - 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)); + } - g_hash_table_insert (users, g_strdup (user_get_user_name (user)), user); - g_debug ("loaded user: %s", user_get_user_name (user)); + if (!explicitly_requested) { + user_set_cached (user, TRUE); + } } /* Generator should have cleaned up */ @@ -414,10 +443,13 @@ static void reload_users (Daemon *daemon) { + AccountsAccounts *accounts = ACCOUNTS_ACCOUNTS (daemon); + gboolean had_no_users, has_no_users, had_multiple_users, has_multiple_users; GHashTable *users; GHashTable *old_users; GHashTable *local; GHashTableIter iter; + gsize number_of_normal_users = 0; gpointer name; User *user; @@ -445,13 +477,27 @@ wtmp_helper_update_login_frequencies (users); - /* Mark which users are local, which are not */ + /* Count the non-system 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)) + while (g_hash_table_iter_next (&iter, &name, (gpointer *)&user)) { + if (!user_get_system_account (user)) + number_of_normal_users++; user_update_local_account_property (user, g_hash_table_lookup (local, name) != NULL); - + } g_hash_table_destroy (local); + had_no_users = accounts_accounts_get_has_no_users (accounts); + has_no_users = number_of_normal_users == 0; + + if (had_no_users != has_no_users) + accounts_accounts_set_has_no_users (accounts, has_no_users); + + had_multiple_users = accounts_accounts_get_has_multiple_users (accounts); + has_multiple_users = number_of_normal_users > 1; + + if (had_multiple_users != has_multiple_users) + accounts_accounts_set_has_multiple_users (accounts, has_multiple_users); + /* Swap out the users */ old_users = daemon->priv->users; daemon->priv->users = users; @@ -459,17 +505,25 @@ /* Remove all the old users */ g_hash_table_iter_init (&iter, old_users); while (g_hash_table_iter_next (&iter, &name, (gpointer *)&user)) { - if (!g_hash_table_lookup (users, name)) { - user_unregister (user); + User *refreshed_user; + + refreshed_user = g_hash_table_lookup (users, name); + + if (!refreshed_user || (user_get_cached (user) && !user_get_cached (refreshed_user))) { accounts_accounts_emit_user_deleted (ACCOUNTS_ACCOUNTS (daemon), user_get_object_path (user)); + user_unregister (user); } } /* Register all the new users */ g_hash_table_iter_init (&iter, users); while (g_hash_table_iter_next (&iter, &name, (gpointer *)&user)) { - if (!g_hash_table_lookup (old_users, name)) { + User *stale_user; + + stale_user = g_hash_table_lookup (old_users, name); + + if (!stale_user || (!user_get_cached (stale_user) && user_get_cached (user))) { user_register (user); accounts_accounts_emit_user_added (ACCOUNTS_ACCOUNTS (daemon), user_get_object_path (user)); @@ -497,18 +551,16 @@ static gboolean reload_autologin_timeout (Daemon *daemon) { + AccountsAccounts *accounts = ACCOUNTS_ACCOUNTS (daemon); gboolean enabled; - gchar *name = NULL; - GError *error = NULL; + g_autofree gchar *name = NULL; + g_autoptr(GError) error = NULL; User *user = NULL; daemon->priv->autologin_id = 0; if (!load_autologin (daemon, &name, &enabled, &error)) { g_debug ("failed to load gdms custom.conf: %s", error->message); - g_error_free (error); - g_free (name); - return FALSE; } @@ -518,12 +570,16 @@ if (daemon->priv->autologin != NULL && daemon->priv->autologin != user) { g_object_set (daemon->priv->autologin, "automatic-login", FALSE, NULL); g_signal_emit_by_name (daemon->priv->autologin, "changed", 0); - g_object_unref (daemon->priv->autologin); - daemon->priv->autologin = NULL; + g_clear_object (&daemon->priv->autologin); } if (enabled) { + const gchar *users[2]; + g_debug ("automatic login is enabled for '%s'", name); + users[0] = user_get_object_path (user); + users[1] = NULL; + accounts_accounts_set_automatic_login_users (accounts, users); if (daemon->priv->autologin != user) { g_object_set (user, "automatic-login", TRUE, NULL); daemon->priv->autologin = g_object_ref (user); @@ -532,10 +588,9 @@ } else { g_debug ("automatic login is disabled"); + accounts_accounts_set_automatic_login_users (accounts, NULL); } - g_free (name); - return FALSE; } @@ -613,9 +668,9 @@ const gchar *path, FileChangeCallback *callback) { - GError *error = NULL; - GFile *file; + g_autoptr(GFile) file = NULL; GFileMonitor *monitor; + g_autoptr(GError) error = NULL; if (!path) { return NULL; @@ -626,16 +681,15 @@ G_FILE_MONITOR_NONE, NULL, &error); - if (monitor != NULL) { - g_signal_connect (monitor, - "changed", - G_CALLBACK (callback), - daemon); - } else { + if (monitor == NULL) { g_warning ("Unable to monitor %s: %s", path, error->message); - g_error_free (error); + return NULL; } - g_object_unref (file); + + g_signal_connect (monitor, + "changed", + G_CALLBACK (callback), + daemon); return monitor; } @@ -694,60 +748,46 @@ static gboolean register_accounts_daemon (Daemon *daemon) { - GError *error = NULL; + g_autoptr(GError) error = NULL; daemon->priv->authority = polkit_authority_get_sync (NULL, &error); - if (daemon->priv->authority == NULL) { - if (error != NULL) { + if (error != NULL) g_critical ("error getting polkit authority: %s", error->message); - g_error_free (error); - } - goto error; + return FALSE; } daemon->priv->bus_connection = g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, &error); if (daemon->priv->bus_connection == NULL) { - if (error != NULL) { + if (error != NULL) g_critical ("error getting system bus: %s", error->message); - g_error_free (error); - } - goto error; + return FALSE; } if (!g_dbus_interface_skeleton_export (G_DBUS_INTERFACE_SKELETON (daemon), daemon->priv->bus_connection, "/org/freedesktop/Accounts", &error)) { - if (error != NULL) { + if (error != NULL) g_critical ("error exporting interface: %s", error->message); - g_error_free (error); - } - goto error; + return FALSE; } return TRUE; - - error: - return FALSE; } Daemon * daemon_new (void) { - Daemon *daemon; + g_autoptr(Daemon) daemon = NULL; daemon = DAEMON (g_object_new (TYPE_DAEMON, NULL)); if (!register_accounts_daemon (DAEMON (daemon))) { - g_object_unref (daemon); - goto error; + return NULL; } - return daemon; - - error: - return NULL; + return g_steal_pointer (&daemon); } static void @@ -757,15 +797,13 @@ ...) { va_list args; - gchar *message; + g_autofree gchar *message = NULL; va_start (args, format); message = g_strdup_vprintf (format, args); va_end (args); g_dbus_method_invocation_return_error (context, ERROR, error_code, "%s", message); - - g_free (message); } static User * @@ -919,7 +957,7 @@ finish_list_cached_users (gpointer user_data) { ListUserData *data = user_data; - GPtrArray *object_paths; + g_autoptr(GPtrArray) object_paths = NULL; GHashTableIter iter; const gchar *name; User *user; @@ -938,6 +976,11 @@ continue; } + if (!user_get_cached (user)) { + g_debug ("user %s %ld not cached", name, (long) uid); + continue; + } + g_debug ("user %s %ld not excluded", name, (long) uid); g_ptr_array_add (object_paths, (gpointer) user_get_object_path (user)); } @@ -945,8 +988,6 @@ accounts_accounts_complete_list_cached_users (NULL, data->context, (const gchar * const *) object_paths->pdata); - g_ptr_array_free (object_paths, TRUE); - list_user_data_free (data); return FALSE; @@ -982,8 +1023,8 @@ cache_user (Daemon *daemon, User *user) { - gchar *filename; - const char *user_name; + g_autofree gchar *filename = NULL; + const gchar *user_name; /* Always use the canonical user name looked up */ user_name = user_get_user_name (user); @@ -992,8 +1033,6 @@ if (!g_file_test (filename, G_FILE_TEST_EXISTS)) { user_save (user); } - - g_free (filename); } typedef struct { @@ -1021,12 +1060,12 @@ { CreateUserData *cd = data; User *user; - GError *error; + g_autoptr(GError) error = NULL; const gchar *argv[9]; + g_autofree gchar *admin_groups = NULL; if (getpwnam (cd->user_name) != NULL) { throw_error (context, ERROR_USER_EXISTS, "A user with name '%s' already exists", cd->user_name); - return; } @@ -1037,8 +1076,14 @@ argv[2] = "-c"; argv[3] = 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, ",", + EXTRA_ADMIN_GROUPS, NULL); + 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[8] = NULL; @@ -1053,10 +1098,8 @@ return; } - error = NULL; if (!spawn_with_login_uid (context, argv, &error)) { throw_error (context, ERROR_FAILED, "running '%s' failed: %s", argv[0], error->message); - g_error_free (error); return; } @@ -1155,7 +1198,6 @@ gpointer data) { const gchar *user_name = data; - gchar *filename; User *user; sys_log (context, "uncache user '%s'", user_name); @@ -1170,13 +1212,9 @@ /* Always use the canonical user name looked up */ user_name = user_get_user_name (user); - filename = g_build_filename (USERDIR, user_name, NULL); - g_remove (filename); - g_free (filename); + remove_cache_files (user_name); - filename = g_build_filename (ICONDIR, user_name, NULL); - g_remove (filename); - g_free (filename); + user_set_cached (user, FALSE); accounts_accounts_complete_uncache_user (NULL, context); @@ -1215,41 +1253,31 @@ { DeleteUserData *ud = data; - GError *error; - gchar *filename; + g_autoptr(GError) error = NULL; struct passwd *pwent; const gchar *argv[6]; + User *user; pwent = getpwuid (ud->uid); if (pwent == NULL) { throw_error (context, ERROR_USER_DOES_NOT_EXIST, "No user with uid %d found", ud->uid); - return; } sys_log (context, "delete user '%s' (%d)", pwent->pw_name, ud->uid); - if (daemon->priv->autologin != NULL) { - User *user; + user = daemon_local_find_user_by_id (daemon, ud->uid); - user = daemon_local_find_user_by_id (daemon, ud->uid); - - g_assert (user != NULL); + if (user != NULL) { + user_set_cached (user, FALSE); if (daemon->priv->autologin == user) { daemon_local_set_automatic_login (daemon, user, FALSE, NULL); } - } - filename = g_build_filename (USERDIR, pwent->pw_name, NULL); - g_remove (filename); - g_free (filename); - - filename = g_build_filename (ICONDIR, pwent->pw_name, NULL); - g_remove (filename); - g_free (filename); + remove_cache_files (pwent->pw_name); argv[0] = "/usr/sbin/userdel"; if (ud->remove_files) { @@ -1266,10 +1294,8 @@ 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); - g_error_free (error); return; } @@ -1337,16 +1363,12 @@ { CheckAuthData *cad = data; PolkitAuthorizationResult *result; - GError *error; - gboolean is_authorized; + g_autoptr(GError) error = NULL; + gboolean is_authorized = FALSE; - is_authorized = FALSE; - - error = NULL; result = polkit_authority_check_authorization_finish (authority, res, &error); if (error) { throw_error (cad->context, ERROR_PERMISSION_DENIED, "Not authorized: %s", error->message); - g_error_free (error); } else { if (polkit_authorization_result_get_is_authorized (result)) { @@ -1418,25 +1440,21 @@ gboolean *enabled, GError **error) { - GKeyFile *keyfile; - GError *local_error; - gchar *string; + g_autoptr(GKeyFile) keyfile = NULL; + GError *local_error = NULL; + g_autofree gchar *string = NULL; keyfile = g_key_file_new (); if (!g_key_file_load_from_file (keyfile, PATH_GDM_CUSTOM, G_KEY_FILE_KEEP_COMMENTS, error)) { - g_key_file_free (keyfile); return FALSE; } - local_error = NULL; string = g_key_file_get_string (keyfile, "daemon", "AutomaticLoginEnable", &local_error); if (local_error) { g_propagate_error (error, local_error); - g_key_file_free (keyfile); - g_free (string); return FALSE; } if (string != NULL && (g_ascii_strcasecmp (string, "true") == 0 || strcmp (string, "1") == 0)) { @@ -1445,17 +1463,13 @@ else { *enabled = FALSE; } - g_free (string); *name = g_key_file_get_string (keyfile, "daemon", "AutomaticLogin", &local_error); if (local_error) { g_propagate_error (error, local_error); - g_key_file_free (keyfile); return FALSE; } - g_key_file_free (keyfile); - return TRUE; } @@ -1465,8 +1479,8 @@ gboolean enabled, GError **error) { - GKeyFile *keyfile; - gchar *data; + g_autoptr(GKeyFile) keyfile = NULL; + g_autofree gchar *data = NULL; gboolean result; keyfile = g_key_file_new (); @@ -1474,7 +1488,6 @@ PATH_GDM_CUSTOM, G_KEY_FILE_KEEP_COMMENTS, error)) { - g_key_file_free (keyfile); return FALSE; } @@ -1484,9 +1497,6 @@ data = g_key_file_to_data (keyfile, NULL, NULL); result = g_file_set_contents (PATH_GDM_CUSTOM, data, -1, error); - g_key_file_free (keyfile); - g_free (data); - return result; } @@ -1511,8 +1521,7 @@ if (daemon->priv->autologin != NULL) { g_object_set (daemon->priv->autologin, "automatic-login", FALSE, NULL); g_signal_emit_by_name (daemon->priv->autologin, "changed", 0); - g_object_unref (daemon->priv->autologin); - daemon->priv->autologin = NULL; + g_clear_object (&daemon->priv->autologin); } if (enabled) { @@ -1528,7 +1537,7 @@ GHashTable * daemon_get_extension_ifaces (Daemon *daemon) { - return daemon->priv->extension_ifaces; + return daemon->priv->extension_ifaces; } static void @@ -1537,7 +1546,7 @@ GValue *value, GParamSpec *pspec) { - switch (prop_id) { + switch (prop_id) { case PROP_DAEMON_VERSION: g_value_set_string (value, VERSION); break; @@ -1554,7 +1563,7 @@ const GValue *value, GParamSpec *pspec) { - switch (prop_id) { + switch (prop_id) { case PROP_DAEMON_VERSION: g_assert_not_reached (); break; diff -Nru accountsservice-0.6.45/src/extensions.c accountsservice-0.6.50/src/extensions.c --- accountsservice-0.6.45/src/extensions.c 2016-06-27 20:00:14.000000000 +0200 +++ accountsservice-0.6.50/src/extensions.c 2018-04-04 15:59:42.000000000 +0200 @@ -55,29 +55,24 @@ daemon_read_extension_file (GHashTable *ifaces, const gchar *filename) { - GError *error = NULL; - GDBusNodeInfo *node; - gchar *contents; + g_autoptr(GError) error = NULL; + g_autoptr(GDBusNodeInfo) node = NULL; + g_autofree gchar *contents = NULL; gint i; if (!g_file_get_contents (filename, &contents, NULL, &error)) { g_warning ("Unable to read extension file %s: %s. Ignoring.", filename, error->message); - g_error_free (error); return; } node = g_dbus_node_info_new_for_xml (contents, &error); - if (node) { - for (i = 0; node->interfaces && node->interfaces[i]; i++) - daemon_maybe_add_extension_interface (ifaces, node->interfaces[i]); - - g_dbus_node_info_unref (node); - } else { + if (!node) { g_warning ("Failed to parse file %s: %s", filename, error->message); - g_error_free (error); + return; } - g_free (contents); + for (i = 0; node->interfaces && node->interfaces[i]; i++) + daemon_maybe_add_extension_interface (ifaces, node->interfaces[i]); } static void @@ -92,8 +87,8 @@ return; while ((name = g_dir_read_name (dir))) { - gchar *filename; - gchar *symlink; + g_autofree gchar *filename = NULL; + g_autofree gchar *symlink = NULL; /* Extensions are installed as normal D-Bus interface * files with an annotation. @@ -123,7 +118,6 @@ if (!symlink) { g_warning ("Found accounts service vendor extension file %s, but file must be a symlink to " "'../../dbus-1/interfaces/%s' for forwards-compatibility reasons.", filename, name); - g_free (filename); continue; } @@ -137,9 +131,6 @@ "equal to '../../dbus-1/interfaces/%s' for forwards-compatibility reasons.", filename, name); } - - g_free (filename); - g_free (symlink); } g_dir_close (dir); @@ -156,11 +147,8 @@ data_dirs = g_get_system_data_dirs (); for (i = 0; data_dirs[i]; i++) { - gchar *path = g_build_filename (data_dirs[i], "accountsservice/interfaces", NULL); - + g_autofree gchar *path = g_build_filename (data_dirs[i], "accountsservice/interfaces", NULL); daemon_read_extension_directory (ifaces, path); - - g_free (path); } return ifaces; diff -Nru accountsservice-0.6.45/src/libaccountsservice/accountsservice.pc accountsservice-0.6.50/src/libaccountsservice/accountsservice.pc --- accountsservice-0.6.45/src/libaccountsservice/accountsservice.pc 2017-03-27 20:33:18.000000000 +0200 +++ accountsservice-0.6.50/src/libaccountsservice/accountsservice.pc 2018-07-10 17:25:14.000000000 +0200 @@ -5,6 +5,6 @@ Name: Accounts Service Description: Client Library for communicating with accounts service -Version: 0.6.45 +Version: 0.6.50 Libs: -L${libdir} -laccountsservice Cflags: -I${includedir}/accountsservice-1.0 diff -Nru accountsservice-0.6.45/src/libaccountsservice/act-user.c accountsservice-0.6.50/src/libaccountsservice/act-user.c --- accountsservice-0.6.45/src/libaccountsservice/act-user.c 2017-03-27 20:31:22.000000000 +0200 +++ accountsservice-0.6.50/src/libaccountsservice/act-user.c 2018-04-04 15:59:42.000000000 +0200 @@ -26,6 +26,8 @@ #include #include +#include + #include #include #include @@ -108,37 +110,11 @@ GDBusConnection *connection; AccountsUser *accounts_proxy; - GDBusProxy *object_proxy; - GCancellable *get_all_cancellable; - char *object_path; - - uid_t uid; - char *user_name; - char *real_name; - char *password_hint; - char *home_dir; - char *shell; - char *email; - char *location; - char *icon_file; - char *language; - char *x_session; + GList *our_sessions; GList *other_sessions; - int login_frequency; - gint64 login_time; - GVariant *login_history; - - ActUserAccountType account_type; - ActUserPasswordMode password_mode; - - guint uid_set : 1; guint is_loaded : 1; - guint locked : 1; - guint automatic_login : 1; - guint system_account : 1; - guint local_account : 1; guint nonexistent : 1; }; @@ -263,66 +239,6 @@ user = ACT_USER (object); switch (param_id) { - case PROP_UID: - g_value_set_int (value, user->uid); - break; - case PROP_USER_NAME: - g_value_set_string (value, user->user_name); - break; - case PROP_REAL_NAME: - g_value_set_string (value, user->real_name); - break; - case PROP_ACCOUNT_TYPE: - g_value_set_int (value, user->account_type); - break; - case PROP_PASSWORD_MODE: - g_value_set_int (value, user->password_mode); - break; - case PROP_PASSWORD_HINT: - g_value_set_string (value, user->password_hint); - break; - case PROP_HOME_DIR: - g_value_set_string (value, user->home_dir); - break; - case PROP_LOGIN_FREQUENCY: - g_value_set_int (value, user->login_frequency); - break; - case PROP_LOGIN_TIME: - g_value_set_int64 (value, user->login_time); - break; - case PROP_LOGIN_HISTORY: - g_value_set_variant (value, user->login_history); - break; - case PROP_SHELL: - g_value_set_string (value, user->shell); - break; - case PROP_EMAIL: - g_value_set_string (value, user->email); - break; - case PROP_LOCATION: - g_value_set_string (value, user->location); - break; - case PROP_ICON_FILE: - g_value_set_string (value, user->icon_file); - break; - case PROP_LANGUAGE: - g_value_set_string (value, user->language); - break; - case PROP_X_SESSION: - g_value_set_string (value, user->x_session); - break; - case PROP_LOCKED: - g_value_set_boolean (value, user->locked); - break; - case PROP_AUTOMATIC_LOGIN: - g_value_set_boolean (value, user->automatic_login); - break; - case PROP_SYSTEM_ACCOUNT: - g_value_set_boolean (value, user->system_account); - break; - case PROP_LOCAL_ACCOUNT: - g_value_set_boolean (value, user->local_account); - break; case PROP_NONEXISTENT: g_value_set_boolean (value, user->nonexistent); break; @@ -330,7 +246,14 @@ g_value_set_boolean (value, user->is_loaded); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec); + if (user->accounts_proxy != NULL) { + const char *property_name; + + property_name = g_param_spec_get_name (pspec); + + g_object_get_property (G_OBJECT (user->accounts_proxy), property_name, value); + + } break; } } @@ -548,19 +471,14 @@ static void act_user_init (ActUser *user) { - GError *error = NULL; + g_autoptr(GError) error = NULL; - user->local_account = TRUE; - user->user_name = NULL; - user->real_name = NULL; user->our_sessions = NULL; user->other_sessions = NULL; - user->login_history = NULL; user->connection = g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, &error); if (user->connection == NULL) { g_warning ("Couldn't connect to system bus: %s", error->message); - g_error_free (error); } } @@ -571,31 +489,10 @@ user = ACT_USER (object); - g_free (user->user_name); - g_free (user->real_name); - g_free (user->icon_file); - g_free (user->language); - g_free (user->object_path); - g_free (user->password_hint); - g_free (user->home_dir); - g_free (user->shell); - g_free (user->email); - g_free (user->location); - if (user->login_history) - g_variant_unref (user->login_history); - if (user->accounts_proxy != NULL) { g_object_unref (user->accounts_proxy); } - if (user->object_proxy != NULL) { - g_object_unref (user->object_proxy); - } - - if (user->get_all_cancellable != NULL) { - g_object_unref (user->get_all_cancellable); - } - if (user->connection != NULL) { g_object_unref (user->connection); } @@ -620,7 +517,7 @@ * * Retrieves the ID of @user. * - * Returns: (transfer none): a pointer to an array of characters which must not be modified or + * Returns: a pointer to an array of characters which must not be modified or * freed, or %NULL. **/ @@ -629,7 +526,10 @@ { g_return_val_if_fail (ACT_IS_USER (user), -1); - return user->uid; + if (user->accounts_proxy == NULL) + return -1; + + return accounts_user_get_uid (user->accounts_proxy); } /** @@ -644,14 +544,20 @@ const char * act_user_get_real_name (ActUser *user) { + const char *real_name = NULL; + g_return_val_if_fail (ACT_IS_USER (user), NULL); - if (user->real_name == NULL || - user->real_name[0] == '\0') { - return user->user_name; + if (user->accounts_proxy == NULL) + return NULL; + + real_name = accounts_user_get_real_name (user->accounts_proxy); + + if (real_name == NULL || real_name[0] == '\0') { + real_name = accounts_user_get_user_name (user->accounts_proxy); } - return user->real_name; + return real_name; } /** @@ -667,7 +573,10 @@ { g_return_val_if_fail (ACT_IS_USER (user), ACT_USER_ACCOUNT_TYPE_STANDARD); - return user->account_type; + if (user->accounts_proxy == NULL) + return ACT_USER_ACCOUNT_TYPE_STANDARD; + + return accounts_user_get_account_type (user->accounts_proxy); } /** @@ -683,7 +592,10 @@ { g_return_val_if_fail (ACT_IS_USER (user), ACT_USER_PASSWORD_MODE_REGULAR); - return user->password_mode; + if (user->accounts_proxy == NULL) + return ACT_USER_PASSWORD_MODE_REGULAR; + + return accounts_user_get_password_mode (user->accounts_proxy); } /** @@ -700,7 +612,10 @@ { g_return_val_if_fail (ACT_IS_USER (user), NULL); - return user->password_hint; + if (user->accounts_proxy == NULL) + return NULL; + + return accounts_user_get_password_hint (user->accounts_proxy); } /** @@ -717,7 +632,10 @@ { g_return_val_if_fail (ACT_IS_USER (user), NULL); - return user->home_dir; + if (user->accounts_proxy == NULL) + return NULL; + + return accounts_user_get_home_directory (user->accounts_proxy); } /** @@ -734,7 +652,10 @@ { g_return_val_if_fail (ACT_IS_USER (user), NULL); - return user->shell; + if (user->accounts_proxy == NULL) + return NULL; + + return accounts_user_get_shell (user->accounts_proxy); } /** @@ -751,7 +672,10 @@ { g_return_val_if_fail (ACT_IS_USER (user), NULL); - return user->email; + if (user->accounts_proxy == NULL) + return NULL; + + return accounts_user_get_email (user->accounts_proxy); } /** @@ -768,7 +692,10 @@ { g_return_val_if_fail (ACT_IS_USER (user), NULL); - return user->location; + if (user->accounts_proxy == NULL) + return NULL; + + return accounts_user_get_location (user->accounts_proxy); } /** @@ -786,7 +713,10 @@ { g_return_val_if_fail (ACT_IS_USER (user), NULL); - return user->user_name; + if (user->accounts_proxy == NULL) + return NULL; + + return accounts_user_get_user_name (user->accounts_proxy); } /** @@ -802,7 +732,10 @@ { g_return_val_if_fail (ACT_IS_USER (user), 0); - return user->login_frequency; + if (user->accounts_proxy == NULL) + return 1; + + return accounts_user_get_login_frequency (user->accounts_proxy); } /** @@ -811,13 +744,17 @@ * * Returns the last login time for @user. * - * Returns: (transfer none): the login time + * Returns: the login time */ gint64 -act_user_get_login_time (ActUser *user) { +act_user_get_login_time (ActUser *user) +{ g_return_val_if_fail (ACT_IS_USER (user), 0); - return user->login_time; + if (user->accounts_proxy == NULL) + return 0; + + return accounts_user_get_login_time (user->accounts_proxy); } /** @@ -830,10 +767,14 @@ * which must not be modified or freed, or %NULL. */ const GVariant * -act_user_get_login_history (ActUser *user) { +act_user_get_login_history (ActUser *user) +{ g_return_val_if_fail (ACT_IS_USER (user), NULL); - return user->login_history; + if (user->accounts_proxy == NULL) + return NULL; + + return accounts_user_get_login_history (user->accounts_proxy); } /** @@ -860,8 +801,8 @@ g_return_val_if_fail (ACT_IS_USER (user1), 0); g_return_val_if_fail (ACT_IS_USER (user2), 0); - num1 = user1->login_frequency; - num2 = user2->login_frequency; + num1 = act_user_get_login_frequency (user1); + num2 = act_user_get_login_frequency (user2); if (num1 > num2) { return -1; @@ -884,17 +825,8 @@ } /* if login frequency is equal try names */ - if (user1->real_name != NULL) { - str1 = user1->real_name; - } else { - str1 = user1->user_name; - } - - if (user2->real_name != NULL) { - str2 = user2->real_name; - } else { - str2 = user2->user_name; - } + str1 = act_user_get_real_name (user1); + str2 = act_user_get_real_name (user2); if (str1 == NULL && str2 != NULL) { return -1; @@ -955,7 +887,12 @@ gboolean act_user_get_locked (ActUser *user) { - return user->locked;; + g_return_val_if_fail (ACT_IS_USER (user), TRUE); + + if (user->accounts_proxy == NULL) + return TRUE; + + return accounts_user_get_locked (user->accounts_proxy); } /** @@ -969,7 +906,12 @@ gboolean act_user_get_automatic_login (ActUser *user) { - return user->automatic_login; + g_return_val_if_fail (ACT_IS_USER (user), FALSE); + + if (user->accounts_proxy == NULL) + return FALSE; + + return accounts_user_get_automatic_login (user->accounts_proxy); } /** @@ -984,7 +926,12 @@ gboolean act_user_is_system_account (ActUser *user) { - return user->system_account; + g_return_val_if_fail (ACT_IS_USER (user), TRUE); + + if (user->accounts_proxy == NULL) + return TRUE; + + return accounts_user_get_system_account (user->accounts_proxy); } /** @@ -993,14 +940,17 @@ * * Retrieves whether the user is a local account or not. * - * Returns: (transfer none): %TRUE if the user is local + * Returns: %TRUE if the user is local **/ gboolean act_user_is_local_account (ActUser *user) { g_return_val_if_fail (ACT_IS_USER (user), FALSE); - return user->local_account; + if (user->accounts_proxy == NULL) + return FALSE; + + return accounts_user_get_local_account (user->accounts_proxy); } /** @@ -1009,7 +959,7 @@ * * Retrieves whether the user is nonexistent or not. * - * Returns: (transfer none): %TRUE if the user is nonexistent + * Returns: %TRUE if the user is nonexistent **/ gboolean act_user_is_nonexistent (ActUser *user) @@ -1032,7 +982,10 @@ { g_return_val_if_fail (ACT_IS_USER (user), NULL); - return user->icon_file; + if (user->accounts_proxy == NULL) + return NULL; + + return accounts_user_get_icon_file (user->accounts_proxy); } /** @@ -1048,7 +1001,10 @@ { g_return_val_if_fail (ACT_IS_USER (user), NULL); - return user->language; + if (user->accounts_proxy == NULL) + return NULL; + + return accounts_user_get_language (user->accounts_proxy); } /** @@ -1064,7 +1020,10 @@ { g_return_val_if_fail (ACT_IS_USER (user), NULL); - return user->x_session; + if (user->accounts_proxy == NULL) + return NULL; + + return accounts_user_get_xsession (user->accounts_proxy); } /** @@ -1082,7 +1041,10 @@ { g_return_val_if_fail (ACT_IS_USER (user), NULL); - return user->object_path; + if (user->accounts_proxy == NULL) + return NULL; + + return g_dbus_proxy_get_object_path (G_DBUS_PROXY (user->accounts_proxy)); } /** @@ -1109,272 +1071,6 @@ return user->our_sessions->data; } -static void -collect_props (const gchar *key, - GVariant *value, - ActUser *user) -{ - gboolean handled = TRUE; - - if (strcmp (key, "Uid") == 0) { - guint64 new_uid; - - new_uid = g_variant_get_uint64 (value); - if (!user->uid_set || (guint64) user->uid != new_uid) { - user->uid = (uid_t) new_uid; - user->uid_set = TRUE; - g_object_notify (G_OBJECT (user), "uid"); - } - } else if (strcmp (key, "UserName") == 0) { - const char *new_user_name; - - new_user_name = g_variant_get_string (value, NULL); - if (g_strcmp0 (user->user_name, new_user_name) != 0) { - g_free (user->user_name); - user->user_name = g_strdup (new_user_name); - g_object_notify (G_OBJECT (user), "user-name"); - } - } else if (strcmp (key, "RealName") == 0) { - const char *new_real_name; - - new_real_name = g_variant_get_string (value, NULL); - if (g_strcmp0 (user->real_name, new_real_name) != 0) { - g_free (user->real_name); - user->real_name = g_strdup (new_real_name); - g_object_notify (G_OBJECT (user), "real-name"); - } - } else if (strcmp (key, "AccountType") == 0) { - int new_account_type; - - new_account_type = g_variant_get_int32 (value); - if ((int) user->account_type != new_account_type) { - user->account_type = (ActUserAccountType) new_account_type; - g_object_notify (G_OBJECT (user), "account-type"); - } - } else if (strcmp (key, "PasswordMode") == 0) { - int new_password_mode; - - new_password_mode = g_variant_get_int32 (value); - if ((int) user->password_mode != new_password_mode) { - user->password_mode = (ActUserPasswordMode) new_password_mode; - g_object_notify (G_OBJECT (user), "password-mode"); - } - } else if (strcmp (key, "PasswordHint") == 0) { - const char *new_password_hint; - - new_password_hint = g_variant_get_string (value, NULL); - if (g_strcmp0 (user->password_hint, new_password_hint) != 0) { - g_free (user->password_hint); - user->password_hint = g_strdup (new_password_hint); - g_object_notify (G_OBJECT (user), "password-hint"); - } - } else if (strcmp (key, "HomeDirectory") == 0) { - const char *new_home_dir; - - new_home_dir = g_variant_get_string (value, NULL); - if (g_strcmp0 (user->home_dir, new_home_dir) != 0) { - g_free (user->home_dir); - user->home_dir = g_strdup (new_home_dir); - g_object_notify (G_OBJECT (user), "home-directory"); - } - } else if (strcmp (key, "Shell") == 0) { - const char *new_shell; - - new_shell = g_variant_get_string (value, NULL); - if (g_strcmp0 (user->shell, new_shell) != 0) { - g_free (user->shell); - user->shell = g_strdup (new_shell); - g_object_notify (G_OBJECT (user), "shell"); - } - } else if (strcmp (key, "Email") == 0) { - const char *new_email; - - new_email = g_variant_get_string (value, NULL); - if (g_strcmp0 (user->email, new_email) != 0) { - g_free (user->email); - user->email = g_strdup (new_email); - g_object_notify (G_OBJECT (user), "email"); - } - } else if (strcmp (key, "Location") == 0) { - const char *new_location; - - new_location = g_variant_get_string (value, NULL); - if (g_strcmp0 (user->location, new_location) != 0) { - g_free (user->location); - user->location = g_strdup (new_location); - g_object_notify (G_OBJECT (user), "location"); - } - } else if (strcmp (key, "Locked") == 0) { - gboolean new_locked_state; - - new_locked_state = g_variant_get_boolean (value); - if (new_locked_state != user->locked) { - user->locked = new_locked_state; - g_object_notify (G_OBJECT (user), "locked"); - } - } else if (strcmp (key, "AutomaticLogin") == 0) { - gboolean new_automatic_login_state; - - new_automatic_login_state = g_variant_get_boolean (value); - if (new_automatic_login_state != user->automatic_login) { - user->automatic_login = new_automatic_login_state; - g_object_notify (G_OBJECT (user), "automatic-login"); - } - } else if (strcmp (key, "SystemAccount") == 0) { - gboolean new_system_account_state; - - new_system_account_state = g_variant_get_boolean (value); - if (new_system_account_state != user->system_account) { - user->system_account = new_system_account_state; - g_object_notify (G_OBJECT (user), "system-account"); - } - } else if (strcmp (key, "LocalAccount") == 0) { - gboolean new_local; - - new_local = g_variant_get_boolean (value); - if (user->local_account != new_local) { - user->local_account = new_local; - g_object_notify (G_OBJECT (user), "local-account"); - } - } else if (strcmp (key, "LoginFrequency") == 0) { - int new_login_frequency; - - new_login_frequency = (int) g_variant_get_uint64 (value); - if ((int) user->login_frequency != (int) new_login_frequency) { - user->login_frequency = new_login_frequency; - g_object_notify (G_OBJECT (user), "login-frequency"); - } - } else if (strcmp (key, "LoginTime") == 0) { - gint64 new_login_time = g_variant_get_int64 (value); - - if (user->login_time != new_login_time) { - user->login_time = new_login_time; - g_object_notify (G_OBJECT (user), "login-time"); - } - } else if (strcmp (key, "LoginHistory") == 0) { - GVariant *new_login_history = value; - - if (user->login_history == NULL || - !g_variant_equal (user->login_history, new_login_history)) { - if (user->login_history) - g_variant_unref (user->login_history); - user->login_history = g_variant_ref (new_login_history); - g_object_notify (G_OBJECT (user), "login-history"); - } - } else if (strcmp (key, "IconFile") == 0) { - const char *new_icon_file; - - new_icon_file = g_variant_get_string (value, NULL); - if (g_strcmp0 (user->icon_file, new_icon_file) != 0) { - g_free (user->icon_file); - user->icon_file = g_strdup (new_icon_file); - g_object_notify (G_OBJECT (user), "icon-file"); - } - } else if (strcmp (key, "Language") == 0) { - const char *new_language; - - new_language = g_variant_get_string (value, NULL); - if (g_strcmp0 (user->language, new_language) != 0) { - g_free (user->language); - user->language = g_strdup (new_language); - g_object_notify (G_OBJECT (user), "language"); - } - } else if (strcmp (key, "XSession") == 0) { - const char *new_x_session; - - new_x_session = g_variant_get_string (value, NULL); - if (g_strcmp0 (user->x_session, new_x_session) != 0) { - g_free (user->x_session); - user->x_session = g_strdup (new_x_session); - g_object_notify (G_OBJECT (user), "x-session"); - } - } else { - handled = FALSE; - } - - if (!handled) { - g_debug ("unhandled property %s", key); - } -} - -static void -on_get_all_finished (GObject *object, - GAsyncResult *result, - gpointer data) -{ - GDBusProxy *proxy = G_DBUS_PROXY (object); - ActUser *user = data; - GError *error; - GVariant *res; - GVariantIter *iter; - gchar *key; - GVariant *value; - - g_assert (G_IS_DBUS_PROXY (user->object_proxy)); - g_assert (user->object_proxy == proxy); - - error = NULL; - res = g_dbus_proxy_call_finish (proxy, result, &error); - - g_clear_object (&user->get_all_cancellable); - - if (! res) { - g_debug ("Error calling GetAll() when retrieving properties for %s: %s", - user->object_path, error->message); - g_error_free (error); - - if (!user->is_loaded) { - set_is_loaded (user, TRUE); - } - return; - } - - g_variant_get (res, "(a{sv})", &iter); - while (g_variant_iter_next (iter, "{sv}", &key, &value)) { - collect_props (key, value, user); - g_free (key); - g_variant_unref (value); - } - g_variant_iter_free (iter); - g_variant_unref (res); - - if (!user->is_loaded) { - set_is_loaded (user, TRUE); - } - - g_signal_emit (user, signals[CHANGED], 0); -} - -static void -update_info (ActUser *user) -{ - g_assert (G_IS_DBUS_PROXY (user->object_proxy)); - - if (user->get_all_cancellable != NULL) { - g_cancellable_cancel (user->get_all_cancellable); - g_clear_object (&user->get_all_cancellable); - } - - user->get_all_cancellable = g_cancellable_new (); - g_dbus_proxy_call (user->object_proxy, - "GetAll", - g_variant_new ("(s)", ACCOUNTS_USER_INTERFACE), - G_DBUS_CALL_FLAGS_NONE, - -1, - user->get_all_cancellable, - on_get_all_finished, - user); -} - -static void -changed_handler (AccountsUser *object, - gpointer *data) -{ - ActUser *user = ACT_USER (data); - - update_info (user); -} - /** * _act_user_update_as_nonexistent: * @user: the user object to update. @@ -1387,7 +1083,7 @@ { g_return_if_fail (ACT_IS_USER (user)); g_return_if_fail (!act_user_is_loaded (user)); - g_return_if_fail (user->object_path == NULL); + g_return_if_fail (act_user_get_object_path (user) == NULL); user->nonexistent = TRUE; g_object_notify (G_OBJECT (user), "nonexistent"); @@ -1395,6 +1091,12 @@ set_is_loaded (user, TRUE); } +static void +on_accounts_proxy_changed (ActUser *user) +{ + g_signal_emit (user, signals[CHANGED], 0); +} + /** * _act_user_update_from_object_path: * @user: the user object to update. @@ -1407,54 +1109,47 @@ _act_user_update_from_object_path (ActUser *user, const char *object_path) { - GError *error = NULL; + AccountsUser *accounts_proxy; + GError *error = NULL; g_return_if_fail (ACT_IS_USER (user)); g_return_if_fail (object_path != NULL); - g_return_if_fail (user->object_path == NULL); - - user->object_path = g_strdup (object_path); + g_return_if_fail (act_user_get_object_path (user) == NULL); - user->accounts_proxy = accounts_user_proxy_new_sync (user->connection, - G_DBUS_PROXY_FLAGS_NONE, - ACCOUNTS_NAME, - user->object_path, - NULL, - &error); - if (!user->accounts_proxy) { + accounts_proxy = accounts_user_proxy_new_sync (user->connection, + G_DBUS_PROXY_FLAGS_NONE, + ACCOUNTS_NAME, + object_path, + NULL, + &error); + if (!accounts_proxy) { g_warning ("Couldn't create accounts proxy: %s", error->message); - g_error_free (error); return; } - g_dbus_proxy_set_default_timeout (G_DBUS_PROXY (user->accounts_proxy), INT_MAX); - g_signal_connect (user->accounts_proxy, "changed", G_CALLBACK (changed_handler), user); + user->accounts_proxy = accounts_proxy; - user->object_proxy = g_dbus_proxy_new_sync (user->connection, - G_DBUS_PROXY_FLAGS_NONE, - 0, - ACCOUNTS_NAME, - user->object_path, - "org.freedesktop.DBus.Properties", - NULL, - &error); - if (!user->object_proxy) { - g_warning ("Couldn't create accounts property proxy: %s", error->message); - g_error_free (error); - return; - } + g_signal_connect_object (user->accounts_proxy, + "changed", + G_CALLBACK (on_accounts_proxy_changed), + user, + G_CONNECT_SWAPPED); + + g_dbus_proxy_set_default_timeout (G_DBUS_PROXY (user->accounts_proxy), INT_MAX); - update_info (user); + set_is_loaded (user, TRUE); } void _act_user_update_login_frequency (ActUser *user, int login_frequency) { - if (user->login_frequency != login_frequency) { - user->login_frequency = login_frequency; - g_object_notify (G_OBJECT (user), "login-frequency"); + if (act_user_get_login_frequency (user) == login_frequency) { + return; } + + accounts_user_set_login_frequency (user->accounts_proxy, + login_frequency); } static void @@ -1484,78 +1179,19 @@ return; } - /* loading users may already have a uid, user name, or session list - * from creation, so only update them if necessary - */ - if (!user->uid_set) { - user->uid = user_to_copy->uid; - g_object_notify (G_OBJECT (user), "uid"); - } + user->accounts_proxy = g_object_ref (user_to_copy->accounts_proxy); - if (user->user_name == NULL) { - user->user_name = g_strdup (user_to_copy->user_name); - g_object_notify (G_OBJECT (user), "user-name"); - } + g_signal_connect_object (user->accounts_proxy, + "changed", + G_CALLBACK (on_accounts_proxy_changed), + user, + G_CONNECT_SWAPPED); if (user->our_sessions == NULL && user->other_sessions == NULL) { copy_sessions_lists (user, user_to_copy); g_signal_emit (user, signals[SESSIONS_CHANGED], 0); } - g_free (user->real_name); - user->real_name = g_strdup (user_to_copy->real_name); - g_object_notify (G_OBJECT (user), "real-name"); - - g_free (user->password_hint); - user->password_hint = g_strdup (user_to_copy->password_hint); - g_object_notify (G_OBJECT (user), "password-hint"); - - g_free (user->home_dir); - user->home_dir = g_strdup (user_to_copy->home_dir); - g_object_notify (G_OBJECT (user), "home-directory"); - - g_free (user->shell); - user->shell = g_strdup (user_to_copy->shell); - g_object_notify (G_OBJECT (user), "shell"); - - g_free (user->email); - user->email = g_strdup (user_to_copy->email); - g_object_notify (G_OBJECT (user), "email"); - - g_free (user->location); - user->location = g_strdup (user_to_copy->location); - g_object_notify (G_OBJECT (user), "location"); - - g_free (user->icon_file); - user->icon_file = g_strdup (user_to_copy->icon_file); - g_object_notify (G_OBJECT (user), "icon-file"); - - g_free (user->language); - user->language = g_strdup (user_to_copy->language); - g_object_notify (G_OBJECT (user), "language"); - - g_free (user->x_session); - user->x_session = g_strdup (user_to_copy->x_session); - g_object_notify (G_OBJECT (user), "x-session"); - - user->login_frequency = user_to_copy->login_frequency; - g_object_notify (G_OBJECT (user), "login-frequency"); - - user->login_time = user_to_copy->login_time; - g_object_notify (G_OBJECT (user), "login-time"); - - user->login_history = user_to_copy->login_history ? g_variant_ref (user_to_copy->login_history) : NULL; - g_object_notify (G_OBJECT (user), "login-history"); - - user->account_type = user_to_copy->account_type; - g_object_notify (G_OBJECT (user), "account-type"); - - user->password_mode = user_to_copy->password_mode; - g_object_notify (G_OBJECT (user), "password-mode"); - - user->nonexistent = user_to_copy->nonexistent; - g_object_notify (G_OBJECT (user), "nonexistent"); - set_is_loaded (user, TRUE); } @@ -1576,16 +1212,16 @@ } /** - * act_user_get_login_history: + * act_user_get_password_expiration_policy: * @user: the user object to query. - * @expiration_time: time users passwor expires - * @last_change_time, - * @min_days_between_changes, - * @max_days_between_changes, - * @days_to_warn, - * @days_after_expiration_until_lock) + * @expiration_time: location to write time users password expires + * @last_change_time: location to write time users password was last changed. + * @min_days_between_changes: location to write minimum number of days needed between password changes. + * @max_days_between_changes: location to write maximum number of days password can stay unchanged. + * @days_to_warn: location to write number of days to warn user password is about to expire. + * @days_after_expiration_until_lock: location to write number of days account will be locked after password expires. * - * Assigns a new email to @user. + * Get the password expiration policy for a user. * * Note this function is synchronous and ignores errors. **/ @@ -1598,7 +1234,7 @@ gint64 *days_to_warn, gint64 *days_after_expiration_until_lock) { - GError *error = NULL; + g_autoptr(GError) error = NULL; g_return_if_fail (ACT_IS_USER (user)); g_return_if_fail (ACCOUNTS_IS_USER (user->accounts_proxy)); @@ -1613,7 +1249,6 @@ NULL, &error)) { g_warning ("GetPasswordExpirationPolicy call failed: %s", error->message); - g_error_free (error); return; } } @@ -1631,7 +1266,7 @@ act_user_set_email (ActUser *user, const char *email) { - GError *error = NULL; + g_autoptr(GError) error = NULL; g_return_if_fail (ACT_IS_USER (user)); g_return_if_fail (email != NULL); @@ -1642,7 +1277,6 @@ NULL, &error)) { g_warning ("SetEmail call failed: %s", error->message); - g_error_free (error); return; } } @@ -1660,7 +1294,7 @@ act_user_set_language (ActUser *user, const char *language) { - GError *error = NULL; + g_autoptr(GError) error = NULL; g_return_if_fail (ACT_IS_USER (user)); g_return_if_fail (language != NULL); @@ -1671,7 +1305,6 @@ NULL, &error)) { g_warning ("SetLanguage for language %s failed: %s", language, error->message); - g_error_free (error); return; } } @@ -1689,7 +1322,7 @@ act_user_set_x_session (ActUser *user, const char *x_session) { - GError *error = NULL; + g_autoptr(GError) error = NULL; g_return_if_fail (ACT_IS_USER (user)); g_return_if_fail (x_session != NULL); @@ -1700,7 +1333,6 @@ NULL, &error)) { g_warning ("SetXSession call failed: %s", error->message); - g_error_free (error); return; } } @@ -1719,7 +1351,7 @@ act_user_set_location (ActUser *user, const char *location) { - GError *error = NULL; + g_autoptr(GError) error = NULL; g_return_if_fail (ACT_IS_USER (user)); g_return_if_fail (location != NULL); @@ -1730,7 +1362,6 @@ NULL, &error)) { g_warning ("SetLocation call failed: %s", error->message); - g_error_free (error); return; } } @@ -1748,7 +1379,7 @@ act_user_set_user_name (ActUser *user, const char *user_name) { - GError *error = NULL; + g_autoptr(GError) error = NULL; g_return_if_fail (ACT_IS_USER (user)); g_return_if_fail (user_name != NULL); @@ -1759,7 +1390,6 @@ NULL, &error)) { g_warning ("SetUserName call failed: %s", error->message); - g_error_free (error); return; } } @@ -1777,7 +1407,7 @@ act_user_set_real_name (ActUser *user, const char *real_name) { - GError *error = NULL; + g_autoptr(GError) error = NULL; g_return_if_fail (ACT_IS_USER (user)); g_return_if_fail (real_name != NULL); @@ -1788,7 +1418,6 @@ NULL, &error)) { g_warning ("SetRealName call failed: %s", error->message); - g_error_free (error); return; } } @@ -1806,7 +1435,7 @@ act_user_set_icon_file (ActUser *user, const char *icon_file) { - GError *error = NULL; + g_autoptr(GError) error = NULL; g_return_if_fail (ACT_IS_USER (user)); g_return_if_fail (icon_file != NULL); @@ -1817,7 +1446,6 @@ NULL, &error)) { g_warning ("SetIconFile call failed: %s", error->message); - g_error_free (error); return; } } @@ -1835,7 +1463,7 @@ act_user_set_account_type (ActUser *user, ActUserAccountType account_type) { - GError *error = NULL; + g_autoptr(GError) error = NULL; g_return_if_fail (ACT_IS_USER (user)); g_return_if_fail (ACCOUNTS_IS_USER (user->accounts_proxy)); @@ -1845,7 +1473,6 @@ NULL, &error)) { g_warning ("SetAccountType call failed: %s", error->message); - g_error_free (error); return; } } @@ -1863,9 +1490,8 @@ static gchar * make_crypted (const gchar *plain) { - GString *salt; - gchar *result; - GRand *rand; + g_autoptr(GString) salt = NULL; + g_autoptr(GRand) rand = NULL; gint i; rand = g_rand_new (); @@ -1878,12 +1504,7 @@ } g_string_append_c (salt, '$'); - result = g_strdup (crypt (plain, salt->str)); - - g_string_free (salt, TRUE); - g_rand_free (rand); - - return result; + return g_strdup (crypt (plain, salt->str)); } /** @@ -1902,8 +1523,8 @@ const gchar *password, const gchar *hint) { - GError *error = NULL; - gchar *crypted; + g_autoptr(GError) error = NULL; + g_autofree gchar *crypted = NULL; g_return_if_fail (ACT_IS_USER (user)); g_return_if_fail (password != NULL); @@ -1916,10 +1537,8 @@ NULL, &error)) { g_warning ("SetPassword call failed: %s", error->message); - g_error_free (error); } memset (crypted, 0, strlen (crypted)); - g_free (crypted); } /** @@ -1936,7 +1555,7 @@ act_user_set_password_hint (ActUser *user, const gchar *hint) { - GError *error = NULL; + g_autoptr(GError) error = NULL; g_return_if_fail (ACT_IS_USER (user)); g_return_if_fail (ACCOUNTS_IS_USER (user->accounts_proxy)); @@ -1946,7 +1565,6 @@ NULL, &error)) { g_warning ("SetPasswordHint call failed: %s", error->message); - g_error_free (error); } } @@ -1967,7 +1585,7 @@ act_user_set_password_mode (ActUser *user, ActUserPasswordMode password_mode) { - GError *error = NULL; + g_autoptr(GError) error = NULL; g_return_if_fail (ACT_IS_USER (user)); g_return_if_fail (ACCOUNTS_IS_USER (user->accounts_proxy)); @@ -1977,7 +1595,6 @@ NULL, &error)) { g_warning ("SetPasswordMode call failed: %s", error->message); - g_error_free (error); } } @@ -1992,7 +1609,7 @@ act_user_set_locked (ActUser *user, gboolean locked) { - GError *error = NULL; + g_autoptr(GError) error = NULL; g_return_if_fail (ACT_IS_USER (user)); g_return_if_fail (ACCOUNTS_IS_USER (user->accounts_proxy)); @@ -2002,7 +1619,6 @@ NULL, &error)) { g_warning ("SetLocked call failed: %s", error->message); - g_error_free (error); } } @@ -2022,7 +1638,7 @@ act_user_set_automatic_login (ActUser *user, gboolean enabled) { - GError *error = NULL; + g_autoptr(GError) error = NULL; g_return_if_fail (ACT_IS_USER (user)); g_return_if_fail (ACCOUNTS_IS_USER (user->accounts_proxy)); @@ -2032,6 +1648,5 @@ NULL, &error)) { g_warning ("SetAutomaticLogin call failed: %s", error->message); - g_error_free (error); } } diff -Nru accountsservice-0.6.45/src/libaccountsservice/act-user-enum-types.c accountsservice-0.6.50/src/libaccountsservice/act-user-enum-types.c --- accountsservice-0.6.45/src/libaccountsservice/act-user-enum-types.c 2017-03-27 20:33:36.000000000 +0200 +++ accountsservice-0.6.50/src/libaccountsservice/act-user-enum-types.c 2018-05-10 19:45:27.000000000 +0200 @@ -1,5 +1,5 @@ - +/* This file is generated by glib-mkenums, do not modify it. This code is licensed under the same license as the containing project. Note that it links to GLib, so must comply with the LGPL linking clauses. */ #include "act-user.h" #include "act-user-manager.h" @@ -56,5 +56,5 @@ return etype; } - +/* Generated data ends here */ diff -Nru accountsservice-0.6.45/src/libaccountsservice/act-user-enum-types.h accountsservice-0.6.50/src/libaccountsservice/act-user-enum-types.h --- accountsservice-0.6.45/src/libaccountsservice/act-user-enum-types.h 2017-03-27 20:33:36.000000000 +0200 +++ accountsservice-0.6.50/src/libaccountsservice/act-user-enum-types.h 2018-05-10 19:45:27.000000000 +0200 @@ -1,5 +1,5 @@ - +/* This file is generated by glib-mkenums, do not modify it. This code is licensed under the same license as the containing project. Note that it links to GLib, so must comply with the LGPL linking clauses. */ #ifndef __ACT_USER_ENUM_TYPES_H__ #define __ACT_USER_ENUM_TYPES_H__ @@ -19,5 +19,5 @@ #endif /* __ACT_USER_ENUM_TYPES_H__ */ - +/* Generated data ends here */ diff -Nru accountsservice-0.6.45/src/libaccountsservice/act-user.h accountsservice-0.6.50/src/libaccountsservice/act-user.h --- accountsservice-0.6.45/src/libaccountsservice/act-user.h 2017-03-27 20:31:22.000000000 +0200 +++ accountsservice-0.6.50/src/libaccountsservice/act-user.h 2018-04-04 15:59:42.000000000 +0200 @@ -120,6 +120,10 @@ void act_user_set_automatic_login (ActUser *user, gboolean enabled); +#if GLIB_CHECK_VERSION(2, 44, 0) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (ActUser, g_object_unref) +#endif + G_END_DECLS #endif /* __ACT_USER_H__ */ diff -Nru accountsservice-0.6.45/src/libaccountsservice/act-user-manager.c accountsservice-0.6.50/src/libaccountsservice/act-user-manager.c --- accountsservice-0.6.45/src/libaccountsservice/act-user-manager.c 2017-03-27 18:50:42.000000000 +0200 +++ accountsservice-0.6.50/src/libaccountsservice/act-user-manager.c 2018-06-13 18:38:55.000000000 +0200 @@ -199,7 +199,7 @@ gboolean is_loaded; gboolean has_multiple_users; gboolean getting_sessions; - gboolean listing_cached_users; + gboolean list_cached_users_done; }; enum { @@ -224,11 +224,14 @@ static void act_user_manager_init (ActUserManager *user_manager); static void act_user_manager_finalize (GObject *object); +static gboolean ensure_accounts_proxy (ActUserManager *manager); static gboolean load_seat_incrementally (ActUserManager *manager); static void unload_seat (ActUserManager *manager); static void load_users (ActUserManager *manager); +static void load_user (ActUserManager *manager, + const char *username); static void act_user_manager_queue_load (ActUserManager *manager); -static void queue_load_seat_and_users (ActUserManager *manager); +static void queue_load_seat (ActUserManager *manager); static void load_new_session_incrementally (ActUserManagerNewSession *new_session); static void set_is_loaded (ActUserManager *manager, gboolean is_loaded); @@ -275,8 +278,8 @@ const char *session_id) { ConsoleKitSeat *proxy; - GError *error = NULL; - gboolean res = FALSE; + g_autoptr(GError) error = NULL; + gboolean res = FALSE; proxy = console_kit_seat_proxy_new_sync (manager->priv->connection, G_DBUS_PROXY_FLAGS_NONE, @@ -292,7 +295,6 @@ if (!res) { g_warning ("Unable to activate session: %s", error->message); - g_error_free (error); return FALSE; } @@ -305,16 +307,14 @@ const char *seat_id, const char *session_id) { - GDBusConnection *connection; - GVariant *reply; - GError *error; + g_autoptr(GDBusConnection) connection = NULL; + g_autoptr(GVariant) reply = NULL; + g_autoptr(GError) error = NULL; - error = NULL; connection = g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, &error); - - if (connection == NULL) { - goto failed; + g_warning ("Unable to activate session: %s", error->message); + return FALSE; } reply = g_dbus_connection_call_sync (connection, @@ -330,20 +330,12 @@ -1, NULL, &error); - g_object_unref (connection); - if (reply == NULL) { - goto failed; + g_warning ("Unable to activate session: %s", error->message); + return FALSE; } - g_object_unref (reply); - return TRUE; - -failed: - g_warning ("Unable to activate session: %s", error->message); - g_error_free (error); - return FALSE; } #endif @@ -352,10 +344,9 @@ const char *session_id) { ConsoleKitSession *proxy; - GError *error = NULL; - char *session_type; - gboolean res = FALSE; - gboolean ret; + g_autoptr(GError) error = NULL; + g_autofree gchar *session_type = NULL; + gboolean res = FALSE; proxy = console_kit_session_proxy_new_sync (manager->priv->connection, G_DBUS_PROXY_FLAGS_NONE, @@ -369,7 +360,6 @@ if (!res) { if (error != NULL) { g_debug ("ActUserManager: Failed to identify the session type: %s", error->message); - g_error_free (error); } else { g_debug ("ActUserManager: Failed to identify the session type"); } @@ -378,10 +368,7 @@ if (proxy) g_object_unref (proxy); - ret = strcmp (session_type, "LoginWindow") == 0; - g_free (session_type); - - return ret; + return strcmp (session_type, "LoginWindow") == 0; } #ifdef WITH_SYSTEMD @@ -390,27 +377,17 @@ const char *session_id) { int res; - int ret; - char *session_class; + g_autofree gchar *session_class = NULL; - ret = FALSE; res = sd_session_get_class (session_id, &session_class); - if (res < 0) { g_debug ("failed to determine class of session %s: %s", session_id, strerror (-res)); - goto out; + return FALSE; } - if (g_strcmp0 (session_class, "greeter") == 0) { - ret = TRUE; - } - - free (session_class); - -out: - return ret; + return g_strcmp0 (session_class, "greeter") == 0; } #endif @@ -442,27 +419,20 @@ { int res; int ret; - char *session_seat; + g_autofree gchar *session_seat = NULL; ret = FALSE; res = sd_session_get_seat (session_id, &session_seat); if (res == -ENOENT) { - goto out; + return FALSE; } else if (res < 0) { g_debug ("failed to determine seat of session %s: %s", session_id, strerror (-res)); - goto out; - } - - if (g_strcmp0 (manager->priv->seat.id, session_seat) == 0) { - ret = TRUE; + return FALSE; } - free (session_seat); - -out: - return ret; + return g_strcmp0 (manager->priv->seat.id, session_seat) == 0; } #endif @@ -491,16 +461,15 @@ act_user_manager_goto_login_session (ActUserManager *manager) { gboolean res; - GError *error; + g_autoptr(GError) error = NULL; g_return_val_if_fail (ACT_IS_USER_MANAGER (manager), FALSE); g_return_val_if_fail (manager->priv->is_loaded, FALSE); res = g_spawn_command_line_async ("gdmflexiserver", &error); - if (! res) { + if (!res) { if (error != NULL) { g_warning ("Unable to start new login: %s", error->message); - g_error_free (error); } else { g_warning ("Unable to start new login"); } @@ -530,14 +499,13 @@ gboolean _can_activate_console_kit_sessions (ActUserManager *manager) { - GError *error = NULL; + g_autoptr(GError) error = NULL; gboolean can_activate_sessions = FALSE; if (!console_kit_seat_call_can_activate_sessions_sync (manager->priv->seat.seat_proxy, &can_activate_sessions, NULL, &error)) { if (error != NULL) { g_warning ("unable to determine if seat can activate sessions: %s", error->message); - g_error_free (error); } else { g_warning ("unable to determine if seat can activate sessions"); } @@ -593,27 +561,23 @@ act_user_manager_activate_user_session (ActUserManager *manager, ActUser *user) { - gboolean ret; const char *ssid; - gboolean res; gboolean can_activate_sessions; g_return_val_if_fail (ACT_IS_USER_MANAGER (manager), FALSE); g_return_val_if_fail (ACT_IS_USER (user), FALSE); g_return_val_if_fail (manager->priv->is_loaded, FALSE); - ret = FALSE; - can_activate_sessions = act_user_manager_can_switch (manager); - if (! can_activate_sessions) { + if (!can_activate_sessions) { g_debug ("ActUserManager: seat is unable to activate sessions"); - goto out; + return FALSE; } ssid = act_user_get_primary_session_id (user); if (ssid == NULL) { - goto out; + return FALSE; } #ifdef WITH_SYSTEMD @@ -622,15 +586,12 @@ } #endif - res = activate_console_kit_session_id (manager, manager->priv->seat.id, ssid); - if (! res) { + if (!activate_console_kit_session_id (manager, manager->priv->seat.id, ssid)) { g_debug ("ActUserManager: unable to activate session: %s", ssid); - goto out; + return FALSE; } - ret = TRUE; - out: - return ret; + return TRUE; } static const char * @@ -661,7 +622,7 @@ { guint nsessions; - if (! manager->priv->is_loaded) { + if (!manager->priv->is_loaded) { return; } @@ -710,8 +671,8 @@ gpointer data) { ConsoleKitSession *proxy = CONSOLE_KIT_SESSION (object); - ActUserManager *manager = data; - GError *error = NULL; + g_autoptr(ActUserManager) manager = data; + g_autoptr(GError) error = NULL; char *seat_id; if (!console_kit_session_call_get_seat_id_finish (proxy, &seat_id, result, &error)) { @@ -719,7 +680,6 @@ g_debug ("Failed to identify the seat of the " "current session: %s", error->message); - g_error_free (error); } else { g_debug ("Failed to identify the seat of the " "current session"); @@ -728,19 +688,13 @@ g_debug ("ActUserManager: GetSeatId call failed, so unloading seat"); unload_seat (manager); - goto out; + return; } g_debug ("ActUserManager: Found current seat: %s", seat_id); manager->priv->seat.id = seat_id; manager->priv->seat.state++; - - load_seat_incrementally (manager); - - out: - g_debug ("ActUserManager: unrefing manager owned by GetSeatId request"); - g_object_unref (manager); } #ifdef WITH_SYSTEMD @@ -748,10 +702,9 @@ _get_systemd_seat_id (ActUserManager *manager) { int res; - char *seat_id; + g_autofree gchar *seat_id = NULL; res = sd_session_get_seat (NULL, &seat_id); - if (res == -ENOENT) { seat_id = NULL; } else if (res < 0) { @@ -762,11 +715,7 @@ } manager->priv->seat.id = g_strdup (seat_id); - free (seat_id); - manager->priv->seat.state++; - - queue_load_seat_incrementally (manager); } #endif @@ -843,11 +792,11 @@ user = g_object_new (ACT_TYPE_USER, NULL); - manager->priv->new_users = g_slist_prepend (manager->priv->new_users, user); + manager->priv->new_users = g_slist_prepend (manager->priv->new_users, g_object_ref (user)); g_signal_connect_object (user, "notify::is-loaded", G_CALLBACK (on_new_user_loaded), manager, 0); - return g_object_ref (user); + return user; } static void @@ -883,11 +832,7 @@ G_CALLBACK (on_user_changed), manager, 0); - if (g_hash_table_size (manager->priv->normal_users_by_name) > 1) { - set_has_multiple_users (manager, TRUE); - } - - if (manager->priv->is_loaded) { + if (manager->priv->is_loaded && manager->priv->list_cached_users_done) { g_debug ("ActUserManager: loaded, so emitting user-added signal"); g_signal_emit (manager, signals[USER_ADDED], 0, user); } else { @@ -916,11 +861,7 @@ } - if (g_hash_table_size (manager->priv->normal_users_by_name) <= 1) { - set_has_multiple_users (manager, FALSE); - } - - if (manager->priv->is_loaded) { + if (manager->priv->is_loaded && manager->priv->list_cached_users_done) { g_debug ("ActUserManager: loaded, so emitting user-removed signal"); g_signal_emit (manager, signals[USER_REMOVED], 0, user); } else { @@ -951,10 +892,6 @@ g_object_ref (user)); g_hash_table_remove (manager->priv->system_users_by_name, username); g_signal_emit (manager, signals[USER_ADDED], 0, user); - - if (g_hash_table_size (manager->priv->normal_users_by_name) > 1) { - set_has_multiple_users (manager, TRUE); - } } } else { if (act_user_is_system_account (user)) { @@ -965,10 +902,6 @@ g_object_ref (user)); g_hash_table_remove (manager->priv->normal_users_by_name, username); g_signal_emit (manager, signals[USER_REMOVED], 0, user); - - if (g_hash_table_size (manager->priv->normal_users_by_name) <= 1) { - set_has_multiple_users (manager, FALSE); - } } } } @@ -1115,6 +1048,13 @@ gpointer user_data) { ActUserManager *manager = ACT_USER_MANAGER (user_data); + g_autoptr(ActUser) user = NULL; + + /* Only track user changes if the user has requested a list + * of users */ + if (!manager->priv->list_cached_users_done) { + return; + } if (!manager->priv->is_loaded) { g_debug ("ActUserManager: ignoring new user in accounts service with object path %s since not loaded yet", object_path); @@ -1122,7 +1062,7 @@ } g_debug ("ActUserManager: new user in accounts service with object path %s", object_path); - add_new_user_for_object_path (object_path, manager); + user = add_new_user_for_object_path (object_path, manager); } static void @@ -1132,6 +1072,13 @@ { ActUserManager *manager = ACT_USER_MANAGER (user_data); ActUser *user; + GSList *node; + + /* Only track user changes if the user has requested a list + * of users */ + if (!manager->priv->list_cached_users_done) { + return; + } user = g_hash_table_lookup (manager->priv->users_by_object_path, object_path); @@ -1142,7 +1089,12 @@ g_debug ("ActUserManager: tracked user %s removed from accounts service", object_path); } - manager->priv->new_users = g_slist_remove (manager->priv->new_users, user); + node = g_slist_find (manager->priv->new_users, user); + if (node != NULL) { + g_signal_handlers_disconnect_by_func (user, on_new_user_loaded, manager); + g_object_unref (user); + manager->priv->new_users = g_slist_delete_link (manager->priv->new_users, node); + } remove_user (manager, user); } @@ -1153,8 +1105,8 @@ gpointer data) { ConsoleKitManager *proxy = CONSOLE_KIT_MANAGER (object); - ActUserManager *manager = data; - GError *error = NULL; + g_autoptr(ActUserManager) manager = data; + g_autoptr(GError) error = NULL; char *session_id; g_assert (manager->priv->seat.state == ACT_USER_MANAGER_SEAT_STATE_GET_SESSION_ID); @@ -1163,30 +1115,25 @@ if (error != NULL) { g_debug ("Failed to identify the current session: %s", error->message); - g_error_free (error); } else { g_debug ("Failed to identify the current session"); } unload_seat (manager); - goto out; + return; } manager->priv->seat.session_id = session_id; manager->priv->seat.state++; queue_load_seat_incrementally (manager); - - out: - g_debug ("ActUserManager: unrefing manager owned by GetCurrentSession request"); - g_object_unref (manager); } #ifdef WITH_SYSTEMD static void _get_current_systemd_session_id (ActUserManager *manager) { - char *session_id; + g_autofree gchar *session_id = NULL; int res; res = sd_pid_get_session (0, &session_id); @@ -1201,8 +1148,6 @@ } manager->priv->seat.session_id = g_strdup (session_id); - free (session_id); - manager->priv->seat.state++; queue_load_seat_incrementally (manager); @@ -1221,7 +1166,7 @@ #endif if (manager->priv->ck_manager_proxy == NULL) { - GError *error = NULL; + g_autoptr(GError) error = NULL; manager->priv->ck_manager_proxy = console_kit_manager_proxy_new_sync (manager->priv->connection, G_DBUS_PROXY_FLAGS_NONE, @@ -1232,7 +1177,6 @@ if (manager->priv->ck_manager_proxy == NULL) { if (error != NULL) { g_warning ("Failed to create ConsoleKit proxy: %s", error->message); - g_error_free (error); } else { g_warning ("Failed to create_ConsoleKit_proxy"); } @@ -1296,7 +1240,8 @@ static void get_proxy_for_new_session (ActUserManagerNewSession *new_session) { - GError *error = NULL; + g_autoptr(GError) error = NULL; + #ifdef WITH_SYSTEMD if (LOGIND_RUNNING()) { new_session->state++; @@ -1314,7 +1259,6 @@ if (new_session->proxy == NULL) { g_warning ("Failed to connect to the ConsoleKit '%s' object: %s", new_session->id, error->message); - g_error_free (error); unload_new_session (new_session); return; } @@ -1331,7 +1275,7 @@ { ConsoleKitSession *proxy = CONSOLE_KIT_SESSION (object); ActUserManagerNewSession *new_session = data; - GError *error = NULL; + g_autoptr(GError) error = NULL; guint uid; new_session->pending_calls--; @@ -1345,7 +1289,6 @@ if (error != NULL) { g_debug ("Failed to get uid of session '%s': %s", new_session->id, error->message); - g_error_free (error); } else { g_debug ("Failed to get uid of session '%s'", new_session->id); @@ -1413,14 +1356,13 @@ { AccountsAccounts *proxy = ACCOUNTS_ACCOUNTS (object); ActUserManagerFetchUserRequest *request = data; - GError *error = NULL; + g_autoptr(GError) error = NULL; char *user; if (!accounts_accounts_call_find_user_by_name_finish (proxy, &user, result, &error)) { if (error != NULL) { g_debug ("ActUserManager: Failed to find %s: %s", request->description, error->message); - g_error_free (error); } else { g_debug ("ActUserManager: Failed to find %s", request->description); @@ -1444,14 +1386,13 @@ { AccountsAccounts *proxy = ACCOUNTS_ACCOUNTS (object); ActUserManagerFetchUserRequest *request = data; - GError *error = NULL; + g_autoptr(GError) error = NULL; char *user; if (!accounts_accounts_call_find_user_by_id_finish (proxy, &user, result, &error)) { if (error != NULL) { g_debug ("ActUserManager: Failed to find user %lu: %s", (gulong) request->uid, error->message); - g_error_free (error); } else { g_debug ("ActUserManager: Failed to find user with id %lu", (gulong) request->uid); @@ -1507,34 +1448,15 @@ } static void -on_list_cached_users_finished (GObject *object, - GAsyncResult *result, - gpointer data) +load_user_paths (ActUserManager *manager, + const char * const * user_paths) { - AccountsAccounts *proxy = ACCOUNTS_ACCOUNTS (object); - ActUserManager *manager = data; - gchar **user_paths; - GError *error = NULL; - - manager->priv->listing_cached_users = FALSE; - if (!accounts_accounts_call_list_cached_users_finish (proxy, &user_paths, result, &error)) { - g_debug ("ActUserManager: ListCachedUsers failed: %s", error->message); - g_error_free (error); - - g_object_unref (manager->priv->accounts_proxy); - manager->priv->accounts_proxy = NULL; - - g_debug ("ActUserManager: unrefing manager owned by failed ListCachedUsers call"); - g_object_unref (manager); - return; - } - /* We now have a batch of unloaded users that we know about. Once that initial * batch is loaded up, we can mark the manager as loaded. * * (see on_new_user_loaded) */ - if (g_strv_length (user_paths) > 0) { + if (g_strv_length ((char **) user_paths) > 0) { int i; g_debug ("ActUserManager: ListCachedUsers finished, will set loaded property after list is fully loaded"); @@ -1550,30 +1472,19 @@ g_debug ("ActUserManager: ListCachedUsers finished with empty list, maybe setting loaded property now"); maybe_set_is_loaded (manager); } +} - g_strfreev (user_paths); +static void +load_included_usernames (ActUserManager *manager) +{ + GSList *l; /* Add users who are specifically included */ - if (manager->priv->include_usernames != NULL) { - GSList *l; - - for (l = manager->priv->include_usernames; l != NULL; l = l->next) { - ActUser *user; + for (l = manager->priv->include_usernames; l != NULL; l = l->next) { + g_debug ("ActUserManager: Adding included user %s", (char *)l->data); - g_debug ("ActUserManager: Adding included user %s", (char *)l->data); - /* - * The call to act_user_manager_get_user will add the user if it is - * valid and not already in the hash. - */ - user = act_user_manager_get_user (manager, l->data); - if (user == NULL) { - g_debug ("ActUserManager: unable to lookup user '%s'", (char *)l->data); - } - } + load_user (manager, l->data); } - - g_debug ("ActUserManager: unrefing manager owned by finished ListCachedUsers call"); - g_object_unref (manager); } static void @@ -1583,7 +1494,7 @@ { ConsoleKitSession *proxy = CONSOLE_KIT_SESSION (object); ActUserManagerNewSession *new_session = data; - GError *error = NULL; + g_autoptr(GError) error = NULL; char *x11_display; new_session->pending_calls--; @@ -1597,7 +1508,6 @@ if (error != NULL) { g_debug ("Failed to get the x11 display of session '%s': %s", new_session->id, error->message); - g_error_free (error); } else { g_debug ("Failed to get the x11 display of session '%s'", new_session->id); @@ -1619,13 +1529,12 @@ static void _get_x11_display_for_new_systemd_session (ActUserManagerNewSession *new_session) { - char *session_type; - char *x11_display; - int res; + g_autofree gchar *session_type = NULL; + g_autofree gchar *x11_display = NULL; + int res; res = sd_session_get_type (new_session->id, &session_type); - if (res < 0) { g_debug ("ActUserManager: Failed to get the type of session '%s': %s", new_session->id, @@ -1634,19 +1543,17 @@ return; } - if (g_strcmp0 (session_type, "x11") != 0) { + if (g_strcmp0 (session_type, "x11") != 0 && + g_strcmp0 (session_type, "wayland") != 0) { g_debug ("ActUserManager: (mostly) ignoring %s session '%s' since it's not graphical", session_type, new_session->id); - free (session_type); x11_display = NULL; goto done; } - free (session_type); res = sd_session_get_display (new_session->id, &x11_display); - if (res < 0) { g_debug ("ActUserManager: Failed to get the x11 display of session '%s': %s", new_session->id, @@ -1660,7 +1567,6 @@ done: new_session->x11_display = g_strdup (x11_display); - free (x11_display); new_session->state++; load_new_session_incrementally (new_session); @@ -1716,12 +1622,6 @@ } add_session_for_user (manager, user, new_session->id, is_ours); - - /* if we haven't yet gotten the login frequency - then at least add one because the session exists */ - if (act_user_get_login_frequency (user) == 0) { - _act_user_update_login_frequency (user, 1); - } } static void @@ -1930,14 +1830,10 @@ { int res; int i; - char **sessions; - GHashTable *systemd_sessions; - char *state; - gboolean is_closing; - + g_auto(GStrv) sessions = NULL; + g_autoptr(GHashTable) systemd_sessions = NULL; res = sd_get_sessions (&sessions); - if (res < 0) { g_debug ("Failed to determine sessions: %s", strerror (-res)); return; @@ -1948,25 +1844,20 @@ if (sessions != NULL) { for (i = 0; sessions[i] != NULL; i ++) { - char *session_class; + g_autofree gchar *state = NULL; + g_autofree gchar *session_class = NULL; res = sd_session_get_state (sessions[i], &state); - if (res < 0) { g_debug ("Failed to determine state of session %s: %s", sessions[i], strerror (-res)); continue; } - is_closing = g_strcmp0 (state, "closing") == 0; - free (state); - - if (is_closing) { + if (g_strcmp0 (state, "closing") == 0) { continue; } - session_class = NULL; res = sd_session_get_class (sessions[i], &session_class); - if (res < 0) { g_debug ("Failed to determine class of session %s: %s", sessions[i], strerror (-res)); continue; @@ -1974,10 +1865,8 @@ if (g_strcmp0 (session_class, "user") != 0) { g_debug ("Ignoring non-user session %s (class %s)", sessions[i], session_class); - free (session_class); continue; } - free (session_class); g_hash_table_insert (systemd_sessions, sessions[i], NULL); @@ -1987,15 +1876,6 @@ _add_new_systemd_sessions (manager, systemd_sessions); _remove_stale_systemd_sessions (manager, systemd_sessions); - g_hash_table_unref (systemd_sessions); - - if (sessions != NULL) { - for (i = 0; sessions[i]; i ++) { - free (sessions[i]); - } - - free (sessions); - } } #endif @@ -2042,7 +1922,7 @@ static void get_seat_proxy (ActUserManager *manager) { - GError *error = NULL; + g_autoptr(GError) error = NULL; #ifdef WITH_SYSTEMD if (LOGIND_RUNNING()) { @@ -2064,7 +1944,6 @@ if (error != NULL) { g_warning ("Failed to connect to the ConsoleKit seat object: %s", error->message); - g_error_free (error); } else { g_warning ("Failed to connect to the ConsoleKit seat object"); } @@ -2087,7 +1966,7 @@ on_console_kit_session_proxy_gotten (GObject *object, GAsyncResult *result, gpointer user_data) { ActUserManager *manager = user_data; - GError *error = NULL; + g_autoptr(GError) error = NULL; g_debug ("on_console_kit_session_proxy_gotten"); @@ -2097,7 +1976,6 @@ if (error != NULL) { g_warning ("Failed to connect to the ConsoleKit session object: %s", error->message); - g_error_free (error); } else { g_warning ("Failed to connect to the ConsoleKit session object"); } @@ -2369,6 +2247,44 @@ return user; } +static void +load_user (ActUserManager *manager, + const char *username) +{ + ActUser *user; + g_autoptr(GError) error = NULL; + char *object_path = NULL; + gboolean user_found; + + g_return_if_fail (ACT_IS_USER_MANAGER (manager)); + g_return_if_fail (username != NULL && username[0] != '\0'); + + user = lookup_user_by_name (manager, username); + + if (user == NULL) { + g_debug ("ActUserManager: trying to track new user with username %s", username); + user = create_new_user (manager); + } + + user_found = accounts_accounts_call_find_user_by_name_sync (manager->priv->accounts_proxy, + username, + &object_path, + NULL, + &error); + + if (!user_found) { + if (error != NULL) { + g_debug ("ActUserManager: Failed to find user '%s': %s", + username, error->message); + } else { + g_debug ("ActUserManager: Failed to find user '%s'", + username); + } + } + + _act_user_update_from_object_path (user, object_path); +} + /** * act_user_manager_get_user_by_id: * @manager: the manager to query. @@ -2386,13 +2302,12 @@ uid_t id) { ActUser *user; - gchar *object_path; + g_autofree gchar *object_path = NULL; g_return_val_if_fail (ACT_IS_USER_MANAGER (manager), NULL); object_path = g_strdup_printf ("/org/freedesktop/Accounts/User%lu", (gulong) id); user = g_hash_table_lookup (manager->priv->users_by_object_path, object_path); - g_free (object_path); if (user != NULL) { return g_object_ref (user); @@ -2433,6 +2348,13 @@ g_return_val_if_fail (ACT_IS_USER_MANAGER (manager), NULL); + if (!manager->priv->list_cached_users_done) { + load_users (manager); + + if (manager->priv->seat.state == ACT_USER_MANAGER_SEAT_STATE_GET_SEAT_PROXY) + queue_load_seat_incrementally (manager); + } + retval = NULL; g_hash_table_foreach (manager->priv->normal_users_by_name, listify_hash_values_hfunc, &retval); @@ -2452,20 +2374,15 @@ return; } - if (manager->priv->listing_cached_users) { - g_debug ("ActUserManager: Listing cached users, so not setting loaded property"); - return; - } - if (manager->priv->new_users_inhibiting_load != NULL) { g_debug ("ActUserManager: Loading new users, so not setting loaded property"); return; } - /* Don't set is_loaded yet unless the seat is already loaded + /* Don't set is_loaded yet unless the seat is already loaded enough * or failed to load. */ - if (manager->priv->seat.state == ACT_USER_MANAGER_SEAT_STATE_LOADED) { + if (manager->priv->seat.state >= ACT_USER_MANAGER_SEAT_STATE_GET_ID) { g_debug ("ActUserManager: Seat loaded, so now setting loaded property"); } else if (manager->priv->seat.state == ACT_USER_MANAGER_SEAT_STATE_UNLOADED) { g_debug ("ActUserManager: Seat wouldn't load, so giving up on it and setting loaded property"); @@ -2501,35 +2418,29 @@ gpointer data) { ConsoleKitSeat *proxy = CONSOLE_KIT_SEAT (object); - ActUserManager *manager = data; - GError *error = NULL; - gchar **session_ids; + g_autoptr(ActUserManager) manager = data; + g_autoptr(GError) error = NULL; + g_auto(GStrv) session_ids = NULL; int i; if (!console_kit_seat_call_get_sessions_finish (proxy, &session_ids, result, &error)) { if (error != NULL) { g_warning ("unable to determine sessions for seat: %s", error->message); - g_error_free (error); } else { g_warning ("unable to determine sessions for seat"); } - goto out; + return; } manager->priv->getting_sessions = FALSE; for (i = 0; session_ids[i] != NULL; i++) { load_new_session (manager, session_ids[i]); } - g_strfreev (session_ids); g_debug ("ActUserManager: GetSessions call finished, so trying to set loaded property"); maybe_set_is_loaded (manager); - - out: - g_debug ("ActUserManager: unrefing manager owned by GetSessions request"); - g_object_unref (manager); } static void @@ -2563,14 +2474,30 @@ static void load_users (ActUserManager *manager) { - g_assert (manager->priv->accounts_proxy != NULL); + g_autoptr(GError) error = NULL; + g_auto(GStrv) user_paths = NULL; + gboolean could_list = FALSE; + + if (!ensure_accounts_proxy (manager)) { + return; + } + g_debug ("ActUserManager: calling 'ListCachedUsers'"); - accounts_accounts_call_list_cached_users (manager->priv->accounts_proxy, - NULL, - on_list_cached_users_finished, - g_object_ref (manager)); - manager->priv->listing_cached_users = TRUE; + could_list = accounts_accounts_call_list_cached_users_sync (manager->priv->accounts_proxy, + &user_paths, + NULL, &error); + + if (!could_list) { + g_debug ("ActUserManager: ListCachedUsers failed: %s", error->message); + return; + } + + load_user_paths (manager, (const char * const *) user_paths); + + load_included_usernames (manager); + + manager->priv->list_cached_users_done = TRUE; } static gboolean @@ -2610,11 +2537,6 @@ static gboolean load_idle (ActUserManager *manager) { - /* The order below is important: load_seat_incrementally might - set "is-loaded" immediately and we thus need to call - load_users before it. - */ - load_users (manager); manager->priv->seat.state = ACT_USER_MANAGER_SEAT_STATE_UNLOADED + 1; load_seat_incrementally (manager); manager->priv->load_id = 0; @@ -2623,7 +2545,7 @@ } static void -queue_load_seat_and_users (ActUserManager *manager) +queue_load_seat (ActUserManager *manager) { if (manager->priv->load_id > 0) { return; @@ -2700,6 +2622,9 @@ case PROP_EXCLUDE_USERNAMES_LIST: set_exclude_usernames (self, g_value_get_pointer (value)); break; + case PROP_HAS_MULTIPLE_USERS: + set_has_multiple_users (self, g_value_get_boolean (value)); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -2728,7 +2653,7 @@ "Has multiple users", "Whether more than one normal user is present", FALSE, - G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (object_class, PROP_INCLUDE_USERNAMES_LIST, g_param_spec_pointer ("include-usernames-list", @@ -2820,15 +2745,55 @@ { g_return_if_fail (ACT_IS_USER_MANAGER (manager)); - if (! manager->priv->is_loaded) { - queue_load_seat_and_users (manager); + if (!manager->priv->is_loaded) { + queue_load_seat (manager); } } +static gboolean +ensure_accounts_proxy (ActUserManager *manager) +{ + g_autoptr(GError) error = NULL; + + if (manager->priv->accounts_proxy != NULL) { + return TRUE; + } + + manager->priv->accounts_proxy = accounts_accounts_proxy_new_sync (manager->priv->connection, + G_DBUS_PROXY_FLAGS_NONE, + ACCOUNTS_NAME, + ACCOUNTS_PATH, + NULL, + &error); + if (error != NULL) { + g_debug ("ActUserManager: getting account proxy failed: %s", error->message); + return FALSE; + } + + g_dbus_proxy_set_default_timeout (G_DBUS_PROXY (manager->priv->accounts_proxy), G_MAXINT); + + g_object_bind_property (G_OBJECT (manager->priv->accounts_proxy), + "has-multiple-users", + G_OBJECT (manager), + "has-multiple-users", + G_BINDING_SYNC_CREATE); + + g_signal_connect (manager->priv->accounts_proxy, + "user-added", + G_CALLBACK (on_new_user_in_accounts_service), + manager); + g_signal_connect (manager->priv->accounts_proxy, + "user-deleted", + G_CALLBACK (on_user_removed_in_accounts_service), + manager); + + return TRUE; +} + static void act_user_manager_init (ActUserManager *manager) { - GError *error; + g_autoptr(GError) error = NULL; manager->priv = ACT_USER_MANAGER_GET_PRIVATE (manager); @@ -2854,43 +2819,17 @@ NULL, g_object_unref); - error = NULL; manager->priv->connection = g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, &error); if (manager->priv->connection == NULL) { if (error != NULL) { g_warning ("Failed to connect to the D-Bus daemon: %s", error->message); - g_error_free (error); } else { g_warning ("Failed to connect to the D-Bus daemon"); } return; } - manager->priv->accounts_proxy = accounts_accounts_proxy_new_sync (manager->priv->connection, - G_DBUS_PROXY_FLAGS_NONE, - ACCOUNTS_NAME, - ACCOUNTS_PATH, - NULL, - &error); - if (manager->priv->accounts_proxy == NULL) { - if (error != NULL) { - g_warning ("Failed to create accounts proxy: %s", error->message); - g_error_free (error); - } else { - g_warning ("Failed to create_accounts_proxy"); - } - return; - } - g_dbus_proxy_set_default_timeout (G_DBUS_PROXY (manager->priv->accounts_proxy), G_MAXINT); - - g_signal_connect (manager->priv->accounts_proxy, - "user-added", - G_CALLBACK (on_new_user_in_accounts_service), - manager); - g_signal_connect (manager->priv->accounts_proxy, - "user-deleted", - G_CALLBACK (on_user_removed_in_accounts_service), - manager); + ensure_accounts_proxy (manager); manager->priv->seat.state = ACT_USER_MANAGER_SEAT_STATE_UNLOADED; } @@ -3048,7 +2987,7 @@ { GError *local_error = NULL; gboolean res; - gchar *path; + g_autofree gchar *path = NULL; ActUser *user; g_debug ("ActUserManager: Creating user '%s', '%s', %d", @@ -3056,7 +2995,6 @@ g_assert (manager->priv->accounts_proxy != NULL); - local_error = NULL; res = accounts_accounts_call_create_user_sync (manager->priv->accounts_proxy, username, fullname, @@ -3064,15 +3002,13 @@ &path, NULL, &local_error); - if (! res) { + if (!res) { g_propagate_error (error, local_error); return NULL; } user = add_new_user_for_object_path (path, manager); - g_free (path); - return user; } @@ -3081,11 +3017,10 @@ GAsyncResult *result, gpointer user_data) { - GSimpleAsyncResult *res = user_data; + GTask *task = user_data; - g_simple_async_result_set_op_res_gpointer (res, g_object_ref (result), g_object_unref); - g_simple_async_result_complete (res); - g_object_unref (res); + g_task_return_pointer (task, g_object_ref (result), g_object_unref); + g_object_unref (task); } /** @@ -3116,7 +3051,7 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *res; + GTask *task; g_return_if_fail (ACT_IS_USER_MANAGER (manager)); g_return_if_fail (manager->priv->accounts_proxy != NULL); @@ -3126,17 +3061,16 @@ g_assert (manager->priv->accounts_proxy != NULL); - res = g_simple_async_result_new (G_OBJECT (manager), - callback, user_data, - act_user_manager_create_user_async); - g_simple_async_result_set_check_cancellable (res, cancellable); + task = g_task_new (G_OBJECT (manager), + cancellable, + callback, user_data); accounts_accounts_call_create_user (manager->priv->accounts_proxy, username, fullname, accounttype, cancellable, - act_user_manager_async_complete_handler, res); + act_user_manager_async_complete_handler, task); } /** @@ -3160,20 +3094,17 @@ { GAsyncResult *inner_result; ActUser *user = NULL; - gchar *path; - GSimpleAsyncResult *res; + g_autofree gchar *path = NULL; GError *remote_error = NULL; - g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (manager), act_user_manager_create_user_async), FALSE); - - res = G_SIMPLE_ASYNC_RESULT (result); - inner_result = g_simple_async_result_get_op_res_gpointer (res); - g_assert (inner_result); + inner_result = g_task_propagate_pointer (G_TASK (result), error); + if (inner_result == NULL) { + return FALSE; + } if (accounts_accounts_call_create_user_finish (manager->priv->accounts_proxy, &path, inner_result, &remote_error)) { user = add_new_user_for_object_path (path, manager); - g_free (path); } if (remote_error) { @@ -3201,30 +3132,24 @@ { GError *local_error = NULL; gboolean res; - gchar *path; - ActUser *user; + g_autofree gchar *path = NULL; g_debug ("ActUserManager: Caching user '%s'", username); g_assert (manager->priv->accounts_proxy != NULL); - local_error = NULL; res = accounts_accounts_call_cache_user_sync (manager->priv->accounts_proxy, username, &path, NULL, &local_error); - if (! res) { + if (!res) { g_propagate_error (error, local_error); return NULL; } - user = add_new_user_for_object_path (path, manager); - - g_free (path); - - return user; + return add_new_user_for_object_path (path, manager); } @@ -3253,22 +3178,21 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *res; + GTask *task; g_return_if_fail (ACT_IS_USER_MANAGER (manager)); g_return_if_fail (manager->priv->accounts_proxy != NULL); g_debug ("ActUserManager: Caching user (async) '%s'", username); - res = g_simple_async_result_new (G_OBJECT (manager), - callback, user_data, - act_user_manager_cache_user_async); - g_simple_async_result_set_check_cancellable (res, cancellable); + task = g_task_new (G_OBJECT (manager), + cancellable, + callback, user_data); accounts_accounts_call_cache_user (manager->priv->accounts_proxy, username, cancellable, - act_user_manager_async_complete_handler, res); + act_user_manager_async_complete_handler, task); } /** @@ -3292,20 +3216,17 @@ { GAsyncResult *inner_result; ActUser *user = NULL; - gchar *path; - GSimpleAsyncResult *res; + g_autofree gchar *path = NULL; GError *remote_error = NULL; - g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (manager), act_user_manager_cache_user_async), FALSE); - - res = G_SIMPLE_ASYNC_RESULT (result); - inner_result = g_simple_async_result_get_op_res_gpointer (res); - g_assert (inner_result); + inner_result = g_task_propagate_pointer (G_TASK (result), error); + if (inner_result == NULL) { + return FALSE; + } if (accounts_accounts_call_cache_user_finish (manager->priv->accounts_proxy, &path, inner_result, &remote_error)) { user = add_new_user_for_object_path (path, manager); - g_free (path); } if (remote_error) { @@ -3342,12 +3263,11 @@ g_assert (manager->priv->accounts_proxy != NULL); - local_error = NULL; res = accounts_accounts_call_uncache_user_sync (manager->priv->accounts_proxy, username, NULL, &local_error); - if (! res) { + if (!res) { g_propagate_error (error, local_error); return FALSE; } @@ -3379,7 +3299,7 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *res; + GTask *task; g_return_if_fail (ACT_IS_USER_MANAGER (manager)); g_return_if_fail (username != NULL); @@ -3387,15 +3307,14 @@ g_debug ("ActUserManager: Uncaching user (async) '%s'", username); - res = g_simple_async_result_new (G_OBJECT (manager), - callback, user_data, - act_user_manager_uncache_user_async); - g_simple_async_result_set_check_cancellable (res, cancellable); + task = g_task_new (G_OBJECT (manager), + cancellable, + callback, user_data); accounts_accounts_call_uncache_user (manager->priv->accounts_proxy, username, cancellable, - act_user_manager_async_complete_handler, res); + act_user_manager_async_complete_handler, task); } /** @@ -3419,14 +3338,12 @@ { GAsyncResult *inner_result; gboolean success; - GSimpleAsyncResult *res; GError *remote_error = NULL; - g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (manager), act_user_manager_uncache_user_async), FALSE); - - res = G_SIMPLE_ASYNC_RESULT (result); - inner_result = g_simple_async_result_get_op_res_gpointer (res); - g_assert (inner_result); + inner_result = g_task_propagate_pointer (G_TASK (result), error); + if (inner_result == NULL) { + return FALSE; + } success = accounts_accounts_call_uncache_user_finish (manager->priv->accounts_proxy, inner_result, &remote_error); @@ -3456,8 +3373,7 @@ gboolean remove_files, GError **error) { - GError *local_error; - gboolean res = TRUE; + GError *local_error = NULL; g_debug ("ActUserManager: Deleting user '%s' (uid %ld)", act_user_get_user_name (user), (long) act_user_get_uid (user)); @@ -3465,17 +3381,16 @@ g_return_val_if_fail (ACT_IS_USER (user), FALSE); g_return_val_if_fail (manager->priv->accounts_proxy != NULL, FALSE); - local_error = NULL; if (!accounts_accounts_call_delete_user_sync (manager->priv->accounts_proxy, act_user_get_uid (user), remove_files, NULL, &local_error)) { g_propagate_error (error, local_error); - res = FALSE; + return FALSE; } - return res; + return TRUE; } /** @@ -3504,23 +3419,22 @@ GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *res; + GTask *task; g_return_if_fail (ACT_IS_USER_MANAGER (manager)); g_return_if_fail (ACT_IS_USER (user)); g_return_if_fail (manager->priv->accounts_proxy != NULL); - res = g_simple_async_result_new (G_OBJECT (manager), - callback, user_data, - act_user_manager_delete_user_async); - g_simple_async_result_set_check_cancellable (res, cancellable); + task = g_task_new (G_OBJECT (manager), + cancellable, + callback, user_data); g_debug ("ActUserManager: Deleting (async) user '%s' (uid %ld)", act_user_get_user_name (user), (long) act_user_get_uid (user)); accounts_accounts_call_delete_user (manager->priv->accounts_proxy, act_user_get_uid (user), remove_files, cancellable, - act_user_manager_async_complete_handler, res); + act_user_manager_async_complete_handler, task); } /** @@ -3544,13 +3458,12 @@ { GAsyncResult *inner_result; gboolean success; - GSimpleAsyncResult *res; GError *remote_error = NULL; - g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (manager), act_user_manager_delete_user_async), FALSE); - res = G_SIMPLE_ASYNC_RESULT (result); - inner_result = g_simple_async_result_get_op_res_gpointer (res); - g_assert (inner_result); + inner_result = g_task_propagate_pointer (G_TASK (result), error); + if (inner_result == NULL) { + return FALSE; + } success = accounts_accounts_call_delete_user_finish (manager->priv->accounts_proxy, inner_result, &remote_error); diff -Nru accountsservice-0.6.45/src/libaccountsservice/act-user-manager.h accountsservice-0.6.50/src/libaccountsservice/act-user-manager.h --- accountsservice-0.6.45/src/libaccountsservice/act-user-manager.h 2016-09-06 19:31:50.000000000 +0200 +++ accountsservice-0.6.50/src/libaccountsservice/act-user-manager.h 2018-04-04 15:59:42.000000000 +0200 @@ -145,6 +145,10 @@ GAsyncResult *result, GError **error); +#if GLIB_CHECK_VERSION(2, 44, 0) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (ActUserManager, g_object_unref) +#endif + G_END_DECLS #endif /* __ACT_USER_MANAGER_H__ */ diff -Nru accountsservice-0.6.45/src/libaccountsservice/ck-manager-generated.c accountsservice-0.6.50/src/libaccountsservice/ck-manager-generated.c --- accountsservice-0.6.45/src/libaccountsservice/ck-manager-generated.c 2017-03-27 20:33:36.000000000 +0200 +++ accountsservice-0.6.50/src/libaccountsservice/ck-manager-generated.c 2018-07-10 17:26:58.000000000 +0200 @@ -1,7 +1,8 @@ /* - * Generated by gdbus-codegen 2.51.5. DO NOT EDIT. + * Generated by gdbus-codegen 2.56.1. DO NOT EDIT. * - * The license of this code is the same as for the source it was derived from. + * The license of this code is the same as for the D-Bus interface description + * it was derived from. */ #ifdef HAVE_CONFIG_H @@ -1021,7 +1022,7 @@ /** * console_kit_manager_override_properties: - * @klass: The class structure for a #GObject-derived class. + * @klass: The class structure for a #GObject derived class. * @property_id_begin: The property id to assign to the first overridden property. * * Overrides all #GObject properties in the #ConsoleKitManager interface for a concrete class. @@ -1070,7 +1071,7 @@ */ typedef ConsoleKitManagerIface ConsoleKitManagerInterface; -G_DEFINE_INTERFACE (ConsoleKitManager, console_kit_manager, G_TYPE_OBJECT); +G_DEFINE_INTERFACE (ConsoleKitManager, console_kit_manager, G_TYPE_OBJECT) static void console_kit_manager_default_init (ConsoleKitManagerIface *iface) @@ -1542,7 +1543,7 @@ /** * console_kit_manager_call_restart: * @proxy: A #ConsoleKitManagerProxy. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * @@ -1599,7 +1600,7 @@ /** * console_kit_manager_call_restart_sync: * @proxy: A #ConsoleKitManagerProxy. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the Restart() D-Bus method on @proxy. The calling thread is blocked until a reply is received. @@ -1634,7 +1635,7 @@ /** * console_kit_manager_call_can_restart: * @proxy: A #ConsoleKitManagerProxy. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * @@ -1695,7 +1696,7 @@ * console_kit_manager_call_can_restart_sync: * @proxy: A #ConsoleKitManagerProxy. * @out_can_restart: (out): Return location for return parameter or %NULL to ignore. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the CanRestart() D-Bus method on @proxy. The calling thread is blocked until a reply is received. @@ -1732,7 +1733,7 @@ /** * console_kit_manager_call_stop: * @proxy: A #ConsoleKitManagerProxy. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * @@ -1789,7 +1790,7 @@ /** * console_kit_manager_call_stop_sync: * @proxy: A #ConsoleKitManagerProxy. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the Stop() D-Bus method on @proxy. The calling thread is blocked until a reply is received. @@ -1824,7 +1825,7 @@ /** * console_kit_manager_call_can_stop: * @proxy: A #ConsoleKitManagerProxy. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * @@ -1885,7 +1886,7 @@ * console_kit_manager_call_can_stop_sync: * @proxy: A #ConsoleKitManagerProxy. * @out_can_stop: (out): Return location for return parameter or %NULL to ignore. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the CanStop() D-Bus method on @proxy. The calling thread is blocked until a reply is received. @@ -1922,7 +1923,7 @@ /** * console_kit_manager_call_open_session: * @proxy: A #ConsoleKitManagerProxy. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * @@ -1983,7 +1984,7 @@ * console_kit_manager_call_open_session_sync: * @proxy: A #ConsoleKitManagerProxy. * @out_cookie: (out): Return location for return parameter or %NULL to ignore. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the OpenSession() D-Bus method on @proxy. The calling thread is blocked until a reply is received. @@ -2021,7 +2022,7 @@ * console_kit_manager_call_open_session_with_parameters: * @proxy: A #ConsoleKitManagerProxy. * @arg_parameters: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * @@ -2085,7 +2086,7 @@ * @proxy: A #ConsoleKitManagerProxy. * @arg_parameters: Argument to pass with the method invocation. * @out_cookie: (out): Return location for return parameter or %NULL to ignore. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the OpenSessionWithParameters() D-Bus method on @proxy. The calling thread is blocked until a reply is received. @@ -2125,7 +2126,7 @@ * console_kit_manager_call_close_session: * @proxy: A #ConsoleKitManagerProxy. * @arg_cookie: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * @@ -2189,7 +2190,7 @@ * @proxy: A #ConsoleKitManagerProxy. * @arg_cookie: Argument to pass with the method invocation. * @out_result: (out): Return location for return parameter or %NULL to ignore. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the CloseSession() D-Bus method on @proxy. The calling thread is blocked until a reply is received. @@ -2228,7 +2229,7 @@ /** * console_kit_manager_call_get_seats: * @proxy: A #ConsoleKitManagerProxy. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * @@ -2258,7 +2259,7 @@ /** * console_kit_manager_call_get_seats_finish: * @proxy: A #ConsoleKitManagerProxy. - * @out_seats: (out): Return location for return parameter or %NULL to ignore. + * @out_seats: (out) (array zero-terminated=1): Return location for return parameter or %NULL to ignore. * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to console_kit_manager_call_get_seats(). * @error: Return location for error or %NULL. * @@ -2288,8 +2289,8 @@ /** * console_kit_manager_call_get_seats_sync: * @proxy: A #ConsoleKitManagerProxy. - * @out_seats: (out): Return location for return parameter or %NULL to ignore. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @out_seats: (out) (array zero-terminated=1): Return location for return parameter or %NULL to ignore. + * @cancellable: (nullable): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the GetSeats() D-Bus method on @proxy. The calling thread is blocked until a reply is received. @@ -2326,7 +2327,7 @@ /** * console_kit_manager_call_get_sessions: * @proxy: A #ConsoleKitManagerProxy. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * @@ -2356,7 +2357,7 @@ /** * console_kit_manager_call_get_sessions_finish: * @proxy: A #ConsoleKitManagerProxy. - * @out_sessions: (out): Return location for return parameter or %NULL to ignore. + * @out_sessions: (out) (array zero-terminated=1): Return location for return parameter or %NULL to ignore. * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to console_kit_manager_call_get_sessions(). * @error: Return location for error or %NULL. * @@ -2386,8 +2387,8 @@ /** * console_kit_manager_call_get_sessions_sync: * @proxy: A #ConsoleKitManagerProxy. - * @out_sessions: (out): Return location for return parameter or %NULL to ignore. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @out_sessions: (out) (array zero-terminated=1): Return location for return parameter or %NULL to ignore. + * @cancellable: (nullable): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the GetSessions() D-Bus method on @proxy. The calling thread is blocked until a reply is received. @@ -2425,7 +2426,7 @@ * console_kit_manager_call_get_session_for_cookie: * @proxy: A #ConsoleKitManagerProxy. * @arg_cookie: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * @@ -2489,7 +2490,7 @@ * @proxy: A #ConsoleKitManagerProxy. * @arg_cookie: Argument to pass with the method invocation. * @out_ssid: (out): Return location for return parameter or %NULL to ignore. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the GetSessionForCookie() D-Bus method on @proxy. The calling thread is blocked until a reply is received. @@ -2529,7 +2530,7 @@ * console_kit_manager_call_get_session_for_unix_process: * @proxy: A #ConsoleKitManagerProxy. * @arg_pid: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * @@ -2593,7 +2594,7 @@ * @proxy: A #ConsoleKitManagerProxy. * @arg_pid: Argument to pass with the method invocation. * @out_ssid: (out): Return location for return parameter or %NULL to ignore. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the GetSessionForUnixProcess() D-Bus method on @proxy. The calling thread is blocked until a reply is received. @@ -2632,7 +2633,7 @@ /** * console_kit_manager_call_get_current_session: * @proxy: A #ConsoleKitManagerProxy. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * @@ -2693,7 +2694,7 @@ * console_kit_manager_call_get_current_session_sync: * @proxy: A #ConsoleKitManagerProxy. * @out_ssid: (out): Return location for return parameter or %NULL to ignore. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the GetCurrentSession() D-Bus method on @proxy. The calling thread is blocked until a reply is received. @@ -2731,7 +2732,7 @@ * console_kit_manager_call_get_sessions_for_unix_user: * @proxy: A #ConsoleKitManagerProxy. * @arg_uid: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * @@ -2763,7 +2764,7 @@ /** * console_kit_manager_call_get_sessions_for_unix_user_finish: * @proxy: A #ConsoleKitManagerProxy. - * @out_sessions: (out): Return location for return parameter or %NULL to ignore. + * @out_sessions: (out) (array zero-terminated=1): Return location for return parameter or %NULL to ignore. * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to console_kit_manager_call_get_sessions_for_unix_user(). * @error: Return location for error or %NULL. * @@ -2794,8 +2795,8 @@ * console_kit_manager_call_get_sessions_for_unix_user_sync: * @proxy: A #ConsoleKitManagerProxy. * @arg_uid: Argument to pass with the method invocation. - * @out_sessions: (out): Return location for return parameter or %NULL to ignore. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @out_sessions: (out) (array zero-terminated=1): Return location for return parameter or %NULL to ignore. + * @cancellable: (nullable): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the GetSessionsForUnixUser() D-Bus method on @proxy. The calling thread is blocked until a reply is received. @@ -2835,7 +2836,7 @@ * console_kit_manager_call_get_sessions_for_user: * @proxy: A #ConsoleKitManagerProxy. * @arg_uid: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * @@ -2867,7 +2868,7 @@ /** * console_kit_manager_call_get_sessions_for_user_finish: * @proxy: A #ConsoleKitManagerProxy. - * @out_sessions: (out): Return location for return parameter or %NULL to ignore. + * @out_sessions: (out) (array zero-terminated=1): Return location for return parameter or %NULL to ignore. * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to console_kit_manager_call_get_sessions_for_user(). * @error: Return location for error or %NULL. * @@ -2898,8 +2899,8 @@ * console_kit_manager_call_get_sessions_for_user_sync: * @proxy: A #ConsoleKitManagerProxy. * @arg_uid: Argument to pass with the method invocation. - * @out_sessions: (out): Return location for return parameter or %NULL to ignore. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @out_sessions: (out) (array zero-terminated=1): Return location for return parameter or %NULL to ignore. + * @cancellable: (nullable): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the GetSessionsForUser() D-Bus method on @proxy. The calling thread is blocked until a reply is received. @@ -2938,7 +2939,7 @@ /** * console_kit_manager_call_get_system_idle_hint: * @proxy: A #ConsoleKitManagerProxy. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * @@ -2999,7 +3000,7 @@ * console_kit_manager_call_get_system_idle_hint_sync: * @proxy: A #ConsoleKitManagerProxy. * @out_idle_hint: (out): Return location for return parameter or %NULL to ignore. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the GetSystemIdleHint() D-Bus method on @proxy. The calling thread is blocked until a reply is received. @@ -3036,7 +3037,7 @@ /** * console_kit_manager_call_get_system_idle_since_hint: * @proxy: A #ConsoleKitManagerProxy. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * @@ -3097,7 +3098,7 @@ * console_kit_manager_call_get_system_idle_since_hint_sync: * @proxy: A #ConsoleKitManagerProxy. * @out_iso8601_datetime: (out): Return location for return parameter or %NULL to ignore. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the GetSystemIdleSinceHint() D-Bus method on @proxy. The calling thread is blocked until a reply is received. @@ -3486,11 +3487,11 @@ #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 G_DEFINE_TYPE_WITH_CODE (ConsoleKitManagerProxy, console_kit_manager_proxy, G_TYPE_DBUS_PROXY, G_ADD_PRIVATE (ConsoleKitManagerProxy) - G_IMPLEMENT_INTERFACE (CONSOLE_KIT_TYPE_MANAGER, console_kit_manager_proxy_iface_init)); + G_IMPLEMENT_INTERFACE (CONSOLE_KIT_TYPE_MANAGER, console_kit_manager_proxy_iface_init)) #else G_DEFINE_TYPE_WITH_CODE (ConsoleKitManagerProxy, console_kit_manager_proxy, G_TYPE_DBUS_PROXY, - G_IMPLEMENT_INTERFACE (CONSOLE_KIT_TYPE_MANAGER, console_kit_manager_proxy_iface_init)); + G_IMPLEMENT_INTERFACE (CONSOLE_KIT_TYPE_MANAGER, console_kit_manager_proxy_iface_init)) #endif static void @@ -3628,9 +3629,9 @@ * console_kit_manager_proxy_new: * @connection: A #GDBusConnection. * @flags: Flags from the #GDBusProxyFlags enumeration. - * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. + * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. * @object_path: An object path. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied. * @user_data: User data to pass to @callback. * @@ -3683,9 +3684,9 @@ * console_kit_manager_proxy_new_sync: * @connection: A #GDBusConnection. * @flags: Flags from the #GDBusProxyFlags enumeration. - * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. + * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. * @object_path: An object path. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @error: Return location for error or %NULL * * Synchronously creates a proxy for the D-Bus interface org.freedesktop.ConsoleKit.Manager. See g_dbus_proxy_new_sync() for more details. @@ -3720,7 +3721,7 @@ * @flags: Flags from the #GDBusProxyFlags enumeration. * @name: A bus name (well-known or unique). * @object_path: An object path. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied. * @user_data: User data to pass to @callback. * @@ -3775,7 +3776,7 @@ * @flags: Flags from the #GDBusProxyFlags enumeration. * @name: A bus name (well-known or unique). * @object_path: An object path. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @error: Return location for error or %NULL * * Like console_kit_manager_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection. @@ -4092,11 +4093,11 @@ #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 G_DEFINE_TYPE_WITH_CODE (ConsoleKitManagerSkeleton, console_kit_manager_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON, G_ADD_PRIVATE (ConsoleKitManagerSkeleton) - G_IMPLEMENT_INTERFACE (CONSOLE_KIT_TYPE_MANAGER, console_kit_manager_skeleton_iface_init)); + G_IMPLEMENT_INTERFACE (CONSOLE_KIT_TYPE_MANAGER, console_kit_manager_skeleton_iface_init)) #else G_DEFINE_TYPE_WITH_CODE (ConsoleKitManagerSkeleton, console_kit_manager_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON, - G_IMPLEMENT_INTERFACE (CONSOLE_KIT_TYPE_MANAGER, console_kit_manager_skeleton_iface_init)); + G_IMPLEMENT_INTERFACE (CONSOLE_KIT_TYPE_MANAGER, console_kit_manager_skeleton_iface_init)) #endif static void diff -Nru accountsservice-0.6.45/src/libaccountsservice/ck-manager-generated.h accountsservice-0.6.50/src/libaccountsservice/ck-manager-generated.h --- accountsservice-0.6.45/src/libaccountsservice/ck-manager-generated.h 2017-03-27 20:33:36.000000000 +0200 +++ accountsservice-0.6.50/src/libaccountsservice/ck-manager-generated.h 2018-07-10 17:26:58.000000000 +0200 @@ -1,7 +1,8 @@ /* - * Generated by gdbus-codegen 2.51.5. DO NOT EDIT. + * Generated by gdbus-codegen 2.56.1. DO NOT EDIT. * - * The license of this code is the same as for the source it was derived from. + * The license of this code is the same as for the D-Bus interface description + * it was derived from. */ #ifndef __CK_MANAGER_GENERATED_H__ diff -Nru accountsservice-0.6.45/src/libaccountsservice/ck-seat-generated.c accountsservice-0.6.50/src/libaccountsservice/ck-seat-generated.c --- accountsservice-0.6.45/src/libaccountsservice/ck-seat-generated.c 2017-03-27 20:33:36.000000000 +0200 +++ accountsservice-0.6.50/src/libaccountsservice/ck-seat-generated.c 2018-07-10 17:26:58.000000000 +0200 @@ -1,7 +1,8 @@ /* - * Generated by gdbus-codegen 2.51.5. DO NOT EDIT. + * Generated by gdbus-codegen 2.56.1. DO NOT EDIT. * - * The license of this code is the same as for the source it was derived from. + * The license of this code is the same as for the D-Bus interface description + * it was derived from. */ #ifdef HAVE_CONFIG_H @@ -547,7 +548,7 @@ /** * console_kit_seat_override_properties: - * @klass: The class structure for a #GObject-derived class. + * @klass: The class structure for a #GObject derived class. * @property_id_begin: The property id to assign to the first overridden property. * * Overrides all #GObject properties in the #ConsoleKitSeat interface for a concrete class. @@ -588,7 +589,7 @@ */ typedef ConsoleKitSeatIface ConsoleKitSeatInterface; -G_DEFINE_INTERFACE (ConsoleKitSeat, console_kit_seat, G_TYPE_OBJECT); +G_DEFINE_INTERFACE (ConsoleKitSeat, console_kit_seat, G_TYPE_OBJECT) static void console_kit_seat_default_init (ConsoleKitSeatIface *iface) @@ -903,7 +904,7 @@ /** * console_kit_seat_call_get_id: * @proxy: A #ConsoleKitSeatProxy. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * @@ -964,7 +965,7 @@ * console_kit_seat_call_get_id_sync: * @proxy: A #ConsoleKitSeatProxy. * @out_sid: (out): Return location for return parameter or %NULL to ignore. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the GetId() D-Bus method on @proxy. The calling thread is blocked until a reply is received. @@ -1001,7 +1002,7 @@ /** * console_kit_seat_call_get_sessions: * @proxy: A #ConsoleKitSeatProxy. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * @@ -1031,7 +1032,7 @@ /** * console_kit_seat_call_get_sessions_finish: * @proxy: A #ConsoleKitSeatProxy. - * @out_sessions: (out): Return location for return parameter or %NULL to ignore. + * @out_sessions: (out) (array zero-terminated=1): Return location for return parameter or %NULL to ignore. * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to console_kit_seat_call_get_sessions(). * @error: Return location for error or %NULL. * @@ -1061,8 +1062,8 @@ /** * console_kit_seat_call_get_sessions_sync: * @proxy: A #ConsoleKitSeatProxy. - * @out_sessions: (out): Return location for return parameter or %NULL to ignore. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @out_sessions: (out) (array zero-terminated=1): Return location for return parameter or %NULL to ignore. + * @cancellable: (nullable): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the GetSessions() D-Bus method on @proxy. The calling thread is blocked until a reply is received. @@ -1099,7 +1100,7 @@ /** * console_kit_seat_call_get_devices: * @proxy: A #ConsoleKitSeatProxy. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * @@ -1160,7 +1161,7 @@ * console_kit_seat_call_get_devices_sync: * @proxy: A #ConsoleKitSeatProxy. * @out_devices: (out): Return location for return parameter or %NULL to ignore. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the GetDevices() D-Bus method on @proxy. The calling thread is blocked until a reply is received. @@ -1197,7 +1198,7 @@ /** * console_kit_seat_call_get_active_session: * @proxy: A #ConsoleKitSeatProxy. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * @@ -1258,7 +1259,7 @@ * console_kit_seat_call_get_active_session_sync: * @proxy: A #ConsoleKitSeatProxy. * @out_ssid: (out): Return location for return parameter or %NULL to ignore. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the GetActiveSession() D-Bus method on @proxy. The calling thread is blocked until a reply is received. @@ -1295,7 +1296,7 @@ /** * console_kit_seat_call_can_activate_sessions: * @proxy: A #ConsoleKitSeatProxy. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * @@ -1356,7 +1357,7 @@ * console_kit_seat_call_can_activate_sessions_sync: * @proxy: A #ConsoleKitSeatProxy. * @out_can_activate: (out): Return location for return parameter or %NULL to ignore. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the CanActivateSessions() D-Bus method on @proxy. The calling thread is blocked until a reply is received. @@ -1394,7 +1395,7 @@ * console_kit_seat_call_activate_session: * @proxy: A #ConsoleKitSeatProxy. * @arg_ssid: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * @@ -1454,7 +1455,7 @@ * console_kit_seat_call_activate_session_sync: * @proxy: A #ConsoleKitSeatProxy. * @arg_ssid: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the ActivateSession() D-Bus method on @proxy. The calling thread is blocked until a reply is received. @@ -1636,11 +1637,11 @@ #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 G_DEFINE_TYPE_WITH_CODE (ConsoleKitSeatProxy, console_kit_seat_proxy, G_TYPE_DBUS_PROXY, G_ADD_PRIVATE (ConsoleKitSeatProxy) - G_IMPLEMENT_INTERFACE (CONSOLE_KIT_TYPE_SEAT, console_kit_seat_proxy_iface_init)); + G_IMPLEMENT_INTERFACE (CONSOLE_KIT_TYPE_SEAT, console_kit_seat_proxy_iface_init)) #else G_DEFINE_TYPE_WITH_CODE (ConsoleKitSeatProxy, console_kit_seat_proxy, G_TYPE_DBUS_PROXY, - G_IMPLEMENT_INTERFACE (CONSOLE_KIT_TYPE_SEAT, console_kit_seat_proxy_iface_init)); + G_IMPLEMENT_INTERFACE (CONSOLE_KIT_TYPE_SEAT, console_kit_seat_proxy_iface_init)) #endif static void @@ -1778,9 +1779,9 @@ * console_kit_seat_proxy_new: * @connection: A #GDBusConnection. * @flags: Flags from the #GDBusProxyFlags enumeration. - * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. + * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. * @object_path: An object path. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied. * @user_data: User data to pass to @callback. * @@ -1833,9 +1834,9 @@ * console_kit_seat_proxy_new_sync: * @connection: A #GDBusConnection. * @flags: Flags from the #GDBusProxyFlags enumeration. - * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. + * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. * @object_path: An object path. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @error: Return location for error or %NULL * * Synchronously creates a proxy for the D-Bus interface org.freedesktop.ConsoleKit.Seat. See g_dbus_proxy_new_sync() for more details. @@ -1870,7 +1871,7 @@ * @flags: Flags from the #GDBusProxyFlags enumeration. * @name: A bus name (well-known or unique). * @object_path: An object path. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied. * @user_data: User data to pass to @callback. * @@ -1925,7 +1926,7 @@ * @flags: Flags from the #GDBusProxyFlags enumeration. * @name: A bus name (well-known or unique). * @object_path: An object path. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @error: Return location for error or %NULL * * Like console_kit_seat_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection. @@ -2290,11 +2291,11 @@ #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 G_DEFINE_TYPE_WITH_CODE (ConsoleKitSeatSkeleton, console_kit_seat_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON, G_ADD_PRIVATE (ConsoleKitSeatSkeleton) - G_IMPLEMENT_INTERFACE (CONSOLE_KIT_TYPE_SEAT, console_kit_seat_skeleton_iface_init)); + G_IMPLEMENT_INTERFACE (CONSOLE_KIT_TYPE_SEAT, console_kit_seat_skeleton_iface_init)) #else G_DEFINE_TYPE_WITH_CODE (ConsoleKitSeatSkeleton, console_kit_seat_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON, - G_IMPLEMENT_INTERFACE (CONSOLE_KIT_TYPE_SEAT, console_kit_seat_skeleton_iface_init)); + G_IMPLEMENT_INTERFACE (CONSOLE_KIT_TYPE_SEAT, console_kit_seat_skeleton_iface_init)) #endif static void diff -Nru accountsservice-0.6.45/src/libaccountsservice/ck-seat-generated.h accountsservice-0.6.50/src/libaccountsservice/ck-seat-generated.h --- accountsservice-0.6.45/src/libaccountsservice/ck-seat-generated.h 2017-03-27 20:33:36.000000000 +0200 +++ accountsservice-0.6.50/src/libaccountsservice/ck-seat-generated.h 2018-07-10 17:26:58.000000000 +0200 @@ -1,7 +1,8 @@ /* - * Generated by gdbus-codegen 2.51.5. DO NOT EDIT. + * Generated by gdbus-codegen 2.56.1. DO NOT EDIT. * - * The license of this code is the same as for the source it was derived from. + * The license of this code is the same as for the D-Bus interface description + * it was derived from. */ #ifndef __CK_SEAT_GENERATED_H__ diff -Nru accountsservice-0.6.45/src/libaccountsservice/ck-session-generated.c accountsservice-0.6.50/src/libaccountsservice/ck-session-generated.c --- accountsservice-0.6.45/src/libaccountsservice/ck-session-generated.c 2017-03-27 20:33:36.000000000 +0200 +++ accountsservice-0.6.50/src/libaccountsservice/ck-session-generated.c 2018-07-10 17:26:58.000000000 +0200 @@ -1,7 +1,8 @@ /* - * Generated by gdbus-codegen 2.51.5. DO NOT EDIT. + * Generated by gdbus-codegen 2.56.1. DO NOT EDIT. * - * The license of this code is the same as for the source it was derived from. + * The license of this code is the same as for the D-Bus interface description + * it was derived from. */ #ifdef HAVE_CONFIG_H @@ -1023,7 +1024,7 @@ /** * console_kit_session_override_properties: - * @klass: The class structure for a #GObject-derived class. + * @klass: The class structure for a #GObject derived class. * @property_id_begin: The property id to assign to the first overridden property. * * Overrides all #GObject properties in the #ConsoleKitSession interface for a concrete class. @@ -1096,7 +1097,7 @@ */ typedef ConsoleKitSessionIface ConsoleKitSessionInterface; -G_DEFINE_INTERFACE (ConsoleKitSession, console_kit_session, G_TYPE_OBJECT); +G_DEFINE_INTERFACE (ConsoleKitSession, console_kit_session, G_TYPE_OBJECT) static void console_kit_session_default_init (ConsoleKitSessionIface *iface) @@ -2158,7 +2159,7 @@ /** * console_kit_session_call_get_id: * @proxy: A #ConsoleKitSessionProxy. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * @@ -2219,7 +2220,7 @@ * console_kit_session_call_get_id_sync: * @proxy: A #ConsoleKitSessionProxy. * @out_ssid: (out): Return location for return parameter or %NULL to ignore. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the GetId() D-Bus method on @proxy. The calling thread is blocked until a reply is received. @@ -2256,7 +2257,7 @@ /** * console_kit_session_call_get_seat_id: * @proxy: A #ConsoleKitSessionProxy. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * @@ -2317,7 +2318,7 @@ * console_kit_session_call_get_seat_id_sync: * @proxy: A #ConsoleKitSessionProxy. * @out_sid: (out): Return location for return parameter or %NULL to ignore. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the GetSeatId() D-Bus method on @proxy. The calling thread is blocked until a reply is received. @@ -2354,7 +2355,7 @@ /** * console_kit_session_call_get_session_type: * @proxy: A #ConsoleKitSessionProxy. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * @@ -2415,7 +2416,7 @@ * console_kit_session_call_get_session_type_sync: * @proxy: A #ConsoleKitSessionProxy. * @out_type: (out): Return location for return parameter or %NULL to ignore. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the GetSessionType() D-Bus method on @proxy. The calling thread is blocked until a reply is received. @@ -2452,7 +2453,7 @@ /** * console_kit_session_call_get_user: * @proxy: A #ConsoleKitSessionProxy. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * @@ -2513,7 +2514,7 @@ * console_kit_session_call_get_user_sync: * @proxy: A #ConsoleKitSessionProxy. * @out_uid: (out): Return location for return parameter or %NULL to ignore. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the GetUser() D-Bus method on @proxy. The calling thread is blocked until a reply is received. @@ -2550,7 +2551,7 @@ /** * console_kit_session_call_get_unix_user: * @proxy: A #ConsoleKitSessionProxy. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * @@ -2611,7 +2612,7 @@ * console_kit_session_call_get_unix_user_sync: * @proxy: A #ConsoleKitSessionProxy. * @out_uid: (out): Return location for return parameter or %NULL to ignore. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the GetUnixUser() D-Bus method on @proxy. The calling thread is blocked until a reply is received. @@ -2648,7 +2649,7 @@ /** * console_kit_session_call_get_x11_display: * @proxy: A #ConsoleKitSessionProxy. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * @@ -2709,7 +2710,7 @@ * console_kit_session_call_get_x11_display_sync: * @proxy: A #ConsoleKitSessionProxy. * @out_display: (out): Return location for return parameter or %NULL to ignore. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the GetX11Display() D-Bus method on @proxy. The calling thread is blocked until a reply is received. @@ -2746,7 +2747,7 @@ /** * console_kit_session_call_get_x11_display_device: * @proxy: A #ConsoleKitSessionProxy. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * @@ -2807,7 +2808,7 @@ * console_kit_session_call_get_x11_display_device_sync: * @proxy: A #ConsoleKitSessionProxy. * @out_x11_display_device: (out): Return location for return parameter or %NULL to ignore. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the GetX11DisplayDevice() D-Bus method on @proxy. The calling thread is blocked until a reply is received. @@ -2844,7 +2845,7 @@ /** * console_kit_session_call_get_display_device: * @proxy: A #ConsoleKitSessionProxy. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * @@ -2905,7 +2906,7 @@ * console_kit_session_call_get_display_device_sync: * @proxy: A #ConsoleKitSessionProxy. * @out_display_device: (out): Return location for return parameter or %NULL to ignore. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the GetDisplayDevice() D-Bus method on @proxy. The calling thread is blocked until a reply is received. @@ -2942,7 +2943,7 @@ /** * console_kit_session_call_get_remote_host_name: * @proxy: A #ConsoleKitSessionProxy. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * @@ -3003,7 +3004,7 @@ * console_kit_session_call_get_remote_host_name_sync: * @proxy: A #ConsoleKitSessionProxy. * @out_remote_host_name: (out): Return location for return parameter or %NULL to ignore. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the GetRemoteHostName() D-Bus method on @proxy. The calling thread is blocked until a reply is received. @@ -3040,7 +3041,7 @@ /** * console_kit_session_call_get_login_session_id: * @proxy: A #ConsoleKitSessionProxy. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * @@ -3101,7 +3102,7 @@ * console_kit_session_call_get_login_session_id_sync: * @proxy: A #ConsoleKitSessionProxy. * @out_login_session_id: (out): Return location for return parameter or %NULL to ignore. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the GetLoginSessionId() D-Bus method on @proxy. The calling thread is blocked until a reply is received. @@ -3138,7 +3139,7 @@ /** * console_kit_session_call_is_active: * @proxy: A #ConsoleKitSessionProxy. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * @@ -3199,7 +3200,7 @@ * console_kit_session_call_is_active_sync: * @proxy: A #ConsoleKitSessionProxy. * @out_active: (out): Return location for return parameter or %NULL to ignore. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the IsActive() D-Bus method on @proxy. The calling thread is blocked until a reply is received. @@ -3236,7 +3237,7 @@ /** * console_kit_session_call_is_local: * @proxy: A #ConsoleKitSessionProxy. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * @@ -3297,7 +3298,7 @@ * console_kit_session_call_is_local_sync: * @proxy: A #ConsoleKitSessionProxy. * @out_local: (out): Return location for return parameter or %NULL to ignore. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the IsLocal() D-Bus method on @proxy. The calling thread is blocked until a reply is received. @@ -3334,7 +3335,7 @@ /** * console_kit_session_call_get_creation_time: * @proxy: A #ConsoleKitSessionProxy. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * @@ -3395,7 +3396,7 @@ * console_kit_session_call_get_creation_time_sync: * @proxy: A #ConsoleKitSessionProxy. * @out_iso8601_datetime: (out): Return location for return parameter or %NULL to ignore. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the GetCreationTime() D-Bus method on @proxy. The calling thread is blocked until a reply is received. @@ -3432,7 +3433,7 @@ /** * console_kit_session_call_activate: * @proxy: A #ConsoleKitSessionProxy. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * @@ -3489,7 +3490,7 @@ /** * console_kit_session_call_activate_sync: * @proxy: A #ConsoleKitSessionProxy. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the Activate() D-Bus method on @proxy. The calling thread is blocked until a reply is received. @@ -3524,7 +3525,7 @@ /** * console_kit_session_call_lock: * @proxy: A #ConsoleKitSessionProxy. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * @@ -3581,7 +3582,7 @@ /** * console_kit_session_call_lock_sync: * @proxy: A #ConsoleKitSessionProxy. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the Lock() D-Bus method on @proxy. The calling thread is blocked until a reply is received. @@ -3616,7 +3617,7 @@ /** * console_kit_session_call_unlock: * @proxy: A #ConsoleKitSessionProxy. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * @@ -3673,7 +3674,7 @@ /** * console_kit_session_call_unlock_sync: * @proxy: A #ConsoleKitSessionProxy. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the Unlock() D-Bus method on @proxy. The calling thread is blocked until a reply is received. @@ -3708,7 +3709,7 @@ /** * console_kit_session_call_get_idle_hint: * @proxy: A #ConsoleKitSessionProxy. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * @@ -3769,7 +3770,7 @@ * console_kit_session_call_get_idle_hint_sync: * @proxy: A #ConsoleKitSessionProxy. * @out_idle_hint: (out): Return location for return parameter or %NULL to ignore. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the GetIdleHint() D-Bus method on @proxy. The calling thread is blocked until a reply is received. @@ -3806,7 +3807,7 @@ /** * console_kit_session_call_get_idle_since_hint: * @proxy: A #ConsoleKitSessionProxy. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * @@ -3867,7 +3868,7 @@ * console_kit_session_call_get_idle_since_hint_sync: * @proxy: A #ConsoleKitSessionProxy. * @out_iso8601_datetime: (out): Return location for return parameter or %NULL to ignore. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the GetIdleSinceHint() D-Bus method on @proxy. The calling thread is blocked until a reply is received. @@ -3905,7 +3906,7 @@ * console_kit_session_call_set_idle_hint: * @proxy: A #ConsoleKitSessionProxy. * @arg_idle_hint: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. * @@ -3965,7 +3966,7 @@ * console_kit_session_call_set_idle_hint_sync: * @proxy: A #ConsoleKitSessionProxy. * @arg_idle_hint: Argument to pass with the method invocation. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * * Synchronously invokes the SetIdleHint() D-Bus method on @proxy. The calling thread is blocked until a reply is received. @@ -4411,11 +4412,11 @@ #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 G_DEFINE_TYPE_WITH_CODE (ConsoleKitSessionProxy, console_kit_session_proxy, G_TYPE_DBUS_PROXY, G_ADD_PRIVATE (ConsoleKitSessionProxy) - G_IMPLEMENT_INTERFACE (CONSOLE_KIT_TYPE_SESSION, console_kit_session_proxy_iface_init)); + G_IMPLEMENT_INTERFACE (CONSOLE_KIT_TYPE_SESSION, console_kit_session_proxy_iface_init)) #else G_DEFINE_TYPE_WITH_CODE (ConsoleKitSessionProxy, console_kit_session_proxy, G_TYPE_DBUS_PROXY, - G_IMPLEMENT_INTERFACE (CONSOLE_KIT_TYPE_SESSION, console_kit_session_proxy_iface_init)); + G_IMPLEMENT_INTERFACE (CONSOLE_KIT_TYPE_SESSION, console_kit_session_proxy_iface_init)) #endif static void @@ -4766,9 +4767,9 @@ * console_kit_session_proxy_new: * @connection: A #GDBusConnection. * @flags: Flags from the #GDBusProxyFlags enumeration. - * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. + * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. * @object_path: An object path. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied. * @user_data: User data to pass to @callback. * @@ -4821,9 +4822,9 @@ * console_kit_session_proxy_new_sync: * @connection: A #GDBusConnection. * @flags: Flags from the #GDBusProxyFlags enumeration. - * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. + * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. * @object_path: An object path. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @error: Return location for error or %NULL * * Synchronously creates a proxy for the D-Bus interface org.freedesktop.ConsoleKit.Session. See g_dbus_proxy_new_sync() for more details. @@ -4858,7 +4859,7 @@ * @flags: Flags from the #GDBusProxyFlags enumeration. * @name: A bus name (well-known or unique). * @object_path: An object path. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied. * @user_data: User data to pass to @callback. * @@ -4913,7 +4914,7 @@ * @flags: Flags from the #GDBusProxyFlags enumeration. * @name: A bus name (well-known or unique). * @object_path: An object path. - * @cancellable: (allow-none): A #GCancellable or %NULL. + * @cancellable: (nullable): A #GCancellable or %NULL. * @error: Return location for error or %NULL * * Like console_kit_session_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection. @@ -5266,11 +5267,11 @@ #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 G_DEFINE_TYPE_WITH_CODE (ConsoleKitSessionSkeleton, console_kit_session_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON, G_ADD_PRIVATE (ConsoleKitSessionSkeleton) - G_IMPLEMENT_INTERFACE (CONSOLE_KIT_TYPE_SESSION, console_kit_session_skeleton_iface_init)); + G_IMPLEMENT_INTERFACE (CONSOLE_KIT_TYPE_SESSION, console_kit_session_skeleton_iface_init)) #else G_DEFINE_TYPE_WITH_CODE (ConsoleKitSessionSkeleton, console_kit_session_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON, - G_IMPLEMENT_INTERFACE (CONSOLE_KIT_TYPE_SESSION, console_kit_session_skeleton_iface_init)); + G_IMPLEMENT_INTERFACE (CONSOLE_KIT_TYPE_SESSION, console_kit_session_skeleton_iface_init)) #endif static void diff -Nru accountsservice-0.6.45/src/libaccountsservice/ck-session-generated.h accountsservice-0.6.50/src/libaccountsservice/ck-session-generated.h --- accountsservice-0.6.45/src/libaccountsservice/ck-session-generated.h 2017-03-27 20:33:36.000000000 +0200 +++ accountsservice-0.6.50/src/libaccountsservice/ck-session-generated.h 2018-07-10 17:26:58.000000000 +0200 @@ -1,7 +1,8 @@ /* - * Generated by gdbus-codegen 2.51.5. DO NOT EDIT. + * Generated by gdbus-codegen 2.56.1. DO NOT EDIT. * - * The license of this code is the same as for the source it was derived from. + * The license of this code is the same as for the D-Bus interface description + * it was derived from. */ #ifndef __CK_SESSION_GENERATED_H__ diff -Nru accountsservice-0.6.45/src/libaccountsservice/Makefile.in accountsservice-0.6.50/src/libaccountsservice/Makefile.in --- accountsservice-0.6.45/src/libaccountsservice/Makefile.in 2017-03-27 20:33:02.000000000 +0200 +++ accountsservice-0.6.50/src/libaccountsservice/Makefile.in 2018-07-10 17:25:08.000000000 +0200 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -224,6 +224,8 @@ am__DIST_COMMON = $(srcdir)/Makefile.in \ $(srcdir)/accountsservice.pc.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACCOUNTS_DAEMON_CFLAGS = @ACCOUNTS_DAEMON_CFLAGS@ +ACCOUNTS_DAEMON_LIBS = @ACCOUNTS_DAEMON_LIBS@ ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ @@ -251,11 +253,11 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ +ELOGIND_CFLAGS = @ELOGIND_CFLAGS@ +ELOGIND_LIBS = @ELOGIND_LIBS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ -GIO_CFLAGS = @GIO_CFLAGS@ -GIO_LIBS = @GIO_LIBS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ @@ -281,6 +283,7 @@ INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ @@ -329,8 +332,6 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POFILES = @POFILES@ -POLKIT_CFLAGS = @POLKIT_CFLAGS@ -POLKIT_LIBS = @POLKIT_LIBS@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ diff -Nru accountsservice-0.6.45/src/main.c accountsservice-0.6.50/src/main.c --- accountsservice-0.6.45/src/main.c 2016-09-06 19:31:50.000000000 +0200 +++ accountsservice-0.6.50/src/main.c 2018-04-04 15:59:42.000000000 +0200 @@ -37,8 +37,6 @@ #define NAME_TO_CLAIM "org.freedesktop.Accounts" -static GMainLoop *loop; - static gboolean ensure_directory (const char *path, GError **error) @@ -59,36 +57,28 @@ const gchar *name, gpointer user_data) { + GMainLoop *loop = user_data; Daemon *daemon; - GError *local_error = NULL; - GError **error = &local_error; - - if (!ensure_directory (ICONDIR, error)) { - goto out; - } + g_autoptr(GError) error = NULL; - if (!ensure_directory (USERDIR, error)) { - goto out; + if (!ensure_directory (ICONDIR, &error) || + !ensure_directory (USERDIR, &error)) { + g_printerr ("%s\n", error->message); + g_main_loop_quit (loop); + return; } daemon = daemon_new (); if (daemon == NULL) { - g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, - "Failed to initialize daemon"); - goto out; + g_printerr ("Failed to initialize daemon\n"); + g_main_loop_quit (loop); + return; } openlog ("accounts-daemon", LOG_PID, LOG_DAEMON); syslog (LOG_INFO, "started daemon version %s", VERSION); closelog (); openlog ("accounts-daemon", 0, LOG_AUTHPRIV); - - out: - if (local_error != NULL) { - g_printerr ("%s\n", local_error->message); - g_clear_error (&local_error); - g_main_loop_quit (loop); - } } static void @@ -96,6 +86,8 @@ const gchar *name, gpointer user_data) { + GMainLoop *loop = user_data; + g_debug ("got NameLost, exiting"); g_main_loop_quit (loop); } @@ -108,7 +100,7 @@ const gchar *message, gpointer user_data) { - GString *string; + g_autoptr(GString) string = NULL; const gchar *progname; int ret G_GNUC_UNUSED; @@ -121,8 +113,6 @@ message ? message : "(NULL) message"); ret = write (1, string->str, string->len); - - g_string_free (string, TRUE); } static void @@ -141,17 +131,19 @@ static gboolean on_signal_quit (gpointer data) { - g_main_loop_quit (data); + GMainLoop *loop = data; + + g_main_loop_quit (loop); return FALSE; } int main (int argc, char *argv[]) { - GError *error; - gint ret; + g_autoptr(GMainLoop) loop = NULL; + g_autoptr(GError) error = NULL; GBusNameOwnerFlags flags; - GOptionContext *context; + g_autoptr(GOptionContext) context = NULL; static gboolean replace; static gboolean show_version; static GOptionEntry entries[] = { @@ -162,9 +154,6 @@ { NULL } }; - ret = 1; - error = NULL; - setlocale (LC_ALL, ""); bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); @@ -174,25 +163,21 @@ if (!g_setenv ("GIO_USE_VFS", "local", TRUE)) { g_warning ("Couldn't set GIO_USE_GVFS"); - goto out; + return EXIT_FAILURE; } context = g_option_context_new (""); g_option_context_set_translation_domain (context, GETTEXT_PACKAGE); g_option_context_set_summary (context, _("Provides D-Bus interfaces for querying and manipulating\nuser account information.")); g_option_context_add_main_entries (context, entries, NULL); - error = NULL; if (!g_option_context_parse (context, &argc, &argv, &error)) { g_warning ("%s", error->message); - g_error_free (error); - goto out; + return EXIT_FAILURE; } - g_option_context_free (context); if (show_version) { g_print ("accounts-daemon " VERSION "\n"); - ret = 0; - goto out; + return EXIT_SUCCESS; } /* If --debug, then print debug messages even when no G_MESSAGES_DEBUG */ @@ -200,6 +185,8 @@ g_log_set_handler (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, on_log_debug, NULL); g_log_set_default_handler (log_handler, NULL); + loop = g_main_loop_new (NULL, FALSE); + flags = G_BUS_NAME_OWNER_FLAGS_ALLOW_REPLACEMENT; if (replace) flags |= G_BUS_NAME_OWNER_FLAGS_REPLACE; @@ -209,11 +196,9 @@ on_bus_acquired, NULL, on_name_lost, - NULL, + loop, NULL); - loop = g_main_loop_new (NULL, FALSE); - g_unix_signal_add (SIGINT, on_signal_quit, loop); g_unix_signal_add (SIGTERM, on_signal_quit, loop); @@ -221,11 +206,7 @@ g_main_loop_run (loop); g_debug ("exiting"); - g_main_loop_unref (loop); - - ret = 0; - out: - return ret; + return EXIT_SUCCESS; } diff -Nru accountsservice-0.6.45/src/Makefile.am accountsservice-0.6.50/src/Makefile.am --- accountsservice-0.6.45/src/Makefile.am 2017-03-27 18:50:42.000000000 +0200 +++ accountsservice-0.6.50/src/Makefile.am 2018-04-04 15:59:42.000000000 +0200 @@ -8,7 +8,7 @@ -DUSERDIR=\"$(localstatedir)/lib/AccountsService/users\" \ -I$(srcdir) \ -I$(builddir) \ - $(POLKIT_CFLAGS) \ + $(ACCOUNTS_DAEMON_CFLAGS) \ $(WARN_CFLAGS) noinst_LTLIBRARIES = libaccounts-generated.la @@ -47,7 +47,7 @@ accounts_daemon_LDADD = \ libaccounts-generated.la \ - $(POLKIT_LIBS) + $(ACCOUNTS_DAEMON_LIBS) EXTRA_DIST = \ fgetpwent.c \ diff -Nru accountsservice-0.6.45/src/Makefile.in accountsservice-0.6.50/src/Makefile.in --- accountsservice-0.6.45/src/Makefile.in 2017-03-27 20:33:02.000000000 +0200 +++ accountsservice-0.6.50/src/Makefile.in 2018-07-10 17:25:08.000000000 +0200 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -229,6 +229,8 @@ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" +ACCOUNTS_DAEMON_CFLAGS = @ACCOUNTS_DAEMON_CFLAGS@ +ACCOUNTS_DAEMON_LIBS = @ACCOUNTS_DAEMON_LIBS@ ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ @@ -256,11 +258,11 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ +ELOGIND_CFLAGS = @ELOGIND_CFLAGS@ +ELOGIND_LIBS = @ELOGIND_LIBS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ -GIO_CFLAGS = @GIO_CFLAGS@ -GIO_LIBS = @GIO_LIBS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ @@ -286,6 +288,7 @@ INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ @@ -334,8 +337,6 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POFILES = @POFILES@ -POLKIT_CFLAGS = @POLKIT_CFLAGS@ -POLKIT_LIBS = @POLKIT_LIBS@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ @@ -418,7 +419,7 @@ -DUSERDIR=\"$(localstatedir)/lib/AccountsService/users\" \ -I$(srcdir) \ -I$(builddir) \ - $(POLKIT_CFLAGS) \ + $(ACCOUNTS_DAEMON_CFLAGS) \ $(WARN_CFLAGS) noinst_LTLIBRARIES = libaccounts-generated.la @@ -447,7 +448,7 @@ accounts_daemon_LDADD = \ libaccounts-generated.la \ - $(POLKIT_LIBS) + $(ACCOUNTS_DAEMON_LIBS) EXTRA_DIST = \ fgetpwent.c \ diff -Nru accountsservice-0.6.45/src/user.c accountsservice-0.6.50/src/user.c --- accountsservice-0.6.45/src/user.c 2017-03-27 19:53:21.000000000 +0200 +++ accountsservice-0.6.50/src/user.c 2018-07-10 15:55:52.000000000 +0200 @@ -48,30 +48,6 @@ #include "accounts-user-generated.h" #include "util.h" -enum { - PROP_0, - PROP_UID, - PROP_USER_NAME, - PROP_REAL_NAME, - PROP_ACCOUNT_TYPE, - PROP_HOME_DIR, - PROP_SHELL, - PROP_EMAIL, - PROP_LANGUAGE, - PROP_X_SESSION, - PROP_LOCATION, - PROP_LOGIN_FREQUENCY, - PROP_LOGIN_TIME, - PROP_LOGIN_HISTORY, - PROP_ICON_FILE, - PROP_LOCKED, - PROP_PASSWORD_MODE, - PROP_PASSWORD_HINT, - PROP_AUTOMATIC_LOGIN, - PROP_SYSTEM_ACCOUNT, - PROP_LOCAL_ACCOUNT, -}; - struct User { AccountsUserSkeleton parent; @@ -82,21 +58,7 @@ GKeyFile *keyfile; - uid_t uid; gid_t gid; - gchar *user_name; - gchar *real_name; - AccountType account_type; - PasswordMode password_mode; - gchar *password_hint; - gchar *home_dir; - gchar *shell; - gchar *email; - gchar *language; - gchar *x_session; - gchar *location; - guint64 login_frequency; - gint64 login_time; gint64 expiration_time; gint64 last_change_time; gint64 min_days_between_changes; @@ -106,13 +68,13 @@ GVariant *login_history; gchar *icon_file; gchar *default_icon_file; - gboolean locked; - gboolean automatic_login; - gboolean system_account; - gboolean local_account; + gboolean account_expiration_policy_known; + gboolean cached; guint *extension_ids; guint n_extension_ids; + + guint changed_timeout_id; }; typedef struct UserClass @@ -150,13 +112,38 @@ return ACCOUNT_TYPE_STANDARD; } +static void +user_reset_icon_file (User *user) +{ + const char *icon_file; + gboolean icon_is_default; + const char *home_dir; + + icon_file = accounts_user_get_icon_file (ACCOUNTS_USER (user)); + + if (icon_file == NULL || g_strcmp0 (icon_file, user->default_icon_file) == 0) { + icon_is_default = TRUE; + } else { + icon_is_default = FALSE; + } + + g_free (user->default_icon_file); + home_dir = accounts_user_get_home_directory (ACCOUNTS_USER (user)); + + user->default_icon_file = g_build_filename (home_dir, ".face", NULL); + + if (icon_is_default) { + accounts_user_set_icon_file (ACCOUNTS_USER (user), user->default_icon_file); + } +} + void user_update_from_pwent (User *user, struct passwd *pwent, struct spwd *spent) { - gchar *real_name; - gboolean changed; + g_autofree gchar *real_name = NULL; + gboolean is_system_account; const gchar *passwd; gboolean locked; PasswordMode mode; @@ -164,8 +151,6 @@ g_object_freeze_notify (G_OBJECT (user)); - changed = FALSE; - if (pwent->pw_gecos && pwent->pw_gecos[0] != '\0') { gchar *first_comma = NULL; gchar *valid_utf8_name = NULL; @@ -192,65 +177,26 @@ } if (real_name && real_name[0] == '\0') { - g_free (real_name); - real_name = NULL; + g_clear_pointer (&real_name, g_free); } } else { real_name = NULL; } - if (g_strcmp0 (real_name, user->real_name) != 0) { - g_free (user->real_name); - user->real_name = real_name; - changed = TRUE; - g_object_notify (G_OBJECT (user), "real-name"); - } - else { - g_free (real_name); - } - /* UID */ - if (pwent->pw_uid != user->uid) { - user->uid = pwent->pw_uid; - changed = TRUE; - g_object_notify (G_OBJECT (user), "uid"); - } + accounts_user_set_real_name (ACCOUNTS_USER (user), real_name); + accounts_user_set_uid (ACCOUNTS_USER (user), pwent->pw_uid); - /* GID */ user->gid = pwent->pw_gid; account_type = account_type_from_pwent (pwent); - if (account_type != user->account_type) { - user->account_type = account_type; - changed = TRUE; - g_object_notify (G_OBJECT (user), "account-type"); - } + accounts_user_set_account_type (ACCOUNTS_USER (user), account_type); - /* Username */ - if (g_strcmp0 (user->user_name, pwent->pw_name) != 0) { - g_free (user->user_name); - user->user_name = g_strdup (pwent->pw_name); - changed = TRUE; - g_object_notify (G_OBJECT (user), "user-name"); - } - - /* Home Directory */ - if (g_strcmp0 (user->home_dir, pwent->pw_dir) != 0) { - g_free (user->home_dir); - user->home_dir = g_strdup (pwent->pw_dir); - g_free (user->default_icon_file); - user->default_icon_file = g_build_filename (user->home_dir, ".face", NULL); - changed = TRUE; - g_object_notify (G_OBJECT (user), "home-directory"); - } - - /* Shell */ - if (g_strcmp0 (user->shell, pwent->pw_shell) != 0) { - g_free (user->shell); - user->shell = g_strdup (pwent->pw_shell); - changed = TRUE; - g_object_notify (G_OBJECT (user), "shell"); - } + accounts_user_set_user_name (ACCOUNTS_USER (user), pwent->pw_name); + accounts_user_set_home_directory (ACCOUNTS_USER (user), pwent->pw_dir); + user_reset_icon_file (user); + + accounts_user_set_shell (ACCOUNTS_USER (user), pwent->pw_shell); passwd = NULL; if (spent) @@ -263,11 +209,7 @@ locked = FALSE; } - if (user->locked != locked) { - user->locked = locked; - changed = TRUE; - g_object_notify (G_OBJECT (user), "locked"); - } + accounts_user_set_locked (ACCOUNTS_USER (user), locked); if (passwd == NULL || passwd[0] != 0) { mode = PASSWORD_MODE_REGULAR; @@ -287,20 +229,17 @@ user->max_days_between_changes = spent->sp_max; user->days_to_warn = spent->sp_warn; user->days_after_expiration_until_lock = spent->sp_inact; + user->account_expiration_policy_known = TRUE; } - if (user->password_mode != mode) { - user->password_mode = mode; - changed = TRUE; - g_object_notify (G_OBJECT (user), "password-mode"); - } - - user->system_account = !user_classify_is_human (user->uid, user->user_name, pwent->pw_shell, passwd); + accounts_user_set_password_mode (ACCOUNTS_USER (user), mode); + is_system_account = !user_classify_is_human (accounts_user_get_uid (ACCOUNTS_USER (user)), + accounts_user_get_user_name (ACCOUNTS_USER (user)), + accounts_user_get_shell (ACCOUNTS_USER (user)), + passwd); + accounts_user_set_system_account (ACCOUNTS_USER (user), is_system_account); g_object_thaw_notify (G_OBJECT (user)); - - if (changed) - accounts_user_emit_changed (ACCOUNTS_USER (user)); } void @@ -313,59 +252,50 @@ s = g_key_file_get_string (keyfile, "User", "Language", NULL); if (s != NULL) { - /* TODO: validate / normalize */ - g_free (user->language); - user->language = s; - g_object_notify (G_OBJECT (user), "language"); + accounts_user_set_language (ACCOUNTS_USER (user), s); + g_clear_pointer (&s, g_free); } s = g_key_file_get_string (keyfile, "User", "XSession", NULL); if (s != NULL) { - g_free (user->x_session); - user->x_session = s; - g_object_notify (G_OBJECT (user), "xsession"); + accounts_user_set_xsession (ACCOUNTS_USER (user), s); + g_clear_pointer (&s, g_free); } s = g_key_file_get_string (keyfile, "User", "Email", NULL); if (s != NULL) { - g_free (user->email); - user->email = s; - g_object_notify (G_OBJECT (user), "email"); + accounts_user_set_email (ACCOUNTS_USER (user), s); + g_clear_pointer (&s, g_free); } s = g_key_file_get_string (keyfile, "User", "Location", NULL); if (s != NULL) { - g_free (user->location); - user->location = s; - g_object_notify (G_OBJECT (user), "location"); + accounts_user_set_location (ACCOUNTS_USER (user), s); + g_clear_pointer (&s, g_free); } s = g_key_file_get_string (keyfile, "User", "PasswordHint", NULL); if (s != NULL) { - g_free (user->password_hint); - user->password_hint = s; - g_object_notify (G_OBJECT (user), "password-hint"); + accounts_user_set_password_hint (ACCOUNTS_USER (user), s); + g_clear_pointer (&s, g_free); } s = g_key_file_get_string (keyfile, "User", "Icon", NULL); if (s != NULL) { - g_free (user->icon_file); - user->icon_file = s; - g_object_notify (G_OBJECT (user), "icon-file"); + accounts_user_set_icon_file (ACCOUNTS_USER (user), s); + g_clear_pointer (&s, g_free); } if (g_key_file_has_key (keyfile, "User", "SystemAccount", NULL)) { gboolean system_account; system_account = g_key_file_get_boolean (keyfile, "User", "SystemAccount", NULL); - if (system_account != user->system_account) { - user->system_account = system_account; - g_object_notify (G_OBJECT (user), "system-account"); - } + accounts_user_set_system_account (ACCOUNTS_USER (user), system_account); } g_clear_pointer (&user->keyfile, g_key_file_unref); user->keyfile = g_key_file_ref (keyfile); + user_set_cached (user, TRUE); g_object_thaw_notify (G_OBJECT (user)); } @@ -374,20 +304,14 @@ user_update_local_account_property (User *user, gboolean local) { - if (local == user->local_account) - return; - user->local_account = local; - g_object_notify (G_OBJECT (user), "local-account"); + accounts_user_set_local_account (ACCOUNTS_USER (user), local); } void user_update_system_account_property (User *user, gboolean system) { - if (system == user->system_account) - return; - user->system_account = system; - g_object_notify (G_OBJECT (user), "system-account"); + accounts_user_set_system_account (ACCOUNTS_USER (user), system); } static void @@ -396,59 +320,57 @@ { g_key_file_remove_group (keyfile, "User", NULL); - if (user->email) - g_key_file_set_string (keyfile, "User", "Email", user->email); + if (accounts_user_get_email (ACCOUNTS_USER (user))) + g_key_file_set_string (keyfile, "User", "Email", accounts_user_get_email (ACCOUNTS_USER (user))); + + if (accounts_user_get_language (ACCOUNTS_USER (user))) + g_key_file_set_string (keyfile, "User", "Language", accounts_user_get_language (ACCOUNTS_USER (user))); - if (user->language) - g_key_file_set_string (keyfile, "User", "Language", user->language); + if (accounts_user_get_xsession (ACCOUNTS_USER (user))) + g_key_file_set_string (keyfile, "User", "XSession", accounts_user_get_xsession (ACCOUNTS_USER (user))); - if (user->x_session) - g_key_file_set_string (keyfile, "User", "XSession", user->x_session); + if (accounts_user_get_location (ACCOUNTS_USER (user))) + g_key_file_set_string (keyfile, "User", "Location", accounts_user_get_location (ACCOUNTS_USER (user))); - if (user->location) - g_key_file_set_string (keyfile, "User", "Location", user->location); + if (accounts_user_get_password_hint (ACCOUNTS_USER (user))) + g_key_file_set_string (keyfile, "User", "PasswordHint", accounts_user_get_password_hint (ACCOUNTS_USER (user))); - if (user->password_hint) - g_key_file_set_string (keyfile, "User", "PasswordHint", user->password_hint); + if (accounts_user_get_icon_file (ACCOUNTS_USER (user))) + g_key_file_set_string (keyfile, "User", "Icon", accounts_user_get_icon_file (ACCOUNTS_USER (user))); - if (user->icon_file) - g_key_file_set_string (keyfile, "User", "Icon", user->icon_file); + g_key_file_set_boolean (keyfile, "User", "SystemAccount", accounts_user_get_system_account (ACCOUNTS_USER (user))); - g_key_file_set_boolean (keyfile, "User", "SystemAccount", user->system_account); + user_set_cached (user, TRUE); } static void save_extra_data (User *user) { - gchar *filename; - gchar *data; - GError *error; + g_autofree gchar *data = NULL; + g_autofree gchar *filename = NULL; + g_autoptr(GError) error = NULL; user_save_to_keyfile (user, user->keyfile); - error = NULL; data = g_key_file_to_data (user->keyfile, NULL, &error); - if (error == NULL) { - filename = g_build_filename (USERDIR, - user->user_name, - NULL); - g_file_set_contents (filename, data, -1, &error); - g_free (filename); - g_free (data); - } - if (error) { + if (data == NULL) { g_warning ("Saving data for user %s failed: %s", - user->user_name, error->message); - g_error_free (error); + accounts_user_get_user_name (ACCOUNTS_USER (user)), error->message); + return; } + + filename = g_build_filename (USERDIR, + accounts_user_get_user_name (ACCOUNTS_USER (user)), + NULL); + g_file_set_contents (filename, data, -1, &error); } static void move_extra_data (const gchar *old_name, const gchar *new_name) { - gchar *old_filename; - gchar *new_filename; + g_autofree gchar *old_filename = NULL; + g_autofree gchar *new_filename = NULL; old_filename = g_build_filename (USERDIR, old_name, NULL); @@ -456,9 +378,6 @@ new_name, NULL); g_rename (old_filename, new_filename); - - g_free (old_filename); - g_free (new_filename); } static GVariant * @@ -468,15 +387,13 @@ { const GVariantType *type = G_VARIANT_TYPE (property->signature); GVariant *value; - gchar *printed; + g_autofree gchar *printed = NULL; gint i; /* First, try to get the value from the keyfile */ printed = g_key_file_get_value (user->keyfile, interface->name, property->name, NULL); if (printed) { value = g_variant_parse (type, printed, NULL, NULL, NULL); - g_free (printed); - if (value != NULL) return value; } @@ -507,13 +424,12 @@ GDBusMethodInvocation *invocation) { const GDBusPropertyInfo *property = g_dbus_method_invocation_get_property_info (invocation); - GVariant *value; + g_autoptr(GVariant) value = NULL; value = user_extension_get_value (user, interface, property); if (value) { g_dbus_method_invocation_return_value (invocation, g_variant_new ("(v)", value)); - g_variant_unref (value); } else { g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, @@ -534,14 +450,12 @@ g_variant_builder_init (&builder, G_VARIANT_TYPE_VARDICT); for (i = 0; interface->properties && interface->properties[i]; i++) { GDBusPropertyInfo *property = interface->properties[i]; - GVariant *value; + g_autoptr(GVariant) value = NULL; value = user_extension_get_value (user, interface, property); - if (value) { + if (value) g_variant_builder_add (&builder, "{sv}", property->name, value); - g_variant_unref (value); - } } g_dbus_method_invocation_return_value (invocation, g_variant_new ("(a{sv})", &builder)); @@ -554,9 +468,9 @@ GDBusMethodInvocation *invocation) { const GDBusPropertyInfo *property = g_dbus_method_invocation_get_property_info (invocation); - GVariant *value; - gchar *printed; - gchar *prev; + g_autoptr(GVariant) value = NULL; + g_autofree gchar *printed = NULL; + g_autofree gchar *prev = NULL; g_variant_get_child (g_dbus_method_invocation_get_parameters (invocation), 2, "v", &value); @@ -586,10 +500,6 @@ save_extra_data (user); } - g_variant_unref (value); - g_free (printed); - g_free (prev); - g_dbus_method_invocation_return_value (invocation, g_variant_new ("()")); } @@ -639,7 +549,7 @@ /* Now get the real interface name */ g_variant_get_child (parameters, 0, "&s", &interface_name); - if (get_caller_uid (invocation, &uid) && (uid_t) uid == user->uid) { + if (get_caller_uid (invocation, &uid) && (uid_t) uid == accounts_user_get_uid (ACCOUNTS_USER (user))) { /* Operation on sender's own User object */ if (g_str_equal (method_name, "Set")) { annotation_name = "org.freedesktop.Accounts.Authentication.ChangeOwn"; @@ -710,7 +620,7 @@ */ while (g_hash_table_iter_next (&iter, NULL, &iface)) user->extension_ids[i++] = g_dbus_connection_register_object (user->system_bus_connection, - user->object_path, iface, + g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (user)), iface, &vtable, user, NULL, NULL); } @@ -720,39 +630,56 @@ gchar *object_path; object_path = g_strdup_printf ("/org/freedesktop/Accounts/User%lu", - (gulong) user->uid); + (gulong) accounts_user_get_uid (ACCOUNTS_USER (user))); return object_path; } +static gboolean +on_user_changed_timeout (User *user) +{ + user->changed_timeout_id = 0; + accounts_user_emit_changed (ACCOUNTS_USER (user)); + + return G_SOURCE_REMOVE; +} + +static void +on_user_property_notify (User *user) +{ + if (user->changed_timeout_id != 0) + return; + + user->changed_timeout_id = g_timeout_add (250, (GSourceFunc) on_user_changed_timeout, user); +} + void user_register (User *user) { - GError *error = NULL; + g_autoptr(GError) error = NULL; + g_autofree gchar *object_path = NULL; user->system_bus_connection = g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, &error); if (user->system_bus_connection == NULL) { - if (error != NULL) { + if (error != NULL) g_critical ("error getting system bus: %s", error->message); - g_error_free (error); - } return; } - user->object_path = compute_object_path (user); + object_path = compute_object_path (user); if (!g_dbus_interface_skeleton_export (G_DBUS_INTERFACE_SKELETON (user), user->system_bus_connection, - user->object_path, + object_path, &error)) { - if (error != NULL) { + if (error != NULL) g_critical ("error exporting user object: %s", error->message); - g_error_free (error); - } return; } user_register_extensions (user); + + g_signal_connect (G_OBJECT (user), "notify", G_CALLBACK (on_user_property_notify), NULL); } void @@ -764,6 +691,8 @@ void user_unregister (User *user) { + g_signal_handlers_disconnect_by_func (G_OBJECT (user), G_CALLBACK (on_user_property_notify), NULL); + g_dbus_interface_skeleton_unexport (G_DBUS_INTERFACE_SKELETON (user)); if (user->extension_ids) { @@ -796,7 +725,7 @@ user = g_object_new (TYPE_USER, NULL); user->daemon = daemon; - user->uid = uid; + accounts_user_set_uid (ACCOUNTS_USER (user), uid); return user; } @@ -804,37 +733,50 @@ const gchar * user_get_user_name (User *user) { - return user->user_name; + return accounts_user_get_user_name (ACCOUNTS_USER (user)); } gboolean user_get_system_account (User *user) { - return user->system_account; + return accounts_user_get_system_account (ACCOUNTS_USER (user)); } gboolean user_get_local_account (User *user) { - return user->local_account; + return accounts_user_get_local_account (ACCOUNTS_USER (user));; } const gchar * user_get_object_path (User *user) { - return user->object_path; + return g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (user)); } uid_t user_get_uid (User *user) { - return user->uid; + return accounts_user_get_uid (ACCOUNTS_USER (user)); } const gchar * user_get_shell(User *user) { - return user->shell; + return accounts_user_get_shell (ACCOUNTS_USER (user)); +} + +gboolean +user_get_cached (User *user) +{ + return user->cached; +} + +void +user_set_cached (User *user, + gboolean cached) +{ + user->cached = cached; } static void @@ -844,15 +786,13 @@ ...) { va_list args; - gchar *message; + g_autofree gchar *message = NULL; va_start (args, format); message = g_strdup_vprintf (format, args); va_end (args); g_dbus_method_invocation_return_error (context, ERROR, error_code, "%s", message); - - g_free (message); } static void @@ -863,34 +803,29 @@ { gchar *name = data; - GError *error; + g_autoptr(GError) error = NULL; const gchar *argv[6]; - if (g_strcmp0 (user->real_name, name) != 0) { + if (g_strcmp0 (accounts_user_get_real_name (ACCOUNTS_USER (user)), name) != 0) { sys_log (context, "change real name of user '%s' (%d) to '%s'", - user->user_name, user->uid, name); + accounts_user_get_user_name (ACCOUNTS_USER (user)), + 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[5] = NULL; - error = NULL; if (!spawn_with_login_uid (context, argv, &error)) { throw_error (context, ERROR_FAILED, "running '%s' failed: %s", argv[0], error->message); - g_error_free (error); return; } - g_free (user->real_name); - user->real_name = g_strdup (name); - - accounts_user_emit_changed (ACCOUNTS_USER (user)); - - g_object_notify (G_OBJECT (user), "real-name"); + accounts_user_set_real_name (ACCOUNTS_USER (user), name); } accounts_user_complete_set_real_name (ACCOUNTS_USER (user), context); @@ -910,7 +845,7 @@ return FALSE; } - if (user->uid == (uid_t) uid) + if (accounts_user_get_uid (ACCOUNTS_USER (user)) == (uid_t) uid) action_id = "org.freedesktop.accounts.change-own-user-data"; else action_id = "org.freedesktop.accounts.user-administration"; @@ -936,37 +871,32 @@ { gchar *name = data; gchar *old_name; - GError *error; + g_autoptr(GError) error = NULL; const gchar *argv[6]; - if (g_strcmp0 (user->user_name, name) != 0) { - old_name = g_strdup (user->user_name); + if (g_strcmp0 (accounts_user_get_user_name (ACCOUNTS_USER (user)), name) != 0) { + old_name = g_strdup (accounts_user_get_user_name (ACCOUNTS_USER (user))); sys_log (context, "change name of user '%s' (%d) to '%s'", - old_name, user->uid, name); + old_name, + 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[5] = NULL; - error = NULL; if (!spawn_with_login_uid (context, argv, &error)) { throw_error (context, ERROR_FAILED, "running '%s' failed: %s", argv[0], error->message); - g_error_free (error); return; } - g_free (user->user_name); - user->user_name = g_strdup (name); + accounts_user_set_user_name (ACCOUNTS_USER (user), name); move_extra_data (old_name, name); - - accounts_user_emit_changed (ACCOUNTS_USER (user)); - - g_object_notify (G_OBJECT (user), "user-name"); } accounts_user_complete_set_user_name (ACCOUNTS_USER (user), context); @@ -1000,15 +930,10 @@ { gchar *email = data; - if (g_strcmp0 (user->email, email) != 0) { - g_free (user->email); - user->email = g_strdup (email); + if (g_strcmp0 (accounts_user_get_email (ACCOUNTS_USER (user)), email) != 0) { + accounts_user_set_email (ACCOUNTS_USER (user), email); save_extra_data (user); - - accounts_user_emit_changed (ACCOUNTS_USER (user)); - - g_object_notify (G_OBJECT (user), "email"); } accounts_user_complete_set_email (ACCOUNTS_USER (user), context); @@ -1030,7 +955,7 @@ return FALSE; } - if (user->uid == (uid_t) uid) + if (accounts_user_get_uid (ACCOUNTS_USER (user)) == (uid_t) uid) action_id = "org.freedesktop.accounts.change-own-user-data"; else action_id = "org.freedesktop.accounts.user-administration"; @@ -1056,15 +981,10 @@ { gchar *language = data; - if (g_strcmp0 (user->language, language) != 0) { - g_free (user->language); - user->language = g_strdup (language); + if (g_strcmp0 (accounts_user_get_language (ACCOUNTS_USER (user)), language) != 0) { + accounts_user_set_language (ACCOUNTS_USER (user), language); save_extra_data (user); - - accounts_user_emit_changed (ACCOUNTS_USER (user)); - - g_object_notify (G_OBJECT (user), "language"); } accounts_user_complete_set_language (ACCOUNTS_USER (user), context); @@ -1086,7 +1006,7 @@ return FALSE; } - if (user->uid == (uid_t) uid) + if (accounts_user_get_uid (ACCOUNTS_USER (user)) == (uid_t) uid) action_id = "org.freedesktop.accounts.change-own-user-data"; else action_id = "org.freedesktop.accounts.user-administration"; @@ -1112,15 +1032,10 @@ { gchar *x_session = data; - if (g_strcmp0 (user->x_session, x_session) != 0) { - g_free (user->x_session); - user->x_session = g_strdup (x_session); + if (g_strcmp0 (accounts_user_get_xsession (ACCOUNTS_USER (user)), x_session) != 0) { + accounts_user_set_xsession (ACCOUNTS_USER (user), x_session); save_extra_data (user); - - accounts_user_emit_changed (ACCOUNTS_USER (user)); - - g_object_notify (G_OBJECT (user), "xsession"); } accounts_user_complete_set_xsession (ACCOUNTS_USER (user), context); @@ -1140,7 +1055,7 @@ return FALSE; } - if (user->uid == (uid_t) uid) + if (accounts_user_get_uid (ACCOUNTS_USER (user)) == (uid_t) uid) action_id = "org.freedesktop.accounts.change-own-user-data"; else action_id = "org.freedesktop.accounts.user-administration"; @@ -1164,6 +1079,11 @@ gpointer data) { + if (!user->account_expiration_policy_known) { + throw_error (context, ERROR_NOT_SUPPORTED, "account expiration policy unknown to accounts service"); + return; + } + accounts_user_complete_get_password_expiration_policy (ACCOUNTS_USER (user), context, user->expiration_time, @@ -1187,7 +1107,7 @@ return FALSE; } - if (user->uid == (uid_t) uid) + if (accounts_user_get_uid (ACCOUNTS_USER (user)) == (uid_t) uid) action_id = "org.freedesktop.accounts.change-own-user-data"; else action_id = "org.freedesktop.accounts.user-administration"; @@ -1214,15 +1134,10 @@ { gchar *location = data; - if (g_strcmp0 (user->location, location) != 0) { - g_free (user->location); - user->location = g_strdup (location); + if (g_strcmp0 (accounts_user_get_location (ACCOUNTS_USER (user)), location) != 0) { + accounts_user_set_location (ACCOUNTS_USER (user), location); save_extra_data (user); - - accounts_user_emit_changed (ACCOUNTS_USER (user)); - - g_object_notify (G_OBJECT (user), "location"); } accounts_user_complete_set_location (ACCOUNTS_USER (user), context); @@ -1242,7 +1157,7 @@ return FALSE; } - if (user->uid == (uid_t) uid) + if (accounts_user_get_uid (ACCOUNTS_USER (user)) == (uid_t) uid) action_id = "org.freedesktop.accounts.change-own-user-data"; else action_id = "org.freedesktop.accounts.user-administration"; @@ -1267,37 +1182,32 @@ { gchar *home_dir = data; - GError *error; + g_autoptr(GError) error = NULL; const gchar *argv[7]; - if (g_strcmp0 (user->home_dir, home_dir) != 0) { + if (g_strcmp0 (accounts_user_get_home_directory (ACCOUNTS_USER (user)), home_dir) != 0) { sys_log (context, "change home directory of user '%s' (%d) to '%s'", - user->user_name, user->uid, home_dir); + accounts_user_get_user_name (ACCOUNTS_USER (user)), + 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; - error = NULL; if (!spawn_with_login_uid (context, argv, &error)) { throw_error (context, ERROR_FAILED, "running '%s' failed: %s", argv[0], error->message); - g_error_free (error); return; } - g_free (user->home_dir); - user->home_dir = g_strdup (home_dir); - g_free (user->default_icon_file); - user->default_icon_file = g_build_filename (user->home_dir, ".face", NULL); - - accounts_user_emit_changed (ACCOUNTS_USER (user)); + accounts_user_set_home_directory (ACCOUNTS_USER (user), home_dir); - g_object_notify (G_OBJECT (user), "home-directory"); + user_reset_icon_file (user); } accounts_user_complete_set_home_directory (ACCOUNTS_USER (user), context); @@ -1329,34 +1239,29 @@ { gchar *shell = data; - GError *error; + g_autoptr(GError) error = NULL; const gchar *argv[6]; - if (g_strcmp0 (user->shell, shell) != 0) { + if (g_strcmp0 (accounts_user_get_shell (ACCOUNTS_USER (user)), shell) != 0) { sys_log (context, "change shell of user '%s' (%d) to '%s'", - user->user_name, user->uid, shell); + accounts_user_get_user_name (ACCOUNTS_USER (user)), + 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[5] = NULL; - error = NULL; if (!spawn_with_login_uid (context, argv, &error)) { throw_error (context, ERROR_FAILED, "running '%s' failed: %s", argv[0], error->message); - g_error_free (error); return; } - g_free (user->shell); - user->shell = g_strdup (shell); - - accounts_user_emit_changed (ACCOUNTS_USER (user)); - - g_object_notify (G_OBJECT (user), "shell"); + accounts_user_set_shell (ACCOUNTS_USER (user), shell); } accounts_user_complete_set_shell (ACCOUNTS_USER (user), context); @@ -1400,9 +1305,9 @@ gpointer data) { - gchar *filename; - GFile *file; - GFileInfo *info; + g_autofree gchar *filename = NULL; + g_autoptr(GFile) file = NULL; + g_autoptr(GFileInfo) info = NULL; guint32 mode; GFileType type; guint64 size; @@ -1411,30 +1316,32 @@ if (filename == NULL || *filename == '\0') { - char *dest_path; - GFile *dest; - GError *error; + g_autofree gchar *dest_path = NULL; + g_autoptr(GFile) dest = NULL; + g_autoptr(GError) error = NULL; - g_free (filename); - filename = NULL; + g_clear_pointer (&filename, g_free); - dest_path = g_build_filename (ICONDIR, user->user_name, NULL); + dest_path = g_build_filename (ICONDIR, accounts_user_get_user_name (ACCOUNTS_USER (user)), NULL); dest = g_file_new_for_path (dest_path); - g_free (dest_path); - error = NULL; if (!g_file_delete (dest, NULL, &error) && !g_error_matches (error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND)) { - g_object_unref (dest); throw_error (context, ERROR_FAILED, "failed to remove user icon, %s", error->message); - g_error_free (error); return; } - g_object_unref (dest); goto icon_saved; } file = g_file_new_for_path (filename); + g_clear_pointer (&filename, g_free); + + /* Canonicalize path so we can call g_str_has_prefix on it + * below without concern for ../ path components moving outside + * the prefix + */ + filename = g_file_get_path (file); + info = g_file_query_info (file, G_FILE_ATTRIBUTE_UNIX_MODE "," G_FILE_ATTRIBUTE_STANDARD_TYPE "," G_FILE_ATTRIBUTE_STANDARD_SIZE, @@ -1443,13 +1350,9 @@ type = g_file_info_get_file_type (info); size = g_file_info_get_attribute_uint64 (info, G_FILE_ATTRIBUTE_STANDARD_SIZE); - g_object_unref (info); - g_object_unref (file); - if (type != G_FILE_TYPE_REGULAR) { g_debug ("not a regular file"); throw_error (context, ERROR_FAILED, "file '%s' is not a regular file", filename); - g_free (filename); return; } @@ -1457,41 +1360,34 @@ g_debug ("file too large"); /* 1MB ought to be enough for everybody */ throw_error (context, ERROR_FAILED, "file '%s' is too large to be used as an icon", filename); - g_free (filename); return; } if ((mode & S_IROTH) == 0 || (!g_str_has_prefix (filename, DATADIR) && !g_str_has_prefix (filename, ICONDIR))) { - gchar *dest_path; - GFile *dest; + g_autofree gchar *dest_path = NULL; + g_autoptr(GFile) dest = NULL; const gchar *argv[3]; gint std_out; - GError *error; - GInputStream *input; - GOutputStream *output; + g_autoptr(GError) error = NULL; + g_autoptr(GInputStream) input = NULL; + g_autoptr(GOutputStream) output = NULL; gint uid; gssize bytes; struct passwd *pw; if (!get_caller_uid (context, &uid)) { throw_error (context, ERROR_FAILED, "failed to copy file, could not determine caller UID"); - g_free (filename); return; } - dest_path = g_build_filename (ICONDIR, user->user_name, NULL); + dest_path = g_build_filename (ICONDIR, accounts_user_get_user_name (ACCOUNTS_USER (user)), NULL); dest = g_file_new_for_path (dest_path); - error = NULL; output = G_OUTPUT_STREAM (g_file_replace (dest, NULL, FALSE, 0, NULL, &error)); if (!output) { throw_error (context, ERROR_FAILED, "creating file '%s' failed: %s", dest_path, error->message); - g_error_free (error); - g_free (filename); - g_free (dest_path); - g_object_unref (dest); return; } @@ -1501,53 +1397,30 @@ pw = getpwuid (uid); - error = NULL; if (!g_spawn_async_with_pipes (NULL, (gchar**)argv, NULL, 0, become_user, pw, NULL, NULL, &std_out, NULL, &error)) { throw_error (context, ERROR_FAILED, "reading file '%s' failed: %s", filename, error->message); - g_error_free (error); - g_free (filename); - g_free (dest_path); - g_object_unref (dest); return; } input = g_unix_input_stream_new (std_out, FALSE); - error = NULL; bytes = g_output_stream_splice (output, input, G_OUTPUT_STREAM_SPLICE_CLOSE_TARGET, NULL, &error); if (bytes < 0 || (gsize)bytes != size) { throw_error (context, ERROR_FAILED, "copying file '%s' to '%s' failed: %s", filename, dest_path, error ? error->message : "unknown reason"); - if (error) - g_error_free (error); - g_file_delete (dest, NULL, NULL); - - g_free (filename); - g_free (dest_path); - g_object_unref (dest); - g_object_unref (input); - g_object_unref (output); return; } - g_object_unref (dest); - g_object_unref (input); - g_object_unref (output); - g_free (filename); - filename = dest_path; + filename = g_steal_pointer (&dest_path); } icon_saved: - g_free (user->icon_file); - user->icon_file = filename; + accounts_user_set_icon_file (ACCOUNTS_USER (user), filename); + g_clear_pointer (&filename, g_free); save_extra_data (user); - accounts_user_emit_changed (ACCOUNTS_USER (user)); - - g_object_notify (G_OBJECT (user), "icon-file"); - accounts_user_complete_set_icon_file (ACCOUNTS_USER (user), context); } @@ -1565,7 +1438,7 @@ return FALSE; } - if (user->uid == (uid_t) uid) + if (accounts_user_get_uid (ACCOUNTS_USER (user)) == (uid_t) uid) action_id = "org.freedesktop.accounts.change-own-user-data"; else action_id = "org.freedesktop.accounts.user-administration"; @@ -1590,33 +1463,33 @@ { gboolean locked = GPOINTER_TO_INT (data); - GError *error; + g_autoptr(GError) error = NULL; const gchar *argv[5]; - if (user->locked != locked) { + 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); + 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; - error = NULL; if (!spawn_with_login_uid (context, argv, &error)) { throw_error (context, ERROR_FAILED, "running '%s' failed: %s", argv[0], error->message); - g_error_free (error); return; } - user->locked = locked; + accounts_user_set_locked (ACCOUNTS_USER (user), locked); - if (user->automatic_login) { + if (accounts_user_get_automatic_login (ACCOUNTS_USER (user))) { User *automatic_login_user; automatic_login_user = daemon_local_get_automatic_login_user (daemon); - if (user->locked) { + if (accounts_user_get_locked (ACCOUNTS_USER (user))) { /* If automatic login is enabled for the user then * disable it in the config file, but keep the state * attached to the user unharmed so it can be restored @@ -1624,11 +1497,11 @@ */ if (user == automatic_login_user) { daemon_local_set_automatic_login (daemon, user, FALSE, NULL); - user->automatic_login = TRUE; + accounts_user_set_automatic_login (ACCOUNTS_USER (user), TRUE); } } else { if (automatic_login_user == NULL) { - user->automatic_login = FALSE; + accounts_user_set_automatic_login (ACCOUNTS_USER (user), FALSE); daemon_local_set_automatic_login (daemon, user, TRUE, NULL); } } @@ -1668,38 +1541,52 @@ { AccountType account_type = GPOINTER_TO_INT (data); - GError *error; + g_autoptr(GError) error = NULL; gid_t *groups; gint ngroups; - GString *str; - gid_t wheel; + g_autoptr(GString) str = NULL; + g_auto(GStrv) extra_admin_groups = NULL; + gid_t admin_gid; struct group *grp; gint i; const gchar *argv[6]; - if (user->account_type != account_type) { + if (((AccountType) accounts_user_get_account_type (ACCOUNTS_USER (user))) != account_type) { sys_log (context, "change account type of user '%s' (%d) to %d", - user->user_name, user->uid, account_type); + accounts_user_get_user_name (ACCOUNTS_USER (user)), + accounts_user_get_uid (ACCOUNTS_USER (user)), + account_type); grp = getgrnam (ADMIN_GROUP); if (grp == NULL) { - throw_error (context, ERROR_FAILED, "failed to set account type: wheel group not found"); + throw_error (context, ERROR_FAILED, "failed to set account type: " ADMIN_GROUP " group not found"); return; } - wheel = grp->gr_gid; + admin_gid = grp->gr_gid; - ngroups = get_user_groups (user->user_name, user->gid, &groups); + ngroups = get_user_groups (accounts_user_get_user_name (ACCOUNTS_USER (user)), user->gid, &groups); str = g_string_new (""); for (i = 0; i < ngroups; i++) { - if (groups[i] == wheel) + if (groups[i] == admin_gid) continue; g_string_append_printf (str, "%d,", groups[i]); } switch (account_type) { case ACCOUNT_TYPE_ADMINISTRATOR: - g_string_append_printf (str, "%d", wheel); + extra_admin_groups = g_strsplit (EXTRA_ADMIN_GROUPS, ",", 0); + + for (i = 0; extra_admin_groups[i] != NULL; i++) { + struct group *extra_group; + extra_group = getgrnam (extra_admin_groups[i]); + if (extra_group == NULL || extra_group->gr_gid == admin_gid) + continue; + + g_string_append_printf (str, "%d,", extra_group->gr_gid); + } + + g_string_append_printf (str, "%d", admin_gid); break; case ACCOUNT_TYPE_STANDARD: default: @@ -1714,19 +1601,15 @@ 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[5] = NULL; - g_string_free (str, FALSE); - - error = NULL; if (!spawn_with_login_uid (context, argv, &error)) { throw_error (context, ERROR_FAILED, "running '%s' failed: %s", argv[0], error->message); - g_error_free (error); return; } - user->account_type = account_type; + accounts_user_set_account_type (ACCOUNTS_USER (user), account_type); accounts_user_emit_changed (ACCOUNTS_USER (user)); @@ -1767,13 +1650,15 @@ { PasswordMode mode = GPOINTER_TO_INT (data); - GError *error; + g_autoptr(GError) error = NULL; const gchar *argv[6]; - if (user->password_mode != mode) { + if (((PasswordMode) accounts_user_get_password_mode (ACCOUNTS_USER (user))) != mode) { sys_log (context, "change password mode of user '%s' (%d) to %d", - user->user_name, user->uid, mode); + accounts_user_get_user_name (ACCOUNTS_USER (user)), + accounts_user_get_uid (ACCOUNTS_USER (user)), + mode); g_object_freeze_notify (G_OBJECT (user)); @@ -1783,13 +1668,11 @@ 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; - error = NULL; if (!spawn_with_login_uid (context, argv, &error)) { throw_error (context, ERROR_FAILED, "running '%s' failed: %s", argv[0], error->message); - g_error_free (error); return; } @@ -1798,57 +1681,42 @@ argv[1] = "-d"; argv[2] = "0"; argv[3] = "--"; - 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)) { throw_error (context, ERROR_FAILED, "running '%s' failed: %s", argv[0], error->message); - g_error_free (error); return; } } - g_free (user->password_hint); - user->password_hint = NULL; - - g_object_notify (G_OBJECT (user), "password-hint"); + accounts_user_set_password_hint (ACCOUNTS_USER (user), NULL); /* removing the password has the side-effect of * unlocking the account */ - if (user->locked) { - user->locked = FALSE; - g_object_notify (G_OBJECT (user), "locked"); - } + 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; - error = NULL; if (!spawn_with_login_uid (context, argv, &error)) { throw_error (context, ERROR_FAILED, "running '%s' failed: %s", argv[0], error->message); - g_error_free (error); return; } - user->locked = FALSE; - g_object_notify (G_OBJECT (user), "locked"); + accounts_user_set_locked (ACCOUNTS_USER (user), FALSE); } - user->password_mode = mode; - - g_object_notify (G_OBJECT (user), "password-mode"); + accounts_user_set_password_mode (ACCOUNTS_USER (user), mode); save_extra_data (user); g_object_thaw_notify (G_OBJECT (user)); - - accounts_user_emit_changed (ACCOUNTS_USER (user)); } accounts_user_complete_set_password_mode (ACCOUNTS_USER (user), context); @@ -1861,13 +1729,22 @@ { User *user = (User*)auser; const gchar *action_id; + gint uid; if (mode < 0 || mode > PASSWORD_MODE_LAST) { throw_error (context, ERROR_FAILED, "unknown password mode: %d", mode); return FALSE; } - action_id = "org.freedesktop.accounts.user-administration"; + if (!get_caller_uid (context, &uid)) { + throw_error (context, ERROR_FAILED, "identifying caller failed"); + return FALSE; + } + + if (accounts_user_get_uid (ACCOUNTS_USER (user)) == (uid_t) uid) + action_id = "org.freedesktop.accounts.change-own-password"; + else + action_id = "org.freedesktop.accounts.user-administration"; daemon_local_check_auth (user->daemon, user, @@ -1889,12 +1766,13 @@ { gchar **strings = data; - GError *error; + g_autoptr(GError) error = NULL; const gchar *argv[6]; sys_log (context, "set password and hint of user '%s' (%d)", - user->user_name, user->uid); + accounts_user_get_user_name (ACCOUNTS_USER (user)), + accounts_user_get_uid (ACCOUNTS_USER (user))); g_object_freeze_notify (G_OBJECT (user)); @@ -1902,38 +1780,22 @@ 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; - error = NULL; if (!spawn_with_login_uid (context, argv, &error)) { throw_error (context, ERROR_FAILED, "running '%s' failed: %s", argv[0], error->message); - g_error_free (error); return; } - if (user->password_mode != PASSWORD_MODE_REGULAR) { - user->password_mode = PASSWORD_MODE_REGULAR; - g_object_notify (G_OBJECT (user), "password-mode"); - } - - if (user->locked) { - user->locked = FALSE; - g_object_notify (G_OBJECT (user), "locked"); - } - - if (g_strcmp0 (user->password_hint, strings[1]) != 0) { - g_free (user->password_hint); - user->password_hint = g_strdup (strings[1]); - g_object_notify (G_OBJECT (user), "password-hint"); - } + accounts_user_set_password_mode (ACCOUNTS_USER (user), PASSWORD_MODE_REGULAR); + accounts_user_set_locked (ACCOUNTS_USER (user), FALSE); + accounts_user_set_password_hint (ACCOUNTS_USER (user), strings[1]); save_extra_data (user); g_object_thaw_notify (G_OBJECT (user)); - accounts_user_emit_changed (ACCOUNTS_USER (user)); - accounts_user_complete_set_password (ACCOUNTS_USER (user), context); } @@ -1952,15 +1814,27 @@ { User *user = (User*)auser; gchar **data; + const gchar *action_id; + gint uid; + + if (!get_caller_uid (context, &uid)) { + throw_error (context, ERROR_FAILED, "identifying caller failed"); + return FALSE; + } data = g_new (gchar *, 3); data[0] = g_strdup (password); data[1] = g_strdup (hint); data[2] = NULL; + if (accounts_user_get_uid (ACCOUNTS_USER (user)) == (uid_t) uid) + action_id = "org.freedesktop.accounts.change-own-password"; + else + action_id = "org.freedesktop.accounts.user-administration"; + daemon_local_check_auth (user->daemon, user, - "org.freedesktop.accounts.user-administration", + action_id, TRUE, user_change_password_authorized_cb, context, @@ -1982,17 +1856,13 @@ sys_log (context, "set password hint of user '%s' (%d)'", - user->user_name, user->uid); + accounts_user_get_user_name (ACCOUNTS_USER (user)), + accounts_user_get_uid (ACCOUNTS_USER (user))); - if (g_strcmp0 (user->password_hint, hint) != 0) { - g_free (user->password_hint); - user->password_hint = g_strdup (hint); + if (g_strcmp0 (accounts_user_get_password_hint (ACCOUNTS_USER (user)), hint) != 0) { + accounts_user_set_password_hint (ACCOUNTS_USER (user), hint); save_extra_data (user); - - accounts_user_emit_changed (ACCOUNTS_USER (user)); - - g_object_notify (G_OBJECT (user), "password-hint"); } accounts_user_complete_set_password_hint (ACCOUNTS_USER (user), context); @@ -2012,7 +1882,7 @@ return FALSE; } - if (user->uid == (uid_t) uid) + if (accounts_user_get_uid (ACCOUNTS_USER (user)) == (uid_t) uid) action_id = "org.freedesktop.accounts.change-own-user-data"; else action_id = "org.freedesktop.accounts.user-administration"; @@ -2036,20 +1906,21 @@ gpointer data) { gboolean enabled = GPOINTER_TO_INT (data); - GError *error = NULL; + g_autoptr(GError) error = NULL; sys_log (context, "%s automatic login for user '%s' (%d)", - enabled ? "enable" : "disable", user->user_name, user->uid); + enabled ? "enable" : "disable", + accounts_user_get_user_name (ACCOUNTS_USER (user)), + accounts_user_get_uid (ACCOUNTS_USER (user))); - if (user->locked) { + if (accounts_user_get_locked (ACCOUNTS_USER (user))) { throw_error (context, ERROR_FAILED, "failed to change automatic login: user is locked"); return; } if (!daemon_local_set_automatic_login (daemon, user, enabled, &error)) { throw_error (context, ERROR_FAILED, "failed to change automatic login: %s", error->message); - g_error_free (error); return; } @@ -2074,123 +1945,6 @@ return TRUE; } -static guint64 -user_real_get_uid (AccountsUser *user) -{ - return (guint64) USER (user)->uid; -} - -static const gchar * -user_real_get_user_name (AccountsUser *user) -{ - return USER (user)->user_name; -} - -static const gchar * -user_real_get_real_name (AccountsUser *user) -{ - return USER (user)->real_name; -} - -static gint -user_real_get_account_type (AccountsUser *user) -{ - return (gint) USER (user)->account_type; -} - -static const gchar * -user_real_get_home_directory (AccountsUser *user) -{ - return USER (user)->home_dir; -} - -static const gchar * -user_real_get_shell (AccountsUser *user) -{ - return USER (user)->shell; -} - -static const gchar * -user_real_get_email (AccountsUser *user) -{ - return USER (user)->email; -} - -static const gchar * -user_real_get_language (AccountsUser *user) -{ - return USER (user)->language; -} - -static const gchar * -user_real_get_xsession (AccountsUser *user) -{ - return USER (user)->x_session; -} - -static const gchar * -user_real_get_location (AccountsUser *user) -{ - return USER (user)->location; -} - -static guint64 -user_real_get_login_frequency (AccountsUser *user) -{ - return USER (user)->login_frequency; -} - -static gint64 -user_real_get_login_time (AccountsUser *user) -{ - return USER (user)->login_time; -} - -static GVariant * -user_real_get_login_history (AccountsUser *user) -{ - return USER (user)->login_history; -} - -static const gchar * -user_real_get_icon_file (AccountsUser *user) -{ - if (USER (user)->icon_file) - return USER (user)->icon_file; - else - return USER (user)->default_icon_file; -} - -static gboolean -user_real_get_locked (AccountsUser *user) -{ - return USER (user)->locked; -} - -static gint -user_real_get_password_mode (AccountsUser *user) -{ - return USER (user)->password_mode; -} - -static const gchar * -user_real_get_password_hint (AccountsUser *user) -{ - return USER (user)->password_hint; -} - -static gboolean -user_real_get_automatic_login (AccountsUser *user) -{ - return USER (user)->automatic_login; -} - -static gboolean -user_real_get_system_account (AccountsUser *user) -{ - return USER (user)->system_account; -} - static void user_finalize (GObject *object) { @@ -2198,166 +1952,27 @@ user = USER (object); + if (user->changed_timeout_id != 0) + g_source_remove (user->changed_timeout_id); + g_clear_pointer (&user->keyfile, g_key_file_unref); - g_free (user->object_path); - g_free (user->user_name); - g_free (user->real_name); - g_free (user->home_dir); - g_free (user->shell); - g_free (user->icon_file); g_free (user->default_icon_file); - g_free (user->email); - g_free (user->language); - g_free (user->x_session); - g_free (user->location); - g_free (user->password_hint); - if (user->login_history) - g_variant_unref (user->login_history); + g_clear_pointer (&user->login_history, g_variant_unref); if (G_OBJECT_CLASS (user_parent_class)->finalize) (*G_OBJECT_CLASS (user_parent_class)->finalize) (object); } static void -user_set_property (GObject *object, - guint param_id, - const GValue *value, - GParamSpec *pspec) -{ - User *user = USER (object); - - switch (param_id) { - case PROP_ACCOUNT_TYPE: - user->account_type = g_value_get_int (value); - break; - case PROP_LANGUAGE: - user->language = g_value_dup_string (value); - break; - case PROP_X_SESSION: - user->x_session = g_value_dup_string (value); - break; - case PROP_EMAIL: - user->email = g_value_dup_string (value); - break; - case PROP_LOGIN_FREQUENCY: - user->login_frequency = g_value_get_uint64 (value); - break; - case PROP_LOGIN_TIME: - user->login_time = g_value_get_int64 (value); - break; - case PROP_LOGIN_HISTORY: - if (user->login_history) - g_variant_unref (user->login_history); - user->login_history = g_variant_ref (g_value_get_variant (value)); - break; - case PROP_AUTOMATIC_LOGIN: - user->automatic_login = g_value_get_boolean (value); - break; - case PROP_SYSTEM_ACCOUNT: - user->system_account = g_value_get_boolean (value); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec); - break; - } -} - -static void -user_get_property (GObject *object, - guint param_id, - GValue *value, - GParamSpec *pspec) -{ - User *user = USER (object); - - switch (param_id) { - case PROP_UID: - g_value_set_uint64 (value, user->uid); - break; - case PROP_USER_NAME: - g_value_set_string (value, user->user_name); - break; - case PROP_REAL_NAME: - g_value_set_string (value, user->real_name); - break; - case PROP_ACCOUNT_TYPE: - g_value_set_int (value, user->account_type); - break; - case PROP_PASSWORD_MODE: - g_value_set_int (value, user->password_mode); - break; - case PROP_PASSWORD_HINT: - g_value_set_string (value, user->password_hint); - break; - case PROP_HOME_DIR: - g_value_set_string (value, user->home_dir); - break; - case PROP_SHELL: - g_value_set_string (value, user->shell); - break; - case PROP_EMAIL: - g_value_set_string (value, user->email); - break; - case PROP_LANGUAGE: - g_value_set_string (value, user->language); - break; - case PROP_X_SESSION: - g_value_set_string (value, user->x_session); - break; - case PROP_LOCATION: - g_value_set_string (value, user->location); - break; - case PROP_ICON_FILE: - if (user->icon_file) - g_value_set_string (value, user->icon_file); - else { - gchar *icon_file; - - icon_file = g_build_filename (user->home_dir, ".face", NULL); - g_value_take_string (value, icon_file); - } - break; - case PROP_LOGIN_FREQUENCY: - g_value_set_uint64 (value, user->login_frequency); - break; - case PROP_LOGIN_TIME: - g_value_set_int64 (value, user->login_time); - break; - case PROP_LOGIN_HISTORY: - g_value_set_variant (value, user->login_history); - break; - case PROP_LOCKED: - g_value_set_boolean (value, user->locked); - break; - case PROP_AUTOMATIC_LOGIN: - g_value_set_boolean (value, user->automatic_login); - break; - case PROP_SYSTEM_ACCOUNT: - g_value_set_boolean (value, user->system_account); - break; - case PROP_LOCAL_ACCOUNT: - g_value_set_boolean (value, user->local_account); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec); - break; - } -} - -static void user_class_init (UserClass *class) { GObjectClass *gobject_class; gobject_class = G_OBJECT_CLASS (class); - gobject_class->get_property = user_get_property; - gobject_class->set_property = user_set_property; gobject_class->finalize = user_finalize; - - accounts_user_override_properties (gobject_class, 1); } static void @@ -2379,48 +1994,13 @@ iface->handle_set_user_name = user_set_user_name; iface->handle_set_xsession = user_set_x_session; iface->handle_get_password_expiration_policy = user_get_password_expiration_policy; - iface->get_uid = user_real_get_uid; - iface->get_user_name = user_real_get_user_name; - iface->get_real_name = user_real_get_real_name; - iface->get_account_type = user_real_get_account_type; - iface->get_home_directory = user_real_get_home_directory; - iface->get_shell = user_real_get_shell; - iface->get_email = user_real_get_email; - iface->get_language = user_real_get_language; - iface->get_xsession = user_real_get_xsession; - iface->get_location = user_real_get_location; - iface->get_login_frequency = user_real_get_login_frequency; - iface->get_login_time = user_real_get_login_time; - iface->get_login_history = user_real_get_login_history; - iface->get_icon_file = user_real_get_icon_file; - iface->get_locked = user_real_get_locked; - iface->get_password_mode = user_real_get_password_mode; - iface->get_password_hint = user_real_get_password_hint; - iface->get_automatic_login = user_real_get_automatic_login; - iface->get_system_account = user_real_get_system_account; } static void user_init (User *user) { user->system_bus_connection = NULL; - user->object_path = NULL; - user->user_name = NULL; - user->real_name = NULL; - user->account_type = ACCOUNT_TYPE_STANDARD; - user->home_dir = NULL; - user->shell = NULL; - user->icon_file = NULL; user->default_icon_file = NULL; - user->email = NULL; - user->language = NULL; - user->x_session = NULL; - user->location = NULL; - user->password_mode = PASSWORD_MODE_REGULAR; - user->password_hint = NULL; - user->locked = FALSE; - user->automatic_login = FALSE; - user->system_account = FALSE; user->login_history = NULL; user->keyfile = g_key_file_new (); } diff -Nru accountsservice-0.6.45/src/user-classify.c accountsservice-0.6.50/src/user-classify.c --- accountsservice-0.6.45/src/user-classify.c 2017-03-27 18:50:42.000000000 +0200 +++ accountsservice-0.6.50/src/user-classify.c 2018-04-04 15:59:42.000000000 +0200 @@ -39,10 +39,7 @@ "mail", "news", "uucp", - "operator", "nobody", - "nobody4", - "noaccess", "postgres", "pvm", "rpm", @@ -79,9 +76,6 @@ return FALSE; } -#define PATH_NOLOGIN "/sbin/nologin" -#define PATH_FALSE "/bin/false" - #ifdef ENABLE_USER_HEURISTICS static gboolean user_classify_is_excluded_by_heuristics (const gchar *username, @@ -118,7 +112,7 @@ static gboolean is_invalid_shell (const char *shell) { - char *basename, *nologin_basename, *false_basename; + g_autofree gchar *basename = NULL; int ret = FALSE; #ifdef HAVE_GETUSERSHELL @@ -139,21 +133,14 @@ /* always check for false and nologin since they are sometimes included by getusershell */ 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; + return TRUE; + } else if (g_strcmp0 (basename, "nologin") == 0) { + return TRUE; + } else if (g_strcmp0 (basename, "false") == 0) { + return TRUE; } - g_free (basename); - g_free (nologin_basename); - g_free (false_basename); - return ret; } diff -Nru accountsservice-0.6.45/src/user.h accountsservice-0.6.50/src/user.h --- accountsservice-0.6.45/src/user.h 2016-09-06 19:31:50.000000000 +0200 +++ accountsservice-0.6.50/src/user.h 2018-01-30 17:11:18.000000000 +0100 @@ -63,6 +63,9 @@ gboolean local); void user_update_system_account_property (User *user, gboolean system); +gboolean user_get_cached (User *user); +void user_set_cached (User *user, + gboolean cached); void user_register (User *user); void user_unregister (User *user); diff -Nru accountsservice-0.6.45/src/util.c accountsservice-0.6.50/src/util.c --- accountsservice-0.6.45/src/util.c 2016-06-27 20:00:14.000000000 +0200 +++ accountsservice-0.6.50/src/util.c 2018-04-04 15:59:43.000000000 +0200 @@ -37,52 +37,43 @@ static gchar * get_cmdline_of_pid (GPid pid) { - gchar *ret = NULL; - gchar *filename; - gchar *contents; - gsize contents_len; - GError *error; - guint n; - - filename = g_strdup_printf ("/proc/%d/cmdline", (int) pid); - - if (!g_file_get_contents (filename, - &contents, - &contents_len, - &error)) - { - g_warning ("Error opening `%s': %s", - filename, - error->message); - g_error_free (error); - goto out; - } - /* The kernel uses '\0' to separate arguments - replace those with a space. */ - for (n = 0; n < contents_len - 1; n++) - { - if (contents[n] == '\0') - contents[n] = ' '; - } - - ret = g_strdup (contents); - g_strstrip (ret); - - out: - g_free (filename); - g_free (contents); + gchar *ret; + g_autofree gchar *filename = NULL; + g_autofree gchar *contents = NULL; + gsize contents_len; + g_autoptr(GError) error = NULL; + guint n; + + filename = g_strdup_printf ("/proc/%d/cmdline", (int) pid); + + if (!g_file_get_contents (filename, + &contents, + &contents_len, + &error)) { + g_warning ("Error opening `%s': %s", + filename, + error->message); + return NULL; + } + /* The kernel uses '\0' to separate arguments - replace those with a space. */ + for (n = 0; n < contents_len - 1; n++) { + if (contents[n] == '\0') + contents[n] = ' '; + } - return ret; + ret = g_strdup (contents); + g_strstrip (ret); + return ret; } static gboolean get_caller_pid (GDBusMethodInvocation *context, GPid *pid) { - GVariant *reply; - GError *error; - guint32 pid_as_int; + g_autoptr(GVariant) reply = NULL; + g_autoptr(GError) error = NULL; + guint32 pid_as_int; - error = NULL; reply = g_dbus_connection_call_sync (g_dbus_method_invocation_get_connection (context), "org.freedesktop.DBus", "/org/freedesktop/DBus", @@ -100,16 +91,12 @@ g_warning ("Could not talk to message bus to find uid of sender %s: %s", g_dbus_method_invocation_get_sender (context), error->message); - g_error_free (error); - return FALSE; } g_variant_get (reply, "(u)", &pid_as_int); *pid = pid_as_int; - g_variant_unref (reply); - return TRUE; } @@ -119,7 +106,7 @@ ...) { va_list args; - gchar *msg; + g_autofree gchar *msg = NULL; va_start (args, format); msg = g_strdup_vprintf (format, args); @@ -127,11 +114,11 @@ if (context) { PolkitSubject *subject; - gchar *cmdline = NULL; - gchar *id; + g_autofree gchar *cmdline = NULL; + g_autofree gchar *id = NULL; GPid pid = 0; gint uid = -1; - gchar *tmp; + g_autofree gchar *tmp = NULL; subject = polkit_system_bus_name_new (g_dbus_method_invocation_get_sender (context)); id = polkit_subject_to_string (subject); @@ -160,16 +147,12 @@ } g_free (msg); - msg = tmp; + msg = g_steal_pointer (&tmp); - g_free (id); - g_free (cmdline); g_object_unref (subject); } syslog (LOG_NOTICE, "%s", msg); - - g_free (msg); } static void @@ -177,8 +160,8 @@ { GPid pid; gint uid; - gchar *path; - gchar *buf; + g_autofree gchar *path = NULL; + g_autofree gchar *buf = NULL; if (!get_caller_uid (context, &uid)) { uid = getuid (); @@ -192,13 +175,10 @@ if (path != NULL && g_file_get_contents (path, &buf, NULL, NULL)) { strncpy (loginuid, buf, size); - g_free (buf); } else { g_snprintf (loginuid, size, "%d", uid); } - - g_free (path); } static gboolean @@ -282,10 +262,9 @@ get_caller_uid (GDBusMethodInvocation *context, gint *uid) { - GVariant *reply; - GError *error; + g_autoptr(GVariant) reply = NULL; + g_autoptr(GError) error = NULL; - error = NULL; reply = g_dbus_connection_call_sync (g_dbus_method_invocation_get_connection (context), "org.freedesktop.DBus", "/org/freedesktop/DBus", @@ -303,13 +282,10 @@ g_warning ("Could not talk to message bus to find uid of sender %s: %s", g_dbus_method_invocation_get_sender (context), error->message); - g_error_free (error); - return FALSE; } g_variant_get (reply, "(u)", uid); - g_variant_unref (reply); return TRUE; } diff -Nru accountsservice-0.6.45/src/wtmp-helper.c accountsservice-0.6.50/src/wtmp-helper.c --- accountsservice-0.6.45/src/wtmp-helper.c 2017-03-27 18:50:42.000000000 +0200 +++ accountsservice-0.6.50/src/wtmp-helper.c 2018-04-25 17:20:26.000000000 +0200 @@ -75,7 +75,6 @@ struct utmpx *wtmp_entry; GHashTableIter iter; gpointer key, value; - struct passwd *pwent; User *user; GVariantBuilder *builder, *builder2; GList *l; @@ -128,11 +127,6 @@ continue; } - pwent = getpwnam (wtmp_entry->ut_user); - if (pwent == NULL) { - continue; - } - if (!g_hash_table_lookup_extended (login_hash, wtmp_entry->ut_user, &key, &value)) { @@ -165,6 +159,9 @@ while (g_hash_table_iter_next (&iter, &key, &value)) { UserAccounting *accounting = (UserAccounting *) value; UserPreviousLogin *previous_login; + gboolean changed = FALSE; + guint64 old_login_frequency; + guint64 old_login_time; user = g_hash_table_lookup (users, key); if (user == NULL) { @@ -172,8 +169,20 @@ continue; } - g_object_set (user, "login-frequency", accounting->frequency, NULL); - g_object_set (user, "login-time", accounting->time, NULL); + g_object_get (user, + "login-frequency", &old_login_frequency, + "login-time", &old_login_time, + NULL); + + if (old_login_frequency != accounting->frequency) { + g_object_set (user, "login-frequency", accounting->frequency, NULL); + changed = TRUE; + } + + if (old_login_time != accounting->time) { + g_object_set (user, "login-time", accounting->time, NULL); + changed = TRUE; + } builder = g_variant_builder_new (G_VARIANT_TYPE ("a(xxa{sv})")); for (l = g_list_last (accounting->previous_logins); l != NULL; l = l->prev) { @@ -188,7 +197,8 @@ g_variant_builder_unref (builder); g_list_free_full (accounting->previous_logins, (GDestroyNotify) user_previous_login_free); - user_changed (user); + if (changed) + user_changed (user); } g_hash_table_unref (login_hash);