On Tue, Jul 23, 2013 at 7:54 AM, Raphaël Jacquot <[email protected]> wrote: > Hi, > > I have installed version BackupPC-3.3.0 and have been having issues with > ping commands other than the standard ping. > for instance, I want to use "ssh -l root $host true" for a certain host > which doesn't respond to icmp > > I found the following issue : > > in lib/BackupPC/Lib.pm, line 1383 we have : > > 1377 $cmd = [map { m/(.*)/ } @$cmd]; # untaint > 1378 # > 1379 # force list-form of exec(), ie: no shell even for 1 > arg > 1380 # > 1381 exec { $cmd->[0] } @$cmd; > 1382 print(STDERR "Exec of @$cmd failed\n"); > 1383 exit(1); > > this code seems pretty suspect. in particular, it doesn't test for the > actual value of $?, and forces the value to 1, aka failure. > > this should probably read : > > exec { $cmd->[0] } @$cmd; > if ( $? ) { > print(STDERR "Exec of @$cmd failed\n"); > exit(1); > } > exit(0); > > or something similar.
That's 'exec', not 'system': http://perldoc.perl.org/functions/exec.html exec (a) doesn't have a shell parse a string for the command for you and (b) doesn't return to execute the next line if it succeeds. -- Les Mikesell [email protected] ------------------------------------------------------------------------------ See everything from the browser to the database with AppDynamics Get end-to-end visibility with application monitoring from AppDynamics Isolate bottlenecks and diagnose root cause in seconds. Start your free trial of AppDynamics Pro today! http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk _______________________________________________ BackupPC-users mailing list [email protected] List: https://lists.sourceforge.net/lists/listinfo/backuppc-users Wiki: http://backuppc.wiki.sourceforge.net Project: http://backuppc.sourceforge.net/
