aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichal Koutný <mkoutny@suse.com>2024-01-29 11:12:10 +0100
committerMatěj Cepl <mcepl@cepl.eu>2024-01-29 11:30:34 +0100
commit53da7169e1a97320ad68f7b2305a60085523b14a (patch)
tree8dbcfdf8a4df836443e4dd12f859ec7af5a2a7d3
parent18ef97dcae8dd2b8af2dc905e11d2dbd3e452a06 (diff)
downloadpinentry-rofi-53da7169e1a97320ad68f7b2305a60085523b14a.tar.gz
When gpg-agent is run as a systemd user service (not in the session).
Also, PIN of the keyring should not be visible to other users on the system.
-rwxr-xr-xpinentry-rofi.sh4
1 files changed, 3 insertions, 1 deletions
diff --git a/pinentry-rofi.sh b/pinentry-rofi.sh
index d64a1f6..e09c60e 100755
--- a/pinentry-rofi.sh
+++ b/pinentry-rofi.sh
@@ -100,6 +100,7 @@ keyinfo=""
main () {
local temp_str
+ umask 0077
assuan_send "OK Please go ahead"
@@ -231,7 +232,8 @@ main () {
if [ "$0" = "$BASH_SOURCE" ]; then
- if [ "$XDG_SESSION_TYPE" != "tty" ] ; then
+ sess_type="${XDG_SESSION_TYPE:-}"
+ if [ "$sess_type" != "tty" ] ; then
main
else
pinentry-tty "$@"