[PATCH] Passmenu: follow symlinks

Théophile Bastian tobast at tobast.fr
Mon Feb 20 10:53:26 UTC 2023


Bash's globstar option does not follow symlinks; however, symlinks can
be useful to have multiple password-store repositories behaving like a
single one (eg. for shared repositories). As passmenu is based on
globstar to find all the password entries, it previously failed to
follow symlinks and find those passwords.
---
  contrib/dmenu/passmenu | 4 +---
  1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/contrib/dmenu/passmenu b/contrib/dmenu/passmenu
index 76d92ab..c2ab1fc 100755
--- a/contrib/dmenu/passmenu
+++ b/contrib/dmenu/passmenu
@@ -1,7 +1,5 @@
  #!/usr/bin/env bash

-shopt -s nullglob globstar
-
  typeit=0
  if [[ $1 == "--type" ]]; then
  	typeit=1
@@ -20,7 +18,7 @@ else
  fi

  prefix=${PASSWORD_STORE_DIR-~/.password-store}
-password_files=( "$prefix"/**/*.gpg )
+password_files=( $(find -L "$prefix" -name '*.gpg' | sort) )
  password_files=( "${password_files[@]#"$prefix"/}" )
  password_files=( "${password_files[@]%.gpg}" )

-- 
2.39.2


More information about the Password-Store mailing list