As people have noted, BackupPC uses exec() for shell commands, not system(). The main reason for that is security - it's easy to be sloppy with system() and create unintended vulnerabilities.
However, it is still easy to be explicit about how the arguments are grouped and passed to the command. Instead of using quotes, which won't work, you can use a list instead of a simple string.
For example, to execute this command:
bash -c "touch /var/lock/backuppc/BackupPC; $sshPath -q -x -l root $host touch /var/lock/backuppc/BackupPC"'
you should be able to do this:
$Conf{DumpPreUserCmd} = ['bin/bash', '-c', 'touch /var/lock/backuppc/BackupPC; $sshPath -q -x -l root $host touch /var/lock/backuppc/BackupPC'];
This should run /bin/bash with the two arguments.
------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13.
http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk _______________________________________________
BackupPC-users mailing list
BackupPC-users AT lists.sourceforge DOT net
List: https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki: http://backuppc.wiki.sourceforge.net
Project: http://backuppc.sourceforge.net/
|