i.passwd revision e913d9ec73b142628c1e26d0225755d49866d9e3
#
# 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 2010 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
export PATH
TEMPF="/tmp/d.$$"
do
if [ ! -f $dest ] ; then
else
#
# 2.1 version of this file had a trailing blank
# in the nobody entry. Remove it.
#
# 2.6 & earlier versions had an smtp entry; remove it.
#
# The NFS nobody users get better GECOS entries.
sed -e 's/^\(nobody:.*:\) $/\1/' \
-e '/^smtp:/d' \
-e '/^nobody:/s/:Nobody:/:NFS Anonymous Access User:/' \
-e '/^nobody4:/s/:SunOS\ 4\.x\ Nobody:/:SunOS 4.x NFS Anonymous Access User:/;' \
#
# s10 is changing root's group back to 0:
#
sed -e 's/^root:\([^:]*\):0:1:/root:\1:0:0:/' \
#
# Add the 'nobody' user from 4.x so that people don't
# assign it to a regular user and confuse themselves
#
NOBODY4_LINE="nobody4:x:65534:65534:SunOS 4.x NFS Anoymous Access User:/:"
:
else
sed '/^noaccess:x/ a\
fi
#
# Add the 'smmsp' user for sendmail 8.12
#
SMMSP_LIN="smmsp:x:25:25:SendMail Message Submission Program:/:"
:
else
sed '/^nobody4:x/ a\
fi
#
# Add the 'gdm' user if it doesn't exist.
#
OLD_GDM_LINE="gdm:x:50:50:GDM Reserved UID:/:"
echo "ERROR: Reserved UID 50 already assigned" \
:
else
sed '/^listen:x/ a\
fi
#
# Add the 'webservd' user if it doesn't exist.
#
WEBSERVD_LIN="webservd:x:80:80:WebServer Reserved UID:/:"
echo "ERROR: Reserved UID 80 already assigned" \
:
else
sed '/^gdm:x/ a\
fi
#
# Add the 'postgres' user if it doesn't exist.
#
POSTGRES_LIN="postgres:x:90:90:PostgreSQL Reserved UID:/:/usr/bin/pfksh"
echo "ERROR: Reserved UID 90 already assigned" \
echo "NOTE: postgres username already assigned" \
:
else
sed '/^webservd:x/ a\
fi
#
# Add the 'mysql' user if it doesn't exist.
#
MYSQL_LIN="mysql:x:70:70:MySQL Reserved UID:/:"
echo "ERROR: Reserved UID 70 already assigned" \
echo "NOTE: mysql username already assigned" \
:
else
sed '/^postgres:x/ a\
fi
#
# Add the 'svctag' user if it doesn't exist.
#
SVCTAG_LIN="svctag:x:95:12:Service Tag UID:/:"
echo "ERROR: Reserved UID 95 already assigned" \
echo "NOTE: svctag username already assigned" \
:
else
sed '/^postgres:x/ a\
fi
#
# Add the 'dladm' user if it doesn't exist.
#
DLADM_LIN="dladm:x:15:3:Datalink Admin:/:"
echo "ERROR: Reserved UID 15 already assigned" \
:
else
sed '/^nuucp:x/ a\
fi
#
# Add the 'xvm' user if it doesn't exist.
#
XVM_LIN="xvm:x:60:60:xVM User:/:"
echo "ERROR: Reserved UID 60 already assigned" \
echo "NOTE: xvm username already assigned" \
:
else
sed '/^gdm:x/ a\
fi
#
# Add the 'openldap' user if it doesn't exist.
#
OPENLDAP_LIN="openldap:x:75:75:OpenLDAP User:/:"
echo "ERROR: Reserved UID 75 already assigned" \
echo "NOTE: openldap username already assigned" \
:
else
sed '/^mysql:x/ a\
fi
#
# Add the 'zfssnap' user if it doesn't exist.
#
echo "ERROR: Reserved UID 51 already assigned" \
echo "NOTE: zfssnap username already assigned" \
:
else
sed '/^gdm:x/ a\
fi
#
# Add the 'upnp' user if it doesn't exist.
#
echo "ERROR: Reserved UID 52 already assigned" \
echo "NOTE: upnp username already assigned" \
:
else
sed '/^zfssnap:x/ a\
fi
#
# Add the 'unknown' user if it doesn't exist.
#
UNKNOWN_LIN="unknown:x:96:96:Unknown Remote UID:/:"
echo "ERROR: Reserved UID 96 already assigned" \
echo "NOTE: unknown username already assigned" \
:
else
sed '/^svctag:x/ a\
fi
fi
done
exit 0