PacketFence - BTS - PacketFence
View Issue Details
0001743PacketFencecorepublic2013-10-28 04:272013-10-29 06:31
erSitzt 
 
normalminoralways
newopen 
LinuxUbuntu12.04
4.0.6-2 
 
0001743: Service watchdog not able to restart all services
"pfcmd service pf start" and the watchdog if it tries to restart services that are not running produces this error

Insecure dependency in sprintf while running with -T switch at /usr/local/pf/lib/pf/services.pm

Needs to be untainted :

sub launchService {
    my ($daemon,@launcher_args) = @_;
    my $launcher = $service_launchers{$daemon};
    if ($launcher) {
        my $logger = Log::Log4perl::get_logger('pf::services');
### untaint launcher ###
        $launcher =~ /^(.*)$/;
        $launcher = $1;
########################
        my $cmd_line = sprintf($launcher, @launcher_args);
        $logger->info("Starting $daemon with '$cmd_line'");
        if ($cmd_line =~ /^(.+)$/) {
            $cmd_line = $1;
            my $t0 = Time::HiRes::time();
            my $return_value = system($cmd_line);
            my $elapsed = Time::HiRes::time() - $t0;
            $logger->info(sprintf("Daemon %s took %.3f seconds to start.", $daemon, $elapsed));
            return $return_value;
        }
    }
    return;
}
No tags attached.
Issue History
2013-10-28 04:27erSitztNew Issue
2013-10-29 06:31francisNote Added: 0003468

Notes
(0003468)
francis   
2013-10-29 06:31   
The upcoming pull of the "service refactor" branch will fix this problem.

See https://github.com/inverse-inc/packetfence/pull/104 [^]