ALT Linux Bugzilla
– Attachment 605 Details for
Bug 5310
Using /tmp is evil
New bug
|
Search
|
[?]
|
Help
Register
|
Log In
[x]
|
Forgot Password
Login:
[x]
|
EN
|
RU
[patch]
Use $TMPDIR instead of /tmp
gnupg-1.9.7-alt-TMPDIR.patch (text/plain), 1.97 KB, created by
Sir Raorn
on 2004-10-12 13:25:51 MSD
(
hide
)
Description:
Use $TMPDIR instead of /tmp
Filename:
MIME Type:
Creator:
Sir Raorn
Created:
2004-10-12 13:25:51 MSD
Size:
1.97 KB
patch
obsolete
>diff -urN gnupg-1.9.7-orig/agent/gpg-agent.c gnupg-1.9.7/agent/gpg-agent.c >--- gnupg-1.9.7-orig/agent/gpg-agent.c 2004-04-06 14:13:21 +0400 >+++ gnupg-1.9.7/agent/gpg-agent.c 2004-10-12 03:04:37 +0400 >@@ -678,6 +678,15 @@ > int len; > struct sockaddr_un serv_addr; > char *p; >+ char *tmpdir; >+ >+ /* Get TMPDIR variable. Don't use $TMPDIR if it unset or >+ set to empty string. */ >+ tmpdir = getenv("TMPDIR"); >+ if (tmpdir == NULL) >+ tmpdir = getenv("TMP"); >+ if (tmpdir != NULL && tmpdir[0] == 0) >+ tmpdir = NULL; > > /* Remove the DISPLAY variable so that a pinentry does not > default to a specific display. There is still a default >@@ -688,7 +697,7 @@ > > *socket_name = 0; > snprintf (socket_name, DIM(socket_name)-1, >- "/tmp/gpg-XXXXXX/S.gpg-agent"); >+ "%s/gpg-XXXXXX/S.gpg-agent", tmpdir != NULL ? tmpdir : "/tmp"); > socket_name[DIM(socket_name)-1] = 0; > p = strrchr (socket_name, '/'); > if (!p) >diff -urN gnupg-1.9.7-orig/scd/scdaemon.c gnupg-1.9.7/scd/scdaemon.c >--- gnupg-1.9.7-orig/scd/scdaemon.c 2004-04-06 14:13:17 +0400 >+++ gnupg-1.9.7/scd/scdaemon.c 2004-10-12 03:04:39 +0400 >@@ -584,12 +584,21 @@ > int len; > struct sockaddr_un serv_addr; > char *p; >+ char *tmpdir; >+ >+ /* Get TMPDIR variable. Don't use $TMPDIR if it unset or >+ set to empty string. */ >+ tmpdir = getenv("TMPDIR"); >+ if (tmpdir == NULL) >+ tmpdir = getenv("TMP"); >+ if (tmpdir != NULL && tmpdir[0] == 0) >+ tmpdir = NULL; > > /* fixme: if there is already a running gpg-agent we should > share the same directory - and vice versa */ > *socket_name = 0; > snprintf (socket_name, DIM(socket_name)-1, >- "/tmp/gpg-XXXXXX/S.scdaemon"); >+ "%s/gpg-XXXXXX/S.scdaemon", tmpdir != NULL ? tmpdir : "/tmp"); > socket_name[DIM(socket_name)-1] = 0; > p = strrchr (socket_name, '/'); > if (!p)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 5310
: 605