summaryrefslogtreecommitdiff
path: root/configmgr
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-09-01 13:07:44 +0200
committerStephan Bergmann <sbergman@redhat.com>2015-09-01 15:06:45 +0200
commitf262cfcf8ebf81d2d1407cf283b5d8eaaee053fd (patch)
treeaa2b9b9d48fbb8ef6c89ff65b8cdd88d14421b5b /configmgr
parent2921d6773698cc588f808172b37fb28d80b28a9c (diff)
dconf: fix encoding of set element names
Change-Id: I6aba45a70a9ebee65be34af1036bb515fd2a22b7
Diffstat (limited to 'configmgr')
-rw-r--r--configmgr/source/dconf.cxx31
1 files changed, 21 insertions, 10 deletions
diff --git a/configmgr/source/dconf.cxx b/configmgr/source/dconf.cxx
index 7d1bc793850b..44e80381ac7a 100644
--- a/configmgr/source/dconf.cxx
+++ b/configmgr/source/dconf.cxx
@@ -51,17 +51,25 @@
// N ; T ; O
//
// where ";" represents U+003B SEMICOLON; N is an encoding of the node name,
-// where each occurrence of U+003B SEMICOLON is replaced by the three
-// characters "\3B" and each ocurrence of U+005C REVERSE SOLIDUS is replaced
-// by the three characters "\5C"; T is an encoding of the full template name,
-// where each occurrence of U+002F SOLIDUS is replaced by the three characters
-// "\2F", each occurrence of U+003B SEMICOLON is replaced by the three
-// characters "\3B", and each ocurrence of U+005C REVERSE SOLIDUS is replaced
-// by the three characters "\5C"; and O is "fuse" or "replace", respectively.
+// where each occurrence of U+0000 NULL is replace by the three characters
+// "\00", each occurrence of U+002F SOLIDUS is replaced by the three
+// characters "\2F", each occurrence of U+003B SEMICOLON is replaced by the
+// three characters "\3B", and each ocurrence of U+005C REVERSE SOLIDUS is
+// replaced by the three characters "\5C"; T is an encoding of the full
+// template name, where each occurrence of U+002F SOLIDUS is replaced by the
+// three characters "\2F", each occurrence of U+003B SEMICOLON is replaced by
+// the three characters "\3B", and each ocurrence of U+005C REVERSE SOLIDUS is
+// replaced by the three characters "\5C"; and O is "fuse" or "replace",
+// respectively.
//
// * Set element and property "remove" operations are encoded as dconf key path
-// segments directly using the node name, and the associated value being a
-// GVariant of empty tuple type.
+// segments as follows, and the associated value being a GVariant of empty
+// tuple type. For set elements, the dconf key path segment consists of an
+// encoding of the node name, where each occurrence of U+0000 NULL is replace
+// by the three characters "\00", each occurrence of U+002F SOLIDUS is
+// replaced by the three characters "\2F", and each ocurrence of U+005C
+// REVERSE SOLIDUS is replaced by the three characters "\5C". For properties,
+// the dconf key path segment directly uses the node name.
//
// * Property and localized property value "fuse" operations map to GVariant
// instances as follows:
@@ -738,7 +746,7 @@ void readDir(
continue;
}
name = seg.copy(0, i1);
- if (!decode(&name, false, false, true)) {
+ if (!decode(&name, true, true, true)) {
continue;
}
++i1;
@@ -781,6 +789,9 @@ void readDir(
} else {
remove = true;
name = seg;
+ if (!decode(&name, true, true, false)) {
+ continue;
+ }
replace = false;
assert(!path.endsWith("/"));
GVariantHolder v(