Bug 594305 - wrong users and groups creation in spec file
Summary: wrong users and groups creation in spec file
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: hal   
(Show other bugs)
Version: 6.0
Hardware: All
OS: Linux
low
high
Target Milestone: rc
: ---
Assignee: Richard Hughes
QA Contact: desktop-bugs@redhat.com
URL:
Whiteboard:
Keywords:
Depends On:
Blocks: 593683
TreeView+ depends on / blocked
 
Reported: 2010-05-20 14:45 UTC by Peter Vrabec
Modified: 2010-11-10 20:38 UTC (History)
4 users (show)

Fixed In Version: hal-0.5.14-5
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-11-10 20:38:14 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

Description Peter Vrabec 2010-05-20 14:45:24 UTC
Description of problem:

Please fix user/group creation in your spec file[1]. There were problems when
(UID != GID) && (UID<200) [2]. For example:
tryitd:x:194:482:TryIt:/:/sbin/nologin

Problem was caused by change/fix of shadow-utis behaviour. useradd does not
create group with same GID as user's UID for IDs < 200 (static/reserved) unless
it's done this way:

getent group qemu >/dev/null || groupadd -g 107 -r qemu
getent passwd qemu >/dev/null || \
  useradd -r -u 107 -g qemu -G kvm -d / -s /sbin/nologin \
    -c "qemu user" qemu


This issue should be fixed as soon as possible. Note, it can't be resolved by
any update once we have RHEL6 GA. Please fix it in Fedora too. thnx.

--------
[1] https://fedoraproject.org/wiki/Packaging:UsersAndGroups 
[2] https://bugzilla.redhat.com/show_bug.cgi?id=593683

Comment 1 Richard Hughes 2010-05-27 10:08:20 UTC
Looks fine for me. Could you please get the required qa acks.

Comment 3 Richard Hughes 2010-06-07 13:48:59 UTC
* Mon Jun 07 2010 Richard Hughes <rhughes@redhat.com> - 0.5.14-4
- Create a haldaemon group in the spec file as shadow-utils has been updated
  and no longer automatically creates a private group for UIDs < 200.
- Resolves: #594305

Comment 4 Dennis Gregorovic 2010-06-08 19:35:40 UTC
This error is now showing up in anaconda's buildinstall process:

Error in PREIN scriptlet in rpm package hal-0.5.14-4.el6.i686

useradd: group 'kvm' does not exist
error: %pre(hal-0.5.14-4.el6.i686) scriptlet failed, exit status 6
error:   install: %pre scriptlet failed (2), skipping hal-0.5.14-4.el6

This error is blocking the nightlies.  I will untag hal-0.5.14-4.el6 for now.

Comment 5 Richard Hughes 2010-06-09 08:17:59 UTC
(In reply to comment #4)
> Error in PREIN scriptlet in rpm package hal-0.5.14-4.el6.i686
> 
> useradd: group 'kvm' does not exist
> error: %pre(hal-0.5.14-4.el6.i686) scriptlet failed, exit status 6
> error:   install: %pre scriptlet failed (2), skipping hal-0.5.14-4.el6

Sincere apologies. This was a classic copy-and-paste mistake from your example. I'm building a new package now [http://brewweb.devel.redhat.com/brew/taskinfo?taskID=2504915]. Thanks.

Comment 8 Lubos Kocman 2010-06-21 14:32:53 UTC
Verified on hal-0.5.14-6.el6 (clean install of 20100620)

haldaemon group is being created during installation of hal, as shadow-utils is no longer creating automatically groups for UID < 200

$ grep hal_user_uid hal.spec 
%define hal_user_uid            68
getent group haldaemon >/dev/null || groupadd -g %{hal_user_uid} -r haldaemon
	useradd -r -u %{hal_user_uid} -g haldaemon -G haldaemon -d '/' -s /sbin/nologin \


# grep 68 /etc/group
haldaemon:x:68:haldaemon

Comment 9 releng-rhel@redhat.com 2010-11-10 20:38:14 UTC
Red Hat Enterprise Linux 6.0 is now available and should resolve
the problem described in this bug report. This report is therefore being closed
with a resolution of CURRENTRELEASE. You may reopen this bug report if the
solution does not work for you.


Note You need to log in before you can comment on or make changes to this bug.