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
};
/* A list of plugin interface IDs. Make sure to increment
- * PLUGIN_NUM_INTERFACES when a new interface is added. */
+ * PLUGIN_NUM_INTERFACES when a new interface is added, and add an entry to the
+ * interface_names table in lib/krb5/krb/plugin.c. */
#define PLUGIN_INTERFACE_PWQUAL 0
#define PLUGIN_INTERFACE_KADM5_HOOK 1
#define PLUGIN_INTERFACE_CLPREAUTH 2
#include "k5-int.h"
-const char *interface_names[PLUGIN_NUM_INTERFACES] = {
+const char *interface_names[] = {
"pwqual",
"kadm5_hook",
"clpreauth",
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;