- (dtucker) [configure.ac gss-serv-krb5.c ssh-gss.h] Define GSSAPI when found

with krb5-config, hunt down gssapi.h and friends.  Based partially on patch
   from deengert at anl.gov.

For the MIT Kerberos bug against krb5-config related to this see:
http://krbdev.mit.edu/rt/Ticket/Display.html?id=2240
This commit is contained in:
Darren Tucker 2004-02-24 10:37:33 +11:00
parent a6ea420c38
commit 0d27ed1c19
4 changed files with 35 additions and 21 deletions

View File

@ -13,6 +13,9 @@
- markus@cvs.openbsd.org 2004/02/23 15:16:46 - markus@cvs.openbsd.org 2004/02/23 15:16:46
[version.h] [version.h]
enter 3.8 enter 3.8
- (dtucker) [configure.ac gss-serv-krb5.c ssh-gss.h] Define GSSAPI when found
with krb5-config, hunt down gssapi.h and friends. Based partially on patch
from deengert at anl.gov.
20040223 20040223
- (dtucker) [session.c] Bug #789: Only make setcred call for !privsep in the - (dtucker) [session.c] Bug #789: Only make setcred call for !privsep in the
@ -1916,4 +1919,4 @@
- Fix sshd BindAddress and -b options for systems using fake-getaddrinfo. - Fix sshd BindAddress and -b options for systems using fake-getaddrinfo.
Report from murple@murple.net, diagnosis from dtucker@zip.com.au Report from murple@murple.net, diagnosis from dtucker@zip.com.au
$Id: ChangeLog,v 1.3247 2004/02/23 22:24:01 dtucker Exp $ $Id: ChangeLog,v 1.3248 2004/02/23 23:37:33 dtucker Exp $

View File

@ -1,4 +1,4 @@
# $Id: configure.ac,v 1.200 2004/02/22 00:37:48 dtucker Exp $ # $Id: configure.ac,v 1.201 2004/02/23 23:37:33 dtucker Exp $
AC_INIT AC_INIT
AC_CONFIG_SRCDIR([ssh.c]) AC_CONFIG_SRCDIR([ssh.c])
@ -2084,18 +2084,15 @@ AC_ARG_WITH(kerberos5,
AC_MSG_CHECKING(for gssapi support) AC_MSG_CHECKING(for gssapi support)
if $KRB5CONF | grep gssapi >/dev/null ; then if $KRB5CONF | grep gssapi >/dev/null ; then
AC_MSG_RESULT(yes) AC_MSG_RESULT(yes)
K5CFLAGS="`$KRB5CONF --cflags gssapi`" AC_DEFINE(GSSAPI)
dnl m4 quadragraphs: "sed 's/-l[^ ]* //g'" k5confopts=gssapi
K5LDFLAGS="`$KRB5CONF --libs gssapi | sed 's/-l@<:@^ @:>@* //g'`"
K5LIBS="`$KRB5CONF --libs gssapi | sed 's/-L@<:@^ @:>@* //g'`"
else else
AC_MSG_RESULT(no) AC_MSG_RESULT(no)
K5CFLAGS="`$KRB5CONF --cflags`" k5confopts=""
K5LDFLAGS="`$KRB5CONF --libs | sed 's/-l@<:@^ @:>@* //g'`"
K5LIBS="`$KRB5CONF --libs | sed 's/-L@<:@^ @:>@* //g'`"
fi fi
K5CFLAGS="`$KRB5CONF --cflags $k5confopts`"
K5LIBS="`$KRB5CONF --libs $k5confopts`"
CPPFLAGS="$CPPFLAGS $K5CFLAGS" CPPFLAGS="$CPPFLAGS $K5CFLAGS"
LDFLAGS="$LDFLAGS $K5LDFLAGS"
AC_MSG_CHECKING(whether we are using Heimdal) AC_MSG_CHECKING(whether we are using Heimdal)
AC_TRY_COMPILE([ #include <krb5.h> ], AC_TRY_COMPILE([ #include <krb5.h> ],
[ char *tmp = heimdal_version; ], [ char *tmp = heimdal_version; ],
@ -2152,14 +2149,16 @@ AC_ARG_WITH(kerberos5,
if test ! -z "$blibpath" ; then if test ! -z "$blibpath" ; then
blibpath="$blibpath:${KRB5ROOT}/lib" blibpath="$blibpath:${KRB5ROOT}/lib"
fi fi
fi ] fi
AC_SEARCH_LIBS(k_hasafs, kafs,
[ AC_DEFINE(USE_AFS) AC_CHECK_HEADERS(gssapi.h gssapi/gssapi.h)
K5LIBS="-lkafs $K5LIBS" AC_CHECK_HEADERS(gssapi_krb5.h gssapi/gssapi_krb5.h)
] AC_CHECK_HEADERS(gssapi_generic.h gssapi/gssapi_generic.h)
)
LIBS="$LIBS $K5LIBS"
AC_SEARCH_LIBS(k_hasafs, kafs, AC_DEFINE(USE_AFS))
]
) )
LIBS="$LIBS $K5LIBS"
# Looking for programs, paths and files # Looking for programs, paths and files

View File

@ -39,9 +39,13 @@
extern ServerOptions options; extern ServerOptions options;
#ifdef HEIMDAL #ifdef HEIMDAL
#include <krb5.h> # include <krb5.h>
#else #else
#include <gssapi_krb5.h> # ifdef HAVE_GSSAPI_KRB5
# include <gssapi_krb5.h>
# elif HAVE_GSSAPI_GSSAPI_KRB5
# include <gssapi/gssapi_krb5.h>
# endif
#endif #endif
static krb5_context krb_context = NULL; static krb5_context krb_context = NULL;

View File

@ -30,11 +30,19 @@
#include "buffer.h" #include "buffer.h"
#ifdef HAVE_GSSAPI_H
#include <gssapi.h> #include <gssapi.h>
#elif defined(HAVE_GSSAPI_GSSAPI_H)
#include <gssapi/gssapi.h>
#endif
#ifdef KRB5 #ifdef KRB5
#ifndef HEIMDAL # ifndef HEIMDAL
#include <gssapi_generic.h> # ifdef HAVE_GSSAPI_GENERIC_H
# include <gssapi_generic.h>
# elif defined(HAVE_GSSAPI_GSSAPI_GENERIC_H)
# include <gssapi/gssapi_generic.h>
# endif
/* MIT Kerberos doesn't seem to define GSS_NT_HOSTBASED_SERVICE */ /* MIT Kerberos doesn't seem to define GSS_NT_HOSTBASED_SERVICE */