gpg2/gpg2-fix-rtsignals.patch

45 lines
1.5 KiB
Diff
Raw Normal View History

# bnc#481463
#
# Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=499569
# agent/gpg-agent.c: Deinit the threading library before exec'ing
# the command to run in --daemon mode. And because that still doesn't
# restore the sigprocmask, do that manually. Closes: #499569
#
Index: gnupg-2.0.11/agent/gpg-agent.c
===================================================================
--- gnupg-2.0.11.orig/agent/gpg-agent.c 2009-03-18 13:35:59.000000000 +0100
+++ gnupg-2.0.11/agent/gpg-agent.c 2009-03-18 13:43:46.000000000 +0100
@@ -528,6 +528,8 @@
int gpgconf_list = 0;
gpg_error_t err;
const char *env_file_name = NULL;
+ sigset_t initial_sigs;
+
set_strusage (my_strusage);
@@ -537,6 +539,8 @@
somewhere after the option parsing */
log_set_prefix ("gpg-agent", JNLIB_LOG_WITH_PREFIX|JNLIB_LOG_WITH_PID);
+ sigprocmask(SIG_SETMASK, NULL, &initial_sigs);
+
/* Make sure that our subsystems are ready. */
i18n_init ();
init_common_subsystems ();
@@ -1053,6 +1057,14 @@
kill (pid, SIGTERM );
exit (1);
}
+ if (! pth_kill())
+ {
+ log_error ("failed to clean up threading");
+ kill (pid, SIGTERM );
+ exit (1);
+ }
+ sigprocmask(SIG_SETMASK, &initial_sigs, NULL);
+
execvp (argv[0], argv);
log_error ("failed to run the command: %s\n", strerror (errno));
kill (pid, SIGTERM);