mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-03 05:18:29 +03:00
Add check destdir exists
mkdir later is not creating parent directories and it is not desirable to use `mkdir -p` which could lead to existing directory reuse. So the parent directory should either exist or should be created.
This commit is contained in:
parent
ce18fb61c0
commit
e7b5c219ad
@ -57,6 +57,8 @@ mkdtemp() {
|
|||||||
destdir=$1
|
destdir=$1
|
||||||
template=$2
|
template=$2
|
||||||
|
|
||||||
|
test -d "$destdir" || die "DIR ('$destdir') does not exist."
|
||||||
|
|
||||||
case "$template" in
|
case "$template" in
|
||||||
*XXXX) ;;
|
*XXXX) ;;
|
||||||
*) die "Invalid template: $template (must have a suffix of at least 4 X's)";;
|
*) die "Invalid template: $template (must have a suffix of at least 4 X's)";;
|
||||||
|
Loading…
Reference in New Issue
Block a user