Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • Kea Kea
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 560
    • Issues 560
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 69
    • Merge requests 69
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • ISC Open Source ProjectsISC Open Source Projects
  • KeaKea
  • Issues
  • #927
Closed
Open
Issue created Sep 26, 2019 by Michael McNally@McNally

Improve parsing of commas within text strings

Our friend Shawn, on support ticket #15079 was having a bit of awkwardness trying to define some string-valued options in which the strings contained commas.

He wrote:

We have a customer attempting to put a comma separated string into an option defined as text in Kea. Kea appears to be treating the comma as a delimiter for arrays and discarding the comma and the text after the comma. It appears that you may have addressed this issue somewhat in 1.6.0 but I wanted to check if there is any way to escape or otherwise allow for commas in text strings in 1.5.0.

For example given this option definition

{
   "space": "dhcp4",
   "code": 176,
   "type": "string",
   "name": "test"
}

And this specification for the option value

{
   "name": "test",
   "code": 177,
   "data": "foo,bar"
}

We are only seeing "foo" put into the packet sent to the client. I have tried single quoting the text "'foo,bar'" and escaping the comma "foo,bar" and neither seem to work.

In a subsequent response on the same ticket he mentions that he has found a way to successfully escape the commas using multiple backslashes but this is likely to be a situation encountered by other operators who may find it similarly confusing, therefore we should consider (ideally) improving the parsing of commas that are within string literals OR (if not) at least better documenting how to use them.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking