[Triage-desktop] [Bug 5908] KWallet GPG don't work

bugzilla-daemon bugzilla-daemon at rosalab.ru
Sat Aug 22 05:52:15 MSK 2015


Zombie Ryushu <zombie_ryushu at yahoo.com> changed:

           What    |Removed                     |Added
                 CC|                            |zombie_ryushu at yahoo.com

--- Comment #5 from Zombie Ryushu <zombie_ryushu at yahoo.com> ---
I'm genuinely hoping this does not sound like word salad.

Gpg-agent creates a socket, that socket's location changes at every startup.
Gpg-agent stores that sockets info in an env var called $GPG_AGENT_INFO.
optionally gpg-agent can write that info to a file.

When gpg-agent creates the env var, it only does so for the current shell. Any
other shell does not get updated.

If you launch gpg-agent as part of KDE or bash_profile, it works because it
creates the env var in KDE or bash's shell respectively. Thus program can find
the socket's location.

It's dependant on the timing of network manager's connection attempt and it's
not fault tolerant. I.e. if gpg-agent crashes then it must be reloaded but no
child shell will get the updated env var for the new socket location, (because
it changes every time gpg-agent starts up), so for the child shells it stops

There is also no support for a TTY as if its part of bash profile, then  new
instance of gpg-agent will be created, and thus a new socket, for each console
window you open in a window manager or for each news TTY session you open.

 On the other hand, if you start gpg-agent via systemd in user mode, then all
of the above is corrected but a new issue appears.

I.e. systemd spawns processes in a unique shell for that process. So the env
var that gpg-agent creates never gets used because it only exists in the shell
that systemd created for gpg-agent not the users active shell. Also that env
var is destroyed shortly after it is created because gpg-agent is a forking
process that will terminate its parent process after using it to create the env
var, and systemd will terminate the shell it spawned when the gpg-agent parent
process terminates as its no longer needed.

As a result the only way to get that info to other programs when using systemd
is the env file option for gpg-agent. But that also has an issue.

You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rosalab.ru/pipermail/triage-desktop/attachments/20150822/85943474/attachment.html>

More information about the Triage-desktop mailing list