summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/include/k5-int.h3
-rw-r--r--src/lib/krb5/krb/plugin.c6
2 files changed, 7 insertions, 2 deletions
diff --git a/src/include/k5-int.h b/src/include/k5-int.h
index b82fe5b6f..21519b096 100644
--- a/src/include/k5-int.h
+++ b/src/include/k5-int.h
@@ -1382,7 +1382,8 @@ struct plugin_interface {
};
/* 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
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;