aboutsummaryrefslogtreecommitdiffstats
path: root/agent
diff options
context:
space:
mode:
Diffstat (limited to 'agent')
-rw-r--r--agent/ChangeLog5
-rw-r--r--agent/gpg-agent.c23
2 files changed, 6 insertions, 22 deletions
diff --git a/agent/ChangeLog b/agent/ChangeLog
index 16871b20f..5abcc67f2 100644
--- a/agent/ChangeLog
+++ b/agent/ChangeLog
@@ -1,3 +1,8 @@
+2010-10-05 Werner Koch <[email protected]>
+
+ * gpg-agent.c (main): Don't set SSH_AGENT_PID so that ssh-agent -k
+ won't kill out gpg-agent.
+
2010-09-30 Werner Koch <[email protected]>
* gpg-agent.c (agent_exit): Run cleanup.
diff --git a/agent/gpg-agent.c b/agent/gpg-agent.c
index a0e018ea3..477185c49 100644
--- a/agent/gpg-agent.c
+++ b/agent/gpg-agent.c
@@ -1054,7 +1054,7 @@ main (int argc, char **argv )
}
else if (pid)
{ /* We are the parent */
- char *infostr, *infostr_ssh_sock, *infostr_ssh_pid;
+ char *infostr, *infostr_ssh_sock;
/* Close the socket FD. */
close (fd);
@@ -1100,13 +1100,6 @@ main (int argc, char **argv )
kill (pid, SIGTERM);
exit (1);
}
- if (asprintf (&infostr_ssh_pid, "SSH_AGENT_PID=%u",
- pid) < 0)
- {
- log_error ("out of core\n");
- kill (pid, SIGTERM);
- exit (1);
- }
}
*socket_name = 0; /* Don't let cleanup() remove the socket -
@@ -1130,8 +1123,6 @@ main (int argc, char **argv )
{
es_fputs (infostr_ssh_sock, fp);
es_putc ('\n', fp);
- es_fputs (infostr_ssh_pid, fp);
- es_putc ('\n', fp);
}
es_fclose (fp);
}
@@ -1154,13 +1145,6 @@ main (int argc, char **argv )
kill (pid, SIGTERM );
exit (1);
}
- if (opt.ssh_support && putenv (infostr_ssh_pid))
- {
- log_error ("failed to set environment: %s\n",
- strerror (errno) );
- kill (pid, SIGTERM );
- exit (1);
- }
/* Close all the file descriptors except the standard
ones and those open at startup. We explicitly don't
@@ -1186,8 +1170,6 @@ main (int argc, char **argv )
{
*strchr (infostr_ssh_sock, '=') = ' ';
es_printf ("setenv %s\n", infostr_ssh_sock);
- *strchr (infostr_ssh_pid, '=') = ' ';
- es_printf ("setenv %s\n", infostr_ssh_pid);
}
}
else
@@ -1197,15 +1179,12 @@ main (int argc, char **argv )
{
es_printf ("%s; export SSH_AUTH_SOCK;\n",
infostr_ssh_sock);
- es_printf ("%s; export SSH_AGENT_PID;\n",
- infostr_ssh_pid);
}
}
xfree (infostr);
if (opt.ssh_support)
{
xfree (infostr_ssh_sock);
- xfree (infostr_ssh_pid);
}
exit (0);
}