[PATCH] Remove the environment file when quitting.

Werner Koch wk at gnupg.org
Wed Sep 28 16:20:21 CEST 2011


On Tue, 27 Sep 2011 10:50, luca at pca.it said:

> 1) remotely-mounted home directories could be a problem if their
>    filesystems do not support fifos or sockets.  And Debian cares about
>    NFS-mounted home directories:

Right.  However the majority of users don't have NFS mounted home
directories and those who have do have an admin to ask what to do. 
gpg-agent provides an option to revert back to the old behaviour/

> 2) gpg-agent's manpage still thinks that using GPG_AGENT_INFO is the
>    first choice and *then* falling back to the standard socket:

Quite possible.  Our development resources are limited and updates to
the documentation of the stable release is unfortunately not a primary
target.

> 3) Debian gpg-agent_2.0.18 is compiled without --enable-standard-socket,
>    but this is easily fixable ;-)

That might be a good thing to do.  It would give us some feedback.

> I would say that we should also check if the agent is running:
>
>   if [ "$PS1" ] && gpg-agent 2>/dev/null; then

There is no need for it.  Really.  If you want the agent for ssh, you
may simply start it in the interactive shell

  gpg-connect-agent /bye

it does nothing if the agent is already running.

> Going back to the subject: what is the reason for the environment file
> not being deleted when quitting?  As I wrote in my first email, I have

You can't delete the environment variables either.

Deleting the file may also exhibit a race if at the same time another
agent is started.  Note also that gpg-agent terminates itself if it
detects another running instance or a started child process has
terminated.

> fail to see why ATM only the sockets are deleted.  If there is no socket
> gpg-agent is not running, thus keeping the now-useless environment
> variables somewhere does not seem right to me.

You can't remove environment variables of another process.


Salam-Shalom,

   Werner

-- 
Die Gedanken sind frei.  Ausnahmen regelt ein Bundesgesetz.




More information about the Gnupg-devel mailing list