dnl Process this file with autoconf to produce a configure script.
-AC_INIT(collectd, 3.6.alpha0)
+AC_INIT(collectd, 3.6.alpha1)
AC_CONFIG_SRCDIR(src/collectd.c)
AC_CONFIG_HEADERS(src/config.h)
AM_INIT_AUTOMAKE(dist-bzip2)
for (i = 0; i < (fields_num - last_is_file); i++)
{
/*
- * Join the components together again
- */
- if (strjoin (dir, dir_len, fields, i + 1, "/") < 0)
- return (-1);
-
- /*
* Do not create directories that start with a dot. This
* prevents `../../' attacks and other likely malicious
* behavior.
*/
if (fields[i][0] == '.')
{
- syslog (LOG_ERR, "Cowardly refusing to create a directory that begins with a `.' (dot): `%s'", dir);
+ syslog (LOG_ERR, "Cowardly refusing to create a directory that begins with a `.' (dot): `%s'", file_orig);
return (-2);
}
+ /*
+ * Join the components together again
+ */
+ if (strjoin (dir, dir_len, fields, i + 1, "/") < 0)
+ {
+ syslog (LOG_ERR, "strjoin failed: `%s', component #%i", file_orig, i);
+ return (-1);
+ }
+
if (stat (dir, &statbuf) == -1)
{
if (errno == ENOENT)
int i, j;
int status = 0;
+ if (check_create_dir (filename))
+ return (-1);
+
argc = ds_num + rra_num + 4;
if ((argv = (char **) malloc (sizeof (char *) * (argc + 1))) == NULL)
/* host == NULL => local mode */
if (host != NULL)
{
- if (check_create_dir (host))
- return (-1);
-
if (snprintf (full_file, 1024, "%s/%s", host, file) >= 1024)
return (-1);
}
* DESCRIPTION
* `cf_register' is called by plugins that wish to receive config keys. The
* plugin will then receive all keys it registered for if they're found in a
- * `<Module $type>' section.
+ * `<Plugin $type>' section.
*
* PARAMETERS
* `type' Name of the plugin (must be the same as passed to
#ifdef HAVE_LIBRRD
if ((operating_mode == MODE_LOCAL) || (operating_mode == MODE_CLIENT))
#endif
- if (read == NULL)
+ if ((init != NULL) && (read == NULL))
syslog (LOG_NOTICE, "Plugin `%s' doesn't provide a read function.", type);
if ((p = (plugin_t *) malloc (sizeof (plugin_t))) == NULL)