small pixel drawing of a pufferfish pa

guard dirname against hyphen-started names in pa-pass
arĉi arcxi@dismail.de
Tue, 25 Jun 2024 18:27:42 +0200
commit

07afbca40d18639ed32bfe49592d8a4715554e38

parent

e5484618768c971785515b24917793836e071061

1 files changed, 2 insertions(+), 2 deletions(-)

jump to
M contrib/pa-passcontrib/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