]> git.proxmox.com Git - mirror_lxc.git/commit - src/lxc/utils.h
implement lxc_string_split_quoted
authorSerge Hallyn <shallyn@cisco.com>
Wed, 4 Oct 2017 05:14:00 +0000 (05:14 +0000)
committerSerge Hallyn <shallyn@cisco.com>
Wed, 4 Oct 2017 18:01:53 +0000 (18:01 +0000)
commit3dca1af064e3ac25be7deeff1aca9f41ea935358
tree2deb63f607285f719031299af6f5e816063793b6
parent0ef43a5c1d635835950335375f0dd71bf1abe384
implement lxc_string_split_quoted

lxc_string_split_quoted() splits a string on spaces, but keeps
groups in single or double qoutes together.  In other words,
generally what we'd want for argv behavior.

Switch lxc-execute to use this for lxc.execute.cmd.

Switch lxc-oci template to put the lxc.execute.cmd inside single
quotes, because parse_line() will eat those.  If we don't do that,
then if we have lxc.execute.cmd = /bin/echo "hello, world", then the
last double quote will disappear.

Signed-off-by: Serge Hallyn <shallyn@cisco.com>
src/lxc/tools/lxc_execute.c
src/lxc/utils.c
src/lxc/utils.h
templates/lxc-oci.in