+ pl->user = strdup (ci->values[0].value.string);
+ if (pl->user == NULL)
+ {
+ ERROR ("exec plugin: strdup failed.");
+ sfree (pl);
+ return (-1);
+ }
+
+ pl->group = strchr (pl->user, ':');
+ if (pl->group != NULL)
+ {
+ *pl->group = '\0';
+ pl->group++;
+ }
+
+ pl->exec = strdup (ci->values[1].value.string);
+ if (pl->exec == NULL)
+ {
+ ERROR ("exec plugin: strdup failed.");
+ sfree (pl->user);
+ sfree (pl);
+ return (-1);
+ }
+
+ pl->argv = (char **) malloc (ci->values_num * sizeof (char *));
+ if (pl->argv == NULL)
+ {
+ ERROR ("exec plugin: malloc failed.");
+ sfree (pl->exec);
+ sfree (pl->user);
+ sfree (pl);
+ return (-1);
+ }
+ memset (pl->argv, '\0', ci->values_num * sizeof (char *));
+
+ {
+ char *tmp = strrchr (ci->values[1].value.string, '/');
+ if (tmp == NULL)
+ strncpy (buffer, ci->values[1].value.string, sizeof (buffer));
+ else
+ strncpy (buffer, tmp + 1, sizeof (buffer));
+ buffer[sizeof (buffer) - 1] = '\0';
+ }
+ pl->argv[0] = strdup (buffer);
+ if (pl->argv[0] == NULL)
+ {
+ ERROR ("exec plugin: malloc failed.");
+ sfree (pl->argv);
+ sfree (pl->exec);
+ sfree (pl->user);
+ sfree (pl);
+ return (-1);
+ }
+
+ for (i = 1; i < (ci->values_num - 1); i++)
+ {
+ if (ci->values[i + 1].type == OCONFIG_TYPE_STRING)