#!/bin/sh
#

echo      "The following links from the SUNWvolr package are being removed."

ALTDIR=""
[ -n "$ROOTDIR" -a "$ROOTDIR" != "/" ] && ALTDIR="-R $ROOTDIR"
pkginfo $ALTDIR -q SUNWvolr
if [ $? -eq 0 ]; then
	echo      "The following links from the SUNWvolr package are being removed."
	REMOVEF="removef $ALTDIR"
	${REMOVEF} SUNWvolr /etc/rcS.d/K35volmgt

	${REMOVEF} SUNWvolr /etc/rc2.d/S92volmgt

	${REMOVEF} SUNWvolr /etc/rc1.d/K35volmgt

	${REMOVEF} SUNWvolr /etc/rc0.d/K35volmgt

	${REMOVEF} -f SUNWvolr || exit 2

	INSTALLF="installf $ALTDIR"

	${INSTALLF} -c initd SUNWvolr /etc/rc0.d/K05volmgt=${ROOTDIR}/etc/init.d/volmgt

	${INSTALLF} -c initd SUNWvolr /etc/rc1.d/K05volmgt=${ROOTDIR}/etc/init.d/volmgt

	${INSTALLF} -c initd SUNWvolr /etc/rc2.d/K05volmgt=${ROOTDIR}/etc/init.d/volmgt

	${INSTALLF} -c initd SUNWvolr /etc/rc3.d/S81volmgt=${ROOTDIR}/etc/init.d/volmgt

	${INSTALLF} -c initd SUNWvolr /etc/rcS.d/K05volmgt=${ROOTDIR}/etc/init.d/volmgt

	${INSTALLF} -f SUNWvolr
fi

### 4892034 Audited system calls hang if auditd killed when audit_policy == 0x5 (argv, cnt)

STARTUP=$ROOTDIR/etc/security/audit_startup
STARTUPTMP=$ROOTDIR/etc/security/audit_startup.tmp

# Check to see if the audit_startup file exists
if [ -f ${STARTUP} ]; then

	# If audit_startup exists, then remove 'setpolicy none' string
	/usr/bin/grep -v 'auditconfig -setpolicy none' $STARTUP > $STARTUPTMP
	/usr/bin/mv $STARTUPTMP $STARTUP
	/usr/bin/chmod 0744 $STARTUP
fi
