[systemd-devel] [PATCH 2/2] machine: quote a scope name in machine_save

Lukas Nykryn lnykryn at redhat.com
Thu Apr 10 06:17:21 PDT 2014


Currently serialization in machined does not work for some names
because parse_env_file is dropping backslashes from values.
Than gc deletes the machine because it is unable to find the scope.
---
 src/machine/machine.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/machine/machine.c b/src/machine/machine.c
index 9a5cc9a..b4035de 100644
--- a/src/machine/machine.c
+++ b/src/machine/machine.c
@@ -124,7 +124,7 @@ int machine_save(Machine *m) {
                 m->name);
 
         if (m->unit)
-                fprintf(f, "SCOPE=%s\n", m->unit); /* We continue to call this "SCOPE=" because it is internal only, and we want to stay compatible with old files */
+                fprintf(f, "SCOPE='%s'\n", m->unit); /* We continue to call this "SCOPE=" because it is internal only, and we want to stay compatible with old files */
 
         if (m->scope_job)
                 fprintf(f, "SCOPE_JOB=%s\n", m->scope_job);
-- 
1.9.0



More information about the systemd-devel mailing list