Bug 2090397

Summary: dbus-common: sysusers entry does not match specfile setup
Product: Red Hat Enterprise Linux 8 Reporter: Luca BRUNO <lucab>
Component: dbusAssignee: David King <dking>
Status: CLOSED ERRATA QA Contact: Petr Schindler <pschindl>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 8.6CC: pschindl, tpopela, travier, walters
Target Milestone: rcKeywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: dbus-1.12.8-20.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 2118226 (view as bug list) Environment:
Last Closed: 2022-11-08 10:53:59 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2118226    
Deadline: 2022-08-15   

Description Luca BRUNO 2022-05-25 16:41:48 UTC
The dbus specfile creates a `dbus` user and group with `81` as static IDs:
https://src.osci.redhat.com/rpms/dbus/blob/rhel-8.6.0/f/dbus.spec#_295

However the `dbus-common` package ships a sysusers.d fragment under `/usr/lib/sysusers.d/dbus` which creates a user/group with dynamic ID allocation:
```
# sysusers.d snippet for creating the D-Bus system user automatically
# at boot on systemd-based systems that ship with an unpopulated
# /etc. See sysusers.d(5) for details.

u dbus - "System Message Bus"
```

To fix misalignment, it would be good to update the sysusers fragment to use `81` as the UID/GID too.

Comment 1 Luca BRUNO 2022-05-25 16:45:45 UTC
This also affects Fedora and RHEL9. I didn't want to create a swarm of duplicate tickets, but it would be good to start fixing it there until eventually reaching 8.6.

Comment 2 Colin Walters 2022-07-07 15:54:46 UTC
Hmm.  I think though in theory, dbus could actually use a dynamic user.  Or really even better, there's no reason AFAIK it couldn't use `DynamicUser=yes` and not use sysusers or useradd at all.

Comment 3 Luca BRUNO 2022-07-08 08:19:32 UTC
For tracking purposes on the Fedora side, I copied this report to https://bugzilla.redhat.com/show_bug.cgi?id=2105177 for F36.

Comment 4 Luca BRUNO 2022-07-14 09:10:13 UTC
It turned out that there are filesystem entries in OS content owned by the `dbus` user/group, so a dynamic ID is likely not a great solution in this case.

In particular, there is at least a setGID binary shipped by the `dbus-daemon` at `/usr/libexec/dbus-1/dbus-daemon-launch-helper` and owned by the `dbus` group:
https://src.fedoraproject.org/rpms/dbus/blob/f35/f/dbus.spec#_403

For this specific user/group, I believe that a sysusers.d fragment with the Fedora-allocated static UID/GID may be the best option.

Comment 10 Petr Schindler 2022-08-15 23:01:43 UTC
dbus user is set to 81 in dbus-common in dbus-1.12.8-20.el8. No regression found during testing. All tests pass.

Comment 12 errata-xmlrpc 2022-11-08 10:53:59 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (dbus bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:7769