From 55ec88d9e3027b37ac9b512de0f7dfa5f7ce3045 Mon Sep 17 00:00:00 2001 From: Robert Stoll Date: Thu, 10 Sep 2026 21:09:01 +0200 Subject: [PATCH] reduce the max allowed gpgDir because there is a longer socket name --- src/utility/gpg-utils.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/utility/gpg-utils.sh b/src/utility/gpg-utils.sh index 89031459..c75735d5 100644 --- a/src/utility/gpg-utils.sh +++ b/src/utility/gpg-utils.sh @@ -276,7 +276,10 @@ function getSaveGpgHomedir() { local -ra params=(gpgDir) parseFnArgs params "$@" || return $? - if ((${#gpgDir} < 100)); then + # socket path max is on certain systems 108 - longest socket name which is currently S.gpg-agent.browser (20 chars) + # 108 - 20 = 88 - 1 (NUL terminating char) 87 and to be on the safer side we use 85 + local -r maxSocketPathLength=85 + if ((${#gpgDir} <= maxSocketPathLength)); then echo "$gpgDir" else local tmpDir