summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2016-02-05 01:12:18 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2016-02-05 01:14:44 +0100
commit90373f042e8ce679870c1868cb0957fb825d00d5 (patch)
treeff8c6c64697bde059499920bd4ea0d4b7d37716e /src
parentbffca1ee21a38f1e808fa83e5df2fcf0f808cb9f (diff)
downloadpass-90373f042e8ce679870c1868cb0957fb825d00d5.tar.gz
pass-90373f042e8ce679870c1868cb0957fb825d00d5.tar.bz2
pass-90373f042e8ce679870c1868cb0957fb825d00d5.zip
Handle removal of directories and passwords with the same name
Diffstat (limited to '')
-rwxr-xr-xsrc/password-store.sh9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/password-store.sh b/src/password-store.sh
index d535a74..8051451 100755
--- a/src/password-store.sh
+++ b/src/password-store.sh
@@ -490,11 +490,10 @@ cmd_delete() {
local path="$1"
check_sneaky_paths "$path"
- local passfile="$PREFIX/${path%/}"
- if [[ ! -d $passfile ]]; then
- passfile="$PREFIX/$path.gpg"
- [[ ! -f $passfile ]] && die "Error: $path is not in the password store."
- fi
+ local passdir="$PREFIX/${path%/}"
+ local passfile="$PREFIX/$path.gpg"
+ [[ -f $passfile && -d $passdir && $path == */ || ! -f $passfile ]] && passfile="$passdir"
+ [[ ! -e $passfile ]] && die "Error: $path is not in the password store."
[[ $force -eq 1 ]] || yesno "Are you sure you would like to delete $path?"
/td> 2007-07-24made the resume_loop-plugin change titles toonecoro5-7/+22 2007-07-21added logviewersnecoro7-215/+429 2007-07-21updated howtonecoro1-14/+24 2007-07-20new Plugin Schemenecoro1-5/+4 2007-07-20new Plugin Schemenecoro1-1/+1 2007-07-20new Plugin Schemenecoro9-162/+214 2007-07-13fixesnecoro4-27/+37 2007-07-13new fancier log outputnecoro14-127/+116 2007-07-11added SIGSTOP/SIGCONT support; SIGTERM now works ;)necoro8-208/+275 2007-07-09bug in shutdown pluginnecoro2-5/+12 2007-07-09added resume_loop pluginnecoro1-1/+1 2007-07-09added resume_loop pluginnecoro10-22/+162 2007-07-07some more documentationnecoro6-4/+108 2007-07-07Some documentation worknecoro7-18/+129