mirror of
https://github.com/percona/percona-toolkit.git
synced 2026-04-26 01:02:25 +08:00
Don't use basename and quote $dir in tmpdir.sh.
This commit is contained in:
+2
-2
@@ -433,11 +433,11 @@ mk_tmpdir() {
|
|||||||
|
|
||||||
if [ -n "$dir" ]; then
|
if [ -n "$dir" ]; then
|
||||||
if [ ! -d "$dir" ]; then
|
if [ ! -d "$dir" ]; then
|
||||||
mkdir $dir || die "Cannot make tmpdir $dir"
|
mkdir "$dir" || die "Cannot make tmpdir $dir"
|
||||||
fi
|
fi
|
||||||
TMPDIR="$dir"
|
TMPDIR="$dir"
|
||||||
else
|
else
|
||||||
local tool=`basename $0`
|
local tool="${0##*/}"
|
||||||
local pid="$$"
|
local pid="$$"
|
||||||
TMPDIR=`mktemp -d /tmp/${tool}.${pid}.XXXXX` \
|
TMPDIR=`mktemp -d /tmp/${tool}.${pid}.XXXXX` \
|
||||||
|| die "Cannot make secure tmpdir"
|
|| die "Cannot make secure tmpdir"
|
||||||
|
|||||||
+2
-2
@@ -39,11 +39,11 @@ mk_tmpdir() {
|
|||||||
|
|
||||||
if [ -n "$dir" ]; then
|
if [ -n "$dir" ]; then
|
||||||
if [ ! -d "$dir" ]; then
|
if [ ! -d "$dir" ]; then
|
||||||
mkdir $dir || die "Cannot make tmpdir $dir"
|
mkdir "$dir" || die "Cannot make tmpdir $dir"
|
||||||
fi
|
fi
|
||||||
TMPDIR="$dir"
|
TMPDIR="$dir"
|
||||||
else
|
else
|
||||||
local tool=`basename $0`
|
local tool="${0##*/}"
|
||||||
local pid="$$"
|
local pid="$$"
|
||||||
TMPDIR=`mktemp -d /tmp/${tool}.${pid}.XXXXX` \
|
TMPDIR=`mktemp -d /tmp/${tool}.${pid}.XXXXX` \
|
||||||
|| die "Cannot make secure tmpdir"
|
|| die "Cannot make secure tmpdir"
|
||||||
|
|||||||
Reference in New Issue
Block a user