From b8d5aedaa1e354e44bf9a7014e49648e21b02af6 Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Wed, 25 May 2011 06:51:04 +0300 Subject: [PATCH] Don't fill log files with repeating messages (#657658, #707412) "rv=0x... for client" and "Card Not Inserted" should be DEBUG log level, not ERROR. --- pcsc-lite-1.6.4-loglevel.patch | 24 ++++++++++++++++++++++++ pcsc-lite.spec | 9 ++++++++- 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 pcsc-lite-1.6.4-loglevel.patch diff --git a/pcsc-lite-1.6.4-loglevel.patch b/pcsc-lite-1.6.4-loglevel.patch new file mode 100644 index 0000000..30f3147 --- /dev/null +++ b/pcsc-lite-1.6.4-loglevel.patch @@ -0,0 +1,24 @@ +diff -up pcsc-lite-1.6.4/src/winscard.c.loglevel pcsc-lite-1.6.4/src/winscard.c +--- pcsc-lite-1.6.4/src/winscard.c.loglevel 2010-08-03 20:01:37.000000000 +0300 ++++ pcsc-lite-1.6.4/src/winscard.c 2011-05-25 07:04:29.228709067 +0300 +@@ -335,7 +335,7 @@ LONG SCardConnect(/*@unused@*/ SCARDCONT + { + if (!(dwStatus & SCARD_PRESENT)) + { +- Log1(PCSC_LOG_ERROR, "Card Not Inserted"); ++ Log1(PCSC_LOG_DEBUG, "Card Not Inserted"); + return SCARD_E_NO_SMARTCARD; + } + +diff -up pcsc-lite-1.6.4/src/winscard_svc.c.loglevel pcsc-lite-1.6.4/src/winscard_svc.c +--- pcsc-lite-1.6.4/src/winscard_svc.c.loglevel 2010-08-13 19:38:58.000000000 +0300 ++++ pcsc-lite-1.6.4/src/winscard_svc.c 2011-05-25 07:04:29.228709067 +0300 +@@ -279,7 +279,7 @@ static const char *CommandsText[] = { + #define WRITE_BODY(v) \ + WRITE_BODY_WITH_COMMAND(CommandsText[header.command], v) + #define WRITE_BODY_WITH_COMMAND(command, v) \ +- Log4(SCARD_S_SUCCESS == v.rv ? PCSC_LOG_DEBUG : PCSC_LOG_ERROR, "%s rv=0x%X for client %d", command, v.rv, filedes); \ ++ Log4(PCSC_LOG_DEBUG, "%s rv=0x%X for client %d", command, v.rv, filedes); \ + ret = MessageSend(&v, sizeof(v), filedes); + + static void ContextThread(LPVOID newContext) diff --git a/pcsc-lite.spec b/pcsc-lite.spec index fa71dc4..ebe5803 100644 --- a/pcsc-lite.spec +++ b/pcsc-lite.spec @@ -2,7 +2,7 @@ Name: pcsc-lite Version: 1.6.4 -Release: 3%{?dist} +Release: 4%{?dist} Summary: PC/SC Lite smart card framework and applications Group: System Environment/Daemons @@ -15,6 +15,9 @@ Patch1: %{name}-1.5.5-rpath64.patch # Disable pcscd on-demand startup (#653903) Patch2: %{name}-1.6.4-noautostart.patch Patch3: %{name}-CVE-2010-4531.patch +# Avoid filling log files with "rv=0x... for client" and "Card Not Inserted" +# messages (#657658, #707412) +Patch4: pcsc-lite-1.6.4-loglevel.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: hal-devel @@ -68,6 +71,7 @@ Requires: %{name}-libs = %{version}-%{release} %patch1 -p1 -b .rpath64 %patch2 -p1 -b .noautostart %patch3 -p0 -b .CVE-2010-4531 +%patch4 -p1 -b .loglevel # Convert to utf-8 for file in ChangeLog; do @@ -148,6 +152,9 @@ fi %changelog +* Wed May 25 2011 Kalev Lember - 1.6.4-4 +- Don't fill log files with repeating messages (#657658, #707412) + * Wed Jan 05 2011 Kalev Lember - 1.6.4-3 - Fixed a buffer overflow in ATR decoder (CVE-2010-4531)