[crossfire] plugin versioning

Mark Wedel mwedel at sonic.net
Wed Nov 23 01:13:16 CST 2011


  It seems to be not that unusual that out of date plugins in the installed area 
result in system crashes.

  Now I've made a fairly simple change (not yet commited) that checks what the 
svn version was of the compiled plugin against that of the server, and if they 
don't match, it doesn't load the plugin.

  The nice bit here is that for old plugins, they will lack this symbol, and 
also will not get loaded.  As that is another potential problem - a plugin that 
used to exist (and thus was installed), but has been renamed, is no longer 
active, etc.

  The one thing I'm not sure of is if any plugins exist from outside the source 
tree, in which case them having the right svn version would be an issue.

  I've also thought about adding in some other checks - sizeof(object) as when 
the plugin was compiled vs the server, and perhaps sizeof of player, map, etc. 
But these would seem to be much more developer scenarios - dev has made changes, 
but not done a commit, so svn number is unchanged.  In those cases, the dev 
should hopefully be aware of what they have done.  And the problem is that 
simple size checks may not be all that foolproof - if for example, I remove one 
field from the middle of the object structure, but add a new one to the end, the 
sizeof(object) may be the same, but the fact that the positioning of a bunch of 
interim fields has changed will result bad behavior.

  I'll commit this change in the next day or two, unless I hear of some reason 
not to - the plus side is that it is a pretty trivial change, and 
removing/disabling the logic from the plugin loader would be pretty easy if 
there are issues.



More information about the crossfire mailing list