guard dirname against hyphen-started names in pa-pass
arĉi arcxi@dismail.de
Tue, 25 Jun 2024 18:27:42 +0200
1 files changed,
2 insertions(+),
2 deletions(-)
jump to
M
contrib/pa-pass
→
contrib/pa-pass
@@ -15,8 +15,8 @@
age=$(command -v age || command -v rage) find "$PASSWORD_STORE_DIR" -name '*.gpg' | while read -r passfile; do - name=$(printf '%s\n' "${passfile#"$PASSWORD_STORE_DIR/"}" | sed 's/\.gpg$//') - mkdir -p "$PA_DIR/$(dirname "$name")" + name=$(printf %s "${passfile#"$PASSWORD_STORE_DIR/"}" | sed 's/\.gpg$//') + mkdir -p "$PA_DIR/$(dirname "./$name")" gpg2 -d "$passfile" | $age -R "$basedir/recipients" -o "$PA_DIR/$name.age" printf '%s\n' "Saved '$name' to the store." done