diff --git a/NEWS b/NEWS index 50fe61e0..f21b5b0c 100644 --- a/NEWS +++ b/NEWS @@ -1,7 +1,11 @@ dbus 1.14.10 (UNRELEASED) ========================= -... +Bug fixes: + +• 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 --git a/dbus/dbus-sysdeps-unix.c b/dbus/dbus-sysdeps-unix.c index 6b32df66..099637cb 100644 --- a/dbus/dbus-sysdeps-unix.c +++ b/dbus/dbus-sysdeps-unix.c @@ -1932,6 +1932,8 @@ add_groups_to_credentials (int client_fd, { #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 @@ add_groups_to_credentials (int client_fd, _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));