Skip to content

distrobox-enter: envs with " are not present in container #1842

@cshuaimin

Description

@cshuaimin

Describe the bug
If there's a " in an environment variable (e.g. a JSON string), distrobox-enter won't make it available in the container. Other envs are available.

To Reproduce

$ GOOD='yes' BAD='{"foo":1}' distrobox enter -- sh -c 'echo GOOD=$GOOD BAD=$BAD'
GOOD=yes BAD=

Expected behavior
All envs are available in the container.

I think docker exec supports only set env names and it will read the values: --env=ENV, not need to set env value in the command line --env=ENV=value. If we don't set the value, this filter can be removed:

$(printenv | grep '=' | grep -Ev '"|`|\$' |

Logs
Run the commands with --verbose and post the log here as a file upload
Attach also the output of podman logs or docker logs, possibly with --latest flag

Desktop (please complete the following information):

  • Are you using podman, docker or lilipod?
  • Which version or podman, docker or lilipod?
  • Which version of distrobox?
  • Which host distribution?
  • How did you install distrobox?

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingwait-on-userwaiting for a reply

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions