From a12e79c7ce4a1c430a33d93d6fdad34011744601 Mon Sep 17 00:00:00 2001 From: Blair Bonnett Date: Tue, 14 Aug 2012 11:48:08 +1200 Subject: [PATCH] Check plugin API version in UCMD plugin. --- src/plugins/mod_ucmd.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/plugins/mod_ucmd.c b/src/plugins/mod_ucmd.c index ca616cb..075372e 100644 --- a/src/plugins/mod_ucmd.c +++ b/src/plugins/mod_ucmd.c @@ -483,6 +483,13 @@ int parse_config(struct plugin_handle* plugin, const char* config) int plugin_register(struct plugin_handle *plugin, const char *config){ PLUGIN_INITIALIZE(plugin, "User command plugin", "0.1", "Provide custom commands to users."); + /* Need version 2 or later of the plugin API. */ + if(plugin->plugin_api_version < 2) + { + plugin->error_msg = "UCMD support requires version 2 or later of the plugin API"; + return -1; + } + /* Attempt to parse the config we were given. */ if(parse_config(plugin, config) == -1) return -1;