opnsense-src/tools/regression/bin/sh/parameters/mail2.0
Jilles Tjoelker f08f4ed374 MFC r203576,r203677: sh: Don't stat() $MAIL/$MAILPATH if not interactive.
These may be NFS mounted, and we should not touch them unless we are going
to do something useful with the information.
2010-04-20 22:52:28 +00:00

15 lines
377 B
Text

# $FreeBSD$
# Test that an interactive shell accesses $MAIL.
goodfile=/var/empty/sh-test-goodfile
mailfile=/var/empty/sh-test-mailfile
T=$(mktemp sh-test.XXXXXX) || exit
ENV=$goodfile MAIL=$mailfile ktrace -i -f "$T" sh +m -i </dev/null >/dev/null 2>&1
if ! grep -q $goodfile "$T"; then
# ktrace problem
rc=0
elif grep -q $mailfile "$T"; then
rc=0
fi
rm "$T"
exit ${rc:-3}