Cover V03, I03
Article
Listing 1
Listing 2
Sidebar 1

may94.tar


Listing 1: profile

# Master Profile - Listing 1
#
# This .profile is modified from the original SCO .profile installed by
# sysadmsh.  In order to not violate SCO copyright, only the enhancements
# to the original .profile are included in this file
#
# Standard SCO .profile for rsh with modifications by FLenk for customer users.
# ATTENTION:  The Master Copy of this .profile is kept in /usr/public/profile.
#   The master copy must be linked into all customer's work areas.  Customers
#   use a restricted shell so the linked copy is put in the customers
#   $HOME:
#       ln /usr/public/profile customers/home/.profile
#   Oracle has not made it very clear as to how to use its product in a
#   restricted shell environment.  Therefore, this profile, as well as the menu
#   and the special Xoraenv version of oraenv are all very tightly cooperating.
#   Changing anything in any of the 3 files may break the system or defeat
#   restricted shell, or allow shell escapes.
#############################################################################
#
# There is a section below in which most custom modifications should go.
# 11/5/93.  Fred Lenk.  Modifications log follows:
#
# Put mods here...
#
#update following version string when changes are made.
pversion="11/05/93"
#
###############################################################################
# initial notes from SCO's profile go here.
###############################################################################
PATH=/bin:/usr/bin
export PATH
PID=$$
MyTTY=`tty`;export MyTTY

#SCO shell notes here
SHELL=/bin/rsh
readonly SHELL
export SHELL

#SCO mail notes here. we don't give customers access to Unix mail.

###############################################################################
#  ADD MOST OF THE CUSTOM STUFF IN THIS SECTION
#
#  DO NOT PUT APPLICATIONS SPECIFIC STUFF IN THE PROFILE.  APPLICATIONS
#  SPECIFIC STUFF SHOULD BE PUT IN DoSomething() PROCEDURE OF THE LOGIN
#  MENU.  ONLY STUFF THAT GOES HERE IS GENERAL SYSTEM AND ORACLE STUFF.
#
# Establish all generic Oracle environmental variables here.
# ORACLE_SID=whatever; export ORACLE_SID
# ORACLE_HOME=/usr/oracle;export ORACLE_HOME
# etc. with other Oracle vars.

# following checks to make sure the same username cannot login a 2nd time.
if [ "`who|grep -c $LOGNAME`" != "1" ]
then
echo "User $LOGNAME is already logged in. "
echo "If you get this message, someone else is currently using your login!"
echo "This is a serious security violation.  Please contact the"
echo "System Administrator immediately and have your password changed."
echo "You are reminded that it is a security violation to tell anyone"
echo "your login name and password."
echo "This security violation has been stored in a log file."
echo "Login .profile: $LOGNAME attempted 2nd login: `date`" >> /usr/messages/securitylog
kill $PID
exit
fi

# Check terminal type:  An additional management requirement was that the
# SysAdmin must provide customized terminal definitions for every supported PC
# terminal emulation, and every supported terminal each PC emulation provides.
# This includes Unix termdef, Oracle termdef and termdefs for every application
# used on the host.  While this has significant maintenance costs, it is
# believed that this will make the user interface easier for customers by
# being able to specify keytop labels associated with the IBM PC keyboard
# rather than the terminal being emulated.
#
# Note that the terminals referenced are quite unique to our environment, and
# will not exist on other hosts.  However, the original code has been
# left in to demonstrate the possibilities.
#
echo "(login version: $pversion)"
echo "
Please indicate the type of terminal you are using at this time.  If you
do not know what kind of terminal you have, or if your terminal is not
listed below, enter \"none\" and you will be logged off.  If you do not
know, please check with your local computer tech for clarification.  If
you enter the wrong terminal type, your screen and keyboard WILL NOT WORK
correctly.

