forbid trailing '/' in password names dirname strips them, which is expected, but then age is unable to save file due to missing parent directory. before switching to dirname, pa used to create ".age" file under the password name, which is probably a mistake, and it's unclear what the user intent would be there, so best to just avoid it altogether. also, reword 'Category' -> 'Name' because category is part of the name and the error sounds clearer this way: the user may not know that they create a "category" by typing an errant slash.
arĉi arcxi@dismail.de
Sat, 22 Jun 2024 14:56:49 +0200
1 files changed,
2 insertions(+),
2 deletions(-)
jump to
M
pa
→
pa
@@ -259,8 +259,8 @@
glob "$1" 'a*' && [ -f "$2.age" ] && die "Password '$2' already exists" - glob "$2" '/*' && - die "Category can't start with '/'" + glob "$2" '/*' || glob "$2" '*/' && + die "Name can't start or end with '/'" glob "$2" '../*' || glob "$2" '*/../*' && die "Category went out of bounds"