Skip to content

QuotedWhitespace does not escape quotes #202

@pipex

Description

@pipex

QuotedWhitespace adds double-quotes around strings with whitespaces but doesn't escape inner double quotes inside the string. This can lead to incorrect configuration being passed to the engine

For example

podlet --install podman run --rm --name test --label 'my-meta={"key": "label0", "value": 123}' alpine sleep infinity
# test.container
[Container]
ContainerName=test
Exec=sleep infinity
Image=alpine
Label="my-meta={"key": "label0", "value": 123}"

[Install]
WantedBy=default.target

These quotes are escaped by the generator when creating the systemd unit, here is the ExecStart

ExecStart=/usr/bin/podman run --name test --replace --rm --cgroups=split --sdnotify=conmon -d --label "my-meta={key:\x20label0,\x20value:\x20123}" alpine sleep infinity

However this doesn't store the correct value on the container label

podman inspect test | jq -r '.[].Config.Labels["my-meta"]'
{key: label0, value: 123}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions