Upgrade plugin versions.
authorJelmer Vernooij <jelmer@samba.org>
Tue, 4 Sep 2007 16:10:17 +0000 (18:10 +0200)
committerJelmer Vernooij <jelmer@samba.org>
Tue, 4 Sep 2007 16:10:17 +0000 (18:10 +0200)
NEWS
mods/log_irssi.c
src/ctrlproxy.h
src/plugins.c

diff --git a/NEWS b/NEWS
index 96b846b7ae3ff5a3295382e908e5bb8d7ce456af..6d41cce2c7722162fbab3d64f171877da6f52b82 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -22,6 +22,8 @@ Ctrlproxy 3.0.4 UNRELEASED
 
        * Recognize NS as command for NickServ (#145)
 
+       * Start checking plugin versions.
+
 
 Ctrlproxy 3.0.3 2007-07-22
 
index 16764f6cc2ae2ff38d4d1baaff4c86cf5b89d990..0a59448f229705b586a7774bb21b68fe6f415afd 100644 (file)
 #include <sys/stat.h>
 #include <sys/types.h>
 
-
-
-#undef G_LOG_DOMAIN
-#define G_LOG_DOMAIN "log_irssi"
-
 static char *logfile = NULL;
 static GHashTable *files = NULL;
 
index 60e7dee90f7cafb3133382818d4e6d7e789b1483..45b5da3fc69ed3fbe1036e94df830b20769a4244 100644 (file)
@@ -27,6 +27,8 @@
 #include <glib.h>
 #include <gmodule.h>
 
+#define CTRLPROXY_PLUGIN_VERSION 1
+
 /**
  * @file
  * @brief Main functions
index e4e26d256f3eb0d64a97de714ed2a6621e5dbc04..33e4ff9fcc890d501a96b3e794e0eb4a8acd03a4 100644 (file)
@@ -76,6 +76,14 @@ struct plugin *load_plugin(const char *modulesdir, const char *name)
                return NULL;
        }
 
+       if (ops->version != CTRLPROXY_PLUGIN_VERSION) {
+               log_global(LOG_WARNING, "%s: Plugin has incompatible version %d, expected %d", 
+                                  ops->name, ops->version, CTRLPROXY_PLUGIN_VERSION);
+               g_free(path_name);
+               g_free(p);
+               return NULL;
+       }
+
        g_free(path_name);
 
        p->module = m;