Accepting request 57872 from home:sbrabec:branches:security:chipcard

Accepted my own submit.

OBS-URL: https://build.opensuse.org/request/show/57872
OBS-URL: https://build.opensuse.org/package/show/security:chipcard/pcsc-lite?expand=0&rev=39
This commit is contained in:
Stanislav Brabec 2011-01-11 13:33:42 +00:00 committed by Git OBS Bridge
parent 1161befb0f
commit adac3d0b76
7 changed files with 147 additions and 80 deletions

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:051de6f3c1deff9a9c6f72995f6b9d271a23fc8aea74737f1902cabf1a71ed26
size 465947

3
pcsc-lite-1.6.6.tar.bz2 Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7a94c27ae687619435b29ad63e0561aca20413333187b4301c75d1a1547ceea8
size 480232

95
pcsc-lite-init Normal file
View File

@ -0,0 +1,95 @@
#!/bin/sh
#
# pcscd Starts the pcscd Daemon
#
# chkconfig: 2345 25 88
# description: The PC/SC smart card daemon is a resource manager for the \
# PC/SC lite and Musclecard frameworks. It coordinates \
# communications with smart card readers, smart cards, and \
# cryptographic tokens that are connected to the system.
#
# processname: pcscd
# config: /etc/reader.conf
#
### BEGIN INIT INFO
# Provides: pcscd
# Required-Start: $local_fs $remote_fs $syslog
# Required-Stop: $local_fs $remote_fs $syslog
# Should-Start: udev hal openct
# Should-Stop: udev hal openct
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Daemon to access a smart card using PC/SC
# Description: The PC/SC smart card daemon is a resource manager for the
# PC/SC lite and Musclecard frameworks. It coordinates
# communications with smart card readers, smart cards, and
# cryptographic tokens that are connected to the system.
# X-UnitedLinux-Default-Enabled: yes
### END INIT INFO
#
# Note! pcscd should be started after pcmcia, and shut down before it
# for smooth experience with PCMCIA readers.
. /etc/rc.status
rc_reset
umask 077
exec=/usr/sbin/pcscd
prog=$(basename $exec)
lockfile=/var/lock/subsys/$prog
PCSCD_OPTIONS=
# Source config
if [ -f /etc/sysconfig/pcscd ] ; then
. /etc/sysconfig/pcscd
fi
start() {
echo -n $"Starting PC/SC smart card daemon ($prog): "
startproc $exec $PCSCD_OPTIONS
retval=$?
rc_status
echo
[ $retval -eq 0 ] && touch $lockfile
rc_status -v
}
stop() {
echo -n $"Stopping PC/SC smart card daemon ($prog): "
killproc $exec
retval=$?
rc_status
echo
[ $retval -eq 0 ] && rm -f $lockfile
rc_status -v
}
restart() {
stop
start
}
case "$1" in
start|stop|restart)
$1
;;
reload|force-reload)
restart
;;
status)
checkproc $exec
rc_status -v
;;
condrestart|try-restart)
if test -f $lockfile ; then
restart
else
rc_reset
fi
rc_status
;;
*)
echo $"Usage: $0 {start|stop|status|restart|try-restart|reload|force-reload}"
exit 2
esac
rc_exit

View File

@ -1,66 +0,0 @@
--- etc/pcscd.init.in
+++ etc/pcscd.init.in
@@ -24,12 +24,14 @@
# PC/SC lite and Musclecard frameworks. It coordinates
# communications with smart card readers, smart cards, and
# cryptographic tokens that are connected to the system.
+# X-UnitedLinux-Default-Enabled: yes
### END INIT INFO
#
# Note! pcscd should be started after pcmcia, and shut down before it
# for smooth experience with PCMCIA readers.
-. @sysconfdir_exp@/init.d/functions
+. @sysconfdir_exp@/rc.status
+rc_reset
umask 077
@@ -45,19 +47,21 @@
start() {
echo -n $"Starting PC/SC smart card daemon ($prog): "
- @sbindir_exp@/update-reader.conf && daemon $prog $PCSCD_OPTIONS
+ @sbindir_exp@/update-reader.conf && startproc $exec $PCSCD_OPTIONS
retval=$?
+ rc_status
echo
[ $retval -eq 0 ] && touch $lockfile
- return $retval
+ rc_status -v
}
stop() {
echo -n $"Stopping PC/SC smart card daemon ($prog): "
- killproc $prog
+ killproc $exec
retval=$?
+ rc_status
echo
[ $retval -eq 0 ] && rm -f $lockfile
- return $retval
+ rc_status -v
}
restart() {
stop
@@ -73,12 +77,19 @@
restart
;;
status)
- status $prog
+ checkproc $exec
+ rc_status -v
;;
condrestart|try-restart)
- [ ! -f $lockfile ] || restart
+ if test -f $lockfile ; then
+ restart
+ else
+ rc_reset
+ fi
+ rc_status
;;
*)
echo $"Usage: $0 {start|stop|status|restart|try-restart|reload|force-reload}"
exit 2
esac
+rc_exit

