The problem is that the plugin loader locates an external variable in the DSO
and then assumes that the structure at that address is a PluginClass. This is
not versioned, and could very easily cause a segfault or other misbehavior if
there is a plugin in /usr/lib/lxpanel/plugins that isn't compiled against the
headers that lxpanel is compiled against.
The idea of versioning is that, at a known point at the beginning of the
structure, you introduce enough data to verify and parse the part after that,
which may contain extensions or optionally present things. What I'm suggesting
is:
At the beginning of PluginClass, introduce two variables that contain
sizeof(PluginClass) and a version number. Then the plugin loader will check
these in addition to what it already checks. I'd suggest a macro that does the
needed initializations. Say:
At the beginning of PluginClass:
guint16 sizeof_structure;
guint16 pluginclass_version;
Plugin helper macros:
#define PLUGINCLASS_VERSION 1
#define PLUGINCLASS_VERSIONING \
sizeof_structure : sizeof(PluginClass),
pluginclass_version : PLUGINCLASS_VERSION
The downside is that every plugin has to be edited. That is why I asked the
question about the duplicated SVN directories.
------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Lxde-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/lxde-list