From c22109df24c6eb8263aa40183a016be3437b1a0c Mon Sep 17 00:00:00 2001 From: Roman Zeyde Date: Sun, 1 Jul 2018 13:15:04 +0300 Subject: [PATCH] Document argv[0] hack for NeoPG --- contrib/neopg-trezor | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/contrib/neopg-trezor b/contrib/neopg-trezor index 71e601a..d65a013 100755 --- a/contrib/neopg-trezor +++ b/contrib/neopg-trezor @@ -8,4 +8,8 @@ binary = 'neopg' if sys.argv[1:2] == ['agent']: os.execvp(agent, [agent, '-vv'] + sys.argv[2:]) else: + # HACK: pass this script's path as argv[0], so it will be invoked again + # when NeoPG tries to run its own agent: + # https://github.com/das-labor/neopg/blob/1fe50460abe01febb118641e37aa50bc429a1786/src/neopg.cpp#L114 + # https://github.com/das-labor/neopg/blob/1fe50460abe01febb118641e37aa50bc429a1786/legacy/gnupg/common/asshelp.cpp#L217 os.execvp(binary, [__file__, 'gpg2'] + sys.argv[1:])