From: Todd C. Miller Date: Fri, 4 Apr 2003 17:45:24 +0000 (+0000) Subject: Check for heimdal even if we found krb5-config and define HAVE_HEIMDAL. X-Git-Tag: SUDO_1_6_8~339 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fab224f42f40ea996a925b651806b8afcf382702;p=sudo Check for heimdal even if we found krb5-config and define HAVE_HEIMDAL. --- diff --git a/config.h.in b/config.h.in index cbcc2200d..de4468905 100644 --- a/config.h.in +++ b/config.h.in @@ -124,6 +124,9 @@ passwords) */ #undef HAVE_GETSPWUID +/* Define if your Kerberos is Heimdal. */ +#undef HAVE_HEIMDAL + /* Define to 1 if you have the `initgroups' function. */ #undef HAVE_INITGROUPS diff --git a/configure b/configure index 417b6faec..dba1015ae 100755 --- a/configure +++ b/configure @@ -13363,6 +13363,52 @@ _ACEOF AUTH_OBJS="${AUTH_OBJS} kerb5.o" CPPFLAGS="$CPPFLAGS `krb5-config --cflags`" SUDO_LIBS="$SUDO_LIBS `krb5-config --libs`" + echo "$as_me:$LINENO: checking whether we are using Heimdal" >&5 +echo $ECHO_N "checking whether we are using Heimdal... $ECHO_C" >&6 + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +const char *tmp = heimdal_version; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +cat >>confdefs.h <<\_ACEOF +#define HAVE_HEIMDAL 1 +_ACEOF + + + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.$ac_objext conftest.$ac_ext fi fi if test -n "$with_kerb5" -a -z "$KRB5CONFIG"; then @@ -13457,6 +13503,11 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 + +cat >>confdefs.h <<\_ACEOF +#define HAVE_HEIMDAL 1 +_ACEOF + SUDO_LIBS="${SUDO_LIBS} -lkrb5 -ldes -lcom_err -lasn1" echo "$as_me:$LINENO: checking for main in -lroken" >&5 echo $ECHO_N "checking for main in -lroken... $ECHO_C" >&6 diff --git a/configure.in b/configure.in index 098a0823b..6521bfbd0 100644 --- a/configure.in +++ b/configure.in @@ -1779,6 +1779,16 @@ if test "$with_kerb5" = "yes"; then AUTH_OBJS="${AUTH_OBJS} kerb5.o" CPPFLAGS="$CPPFLAGS `krb5-config --cflags`" SUDO_LIBS="$SUDO_LIBS `krb5-config --libs`" + dnl + dnl Try to determine whether we have Heimdal or MIT Kerberos + dnl + AC_MSG_CHECKING(whether we are using Heimdal) + AC_TRY_COMPILE([#include ], [const char *tmp = heimdal_version;], + [ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_HEIMDAL, 1, [Define if your Kerberos is Heimdal.]) + ] + ) fi fi if test -n "$with_kerb5" -a -z "$KRB5CONFIG"; then @@ -1810,6 +1820,7 @@ if test -n "$with_kerb5" -a -z "$KRB5CONFIG"; then AC_TRY_COMPILE([#include ], [const char *tmp = heimdal_version;], [ AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_HEIMDAL, 1, [Define if your Kerberos is Heimdal.]) SUDO_LIBS="${SUDO_LIBS} -lkrb5 -ldes -lcom_err -lasn1" AC_CHECK_LIB(roken, main, [SUDO_LIBS="${SUDO_LIBS} -lroken"]) ], [