mirror of
https://github.com/Llewellynvdm/Tomb.git
synced 2025-01-03 14:17:37 +00:00
forge and create refuse to overwrite existing files
This commit is contained in:
parent
28a52f5851
commit
61362ce34e
14
tomb
14
tomb
@ -865,10 +865,13 @@ print "-----END PGP MESSAGE-----"
|
||||
forge_key() {
|
||||
_message "Commanded to forge key $1"
|
||||
|
||||
if ! [ $1 ]; then
|
||||
{ test "$1" = "" } && {
|
||||
_warning "no key name specified for creation"
|
||||
return 1
|
||||
fi
|
||||
return 1 }
|
||||
|
||||
{ test -r "$1" } && {
|
||||
_warning "Forging this key would overwrite an existing file. Operation aborted."
|
||||
die "`ls -lh $1`" }
|
||||
|
||||
# if swap is on, we remind the user about possible data leaks to disk
|
||||
if ! option_is_set -f && ! option_is_set --ignore-swap; then check_swap; fi
|
||||
@ -1117,6 +1120,11 @@ create_tomb() {
|
||||
return 1
|
||||
fi
|
||||
|
||||
|
||||
{ test -r "$1" } && {
|
||||
_warning "Creating this tomb would overwrite an existing file. Operation aborted."
|
||||
die "`ls -lh $1`" }
|
||||
|
||||
dig_tomb ${=PARAM}
|
||||
{ test $? = 0 } || { die "Failed to dig tomb, operation aborted." }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user