i.group revision eecb47bb5e717cff09df635438d3babe0922c6b0
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
export PATH
TEMPF="/tmp/g.$$"
do
if [ ! -f $dest ] ; then
else
#
# Strip off any leading "/a"
#
#
# Add the sysadmin group (gid 14) to support admintool
#
if [ $? = 0 ] ; then
cur_name="sysadmin"
echo "sysadmin::14:" >> $dest
echo "sysadmin::14:" >> $dest
else # add the group
echo "sysadmin::14:" >> $dest
fi
#
# Add the 'nogroup' group from 4.x so that people don't
# assign it to a regular user and confuse themselves
#
NOGROUP_LINE="nogroup::65534:"
:
else
sed '/^noaccess::60002:/ a\
fi
sed '
/^root:/s/\([:,]\)root,/\1/;
/^root:/s/,root$//;
/^root:/s/:root$/:/;
/^bin:/s/\([:,]\)bin,/\1/;
/^bin:/s/,bin$//;
/^bin:/s/:bin$/:/;
/^sys:/s/\([:,]\)sys,/\1/;
/^sys:/s/,sys$//;
/^sys:/s/:sys$/:/;
/^adm:/s/\([:,]\)adm,/\1/;
/^adm:/s/,adm$//;
/^adm:/s/:adm$/:/;
/^tty:/s/\([:,]\)tty,/\1/;
/^tty:/s/,tty$//;
/^tty:/s/:tty$/:/;
/^uucp:/s/\([:,]\)uucp,/\1/;
/^uucp:/s/,uucp$//;
/^uucp:/s/:uucp$/:/;
/^nuucp:/s/\([:,]\)nuucp,/\1/;
/^nuucp:/s/,nuucp$//;
/^nuucp:/s/:nuucp$/:/;
/^daemon:/s/\([:,]\)daemon,/\1/;
/^daemon:/s/,daemon$//;
/^daemon:/s/:daemon$/:/;
/^smmsp:/s/\([:,]\)smmsp,/\1/;
/^smmsp:/s/,smmsp$//;
/^smmsp:/s/:smmsp$/:/;
/^lp:/s/\([:,]\)lp,/\1/;
/^lp:/s/,lp$//;
#add 'root' to user-list of group1
# line 1,2: skip any line with root in the user field
# line 3: users already in list, add "root,"
# line 4: no users in list, add "root"
sed '
/[:,]root,/b
/[:,]root$/b
s/:1:\([^:][^:]*\)$/:1:root,\1/;
s/:1:$/:1:root/;
#
# Add the 'smmsp' group for sendmail 8.12
#
SMMSPGROUP_LINE="smmsp::25:"
:
else
sed '/^nogroup::65534:/ a\
fi
#
# Add the 'gdm' group if it doesn't already exist.
#
GDMGROUP_LINE="gdm::50:"
echo "ERROR: Reserved GID 50 already assigned" \
:
else
sed '/^smmsp::25:/ a\
fi
#
# Add the 'upnp' group if it doesn't already exist.
#
UPNPGROUP_LINE="upnp::52:"
echo "ERROR: Reserved GID 52 already assigned" \
:
else
sed '/^gdm::50:/ a\
fi
#
# Add the 'webservd' group if it doesn't already exist.
#
WEBSERVDGROUP_LINE="webservd::80:"
echo "ERROR: Reserved GID 80 already assigned" \
:
else
sed '/^upnp::50:/ a\
fi
#
# Add the 'postgres' group if it doesn't already exist.
#
POSTGRESGROUP_LINE="postgres::90:"
echo "ERROR: Reserved GID 90 already assigned" \
echo "NOTE: postgres group already assigned" \
:
else
sed '/^webservd::80:/ a\
fi
#
# Add the 'mysql' group if it doesn't already exist.
#
MYSQLGROUP_LINE="mysql::70:"
echo "ERROR: Reserved GID 70 already assigned" \
echo "NOTE: mysql group already assigned" \
:
else
sed '/^postgres::90:/ a\
fi
#
# Add the 'games' group if it doesn't already exist.
#
GAMESGROUP_LINE="games::20:"
echo "ERROR: Reserved GID 20 already assigned" \
echo "NOTE: games group already assigned" \
:
else
sed '/^smmsp::25:/ a\
fi
#
# Add the 'xvm' group if it doesn't already exist.
#
XVMGROUP_LINE="xvm::60:"
echo "ERROR: Reserved GID 60 already assigned" \
echo "NOTE: xvm group already assigned" \
:
else
sed '/^mysql::70:/ a\
fi
#
# Add the 'slocate' group if it doesn't already exist.
#
SLOCATEGROUP_LINE="slocate::95:"
echo "ERROR: Reserved GID 95 already assigned" \
echo "NOTE: slocate group already assigned" \
:
else
sed '/^postgres::90:/ a\
fi
#
# Add the 'openldap' group if it doesn't already exist.
#
OPENLDAPGROUP_LINE="openldap::75:"
echo "ERROR: Reserved GID 75 already assigned" \
echo "NOTE: openldap group already assigned" \
:
else
sed '/^mysql::70:/ a\
fi
fi
done
exit 0