vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- strcpy (vl.host, hostname_g);
- strcpy (vl.plugin, "apache");
- strcpy (vl.plugin_instance, "");
+ sstrncpy (vl.host, hostname_g, sizeof (vl.host));
+ sstrncpy (vl.plugin, "apache", sizeof (vl.plugin));
+ sstrncpy (vl.plugin_instance, "", sizeof (vl.plugin_instance));
if (type_instance != NULL)
{
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- strcpy (vl.host, hostname_g);
- strcpy (vl.plugin, "apache");
- strcpy (vl.plugin_instance, "");
+ sstrncpy (vl.host, hostname_g, sizeof (vl.host));
+ sstrncpy (vl.plugin, "apache", sizeof (vl.plugin));
+ sstrncpy (vl.plugin_instance, "", sizeof (vl.plugin_instance));
if (type_instance != NULL)
{
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- strcpy (vl.host, hostname_g);
- strcpy (vl.plugin, "apcups");
- strcpy (vl.plugin_instance, "");
+ sstrncpy (vl.host, hostname_g, sizeof (vl.host));
+ sstrncpy (vl.plugin, "apcups", sizeof (vl.plugin));
+ sstrncpy (vl.plugin_instance, "", sizeof (vl.plugin_instance));
strncpy (vl.type_instance, type_inst, sizeof (vl.type_instance));
plugin_dispatch_values (type, &vl);
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- strcpy (vl.host, hostname_g);
- strcpy (vl.plugin, "apple_sensors");
- strcpy (vl.plugin_instance, "");
- strcpy (vl.type_instance, type_instance);
+ sstrncpy (vl.host, hostname_g, sizeof (vl.host));
+ sstrncpy (vl.plugin, "apple_sensors", sizeof (vl.plugin));
+ sstrncpy (vl.plugin_instance, "", sizeof (vl.plugin_instance));
+ sstrncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
plugin_dispatch_values (type, &vl);
}
if (strcmp (type, "temperature") == 0)
{
value_double = ((double) value_int) / 65536.0;
- strcpy (type, "temperature");
+ sstrncpy (type, "temperature", sizeof (type));
}
else if (strcmp (type, "temp") == 0)
{
value_double = ((double) value_int) / 10.0;
- strcpy (type, "temperature");
+ sstrncpy (type, "temperature", sizeof (type));
}
else if (strcmp (type, "fanspeed") == 0)
{
value_double = ((double) value_int) / 65536.0;
- strcpy (type, "fanspeed");
+ sstrncpy (type, "fanspeed", sizeof (type));
}
else if (strcmp (type, "voltage") == 0)
{
else if (strcmp (type, "adc") == 0)
{
value_double = ((double) value_int) / 10.0;
- strcpy (type, "fanspeed");
+ sstrncpy (type, "fanspeed", sizeof (type));
}
else
{
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- strcpy (vl.host, hostname_g);
- strcpy (vl.plugin, "battery");
- strcpy (vl.plugin_instance, plugin_instance);
+ sstrncpy (vl.host, hostname_g, sizeof (vl.host));
+ sstrncpy (vl.plugin, "battery", sizeof (vl.plugin));
+ sstrncpy (vl.plugin_instance, plugin_instance, sizeof (vl.plugin_instance));
plugin_dispatch_values (type, &vl);
} /* void battery_submit */
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- strcpy (vl.host, hostname_g);
- strcpy (vl.plugin, "cpu");
+ sstrncpy (vl.host, hostname_g, sizeof (vl.host));
+ sstrncpy (vl.plugin, "cpu", sizeof (vl.plugin));
snprintf (vl.plugin_instance, sizeof (vl.type_instance),
"%i", cpu_num);
vl.plugin_instance[DATA_MAX_NAME_LEN - 1] = '\0';
- strcpy (vl.type_instance, type_instance);
+ sstrncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
plugin_dispatch_values ("cpu", &vl);
}
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- strcpy (vl.host, hostname_g);
- strcpy (vl.plugin, "cpufreq");
+ sstrncpy (vl.host, hostname_g, sizeof (vl.host));
+ sstrncpy (vl.plugin, "cpufreq", sizeof (vl.plugin));
snprintf (vl.type_instance, sizeof (vl.type_instance),
"%i", cpu_num);
vl.values = values;
vl.values_len = 2;
vl.time = time (NULL);
- strcpy (vl.host, hostname_g);
- strcpy (vl.plugin, "df");
- strcpy (vl.plugin_instance, "");
+ sstrncpy (vl.host, hostname_g, sizeof (vl.host));
+ sstrncpy (vl.plugin, "df", sizeof (vl.plugin));
+ sstrncpy (vl.plugin_instance, "", sizeof (vl.plugin_instance));
strncpy (vl.type_instance, df_name, sizeof (vl.type_instance));
plugin_dispatch_values ("df", &vl);
vl.values = values;
vl.values_len = 2;
vl.time = time (NULL);
- strcpy (vl.host, hostname_g);
- strcpy (vl.plugin, "disk");
+ sstrncpy (vl.host, hostname_g, sizeof (vl.host));
+ sstrncpy (vl.plugin, "disk", sizeof (vl.plugin));
strncpy (vl.plugin_instance, plugin_instance,
sizeof (vl.plugin_instance));
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- strcpy (vl.host, hostname_g);
- strcpy (vl.plugin, "dns");
+ sstrncpy (vl.host, hostname_g, sizeof (vl.host));
+ sstrncpy (vl.plugin, "dns", sizeof (vl.plugin));
strncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
plugin_dispatch_values (type, &vl);
vl.values = values;
vl.values_len = 2;
vl.time = time (NULL);
- strcpy (vl.host, hostname_g);
- strcpy (vl.plugin, "dns");
+ sstrncpy (vl.host, hostname_g, sizeof (vl.host));
+ sstrncpy (vl.plugin, "dns", sizeof (vl.plugin));
plugin_dispatch_values ("dns_octets", &vl);
} /* void submit_counter */
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- strcpy (vl.host, hostname_g);
- strcpy (vl.plugin, "email");
+ sstrncpy (vl.host, hostname_g, sizeof (vl.host));
+ sstrncpy (vl.plugin, "email", sizeof (vl.plugin));
strncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
plugin_dispatch_values (type, &vl);
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- strcpy (vl.host, hostname_g);
- strcpy (vl.plugin, "entropy");
- strcpy (vl.plugin_instance, "");
- strcpy (vl.type_instance, "");
+ sstrncpy (vl.host, hostname_g, sizeof (vl.host));
+ sstrncpy (vl.plugin, "entropy", sizeof (vl.plugin));
+ sstrncpy (vl.plugin_instance, "", sizeof (vl.plugin_instance));
+ sstrncpy (vl.type_instance, "", sizeof (vl.type_instance));
plugin_dispatch_values ("entropy", &vl);
}
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- strcpy (vl.host, hostname_g);
- strcpy (vl.plugin, "hddtemp");
+ sstrncpy (vl.host, hostname_g, sizeof (vl.host));
+ sstrncpy (vl.plugin, "hddtemp", sizeof (vl.plugin));
strncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
plugin_dispatch_values ("temperature", &vl);
vl.values = values;
vl.values_len = 2;
vl.time = time (NULL);
- strcpy (vl.host, hostname_g);
- strcpy (vl.plugin, "interface");
+ sstrncpy (vl.host, hostname_g, sizeof (vl.host));
+ sstrncpy (vl.plugin, "interface", sizeof (vl.plugin));
strncpy (vl.type_instance, dev, sizeof (vl.type_instance));
plugin_dispatch_values (type, &vl);
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- strcpy (vl.host, hostname_g);
- strcpy (vl.plugin, "iptables");
+ sstrncpy (vl.host, hostname_g, sizeof (vl.host));
+ sstrncpy (vl.plugin, "iptables", sizeof (vl.plugin));
status = snprintf (vl.plugin_instance, sizeof (vl.plugin_instance),
"%s-%s", chain->table, chain->chain);
vl.time = time (NULL);
vl.interval = interval_g;
- strcpy (vl.host, hostname_g);
- strcpy (vl.plugin, "ipvs");
- strcpy (vl.plugin_instance, pi);
- strcpy (vl.type_instance, (NULL != ti) ? ti : "total");
+ sstrncpy (vl.host, hostname_g, sizeof (vl.host));
+ sstrncpy (vl.plugin, "ipvs", sizeof (vl.plugin));
+ sstrncpy (vl.plugin_instance, pi, sizeof (vl.plugin_instance));
+ sstrncpy (vl.type_instance, (NULL != ti) ? ti : "total", sizeof (vl.type_instance));
plugin_dispatch_values ("connections", &vl);
return;
vl.time = time (NULL);
vl.interval = interval_g;
- strcpy (vl.host, hostname_g);
- strcpy (vl.plugin, "ipvs");
- strcpy (vl.plugin_instance, pi);
- strcpy (vl.type_instance, (NULL != ti) ? ti : "total");
+ sstrncpy (vl.host, hostname_g, sizeof (vl.host));
+ sstrncpy (vl.plugin, "ipvs", sizeof (vl.plugin));
+ sstrncpy (vl.plugin_instance, pi, sizeof (vl.plugin_instance));
+ sstrncpy (vl.type_instance, (NULL != ti) ? ti : "total", sizeof (vl.type_instance));
plugin_dispatch_values (t, &vl);
return;
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- strcpy (vl.host, hostname_g);
- strcpy (vl.plugin, "irq");
+ sstrncpy (vl.host, hostname_g, sizeof (vl.host));
+ sstrncpy (vl.plugin, "irq", sizeof (vl.plugin));
status = snprintf (vl.type_instance, sizeof (vl.type_instance),
"%u", irq);
vl.values = values;
vl.values_len = STATIC_ARRAY_SIZE (values);
vl.time = time (NULL);
- strcpy (vl.host, hostname_g);
- strcpy (vl.plugin, "load");
+ sstrncpy (vl.host, hostname_g, sizeof (vl.host));
+ sstrncpy (vl.plugin, "load", sizeof (vl.plugin));
plugin_dispatch_values ("load", &vl);
}
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- strcpy (vl.host, hostname_g);
- strcpy (vl.plugin, "mbmon");
+ sstrncpy (vl.host, hostname_g, sizeof (vl.host));
+ sstrncpy (vl.plugin, "mbmon", sizeof (vl.plugin));
strncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
plugin_dispatch_values (type, &vl);
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- strcpy (vl.host, hostname_g);
- strcpy (vl.plugin, "memcached");
+ sstrncpy (vl.host, hostname_g, sizeof (vl.host));
+ sstrncpy (vl.plugin, "memcached", sizeof (vl.plugin));
if (type_inst != NULL)
{
strncpy (vl.type_instance, type_inst, sizeof (vl.type_instance));
vl.values = values;
vl.values_len = 2;
vl.time = time (NULL);
- strcpy (vl.host, hostname_g);
- strcpy (vl.plugin, "memcached");
+ sstrncpy (vl.host, hostname_g, sizeof (vl.host));
+ sstrncpy (vl.plugin, "memcached", sizeof (vl.plugin));
if (type_inst != NULL)
{
strncpy (vl.type_instance, type_inst, sizeof (vl.type_instance));
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- strcpy (vl.host, hostname_g);
- strcpy (vl.plugin, "memcached");
+ sstrncpy (vl.host, hostname_g, sizeof (vl.host));
+ sstrncpy (vl.plugin, "memcached", sizeof (vl.plugin));
if (type_inst != NULL)
{
strncpy (vl.type_instance, type_inst, sizeof (vl.type_instance));
vl.values = values;
vl.values_len = 2;
vl.time = time (NULL);
- strcpy (vl.host, hostname_g);
- strcpy (vl.plugin, "memcached");
+ sstrncpy (vl.host, hostname_g, sizeof (vl.host));
+ sstrncpy (vl.plugin, "memcached", sizeof (vl.plugin));
if (type_inst != NULL)
{
strncpy (vl.type_instance, type_inst, sizeof (vl.type_instance));
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- strcpy (vl.host, hostname_g);
- strcpy (vl.plugin, "memory");
+ sstrncpy (vl.host, hostname_g, sizeof (vl.host));
+ sstrncpy (vl.plugin, "memory", sizeof (vl.plugin));
strncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
vl.type_instance[sizeof (vl.type_instance) - 1] = '\0';
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- strcpy (vl.host, hostname_g);
- strcpy (vl.plugin, "multimeter");
+ sstrncpy (vl.host, hostname_g, sizeof (vl.host));
+ sstrncpy (vl.plugin, "multimeter", sizeof (vl.plugin));
plugin_dispatch_values ("multimeter", &vl);
}
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- strcpy (vl.host, hostname_g);
- strcpy (vl.plugin, "mysql");
+ sstrncpy (vl.host, hostname_g, sizeof (vl.host));
+ sstrncpy (vl.plugin, "mysql", sizeof (vl.plugin));
strncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
plugin_dispatch_values (type, &vl);
vl.values = values;
vl.values_len = 5;
vl.time = time (NULL);
- strcpy (vl.host, hostname_g);
- strcpy (vl.plugin, "mysql");
+ sstrncpy (vl.host, hostname_g, sizeof (vl.host));
+ sstrncpy (vl.plugin, "mysql", sizeof (vl.plugin));
plugin_dispatch_values ("mysql_qcache", &vl);
} /* void qcache_submit */
vl.values = values;
vl.values_len = 4;
vl.time = time (NULL);
- strcpy (vl.host, hostname_g);
- strcpy (vl.plugin, "mysql");
+ sstrncpy (vl.host, hostname_g, sizeof (vl.host));
+ sstrncpy (vl.plugin, "mysql", sizeof (vl.plugin));
plugin_dispatch_values ("mysql_threads", &vl);
} /* void threads_submit */
vl.values = values;
vl.values_len = 2;
vl.time = time (NULL);
- strcpy (vl.host, hostname_g);
- strcpy (vl.plugin, "mysql");
+ sstrncpy (vl.host, hostname_g, sizeof (vl.host));
+ sstrncpy (vl.plugin, "mysql", sizeof (vl.plugin));
plugin_dispatch_values ("mysql_octets", &vl);
} /* void traffic_submit */
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- strcpy (vl.host, hostname_g);
- strcpy (vl.plugin, "netlink");
+ sstrncpy (vl.host, hostname_g, sizeof (vl.host));
+ sstrncpy (vl.plugin, "netlink", sizeof (vl.plugin));
strncpy (vl.plugin_instance, dev, sizeof (vl.plugin_instance));
if (type_instance != NULL)
vl.values = values;
vl.values_len = 2;
vl.time = time (NULL);
- strcpy (vl.host, hostname_g);
- strcpy (vl.plugin, "netlink");
+ sstrncpy (vl.host, hostname_g, sizeof (vl.host));
+ sstrncpy (vl.plugin, "netlink", sizeof (vl.plugin));
strncpy (vl.plugin_instance, dev, sizeof (vl.plugin_instance));
if (type_instance != NULL)
if (write_part_string (&buffer, &buffer_size, TYPE_HOST,
vl->host, strlen (vl->host)) != 0)
return (-1);
- strcpy (vl_def->host, vl->host);
+ sstrncpy (vl_def->host, vl->host, sizeof (vl_def->host));
}
if (vl_def->time != vl->time)
if (write_part_string (&buffer, &buffer_size, TYPE_PLUGIN,
vl->plugin, strlen (vl->plugin)) != 0)
return (-1);
- strcpy (vl_def->plugin, vl->plugin);
+ sstrncpy (vl_def->plugin, vl->plugin, sizeof (vl_def->plugin));
}
if (strcmp (vl_def->plugin_instance, vl->plugin_instance) != 0)
vl->plugin_instance,
strlen (vl->plugin_instance)) != 0)
return (-1);
- strcpy (vl_def->plugin_instance, vl->plugin_instance);
+ sstrncpy (vl_def->plugin_instance, vl->plugin_instance, sizeof (vl_def->plugin_instance));
}
if (strcmp (type_def, ds->type) != 0)
if (write_part_string (&buffer, &buffer_size, TYPE_TYPE,
ds->type, strlen (ds->type)) != 0)
return (-1);
- strcpy (type_def, ds->type);
+ sstrncpy (type_def, ds->type, sizeof (type_def));
}
if (strcmp (vl_def->type_instance, vl->type_instance) != 0)
vl->type_instance,
strlen (vl->type_instance)) != 0)
return (-1);
- strcpy (vl_def->type_instance, vl->type_instance);
+ sstrncpy (vl_def->type_instance, vl->type_instance, sizeof (vl_def->type_instance));
}
if (write_part_values (&buffer, &buffer_size, ds, vl) != 0)
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- strcpy (vl.host, hostname_g);
- strcpy (vl.plugin, "nfs");
+ sstrncpy (vl.host, hostname_g, sizeof (vl.host));
+ sstrncpy (vl.plugin, "nfs", sizeof (vl.plugin));
strncpy (vl.plugin_instance, plugin_instance,
sizeof (vl.plugin_instance));
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- strcpy (vl.host, hostname_g);
- strcpy (vl.plugin, "nginx");
- strcpy (vl.plugin_instance, "");
+ sstrncpy (vl.host, hostname_g, sizeof (vl.host));
+ sstrncpy (vl.plugin, "nginx", sizeof (vl.plugin));
+ sstrncpy (vl.plugin_instance, "", sizeof (vl.plugin_instance));
if (inst != NULL)
{
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- strcpy (vl.host, hostname_g);
- strcpy (vl.plugin, "ntpd");
- strcpy (vl.plugin_instance, "");
+ sstrncpy (vl.host, hostname_g, sizeof (vl.host));
+ sstrncpy (vl.plugin, "ntpd", sizeof (vl.plugin));
+ sstrncpy (vl.plugin_instance, "", sizeof (vl.plugin_instance));
strncpy (vl.type_instance, type_inst, sizeof (vl.type_instance));
plugin_dispatch_values (type, &vl);
? hostname_g
: ups->hostname,
sizeof (vl.host));
- strcpy (vl.plugin, "nut");
+ sstrncpy (vl.plugin, "nut", sizeof (vl.plugin));
strncpy (vl.plugin_instance, ups->upsname, sizeof (vl.plugin_instance));
strncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
list.host[DATA_MAX_NAME_LEN - 1] = '\0';
}
else {
- strcpy (list.host, hostname_g);
+ sstrncpy (list.host, hostname_g, sizeof (list.host));
}
if (NULL != (tmp = hv_fetch (values, "plugin", 6, 0))) {
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- strcpy (vl.host, hostname_g);
- strcpy (vl.plugin, "ping");
- strcpy (vl.plugin_instance, "");
+ sstrncpy (vl.host, hostname_g, sizeof (vl.host));
+ sstrncpy (vl.plugin, "ping", sizeof (vl.plugin));
+ sstrncpy (vl.plugin_instance, "", sizeof (vl.plugin_instance));
strncpy (vl.type_instance, host, sizeof (vl.type_instance));
plugin_dispatch_values ("ping", &vl);
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- strcpy (vl.host, hostname_g);
- strcpy (vl.plugin, "processes");
- strcpy (vl.plugin_instance, "");
+ sstrncpy (vl.host, hostname_g, sizeof (vl.host));
+ sstrncpy (vl.plugin, "processes", sizeof (vl.plugin));
+ sstrncpy (vl.plugin_instance, "", sizeof (vl.plugin_instance));
strncpy (vl.type_instance, state, sizeof (vl.type_instance));
plugin_dispatch_values ("ps_state", &vl);
vl.values = values;
vl.values_len = 2;
vl.time = time (NULL);
- strcpy (vl.host, hostname_g);
- strcpy (vl.plugin, "processes");
+ sstrncpy (vl.host, hostname_g, sizeof (vl.host));
+ sstrncpy (vl.plugin, "processes", sizeof (vl.plugin));
strncpy (vl.plugin_instance, ps->name, sizeof (vl.plugin_instance));
vl.values[0].gauge = ps->vmem_rss;
if (isnan (d->min))
{
- strcpy (min, "U");
+ sstrncpy (min, "U", sizeof (min));
}
else
{
if (isnan (d->max))
{
- strcpy (max, "U");
+ sstrncpy (max, "U", sizeof (max));
}
else
{
vl.values = values;
vl.values_len = 2;
vl.time = time (NULL);
- strcpy (vl.host, hostname_g);
- strcpy (vl.plugin, "serial");
+ sstrncpy (vl.host, hostname_g, sizeof (vl.host));
+ sstrncpy (vl.plugin, "serial", sizeof (vl.plugin));
strncpy (vl.type_instance, type_instance,
sizeof (vl.type_instance));
strncpy (vl.host, host->name, sizeof (vl.host));
vl.host[sizeof (vl.host) - 1] = '\0';
- strcpy (vl.plugin, "snmp");
+ sstrncpy (vl.plugin, "snmp", sizeof (vl.plugin));
vl.interval = host->interval;
vl.time = time (NULL);
strncpy (vl.host, host->name, sizeof (vl.host));
vl.host[sizeof (vl.host) - 1] = '\0';
- strcpy (vl.plugin, "snmp");
+ sstrncpy (vl.plugin, "snmp", sizeof (vl.plugin));
strncpy (vl.type_instance, data->instance.string, sizeof (vl.type_instance));
vl.type_instance[sizeof (vl.type_instance) - 1] = '\0';
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- strcpy (vl.host, hostname_g);
- strcpy (vl.plugin, "swap");
+ sstrncpy (vl.host, hostname_g, sizeof (vl.host));
+ sstrncpy (vl.plugin, "swap", sizeof (vl.plugin));
strncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
plugin_dispatch_values ("swap", &vl);
vl.values = values;
vl.values_len = 2;
vl.time = time (NULL);
- strcpy (vl.host, hostname_g);
- strcpy (vl.plugin, "tape");
+ sstrncpy (vl.host, hostname_g, sizeof (vl.host));
+ sstrncpy (vl.plugin, "tape", sizeof (vl.plugin));
strncpy (vl.plugin_instance, plugin_instance,
sizeof (vl.plugin_instance));
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- strcpy (vl.host, hostname_g);
- strcpy (vl.plugin, "tcpconns");
+ sstrncpy (vl.host, hostname_g, sizeof (vl.host));
+ sstrncpy (vl.plugin, "tcpconns", sizeof (vl.plugin));
if (((port_collect_listening != 0) && (pe->flags & PORT_IS_LISTENING))
|| (pe->flags & PORT_COLLECT_LOCAL))
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- strcpy (vl.host, hostname_g);
- strcpy (vl.plugin, "users");
+ sstrncpy (vl.host, hostname_g, sizeof (vl.host));
+ sstrncpy (vl.plugin, "users", sizeof (vl.plugin));
plugin_dispatch_values ("users", &vl);
} /* void users_submit */
return (-1);
}
- strcpy (vl.host, hostname);
- strcpy (vl.plugin, plugin);
+ sstrncpy (vl.host, hostname, sizeof (vl.host));
+ sstrncpy (vl.plugin, plugin, sizeof (vl.plugin));
if (plugin_instance != NULL)
- strcpy (vl.plugin_instance, plugin_instance);
+ sstrncpy (vl.plugin_instance, plugin_instance, sizeof (vl.plugin_instance));
if (type_instance != NULL)
- strcpy (vl.type_instance, type_instance);
+ sstrncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
ds = plugin_get_ds (type);
if (ds == NULL) {
if (0 != x)
return 0;
if ('\0' == qh.qname[0])
- strcpy(qh.qname, ".");
+ strncpy (qh.qname, ".", sizeof (qh.qname));
while ((t = strchr(qh.qname, '\n')))
*t = ' ';
while ((t = strchr(qh.qname, '\r')))
vl.values = values;
vl.values_len = STATIC_ARRAY_SIZE (values);
vl.time = time (NULL);
- strcpy (vl.host, hostname_g);
- strcpy (vl.plugin, "vserver");
+ sstrncpy (vl.host, hostname_g, sizeof (vl.host));
+ sstrncpy (vl.plugin, "vserver", sizeof (vl.plugin));
strncpy (vl.plugin_instance, plugin_instance, sizeof (vl.plugin_instance));
strncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
vl.values = values;
vl.values_len = STATIC_ARRAY_SIZE (values);
vl.time = time (NULL);
- strcpy (vl.host, hostname_g);
- strcpy (vl.plugin, "vserver");
+ sstrncpy (vl.host, hostname_g, sizeof (vl.host));
+ sstrncpy (vl.plugin, "vserver", sizeof (vl.plugin));
strncpy (vl.plugin_instance, plugin_instance, sizeof (vl.plugin_instance));
plugin_dispatch_values ("load", &vl);
vl.values = values;
vl.values_len = STATIC_ARRAY_SIZE (values);
vl.time = time (NULL);
- strcpy (vl.host, hostname_g);
- strcpy (vl.plugin, "vserver");
+ sstrncpy (vl.host, hostname_g, sizeof (vl.host));
+ sstrncpy (vl.plugin, "vserver", sizeof (vl.plugin));
strncpy (vl.plugin_instance, plugin_instance, sizeof (vl.plugin_instance));
strncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- strcpy (vl.host, hostname_g);
- strcpy (vl.plugin, "wireless");
+ sstrncpy (vl.host, hostname_g, sizeof (vl.host));
+ sstrncpy (vl.plugin, "wireless", sizeof (vl.plugin));
strncpy (vl.plugin_instance, plugin_instance,
sizeof (vl.plugin_instance));
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- strcpy (vl.host, hostname_g);
- strcpy (vl.plugin, "xmms");
+ sstrncpy (vl.host, hostname_g, sizeof (vl.host));
+ sstrncpy (vl.plugin, "xmms", sizeof (vl.plugin));
plugin_dispatch_values (type, &vl);
} /* void cxmms_submit */