From 9040519a9f03faef5ac6abea2146f28e0036963c Mon Sep 17 00:00:00 2001 From: edef Date: Sat, 29 May 2021 13:10:05 +0000 Subject: ripple/driver.pl: fix bpftrace argument passing bpftrace takes a single argument to -c, and then simply does a naive split_string(cmd, ' ') on that. This unfortunately makes it impossible to pass arguments containing spaces to subprocesses. Change-Id: Ib18a19f858b5acd87e54e00927173ccd4fe6ee49 --- ripple/driver.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'ripple') diff --git a/ripple/driver.pl b/ripple/driver.pl index 07be06f..7a8d164 100755 --- a/ripple/driver.pl +++ b/ripple/driver.pl @@ -6,6 +6,7 @@ use strict; use POSIX qw(mkfifo); @ARGV or die "Usage: $0 PROGRAM [ARG]... 2> [LOG FILE]"; +die "bpftrace does not support spaces in argv" if grep {/ /} @ARGV; unlink(my $fifo = "tracepipe"); mkfifo($fifo, 0600) or die; @@ -20,7 +21,7 @@ if (!$pid) { # NOTE: this expects bpftrace to be SUID-root, # and relies on shells dropping euid 'bpftrace', '-o', $fifo, '-e', $script, '-c', - @ARGV + join(' ', @ARGV) ) or die; } -- cgit 1.4.1