[git] GnuPG - branch, master, updated. gnupg-2.1.0beta3-66-gbee0ac2
by Ben Kibbey
cvs at cvs.gnupg.org
Tue Apr 10 10:07:16 CEST 2012
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The GNU Privacy Guard".
The branch, master has been updated
via bee0ac28c9c8027540ae56900b9f85e0bd555f1d (commit)
from f1e1387bee286c7434f0462185048872bcdb4484 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit bee0ac28c9c8027540ae56900b9f85e0bd555f1d
Author: Ben Kibbey <bjk at luxsci.net>
Date: Mon Apr 9 20:52:22 2012 -0400
Fix killing PID -1.
When the KILLSCD command had been sent a race condition would occur
causing PID -1 getting killed, which on Linux seems to terminate all
applications for the current user.
diff --git a/scd/apdu.c b/scd/apdu.c
index 064f0d6..8467b03 100644
--- a/scd/apdu.c
+++ b/scd/apdu.c
@@ -1016,7 +1016,8 @@ pcsc_get_status_wrapped (int slot, unsigned int *status)
close (slotp->pcsc.rsp_fd);
slotp->pcsc.req_fd = -1;
slotp->pcsc.rsp_fd = -1;
- kill (slotp->pcsc.pid, SIGTERM);
+ if (slotp->pcsc.pid != -1)
+ kill (slotp->pcsc.pid, SIGTERM);
slotp->pcsc.pid = (pid_t)(-1);
slotp->used = 0;
return sw;
@@ -1180,7 +1181,8 @@ pcsc_send_apdu_wrapped (int slot, unsigned char *apdu, size_t apdulen,
close (slotp->pcsc.rsp_fd);
slotp->pcsc.req_fd = -1;
slotp->pcsc.rsp_fd = -1;
- kill (slotp->pcsc.pid, SIGTERM);
+ if (slotp->pcsc.pid != -1)
+ kill (slotp->pcsc.pid, SIGTERM);
slotp->pcsc.pid = (pid_t)(-1);
slotp->used = 0;
return sw;
@@ -1321,7 +1323,8 @@ control_pcsc_wrapped (int slot, unsigned long ioctl_code,
close (slotp->pcsc.rsp_fd);
slotp->pcsc.req_fd = -1;
slotp->pcsc.rsp_fd = -1;
- kill (slotp->pcsc.pid, SIGTERM);
+ if (slotp->pcsc.pid != -1)
+ kill (slotp->pcsc.pid, SIGTERM);
slotp->pcsc.pid = (pid_t)(-1);
slotp->used = 0;
return pcsc_error_to_sw (err);
@@ -1422,7 +1425,8 @@ close_pcsc_reader_wrapped (int slot)
close (slotp->pcsc.rsp_fd);
slotp->pcsc.req_fd = -1;
slotp->pcsc.rsp_fd = -1;
- kill (slotp->pcsc.pid, SIGTERM);
+ if (slotp->pcsc.pid != -1)
+ kill (slotp->pcsc.pid, SIGTERM);
slotp->pcsc.pid = (pid_t)(-1);
slotp->used = 0;
return 0;
@@ -1640,7 +1644,8 @@ reset_pcsc_reader_wrapped (int slot)
close (slotp->pcsc.rsp_fd);
slotp->pcsc.req_fd = -1;
slotp->pcsc.rsp_fd = -1;
- kill (slotp->pcsc.pid, SIGTERM);
+ if (slotp->pcsc.pid != -1)
+ kill (slotp->pcsc.pid, SIGTERM);
slotp->pcsc.pid = (pid_t)(-1);
slotp->used = 0;
return sw;
@@ -1965,7 +1970,8 @@ open_pcsc_reader_wrapped (const char *portstr)
close (slotp->pcsc.rsp_fd);
slotp->pcsc.req_fd = -1;
slotp->pcsc.rsp_fd = -1;
- kill (slotp->pcsc.pid, SIGTERM);
+ if (slotp->pcsc.pid != -1)
+ kill (slotp->pcsc.pid, SIGTERM);
slotp->pcsc.pid = (pid_t)(-1);
slotp->used = 0;
/* There is no way to return SW. */
-----------------------------------------------------------------------
Summary of changes:
scd/apdu.c | 18 ++++++++++++------
1 files changed, 12 insertions(+), 6 deletions(-)
hooks/post-receive
--
The GNU Privacy Guard
http://git.gnupg.org
More information about the Gnupg-commits
mailing list