:
#	@(#) script 23.5 91/10/25 
#
#	Copyright (C) 1991 The Santa Cruz Operation, Inc.
#		All Rights Reserved.
#	The information in this file is provided for the exclusive use of
#	the licensees of The Santa Cruz Operation, Inc.  Such users have the
#	right to use, modify, and incorporate this code into other products
#	for purposes authorized by the license agreement provided they include
#	this notice and the associated copyright notice with any such product.
#	The information in this file is provided "AS IS" without warranty.
#

UMASK=022
# to allow at/cron access by default, the deny file must be present
CREATE=deny
REMOVE=allow
STOPIO=0
LUID=0
CLEARID=0

/tcb/bin/authck -p -y
test -f /etc/shadow && /etc/pwunconv    # remove /etc/shadow if necessary

# fix up default umasks

for file in /etc/initscript /etc/cshrc /etc/profile
do
	/bin/sed "s/.*umask.*/umask $UMASK/" < $file > $file-t
	/bin/cat $file-t > $file
	/bin/rm -f $file-t
done

# specify default at/cron usability

for util in at cron
do	/tcb/bin/cps /usr/lib/cron/$util.$CREATE
	/bin/rm -f /usr/lib/cron/$util.$REMOVE
done

# configure kernel appropriately (checking if a change was in fact made)

set $STOPIO $LUID $CLEARID

TMPFILE=/tmp/relax$$

for param in sec_stopio sec_luid sec_clearid
do
	echo $param/W$1
	shift
done | /etc/_fst -w /unix > $TMPFILE

if	grep '0x0=.*0x1' /tmp/relax$$ > /dev/null ||
	grep '0x1=.*0x0' /tmp/relax$$ > /dev/null
then	echo ""
	echo "You must reboot the system to complete this change"
	echo "to the system security configuration."
	echo ""
fi

/bin/rm -f $TMPFILE

# update the link kit if it's present

if	test -x /etc/conf/cf.d/configure
then	cd /etc/conf/cf.d
	./configure SECSTOPIO=$STOPIO SECLUID=$LUID SECCLEARID=$CLEARID
fi

