#!/bin/sh -fb
#Tag 0x00FF02C2

# Acrobat Reader 4.05 (acroread) creates temporary files in /tmp (or
# in directory pointed by TMP environment variable) insecurely when
# opening or printing a PDF document.  If we use /tmp malicious users
# could craft symlinks that caused files to be overwritten.

PROG="/usr/adobe/Acrobat4.0/bin/acroread.dist"
MYTMP="${HOME}/.acrobat"

export TMPDIR=$MYTMP;
export TMP=$MYTMP;

# Create the new ~/.acroread temporary directory if necessary.
# Let users symlink it to another location if they want.
# Since the link is in their home directory it should be as
# trustworthy as anything else.
if [ ! -e $MYTMP ]; then
   /bin/mkdir -m 700 $MYTMP || exit $?
fi

exec $PROG ${1+"$@"}
