more-aklog-fixes-20050618
authorKen Hornstein <kenh@cmf.nrl.navy.mil>
Sun, 19 Jun 2005 02:06:21 +0000 (02:06 +0000)
committerKen Hornstein <kenh@cmf.nrl.navy.mil>
Sun, 19 Jun 2005 02:06:21 +0000 (02:06 +0000)
Fixup aklog so it will compile (at least on MacOS X).  Include basic
autoconf glue.

Makefile.in
acinclude.m4
configure.in
src/aklog/aklog.c
src/aklog/aklog.h
src/aklog/aklog_main.c
src/aklog/aklog_param.c
src/aklog/krb_util.c
src/cf/kerberos.m4 [new file with mode: 0644]

index 7c45912..1e4cd1f 100644 (file)
@@ -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 \
index 17e931c..aed3112 100644 (file)
@@ -1094,6 +1094,7 @@ AC_SUBST(DARWIN_INFOFILE)
 AC_SUBST(IRIX_BUILD_IP35)
 
 OPENAFS_OSCONF
+OPENAFS_KRB5CONF
 
 TOP_SRCDIR="${srcdir}/src"
 dnl
index 3103299..797df6d 100644 (file)
@@ -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 \
index a8f81cd..0847a67 100644 (file)
@@ -9,6 +9,7 @@
 static char *rcsid = "$Id$";
 #endif /* lint || SABER */
 
+#include <afs/stds.h>
 #include "aklog.h"
 
 #ifndef WINDOWS
index 0f7c9fe..9d84d2f 100644 (file)
@@ -15,6 +15,7 @@ static char *rcsid_aklog_h = "$Id$";
 #include <krb5.h>
 #include <kerberosIV/krb.h>
 #include "linked_list.h"
+#include <afsconfig.h>
 
 #ifdef __STDC__
 #define ARGS(x) x
index 9189999..8bab3b1 100644 (file)
@@ -1608,3 +1608,15 @@ void aklog(argc, argv, a_params)
 
     params.exitprog(status);
 }
+
+#ifndef HAVE_ADD_TO_ERROR_TABLE
+#include <afs/error_table.h>
+
+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 */
index aa010dc..9b88044 100644 (file)
@@ -9,6 +9,7 @@
 static char *rcsid = "$Id$";
 #endif /* lint || SABER */
 
+#include <afs/stds.h>
 #include "aklog.h"
 #include <stdio.h>
 #include <sys/types.h>
@@ -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)
index 5e63fec..d202715 100644 (file)
@@ -17,6 +17,7 @@ static char rcsid_send_to_kdc_c[] =
 #if 0
 #include <kerberosIV/mit-copyright.h>
 #endif
+#include <afs/stds.h>
 #include <krb5.h>
 #include <kerberosIV/krb.h> 
 
diff --git a/src/cf/kerberos.m4 b/src/cf/kerberos.m4
new file mode 100644 (file)
index 0000000..88dd2cf
--- /dev/null
@@ -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