Browse Source

n/gnupg2: Applied gniibe's patches on scd.

slackware-14.2
Damien Goutte-Gattat 5 years ago
parent
commit
c6cc6738ba
  1. 29
      n/gnupg2/gnupg-2.1.15-fix-scdaemon-8fe8105.diff
  2. 50
      n/gnupg2/gnupg-2.1.15-fix-scdaemon-f9e49c8.diff
  3. 7
      n/gnupg2/gnupg2.SlackBuild

29
n/gnupg2/gnupg-2.1.15-fix-scdaemon-8fe8105.diff

@ -0,0 +1,29 @@
commit 8fe81055762d9c9e6f03fb7853a985c94ef73ac3
Author: NIIBE Yutaka <gniibe@fsij.org>
Date: Fri Sep 2 14:45:26 2016 +0900
scd: Release the card reader after card removal.
* scd/command.c (update_reader_status_file): Call apdu_close_reader.
--
GnuPG-bug-id: 2651
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
diff --git a/scd/command.c b/scd/command.c
index 239480b..2909330 100644
--- a/scd/command.c
+++ b/scd/command.c
@@ -2340,7 +2340,10 @@ update_reader_status_file (int set_card_removed_flag)
/* Set the card removed flag for all current sessions. */
if (vr->any && vr->status == 0 && set_card_removed_flag)
- update_card_removed (idx, 1);
+ {
+ apdu_close_reader (vr->slot);
+ update_card_removed (idx, 1);
+ }
vr->any = 1;

50
n/gnupg2/gnupg-2.1.15-fix-scdaemon-f9e49c8.diff

@ -0,0 +1,50 @@
commit f9e49c80e706a27d5e30d4b3237ff26367a67130
Author: NIIBE Yutaka <gniibe@fsij.org>
Date: Sat Sep 3 15:27:30 2016 +0900
scd: Fix an action after card removal.
* scd/command.c (update_card_removed): Call apdu_close_reader here.
--
This is update of the commit 8fe81055762d9c9e6f03fb7853a985c94ef73ac3
It is better apdu_close_reader is called in update_card_removed.
The commit 1598a4476466822e7e9c757ac471089d3db4b545 introduced a
regression, it doesn't close the reader after removal of the card, while
the code before the commit call apdu_close_reader in do_reset.
So, this fix.
GnuPG-bug-id: 2449
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
diff --git a/scd/command.c b/scd/command.c
index 2909330..9d978ab 100644
--- a/scd/command.c
+++ b/scd/command.c
@@ -223,8 +223,11 @@ update_card_removed (int vrdr, int value)
/* Let the card application layer know about the removal. */
if (value)
{
+ int slot = vreader_slot (vrdr);
+
log_debug ("Removal of a card: %d\n", vrdr);
- application_notify_card_reset (vreader_slot (vrdr));
+ apdu_close_reader (slot);
+ application_notify_card_reset (slot);
vreader_table[vrdr].slot = -1;
}
}
@@ -2340,10 +2343,7 @@ update_reader_status_file (int set_card_removed_flag)
/* Set the card removed flag for all current sessions. */
if (vr->any && vr->status == 0 && set_card_removed_flag)
- {
- apdu_close_reader (vr->slot);
- update_card_removed (idx, 1);
- }
+ update_card_removed (idx, 1);
vr->any = 1;

7
n/gnupg2/gnupg2.SlackBuild

@ -35,7 +35,7 @@ WGET=${WGET:-ftp://ftp.gnupg.org/gcrypt/gnupg/$ARCHIVE}
# Build infos
NAMEPKG=${NAMEPKG:-gnupg2}
BUILD=${BUILD:-1GGD}
BUILD=${BUILD:-2GGD}
ARCH=${ARCH:-$(uname -m | sed 's/^i.86$/i486/;s/^arm.*/arm/')}
JOBS=${JOBS:-1}
EXT=${EXT:-txz}
@ -86,6 +86,11 @@ cd $TMP
echo "Building $ARCHIVE..."
tar xf $CWD/$ARCHIVE
cd $NAME
# Apply gniibe's patches to fix scdaemon regression in 2.1.15
patch -p 1 < $CWD/gnupg-2.1.15-fix-scdaemon-8fe8105.diff
patch -p 1 < $CWD/gnupg-2.1.15-fix-scdaemon-f9e49c8.diff
CFLAGS=$CPUOPT \
CXXFLAGS=$CPUOPT \
./configure \

Loading…
Cancel
Save