lockbox

password manager
Log | Files | Refs | README | LICENSE

commit 9547bd36873333865e17c4f5715b3f17acc8fc91
parent 988578c2cb6eaa14cc10bbd8a0b5ce7dd69e1e24
Author: Sean Enck <sean@ttypty.com>
Date:   Wed, 13 Jul 2022 19:17:34 -0400

allow glob all, special case

Diffstat:
Mcmd/lb/main.go | 16++++++++++++----
Mtests/expected.log | 4++--
Mtests/run.sh | 4++--
3 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/cmd/lb/main.go b/cmd/lb/main.go @@ -171,11 +171,19 @@ func main() { isShow := command == "show" || isDump entries := []string{inEntry} if strings.Contains(inEntry, "*") { - matches, err := filepath.Glob(inEntry) - if err != nil { - internal.Die("bad glob", err) + if inEntry == getEntry(store, []string{"***"}, 0) { + all, err := internal.Find(store, false) + if err != nil { + internal.Die("unable to get all files", err) + } + entries = all + } else { + matches, err := filepath.Glob(inEntry) + if err != nil { + internal.Die("bad glob", err) + } + entries = matches } - entries = matches } isGlob := len(entries) > 1 if isGlob { diff --git a/tests/expected.log b/tests/expected.log @@ -1,3 +1,5 @@ +[ +] HOOK RAN @@ -52,5 +54,3 @@ remove entry? (y/N) HOOK RAN unable to decrypt (decrypt not ok) rekeying: /keys/one2.lb test2 -[ -] diff --git a/tests/run.sh b/tests/run.sh @@ -34,10 +34,11 @@ _hook() { } _run() { + echo "y" | "$BIN/lb" dump -yes "*" echo "test" | "$BIN/lb" insert keys/one echo "test2" | "$BIN/lb" insert keys/one2 "$BIN/lb" show keys/* - "$BIN/lb" dump -yes 'keys/*' + "$BIN/lb" dump -yes '***' echo -e "test3\ntest4" | "$BIN/lb" insert keys2/three "$BIN/lb" ls "$BIN/lb-pwgen" -special -length 10 @@ -60,7 +61,6 @@ _run() { LOCKBOX_KEY="invalid" "$BIN/lb" show keys/one2 "$BIN/lb-rekey" -outkey "test" -outmode "plaintext" "$BIN/lb-rw" -file bin/lb/keys/one2.lb -key "test" -keymode "plaintext" -mode "decrypt" - echo "y" | "$BIN/lb" dump -yes "*" } LOG=$TESTS/lb.log