Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • NetworkManager-openvpn NetworkManager-openvpn
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 44
    • Issues 44
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 4
    • Merge requests 4
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GNOMEGNOME
  • NetworkManager-openvpnNetworkManager-openvpn
  • Merge requests
  • !5

[th/export-sanitize-newlines] properties: sanitize newlines ('\n') when exporting ovpn file

  • Review changes

  • Download
  • Patches
  • Plain diff
Closed Thomas Haller requested to merge th/export-sanitize-newlines into master Jul 14, 2018
  • Overview 4
  • Commits 1
  • Pipelines 3
  • Changes 1

Openvpn's ovpn configuration files cannot contain newlines as values, because

  • the parser reads the ovpn file line by line, splitting lines are newlines before considering quotation that spans multiple lines.
  • special special escape sequences like '\n' or '\0x012' are not supported. Escape sequences are only supported for "'", """, and verbatim spaces like "\ " (but not newline itself).

Note that newlines could be part of a valid configuration, for example as part of filenames.

That means, whenever exporting a configuration with newlines, it cannot be expressed, because we would end up with a quotation that breaks the line, tripping up the configuration parser of openvpn.

There is no way to make this configuration working. However, instead of writing syntatically wrong ovpn files, prefer to write valid ovpn files with mangled configuration. For that, replace newline characters with space.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: th/export-sanitize-newlines