[systemd-devel] [PATCH 8/9] nspawn: Allow : characters in overlay paths

Richard Maw richard.maw at codethink.co.uk
Thu May 28 05:02:14 PDT 2015


: characters can be entered with the \: escape sequence.
---
 src/nspawn/nspawn.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
index f7580f9..bace72e 100644
--- a/src/nspawn/nspawn.c
+++ b/src/nspawn/nspawn.c
@@ -744,9 +744,13 @@ static int parse_argv(int argc, char *argv[]) {
                         unsigned n = 0;
                         char **i;
 
-                        lower = strv_split(optarg, ":");
-                        if (!lower)
+                        r = strv_split_escaped(&lower, optarg, ":", UNQUOTE_SEPARATOR_SPLIT);
+                        if (r == -ENOMEM)
                                 return log_oom();
+                        else if (r < 0) {
+                                log_error("Invalid overlay specification: %s", optarg);
+                                return r;
+                        }
 
                         STRV_FOREACH(i, lower) {
                                 if (!path_is_absolute(*i)) {
-- 
1.9.1



More information about the systemd-devel mailing list