chiark / gitweb /
conf-parser: don't unescape parsed configuration strings by default
authorLennart Poettering <lennart@poettering.net>
Mon, 17 Sep 2012 19:58:03 +0000 (21:58 +0200)
committerLennart Poettering <lennart@poettering.net>
Mon, 17 Sep 2012 19:58:03 +0000 (21:58 +0200)
In many cases this might have a negative effect since we drop escaping
from strings where we better shouldn't have dropped it.

If unescaping makes sense for some settings we can readd it later again,
on a per-case basis.

https://bugs.freedesktop.org/show_bug.cgi?id=54522

src/core/service.c
src/core/unit.c
src/shared/conf-parser.c
src/shared/util.c

index 7b5ff6d1ac87673df12dec69b86a27ae940f991e..5f7ddfaf14d4db41610993f097e179c69a20445a 100644 (file)
@@ -932,7 +932,6 @@ static int service_load_sysv_path(Service *s, const char *path) {
                 s->timeout_stop_usec = DEFAULT_SYSV_TIMEOUT_USEC;
         }
 
-
         /* Special setting for all SysV services */
         s->type = SERVICE_FORKING;
         s->remain_after_exit = !s->pid_file;
index 3950c43f5e217c66c48a39291827594de41610e2..be0d654bbc001bcfb94c9750c0700bece380236d 100644 (file)
@@ -2675,16 +2675,18 @@ int unit_add_node_link(Unit *u, const char *what, bool wants) {
 
         r = manager_load_unit(u->manager, e, NULL, NULL, &device);
         free(e);
-
         if (r < 0)
                 return r;
 
-        if ((r = unit_add_two_dependencies(u, UNIT_AFTER, UNIT_BINDS_TO, device, true)) < 0)
+        r = unit_add_two_dependencies(u, UNIT_AFTER, UNIT_BINDS_TO, device, true);
+        if (r < 0)
                 return r;
 
-        if (wants)
-                if ((r = unit_add_dependency(device, UNIT_WANTS, u, false)) < 0)
+        if (wants) {
+                r = unit_add_dependency(device, UNIT_WANTS, u, false);
+                if (r < 0)
                         return r;
+        }
 
         return 0;
 }
index 68ab80470e5348ae0d7c0cc160edb74f136324d0..4bf3147f2d2e9194efba31befa971728556278d2 100644 (file)
@@ -593,7 +593,7 @@ int config_parse_string(
         assert(rvalue);
         assert(data);
 
-        n = cunescape(rvalue);
+        n = strdup(rvalue);
         if (!n)
                 return -ENOMEM;
 
index 84f8565e0c0542299eb2ef9df148bbb0c0593302..20e5faf34bd2037a5bd017a378d838cf2a9afc99 100644 (file)
@@ -4097,6 +4097,8 @@ static char *tag_to_udev_node(const char *tagvalue, const char *by) {
 }
 
 char *fstab_node_to_udev_node(const char *p) {
+        assert(p);
+
         if (startswith(p, "LABEL="))
                 return tag_to_udev_node(p+6, "label");