From: Alasdair Kergon <agk@fedoraproject.org>
To: lvm-devel@redhat.com
Subject: master - lvmdump: If dir exists check dir perms too.
Date: Wed, 6 Apr 2016 21:57:44 +0000 (UTC) [thread overview]
Message-ID: <20160406215744.EACF9601E9@fedorahosted.org> (raw)
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=f19ec0e36d64bcde6cb4cbd00376fe2377e81b19
Commit: f19ec0e36d64bcde6cb4cbd00376fe2377e81b19
Parent: 55001ae9ec2c00a070f8dfa8541f4f17a6e2a284
Author: Alasdair G Kergon <agk@redhat.com>
AuthorDate: Wed Apr 6 22:56:45 2016 +0100
Committer: Alasdair G Kergon <agk@redhat.com>
CommitterDate: Wed Apr 6 22:56:45 2016 +0100
lvmdump: If dir exists check dir perms too.
---
scripts/lvmdump.sh | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/scripts/lvmdump.sh b/scripts/lvmdump.sh
index 19b36d3..a813537 100755
--- a/scripts/lvmdump.sh
+++ b/scripts/lvmdump.sh
@@ -100,7 +100,8 @@ else
fi
if test -d $dir ; then
- (shopt -s nullglob dotglob; cd $dir && files=(*) && ((${#files[@]}))) && die 5 "Fatal: directory $dir already exists and is not empty"
+ (shopt -s nullglob dotglob; test -r $dir -a -w $dir -a -x $dir && cd $dir && files=(*) && ((! ${#files[@]}))) || \
+ die 5 "Fatal: directory $dir already exists and is not empty or inaccessible"
else
test -e $dir && die 3 "Fatal: $dir already exists"
$MKDIR -p $dir || die 4 "Fatal: could not create $dir"
reply other threads:[~2016-04-06 21:57 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160406215744.EACF9601E9@fedorahosted.org \
--to=agk@fedoraproject.org \
--cc=lvm-devel@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.