From 9b21c05fec7cc9e06c7c8d00dd750ee8a32cfe44 Mon Sep 17 00:00:00 2001 From: Greg Hudson Date: Sun, 13 Nov 2011 00:38:23 +0000 Subject: Add consistency check for plugin interface names Add an assertion to ensure that the interface_names table in plugin.c is updated when a new pluggable interface is added. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25471 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/krb/plugin.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/lib') diff --git a/src/lib/krb5/krb/plugin.c b/src/lib/krb5/krb/plugin.c index 575b8efa7..9b2328ba2 100644 --- a/src/lib/krb5/krb/plugin.c +++ b/src/lib/krb5/krb/plugin.c @@ -26,7 +26,7 @@ #include "k5-int.h" -const char *interface_names[PLUGIN_NUM_INTERFACES] = { +const char *interface_names[] = { "pwqual", "kadm5_hook", "clpreauth", @@ -250,6 +250,10 @@ configure_interface(krb5_context context, int id) if (interface->configured) return 0; + /* Detect consistency errors when plugin interfaces are added. */ + assert(sizeof(interface_names) / sizeof(*interface_names) == + PLUGIN_NUM_INTERFACES); + /* Read the configuration variables for this interface. */ path[0] = KRB5_CONF_PLUGINS; path[1] = iname; -- cgit