Files
cdesktop/cde/programs/dtlogin/config/Xsession.ow2.src
Marcin Cieslak 17a33f0430 Use KORNSHELL variable instead of /bin/ksh
This patch removes instances of hardcoded
invocation of /bin/ksh and allows to
replace it with, for, example,
/usr/local/bin/ksh93

Also "ksh93" is accepted whenever "ksh" is.

Tested using the following /bin/ksh:

----8<----
WHAT=`ps -o command= -p $PPID`
msg="Something tried to call /bin/ksh: $PPID: $WHAT"
print -u2 "$msg"
logger user.warn "$msg"
exit 99
----8<----
(Warning: first two lines are FreeBSD specific)

Scripts from Makefiles should now be executed either
with

$(KORNSHELL) korn-shell-script

or

$(SHELL) bourne-shell-script

therefore #!/bin/ksh has not been changed everywhere.

/usr/dt/bin/ scripts have been converted (e.g. Xsession)

Whenever possible Imake and CPP facilities have been used.

For C and C++ programs KORNSHELL needs to be defined to
"/path/to/your/ksh" (with quotes) so that it can make
a valid C constant.

Therefore, when adding KORNSHELL to Imakefile for C files,
you have to add

CXXEXTRA_DEFINES = -DKORNSHELL=\"$(KORNSHELL)\"

or similar (for example, see programs/dtprintinfo)

But for simple shell script substitution we usually change

 LOCAL_CPP_DEFINES = -DCDE_CONFIGURATION_TOP=$(CDE_CONFIGURATION_TOP) \
                     -DCDE_INSTALLATION_TOP=$(CDE_INSTALLATION_TOP) \
                     -DCDE_LOGFILES_TOP=$(CDE_LOGFILES_TOP)

to:

 LOCAL_CPP_DEFINES = -DCDE_CONFIGURATION_TOP=$(CDE_CONFIGURATION_TOP) \
                     -DCDE_INSTALLATION_TOP=$(CDE_INSTALLATION_TOP) \
                     -DCDE_LOGFILES_TOP=$(CDE_LOGFILES_TOP) \
                     -DKORNSHELL=$(KORNSHELL) \
                     -DXPROJECTROOT=X11ProjectRoot

since we don't want quotes for shell scripts.
2012-08-23 20:00:43 -06:00

53 lines
1.4 KiB
Plaintext

XCOMM!KORNSHELL
XCOMM $XConsortium: Xsession.ow2.src /main/3 1996/11/19 11:41:57 drk $
XCOMM ####################################################################
XCOMM ## File: Xsession.ow2
XCOMM ##
XCOMM ## Default Location: /usr/dt/config/Xsession.ow2
XCOMM ##
XCOMM ## Purpose: OpenWindows Desktop start script
XCOMM ##
XCOMM ## Invoked by: /usr/dt/bin/Xsession
XCOMM ##
XCOMM ## Revision: @(#)Xsession.ow2.src 1.3 95/02/16
XCOMM ##
XCOMM ## (c) Copyright 1993, 1994, 1995 Sun Microsystems, Inc.
XCOMM ##
XCOMM ####################################################################
XCOMM First a little namespace cleanup of vars associated with this
XCOMM (and /usr/dt/bin/Xsession.ow) scripts.
unset SDT_ALT_SESSION
unset SDT_ALT_HELLO
unset SDT_NO_DSDM
XCOMM
XCOMM Find "xinitrc" file by standard precedence rules and start
XCOMM the user's OpenWindows Desktop.
XCOMM
DEFAULT_XINITRC="/usr/openwin/lib/Xinitrc"
HOME_XINITRC="$HOME/.xinitrc"
if [ -z "$XINITRC" ]; then
if [ -f $HOME_XINITRC ]; then
XINITRC=$HOME_XINITRC
else
XINITRC=$DEFAULT_XINITRC
fi
fi
echo "OpenWindows Desktop Login"
if [ -f $XINITRC ]; then
echo "using xinitrc file: $XINITRC"
/bin/ksh $XINITRC
else
echo "xinitrc file: $XINITRC not found"
if [ -f $DEFAULT_XINITRC ]; then
echo "using xinitrc: $DEFAULT_XINITRC"
/bin/ksh $DEFAULT_XINITRC
fi
fi