Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package dbus-1 for openSUSE:Factory checked in at 2023-09-22 21:47:07 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/dbus-1 (Old) and /work/SRC/openSUSE:Factory/.dbus-1.new.1770 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "dbus-1" Fri Sep 22 21:47:07 2023 rev:179 rq:1112496 version:1.14.10 Changes: -------- dbus-1-x11.changes: same change --- /work/SRC/openSUSE:Factory/dbus-1/dbus-1.changes 2023-06-14 16:29:18.926459391 +0200 +++ /work/SRC/openSUSE:Factory/.dbus-1.new.1770/dbus-1.changes 2023-09-22 21:47:52.145851379 +0200 @@ -1,0 +2,17 @@ +Wed Sep 13 08:45:38 UTC 2023 - Dirk Müller <dmuel...@suse.com> + +- update to 1.14.10: + * Avoid a dbus-daemon crash if re-creating a connection's policy + fails. If it isn't possible to re-create its policy (for + example if it belongs to a user account that has been deleted + or if the Name Service Switch is broken, on a system not + supporting SO_PEERGROUPS), we now log a warning, continue to + use its current policy, and continue to reload other + connections' policies. + * If getting the groups from a user ID fails, report the error + correctly, instead of logging "(null)" + * Return the primary group ID in GetConnectionCredentials()' + UnixGroupIDs field for processes with a valid-but-empty + supplementary group list + +------------------------------------------------------------------- Old: ---- dbus-1.14.8.tar.xz dbus-1.14.8.tar.xz.asc New: ---- dbus-1.14.10.tar.xz dbus-1.14.10.tar.xz.asc ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ dbus-1-devel-doc.spec ++++++ --- /var/tmp/diff_new_pack.CxPsth/_old 2023-09-22 21:47:54.001918760 +0200 +++ /var/tmp/diff_new_pack.CxPsth/_new 2023-09-22 21:47:54.001918760 +0200 @@ -23,7 +23,7 @@ %global _backup %{_sysconfdir}/sysconfig/services.rpmbak.%{name}-%{version}-%{release} %bcond_without selinux Name: dbus-1-devel-doc -Version: 1.14.8 +Version: 1.14.10 Release: 0 Summary: Developer documentation package for D-Bus License: AFL-2.1 OR GPL-2.0-or-later ++++++ dbus-1-x11.spec ++++++ --- /var/tmp/diff_new_pack.CxPsth/_old 2023-09-22 21:47:54.025919630 +0200 +++ /var/tmp/diff_new_pack.CxPsth/_new 2023-09-22 21:47:54.029919776 +0200 @@ -23,7 +23,7 @@ %endif %bcond_without selinux Name: dbus-1-x11 -Version: 1.14.8 +Version: 1.14.10 Release: 0 Summary: D-Bus Message Bus System License: AFL-2.1 OR GPL-2.0-or-later ++++++ dbus-1.spec ++++++ --- /var/tmp/diff_new_pack.CxPsth/_old 2023-09-22 21:47:54.057920793 +0200 +++ /var/tmp/diff_new_pack.CxPsth/_new 2023-09-22 21:47:54.061920937 +0200 @@ -21,7 +21,7 @@ %define _libname libdbus-1-3 %bcond_without selinux Name: dbus-1 -Version: 1.14.8 +Version: 1.14.10 Release: 0 Summary: D-Bus Message Bus System License: AFL-2.1 OR GPL-2.0-or-later ++++++ dbus-1.14.8.tar.xz -> dbus-1.14.10.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dbus-1.14.8/AUTHORS new/dbus-1.14.10/AUTHORS --- old/dbus-1.14.8/AUTHORS 2023-06-06 15:00:36.000000000 +0200 +++ new/dbus-1.14.10/AUTHORS 2023-09-01 16:28:31.000000000 +0200 @@ -38,6 +38,7 @@ Colin Watson <cjwat...@ubuntu.com> Cosimo Alfarano <cosimo.alfar...@collabora.com> Cosimo Alfarano <cosimo.alfar...@collabora.co.uk> +cptpcrd <cptpcrd....@gmail.com> Cristian Onet <onet.crist...@gmail.com> Cristian RodrÃguez <cristian.rodrig...@opensuse.org> Cristian RodrÃguez <crrodrig...@opensuse.org> @@ -170,6 +171,7 @@ Paul Bolle <pebo...@tiscali.nl> Pavel Strashkin <pavel.strash...@gmail.com> Pavel Strashkin <pavel.strash...@nexenta.com> +Peter Benie <pjb1008> Peter Breitenlohner <p...@mppmu.mpg.de> Peter Kümmel <syntheti...@gmx.net> Peter McCurdy <peter.mccu...@gmail.com> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dbus-1.14.8/Makefile.in new/dbus-1.14.10/Makefile.in --- old/dbus-1.14.8/Makefile.in 2023-06-06 15:02:00.000000000 +0200 +++ new/dbus-1.14.10/Makefile.in 2023-09-01 16:31:27.000000000 +0200 @@ -15,7 +15,7 @@ @SET_MAKE@ # aminclude_static.am generated automatically by Autoconf -# from AX_AM_MACROS_STATIC on Tue Jun 6 14:01:59 BST 2023 +# from AX_AM_MACROS_STATIC on Fri Sep 1 15:31:27 BST 2023 VPATH = @srcdir@ am__is_gnu_make = { \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dbus-1.14.8/NEWS new/dbus-1.14.10/NEWS --- old/dbus-1.14.8/NEWS 2023-06-06 15:00:36.000000000 +0200 +++ new/dbus-1.14.10/NEWS 2023-09-01 16:30:45.000000000 +0200 @@ -1,3 +1,22 @@ +dbus 1.14.10 (2023-09-01) +========================= + +Bug fixes: + +⢠Avoid a dbus-daemon crash if re-creating a connection's policy fails. + If it isn't possible to re-create its policy (for example if it belongs + to a user account that has been deleted or if the Name Service Switch is + broken, on a system not supporting SO_PEERGROUPS), we now log a warning, + continue to use its current policy, and continue to reload other + connections' policies. (dbus#343; Peter Benie, Simon McVittie) + +⢠If getting the groups from a user ID fails, report the error correctly, + instead of logging "(null)" (dbus#343, Simon McVittie) + +⢠Return the primary group ID in GetConnectionCredentials()' UnixGroupIDs + field for processes with a valid-but-empty supplementary group list + (dbus!422, cptpcrd) + dbus 1.14.8 (2023-06-06) ======================== diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dbus-1.14.8/aminclude_static.am new/dbus-1.14.10/aminclude_static.am --- old/dbus-1.14.8/aminclude_static.am 2023-06-06 15:01:59.000000000 +0200 +++ new/dbus-1.14.10/aminclude_static.am 2023-09-01 16:31:27.000000000 +0200 @@ -1,6 +1,6 @@ # aminclude_static.am generated automatically by Autoconf -# from AX_AM_MACROS_STATIC on Tue Jun 6 14:01:59 BST 2023 +# from AX_AM_MACROS_STATIC on Fri Sep 1 15:31:27 BST 2023 # Code coverage diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dbus-1.14.8/build-aux/ltmain.sh new/dbus-1.14.10/build-aux/ltmain.sh --- old/dbus-1.14.8/build-aux/ltmain.sh 2023-06-06 13:05:03.000000000 +0200 +++ new/dbus-1.14.10/build-aux/ltmain.sh 2023-09-01 16:26:33.000000000 +0200 @@ -31,7 +31,7 @@ PROGRAM=libtool PACKAGE=libtool -VERSION="2.4.7 Debian-2.4.7-5" +VERSION="2.4.7 Debian-2.4.7-7" package_revision=2.4.7 @@ -572,27 +572,15 @@ # --------------------- # Append VALUE onto the existing contents of VAR. - # We should try to minimise forks, especially on Windows where they are - # unreasonably slow, so skip the feature probes when bash or zsh are - # being used: - if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then - : ${_G_HAVE_ARITH_OP="yes"} - : ${_G_HAVE_XSI_OPS="yes"} - # The += operator was introduced in bash 3.1 - case $BASH_VERSION in - [12].* | 3.0 | 3.0*) ;; - *) - : ${_G_HAVE_PLUSEQ_OP="yes"} - ;; - esac - fi - # _G_HAVE_PLUSEQ_OP # Can be empty, in which case the shell is probed, "yes" if += is # useable or anything else if it does not work. - test -z "$_G_HAVE_PLUSEQ_OP" \ - && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \ - && _G_HAVE_PLUSEQ_OP=yes + if test -z "$_G_HAVE_PLUSEQ_OP" && \ + __PLUSEQ_TEST="a" && \ + __PLUSEQ_TEST+=" b" 2>/dev/null && \ + test "a b" = "$__PLUSEQ_TEST"; then + _G_HAVE_PLUSEQ_OP=yes + fi if test yes = "$_G_HAVE_PLUSEQ_OP" then @@ -2308,7 +2296,7 @@ compiler: $LTCC compiler flags: $LTCFLAGS linker: $LD (gnu? $with_gnu_ld) - version: $progname $scriptversion Debian-2.4.7-5 + version: $progname $scriptversion Debian-2.4.7-7 automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dbus-1.14.8/bus/Makefile.in new/dbus-1.14.10/bus/Makefile.in --- old/dbus-1.14.8/bus/Makefile.in 2023-06-06 15:02:00.000000000 +0200 +++ new/dbus-1.14.10/bus/Makefile.in 2023-09-01 16:31:28.000000000 +0200 @@ -15,7 +15,7 @@ @SET_MAKE@ # aminclude_static.am generated automatically by Autoconf -# from AX_AM_MACROS_STATIC on Tue Jun 6 14:01:59 BST 2023 +# from AX_AM_MACROS_STATIC on Fri Sep 1 15:31:27 BST 2023 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dbus-1.14.8/bus/bus.c new/dbus-1.14.10/bus/bus.c --- old/dbus-1.14.8/bus/bus.c 2022-10-02 16:06:53.000000000 +0200 +++ new/dbus-1.14.10/bus/bus.c 2023-09-01 16:23:58.000000000 +0200 @@ -1412,11 +1412,42 @@ BusClientPolicy* bus_context_create_client_policy (BusContext *context, DBusConnection *connection, + BusClientPolicy *previous, DBusError *error) { + BusClientPolicy *client; + DBusError local_error = DBUS_ERROR_INIT; + const char *conn; + const char *loginfo; + _DBUS_ASSERT_ERROR_IS_CLEAR (error); - return bus_policy_create_client_policy (context->policy, connection, - error); + + client = bus_policy_create_client_policy (context->policy, connection, + &local_error); + + /* On success, use new policy */ + if (client != NULL) + return client; + + /* On failure while setting up a new connection, fail */ + if (previous == NULL) + { + dbus_move_error (&local_error, error); + return NULL; + } + + /* On failure while reloading, keep the previous policy */ + conn = bus_connection_get_name (connection); + loginfo = bus_connection_get_loginfo (connection); + + if (conn == NULL) + conn = "(inactive)"; + + bus_context_log (context, DBUS_SYSTEM_LOG_WARNING, + "Unable to reload policy for connection \"%s\" (%s), " + "keeping current policy: %s", + conn, loginfo, local_error.message); + return bus_client_policy_ref (previous); } int diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dbus-1.14.8/bus/bus.h new/dbus-1.14.10/bus/bus.h --- old/dbus-1.14.8/bus/bus.h 2022-10-02 16:06:53.000000000 +0200 +++ new/dbus-1.14.10/bus/bus.h 2023-09-01 16:23:58.000000000 +0200 @@ -115,6 +115,7 @@ BusClientPolicy* bus_context_create_client_policy (BusContext *context, DBusConnection *connection, + BusClientPolicy *previous, DBusError *error); int bus_context_get_activation_timeout (BusContext *context); int bus_context_get_auth_timeout (BusContext *context); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dbus-1.14.8/bus/connection.c new/dbus-1.14.10/bus/connection.c --- old/dbus-1.14.8/bus/connection.c 2023-06-06 15:00:36.000000000 +0200 +++ new/dbus-1.14.10/bus/connection.c 2023-09-01 16:23:58.000000000 +0200 @@ -1079,7 +1079,7 @@ if (dbus_connection_get_unix_user (connection, &uid)) { - if (!_dbus_unix_groups_from_uid (uid, groups, n_groups)) + if (!_dbus_unix_groups_from_uid (uid, groups, n_groups, error)) { _dbus_verbose ("Did not get any groups for UID %lu\n", uid); @@ -1584,6 +1584,7 @@ d->policy = bus_context_create_client_policy (d->connections->context, connection, + NULL, error); /* we may have a NULL policy on OOM or error getting list of @@ -1660,22 +1661,27 @@ link; link = _dbus_list_get_next_link (&(connections->completed), link)) { + BusClientPolicy *policy; + connection = link->data; d = BUS_CONNECTION_DATA (connection); _dbus_assert (d != NULL); _dbus_assert (d->policy != NULL); - bus_client_policy_unref (d->policy); - d->policy = bus_context_create_client_policy (connections->context, - connection, - error); - if (d->policy == NULL) + policy = bus_context_create_client_policy (connections->context, + connection, + d->policy, + error); + if (policy == NULL) { _dbus_verbose ("Failed to create security policy for connection %p\n", connection); _DBUS_ASSERT_ERROR_IS_SET (error); return FALSE; } + + bus_client_policy_unref (d->policy); + d->policy = policy; } return TRUE; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dbus-1.14.8/bus/policy.c new/dbus-1.14.10/bus/policy.c --- old/dbus-1.14.8/bus/policy.c 2022-10-02 16:06:53.000000000 +0200 +++ new/dbus-1.14.10/bus/policy.c 2023-09-01 16:23:58.000000000 +0200 @@ -450,7 +450,7 @@ int n_group_ids; /* On OOM or error we always reject the user */ - if (!_dbus_unix_groups_from_uid (uid, &group_ids, &n_group_ids)) + if (!_dbus_unix_groups_from_uid (uid, &group_ids, &n_group_ids, NULL)) { _dbus_verbose ("Did not get any groups for UID %lu\n", uid); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dbus-1.14.8/cmake/DBus1ConfigVersion.cmake new/dbus-1.14.10/cmake/DBus1ConfigVersion.cmake --- old/dbus-1.14.8/cmake/DBus1ConfigVersion.cmake 2023-06-06 15:02:14.000000000 +0200 +++ new/dbus-1.14.10/cmake/DBus1ConfigVersion.cmake 2023-09-01 16:31:38.000000000 +0200 @@ -1,4 +1,4 @@ -set(PACKAGE_VERSION 1.14.8) +set(PACKAGE_VERSION 1.14.10) # Check whether the requested PACKAGE_FIND_VERSION is compatible if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dbus-1.14.8/configure new/dbus-1.14.10/configure --- old/dbus-1.14.8/configure 2023-06-06 15:01:59.000000000 +0200 +++ new/dbus-1.14.10/configure 2023-09-01 16:31:27.000000000 +0200 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for dbus 1.14.8. +# Generated by GNU Autoconf 2.71 for dbus 1.14.10. # # Report bugs to <https://gitlab.freedesktop.org/dbus/dbus/issues>. # @@ -621,8 +621,8 @@ # Identity of this package. PACKAGE_NAME='dbus' PACKAGE_TARNAME='dbus' -PACKAGE_VERSION='1.14.8' -PACKAGE_STRING='dbus 1.14.8' +PACKAGE_VERSION='1.14.10' +PACKAGE_STRING='dbus 1.14.10' PACKAGE_BUGREPORT='https://gitlab.freedesktop.org/dbus/dbus/issues' PACKAGE_URL='' @@ -1614,7 +1614,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 dbus 1.14.8 to adapt to many kinds of systems. +\`configure' configures dbus 1.14.10 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1685,7 +1685,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of dbus 1.14.8:";; + short | recursive ) echo "Configuration of dbus 1.14.10:";; esac cat <<\_ACEOF @@ -1925,7 +1925,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -dbus configure 1.14.8 +dbus configure 1.14.10 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. @@ -2611,7 +2611,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by dbus $as_me 1.14.8, which was +It was created by dbus $as_me 1.14.10, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw @@ -4223,7 +4223,7 @@ # Define the identity of the package. PACKAGE='dbus' - VERSION='1.14.8' + VERSION='1.14.10' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h @@ -4533,7 +4533,7 @@ ## increment any time the source changes; set to ## 0 if you increment CURRENT -LT_REVISION=3 +LT_REVISION=4 ## increment if any interfaces have been added; set to 0 ## if any interfaces have been changed or removed. removal has @@ -4548,8 +4548,8 @@ DBUS_MAJOR_VERSION=1 DBUS_MINOR_VERSION=14 -DBUS_MICRO_VERSION=8 -DBUS_VERSION=1.14.8 +DBUS_MICRO_VERSION=10 +DBUS_VERSION=1.14.10 @@ -29224,7 +29224,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by dbus $as_me 1.14.8, which was +This file was extended by dbus $as_me 1.14.10, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -29292,7 +29292,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -dbus config.status 1.14.8 +dbus config.status 1.14.10 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dbus-1.14.8/configure.ac new/dbus-1.14.10/configure.ac --- old/dbus-1.14.8/configure.ac 2023-06-06 15:00:36.000000000 +0200 +++ new/dbus-1.14.10/configure.ac 2023-09-01 16:30:58.000000000 +0200 @@ -3,7 +3,7 @@ m4_define([dbus_major_version], [1]) m4_define([dbus_minor_version], [14]) -m4_define([dbus_micro_version], [8]) +m4_define([dbus_micro_version], [10]) m4_define([dbus_version], [dbus_major_version.dbus_minor_version.dbus_micro_version]) AC_INIT([dbus], [dbus_version], [https://gitlab.freedesktop.org/dbus/dbus/issues], [dbus]) @@ -42,7 +42,7 @@ ## increment any time the source changes; set to ## 0 if you increment CURRENT -LT_REVISION=3 +LT_REVISION=4 ## increment if any interfaces have been added; set to 0 ## if any interfaces have been changed or removed. removal has diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dbus-1.14.8/dbus/Makefile.in new/dbus-1.14.10/dbus/Makefile.in --- old/dbus-1.14.8/dbus/Makefile.in 2023-06-06 15:02:00.000000000 +0200 +++ new/dbus-1.14.10/dbus/Makefile.in 2023-09-01 16:31:28.000000000 +0200 @@ -15,7 +15,7 @@ @SET_MAKE@ # aminclude_static.am generated automatically by Autoconf -# from AX_AM_MACROS_STATIC on Tue Jun 6 14:01:59 BST 2023 +# from AX_AM_MACROS_STATIC on Fri Sep 1 15:31:27 BST 2023 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dbus-1.14.8/dbus/dbus-sysdeps-unix.c new/dbus-1.14.10/dbus/dbus-sysdeps-unix.c --- old/dbus-1.14.8/dbus/dbus-sysdeps-unix.c 2023-02-08 11:30:57.000000000 +0100 +++ new/dbus-1.14.10/dbus/dbus-sysdeps-unix.c 2023-08-16 12:29:50.000000000 +0200 @@ -1932,6 +1932,8 @@ { #if defined(__linux__) && defined(SO_PEERGROUPS) _DBUS_STATIC_ASSERT (sizeof (gid_t) <= sizeof (dbus_gid_t)); + /* This function assumes socklen_t is unsigned, which is true on Linux */ + _DBUS_STATIC_ASSERT (((socklen_t) -1) > 0); gid_t *buf = NULL; socklen_t len = 1024; dbus_bool_t oom = FALSE; @@ -1977,13 +1979,6 @@ _dbus_verbose ("will try again with %lu\n", (unsigned long) len); } - if (len <= 0) - { - _dbus_verbose ("getsockopt(SO_PEERGROUPS) yielded <= 0 bytes: %ld\n", - (long) len); - goto out; - } - if (len > n_gids * sizeof (gid_t)) { _dbus_verbose ("%lu > %zu", (unsigned long) len, n_gids * sizeof (gid_t)); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dbus-1.14.8/dbus/dbus-sysdeps-util-unix.c new/dbus-1.14.10/dbus/dbus-sysdeps-util-unix.c --- old/dbus-1.14.8/dbus/dbus-sysdeps-util-unix.c 2022-10-02 16:06:53.000000000 +0200 +++ new/dbus-1.14.10/dbus/dbus-sysdeps-util-unix.c 2023-09-01 16:23:58.000000000 +0200 @@ -992,14 +992,16 @@ * @param uid the UID * @param group_ids return location for array of group IDs * @param n_group_ids return location for length of returned array + * @param error error location * @returns #TRUE if the UID existed and we got some credentials */ dbus_bool_t _dbus_unix_groups_from_uid (dbus_uid_t uid, dbus_gid_t **group_ids, - int *n_group_ids) + int *n_group_ids, + DBusError *error) { - return _dbus_groups_from_uid (uid, group_ids, n_group_ids); + return _dbus_groups_from_uid (uid, group_ids, n_group_ids, error); } /** diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dbus-1.14.8/dbus/dbus-sysdeps-util-win.c new/dbus-1.14.10/dbus/dbus-sysdeps-util-win.c --- old/dbus-1.14.8/dbus/dbus-sysdeps-util-win.c 2022-10-02 16:06:53.000000000 +0200 +++ new/dbus-1.14.10/dbus/dbus-sysdeps-util-win.c 2023-09-01 16:23:58.000000000 +0200 @@ -649,6 +649,13 @@ unix emulation functions - should be removed sometime in the future =====================================================================*/ +static void +set_unix_uid_unsupported (DBusError *error) +{ + dbus_set_error (error, DBUS_ERROR_NOT_SUPPORTED, + "UNIX user IDs not supported on Windows"); +} + /** * Checks to see if the UNIX user ID is at the console. * Should always fail on Windows (set the error to @@ -662,8 +669,7 @@ _dbus_unix_user_is_at_console (dbus_uid_t uid, DBusError *error) { - dbus_set_error (error, DBUS_ERROR_NOT_SUPPORTED, - "UNIX user IDs not supported on Windows\n"); + set_unix_uid_unsupported (error); return FALSE; } @@ -707,13 +713,16 @@ * @param uid the UID * @param group_ids return location for array of group IDs * @param n_group_ids return location for length of returned array + * @param error error location * @returns #TRUE if the UID existed and we got some credentials */ dbus_bool_t _dbus_unix_groups_from_uid (dbus_uid_t uid, dbus_gid_t **group_ids, - int *n_group_ids) + int *n_group_ids, + DBusError *error) { + set_unix_uid_unsupported (error); return FALSE; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dbus-1.14.8/dbus/dbus-sysdeps.h new/dbus-1.14.10/dbus/dbus-sysdeps.h --- old/dbus-1.14.8/dbus/dbus-sysdeps.h 2022-10-02 16:06:53.000000000 +0200 +++ new/dbus-1.14.10/dbus/dbus-sysdeps.h 2023-09-01 16:23:58.000000000 +0200 @@ -298,7 +298,8 @@ dbus_gid_t *gid_p); dbus_bool_t _dbus_unix_groups_from_uid (dbus_uid_t uid, dbus_gid_t **group_ids, - int *n_group_ids); + int *n_group_ids, + DBusError *error); dbus_bool_t _dbus_unix_user_is_at_console (dbus_uid_t uid, DBusError *error); dbus_bool_t _dbus_unix_user_is_process_owner (dbus_uid_t uid); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dbus-1.14.8/dbus/dbus-userdb-util.c new/dbus-1.14.10/dbus/dbus-userdb-util.c --- old/dbus-1.14.8/dbus/dbus-userdb-util.c 2022-10-02 16:06:53.000000000 +0200 +++ new/dbus-1.14.10/dbus/dbus-userdb-util.c 2023-09-01 16:23:58.000000000 +0200 @@ -373,31 +373,35 @@ * @param uid the UID * @param group_ids return location for array of group IDs * @param n_group_ids return location for length of returned array + * @param error error to fill in on failure * @returns #TRUE if the UID existed and we got some credentials */ dbus_bool_t _dbus_groups_from_uid (dbus_uid_t uid, dbus_gid_t **group_ids, - int *n_group_ids) + int *n_group_ids, + DBusError *error) { DBusUserDatabase *db; const DBusUserInfo *info; *group_ids = NULL; *n_group_ids = 0; - /* FIXME: this can't distinguish ENOMEM from other errors */ if (!_dbus_user_database_lock_system ()) - return FALSE; + { + _DBUS_SET_OOM (error); + return FALSE; + } db = _dbus_user_database_get_system (); if (db == NULL) { + _DBUS_SET_OOM (error); _dbus_user_database_unlock_system (); return FALSE; } - if (!_dbus_user_database_get_uid (db, uid, - &info, NULL)) + if (!_dbus_user_database_get_uid (db, uid, &info, error)) { _dbus_user_database_unlock_system (); return FALSE; @@ -410,6 +414,7 @@ *group_ids = dbus_new (dbus_gid_t, info->n_group_ids); if (*group_ids == NULL) { + _DBUS_SET_OOM (error); _dbus_user_database_unlock_system (); return FALSE; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dbus-1.14.8/dbus/dbus-userdb.h new/dbus-1.14.10/dbus/dbus-userdb.h --- old/dbus-1.14.8/dbus/dbus-userdb.h 2022-10-02 16:06:53.000000000 +0200 +++ new/dbus-1.14.10/dbus/dbus-userdb.h 2023-09-01 16:23:58.000000000 +0200 @@ -100,7 +100,8 @@ dbus_gid_t *gid_p); dbus_bool_t _dbus_groups_from_uid (dbus_uid_t uid, dbus_gid_t **group_ids, - int *n_group_ids); + int *n_group_ids, + DBusError *error); DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_is_console_user (dbus_uid_t uid, DBusError *error); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dbus-1.14.8/test/CMakeLists.txt new/dbus-1.14.10/test/CMakeLists.txt --- old/dbus-1.14.8/test/CMakeLists.txt 2023-02-08 13:04:02.000000000 +0100 +++ new/dbus-1.14.10/test/CMakeLists.txt 2023-09-01 16:23:58.000000000 +0200 @@ -201,6 +201,7 @@ add_test_executable(test-sysdeps internals/sysdeps.c ${TEST_LIBRARIES}) add_test_executable(test-syslog internals/syslog.c ${TEST_LIBRARIES}) add_test_executable(test-uid-permissions uid-permissions.c ${TEST_LIBRARIES}) + add_test_executable(test-userdb internals/userdb.c ${TEST_LIBRARIES}) add_helper_executable(manual-authz manual-authz.c ${TEST_LIBRARIES}) add_helper_executable(manual-test-thread-blocking thread-blocking.c ${TEST_LIBRARIES}) endif() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dbus-1.14.8/test/Makefile.am new/dbus-1.14.10/test/Makefile.am --- old/dbus-1.14.8/test/Makefile.am 2023-02-08 13:04:02.000000000 +0100 +++ new/dbus-1.14.10/test/Makefile.am 2023-09-01 16:23:58.000000000 +0200 @@ -171,6 +171,9 @@ test_syslog_SOURCES = internals/syslog.c test_syslog_LDADD = libdbus-testutils.la $(GLIB_LIBS) +test_userdb_SOURCES = internals/userdb.c +test_userdb_LDADD = libdbus-testutils.la $(GLIB_LIBS) + test_variant_SOURCES = internals/variant.c test_variant_LDADD = libdbus-testutils.la $(GLIB_LIBS) @@ -316,6 +319,7 @@ test-sysdeps \ test-syslog \ test-uid-permissions \ + test-userdb \ test-variant \ $(NULL) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dbus-1.14.8/test/Makefile.in new/dbus-1.14.10/test/Makefile.in --- old/dbus-1.14.8/test/Makefile.in 2023-06-06 15:02:00.000000000 +0200 +++ new/dbus-1.14.10/test/Makefile.in 2023-09-01 16:31:28.000000000 +0200 @@ -15,7 +15,7 @@ @SET_MAKE@ # aminclude_static.am generated automatically by Autoconf -# from AX_AM_MACROS_STATIC on Tue Jun 6 14:01:59 BST 2023 +# from AX_AM_MACROS_STATIC on Fri Sep 1 15:31:27 BST 2023 @@ -131,6 +131,7 @@ @DBUS_WITH_GLIB_TRUE@ test-sysdeps \ @DBUS_WITH_GLIB_TRUE@ test-syslog \ @DBUS_WITH_GLIB_TRUE@ test-uid-permissions \ +@DBUS_WITH_GLIB_TRUE@ test-userdb \ @DBUS_WITH_GLIB_TRUE@ test-variant \ @DBUS_WITH_GLIB_TRUE@ $(NULL) @@ -235,6 +236,7 @@ @DBUS_WITH_GLIB_TRUE@ test-sysdeps$(EXEEXT) \ @DBUS_WITH_GLIB_TRUE@ test-syslog$(EXEEXT) \ @DBUS_WITH_GLIB_TRUE@ test-uid-permissions$(EXEEXT) \ +@DBUS_WITH_GLIB_TRUE@ test-userdb$(EXEEXT) \ @DBUS_WITH_GLIB_TRUE@ test-variant$(EXEEXT) @DBUS_UNIX_TRUE@@DBUS_WITH_GLIB_TRUE@am__EXEEXT_7 = \ @DBUS_UNIX_TRUE@@DBUS_WITH_GLIB_TRUE@ test-containers$(EXEEXT) \ @@ -509,6 +511,9 @@ test_uid_permissions_OBJECTS = $(am_test_uid_permissions_OBJECTS) test_uid_permissions_DEPENDENCIES = libdbus-testutils.la \ $(am__DEPENDENCIES_1) +am_test_userdb_OBJECTS = internals/userdb.$(OBJEXT) +test_userdb_OBJECTS = $(am_test_userdb_OBJECTS) +test_userdb_DEPENDENCIES = libdbus-testutils.la $(am__DEPENDENCIES_1) am_test_variant_OBJECTS = internals/variant.$(OBJEXT) test_variant_OBJECTS = $(am_test_variant_OBJECTS) test_variant_DEPENDENCIES = libdbus-testutils.la $(am__DEPENDENCIES_1) @@ -605,7 +610,8 @@ internals/$(DEPDIR)/server-oom.Po internals/$(DEPDIR)/sha.Po \ internals/$(DEPDIR)/spawn-oom.Po \ internals/$(DEPDIR)/strings.Po internals/$(DEPDIR)/sysdeps.Po \ - internals/$(DEPDIR)/syslog.Po internals/$(DEPDIR)/variant.Po + internals/$(DEPDIR)/syslog.Po internals/$(DEPDIR)/userdb.Po \ + internals/$(DEPDIR)/variant.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -653,7 +659,7 @@ $(test_spawn_oom_SOURCES) $(test_strings_SOURCES) \ $(test_syntax_SOURCES) $(test_sysdeps_SOURCES) \ $(test_syslog_SOURCES) $(test_uid_permissions_SOURCES) \ - $(test_variant_SOURCES) + $(test_userdb_SOURCES) $(test_variant_SOURCES) DIST_SOURCES = $(am__libdbus_testutils_la_SOURCES_DIST) \ $(dbus_daemon_launch_helper_for_tests_SOURCES) \ $(manual_authz_SOURCES) $(manual_backtrace_SOURCES) \ @@ -683,7 +689,7 @@ $(am__test_spawn_oom_SOURCES_DIST) $(test_strings_SOURCES) \ $(test_syntax_SOURCES) $(test_sysdeps_SOURCES) \ $(test_syslog_SOURCES) $(test_uid_permissions_SOURCES) \ - $(test_variant_SOURCES) + $(test_userdb_SOURCES) $(test_variant_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ @@ -1272,6 +1278,8 @@ test_sysdeps_LDADD = libdbus-testutils.la $(GLIB_LIBS) test_syslog_SOURCES = internals/syslog.c test_syslog_LDADD = libdbus-testutils.la $(GLIB_LIBS) +test_userdb_SOURCES = internals/userdb.c +test_userdb_LDADD = libdbus-testutils.la $(GLIB_LIBS) test_variant_SOURCES = internals/variant.c test_variant_LDADD = libdbus-testutils.la $(GLIB_LIBS) manual_backtrace_SOURCES = manual-backtrace.c @@ -2126,6 +2134,12 @@ test-uid-permissions$(EXEEXT): $(test_uid_permissions_OBJECTS) $(test_uid_permissions_DEPENDENCIES) $(EXTRA_test_uid_permissions_DEPENDENCIES) @rm -f test-uid-permissions$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_uid_permissions_OBJECTS) $(test_uid_permissions_LDADD) $(LIBS) +internals/userdb.$(OBJEXT): internals/$(am__dirstamp) \ + internals/$(DEPDIR)/$(am__dirstamp) + +test-userdb$(EXEEXT): $(test_userdb_OBJECTS) $(test_userdb_DEPENDENCIES) $(EXTRA_test_userdb_DEPENDENCIES) + @rm -f test-userdb$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_userdb_OBJECTS) $(test_userdb_LDADD) $(LIBS) internals/variant.$(OBJEXT): internals/$(am__dirstamp) \ internals/$(DEPDIR)/$(am__dirstamp) @@ -2251,6 +2265,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@internals/$(DEPDIR)/strings.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@internals/$(DEPDIR)/sysdeps.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@internals/$(DEPDIR)/syslog.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@internals/$(DEPDIR)/userdb.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@internals/$(DEPDIR)/variant.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @@ -2819,6 +2834,13 @@ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) +test-userdb.log: test-userdb$(EXEEXT) + @p='test-userdb$(EXEEXT)'; \ + b='test-userdb'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) test-variant.log: test-variant$(EXEEXT) @p='test-variant$(EXEEXT)'; \ b='test-variant'; \ @@ -3042,6 +3064,7 @@ -rm -f internals/$(DEPDIR)/strings.Po -rm -f internals/$(DEPDIR)/sysdeps.Po -rm -f internals/$(DEPDIR)/syslog.Po + -rm -f internals/$(DEPDIR)/userdb.Po -rm -f internals/$(DEPDIR)/variant.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ @@ -3157,6 +3180,7 @@ -rm -f internals/$(DEPDIR)/strings.Po -rm -f internals/$(DEPDIR)/sysdeps.Po -rm -f internals/$(DEPDIR)/syslog.Po + -rm -f internals/$(DEPDIR)/userdb.Po -rm -f internals/$(DEPDIR)/variant.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dbus-1.14.8/test/internals/misc-internals.c new/dbus-1.14.10/test/internals/misc-internals.c --- old/dbus-1.14.8/test/internals/misc-internals.c 2022-10-02 16:06:53.000000000 +0200 +++ new/dbus-1.14.10/test/internals/misc-internals.c 2023-09-01 16:23:58.000000000 +0200 @@ -935,7 +935,7 @@ dbus_uid_t uid; unsigned long *group_ids; int n_group_ids, i; - DBusError error; + DBusError error = DBUS_ERROR_INIT; if (!_dbus_username_from_current_process (&username)) _dbus_test_fatal ("didn't get username"); @@ -946,8 +946,8 @@ if (!_dbus_get_user_id (username, &uid)) _dbus_test_fatal ("didn't get uid"); - if (!_dbus_groups_from_uid (uid, &group_ids, &n_group_ids)) - _dbus_test_fatal ("didn't get groups"); + if (!_dbus_groups_from_uid (uid, &group_ids, &n_group_ids, &error)) + _dbus_test_fatal ("didn't get groups: %s: %s", error.name, error.message); _dbus_test_diag (" Current user: %s homedir: %s gids:", _dbus_string_get_const_data (username), diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dbus-1.14.8/test/internals/userdb.c new/dbus-1.14.10/test/internals/userdb.c --- old/dbus-1.14.8/test/internals/userdb.c 1970-01-01 01:00:00.000000000 +0100 +++ new/dbus-1.14.10/test/internals/userdb.c 2023-09-01 16:23:58.000000000 +0200 @@ -0,0 +1,143 @@ +/* + * Copyright © 2023 Collabora Ltd. + * SPDX-License-Identifier: MIT + */ + +#include <config.h> + +#include <glib.h> + +#include <dbus/dbus.h> +#include "dbus/dbus-sysdeps.h" +#include "test-utils-glib.h" + +#ifdef DBUS_UNIX +#include <errno.h> +#include <pwd.h> +#include <sys/types.h> +#include <unistd.h> + +#include "dbus/dbus-sysdeps-unix.h" +#include "dbus/dbus-userdb.h" +#endif + +typedef struct +{ + int dummy; +} Fixture; + +static void +setup (Fixture *f G_GNUC_UNUSED, + gconstpointer context G_GNUC_UNUSED) +{ +} + +static void +test_groups_from_uid (Fixture *f, + gconstpointer context G_GNUC_UNUSED) +{ + DBusError error = DBUS_ERROR_INIT; + dbus_gid_t *gids = NULL; + int n_gids = -1; + dbus_bool_t ret; +#ifdef DBUS_UNIX + int i; +#endif + + /* We assume that uid 0 (root) is available on all Unix systems, + * so this should succeed */ + ret = _dbus_unix_groups_from_uid (0, &gids, &n_gids, &error); + +#ifdef DBUS_UNIX + test_assert_no_error (&error); + g_assert_true (ret); + g_assert_cmpint (n_gids, >=, 0); + + g_test_message ("Groups of uid 0:"); + + for (i = 0; i < n_gids; i++) + { + g_test_message ("[%d]: %ld", i, (long) gids[i]); + g_assert_cmpint (gids[i], >=, 0); + } +#else + g_assert_cmpstr (error.name, ==, DBUS_ERROR_NOT_SUPPORTED); + g_assert_false (ret); + g_test_message ("Getting Unix groups on Windows failed as expected: %s: %s", + error.name, error.message); + g_assert_null (gids); + g_assert_cmpint (n_gids, <=, 0); +#endif + + dbus_free (gids); + dbus_error_free (&error); + +#ifdef DBUS_UNIX + /* Assume that the current uid is something sensible */ + ret = _dbus_unix_groups_from_uid (geteuid (), &gids, &n_gids, &error); + test_assert_no_error (&error); + g_assert_true (ret); + g_assert_cmpint (n_gids, >=, 0); + + g_test_message ("Groups of uid %ld:", (long) geteuid ()); + + for (i = 0; i < n_gids; i++) + { + g_test_message ("[%d]: %ld", i, (long) gids[i]); + g_assert_cmpint (gids[i], >=, 0); + } + + g_test_message ("Total: %i groups", n_gids); + + dbus_free (gids); + dbus_error_free (&error); + + errno = 0; + + /* arbitrarily chosen, probably isn't a valid uid */ + if (getpwuid (31337) == NULL) + { + g_test_message ("uid 31337 doesn't exist: %s", + errno == 0 ? "(no errno)" : g_strerror (errno)); + ret = _dbus_unix_groups_from_uid (31337, &gids, &n_gids, &error); + g_assert_nonnull (error.name); + g_assert_nonnull (error.message); + g_assert_false (ret); + g_test_message ("Getting groups from non-uid failed as expected: %s: %s", + error.name, error.message); + /* The Unix implementation always clears gids/n_gids, + * even on failure, and even if they were uninitialized */ + g_assert_null (gids); + g_assert_cmpint (n_gids, ==, 0); + + dbus_free (gids); + dbus_error_free (&error); + } + else + { + g_test_skip ("against our expectations, uid 31337 exists on this system"); + } +#endif +} + +static void +teardown (Fixture *f G_GNUC_UNUSED, + gconstpointer context G_GNUC_UNUSED) +{ +} + +int +main (int argc, + char **argv) +{ + int ret; + + test_init (&argc, &argv); + + g_test_add ("/userdb/groups_from_uid", + Fixture, NULL, setup, test_groups_from_uid, teardown); + + ret = g_test_run (); + dbus_shutdown (); + return ret; +}