diff --git a/tog-pegasus.spec b/tog-pegasus.spec index 7397d59..8577d6c 100644 --- a/tog-pegasus.spec +++ b/tog-pegasus.spec @@ -15,7 +15,7 @@ Summary: OpenPegasus WBEM Services for Linux Name: tog-pegasus Version: 2.5 -Release: 7 +Release: 8 Epoch: 2 Group: Systems Management/Base License: Open Group Pegasus Open Source @@ -204,9 +204,19 @@ if [ $1 -gt 1 ]; then elif [ $1 -eq 1 ]; then # first install: create the 'pegasus' user and group: # By default, ONLY the "pegasus" user will be allowed to connect to cimserver over network - /usr/sbin/groupadd pegasus -g 65 >/dev/null 2>&1 || :; - /usr/sbin/useradd -u 66 -c "tog-pegasus OpenPegasus WBEM/CIM services" -g pegasus \ - -s /sbin/nologin -r -d /var/lib/Pegasus pegasus >/dev/null 2>&1 || :; + # create pegasus group IFF it does not already exist + # - use any free ID between 1 and 499 if group 65 exists: + /usr/sbin/groupadd -g 65 -f -r pegasus >/dev/null 2>&1 || :; + if ! /usr/bin/id -u pegasus > /dev/null 2>&1; then + if ! /bin/egrep -q '^[^:]+:[^:]+:66:' /etc/passwd >/dev/null 2>&1 ; then + /usr/sbin/useradd -u 66 -r -n -M -g pegasus -s /sbin/nologin -r -d /var/lib/Pegasus \ + -c "tog-pegasus OpenPegasus WBEM/CIM services" pegasus >/dev/null 2>&1 || :; + else + # use any free ID between 1 and 499: + /usr/sbin/useradd -r -n -M -g pegasus -s /sbin/nologin -r -d /var/lib/Pegasus \ + -c "tog-pegasus OpenPegasus WBEM/CIM services" pegasus >/dev/null 2>&1 || :; + fi; + fi; fi %post @@ -239,6 +249,10 @@ rm -rf $RPM_BUILD_ROOT; #rm -rf ${RPM_BUILD_DIR}/%{srcname}-%{version}; %changelog +* Tue Mar 07 2006 Jason Vas Dias - 2.2.5-8 +- fix creation of userid / gid - the previous fix can fail if + gid 65 or uid 66 exists already. + * Tue Mar 7 2006 Bill Nottingham - 2:2.5-7 - use an assigned uid/gid, do not loop over user ids looking for a free one