mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2026-05-09 13:08:10 +02:00
dbus-sysdeps-unix: Handle empty supplementary group list
It is valid for getsockopt(SO_PEERGROUPS) to return len=0; that
indicates the process has no supplementary groups. Rather than failing,
simply use the returned empty list (and add the primary GID to it).
Without this change, calling GetConnectionCredentials on a bus name
owned by a process with no supplementary groups does not return the
UnixGroupIDs field, even though it is easy to determine that the process
only has one GID (the primary GID).
(cherry picked from commit f8a7bffd5e)
This commit is contained in:
parent
f9b5bf68ab
commit
8a98ef62b0
1 changed files with 0 additions and 7 deletions
|
|
@ -1977,13 +1977,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));
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue