[svn] GnuPG - r4936 - in trunk: common doc
svn author wk
cvs at cvs.gnupg.org
Mon Mar 2 12:53:32 CET 2009
Author: wk
Date: 2009-03-02 12:53:32 +0100 (Mon, 02 Mar 2009)
New Revision: 4936
Modified:
trunk/common/homedir.c
trunk/doc/ChangeLog
trunk/doc/gpg-agent.texi
Log:
Modernized gpg-agent startup instructions
Modified: trunk/doc/ChangeLog
===================================================================
--- trunk/doc/ChangeLog 2009-03-02 10:26:37 UTC (rev 4935)
+++ trunk/doc/ChangeLog 2009-03-02 11:53:32 UTC (rev 4936)
@@ -1,3 +1,7 @@
+2009-03-02 Werner Koch <wk at g10code.com>
+
+ * gpg-agent.texi (Invoking GPG-AGENT): Modernized instructions.
+
2009-01-12 Werner Koch <wk at g10code.com>
* faq.raw: Fix bug reorting address.
Modified: trunk/common/homedir.c
===================================================================
--- trunk/common/homedir.c 2009-03-02 10:26:37 UTC (rev 4935)
+++ trunk/common/homedir.c 2009-03-02 11:53:32 UTC (rev 4936)
@@ -86,7 +86,7 @@
/* Get the standard home directory. In general this function should
not be used as it does not consider a registry value (under W32) or
- the GNUPGHOME encironment variable. It is better to use
+ the GNUPGHOME environment variable. It is better to use
default_homedir(). */
const char *
standard_homedir (void)
Modified: trunk/doc/gpg-agent.texi
===================================================================
--- trunk/doc/gpg-agent.texi 2009-03-02 10:26:37 UTC (rev 4935)
+++ trunk/doc/gpg-agent.texi 2009-03-02 11:53:32 UTC (rev 4936)
@@ -61,23 +61,36 @@
sure that only one is running: @command{gpg-agent} uses an environment
variable to inform clients about the communication parameters. You can
write the content of this environment variable to a file so that you can
-test for a running agent. This short script may do the job:
+test for a running agent. Here is an example using Bourne shell synax:
@smallexample
-if test -f $HOME/.gpg-agent-info && \
- kill -0 $(cut -d: -f 2 $HOME/.gpg-agent-info) 2>/dev/null; then
- GPG_AGENT_INFO=$(cat $HOME/.gpg-agent-info)
- export GPG_AGENT_INFO
-else
- eval $(gpg-agent --daemon)
- echo $GPG_AGENT_INFO >$HOME/.gpg-agent-info
+gpg-agent --daemon --enable-ssh-support \
+ --write-env-file "$@{HOME@}/.gpg-agent-info"
+ at end smallexample
+
+This code should only be run once per user session to initially fire up
+the agent. In the example the optional support for the included Secure
+Shell agent is enabled and the information about the agent is written to
+a file in the HOME directory. Note that by running gpg-agent without
+arguments you may test whether an agent is already running; however such
+a test may lead to a race condition, thus it is not suggested.
+
+ at noindent
+The second script needs to be run for each interactive session:
+
+ at smallexample
+if [ -f "$@{HOME@}/.gpg-agent-info" ]; then
+ . "$@{HOME@}/.gpg-agent-info"
+ export GPG_AGENT_INFO
+ export SSH_AUTH_SOCK
+ export SSH_AGENT_PID
fi
@end smallexample
@noindent
-Note that the new option @option{--write-env-file} may be used instead.
+It reads the data out of the file and exports the variables. If you
+don't use Secure Shell, you don't need the last two export statements.
-
@noindent
You should always add the following lines to your @code{.bashrc} or
whatever initialization file is used for all shell invocations:
More information about the Gnupg-commits
mailing list