From owner-freebsd-ports-bugs@FreeBSD.ORG Sun Nov 7 21:40:09 2010 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E3FF106566C for ; Sun, 7 Nov 2010 21:40:09 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 5E2C88FC0C for ; Sun, 7 Nov 2010 21:40:09 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id oA7Le9oj016657 for ; Sun, 7 Nov 2010 21:40:09 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id oA7Le9A7016656; Sun, 7 Nov 2010 21:40:09 GMT (envelope-from gnats) Resent-Date: Sun, 7 Nov 2010 21:40:09 GMT Resent-Message-Id: <201011072140.oA7Le9A7016656@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Joerg Pulz Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 780E3106564A for ; Sun, 7 Nov 2010 21:32:46 +0000 (UTC) (envelope-from Joerg.Pulz@frm2.tum.de) Received: from mailhost.frm2.tum.de (mailhost.frm2.tum.de [129.187.179.12]) by mx1.freebsd.org (Postfix) with ESMTP id A5D568FC15 for ; Sun, 7 Nov 2010 21:32:45 +0000 (UTC) Received: from mailhost.frm2.tum.de (localhost [127.0.0.1]) by mailhost.frm2.tum.de (8.14.4/8.14.4) with ESMTP id oA7LWiD6060390 for ; Sun, 7 Nov 2010 22:32:44 +0100 (CET) (envelope-from jpulz@frm2.tum.de) Received: from hades.admin.frm2 (hades.admin.frm2 [172.25.1.10]) by mailhost.frm2.tum.de (8.14.4/8.14.4) with ESMTP id oA7LWhRT060386 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Sun, 7 Nov 2010 22:32:44 +0100 (CET) (envelope-from jpulz@frm2.tum.de) Received: from hades.admin.frm2 (localhost [127.0.0.1]) by hades.admin.frm2 (8.14.3/8.14.3) with ESMTP id oA7LWhxg016754 for ; Sun, 7 Nov 2010 22:32:43 +0100 (CET) (envelope-from jpulz@frm2.tum.de) Received: (from jpulz@localhost) by hades.admin.frm2 (8.14.3/8.14.3/Submit) id oA7LWhIb016753; Sun, 7 Nov 2010 22:32:43 +0100 (CET) (envelope-from jpulz) Message-Id: <201011072132.oA7LWhIb016753@hades.admin.frm2> Date: Sun, 7 Nov 2010 22:32:43 +0100 (CET) From: Joerg Pulz To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: ports/152030: [maintainer] security/heimdal: add gss_pname_to_uid function X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Joerg Pulz List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Nov 2010 21:40:09 -0000 >Number: 152030 >Category: ports >Synopsis: [maintainer] security/heimdal: add gss_pname_to_uid function >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: maintainer-update >Submitter-Id: current-users >Arrival-Date: Sun Nov 07 21:40:09 UTC 2010 >Closed-Date: >Last-Modified: >Originator: Joerg Pulz >Release: FreeBSD 8.0-STABLE amd64 >Organization: TU Muenchen / FRM II >Environment: System: FreeBSD hades.admin.frm2 8.0-STABLE FreeBSD 8.0-STABLE #2: Thu Jan 21 12:42:55 CET 2010 root@hades.admin.frm2:/usr/obj/usr/src/sys/GENERIC amd64 >Description: Add the 'gss_pname_to_uid' function to libgssapi. This function is obtained from the FreeBSD base libgssapi code. Whith this function added to the port, it is possible to buildworld FreeBSD fully against the port. FYI: Patches for CURRENT and 8-STABLE src/ are here: ftp://ftp.frm2.tum.de/pub/jpulz/FreeBSD/patches/CURRENT_use_kerberos_port.patch ftp://ftp.frm2.tum.de/pub/jpulz/FreeBSD/patches/8-STABLE_use_kerberos_port.patch >How-To-Repeat: >Fix: --- security__heimdal.diff begins here --- Index: Makefile =================================================================== RCS file: /home/ncvs/ports/security/heimdal/Makefile,v retrieving revision 1.90 diff -u -r1.90 Makefile --- Makefile 31 Oct 2010 18:12:31 -0000 1.90 +++ Makefile 6 Nov 2010 08:10:30 -0000 @@ -7,6 +7,7 @@ PORTNAME= heimdal PORTVERSION= 1.4 +PORTREVISION= 1 CATEGORIES= security ipv6 MASTER_SITES= http://www.h5l.org/dist/src/ \ http://ftp.pdc.kth.se/pub/heimdal/src/ \ @@ -164,6 +165,8 @@ ${WRKSRC}/lib/hcrypto/libtommath/tommath_class.h @${CP} ${FILESDIR}/lib__hcrypto__libtommath__tommath_superclass.h \ ${WRKSRC}/lib/hcrypto/libtommath/tommath_superclass.h + @${CP} ${FILESDIR}/lib__gssapi__mech__gss_pname_to_uid.c \ + ${WRKSRC}/lib/gssapi/mech/gss_pname_to_uid.c post-build: .if defined(WITH_CRACKLIB) Index: files/lib__gssapi__mech__gss_pname_to_uid.c =================================================================== RCS file: files/lib__gssapi__mech__gss_pname_to_uid.c diff -N files/lib__gssapi__mech__gss_pname_to_uid.c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ files/lib__gssapi__mech__gss_pname_to_uid.c 6 Nov 2010 08:10:30 -0000 @@ -0,0 +1,66 @@ +/*- + * Copyright (c) 2008 Isilon Inc http://www.isilon.com/ + * Authors: Doug Rabson + * Developed with Red Inc: Alfred Perlstein + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +/* $FreeBSD: src/lib/libgssapi/gss_pname_to_uid.c,v 1.1.2.1.4.1 2010/06/14 02:09:06 kensmith Exp $ */ + +#include "mech_locl.h" + +GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL +gss_pname_to_uid(OM_uint32 *minor_status, + const gss_name_t pname, + const gss_OID mech, + uid_t *uidp) +{ + struct _gss_name *name = (struct _gss_name *) pname; + gssapi_mech_interface m; + struct _gss_mechanism_name *mn; + OM_uint32 major_status; + + *minor_status = 0; + + if (pname == GSS_C_NO_NAME) + return (GSS_S_BAD_NAME); + + m = __gss_get_mechanism(mech); + if (!m) + return (GSS_S_BAD_MECH); + + if (m->gm_pname_to_uid == NULL) + return (GSS_S_UNAVAILABLE); + + major_status = _gss_find_mn(minor_status, name, mech, &mn); + if (major_status != GSS_S_COMPLETE) { + _gss_mg_error(m, major_status, *minor_status); + return (major_status); + } + + major_status = (*m->gm_pname_to_uid)(minor_status, mn->gmn_name, + mech, uidp); + if (major_status != GSS_S_COMPLETE) + _gss_mg_error(m, major_status, *minor_status); + + return (major_status); +} Index: files/patch-lib__gssapi__Makefile.in =================================================================== RCS file: files/patch-lib__gssapi__Makefile.in diff -N files/patch-lib__gssapi__Makefile.in --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ files/patch-lib__gssapi__Makefile.in 6 Nov 2010 08:10:30 -0000 @@ -0,0 +1,45 @@ +--- lib/gssapi/Makefile.in.orig 2010-11-05 10:15:29.000000000 +0100 ++++ lib/gssapi/Makefile.in 2010-11-05 10:18:39.000000000 +0100 +@@ -188,7 +188,7 @@ + mech/gss_unwrap.lo mech/gss_utils.lo mech/gss_verify.lo \ + mech/gss_verify_mic.lo mech/gss_wrap.lo \ + mech/gss_wrap_size_limit.lo \ +- mech/gss_inquire_sec_context_by_oid.lo ++ mech/gss_inquire_sec_context_by_oid.lo mech/gss_pname_to_uid.lo + am__objects_3 = ntlm/accept_sec_context.lo ntlm/acquire_cred.lo \ + ntlm/add_cred.lo ntlm/canonicalize_name.lo \ + ntlm/compare_name.lo ntlm/context_time.lo ntlm/crypto.lo \ +@@ -643,6 +643,7 @@ + mech/gss_oid_to_str.c \ + mech/gss_process_context_token.c \ + mech/gss_pseudo_random.c \ ++ mech/gss_pname_to_uid.c \ + mech/gss_release_buffer.c \ + mech/gss_release_cred.c \ + mech/gss_release_name.c \ +@@ -1039,6 +1040,8 @@ + mech/$(DEPDIR)/$(am__dirstamp) + mech/gss_pseudo_random.lo: mech/$(am__dirstamp) \ + mech/$(DEPDIR)/$(am__dirstamp) ++mech/gss_pname_to_uid.lo: mech/$(am__dirstamp) \ ++ mech/$(DEPDIR)/$(am__dirstamp) + mech/gss_release_buffer.lo: mech/$(am__dirstamp) \ + mech/$(DEPDIR)/$(am__dirstamp) + mech/gss_release_cred.lo: mech/$(am__dirstamp) \ +@@ -1425,6 +1428,8 @@ + -rm -f mech/gss_process_context_token.lo + -rm -f mech/gss_pseudo_random.$(OBJEXT) + -rm -f mech/gss_pseudo_random.lo ++ -rm -f mech/gss_pname_to_uid.$(OBJEXT) ++ -rm -f mech/gss_pname_to_uid.lo + -rm -f mech/gss_release_buffer.$(OBJEXT) + -rm -f mech/gss_release_buffer.lo + -rm -f mech/gss_release_cred.$(OBJEXT) +@@ -1644,6 +1649,7 @@ + @AMDEP_TRUE@@am__include@ @am__quote@mech/$(DEPDIR)/gss_oid_to_str.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@mech/$(DEPDIR)/gss_process_context_token.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@mech/$(DEPDIR)/gss_pseudo_random.Plo@am__quote@ ++@AMDEP_TRUE@@am__include@ @am__quote@mech/$(DEPDIR)/gss_pname_to_uid.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@mech/$(DEPDIR)/gss_release_buffer.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@mech/$(DEPDIR)/gss_release_cred.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@mech/$(DEPDIR)/gss_release_name.Plo@am__quote@ Index: files/patch-lib__gssapi__gssapi__gssapi.h =================================================================== RCS file: files/patch-lib__gssapi__gssapi__gssapi.h diff -N files/patch-lib__gssapi__gssapi__gssapi.h --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ files/patch-lib__gssapi__gssapi__gssapi.h 6 Nov 2010 08:10:30 -0000 @@ -0,0 +1,17 @@ +--- lib/gssapi/gssapi/gssapi.h.orig 2010-11-05 10:44:14.000000000 +0100 ++++ lib/gssapi/gssapi/gssapi.h 2010-11-05 10:51:26.000000000 +0100 +@@ -929,6 +929,14 @@ + gss_buffer_t /* cred_token */, + gss_cred_id_t * /* cred_handle */); + ++#ifdef _UID_T_DECLARED ++GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL ++gss_pname_to_uid ++ (OM_uint32 * /* minor status */, ++ const gss_name_t /* principal name */, ++ const gss_OID mech /* mechanism to query */, ++ uid_t * /* pointer to UID for result */); ++#endif + + GSSAPI_CPP_END + Index: files/patch-lib__gssapi__gssapi_mech.h =================================================================== RCS file: files/patch-lib__gssapi__gssapi_mech.h diff -N files/patch-lib__gssapi__gssapi_mech.h --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ files/patch-lib__gssapi__gssapi_mech.h 6 Nov 2010 08:10:30 -0000 @@ -0,0 +1,23 @@ +--- lib/gssapi/gssapi_mech.h.orig 2010-09-13 09:23:34.000000000 +0200 ++++ lib/gssapi/gssapi_mech.h 2010-11-05 11:04:11.000000000 +0100 +@@ -353,6 +353,12 @@ + gss_buffer_t cred_token, + gss_cred_id_t * cred_handle); + ++typedef OM_uint32 GSSAPI_CALLCONV ++_gss_pname_to_uid (OM_uint32 * minor_status, /* minor status */ ++ gss_name_t pname, /* principal name */ ++ gss_OID mech, /* mechanism to query */ ++ uid_t *uidp /* pointer to UID for result */ ++ ); + + #define GMI_VERSION 2 + +@@ -405,6 +411,7 @@ + _gss_store_cred_t *gm_store_cred; + _gss_export_cred_t *gm_export_cred; + _gss_import_cred_t *gm_import_cred; ++ _gss_pname_to_uid *gm_pname_to_uid; + } gssapi_mech_interface_desc, *gssapi_mech_interface; + + gssapi_mech_interface Index: files/patch-lib__gssapi__mech__gss_mech_switch.c =================================================================== RCS file: files/patch-lib__gssapi__mech__gss_mech_switch.c diff -N files/patch-lib__gssapi__mech__gss_mech_switch.c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ files/patch-lib__gssapi__mech__gss_mech_switch.c 6 Nov 2010 08:10:30 -0000 @@ -0,0 +1,10 @@ +--- lib/gssapi/mech/gss_mech_switch.c.orig 2010-11-05 11:16:35.000000000 +0100 ++++ lib/gssapi/mech/gss_mech_switch.c 2010-11-05 11:16:52.000000000 +0100 +@@ -334,6 +334,7 @@ + OPTSYM(set_sec_context_option); + OPTSYM(set_cred_option); + OPTSYM(pseudo_random); ++ OPTSYM(pname_to_uid); + OPTSYM(wrap_iov); + OPTSYM(unwrap_iov); + OPTSYM(wrap_iov_length); Index: files/patch-lib__gssapi__version-script.map =================================================================== RCS file: files/patch-lib__gssapi__version-script.map diff -N files/patch-lib__gssapi__version-script.map --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ files/patch-lib__gssapi__version-script.map 6 Nov 2010 08:10:30 -0000 @@ -0,0 +1,10 @@ +--- lib/gssapi/version-script.map.orig 2010-11-05 09:09:47.000000000 +0100 ++++ lib/gssapi/version-script.map 2010-11-05 09:40:32.000000000 +0100 +@@ -63,6 +63,7 @@ + gss_oid_to_str; + gss_process_context_token; + gss_pseudo_random; ++ gss_pname_to_uid; + gss_release_buffer; + gss_release_buffer_set; + gss_release_cred; --- security__heimdal.diff ends here --- >Release-Note: >Audit-Trail: >Unformatted: