#!/sbin/sh
#@(#)$Revision: 1.2 $	$Date: 92/07/19 21:54:28 $
#
# Xstartup
#
# This is the shell script that is run as root for the display manager
# before each individual X session.
#

PwAging ()
{
  #
  # Not supported on HP-UX 10.0
  #
PWEXPD=/usr/bin/X11/700X/pwexpd
if [ -x $PWEXPD ]; then
	
	while $PWEXPD $USER
	do
		su $USER -c "xterm -geometry 80x10+270+270 -e passwd $USER"
	done
fi
}

NoRoot ()
{
if [ $USER = root ] ; then
	scratch_file=/tmp$$
	echo "echo Login as root not allowed." > $scratch_file  
	echo "echo \"-- hit <enter> --\"" >> $scratch_file  
	echo "read x" >> $scratch_file  
	xterm -geometry 80x5+270+270  -e /sbin/sh $scratch_file  
	rm $scratch_file
	exit 1
fi
}

#             Prevention of login as root
#             from all X stations.
#
#NoRoot #	DON'T TOUCH this line. Edit it using xtadm script.

#             For systems that support password aging - mostly SYS V, - 
#             see unix documentation passwd{4}
#
#PwAging #	DON'T TOUCH this line. Edit it using xtadm script. 

#
# put entry for user in utmp and wtmp files
#
sessreg.sh -a


if [ "$USER" != "root" -a -x /usr/bin/X11/700X/admin/mountfloppy ] 
then
  /usr/bin/X11/700X/admin/mountfloppy $DISPLAY $USER $HOME/floppy
  :
fi

