OpenSSH-snap-20040212 and the use of krb5-config

Douglas E. Engert deengert at anl.gov
Tue Feb 17 04:12:12 EST 2004



Darren Tucker wrote:
> 
> Douglas E. Engert wrote:
> > With openssh-snap-20040212 the configure.ac when it finds a
> > krb5-config file, does not call the AC_DEFINE(GSSAPI) or
> > AC_CHECK_HEADER(gssapi.h...) This means that GSSAPI and HAVE_GSSAPI_H
> > are not defined, and thus GSSAPI is not built.
> 
> Fair enough.  How's this patch?

Attached is a modified version that will check for the gssapi.h 
and try to look in two places. This is similiar to the way it worked
without the krb5-config. So it will work with or without an MIT fix 
in the future. 
 
> 
> > If I rename the kerberos provided krb5-config file and run configure,
> > the old method of finding the Kerberos lib and include directories
> > is used and OpenSSH builds with the GSSAPI.
> >
> > There is also a seperate issue with the MIT version of krb5-config with
> > finding the location of gssapi.h. Its in thier .../include/gssapi which
> > is not returned by the krb5-config --cflags.  I have reported that to MIT as
> > a seperate bug.
> 
> I'm wondering what (if anything) configure should do about this.
> Currently it searches for GSSAPI includes in
> /path/to/kerberos/include/gssapi.  On the other hand, using krb5-config
> is supposed make things simpler, right :-?

Yes that was the intent. The gssapi.h in Heimdal appears to be in 
/path/to/kerberos/include where as with MIT it is in 
/path/to/kerberos/include/gssapi, but the MIT krb5-config only returns
/path/to/kerberos/include 

> 
> --
> Darren Tucker (dtucker at zip.com.au)
> GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4  37C9 C982 80C7 8FF4 FA69
>      Good judgement comes with experience. Unfortunately, the experience
> usually comes from bad judgement.
> 
>   ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> Index: configure.ac
> ===================================================================
> RCS file: /usr/local/src/security/openssh/cvs/openssh_cvs/configure.ac,v
> retrieving revision 1.198
> diff -u -p -r1.198 configure.ac
> --- configure.ac        12 Feb 2004 17:27:21 -0000      1.198
> +++ configure.ac        14 Feb 2004 00:43:32 -0000
> @@ -2084,6 +2084,9 @@ AC_ARG_WITH(kerberos5,
>                         AC_MSG_CHECKING(for gssapi support)
>                         if $KRB5CONF | grep gssapi >/dev/null ; then
>                                 AC_MSG_RESULT(yes)
> +                               AC_DEFINE(GSSAPI)
> +                               AC_CHECK_HEADERS(gssapi.h, ,
> +                                       AC_MSG_WARN([Cannot find any suitable gss-api header - build may fail])
>                                 K5CFLAGS="`$KRB5CONF --cflags gssapi`"
>                                 dnl  m4 quadragraphs: "sed 's/-l[^- ]*//g'"
>                                 K5LDFLAGS="`$KRB5CONF --libs gssapi | sed 's/-l@<:@^- @:>@*//g'`"
> 
>   ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> _______________________________________________
> openssh-unix-dev mailing list
> openssh-unix-dev at mindrot.org
> http://www.mindrot.org/mailman/listinfo/openssh-unix-dev

-- 

 Douglas E. Engert  <DEEngert at anl.gov>
 Argonne National Laboratory
 9700 South Cass Avenue
 Argonne, Illinois  60439 
 (630) 252-5444
-------------- next part --------------
--- ,configure.ac	Tue Feb 10 00:15:05 2004
+++ configure.ac	Mon Feb 16 09:29:56 2004
@@ -2084,18 +2084,29 @@
 			AC_MSG_CHECKING(for gssapi support)
 			if $KRB5CONF | grep gssapi >/dev/null ; then
 				AC_MSG_RESULT(yes)
+				AC_DEFINE(GSSAPI)
 				K5CFLAGS="`$KRB5CONF --cflags gssapi`"
 				dnl  m4 quadragraphs: "sed 's/-l[^- ]*//g'"
 				K5LDFLAGS="`$KRB5CONF --libs gssapi | sed 's/-l@<:@^- @:>@*//g'`"
 				K5LIBS="`$KRB5CONF --libs gssapi | sed 's/-L@<:@^- @:>@*//g'`"
+				CPPFLAGS="$CPPFLAGS $K5CFLAGS"
+				LDFLAGS="$LDFLAGS $K5LDFLAGS"
+				AC_CHECK_HEADER(gssapi.h, ,
+					[ unset ac_cv_header_gssapi_h
+						CPPFLAGS="$CPPFLAGS ${K5CFLAGS}/gssapi"
+						AC_CHECK_HEADERS(gssapi.h, ,
+							AC_MSG_WARN([Cannot find any suitable gss-api header - build may fail])
+						)
+					]
+				)
 			else
 				AC_MSG_RESULT(no)
 				K5CFLAGS="`$KRB5CONF --cflags`"
 				K5LDFLAGS="`$KRB5CONF --libs | sed 's/-l@<:@^- @:>@*//g'`"
 				K5LIBS="`$KRB5CONF --libs | sed 's/-L@<:@^- @:>@*//g'`"
+				CPPFLAGS="$CPPFLAGS $K5CFLAGS"
+				LDFLAGS="$LDFLAGS $K5LDFLAGS"
 			fi
-			CPPFLAGS="$CPPFLAGS $K5CFLAGS"
-			LDFLAGS="$LDFLAGS $K5LDFLAGS"
 			AC_MSG_CHECKING(whether we are using Heimdal)
 			AC_TRY_COMPILE([ #include <krb5.h> ],
 				       [ char *tmp = heimdal_version; ],


More information about the openssh-unix-dev mailing list