[bug-notifications] [cas_usergroup 0004761]: CSWpuppet fails to install if a group 100 is already used

Mantis Bug Tracker noreply at opencsw.org
Sun Apr 24 23:23:02 CEST 2011


The following issue has been ASSIGNED. 
====================================================================== 
https://www.opencsw.org/mantis/view.php?id=4761 
====================================================================== 
Reported By:                alop
Assigned To:                markp
====================================================================== 
Project:                    cas_usergroup
Issue ID:                   4761
Category:                   packaging
Reproducibility:            always
Severity:                   block
Priority:                   normal
Status:                     assigned
====================================================================== 
Date Submitted:             2011-04-22 22:49 CEST
Last Modified:              2011-04-24 23:23 CEST
====================================================================== 
Summary:                    CSWpuppet fails to install if a group 100 is already
used
Description: 
=> Installing CSWpuppet-2.6.6,REV=2011.03.13 (1/1) ...
Please see /opt/csw/share/doc/puppet/license for license information.
Installing class <cswusergroup> ...
UX: groupadd: ERROR: 100 is already in use.  Choose another.
ERROR: Failed to add group puppet
pkgadd: ERROR: class action script did not complete successfully

Installation of <CSWpuppet> failed.
Exiting pkgutil due to pkgadd error: 1
bash-3.00# group
bash-3.00# grep 100 /etc/group 
bash-3.00# groupadd -g 100 moo
UX: groupadd: ERROR: 100 is already in use.  Choose another.

/etc/nsswitch.conf has
group:      files ldap [TRYAGAIN=continue]

getent group 100 -returns the already existing group
====================================================================== 

---------------------------------------------------------------------- 
 (0008991) bwalton (manager) - 2011-04-23 01:42
 https://www.opencsw.org/mantis/view.php?id=4761#c8991 
---------------------------------------------------------------------- 
Can you please simulate this function (run via /bin/sh -x) on your box with
GID_MIN set to either 100 or your local system value (provide that info if
not 100).  GID_MAX should be 999 (or your local value).

Thanks
-Ben

first_avail_gid() {
  for gid in `/usr/bin/getent group | cut -d: -f3 | sort -n`
  do
    [ $gid -lt $GID_MIN ] && continue
    [ $gid -gt $GID_MAX ] && break
    eval GID_TAKEN_$gid=1
  done

  gid=$GID_MIN
  while test $gid -le $GID_MAX
  do
    [ `eval echo \$\{GID_TAKEN_$gid:-0}` -eq 1 ] || { echo $gid; return;
}
    gid=`expr $gid + 1`
  done
  echo -1
}



More information about the bug-notifications mailing list