Bug 1309709

Summary: Installation tries to create user with static uid/gid, fails if uid/gid already exists.
Product: Red Hat Enterprise Linux 7 Reporter: weimann
Component: rtkitAssignee: Michal Sekletar <msekleta>
Status: CLOSED NOTABUG QA Contact: qe-baseos-daemons
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.2CC: jscotka, weimann
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-03-05 14:48:35 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: 1400961, 1472751    

Description weimann 2016-02-18 14:31:42 UTC
Description of problem:

rtkit rpm tries to create user/group rtkit with static uid/gid 172. This fails if another package was installed previously that got assigned this uid. 

This results in GNOME not logging in at all (and a subsequent message that something went wrong), and error messages like 

 > dbus-daemon[756]: Unknown username "rtkit" in message bus configuration file


If I manually change the uid/gid of the conflicting user (unbound in my case) and reinstall rtkit, everything works as expected. 


Version-Release number of selected component (if applicable):

0.11-10.el7


How reproducible:

Happens for every workstation build in my environment. 


Actual results:

user/group rtkit are not created, rtkit doesn't work. 

Expected results:

user rtkit gets assigned a *free*, not a static uid/gid and uses this. 

Additional info:

See the %pre section in the spec file for the rtkit rpm: 
https://git.centos.org/blob/rpms!rtkit/88c2c1e7a968cf0e62c6ad474e1915dccc7b229a/SPECS!rtkit.spec

Comment 5 Michal Sekletar 2017-07-11 13:13:37 UTC
(In reply to weimann from comment #0)
> Expected results:
> 
> user rtkit gets assigned a *free*, not a static uid/gid and uses this. 
> 

This is actually expected. rtkit has static uid/gid reservation (see /usr/share/doc/setup-2.8.71/uidgid). 

Here in %pre from unbound-libs that create unbound user,

getent group unbound >/dev/null || groupadd -r unbound
getent passwd unbound >/dev/null || \
useradd -r -g unbound -d /etc/unbound -s /sbin/nologin \
-c "Unbound DNS resolver" unbound

Above seems to be correct. Script creates system user and group that should get dynamically allocated uid/gid from range SYS_UID_MIN-SYS_UID_MAX.

$ egrep 'SYS_UID_(MIN|MAX)' /etc/login.defs 
SYS_UID_MIN               201
SYS_UID_MAX               999

I don't understand how is it possible that on your system unbound user has UID that is smaller than 201.