mktemp
Richard Mealing
richard at fastnet.co.uk
Wed Apr 11 17:24:05 IST 2012
-----Original Message-----
From: mailscanner-bounces at lists.mailscanner.info [mailto:mailscanner-bounces at lists.mailscanner.info] On Behalf Of Peter Bonivart
Sent: 11 April 2012 15:58
To: MailScanner discussion
Subject: Re: mktemp
On Wed, Apr 11, 2012 at 4:25 PM, Richard Mealing <richard at fastnet.co.uk> wrote:
> usage: mktemp [-d] [-q] [-t prefix] [-u] template ...
>
> mktemp [-d] [-q] [-u] -t prefix
>
> /usr/local/libexec/MailScanner/bitdefender-wrapper: Cannot create
> temporary file
>
> usage: mktemp [-d] [-q] [-t prefix] [-u] template ...
>
> mktemp [-d] [-q] [-u] -t prefix
>
> /usr/local/libexec/MailScanner/clamav-wrapper: Cannot make name for
> temporary dir
Seems like on your platform you can't use just mktemp with no args at all. On Solaris all args are optional:
SYNOPSIS
mktemp [-dtqu] [-p directory] [template]
Try editing the wrapper files to something like this:
TempDir=$(mktemp -t tmp.XXXXXX) || { echo "$0: Cannot make name for temporary dir" >&2; exit 1; }
/peter
Thanks Peter.. That works fine.
I had already replaced it with mktemp -t tmp and that works. When I add the XXXXXX I just get a load of X's and then the unique letter combination.
It was something like this - tmp.XXXXXX.GQm45Ohl
But without I get this -
ls -l tmp.*
-rw------- 1 root clamav 0 Apr 11 17:18 tmp.XR8g1ILO
-rw------- 1 root clamav 0 Apr 11 17:18 tmp.uobA8fLv
I assume this is because it can't find the current process number or there isn't one. ?
"The trailing `Xs' are replaced with the current process number and/or a
unique letter combination. The number of unique file names mktemp can
return depends on the number of `Xs' provided; six `Xs' will result in
mktemp selecting 1 of 56800235584 (62 ** 6) possible file names."
Thanks again.
Rich
--
MailScanner mailing list
mailscanner at lists.mailscanner.info
http://lists.mailscanner.info/mailman/listinfo/mailscanner
Before posting, read http://wiki.mailscanner.info/posting
Support MailScanner development - buy the book off the website!
More information about the MailScanner
mailing list