13
pcsc-lite-reader-conf Normal file
View File

@ -0,0 +1,13 @@
# Configuration file for pcsc-lite
#
# This file has to be configured for serial and PCMCIA readers only.
# normal USB readers shall _not_ be configured here!
#
# David Corcoran <corcoran@linuxnet.com>
#FRIENDLYNAME "Generic Reader"
#DEVICENAME /dev/ttySx_not_configured
#LIBPATH @ifddir@/libgen_ifd.so
#CHANNELID 0x0103F8
# End of file

View File

@ -1,3 +1,16 @@
-------------------------------------------------------------------
Mon Jan 10 19:36:08 CET 2011 - sbrabec@suse.cz
- Updated to version 1.6.6:
* code and behavior improvements
* many fixes
* uses libusb-1.0
* two security fixes (bnc#609317, CVE-2010-0407,
bnc#661000, CVE-2010-4531)
* for more see ChangeLog
- Disabled HAL support.
- Create dedicated UID and GID "scard".
-------------------------------------------------------------------
Tue Dec 15 01:39:25 CET 2009 - jengelh@medozas.de

View File

@ -21,9 +21,14 @@
Name: pcsc-lite
# FIXME: Maybe we should use /usr/lib/pcsc/drivers as others do:
%define ifddir %{_libdir}/readers
BuildRequires: hal-devel pkg-config readline-devel
Version: 1.5.5
Release: 2
BuildRequires: pkg-config readline-devel
%if %suse_version >= 1110
BuildRequires: libusb-1_0-devel
%else
BuildRequires: hal-devel
%endif
Version: 1.6.6
Release: 0
PreReq: %{insserv_prereq} %{fillup_prereq}
Group: Productivity/Security
License: BSD3c(or similar)
@ -34,9 +39,12 @@ Source1: %{name}.sysconfig
Source2: README.SUSE
Source3: pre_checkin.sh
Source4: baselibs.conf
Patch1: pcsc-lite-init.patch
Source5: pcsc-lite-init
Source6: pcsc-lite-reader-conf
Requires: libpcsclite1 >= %{version}
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%define USER scard
%define GROUP scard
%description
The purpose of PCSC Lite is to provide a Windows(R) SCard interface in
@ -119,8 +127,7 @@ Authors:
%prep
%setup -q
cp -a %{S:1} %{S:2} .
%patch1
cp -a %{S:1} %{S:2} %{S:5} %{S:6} .
%build
%if %suse_version > 1110
@ -129,17 +136,19 @@ ACLOCAL="aclocal -I m4" autoreconf -f -i
%configure\
--docdir=%{_docdir}/%{name}\
--enable-usbdropdir=%{ifddir}\
%if %suse_version >= 1110
--disable-libhal\
%endif
--disable-static
make %{?jobs:-j%jobs}
%install
%makeinstall
touch $RPM_BUILD_ROOT%{_sysconfdir}/reader.conf
mkdir $RPM_BUILD_ROOT%{ifddir}
sed s:@ifddir@:%{ifddir}: <pcsc-lite-reader-conf >$RPM_BUILD_ROOT%{_sysconfdir}/reader.conf.d/reader.conf
# this program is noinst in the package
install src/.libs/testpcsc $RPM_BUILD_ROOT%{_sbindir}/
mkdir $RPM_BUILD_ROOT/etc/init.d
install -m 755 etc/pcscd.init $RPM_BUILD_ROOT/etc/init.d/pcscd
install -m 755 pcsc-lite-init $RPM_BUILD_ROOT/etc/init.d/pcscd
ln -sf ../../etc/init.d/pcscd $RPM_BUILD_ROOT%{_sbindir}/rcpcscd
mkdir -p $RPM_BUILD_ROOT/var/adm/fillup-templates
cp %{name}.sysconfig $RPM_BUILD_ROOT/var/adm/fillup-templates/sysconfig.pcscd
@ -149,6 +158,10 @@ cp -a AUTHORS ChangeLog ChangeLog.svn COPYING DRIVERS HELP NEWS README README.SU
%clean
rm -rf $RPM_BUILD_ROOT
%pre
usr/sbin/groupadd -r -o %{GROUP} 2>/dev/null || :
usr/sbin/useradd -r -o -g %{GROUP} -s /bin/false -c "Smart Card Reader" -d /sbin %{USER} 2>/dev/null || :
%preun
%{stop_on_removal pcscd}
@ -170,9 +183,8 @@ rm -rf $RPM_BUILD_ROOT
%{_libdir}/*.so
%doc %{_mandir}/man?/*.*
%{_sbindir}/*
%ghost %{_sysconfdir}/reader.conf
%dir %{_sysconfdir}/reader.conf.d
%config %{_sysconfdir}/reader.conf.d/reader.conf
%config(noreplace) %{_sysconfdir}/reader.conf.d/reader.conf
%{ifddir}
/etc/init.d/pcscd
/var/adm/fillup-templates/sysconfig.pcscd