tMerge pull request #17 from davinerd/fix_issue3 - tomb - the crypto undertaker
HTML git clone git://parazyd.org/tomb.git
DIR Log
DIR Files
DIR Refs
DIR README
DIR LICENSE
---
DIR commit 7b2fc78b1974297b3278e21e0784a4542640f115
DIR parent b18ef6c27b6b1cb191c9b0e092cca6897c1bca75
HTML Author: DJR <jaromil@dyne.org>
Date: Mon, 1 Aug 2011 13:31:50 -0700
Merge pull request #17 from davinerd/fix_issue3
fix issue #3
create now avoids ovewriting an existing tomb key: quits with error.
Diffstat:
M src/tomb | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
---
DIR diff --git a/src/tomb b/src/tomb
t@@ -311,9 +311,15 @@ create_tomb() {
tombfile=${tombname}.tomb
if [ -e ${tombdir}/${tombfile} ]; then
- error "tomb exists already. I'm not digging here:"
- ls -lh ${tombdir}/${tombfile}
- return 1
+ error "tomb exists already. I'm not digging here:"
+ ls -lh ${tombdir}/${tombfile}
+ return 1
+ fi
+
+ if [ -e ${tombdir}/${tombfile}.key ]; then
+ error "tomb key already exists. Quitting."
+ ls -lh ${tombdir}/${tombfile}.key
+ return 1
fi
notice "Creating a new tomb in ${tombdir}/${tombfile}"