]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[5105] Updated examples and User's Guide to match double escapes.
authorTomek Mrugalski <tomasz@isc.org>
Thu, 2 Feb 2017 12:46:07 +0000 (13:46 +0100)
committerTomek Mrugalski <tomasz@isc.org>
Thu, 2 Feb 2017 12:46:07 +0000 (13:46 +0100)
doc/examples/kea4/multiple-options.json
doc/examples/kea6/multiple-options.json
doc/guide/dhcp4-srv.xml
doc/guide/dhcp6-srv.xml

index c5d284427de9c061cb0fff74259b19fef1aeb20c..1d18d0025f727b3717c65e9561f2137a95a9b8b4 100644 (file)
          },
          {
              // String options that have a comma in their values need to have
-             // it escaped (i.e. each comma is predeced by a backslash). That's
+             // it escaped (i.e. each comma is predeced by two backslashes). That's
              // because commas are reserved for separating fields in compound
-             // options.
+             // options. At the same time, we need to be conformant with JSON spec,
+             // that does not allow "\,". Therefore the slightly uncommon double
+             // backslashes natation is needed.
              "name": "boot-file-name",
-             "data": "EST5EDT4\,M3.2.0/02:00\,M11.1.0/02:00"
+             "data": "EST5EDT4\\,M3.2.0/02:00\\,M11.1.0/02:00"
          }
        ]
     } 
index 3677da4c29a5c8b5e616c70cb153b53d6fcd5576..75fd517bda8d2f44f9170899ed9dccfde751001a 100644 (file)
         },
         {
             // String options that have a comma in their values need to have
-            // it escaped (i.e. each comma is predeced by a backslash). That's
+            // it escaped (i.e. each comma is predeced by two backslashes). That's
             // because commas are reserved for separating fields in compound
-            // options.
+            // options. At the same time, we need to be conformant with JSON spec,
+            // that does not allow "\,". Therefore the slightly uncommon double
+            // backslashes natation is needed.
             "name": "new-posix-timezone",
             "data": "EST5EDT4\,M3.2.0/02:00\,M11.1.0/02:00"
         }
index f21ee4b2e2449bf2c8a1e2fbdf1e529e80fba4fc..7c21acfc28bd531e770f0d6bb7bbc230a80159f1 100644 (file)
@@ -1018,8 +1018,9 @@ temporarily override a list of interface names and listen on all interfaces.
       </para>
 
       <para>When the data field is a string, and that string contains the comma
-      (,; U+002C) character, the comma must be escaped with a reverse solidus
-      character (\; U+005C). For example, the string
+      (,; U+002C) character, the comma must be escaped with a double reverse solidus
+      character (\; U+005C). This double escape is required, because a
+      single escape (\,) would make the JSON invalid. For example, the string
       &quot;foo,bar&quot; would be represented as:
       <screen>
 "Dhcp4": {
@@ -1030,7 +1031,7 @@ temporarily override a list of interface names and listen on all interfaces.
                     <userinput>"option-data": [
                         {
                             "name": "boot-file-name",
-                            "data": "foo\,bar"
+                            "data": "foo\\,bar"
                         }
                     ]</userinput>
                 },
index 89a731767ce9681e41276f857492a6090f727d45..aa0ac27a6616680790ad6f96219f97f8b66aaa64 100644 (file)
@@ -1050,9 +1050,12 @@ temporarily override a list of interface names and listen on all interfaces.
       which was not assigned by IANA) are listed in
       <xref linkend="dhcp6-exp-options-list"/>.
     </para>
-    <para>When the data field is a string, and that string contains the comma
-    (,; U+002C) character, the comma must be escaped with a reverse solidus
-    character (\; U+005C). For example, the string &quot;EST5EDT4,M3.2.0/02:00,M11.1.0/02:00&quot; would be
+    <para>When the data field is a string, and that string contains
+    the comma (,; U+002C) character, the comma must be escaped with a
+    reverse solidus character (\; U+005C). This double escape is
+    required, because a single escape (\,) would make the JSON
+    invalid. For example, the string
+    &quot;EST5EDT4,M3.2.0/02:00,M11.1.0/02:00&quot; would be
     represented as:
 <screen>
 "Dhcp6": {