[ovs-dev] [PATCH 2/5] system-common-macros: Don't use bash to exec in ns.
joestringer at nicira.com
Mon Aug 10 20:17:29 UTC 2015
Hmm. The problem I was having is that if we wrap 'command' in quotes
here, and 'command' itself includes quotes (eg, command='echo "foo" |
bar'), then rather than quoting "foo", the command ends up quoting
everything up to 'foo', then unquoting 'foo', then quoting everything
after 'foo'. The ICMP related test in the conntrack branch has an
instance of this.
Maybe the right solution is to have two variants: NS_CHECK_EXEC() and
NS_CHECK_EXEC_UNQUOTED(). I've seen this other places in OVS
On 10 August 2015 at 11:40, Daniele Di Proietto <diproiettod at vmware.com> wrote:
> I guess you need this to use quotes("") inside 'command'.
> One effect of this change is that if 'command' contains a pipe
> (or &&, or ||) just the first command will be executed inside
> the namespace. I'm not sure if it's a big problem. What do you
> On 08/08/2015 00:28, "Joe Stringer" <joestringer at nicira.com> wrote:
>>ip netns exec $namespace $command doesn't need to use bash to execute
>>the command. Remove it.
>>Signed-off-by: Joe Stringer <joestringer at nicira.com>
>> tests/system-common-macros.at | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>diff --git a/tests/system-common-macros.at b/tests/system-common-macros.at
>>index 1321e58..fdc2bc7 100644
>>@@ -25,7 +25,7 @@ m4_define([ADD_NAMESPACES],
>> # Execute 'command' in 'namespace'
>>- [ip netns exec $1 bash -c "$2"]
>>+ [ip netns exec $1 $2]
>> # NS_CHECK_EXEC([namespace], [command], other_params...)
More information about the dev