aboutsummaryrefslogtreecommitdiffstats
path: root/pinentry-rofi.scm
diff options
context:
space:
mode:
authorFredrik Salomonsson <plattfot@gmail.com>2020-05-01 16:06:55 -0700
committerFredrik Salomonsson <plattfot@gmail.com>2020-05-01 16:06:55 -0700
commit23957c71079683daef81e376dedd212e59d1690d (patch)
treeb67965805330deb3b58e0b3a5b566ce12cc84e8a /pinentry-rofi.scm
parenta90eb5e3d5213ea52a7b750c3b569cd4dac0d28c (diff)
downloadpinentry-rofi-23957c71079683daef81e376dedd212e59d1690d.tar.gz
Return ERR instead of exiting when encounter an unknown command (#4)
This might help with the high cpu load as gpg seems to be respawning `pinentry-rofi` if it exists when encounter an unknown command. Instead it prints ERR 69 <msg>, which is the gpg error code for not implemented.
Diffstat (limited to 'pinentry-rofi.scm')
-rwxr-xr-xpinentry-rofi.scm5
1 files changed, 3 insertions, 2 deletions
diff --git a/pinentry-rofi.scm b/pinentry-rofi.scm
index 32be279..f7aaf0f 100755
--- a/pinentry-rofi.scm
+++ b/pinentry-rofi.scm
@@ -195,13 +195,14 @@ touch-file=/run/user/1000/gnupg/S.gpg-agent"
((pinentry-seterror pinentry line))
((pinentry-bye pinentry line))
(#t (begin
- (format #t "BYE\n")
(let ((log (pinentry-logfile pinentry)))
(when (file-port? log)
(format log "Unknown command: ~s\n" line)
(force-output log)))
+ ;; GPG_ERR_NOT_IMPLEMENTED == 69
+ (format #t "ERR 69 Unknown command ~s\n" line)
(force-output)
- (exit #f))))
+ (set-pinentry-ok! pinentry #f))))
(when (pinentry-ok pinentry)
(format #t "OK\n")
(force-output))