Closed GoogleCodeExporter closed 9 years ago
How about this patch instead?
Index: pump.in
===================================================================
--- pump.in (revision 755)
+++ pump.in (working copy)
@@ -181,7 +181,7 @@
# $2="-d" to make a directory. The name of the created temp file or
# directory is written to stdout.
MakeTmpFile() {
- if mktemp $2 /tmp/$1.XXXXXX; then
+ if mktemp $2 ${TMPDIR-/tmp}/$1.XXXXXX; then
: # mktemp prints the output we want; no need to do more
else
echo "$program_name: Could not make temp \"$1\"" 1>&2
Original comment by fergus.h...@gmail.com
on 4 Apr 2012 at 5:11
On Wed, 2012-04-04 at 17:11 +0000, distcc@googlecode.com wrote:
> - if mktemp $2 /tmp/$1.XXXXXX; then
> + if mktemp $2 ${TMPDIR-/tmp}/$1.XXXXXX; then
Looks good. But on closer inspection, we should protect against TMPDIR="/a dir
with spaces/" so better wrap that in quotes. $2 also for good measure...
if mktemp "$2" "${TMPDIR-/tmp}/$1.XXXXXX"; then
Original comment by kamal@whence.com
on 4 Apr 2012 at 5:23
> Looks good. But on closer inspection, we should protect against TMPDIR="/a
dir with spaces/" so better wrap that in quotes.
Done.
> $2 also for good measure...
We need to leave $2 unquoted in order to correctly handle the case when the
caller passes in only a single argument.
I'll go ahead and submit the following patch. Thanks.
Index: pump.in
===================================================================
--- pump.in (revision 755)
+++ pump.in (working copy)
@@ -181,7 +181,7 @@
# $2="-d" to make a directory. The name of the created temp file or
# directory is written to stdout.
MakeTmpFile() {
- if mktemp $2 /tmp/$1.XXXXXX; then
+ if mktemp $2 "${TMPDIR-/tmp}/$1.XXXXXX"; then
: # mktemp prints the output we want; no need to do more
else
echo "$program_name: Could not make temp \"$1\"" 1>&2
Original comment by fergus.h...@gmail.com
on 4 Apr 2012 at 5:36
Fixed in revision 756.
Original comment by fergus.h...@gmail.com
on 4 Apr 2012 at 5:52
Original issue reported on code.google.com by
kamal@whence.com
on 4 Apr 2012 at 4:27Attachments: