NetBSD Problem Report #26678

Received: (qmail 8009 invoked by uid 605); 15 Aug 2004 23:03:55 -0000
Message-Id: <20040815230351.9BFF114A76@himo.salmi.ch>
Date: Mon, 16 Aug 2004 01:03:51 +0200 (CEST)
From: j+nbsd@2004.salmi.ch
Sender: gnats-bugs-owner@NetBSD.org
Reply-To: j+nbsd@2004.salmi.ch
To: gnats-bugs@gnats.NetBSD.org
Subject: splitting out SASL plugins broke GSSAPI authentication
X-Send-Pr-Version: 3.95

>Number:         26678
>Category:       pkg
>Synopsis:       splitting out SASL plugins broke GSSAPI authentication
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    jlam
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Aug 15 23:04:00 +0000 2004
>Closed-Date:    Sun Sep 12 05:11:26 +0000 2004
>Last-Modified:  Sun Sep 12 05:11:26 +0000 2004
>Originator:     Jukka Salmi
>Release:        NetBSD 2.0G
>Organization:
>Environment:
System: NetBSD himo.salmi.ch 2.0G NetBSD 2.0G (GENERIC) #0: Thu Aug 12 23:26:18 CEST 2004 build@himo.salmi.ch:/build/nbsd/usr/src/sys/arch/i386/compile/GENERIC i386
Architecture: i386
Machine: i386
>Description:
Since SASL plugins are installed separately (this change was made two days
ago), GSSAPI authentication fails.
>How-To-Repeat:
Install security/cy2-gssapi and e.g. mail/cyrus-imapd22 from current pkgsrc
and try to authenticate via GSSAPI. Results:

Aug 15 21:33:25 grouper imap[14423]: unable to dlopen /usr/pkg/lib/sasl2/libgssapiv2.so.2: /usr/pkg/lib/sasl2/libgssapiv2.so.2: Undefined symbol "gss_nt_service_name" (symnum = 58)
Aug 15 21:33:25 grouper imap[14423]: unable to dlopen /usr/pkg/lib/sasl2/libgssapiv2.so.2: /usr/pkg/lib/sasl2/libgssapiv2.so.2: Undefined symbol "gss_nt_service_name" (symnum = 58)
Aug 15 21:33:25 grouper perl: unable to dlopen /usr/pkg/lib/sasl2/libgssapiv2.so.2: /usr/pkg/lib/sasl2/libgssapiv2.so.2: Undefined PLT symbol "gss_import_name" (symnum = 23)
Aug 15 21:33:25 grouper perl: No worthy mechs found

(This is with cyrus-sasl-2.1.19nb2 and cy2-gssapi-2.1.19; with
cyrus-sasl-2.1.19nb1 GSSAPI authentication worked fine.)
>Fix:
unknown
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: pkg-manager->jlam 
Responsible-Changed-By: wiz 
Responsible-Changed-When: Sun Aug 15 23:21:10 UTC 2004 
Responsible-Changed-Why:  
jlam said he'd handle it. 

