> OpenCT has been broken by the recent commit of SO_PEERCRED:
> 
> socket.c: In function `ct_socket_getcreds':
> socket.c:298: error: storage size of `creds' isn't known
> 
> This is because we use "struct sockpeercred" instead of "struct ucred"
> to return the credentials in. The following patch fixes it. Ok?

tha's right.

It is impossible to use struct ucred.  We have that in use for something
else in our kernel, have for 25 years, and their choice of structure names
just shows that they live in caves.

> Index: Makefile
> ===================================================================
> RCS file: /cvs/ports/security/openct/Makefile,v
> retrieving revision 1.12
> diff -u -p -r1.12 Makefile
> --- Makefile  13 Mar 2009 21:33:43 -0000      1.12
> +++ Makefile  1 Jul 2010 01:55:45 -0000
> @@ -3,7 +3,7 @@
>  COMMENT=     drivers for several smart card readers
>  
>  DISTNAME=    openct-0.6.15
> -PKGNAME=        ${DISTNAME}p1
> +PKGNAME=        ${DISTNAME}p2
>  CATEGORIES=  security
>  SHARED_LIBS= openct  1.1
>  
> Index: patches/patch-configure
> ===================================================================
> RCS file: /cvs/ports/security/openct/patches/patch-configure,v
> retrieving revision 1.1
> diff -u -p -r1.1 patch-configure
> --- patches/patch-configure   13 Mar 2009 21:33:43 -0000      1.1
> +++ patches/patch-configure   1 Jul 2010 01:55:45 -0000
> @@ -1,7 +1,7 @@
>  $OpenBSD: patch-configure,v 1.1 2009/03/13 21:33:43 jasper Exp $
> ---- configure.orig   Mon Mar  2 08:16:29 2009
> -+++ configure        Mon Mar  2 08:16:53 2009
> -@@ -23258,7 +23258,7 @@
> +--- configure.orig   Thu Jul 31 23:03:41 2008
> ++++ configure        Thu Jul  1 11:48:12 2010
> +@@ -23258,7 +23258,7 @@ cat >>confdefs.h <<_ACEOF
>   #define OPENCT_MODULES_PATH "${ifddir}"
>   _ACEOF
>   
> Index: patches/patch-src_ct_socket_c
> ===================================================================
> RCS file: patches/patch-src_ct_socket_c
> diff -N patches/patch-src_ct_socket_c
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-src_ct_socket_c     1 Jul 2010 01:55:45 -0000
> @@ -0,0 +1,12 @@
> +$OpenBSD$
> +--- src/ct/socket.c.orig     Thu Jul  1 11:51:42 2010
> ++++ src/ct/socket.c  Thu Jul  1 11:52:26 2010
> +@@ -295,7 +295,7 @@ ct_socket_t *ct_socket_accept(ct_socket_t * sock)
> + static int ct_socket_getcreds(ct_socket_t * sock)
> + {
> + #ifdef SO_PEERCRED
> +-    struct ucred creds;
> ++    struct sockpeercred creds;
> +     socklen_t len;
> + 
> +     len = sizeof(creds);
> 

1

Reply via email to