Hello community, here is the log from the commit of package openct for openSUSE:Factory checked in at 2015-08-10 09:16:21 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/openct (Old) and /work/SRC/openSUSE:Factory/.openct.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "openct" Changes: -------- --- /work/SRC/openSUSE:Factory/openct/openct.changes 2015-03-11 09:59:01.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.openct.new/openct.changes 2015-08-10 09:16:24.000000000 +0200 @@ -1,0 +2,8 @@ +Wed Jul 29 23:15 EEST 2015 - [email protected] + +- Move libopenctapi.so from -devel to main package to avoid + pulling in -devel packages on production systems +- Add patch to support multiple USB readers from upstream git + (0001-Handling-multiple-USB-tokens-in-IFD-handler.patch) + +------------------------------------------------------------------- New: ---- 0001-Handling-multiple-USB-tokens-in-IFD-handler.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ openct.spec ++++++ --- /var/tmp/diff_new_pack.1AY5j4/_old 2015-08-10 09:16:25.000000000 +0200 +++ /var/tmp/diff_new_pack.1AY5j4/_new 2015-08-10 09:16:25.000000000 +0200 @@ -49,6 +49,8 @@ Patch2: %{name}-udev-permission.patch Patch3: %{name}-systemd.patch Patch4: %{name}-disable_forcepool.patch +# this patch can be dropped once 0.6.21 is out +Patch5: 0001-Handling-multiple-USB-tokens-in-IFD-handler.patch BuildRequires: db-devel BuildRequires: doxygen BuildRequires: krb5-devel @@ -141,6 +143,7 @@ %patch3 -p1 %endif %patch4 -p1 +%patch5 -p1 sed -i 's/@USER@/%{USER}/g;s/@GROUP@/%{GROUP}/g' etc/init-script.in tr -d \\r <doc/nonpersistent/wiki.out/trac.css >doc/nonpersistent/wiki.out/trac.css.unix @@ -249,6 +252,7 @@ %{_bindir}/* %doc %{_mandir}/man?/*.* %{_sbindir}/* +%{_libdir}/libopenctapi.so %config(noreplace) %{_sysconfdir}/openct.conf # SLE11 needs it. Expansion from the preamble does not apply here: %{!?_udevrulesdir: %define _udevrulesdir %{_udevdir}/rules.d} @@ -276,6 +280,7 @@ %doc %{_docdir}/%{name}/api %{_includedir}/openct %{_libdir}/*.so +%exclude %{_libdir}/libopenctapi.so %{_libdir}/pkgconfig/libopenct.pc %changelog ++++++ 0001-Handling-multiple-USB-tokens-in-IFD-handler.patch ++++++ >From a2516aa49f4822ddc4fd37ee4ee0d8d3d5336ffa Mon Sep 17 00:00:00 2001 From: Ludovic Rousseau <[email protected]> Date: Tue, 1 May 2012 14:19:15 +0000 Subject: [PATCH] Handling multiple USB tokens in IFD handler " Probably the problem I'm gonna describe is already known: OpenCT's IFD handler, used by pcscd, does not handle multiple USB tokens correctly. With one token everything works fine, but if you insert another one, it leads either to error, or even to pcscd's segmentation fault. The problem hides in CT_init() and CT_close() functions. The first one calculates wrong channel number for a new device, and the second causes memory corruption when deleting an item from a linked list. I've made a simple patch that corrects these problems and makes IFD handler work good - see the attachment. Hope it'll be useful. " Thanks to Alexander Gozman for the patch http://www.opensc-project.org/pipermail/opensc-devel/2012-April/017981.html --- src/ctapi/ctapi.c | 34 ++++++++++++++++++++++------------ src/pcsc/pcsc.c | 2 +- 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/src/ctapi/ctapi.c b/src/ctapi/ctapi.c index 771ecc1..76d6a20 100644 --- a/src/ctapi/ctapi.c +++ b/src/ctapi/ctapi.c @@ -597,18 +597,28 @@ char CT_init(unsigned short ctn, unsigned short pn) char CT_close(unsigned short ctn) { - struct CardTerminal **ct, *this; - - for (ct = &cardTerminals; *ct && (*ct)->ctn != ctn; ct = &(*ct)->next) ; - this = *ct; - if (!this) - return ERR_INVALID; - ct_reader_disconnect(this->h); - ct = &(this->next); - - this->next = NULL; - free(this); - return OK; + struct CardTerminal *curr = cardTerminals, + *prev = NULL; + + while (curr) + { + if (curr->ctn == ctn) + { + if (prev) + prev->next = curr->next; + else + cardTerminals = curr->next; + + free(curr); + } + else + { + prev = curr; + curr = curr->next; + } + } + + return OK; } char CT_data(unsigned short ctn, unsigned char *dad, unsigned char *sad, diff --git a/src/pcsc/pcsc.c b/src/pcsc/pcsc.c index 0ed9a61..d364b42 100644 --- a/src/pcsc/pcsc.c +++ b/src/pcsc/pcsc.c @@ -91,7 +91,7 @@ RESPONSECODE IFDHCreateChannel(DWORD Lun, DWORD Channel) if (Channel > IFDH_MAX_READERS) { pn = 0; } else { - pn = ((Channel == 0) ? 0 : Channel - 1); + pn = Channel; } ret = CT_init(ctn, pn); -- 2.4.3 ++++++ openct-rpmlintrc ++++++ --- /var/tmp/diff_new_pack.1AY5j4/_old 2015-08-10 09:16:25.000000000 +0200 +++ /var/tmp/diff_new_pack.1AY5j4/_new 2015-08-10 09:16:25.000000000 +0200 @@ -1,2 +1,5 @@ # This is not an error. rpmlint cannot handle %() properly. addFilter("specfile-error") +# libopenctapi.so should be in the main package +addFilter("shlib-policy-name-error") +addFilter("shlib-policy-missing-suffix")
