Skip to content

Commit

Permalink
Fix mktemp on FreeBSD11 flags #226 (#230)
Browse files Browse the repository at this point in the history
  • Loading branch information
Snelius30 authored and shawniverson committed Oct 3, 2018
1 parent 4367b27 commit cf1c302
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions common/usr/lib/MailScanner/wrapper/clamav-wrapper
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#

#OS Name
OSType=`/usr/bin/env uname -s`

# this passed from the CLI
# ./scanner-wrapper /path/to/av/bin /thing/to/scan
ClamScan=$1/bin/clamscan
Expand Down Expand Up @@ -144,7 +147,11 @@ fi
[ -d ${IWD} ] || mkdir -p ${IWD}

# create our working tmp directory in the base tmp directory
TempDir=`mktemp -d --tmpdir=${IWD}`
if [ "${OSType}" = "FreeBSD" ]; then
TempDir=`TMPDIR=${IWD} mktemp -d`
else
TempDir=`mktemp -d --tmpdir=${IWD}`
fi

# In case we get interupted....
trap "rm -rf ${TempDir}" EXIT
Expand Down Expand Up @@ -179,4 +186,4 @@ if [ -d ${TempDir} ]; then
rm -rf ${TempDir}
fi

exit $retval
exit $retval

0 comments on commit cf1c302

Please sign in to comment.