env.sh revision 7c478bd95313f5f23a4c958a745db2134aa03244
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License, Version 1.0 only
# (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 1990-2002 Sun Microsystems, Inc. All Rights Reserved.
#
#
#ident "%Z%%M% %I% %E% SMI"
dot_cshrc=".cshrc"
dot_profile=".profile"
dot_login=".login"
########## FUNCTIONS ##########
{
do
if [ -s $i ]; then
if [ $? -eq 0 ]; then
if ($2 != "") { \
if (length($2) == 1) \
print "00"$2; \
else if (length($2) == 2) \
print "0"$2; \
else \
print $2; \
} else
print "000";
}'`
echo
echo "Warning! umask set to $umask in $i - not recommended."
fi
fi
fi
fi
done
} # end check_umask
{
infile=$1
$CHMOD 600 $tmpstatus
case $infile in */$dot_profile)
;; esac
if [ -s $tmpstatus ]; then
echo
echo "Warning! \".\" is in path variable!"
echo " Check $infile file."
fi
do
echo $i
done | $SORT -u |
while read i
do
if [ -d $i -a "$i" != "." ]; then
if $IS_WRITABLE $i
then
echo
echo "Warning! Directory $i is world writable!"
echo " Should not be in path variable."
echo " Check $infile file."
fi
fi
done
$RM -f $tmpstatus
} # end check_file
#
# Usage: check_path users
# Root is always checked.
#
{
if [ $? -ne 0 ]; then
exit 1
fi
do
continue
fi
# note: execute . files as 'user', not as root
# check .cshrc
if [ -r $cshrc ]; then
> $tmppath
fi
# check .login
if [ -r $login ]; then
> $tmppath
fi
# check .profile
if [ -r $profile ]; then
> $tmppath
fi
done # for user
} # end check_path
########## MAIN ##########
echo
echo "*** Begin Enviroment Check ***"
# relocate to / so that csh can stat .
cd /
if [ "$CHECK_USERS" != "" ]
then
else
fi
echo
echo "*** End Enviroment Check ***"