diff options
Diffstat (limited to 'src/gpg.c')
-rw-r--r-- | src/gpg.c | 20 |
1 files changed, 10 insertions, 10 deletions
@@ -33,7 +33,7 @@ } \ while (0) -static char *homedir; +char *temp_homedir; static int rmdir_r (const char *name); @@ -122,29 +122,29 @@ static void remove_homedir () { if (debug_level > 1) - logmsg (LOG_DEBUG, _("removing GNUPG home directory: %s"), homedir); - if (rmdir_r (homedir)) - logmsg (LOG_CRIT, _("failed to remove GPG directory %s"), homedir); + logmsg (LOG_DEBUG, _("removing GNUPG home directory: %s"), temp_homedir); + if (rmdir_r (temp_homedir)) + logmsg (LOG_CRIT, _("failed to remove GPG directory %s"), temp_homedir); } /* Create a temporary GPG home directory */ static int create_gpg_homedir () { - if (homedir) + if (temp_homedir) return 0; - homedir = xstrdup ("/tmp/wydawca-XXXXXX"); - if (!mkdtemp (homedir)) + temp_homedir = xstrdup ("/tmp/wydawca-XXXXXX"); + if (!mkdtemp (temp_homedir)) { logmsg (LOG_CRIT, _("cannot create GPG home directory (%s): %s"), - homedir, strerror (errno)); + temp_homedir, strerror (errno)); return 1; } atexit (remove_homedir); if (debug_level > 1) - logmsg (LOG_DEBUG, _("GNUPG home directory: %s"), homedir); - setenv ("GNUPGHOME", homedir, 1); + logmsg (LOG_DEBUG, _("GNUPG home directory: %s"), temp_homedir); + setenv ("GNUPGHOME", temp_homedir, 1); return 0; } |