Added support for Polkit and force sanity of parameters received by the client

This commit is contained in:
Nikos Mavrogiannopoulos 2014-02-11 13:47:51 +01:00
parent 8d28bb26f1
commit db032e045f
4 changed files with 1447 additions and 1 deletions

View File

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE policyconfig PUBLIC
"-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
"http://www.freedesktop.org/standards/PolicyKit/1.0/policyconfig.dtd">
<policyconfig>
<vendor>The PCSC-lite Project</vendor>
<vendor_url>http://pcsclite.alioth.debian.org/</vendor_url>
<!-- <icon_name>smart-card</icon_name> -->
<action id="org.debian.pcsc-lite.access_pcsc">
<description>Access to the PC/SC daemon</description>
<message>Authentication is required to access the PC/SC daemon</message>
<defaults>
<allow_any>yes</allow_any>
<allow_inactive>yes</allow_inactive>
<allow_active>yes</allow_active>
</defaults>
</action>
<action id="org.debian.pcsc-lite.access_card">
<description>Access to the smart card</description>
<message>Authentication is required to access the smart card</message>
<defaults>
<allow_any>yes</allow_any>
<allow_inactive>yes</allow_inactive>
<allow_active>yes</allow_active>
</defaults>
</action>
</policyconfig>

View File

@ -2,18 +2,26 @@
Name: pcsc-lite
Version: 1.8.10
Release: 1%{?dist}
Release: 2%{?dist}
Summary: PC/SC Lite smart card framework and applications
Group: System Environment/Daemons
License: BSD
URL: http://pcsclite.alioth.debian.org/
Source0: https://alioth.debian.org/frs/download.php/file/%{upstream_build}/%{name}-%{version}.tar.bz2
Source1: org.debian.pcsc-lite.policy
Patch0: pcscd-1.8.10-polkit.patch
Patch1: pcscd-1.8.10-null-force.patch
BuildRequires: doxygen
BuildRequires: graphviz
BuildRequires: systemd-devel
BuildRequires: /usr/bin/pod2man
BuildRequires: polkit-devel
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: gettext-devel
BuildRequires: libtool
Requires(post): systemd
Requires(preun): systemd
@ -58,6 +66,9 @@ Requires: %{name}-libs = %{version}-%{release}
%prep
%setup -q
%patch0 -p1 -b .polkit
%patch1 -p1 -b .null
# Convert to utf-8
for file in ChangeLog; do
iconv -f ISO-8859-1 -t UTF-8 -o $file.new $file && \
@ -67,8 +78,10 @@ done
%build
autoreconf -if
%configure \
--disable-static \
--enable-polkit \
--enable-usbdropdir=%{_libdir}/pcsc/drivers
make %{?_smp_mflags}
doxygen doc/doxygen.conf ; rm -f doc/api/*.{map,md5}
@ -76,6 +89,10 @@ doxygen doc/doxygen.conf ; rm -f doc/api/*.{map,md5}
%install
make install DESTDIR=$RPM_BUILD_ROOT
rm -f $RPM_BUILD_ROOT%{_datadir}/polkit-1/actions/org.debian.pcsc-lite.policy
mkdir -p $RPM_BUILD_ROOT%{_datadir}/polkit-1/actions/
install -p -m 644 %{SOURCE1} $RPM_BUILD_ROOT%{_datadir}/polkit-1/actions/
# Create empty directories
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/reader.conf.d
@ -112,6 +129,7 @@ rm $RPM_BUILD_ROOT%{_docdir}/pcsc-lite/README.DAEMON
%dir %{_libdir}/pcsc/drivers/
%{_mandir}/man5/reader.conf.5*
%{_mandir}/man8/pcscd.8*
%{_datadir}/polkit-1/actions/org.debian.pcsc-lite.policy
%ghost %dir %{_localstatedir}/run/pcscd/
%files libs
@ -131,6 +149,10 @@ rm $RPM_BUILD_ROOT%{_docdir}/pcsc-lite/README.DAEMON
%changelog
* Tue Feb 11 2014 Nikos Mavrogiannopoulos <nmav@redhat.com> - 1.8.10-2
- Added upstream patch to support polkit
- Force sanity of parameters received by the client
* Sun Oct 20 2013 Kalev Lember <kalevlember@gmail.com> - 1.8.10-1
- Update to 1.8.10
- Update source URL

View File

@ -0,0 +1,12 @@
diff -ur pcsc-lite-1.8.10.orig/src/winscard_svc.c pcsc-lite-1.8.10/src/winscard_svc.c
--- pcsc-lite-1.8.10.orig/src/winscard_svc.c 2013-08-05 21:18:44.000000000 +0200
+++ pcsc-lite-1.8.10/src/winscard_svc.c 2014-02-11 13:03:03.145500010 +0100
@@ -436,6 +436,7 @@
READ_BODY(coStr)
+ coStr.szReader[sizeof(coStr.szReader)-1] = 0;
hCard = coStr.hCard;
dwActiveProtocol = coStr.dwActiveProtocol;
Only in pcsc-lite-1.8.10/src: winscard_svc.c.orig

1382
pcscd-1.8.10-polkit.patch Normal file

File diff suppressed because it is too large Load Diff