diff options
author | Steve Arnold <nerdboy@gentoo.org> | 2010-09-25 03:55:51 +0000 |
---|---|---|
committer | Steve Arnold <nerdboy@gentoo.org> | 2010-09-25 03:55:51 +0000 |
commit | e52a17ab07fa4e421621706e7fc078dba1893e02 (patch) | |
tree | f0fef5300e3c0c8189e13096d639b48b263d0566 /app-crypt/coolkey | |
parent | Version bump (fixes bug #337209, thanks to Andreis Vinogradovs for reporting)... (diff) | |
download | gentoo-2-e52a17ab07fa4e421621706e7fc078dba1893e02.tar.gz gentoo-2-e52a17ab07fa4e421621706e7fc078dba1893e02.tar.bz2 gentoo-2-e52a17ab07fa4e421621706e7fc078dba1893e02.zip |
Updated with upstream patches to support new CAC format and other fixes.
(Portage version: 2.2_rc67/cvs/Linux x86_64)
Diffstat (limited to 'app-crypt/coolkey')
-rw-r--r-- | app-crypt/coolkey/ChangeLog | 12 | ||||
-rw-r--r-- | app-crypt/coolkey/coolkey-1.1.0-r1.ebuild | 36 | ||||
-rw-r--r-- | app-crypt/coolkey/coolkey-1.1.0-r2.ebuild | 50 | ||||
-rw-r--r-- | app-crypt/coolkey/files/coolkey-1.1.0-cache-move.patch | 177 | ||||
-rw-r--r-- | app-crypt/coolkey/files/coolkey-1.1.0-gcc-4.3.patch | 54 |
5 files changed, 60 insertions, 269 deletions
diff --git a/app-crypt/coolkey/ChangeLog b/app-crypt/coolkey/ChangeLog index 497c17905ba6..390c81e5548a 100644 --- a/app-crypt/coolkey/ChangeLog +++ b/app-crypt/coolkey/ChangeLog @@ -1,6 +1,14 @@ # ChangeLog for app-crypt/coolkey -# Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/app-crypt/coolkey/ChangeLog,v 1.7 2008/08/30 20:23:32 maekke Exp $ +# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/app-crypt/coolkey/ChangeLog,v 1.8 2010/09/25 03:55:50 nerdboy Exp $ + +*coolkey-1.1.0-r2 (25 Sep 2010) + + 25 Sep 2010; Steve Arnold <nerdboy@gentoo.org> -coolkey-1.1.0-r1.ebuild, + +coolkey-1.1.0-r2.ebuild, -files/coolkey-1.1.0-cache-move.patch, + -files/coolkey-1.1.0-gcc-4.3.patch: + Updated with upstream patches to support new CAC format and other fixes. + Closes bug #302769 (tested with new CAC on ppc and amd64). 30 Aug 2008; Markus Meier <maekke@gentoo.org> coolkey-1.1.0-r1.ebuild: add ~amd64, bug #235627 diff --git a/app-crypt/coolkey/coolkey-1.1.0-r1.ebuild b/app-crypt/coolkey/coolkey-1.1.0-r1.ebuild deleted file mode 100644 index 17b57659f492..000000000000 --- a/app-crypt/coolkey/coolkey-1.1.0-r1.ebuild +++ /dev/null @@ -1,36 +0,0 @@ -# Copyright 1999-2008 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-crypt/coolkey/coolkey-1.1.0-r1.ebuild,v 1.3 2008/08/30 20:23:32 maekke Exp $ - -inherit eutils - -DESCRIPTION="Linux Driver support for the CoolKey and CAC products" -HOMEPAGE="http://directory.fedora.redhat.com/wiki/CoolKey" -SRC_URI="http://directory.fedora.redhat.com/download/coolkey/${P}.tar.gz" - -LICENSE="LGPL-2.1" -SLOT="0" -KEYWORDS="~amd64 ~ppc ~ppc64 ~x86" -IUSE="debug" -RDEPEND="sys-apps/pcsc-lite - sys-libs/zlib" -DEPEND="${RDEPEND} - dev-util/pkgconfig" - -src_unpack() { - unpack ${A} - cd "${S}" - epatch "${FILESDIR}/${P}-cache-move.patch" - epatch "${FILESDIR}/${P}-gcc-4.3.patch" -} - -src_compile() { - econf $(use_enable debug) || die "configure failed" - emake -j1 || die "make failed" -} - -src_install() { - emake install DESTDIR="${D}" || die - diropts -m 1777 - keepdir /var/cache/coolkey -} diff --git a/app-crypt/coolkey/coolkey-1.1.0-r2.ebuild b/app-crypt/coolkey/coolkey-1.1.0-r2.ebuild new file mode 100644 index 000000000000..08956116d47e --- /dev/null +++ b/app-crypt/coolkey/coolkey-1.1.0-r2.ebuild @@ -0,0 +1,50 @@ +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-crypt/coolkey/coolkey-1.1.0-r2.ebuild,v 1.1 2010/09/25 03:55:50 nerdboy Exp $ + +EAPI=3 + +inherit eutils + +DESCRIPTION="Linux Driver support for the CoolKey and CAC products" +HOMEPAGE="http://directory.fedora.redhat.com/wiki/CoolKey" +SRC_URI="http://directory.fedora.redhat.com/download/coolkey/${P}.tar.gz + mirror://gentoo/${PN}-patches.tar.gz" + +LICENSE="LGPL-2.1" +SLOT="0" +KEYWORDS="~amd64 ~ppc ~ppc64 ~x86" +IUSE="debug" + +RDEPEND="sys-apps/pcsc-lite + sys-libs/zlib" +DEPEND="${RDEPEND} + dev-util/pkgconfig" + +EPATCH_OPTS="-F3 -l" + +src_prepare() { +# EPATCH_SUFFIX="patch" epatch "${WORKDIR}/${PN}-patches/${PV}" + epatch "${WORKDIR}/${PN}-patches/${PV}/01_${P}-cache-move.patch" + epatch "${WORKDIR}/${PN}-patches/${PV}/02_${P}-gcc-4.3.patch" + epatch "${WORKDIR}/${PN}-patches/${PV}/03_${P}-latest.patch" + epatch "${WORKDIR}/${PN}-patches/${PV}/04_${P}-simple-bugs.patch" + epatch "${WORKDIR}/${PN}-patches/${PV}/05_${P}-thread-fix.patch" + epatch "${WORKDIR}/${PN}-patches/${PV}/06_${P}-CAC-update.patch" + epatch "${WORKDIR}/${PN}-patches/${PV}/07_${P}-safe-open.patch" + epatch "${WORKDIR}/${PN}-patches/${PV}/08_${P}-configure-fix.patch" +} + +src_configure() { + econf $(use_enable debug) || die "configure failed" +} + +src_compile() { + emake -j1 || die "make failed" +} + +src_install() { + emake install DESTDIR="${D}" || die + diropts -m 1777 + keepdir /var/cache/coolkey +} diff --git a/app-crypt/coolkey/files/coolkey-1.1.0-cache-move.patch b/app-crypt/coolkey/files/coolkey-1.1.0-cache-move.patch deleted file mode 100644 index 7dbd0ec3070b..000000000000 --- a/app-crypt/coolkey/files/coolkey-1.1.0-cache-move.patch +++ /dev/null @@ -1,177 +0,0 @@ -Index: src/coolkey/machdep.cpp -=================================================================== -RCS file: /cvs/dirsec/coolkey/src/coolkey/machdep.cpp,v -retrieving revision 1.4 -diff -u -r1.4 machdep.cpp ---- src/coolkey/machdep.cpp 14 Feb 2007 00:46:28 -0000 1.4 -+++ src/coolkey/machdep.cpp 15 Aug 2007 01:41:11 -0000 -@@ -185,12 +185,20 @@ - #define MAP_INHERIT 0 - #endif - -+#ifndef BASEPATH -+#ifdef MAC -+#define BASEPATH "/var" -+#else -+#define BASEPATH "/var/cache" -+#endif -+#endif -+ - #ifdef FULL_CLEANUP - #define RESERVED_OFFSET 256 --#define MEMSEGPATH "/tmp/.pk11ipc" -+#define MEMSEGPATH BASEPATH"/coolkey-lock" - #else - #define RESERVED_OFFSET 0 --#define MEMSEGPATH "/tmp/.pk11ipc1" -+#define MEMSEGPATH BASEPATH"/coolkey" - #endif - - struct SHMemData { -@@ -208,11 +216,6 @@ - #ifdef FULL_CLEANUP - flock(fd,LOCK_EX); - unsigned long ref = --(*(unsigned long *)addr); --#ifdef notdef -- if (ref == 0) { -- unlink(path); -- } --#endif - flock(fd, LOCK_UN); - #endif - munmap(addr,size+RESERVED_OFFSET); -@@ -225,6 +228,73 @@ - } - } - -+/* -+ * The cache directory is shared and accessible by anyone, make -+ * sure the cache file we are opening is really a valid cache file. -+ */ -+int safe_open(char *path, int flags, int mode, int size) -+{ -+ struct stat buf; -+ int fd, ret; -+ -+ fd = open (path, flags|O_NOFOLLOW, mode); -+ -+ if (fd < 0) { -+ return fd; -+ } -+ -+ ret = fstat(fd, &buf); -+ if (ret < 0) { -+ close (fd); -+ return ret; -+ } -+ -+ /* our cache files are pretty specific, make sure we are looking -+ * at the correct one */ -+ -+ /* first, we should own the file ourselves, don't open a file -+ * that someone else wanted us to see. */ -+ if (buf.st_uid != getuid()) { -+ close(fd); -+ errno = EACCES; -+ return -1; -+ } -+ -+ /* next, there should only be one link in this file. Don't -+ * use this code to trash another file */ -+ if (buf.st_nlink != 1) { -+ close(fd); -+ errno = EMLINK; -+ return -1; -+ } -+ -+ /* next, This better be a regular file */ -+ if (!S_ISREG(buf.st_mode)) { -+ close(fd); -+ errno = EACCES; -+ return -1; -+ } -+ -+ /* if the permissions don't match, something is wrong */ -+ if ((buf.st_mode & 03777) != mode) { -+ close(fd); -+ errno = EACCES; -+ return -1; -+ } -+ -+ /* finally the file should be the correct size. This -+ * check isn't so much to protect from an attack, as it is to -+ * detect a corrupted cache file */ -+ if (buf.st_size != size) { -+ close(fd); -+ errno = EACCES; -+ return -1; -+ } -+ -+ /* OK, the file checked out, ok to continue */ -+ return fd; -+} -+ - SHMem::SHMem(): shmemData(0) {} - - SHMem * -@@ -248,7 +318,7 @@ - return NULL; - } - int mask = umask(0); -- int ret = mkdir (MEMSEGPATH, 0777); -+ int ret = mkdir (MEMSEGPATH, 1777); - umask(mask); - if ((ret == -1) && (errno != EEXIST)) { - delete shmemData; -@@ -264,21 +334,16 @@ - shmemData->path[sizeof(MEMSEGPATH)-1] = '/'; - strcpy(&shmemData->path[sizeof(MEMSEGPATH)],name); - -- int mode = 0777; -- if (strcmp(name,"token_names") != 0) { -- /* each user gets his own uid array */ -- sprintf(uid_str, "-%u",getuid()); -- strcat(shmemData->path,uid_str); -- mode = 0700; -- } -+ sprintf(uid_str, "-%u",getuid()); -+ strcat(shmemData->path,uid_str); -+ int mode = 0600; -+ - shmemData->fd = open(shmemData->path, - O_CREAT|O_RDWR|O_EXCL|O_APPEND|O_EXLOCK, mode); -- if (shmemData->fd < 0) { -- needInit = false; -- shmemData->fd = open(shmemData->path,O_RDWR|O_EXLOCK, mode); -- } else { -+ if (shmemData->fd >= 0) { - char *buf; - int len = size+RESERVED_OFFSET; -+ int ret; - - buf = (char *)calloc(1,len); - if (!buf) { -@@ -289,8 +354,22 @@ - delete shmemData; - return NULL; - } -- write(shmemData->fd,buf,len); -+ ret = write(shmemData->fd,buf,len); -+ if (ret != len) { -+ unlink(shmemData->path); -+#ifdef FULL_CLEANUP -+ flock(shmemData->fd, LOCK_UN); -+#endif -+ delete shmemData; -+ return NULL; -+ } -+ - free(buf); -+ } else if (errno == EEXIST) { -+ needInit = false; -+ -+ shmemData->fd = safe_open(shmemData->path,O_RDWR|O_EXLOCK, mode, -+ size+RESERVED_OFFSET); - } - if (shmemData->fd < 0) { - delete shmemData; diff --git a/app-crypt/coolkey/files/coolkey-1.1.0-gcc-4.3.patch b/app-crypt/coolkey/files/coolkey-1.1.0-gcc-4.3.patch deleted file mode 100644 index 5e41b5ab702b..000000000000 --- a/app-crypt/coolkey/files/coolkey-1.1.0-gcc-4.3.patch +++ /dev/null @@ -1,54 +0,0 @@ -diff -up ./src/coolkey/slot.cpp.coolkey-gcc43 ./src/coolkey/slot.cpp ---- ./src/coolkey/slot.cpp.coolkey-gcc43 2008-02-13 18:01:45.000000000 -0800 -+++ ./src/coolkey/slot.cpp 2008-02-13 18:03:05.000000000 -0800 -@@ -25,7 +25,6 @@ - #include "PKCS11Exception.h" - #include <winscard.h> - #include "slot.h" --#include <memory.h> - #include "zlib.h" - #include "params.h" - -@@ -33,7 +32,6 @@ - - #define MIN(x, y) ((x) < (y) ? (x) : (y)) - --using std::auto_ptr; - - - #ifdef DEBUG -diff -up ./src/coolkey/machdep.cpp.coolkey-gcc43 ./src/coolkey/machdep.cpp ---- ./src/coolkey/machdep.cpp.coolkey-gcc43 2008-02-13 18:02:06.000000000 -0800 -+++ ./src/coolkey/machdep.cpp 2008-02-13 18:04:04.000000000 -0800 -@@ -33,6 +33,8 @@ - #include <sys/stat.h> - #include <sys/mman.h> - #include <pthread.h> -+#include <string.h> -+#include <stdlib.h> - #endif - - #ifdef _WIN32 -diff -up ./src/coolkey/log.cpp.coolkey-gcc43 ./src/coolkey/log.cpp ---- ./src/coolkey/log.cpp.coolkey-gcc43 2008-02-13 18:01:55.000000000 -0800 -+++ ./src/coolkey/log.cpp 2008-02-13 18:03:37.000000000 -0800 -@@ -18,6 +18,8 @@ - * ***** END COPYRIGHT BLOCK *****/ - - #include <string> -+#include <string.h> -+#include <stdlib.h> - #include "mypkcs11.h" - #include <assert.h> - #include <stdio.h> -diff -up ./src/coolkey/object.cpp.coolkey-gcc43 ./src/coolkey/object.cpp ---- ./src/coolkey/object.cpp.coolkey-gcc43 2008-02-13 18:02:20.000000000 -0800 -+++ ./src/coolkey/object.cpp 2008-02-13 18:04:22.000000000 -0800 -@@ -21,6 +21,7 @@ - #include "PKCS11Exception.h" - #include "object.h" - #include <algorithm> -+#include <string.h> - - using std::find_if; - |