1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

regress: avoid interference from systemwide /etc/ksh.kshrc

ksh, even non-interactive, loads /etc/ksh.kshrc by default. On
some systems this can be a problem, e.g. OpenBSD, which installs a
default /etc/ksh.kshrc which is designed for its version of pdksh.

Quoth sh.1:

    On systems that support a system wide /etc/ksh.kshrc
    initialization file, if the filename generated by the expansion
    of ENV begins with /./ or ././ the system wide initialization
    file will not be executed.

src/cmd/ksh93/tests/shtests,
src/cmd/ksh93/tests/builtins.sh,
src/cmd/ksh93/tests/options.sh,
src/cmd/ksh93/tests/pty.sh:
- Instead of emptying or unsetting ENV, ensure it is exported with
  a default value of /./dev/null so we skip loading the system-wide
  profile and load an empty user profile.
- Where a specific ENV path was required for the tests, prefix it
  with '/.' so it starts with '/./'.
This commit is contained in:
Martijn Dekker 2020-06-27 00:52:17 +02:00
parent bb4745e897
commit c870be9fea
4 changed files with 10 additions and 9 deletions

View file

@ -638,7 +638,7 @@ then [[ $(kill -l HUP) == "$(kill -L HUP)" ]] || err_exit 'kill -l and kill -L a
[[ $(kill -L) == *'9) KILL'* ]] || err_exit 'kill -L output does not contain 9) KILL'
fi
unset ENV
export ENV=/./dev/null
v=$($SHELL 2> /dev/null +o rc -ic $'getopts a:bc: opt --man\nprint $?')
[[ $v == 2* ]] || err_exit 'getopts --man does not exit 2 for interactive shells'