summaryrefslogtreecommitdiff
path: root/portable
diff options
context:
space:
mode:
authorRuss Allbery <rra@stanford.edu>2010-08-25 15:08:05 -0700
committerRuss Allbery <rra@stanford.edu>2010-08-25 15:08:05 -0700
commit468ded4c2fae05a815bef91bdcb17d52f9cdcb2b (patch)
treeb2b836734664367c03691a8594684187a1be4054 /portable
parent32dc393016f0b6241dbf8d405638e18a33bb9b62 (diff)
Update to rra-c-util 2.6 and C TAP Harness 1.5
Update to C TAP Harness 1.5: * Better reporting of fatal errors in the test suite. * Summarize results at the end of test execution. * Add tests/HOWTO from docs/writing-tests in C TAP Harness. Update to rra-c-util 2.6: * Fix portability to bundled Heimdal on OpenBSD. * Improve checking for krb5_kt_free_entry with older MIT Kerberos. * Fix portability for missing krb5_get_init_creds_opt_free. * Fix header guard for util/xwrite.h. * Restore default compiler configuration after GSS-API library probe.
Diffstat (limited to 'portable')
-rw-r--r--portable/krb5-extra.c3
-rw-r--r--portable/krb5.h31
2 files changed, 27 insertions, 7 deletions
diff --git a/portable/krb5-extra.c b/portable/krb5-extra.c
index dcddbe4..89ccbde 100644
--- a/portable/krb5-extra.c
+++ b/portable/krb5-extra.c
@@ -97,7 +97,8 @@ krb5_free_error_message(krb5_context ctx UNUSED, const char *msg)
* assumes that an all-zero bit pattern will create a NULL pointer.
*/
krb5_error_code
-krb5_get_init_creds_opt_alloc(krb5_context ctx, krb5_get_init_creds_opt **opts)
+krb5_get_init_creds_opt_alloc(krb5_context ctx UNUSED,
+ krb5_get_init_creds_opt **opts)
{
*opts = calloc(1, sizeof(krb5_get_init_creds_opt));
if (*opts == NULL)
diff --git a/portable/krb5.h b/portable/krb5.h
index d9ef283..3b5700b 100644
--- a/portable/krb5.h
+++ b/portable/krb5.h
@@ -23,10 +23,17 @@
#ifndef PORTABLE_KRB5_H
#define PORTABLE_KRB5_H 1
-#include <config.h>
+/*
+ * Allow inclusion of config.h to be skipped, since sometimes we have to use a
+ * stripped-down version of config.h with a different name.
+ */
+#ifndef CONFIG_H_INCLUDED
+# include <config.h>
+#endif
#include <portable/macros.h>
#include <krb5.h>
+#include <stdlib.h>
BEGIN_DECLS
@@ -50,27 +57,39 @@ void krb5_free_error_message(krb5_context, const char *);
#endif
/*
- * Both current MIT and current Heimdal prefer _opt_alloc, but older versions
- * of both require allocating your own struct and calling _opt_init.
+ * Both current MIT and current Heimdal prefer _opt_alloc and _opt_free, but
+ * older versions of both require allocating your own struct and calling
+ * _opt_init.
*/
#ifndef HAVE_KRB5_GET_INIT_CREDS_OPT_ALLOC
krb5_error_code krb5_get_init_creds_opt_alloc(krb5_context,
krb5_get_init_creds_opt **);
#endif
+#ifdef HAVE_KRB5_GET_INIT_CREDS_OPT_FREE
+# ifndef HAVE_KRB5_GET_INIT_CREDS_OPT_FREE_2_ARGS
+# define krb5_get_init_creds_opt_free(c, o) krb5_get_init_creds_opt_free(o)
+# endif
+#else
+# define krb5_get_init_creds_opt_free(c, o) free(o)
+#endif
/* Heimdal-specific. */
#ifndef HAVE_KRB5_GET_INIT_CREDS_OPT_SET_DEFAULT_FLAGS
#define krb5_get_init_creds_opt_set_default_flags(c, p, r, o) /* empty */
#endif
-/* Heimdal: krb5_kt_free_entry, MIT: krb5_free_keytab_entry_contents. */
-#ifndef HAVE_KRB5_KT_FREE_ENTRY
+/*
+ * Heimdal: krb5_kt_free_entry, MIT: krb5_free_keytab_entry_contents. We
+ * check for the declaration rather than the function since the function is
+ * present in older MIT Kerberos libraries but not prototyped.
+ */
+#if !HAVE_DECL_KRB5_KT_FREE_ENTRY
# define krb5_kt_free_entry(c, e) krb5_free_keytab_entry_contents((c), (e))
#endif
/*
* Heimdal provides a nice function that just returns a const char *. On MIT,
- * there's an accessor macro that returns the krb5_data pointer, wihch
+ * there's an accessor macro that returns the krb5_data pointer, which
* requires more work to get at the underlying char *.
*/
#ifndef HAVE_KRB5_PRINCIPAL_GET_REALM