#
#     tiger - A UN*X security checking system
#     Copyright (C) 1993 Douglas Lee Schales, David K. Hess, David R. Safford
#
#    This program is free software; you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation; either version 1, or (at your option)
#    any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#     Please see the file `COPYING' for the complete copyright notice.
#
# NeXT/3/config - 06/14/93
#
#-----------------------------------------------------------------------------
#

[ "$UUID" = "" ] &&
    UNAME=`whoami`

export UNAME

[ "$UNAME" != 'root' -a "$Tiger_TESTMODE" != 'Y' ] && {
   echo " " 1>&2
   echo "This script should be run from a super-user account." 1>&2
   echo " " 1>&2
#   exit 1
}

CAT=/bin/cat
LS=/bin/ls
# -g to show group ownership
LSGROUP="-g"
# -L to ls file instead of symlink
LSLINK="-L"
RM=/bin/rm
AWK=/bin/awk
GREP=/bin/grep
EGREP=/usr/bin/egrep
SGREP="$EGREP -s"
SED=/bin/sed
SORT=/usr/bin/sort
COMM=/usr/bin/comm
TAIL=/usr/ucb/tail
MV=/bin/mv
TR=/usr/bin/tr
JOIN=/usr/bin/join
GROUPSS=/usr/ucb/groups
FILECMD=/bin/file
UNIQ=/usr/bin/uniq
BASENAME=/usr/bin/basename
CHMOD=/bin/chmod
CHOWN=/usr/etc/chown
LN=/bin/ln
PASTE=/usr/bin/paste
CP=/bin/cp
DIFF=/bin/diff
MAILER=/bin/mail
SENDMAILS="/usr/lib/sendmail"
SENDMAILCF="/etc/sendmail/sendmail.cf"
export SENDMAILS SENDMAILCF
#
export CAT LS LSGROUP LSLINK RM AWK GREP EGREP SGREP SED
export SORT COMM TAIL MV TR JOIN GROUPSS FILECMD UNIQ BASENAME
export CHMOD CHOWN LN PASTE CP DIFF MAILER
#
UNAME=/usr/bin/uname
GETHOSTNAME=/bin/hostname
EXPR=/bin/expr
STRINGS=/bin/strings
FIND=/usr/bin/find
FINDXDEV=-xdev
FMT=/usr/ucb/fmt
CC=/bin/cc
PS=/bin/ps
DATE=/bin/date
DOMAINNAME=/bin/domainname
TESTLINK=-h
TESTEXEC=-x
#
#
export UNAME EXPR STRINGS FIND FINDXDEV
export FMT CC PS DOMAINNAME DATE TESTLINK TESTEXEC
WAIT=wait
#
YPCAT=/usr/bin/ypcat
#
#
#
YP=
($PS -aux | $GREP ypbind | $SGREP -v $GREP) && YP=YES
export YP
#
#
YPSERVER="NO"
($PS -aux | $GREP ypserv | $GREP -v -s $GREP) && YPSERVER="YES"
export WAIT YPCAT YPSERVER
#
MAILSPOOL=/usr/spool/mail
#
CRONSPOOL=/var/spool/cron/crontabs
#
ETCSHELLS=/etc/shells
#
export MAILSPOOL CRONSPOOL ETCSHELLS
# What type are local mounted file systems?
LOCFS="4.3"
#
export LOCFS
#
#
DEVDIRSYS="/dev/ /private/dev/"
export DEVDIRSYS

# Check read only filesystems that are mounted for suid?
#CHECKROFS="YES"
CHECKROFS="NO"
#
export CHECKROFS
CDIR="$BASEDIR/systems"
eval `
  while read var file
  do
    if [ -f "$CONFIG_DIR/$file" ]; then
      loc="$CONFIG_DIR"
    elif [ -f "$CDIR/$OS/$REL/$REV/$ARCH/$file" ]; then
      loc="$CDIR/$OS/$REL/$REV/$ARCH"
    elif [ -f "$CDIR/$OS/$REL/$REV/$file" ]; then
      loc="$CDIR/$OS/$REL/$REV"
    elif [ -f "$CDIR/$OS/$REL/$file" ]; then
      loc="$CDIR/$OS/$REL"
    elif [ -f "$CDIR/$OS/$file" ]; then
      loc="$CDIR/$OS"
    else
      loc=""
    fi
    if [ "$loc" != "" ]; then
      echo $var="$loc/$file;"
    else
      echo "$var=;"
    fi
    echo "export $var;"
  done << EOL
DATECMD datecmd
TIMECMD timecmd
GEN_PASSWD_SETS gen_passwd_sets
GEN_GROUP_SETS gen_group_sets
GEN_ALIAS_SETS gen_alias_sets
CHECK_CRON check_cron
GEN_BOOTPARAM_SETS gen_bootparam_sets
GEN_EXPORT_SETS gen_export_sets
GEN_SERVICES_SETS gen_services
GET_MOUNTS gen_mounts
SIGNATURE_FILE signatures
SERVICESFILE services
INETDFILE inetd
FILE_ACL file_access_list
SUID_LIST suid_list
REL_FILE_EXCP rel_file_exp_list
GEN_CRON_FILES gen_cron
GETCLIENTDIRS gendlclients
GEN_INETD_SETS gen_inetd
GETDISKS getdisks
EMBEDDEDLIST embedlist
GETUSERHOME getuserhome
EOL
`
