2008-04-06 05:55:31 +02:00
|
|
|
# create gpg-agent socket in TMPDIR
|
2009-11-16 18:35:33 +01:00
|
|
|
Index: gnupg-2.0.13/agent/gpg-agent.c
|
2009-06-20 01:33:05 +02:00
|
|
|
===================================================================
|
2009-11-16 18:35:33 +01:00
|
|
|
--- gnupg-2.0.13.orig/agent/gpg-agent.c 2009-07-20 12:12:06.000000000 +0200
|
|
|
|
+++ gnupg-2.0.13/agent/gpg-agent.c 2009-11-13 13:00:55.000000000 +0100
|
|
|
|
@@ -960,6 +960,10 @@ main (int argc, char **argv )
|
2008-01-10 14:14:30 +01:00
|
|
|
gnupg_fd_t fd_ssh;
|
2007-01-16 00:15:33 +01:00
|
|
|
pid_t pid;
|
|
|
|
|
|
|
|
+ char *tmp1, *tmp;
|
|
|
|
+ char *tmp2 = "gpg-XXXXXX/S.gpg-agent";
|
|
|
|
+ size_t len;
|
|
|
|
+
|
|
|
|
/* Remove the DISPLAY variable so that a pinentry does not
|
|
|
|
default to a specific display. There is still a default
|
|
|
|
display when gpg-agent was started using --display or a
|
2009-11-16 18:35:33 +01:00
|
|
|
@@ -971,13 +975,23 @@ main (int argc, char **argv )
|
2007-01-16 00:15:33 +01:00
|
|
|
unsetenv ("DISPLAY");
|
|
|
|
#endif
|
|
|
|
|
|
|
|
+ if ((tmp1 = getenv("TMPDIR")) == NULL)
|
|
|
|
+ tmp1 = "/tmp";
|
|
|
|
+
|
|
|
|
+ len = strlen(tmp1) + strlen(tmp2) + 10;
|
|
|
|
+ tmp = malloc(len);
|
|
|
|
+
|
2008-01-10 14:14:30 +01:00
|
|
|
+ snprintf(tmp, len, "%s%s%s", tmp1, tmp1 && strlen(tmp1) > 0 ? "/" : "", tmp2);
|
2007-01-16 00:15:33 +01:00
|
|
|
|
|
|
|
/* Create the sockets. */
|
2009-01-13 18:57:46 +01:00
|
|
|
socket_name = create_socket_name
|
|
|
|
- ("S.gpg-agent", "/tmp/gpg-XXXXXX/S.gpg-agent");
|
2007-01-16 00:15:33 +01:00
|
|
|
- if (opt.ssh_support)
|
2009-01-13 18:57:46 +01:00
|
|
|
+ ("S.gpg-agent", tmp);
|
2007-01-16 00:15:33 +01:00
|
|
|
+ if (opt.ssh_support) {
|
|
|
|
+ snprintf(tmp, len, "%s%s%s.ssh", tmp1, tmp1 && strlen(tmp1) > 0 ? "/" : "", tmp2);
|
2009-11-16 18:35:33 +01:00
|
|
|
socket_name_ssh = create_socket_name
|
|
|
|
- ("S.gpg-agent.ssh", "/tmp/gpg-XXXXXX/S.gpg-agent.ssh");
|
2009-01-13 18:57:46 +01:00
|
|
|
+ ("S.gpg-agent.ssh", tmp);
|
2007-01-16 00:15:33 +01:00
|
|
|
+ }
|
|
|
|
+ free(tmp);
|
2009-01-13 18:57:46 +01:00
|
|
|
|
|
|
|
fd = create_server_socket (socket_name, 0, &socket_nonce);
|
2007-01-16 00:15:33 +01:00
|
|
|
if (opt.ssh_support)
|