ports/152030: [maintainer] security/heimdal: add gss_pname_to_uid function

Joerg Pulz Joerg.Pulz at frm2.tum.de
Sun Nov 7 21:40:09 UTC 2010


>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 at 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 <dfr at rabson.org>
+ * Developed with Red Inc: Alfred Perlstein <alfred at freebsd.org>
+ *
+ * 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 at mech/$(DEPDIR)/gss_oid_to_str.Plo at am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote at mech/$(DEPDIR)/gss_process_context_token.Plo at am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote at mech/$(DEPDIR)/gss_pseudo_random.Plo at am__quote@
++ at AMDEP_TRUE@@am__include@ @am__quote at mech/$(DEPDIR)/gss_pname_to_uid.Plo at am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote at mech/$(DEPDIR)/gss_release_buffer.Plo at am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote at mech/$(DEPDIR)/gss_release_cred.Plo at am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote at mech/$(DEPDIR)/gss_release_name.Plo at 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:



More information about the freebsd-ports-bugs mailing list