summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Karl Ramm <kcr@mit.edu>2008-12-24 23:52:23 +0000
committerGravatar Karl Ramm <kcr@mit.edu>2008-12-24 23:52:23 +0000
commitd44cdd8600187a9c000d1e036c7dd8721c941caf (patch)
treefb4a4262d802dff06ee1c03a3c6e67d047310ac7
parentb1aa1f99237b8743dc10defbbc14a8fa359a6c9f (diff)
make this work^H^H^H^Hcompile with Heimdal
-rw-r--r--aclocal.m45
-rwxr-xr-xconfigure539
-rw-r--r--configure.in30
-rw-r--r--h/config.h.in3
-rw-r--r--h/internal.h2
-rw-r--r--lib/Zinternal.c10
-rw-r--r--lib/quad_cksum.c13
-rw-r--r--server/bdump.c15
8 files changed, 565 insertions, 52 deletions
diff --git a/aclocal.m4 b/aclocal.m4
index fadf7b4..8471cbc 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -244,8 +244,7 @@ if test "$krb5" != yes; then
LDFLAGS="$LDFLAGS -L$krb5/lib"
fi
AC_CHECK_LIB(krb5, krb5_init_context, :,
- [AC_MSG_ERROR(Kerberos 5 libraries not found)],
- -lk5crypto -lcom_err)])
+ [AC_MSG_ERROR(Kerberos 5 libraries not found)])])
AC_DEFUN([ATHENA_KRB5],
[AC_ARG_WITH(krb5,
@@ -253,7 +252,7 @@ AC_DEFUN([ATHENA_KRB5],
[krb5="$withval"], [krb5=no])
if test "$krb5" != no; then
ATHENA_KRB5_CHECK
- KRB5_LIBS="-lkrb5 -lk5crypto -lcom_err"
+ KRB5_LIBS="-lkrb5"
AC_DEFINE(HAVE_KRB5)
fi
AC_SUBST(KRB5_LIBS)])
diff --git a/configure b/configure
index 4466d3b..00d5e42 100755
--- a/configure
+++ b/configure
@@ -860,6 +860,7 @@ TLIB
RLIB
SLIB
KRB4_LIBS
+krb5config
KRB5_LIBS
HESIOD_LIBS
REGEX_LIBS
@@ -4141,7 +4142,7 @@ ia64-*-hpux*)
;;
*-*-irix6*)
# Find out which ABI we are using.
- echo '#line 4144 "configure"' > conftest.$ac_ext
+ echo '#line 4145 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
@@ -6707,11 +6708,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:6710: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:6711: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:6714: \$? = $ac_status" >&5
+ echo "$as_me:6715: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
@@ -6940,11 +6941,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:6943: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:6944: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:6947: \$? = $ac_status" >&5
+ echo "$as_me:6948: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
@@ -7000,11 +7001,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:7003: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:7004: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:7007: \$? = $ac_status" >&5
+ echo "$as_me:7008: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -8330,7 +8331,7 @@ linux*)
libsuff=
case "$host_cpu" in
x86_64*|s390x*|powerpc64*)
- echo '#line 8333 "configure"' > conftest.$ac_ext
+ echo '#line 8334 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
@@ -9168,7 +9169,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 9171 "configure"
+#line 9172 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -9266,7 +9267,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 9269 "configure"
+#line 9270 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -11445,11 +11446,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:11448: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:11449: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:11452: \$? = $ac_status" >&5
+ echo "$as_me:11453: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
@@ -11505,11 +11506,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:11508: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:11509: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:11512: \$? = $ac_status" >&5
+ echo "$as_me:11513: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -12016,7 +12017,7 @@ linux*)
libsuff=
case "$host_cpu" in
x86_64*|s390x*|powerpc64*)
- echo '#line 12019 "configure"' > conftest.$ac_ext
+ echo '#line 12020 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
@@ -12854,7 +12855,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 12857 "configure"
+#line 12858 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -12952,7 +12953,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 12955 "configure"
+#line 12956 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -13779,11 +13780,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:13782: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:13783: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:13786: \$? = $ac_status" >&5
+ echo "$as_me:13787: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
@@ -13839,11 +13840,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:13842: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:13843: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:13846: \$? = $ac_status" >&5
+ echo "$as_me:13847: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -15149,7 +15150,7 @@ linux*)
libsuff=
case "$host_cpu" in
x86_64*|s390x*|powerpc64*)
- echo '#line 15152 "configure"' > conftest.$ac_ext
+ echo '#line 15153 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
@@ -15893,11 +15894,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:15896: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:15897: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:15900: \$? = $ac_status" >&5
+ echo "$as_me:15901: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
@@ -16126,11 +16127,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:16129: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:16130: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:16133: \$? = $ac_status" >&5
+ echo "$as_me:16134: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
@@ -16186,11 +16187,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:16189: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:16190: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:16193: \$? = $ac_status" >&5
+ echo "$as_me:16194: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -17516,7 +17517,7 @@ linux*)
libsuff=
case "$host_cpu" in
x86_64*|s390x*|powerpc64*)
- echo '#line 17519 "configure"' > conftest.$ac_ext
+ echo '#line 17520 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
@@ -18354,7 +18355,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 18357 "configure"
+#line 18358 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -18452,7 +18453,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 18455 "configure"
+#line 18456 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -24017,6 +24018,379 @@ _ACEOF
fi
+
+# Check whether --with-krb5 was given.
+if test "${with_krb5+set}" = set; then
+ withval=$with_krb5; krb5="$withval"
+else
+ krb5=no
+fi
+
+if test "$krb5" != no; then
+ { echo "$as_me:$LINENO: checking for library containing gethostbyname" >&5
+echo $ECHO_N "checking for library containing gethostbyname... $ECHO_C" >&6; }
+if test "${ac_cv_search_gethostbyname+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char gethostbyname ();
+int
+main ()
+{
+return gethostbyname ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' nsl; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ ac_cv_search_gethostbyname=$ac_res
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext
+ if test "${ac_cv_search_gethostbyname+set}" = set; then
+ break
+fi
+done
+if test "${ac_cv_search_gethostbyname+set}" = set; then
+ :
+else
+ ac_cv_search_gethostbyname=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_search_gethostbyname" >&5
+echo "${ECHO_T}$ac_cv_search_gethostbyname" >&6; }
+ac_res=$ac_cv_search_gethostbyname
+if test "$ac_res" != no; then
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+ { echo "$as_me:$LINENO: checking for library containing socket" >&5
+echo $ECHO_N "checking for library containing socket... $ECHO_C" >&6; }
+if test "${ac_cv_search_socket+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char socket ();
+int
+main ()
+{
+return socket ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' socket; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ ac_cv_search_socket=$ac_res
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext
+ if test "${ac_cv_search_socket+set}" = set; then
+ break
+fi
+done
+if test "${ac_cv_search_socket+set}" = set; then
+ :
+else
+ ac_cv_search_socket=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_search_socket" >&5
+echo "${ECHO_T}$ac_cv_search_socket" >&6; }
+ac_res=$ac_cv_search_socket
+if test "$ac_res" != no; then
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+
+{ echo "$as_me:$LINENO: checking for compile in -lgen" >&5
+echo $ECHO_N "checking for compile in -lgen... $ECHO_C" >&6; }
+if test "${ac_cv_lib_gen_compile+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lgen $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char compile ();
+int
+main ()
+{
+return compile ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ ac_cv_lib_gen_compile=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_lib_gen_compile=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_gen_compile" >&5
+echo "${ECHO_T}$ac_cv_lib_gen_compile" >&6; }
+if test $ac_cv_lib_gen_compile = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBGEN 1
+_ACEOF
+
+ LIBS="-lgen $LIBS"
+
+fi
+
+ if test "$krb5" != yes; then
+ PATH="$PATH:$krb5/bin"
+ fi
+ # Extract the first word of "krb5-config", so it can be a program name with args.
+set dummy krb5-config; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_krb5config+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$krb5config"; then
+ ac_cv_prog_krb5config="$krb5config" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_krb5config="yes"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+krb5config=$ac_cv_prog_krb5config
+if test -n "$krb5config"; then
+ { echo "$as_me:$LINENO: result: $krb5config" >&5
+echo "${ECHO_T}$krb5config" >&6; }
+else
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+ if test "$krb5config" == yes; then
+ CPPFLAGS="$CPPFLAGS $(krb5-config --cflags krb5)"
+ KRB5_LIBS="$(krb5-config --libs krb5)"
+ else
+ if test "$krb5" != yes; then
+ CPPFLAGS="$CPPFLAGS -I$krb5/include"
+ LDFLAGS="$LDFLAGS -L$krb5/lib"
+ fi
+ { echo "$as_me:$LINENO: checking for krb5_init_context in -lkrb5" >&5
+echo $ECHO_N "checking for krb5_init_context in -lkrb5... $ECHO_C" >&6; }
+if test "${ac_cv_lib_krb5_krb5_init_context+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lkrb5 -lk5crypto -lcom_err $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char krb5_init_context ();
+int
+main ()
+{
+return krb5_init_context ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ ac_cv_lib_krb5_krb5_init_context=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_lib_krb5_krb5_init_context=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_krb5_krb5_init_context" >&5
+echo "${ECHO_T}$ac_cv_lib_krb5_krb5_init_context" >&6; }
+if test $ac_cv_lib_krb5_krb5_init_context = yes; then
+ :
+else
+ { { echo "$as_me:$LINENO: error: Kerberos 5 libraries not found" >&5
+echo "$as_me: error: Kerberos 5 libraries not found" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+ KRB5_LIBS="-lkrb5 -l5crypto -lcom_err"
+ fi
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_KRB5 1
+_ACEOF
+
+fi
+
+
+
# Check whether --with-krb5 was given.
if test "${with_krb5+set}" = set; then
withval=$with_krb5; krb5="$withval"
@@ -24272,7 +24646,7 @@ if test "${ac_cv_lib_krb5_krb5_init_context+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lkrb5 -lk5crypto -lcom_err $LIBS"
+LIBS="-lkrb5 $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -24335,7 +24709,7 @@ echo "$as_me: error: Kerberos 5 libraries not found" >&2;}
{ (exit 1); exit 1; }; }
fi
- KRB5_LIBS="-lkrb5 -lk5crypto -lcom_err"
+ KRB5_LIBS="-lkrb5"
cat >>confdefs.h <<\_ACEOF
#define HAVE_KRB5 1
_ACEOF
@@ -25988,6 +26362,100 @@ fi
done
+for ac_func in krb5_crypto_init
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined __stub_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
+int
+main ()
+{
+return $ac_func ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ eval "$as_ac_var=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ eval "$as_ac_var=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval echo '${'$as_ac_var'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
{ echo "$as_me:$LINENO: checking for krb5_auth_con_getauthenticator taking double pointer" >&5
echo $ECHO_N "checking for krb5_auth_con_getauthenticator taking double pointer... $ECHO_C" >&6; }
if test "${ac_cv_krb5_auth_con_getauthenticator_takes_double_pointer+set}" = set; then
@@ -26904,10 +27372,10 @@ TLIB!$TLIB$ac_delim
RLIB!$RLIB$ac_delim
SLIB!$SLIB$ac_delim
KRB4_LIBS!$KRB4_LIBS$ac_delim
+krb5config!$krb5config$ac_delim
KRB5_LIBS!$KRB5_LIBS$ac_delim
HESIOD_LIBS!$HESIOD_LIBS$ac_delim
REGEX_LIBS!$REGEX_LIBS$ac_delim
-ARES_LIBS!$ARES_LIBS$ac_delim
_ACEOF
if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
@@ -26949,11 +27417,12 @@ _ACEOF
ac_delim='%!_!# '
for ac_last_try in false false false false false :; do
cat >conf$$subs.sed <<_ACEOF
+ARES_LIBS!$ARES_LIBS$ac_delim
LIBOBJS!$LIBOBJS$ac_delim
LTLIBOBJS!$LTLIBOBJS$ac_delim
_ACEOF
- if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 2; then
+ if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 3; then
break
elif $ac_last_try; then
{ { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
diff --git a/configure.in b/configure.in
index 57b97df..7768afa 100644
--- a/configure.in
+++ b/configure.in
@@ -85,6 +85,35 @@ AC_SUBST(RLIB)
AC_SUBST(SLIB)
ATHENA_KRB4
+
+AC_ARG_WITH(krb5,
+ [ --with-krb5=PREFIX Use Kerberos 5],
+ [krb5="$withval"], [krb5=no])
+if test "$krb5" != no; then
+ AC_SEARCH_LIBS(gethostbyname, nsl)
+ AC_SEARCH_LIBS(socket, socket)
+ AC_CHECK_LIB(gen, compile)
+ if test "$krb5" != yes; then
+ PATH="$PATH:$krb5/bin"
+ fi
+ AC_CHECK_PROG(krb5config, krb5-config,yes)
+ if test "$krb5config" == yes; then
+ CPPFLAGS="$CPPFLAGS $(krb5-config --cflags krb5)"
+ KRB5_LIBS="$(krb5-config --libs krb5)"
+ else
+ if test "$krb5" != yes; then
+ CPPFLAGS="$CPPFLAGS -I$krb5/include"
+ LDFLAGS="$LDFLAGS -L$krb5/lib"
+ fi
+ AC_CHECK_LIB(krb5, krb5_init_context, :,
+ [AC_MSG_ERROR(Kerberos 5 libraries not found)],
+ -lk5crypto -lcom_err)
+ KRB5_LIBS="-lkrb5 -l5crypto -lcom_err"
+ fi
+ AC_DEFINE(HAVE_KRB5)
+fi
+AC_SUBST(KRB5_LIBS)
+
ATHENA_KRB5
ATHENA_HESIOD
ATHENA_REGEXP
@@ -101,6 +130,7 @@ AC_FUNC_SETPGRP
AC_CHECK_FUNCS(putenv strchr memcpy memmove waitpid getlogin strerror random)
AC_CHECK_FUNCS(lrand48 gethostid getsid getpgid krb_get_err_text krb_log)
AC_CHECK_FUNCS(krb5_free_data krb5_c_make_checksum krb5_cc_set_default_name)
+AC_CHECK_FUNCS(krb5_crypto_init)
AC_MSG_CHECKING(for krb5_auth_con_getauthenticator taking double pointer)
AC_CACHE_VAL(ac_cv_krb5_auth_con_getauthenticator_takes_double_pointer, [
diff --git a/h/config.h.in b/h/config.h.in
index 40c0a3e..ec4faad 100644
--- a/h/config.h.in
+++ b/h/config.h.in
@@ -20,6 +20,9 @@
/* Define to 1 if you have the `krb5_cc_set_default_name' function. */
#undef HAVE_KRB5_CC_SET_DEFAULT_NAME
+/* Define to 1 if you have the `krb5_crypto_init' function. */
+#undef HAVE_KRB5_CRYPTO_INIT
+
/* Define to 1 if `krb5_auth_con_getauthenticator' takes a double pointer third arg. */
#undef KRB5_AUTH_CON_GETAUTHENTICATOR_TAKES_DOUBLE_POINTER
diff --git a/h/internal.h b/h/internal.h
index e00721c..2869543 100644
--- a/h/internal.h
+++ b/h/internal.h
@@ -146,7 +146,7 @@ Code_t Z_InsertZcodeChecksum(krb5_keyblock *keyblock, ZNotice_t *notice,
char *cksum_start, int cksum_len,
char *cstart, char *cend, int buffer_len,
int *length_ajdust);
-unsigned long z_quad_cksum(const unsigned char *, krb5_ui_4 *, long,
+unsigned long z_quad_cksum(const unsigned char *, u_int32_t *, long,
int, unsigned char *);
#endif
diff --git a/lib/Zinternal.c b/lib/Zinternal.c
index d5e0e44..504a9a8 100644
--- a/lib/Zinternal.c
+++ b/lib/Zinternal.c
@@ -1272,14 +1272,14 @@ Z_Checksum(krb5_data *cksumbuf,
krb5_error_code result;
unsigned char *data;
int len;
-#if HAVE_KRB5_C_MAKE_CHECKSUM
+#ifndef HAVE_KRB5_CRYPTO_INIT
krb5_checksum checksum;
#else
Checksum checksum;
krb5_crypto cryptctx;
#endif
-#if HAVE_KRB5_C_MAKE_CHECKSUM
+#ifndef HAVE_KRB5_CRYPTO_INIT
/* Create the checksum -- MIT crypto API */
result = krb5_c_make_checksum(Z_krb5_ctx, cksumtype,
keyblock, Z_KEYUSAGE_CLT_CKSUM,
@@ -1317,7 +1317,7 @@ Z_Checksum(krb5_data *cksumbuf,
memcpy(*asn1_data, data, len);
*asn1_len = len;
-#if HAVE_KRB5_C_MAKE_CHECKSUM
+#ifndef HAVE_KRB5_CRYPTO_INIT
krb5_free_checksum_contents(Z_krb5_ctx, &checksum);
#else
free_Checksum(&checksum);
@@ -1414,7 +1414,7 @@ Z_krb5_verify_cksum(krb5_keyblock *keyblock,
int asn1_len)
{
krb5_error_code result;
-#if HAVE_KRB5_C_MAKE_CHECKSUM
+#ifndef HAVE_KRB5_CRYPTO_INIT
krb5_checksum checksum;
krb5_boolean valid;
#else
@@ -1424,7 +1424,7 @@ Z_krb5_verify_cksum(krb5_keyblock *keyblock,
#endif
memset(&checksum, 0, sizeof(checksum));
-#if HAVE_KRB5_C_MAKE_CHECKSUM
+#ifndef HAVE_KRB5_CRYPTO_INIT
/* Verify the checksum -- MIT crypto API */
checksum.length = asn1_len;
checksum.contents = asn1_data;
diff --git a/lib/quad_cksum.c b/lib/quad_cksum.c
index 5d06440..dc43e46 100644
--- a/lib/quad_cksum.c
+++ b/lib/quad_cksum.c
@@ -105,6 +105,7 @@
/* System include files */
+#include <sys/types.h>
#include <stdio.h>
#include <errno.h>
@@ -123,7 +124,7 @@
#ifdef HAVE_KRB5
unsigned long
z_quad_cksum(const unsigned char *in, /* input block */
- krb5_ui_4 *out, /* optional longer output */
+ u_int32_t *out, /* optional longer output */
long length, /* original length in bytes */
int out_count, /* number of iterations */
unsigned char *c_seed /* secret seed, 8 bytes */
@@ -137,12 +138,12 @@ z_quad_cksum(const unsigned char *in, /* input block */
* checksum is written unto the address pointed to.
*/
- register krb5_ui_4 z;
- register krb5_ui_4 z2;
- register krb5_ui_4 x;
- register krb5_ui_4 x2;
+ register u_int32_t z;
+ register u_int32_t z2;
+ register u_int32_t x;
+ register u_int32_t x2;
const unsigned char *p;
- register krb5_int32 len;
+ register int32_t len;
register int i;
/* use all 8 bytes of seed */
diff --git a/server/bdump.c b/server/bdump.c
index 1b40336..8df2e87 100644
--- a/server/bdump.c
+++ b/server/bdump.c
@@ -103,7 +103,7 @@ static void shutdown_file_pointers(void);
static void cleanup(Server *server);
#if defined(HAVE_KRB4) || defined(HAVE_KRB5)
-static int des_service_decrypt(char *in, char *out);
+static int des_service_decrypt(unsigned char *in, unsigned char *out);
#endif
#ifdef HAVE_KRB5
static long ticket5_time;
@@ -1003,7 +1003,9 @@ int got_des = 0;
unsigned int enctypes[] = {ENCTYPE_DES_CBC_CRC,
ENCTYPE_DES_CBC_MD4,
ENCTYPE_DES_CBC_MD5,
+#ifdef ENCTYPE_DES_CBC_RAW
ENCTYPE_DES_CBC_RAW,
+#endif
0};
#endif
@@ -1101,7 +1103,12 @@ get_tgt(void)
break;
}
if (!retval) {
+#ifdef HAVE_KRB5_CRYPTO_INIT
+ retval = krb5_copy_keyblock(Z_krb5_ctx, &kt_ent.keyblock,
+ &server_key);
+#else
retval = krb5_copy_keyblock(Z_krb5_ctx, &kt_ent.key, &server_key);
+#endif
if (retval) {
krb5_free_principal(Z_krb5_ctx, principal);
krb5_kt_close(Z_krb5_ctx, kt);
@@ -1667,7 +1674,7 @@ setup_file_pointers (void)
}
#ifdef HAVE_KRB5
-static int des_service_decrypt(char *in, char *out) {
+static int des_service_decrypt(unsigned char *in, unsigned char *out) {
#ifndef HAVE_KRB4
krb5_data dout;
krb5_enc_data din;
@@ -1679,7 +1686,11 @@ static int des_service_decrypt(char *in, char *out) {
din.ciphertext.data = in;
din.enctype = Z_enctype(server_key);
+#ifdef HAVE_KRB5_CRYPTO_INIT
+ return krb5_c_decrypt(Z_krb5_ctx, *server_key, 0, 0, &din, &dout);
+#else
return krb5_c_decrypt(Z_krb5_ctx, server_key, 0, 0, &din, &dout);
+#endif
#else
des_ecb_encrypt((C_Block *)in, (C_Block *)out, serv_ksched.s, DES_DECRYPT);
return 0; /* sigh */