Merge branch '1.14-empty-group-list' into 'dbus-1.14'

Backport dbus!422 to 1.14.x

See merge request dbus/dbus!434
This commit is contained in:
Simon McVittie 2023-08-18 12:35:32 +00:00
commit 8bd071a911
2 changed files with 7 additions and 8 deletions

6
NEWS
View file

@ -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)
========================

View file

@ -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));