From 17de82067638d11bb0026b309849b6ea5f2c331d Mon Sep 17 00:00:00 2001 From: markus Date: Thu, 24 Nov 2005 12:23:04 +0000 Subject: [PATCH] make usb etokens work; ok sturm@, Douglas Santos --- security/openct/Makefile | 3 +- .../openct/patches/patch-src_ifd_sys-bsd_c | 34 +++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 security/openct/patches/patch-src_ifd_sys-bsd_c diff --git a/security/openct/Makefile b/security/openct/Makefile index 97396fa41bd..3342a9e4095 100644 --- a/security/openct/Makefile +++ b/security/openct/Makefile @@ -1,8 +1,9 @@ -# $OpenBSD: Makefile,v 1.1.1.1 2005/10/04 21:58:54 alek Exp $ +# $OpenBSD: Makefile,v 1.2 2005/11/24 12:23:04 markus Exp $ COMMENT= "drivers for several smart card readers" DISTNAME= openct-0.6.6 +PKGNAME= ${DISTNAME}p0 CATEGORIES= security HOMEPAGE= http://www.opensc.org/openct diff --git a/security/openct/patches/patch-src_ifd_sys-bsd_c b/security/openct/patches/patch-src_ifd_sys-bsd_c new file mode 100644 index 00000000000..3bc2c7fbd5a --- /dev/null +++ b/security/openct/patches/patch-src_ifd_sys-bsd_c @@ -0,0 +1,34 @@ +$OpenBSD: patch-src_ifd_sys-bsd_c,v 1.1 2005/11/24 12:23:04 markus Exp $ +--- src/ifd/sys-bsd.c.orig Sun Jun 12 11:35:17 2005 ++++ src/ifd/sys-bsd.c Wed Nov 23 12:14:56 2005 +@@ -37,8 +37,10 @@ int ifd_sysdep_device_type(const char *n + + if (!strncmp(name, "/dev/ugen", 9)) { + ifd_debug(1, "BSD: returning IFD_DEVICE_TYPE_USB"); ++#ifndef __OpenBSD__ + if (stat(name, &stb) < 0) + return -1; ++#endif + return IFD_DEVICE_TYPE_USB; + } + +@@ -329,7 +331,19 @@ int ifd_sysdep_usb_release_interface(ifd + + int ifd_sysdep_usb_open(const char *device, int flags) + { ++#ifdef __OpenBSD__ ++ char *path; ++ int fd; ++ ++ if (asprintf(&path, "%s.00", device) < 0) ++ return -1; ++ ifd_debug(1, "BSD: ifd_sysdep_usb_open(%s)", path); ++ fd = open(path, O_EXCL | O_RDWR); ++ free(path); ++ return fd; ++#else + return open(device, O_EXCL | O_RDWR); ++#endif + } + + /*