/usr/share/cricket/lib/sqlUtils.pm is in cricket 1.0.5-21.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | package sqlUtils;
use Common::Log;
sub sendto {
my ($args, @data) = @_;
my ($driver, $login, $password, $sybhome) = split(/,/, $args);
my $dbh = DBI->connect($driver, $login, $password) ||
Error("DBH connect failed because of: $DBI::errstr");
my $ds = 0;
foreach my $val (@data) {
my @time = localtime();
my $timestamp = ($time[4] + 1) . "-" . ($time[3]) . "-" .
($time[5] + 1900) . " $time[2]:$time[1]";
$dbh->do("use cricket; " .
"insert into CricketData (targetPath, targetName, ds, " .
"value, timestamp) " .
"values ('$tpath', '$tname', '$ds', '$val', '$timestamp')");
$ds++;
}
}
1;
# Local Variables:
# mode: perl
# indent-tabs-mode: nil
# tab-width: 4
# perl-indent-level: 4
# End:
|