From 761fa7d7709bdf2380a02b92f695ecdee929188a Mon Sep 17 00:00:00 2001 From: Scott Mann Date: Wed, 30 Mar 2011 15:48:41 +0000 Subject: [PATCH] Fixes for various OS/environs for RT #23836 (--with-gssapi as default). --- bin/tests/system/Makefile.in | 4 +- bin/tests/system/tsiggss/Makefile.in | 55 +++++++++++++++++++++++++++ bin/tests/system/tsiggss/gssapi_krb.c | 28 ++++++++++++++ bin/tests/system/tsiggss/prereq.sh | 8 ++-- configure.in | 30 ++++++++++----- 5 files changed, 110 insertions(+), 15 deletions(-) create mode 100644 bin/tests/system/tsiggss/Makefile.in create mode 100644 bin/tests/system/tsiggss/gssapi_krb.c diff --git a/bin/tests/system/Makefile.in b/bin/tests/system/Makefile.in index b7f5a824c6..fc038eae06 100644 --- a/bin/tests/system/Makefile.in +++ b/bin/tests/system/Makefile.in @@ -13,7 +13,7 @@ # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR # PERFORMANCE OF THIS SOFTWARE. -# $Id: Makefile.in,v 1.36 2011/03/10 04:36:15 each Exp $ +# $Id: Makefile.in,v 1.37 2011/03/30 15:48:41 smann Exp $ srcdir = @srcdir@ VPATH = @srcdir@ @@ -21,7 +21,7 @@ top_srcdir = @top_srcdir@ @BIND9_MAKE_INCLUDES@ -SUBDIRS = dlzexternal filter-aaaa lwresd rpz tkey +SUBDIRS = dlzexternal filter-aaaa lwresd rpz tkey tsiggss TARGETS = @BIND9_MAKE_RULES@ diff --git a/bin/tests/system/tsiggss/Makefile.in b/bin/tests/system/tsiggss/Makefile.in new file mode 100644 index 0000000000..81aea2c2ac --- /dev/null +++ b/bin/tests/system/tsiggss/Makefile.in @@ -0,0 +1,55 @@ +# Copyright (C) 2011 Internet Systems Consortium, Inc. ("ISC") +# +# Permission to use, copy, modify, and/or distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH +# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, +# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +# PERFORMANCE OF THIS SOFTWARE. + +# $Id: Makefile.in,v 1.2 2011/03/30 15:48:41 smann Exp $ + +srcdir = @srcdir@ +VPATH = @srcdir@ +top_srcdir = @top_srcdir@ + +@BIND9_VERSION@ + +@BIND9_MAKE_INCLUDES@ + +CINCLUDES = ${DNS_INCLUDES} ${ISC_INCLUDES} +CDEFINES = +CWARNINGS = + +LIBS = @LIBS@ + +#SO_TARGETS = driver.@SO@ +TARGETS = gssapi_krb@EXEEXT@ @SO_TARGETS@ + +SRCS = gssapi_krb.c driver.c + +GSSAPIKRBOBJS = gssapi_krb.@O@ + +SO_OBJS = driver.@O@ +SO_SRCS = driver.c + +OBJS = ${GSSAPIKRBOBJS} + +@BIND9_MAKE_RULES@ + +CFLAGS = @CFLAGS@ @SO_CFLAGS@ + +gssapi_krb@EXEEXT@: ${GSSAPIKRBOBJS} + ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} \ + -o $@ ${GSSAPIKRBOBJS} ${LIBS} + +#driver.@SO@: ${SO_OBJS} +# @SO_LD@ -o $@ driver.o + +clean distclean:: + rm -f ${TARGETS} diff --git a/bin/tests/system/tsiggss/gssapi_krb.c b/bin/tests/system/tsiggss/gssapi_krb.c new file mode 100644 index 0000000000..b2046d0bbb --- /dev/null +++ b/bin/tests/system/tsiggss/gssapi_krb.c @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2011 Internet Systems Consortium, Inc. ("ISC") + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH + * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, + * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE + * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + +/* $Id: gssapi_krb.c,v 1.2 2011/03/30 15:48:41 smann Exp $ */ + +#include + +int +main() { +#if defined(HAVE_GSSAPI_H) && defined(HAVE_KRB5_H) + return (0); +#else + return (1); +#endif +} diff --git a/bin/tests/system/tsiggss/prereq.sh b/bin/tests/system/tsiggss/prereq.sh index 17c7d5a396..8a3b7fb156 100644 --- a/bin/tests/system/tsiggss/prereq.sh +++ b/bin/tests/system/tsiggss/prereq.sh @@ -14,14 +14,14 @@ # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR # PERFORMANCE OF THIS SOFTWARE. -# $Id: prereq.sh,v 1.3 2010/12/20 23:47:20 tbox Exp $ +# $Id: prereq.sh,v 1.4 2011/03/30 15:48:41 smann Exp $ TOP=${SYSTEMTESTTOP:=.}/../../../.. # enable the tsiggss test only if gssapi was enabled -$TOP/bin/named/named -V | grep with.gssapi | grep -v with-gssapi=no > /dev/null || { - echo "I:BIND9 was not built with --with-gssapi" - exit 255 +./gssapi_krb5 || { + echo "I:gssapi and krb5 not supported - skipping tsiggss test" + exit 255 } exit 0 diff --git a/configure.in b/configure.in index 9328f8a5b6..0e304d05ca 100644 --- a/configure.in +++ b/configure.in @@ -18,7 +18,7 @@ AC_DIVERT_PUSH(1)dnl esyscmd([sed "s/^/# /" COPYRIGHT])dnl AC_DIVERT_POP()dnl -AC_REVISION($Revision: 1.521 $) +AC_REVISION($Revision: 1.522 $) AC_INIT(lib/dns/name.c) AC_PREREQ(2.59) @@ -803,23 +803,34 @@ AC_ARG_WITH(gssapi, # gssapi is just the framework, we really require kerberos v5, so # look for those headers (the gssapi headers must be there, too) # The problem with this implementation is that it doesn't allow -# for the specification of gssapi and krb5 headers in different locations -# This probably ought to be fixed. -krb5dirs="/usr/local /usr/local/krb5 /usr/local/kerberosv5 /usr/local/kerberos /usr/pkg /usr/krb5 /usr/kerberosv5 /usr/kerberos /usr" +# for the specification of gssapi and krb5 headers in different locations, +# which probably ought to be fixed although fixing might raise the issue of +# trying to build with incompatible versions of gssapi and krb5. if test "$use_gssapi" = "yes" then - for d in $krb5dirs - do - if test -f $d/include/gssapi/gssapi_krb5.h -o -f $d/include/krb5.h + # first, deal with the obvious + if test \( -f /usr/include/kerberosv5/krb5.h -o \ + -f /usr/include/krb5/krb5.h -o \ + -f /usr/include/krb5.h \) -a -f /usr/include/gssapi.h + then + use_gssapi=/usr + else + krb5dirs="/usr/local /usr/local/krb5 /usr/local/kerberosv5 /usr/local/kerberos /usr/pkg /usr/krb5 /usr/kerberosv5 /usr/kerberos /usr" + for d in $krb5dirs + do + if test -f $d/include/gssapi/gssapi_krb5.h -o \ + -f $d/include/krb5.h then - if test -f $d/include/gssapi/gssapi.h -o -f $d/include/gssapi.h + if test -f $d/include/gssapi/gssapi.h -o \ + -f $d/include/gssapi.h then use_gssapi=$d break fi fi use_gssapi="no" - done + done + fi fi case "$use_gssapi" in @@ -3416,6 +3427,7 @@ AC_CONFIG_FILES([ bin/tests/system/lwresd/Makefile bin/tests/system/rpz/Makefile bin/tests/system/tkey/Makefile + bin/tests/system/tsiggss/Makefile bin/tests/tasks/Makefile bin/tests/timers/Makefile bin/tests/virtual-time/Makefile