1) PC using ANSIterm emulation (RS232 or LAN vers.) and color CRT.
2) PC using ANSIterm emulation (RS232 or LAN vers.) and mono CRT.
3) PC (HP2392a) using Reflections emulation via local PC or LAN Menu.
4) (Option not currently in use.)
5) HP2392a dumb terminal.
6) PC (VT100) using Prolinc TCP/IP (tnvt -vt100) via local PC or LAN Menu.
7) PC (VT100) using Reflections emulation via local PC or LAN Menu.
8) VT100 dumb terminal.
9) Macintosh (VT100) using VersaTerm emulation, with Standard Keyboard.
10) Macintosh (VT100/VT220) using VersaTerm emulation, with Extended Keyboard.
11) Using Softerm on IBM PC compatible.
12) System Console at Computer Center. (quasi-ANSI terminal)
13) MS-DOS Kermit, VT100 emulation.

Respond with 1-13 or \"none\" > \c"
read term
case ${term}
in
"1")
TERM=ansiterm         #custom ANSI term with color display
;;
"2")
TERM=ansimono         #custom ANSI term with mono display
;;
"3")
TERM=hprefl1          #Reflections emulation of hp2392a
;;
#"4") currently unused
"5")
TERM=hp2392a          #real hp2392a dumb terminal
;;
"6")
TERM=vtwsd            #uses tnvt -vt100 command from PC
;;                    #a TCP/IP connection
"7")
TERM=vtref            #Reflections 1 emulation of VT100
;;
"8")
TERM=vt100            #real VT100 dumb terminal, or other emulation
;;
"9")
TERM=vtmac            #Macintosh vt100 using VersaTerm
;;
"10")
TERM=vtmacx           #Macintosh ext kbd vt220 using VersaTerm
;;
"11") #1/13/93 FLenk.  Determine what Softerm is emulating...
echo "\n\nPlease indicate which of the following your Softerm PC"
echo "terminal emulation is using:\n"
echo "    1)  VT100 (vt102)"
echo "    2)  VT220"
echo "    3)  HP2392A"
echo "    4)  I don't know at this time"
echo "\nEnter 1-4 > \c"
read term2
case $term2
in
"1") TERM=vt1soft;;
"2") TERM=vt2soft;;
"3") TERM=hp23soft;;
*) #bail out
echo "\nPlease determine which terminal Softerm emulates and"
echo "try again later.  Cannot continue without knowing the"
echo "exact terminal emulated by Softerm.  Sorry."
exit;;
esac
;;
"12")
TERM=ansi              #for SCO Unix system console
;;
"13")
TERM=ker100            #Columbia U's v3.13 of 9/93
echo "\007"
echo "Configure MSCUSTOM.INI file for \"set key \270 \8\" to make"
echo "BACKSPACE key work as a BS and not DEL."
echo "(Press <ENTER> to continue...\c"
read junk
;;
*)                         #none of the above
TERM=""
echo "Sorry.  Only the above terminals are currently supported.  Bye."
exit
;;
esac
export TERM;tset

###############################################################################
#  DO NOT ADD CUSTOM STUFF BELOW THIS LINE UNLESS YOU REALLY NEED TO,
#  SUCH AS A CALL TO THE ORACLE SHELL WITH THE MENU CALL AS A PARAMETER
#
# Establish PATH.  Do not include /bin or /usr/bin in the PATH as this could
# allow user to run shell escapes.
#
PATH=/usr/rbin:$HOME/bin:$HOME/work:$ORACLE_HOME/bin:/usr/lbin
PATH=$PATH:/usr/public/bin:/sqr:/usr/esqr
readonly PATH  #do not allow path to be changed
export PATH

#
# SCO recommends changing to users $HOME/work directory
#
cd $HOME/work
#here we run a customized version of oraenv - works with restricted shell.
#the following syntax must be maintained or we loose logoff security.
#Xoraenv kicks off osh, Oracle's shell, which then starts the Login Menu.
exec /usr/lbin/Xoraenv $HOME/bin/.menu $PID

#
# Done.  The restrictions of the Restricted Bourne Shell now apply.
# Do not add any code after the previous exec.  It will not be
# executed.
# End Profile