From bcdb5a184ee597244fe1c7a8c708ee6bf796d07a Mon Sep 17 00:00:00 2001 From: Ken Hornstein Date: Sun, 19 Jun 2005 02:06:21 +0000 Subject: [PATCH] more-aklog-fixes-20050618 Fixup aklog so it will compile (at least on MacOS X). Include basic autoconf glue. --- Makefile.in | 12 ++++++++- acinclude.m4 | 1 + configure.in | 1 + src/aklog/aklog.c | 1 + src/aklog/aklog.h | 1 + src/aklog/aklog_main.c | 12 +++++++++ src/aklog/aklog_param.c | 3 ++- src/aklog/krb_util.c | 1 + src/cf/kerberos.m4 | 67 +++++++++++++++++++++++++++++++++++++++++++++++++ 9 files changed, 97 insertions(+), 2 deletions(-) create mode 100644 src/cf/kerberos.m4 diff --git a/Makefile.in b/Makefile.in index 7c45912..1e4cd1f 100644 --- a/Makefile.in +++ b/Makefile.in @@ -324,7 +324,15 @@ sgistuff: cmd comerr kauth rxkad echo Skipping sgistuff for ${SYS_NAME} ;; \ esac -login: cmd comerr kauth rxkad pam sia tsm41 sgistuff +aklog: comerr ptserver + set -x; \ + if test "@BUILD_KRB5@" = "yes"; then \ + ${COMPILE_PART1} aklog ${COMPILE_PART2} ; \ + else \ + echo Skipping aklog for ${SYS_NAME} ; \ + fi + +login: cmd comerr kauth rxkad pam sia tsm41 sgistuff aklog set -x; \ if test "@BUILD_LOGIN@" = "yes"; then \ ${COMPILE_PART1} login ${COMPILE_PART2} ; \ @@ -630,6 +638,7 @@ clean2: -${COMPILE_PART1} sgistuff ${COMPILE_CLEAN} -${COMPILE_PART1} tsm41 ${COMPILE_CLEAN} -${COMPILE_PART1} sia ${COMPILE_CLEAN} + -${COMPILE_PART1} aklog ${COMPILE_CLEAN} -${COMPILE_PART1} login ${COMPILE_CLEAN} -${COMPILE_PART1} pam ${COMPILE_CLEAN} -${COMPILE_PART1} afsweb ${COMPILE_CLEAN} @@ -684,6 +693,7 @@ distclean: clean src/afsd/afs.ppc_darwin.plist \ src/afsmonitor/Makefile \ src/afsweb/Makefile \ + src/aklog/Makefile \ src/audit/Makefile \ src/auth/test/Makefile \ src/auth/Makefile \ diff --git a/acinclude.m4 b/acinclude.m4 index 17e931c..aed3112 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1094,6 +1094,7 @@ AC_SUBST(DARWIN_INFOFILE) AC_SUBST(IRIX_BUILD_IP35) OPENAFS_OSCONF +OPENAFS_KRB5CONF TOP_SRCDIR="${srcdir}/src" dnl diff --git a/configure.in b/configure.in index 3103299..797df6d 100644 --- a/configure.in +++ b/configure.in @@ -11,6 +11,7 @@ src/afs/Makefile \ src/afsd/Makefile \ src/afsmonitor/Makefile \ src/afsweb/Makefile \ +src/aklog/Makefile \ src/audit/Makefile \ src/auth/test/Makefile \ src/auth/Makefile \ diff --git a/src/aklog/aklog.c b/src/aklog/aklog.c index a8f81cd..0847a67 100644 --- a/src/aklog/aklog.c +++ b/src/aklog/aklog.c @@ -9,6 +9,7 @@ static char *rcsid = "$Id$"; #endif /* lint || SABER */ +#include #include "aklog.h" #ifndef WINDOWS diff --git a/src/aklog/aklog.h b/src/aklog/aklog.h index 0f7c9fe..9d84d2f 100644 --- a/src/aklog/aklog.h +++ b/src/aklog/aklog.h @@ -15,6 +15,7 @@ static char *rcsid_aklog_h = "$Id$"; #include #include #include "linked_list.h" +#include #ifdef __STDC__ #define ARGS(x) x diff --git a/src/aklog/aklog_main.c b/src/aklog/aklog_main.c index 9189999..8bab3b1 100644 --- a/src/aklog/aklog_main.c +++ b/src/aklog/aklog_main.c @@ -1608,3 +1608,15 @@ void aklog(argc, argv, a_params) params.exitprog(status); } + +#ifndef HAVE_ADD_TO_ERROR_TABLE +#include + +void add_error_table (const struct error_table *); + +void +add_to_error_table(struct et_list *new_table) +{ + add_error_table(new_table->table); +} +#endif /* HAVE_ADD_TO_ERROR_TABLE */ diff --git a/src/aklog/aklog_param.c b/src/aklog/aklog_param.c index aa010dc..9b88044 100644 --- a/src/aklog/aklog_param.c +++ b/src/aklog/aklog_param.c @@ -9,6 +9,7 @@ static char *rcsid = "$Id$"; #endif /* lint || SABER */ +#include #include "aklog.h" #include #include @@ -107,7 +108,7 @@ static int get_cred(context, name, inst, realm, c, creds) increds.client = client_principal; increds.times.endtime = 0; /* Ask for DES since that is what V4 understands */ - /* increds.keyblock.enctype = ENCTYPE_DES_CBC_CRC; */ + increds.keyblock.enctype = ENCTYPE_DES_CBC_CRC; r = krb5_get_credentials(context, 0, _krb425_ccache, &increds, creds); if (r) diff --git a/src/aklog/krb_util.c b/src/aklog/krb_util.c index 5e63fec..d202715 100644 --- a/src/aklog/krb_util.c +++ b/src/aklog/krb_util.c @@ -17,6 +17,7 @@ static char rcsid_send_to_kdc_c[] = #if 0 #include #endif +#include #include #include diff --git a/src/cf/kerberos.m4 b/src/cf/kerberos.m4 new file mode 100644 index 0000000..88dd2cf --- /dev/null +++ b/src/cf/kerberos.m4 @@ -0,0 +1,67 @@ +dnl +dnl $Id$ +dnl +dnl Kerberos autoconf glue +dnl + +AC_DEFUN([OPENAFS_KRB5CONF],[ + +AC_ARG_VAR(KRB5CFLAGS, [C flags to compile Kerberos 5 programs]) +AC_ARG_VAR(KRB5LIBS, [Libraries and flags to compile Kerberos 5 programs]) +AC_ARG_VAR(KRB5_CONFIG, [Location of krb5-config script]) + +AC_ARG_WITH([krb5-conf], + AC_HELP_STRING([--with-krb5-config[=krb5-config-location]], + [Use a krb5-config script to configure Kerberos]), + [if test X$withval != Xno; then + conf_krb5=YES + if test X$withval = Xyes; then + AC_PATH_PROG(KRB5_CONFIG, krb5-config, not_found) + if test X$KRB5_CONFIG = Xnot_found; then + AC_MSG_ERROR([cannot find krb5-config script, you must configure Kerberos manually]) + fi + else + KRB5_CONFIG=$withval + fi + KRB5CFLAGS=`$KRB5_CONFIG --cflags krb5` + retval=$? + if test $retval -ne 0; then + AC_MSG_ERROR([$KRB5_CONFIG failed with an error code of $retval]) + fi + KRB5LIBS=`$KRB5_CONFIG --libs krb5` + retval=$? + if test $retval -ne 0; then + AC_MSG_ERROR([$KRB5_CONFIG failed with an error code of $retval]) + fi + AC_MSG_RESULT([Adding $KRB5CFLAGS to KRB5CFLAGS]) + AC_MSG_RESULT([Adding $KRB5LIBS to KRB5LIBS]) + fi]) + +AC_ARG_WITH([krb5], + AC_HELP_STRING([--with-krb5], + [Support for Kerberos 5 (manual configuration)]), + [if test X$conf_krb5 = XYES; then + AC_MSG_ERROR([--with-krb5-config and --with-krb5 are mutually exclusive, choose only one]) + fi + if test "X$KRB5CFLAGS" = X; then + AC_MSG_WARN([KRB5CFLAGS is not set]) + fi + if test "X$KRB5LIBS" = X; then + AC_MSG_WARN([KRB5LIBS is not set]) + fi + conf_krb5=YES]) + +BUILD_KRB5=no +if test X$conf_krb5 = XYES; then + AC_MSG_RESULT([Configuring support for Kerberos 5 utilities]) + BUILD_KRB5=yes + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS KRB5CFLAGS" + save_LIBS="$LIBS" + LIBS="$LIBS $KRB5LIBS" + AC_CHECK_FUNCS([add_to_error_table]) + CFLAGS="$save_CFLAGS" + LIBS="$save_LIBS" +fi +AC_SUBST(BUILD_KRB5) +])dnl -- 1.9.4