#include "plugin_manager.h"
#include "plugin.h"
#include "debug.h"
+#include "version.h"
+#include "utils.h"
static char *exec_path;
goto out;
}
+ if (!info->version) {
+ pr_err("Plugin %s version info missing\n", path);
+ ret = -1;
+ goto out;
+ }
+
+ if (strcmp(RRDD_VERSION, info->version)) {
+ pr_err("Plugin %s version mismatch, expected %s, got %s\n",
+ path, RRDD_VERSION, info->version);
+ ret = -1;
+ goto out;
+ }
+
if (!info->init) {
pr_err("Plugin info structure has NULL .init callback\n");
goto out;
int ret;
strncpy(str, name, sizeof(str));
- strncat(str, parser, sizeof(str) - 1);
+ str[sizeof(str) - 1] = '\0';
+ _strlcat(str, parser, sizeof(str));
ret = load_plugin(str);
if (!ret)
return 0;
strncpy(str, "./", sizeof(str));
- strncat(str, name, sizeof(str) - 1);
- strncat(str, parser, sizeof(str) - 1);
+ str[sizeof(str) - 1] = '\0';
+ _strlcat(str, name, sizeof(str));
+ _strlcat(str, parser, sizeof(str));
ret = load_plugin(str);
if (!ret)
return 0;
return 0;
strncpy(str, exec_path, sizeof(str));
- strncat(str, "/", sizeof(str) - 1);
- strncat(str, name, sizeof(str) - 1);
- strncat(str, parser, sizeof(str) - 1);
+ str[sizeof(str) - 1] = '\0';
+ _strlcat(str, "/", sizeof(str));
+ _strlcat(str, name, sizeof(str));
+ _strlcat(str, parser, sizeof(str));
return load_plugin(str);
}