From 593aee561015251dfd042dc5e00388f63232c45f Mon Sep 17 00:00:00 2001
From: Cyrille Bagard <nocbos@gmail.com>
Date: Sat, 30 Sep 2017 13:57:04 +0200
Subject: Checked the ABI version before loading plugins.

---
 ChangeLog                | 8 ++++++++
 src/plugins/plugin-def.h | 2 --
 src/plugins/plugin.c     | 6 ++----
 3 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 201ab6f..4cbd7f8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 17-08-30  Cyrille Bagard <nocbos@gmail.com>
 
+	* src/plugins/plugin-def.h:
+	Typo.
+
+	* src/plugins/plugin.c:
+	Check the ABI version before loading plugins.
+
+17-08-30  Cyrille Bagard <nocbos@gmail.com>
+
 	* plugins/pychrysa/plugin.c:
 	* plugins/pychrysa/pychrysa.c:
 	Update code.
diff --git a/src/plugins/plugin-def.h b/src/plugins/plugin-def.h
index 83b2c9a..e5d06c3 100644
--- a/src/plugins/plugin-def.h
+++ b/src/plugins/plugin-def.h
@@ -31,8 +31,6 @@
 
 
 
-
-
 /* ------------------------ IDENTIFICATION DE COMPATIBILITES ------------------------ */
 
 
diff --git a/src/plugins/plugin.c b/src/plugins/plugin.c
index cd59ee1..f12c1f6 100644
--- a/src/plugins/plugin.c
+++ b/src/plugins/plugin.c
@@ -209,15 +209,13 @@ GPluginModule *g_plugin_module_new(const gchar *filename)
 
     current = CURRENT_ABI_VERSION;
 
-    if (0 /* check_version() */)
+    if (current != result->interface->abi_version)
     {
-
         log_variadic_message(LMT_ERROR, 
-                             _("Bad version... '%s'"),
+                             _("ABI mismatch detected! Plugin '%s' rejected"),
                              filename);
         goto bad_plugin;
 
-
     }
 
     /* Localisation des différents points d'entrée déclarés */
-- 
cgit v0.11.2-87-g4458