From: Jukka Salmi <j+nbsd@2004.salmi.ch>
To: gnats-bugs@gnats.NetBSD.org
Cc:  
Subject: Re: pkg/26678: splitting out SASL plugins broke GSSAPI authentication
Date: Tue, 24 Aug 2004 15:53:37 +0200

 This problem seems to exist only with NetBSD 2.0_BETA: I tried
 building security/cy2-gssapi from current pkgsrc on two different
 NetBSD 2.0_BETA systems (built using todays sources), on a NetBSD
 1.6.2_STABLE system and on NetBSD current (2.0G) (all i386). The
 1.6.2 and current systems built successfully, both 2.0_BETA systems
 failed.

 On the 2.0_BETA systems, "make configure" in security/cy2-gssapi
 reports:
 [...]  
 checking gssapi.h usability... no
 checking gssapi.h presence... no
 checking for gssapi.h... no
 checking gssapi/gssapi.h usability... yes
 checking gssapi/gssapi.h presence... yes
 checking for gssapi/gssapi.h... yes
 checking for res_search in -lresolv... yes
 checking for gss_unwrap in -lgssapi... no
 configure: WARNING: Disabling GSSAPI - specified library not found
 checking GSSAPI... disabled
 [...]

 Excerpt from config.log:
 [...]
 configure:10167: checking for gss_unwrap in -lgssapi
 configure:10198: gcc -o conftest -Wall -W -O2 -I/usr/pkg/include -I/usr/include/krb5 -I/usr/pkg/include -I/usr/include/krb5 -I/usr/include -L/usr/pkg/lib -Wl,-R/usr/pkg/lib -L/usr/lib -Wl,-R/usr/lib -L/usr/lib conftest.c -lgssapi -L/usr/lib -lgssapi -lkrb5 -lasn1 -lroken -lcrypt  -lcom_err  -lresolv  >&5
 /usr/lib/libkrb5.so: undefined reference to `RAND_write_file'
 /usr/lib/libkrb5.so: undefined reference to `DES_set_odd_parity'
 /usr/lib/libkrb5.so: undefined reference to `RAND_add'
 /usr/lib/libkrb5.so: undefined reference to `SHA1_Init'
 /usr/lib/libgssapi.so: undefined reference to `DES_cbc_cksum'
 /usr/lib/libkrb5.so: undefined reference to `RAND_egd_bytes'
 /usr/lib/libgssapi.so: undefined reference to `RC4_set_key'
 /usr/lib/libkrb5.so: undefined reference to `SHA1_Update'
 /usr/lib/libkrb5.so: undefined reference to `SHA1_Final'
 /usr/lib/libkrb5.so: undefined reference to `MD4_Update'
 /usr/lib/libgssapi.so: undefined reference to `RC4'
 /usr/lib/libkrb5.so: undefined reference to `DES_ede3_cbc_encrypt'
 /usr/lib/libkrb5.so: undefined reference to `RAND_file_name'
 /usr/lib/libkrb5.so: undefined reference to `MD4_Final'
 /usr/lib/libkrb5.so: undefined reference to `DES_is_weak_key'
 /usr/lib/libgssapi.so: undefined reference to `MD5_Init'
 /usr/lib/libkrb5.so: undefined reference to `RAND_status'
 /usr/lib/libgssapi.so: undefined reference to `DES_set_key'
 /usr/lib/libgssapi.so: undefined reference to `MD5_Final'
 /usr/lib/libkrb5.so: undefined reference to `RAND_bytes'
 /usr/lib/libgssapi.so: undefined reference to `DES_cbc_encrypt'
 /usr/lib/libkrb5.so: undefined reference to `MD4_Init'
 /usr/lib/libkrb5.so: undefined reference to `UI_UTIL_read_pw_string'
 /usr/lib/libkrb5.so: undefined reference to `DES_pcbc_encrypt'
 /usr/lib/libkrb5.so: undefined reference to `DES_cfb64_encrypt'
 /usr/lib/libgssapi.so: undefined reference to `MD5_Update'
 configure:10201: $? = 1
 configure: failed program was:
 | #line 10175 "configure"
 | /* confdefs.h.  */
 | 
 | #define PACKAGE_NAME ""
 | #define PACKAGE_TARNAME ""
 | #define PACKAGE_VERSION ""
 | #define PACKAGE_STRING ""
 | #define PACKAGE_BUGREPORT ""
 | #define PACKAGE "cyrus-sasl"
 | #define VERSION "2.1.19"
 | #define HAVE___ATTRIBUTE__ 1
 | #define HAVE_DN_EXPAND 1
 | #define SASL_DB_PATH "/etc/sasldb2"
 | #define STDC_HEADERS 1
 | #define HAVE_SYS_TYPES_H 1
 | #define HAVE_SYS_STAT_H 1
 | #define HAVE_STDLIB_H 1
 | #define HAVE_STRING_H 1
 | #define HAVE_MEMORY_H 1
 | #define HAVE_STRINGS_H 1
 | #define HAVE_INTTYPES_H 1
 | #define HAVE_STDINT_H 1
 | #define HAVE_UNISTD_H 1
 | #define SASL_DEV_RANDOM "/dev/random"
 | #define HAVE_SYSLOG 1
 | #define HAVE_AUTHDAEMON
 | #define PATH_AUTHDAEMON_SOCKET "/dev/null"
 | #define WITH_DES
 | #define HAVE_LIBRESOLV 1
 | /* end confdefs.h.  */
 | 
 | /* Override any gcc2 internal prototype to avoid an error.  */
 | #ifdef __cplusplus
 | extern "C"
 | #endif
 | /* We use char because int might match the return type of a gcc2
 |    builtin and then its argument prototype would still apply.  */
 | char gss_unwrap ();
 | int
 | main ()
 | {
 | gss_unwrap ();
 |   ;
 |   return 0;
 | }
 configure:10219: result: no
 configure:10543: WARNING: Disabling GSSAPI - specified library not found
 configure:10704: checking GSSAPI
 configure:10865: result: disabled
 [...]

 Adding -lcrypto to the LIBS used in the configure check for gss_unwrap
 seems to work around the "undefined reference" problem (but I'm not sure
 if that's the right way to fix it...). However, using the resulting
 library, when trying to authenticate via GSSAPI, I get

 perl: unable to dlopen /usr/pkg/lib/sasl2/libgssapiv2.so.2: /usr/lib/libgssapi.so.5: Undefined PLT symbol "DES_cbc_cksum" (symnum = 70)

 Cheers, Jukka

 -- 
 bashian roulette:
 $ ((RANDOM%6)) || rm -rf ~

From: Jukka Salmi <j+nbsd@2004.salmi.ch>
To: gnats-bugs@gnats.NetBSD.org
Cc: "Johnny C. Lam" <jlam@NetBSD.org>
Subject: Re: pkg/26678: splitting out SASL plugins broke GSSAPI authentication
Date: Fri, 27 Aug 2004 12:46:37 +0200

 --9zSXsLTf0vkW971A
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline

 Problem (probably) solved: OpenSSL is needed to build security/cy2-gssapi
 correctly, but it's not used.
 The attached patch - applied to security/cy2-gssapi - should fix this.
 At the moment I can only confirm tha packages builds correctly with this
 patch applied; however, I can't test GSSAPI authentication until tomorrow.
 I'll report definitive success (hopefully...) ASAP.

 Cheers, Jukka

 -- 
 bashian roulette:
 $ ((RANDOM%6)) || rm -rf ~

 --9zSXsLTf0vkW971A
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: attachment; filename="cy2-gssapi.patch"

 --- Makefile.orig	2004-08-13 20:14:04.000000000 +0200
 +++ Makefile	2004-08-27 12:26:01.000000000 +0200
 @@ -8,6 +8,7 @@

  .include "../cyrus-sasl2/Makefile.common"

 +CONFIGURE_ARGS+=	--with-openssl=${SSLBASE}
  CONFIGURE_ARGS+=	--enable-gssapi=${KRB5BASE}
  CONFIGURE_ARGS+=	--with-gss_impl=${GSSIMPL.${KRB5_TYPE}}
  GSSIMPL.heimdal=	heimdal
 @@ -16,6 +17,7 @@
  BUILD_DIRS=	${WRKSRC}/plugins
  ALL_TARGET=	libgssapiv2.la

 +.include "../../security/openssl/buildlink3.mk"
  .include "../../mk/krb5.buildlink3.mk"

  do-install:

 --9zSXsLTf0vkW971A--

From: Jukka Salmi <j+nbsd@2004.salmi.ch>
To: gnats-bugs@gnats.NetBSD.org
Cc: "Johnny C. Lam" <jlam@NetBSD.org>
Subject: Re: pkg/26678: splitting out SASL plugins broke GSSAPI authentication
Date: Fri, 27 Aug 2004 18:53:45 +0200

 I confirm that the patch which I sent with my last message fixes the
 problem.

 Cheers, Jukka

 -- 
 bashian roulette:
 $ ((RANDOM%6)) || rm -rf ~

From: Jukka Salmi <j+nbsd@2004.salmi.ch>
To: gnats-bugs@gnats.NetBSD.org
Cc: jlam@NetBSD.org
Subject: Re: pkg/26678: splitting out SASL plugins broke GSSAPI authentication
Date: Mon, 30 Aug 2004 12:48:05 +0200

 --z4+8/lEcDcG5Ke9S
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline

 While fixing the Cyrus SASL package, the attached patch should probably
 be applied, too.

 Cheers, Jukka

 -- 
 bashian roulette:
 $ ((RANDOM%6)) || rm -rf ~

 --z4+8/lEcDcG5Ke9S
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: attachment; filename="Makefile.common.diff"

 --- security/cyrus-sasl2/Makefile.common.orig	Mon Aug 30 12:27:54 2004
 +++ security/cyrus-sasl2/Makefile.common	Mon Aug 30 12:29:26 2004
 @@ -3,8 +3,14 @@
  # This file is currently included by:
  #
  #	security/cyrus-sasl2/Makefile
 +#	security/cy2-anonymous/Makefile
 +#	security/cy2-crammd5 /Makefile
 +#	security/cy2-digestmd5/Makefile
 +#	security/cy2-gssapi/Makefile
  #	security/cy2-login/Makefile
  #	security/cy2-ntlm/Makefile
 +#	security/cy2-otp/Makefile
 +#	security/cy2-plain/Makefile
  #	security/cy2-sql/Makefile
  #
  # This Makefile fragment should be included _below_ any SASL_PLUGIN

 --z4+8/lEcDcG5Ke9S--

From: "Johnny C. Lam" <jlam@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:  
Subject: pr/26678 CVS commit: pkgsrc/security/cy2-gssapi
Date: Sun, 12 Sep 2004 05:07:28 +0000 (UTC)

 Module Name:	pkgsrc
 Committed By:	jlam
 Date:		Sun Sep 12 05:07:28 UTC 2004

 Modified Files:
 	pkgsrc/security/cy2-gssapi: Makefile

 Log Message:
 Fix build when using the built-in Heimdal on NetBSD.  Analysis and fix
 provided in PR pkg/26678 by Jukka Salmi.


 To generate a diff of this commit:
 cvs rdiff -r1.1.1.1 -r1.2 pkgsrc/security/cy2-gssapi/Makefile

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed 
State-Changed-By: jlam 
State-Changed-When: Sun Sep 12 05:10:27 UTC 2004 
State-Changed-Why:  
I've applied the fix that you provided in this PR.  Thanks very much for 
the analysis and the fix! 
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.