Skip to content

[Error] Arguments passed to exported binaries are interpred by the shell and can result in unexpected behaviours and syntax errors #1275

Closed
@xoich

Description

@xoich

Describe the bug
Arguments passed to exported binaries when run in the host are interpreted by the shell, this makes the exported binary behave differently than when run directly in the guest, even causing shell syntax errors.

To Reproduce

  • print1 is an executable the prints its first argument as it is (#!/bin/sh\n echo "$1")
  • run print1 '--anchor="define(' in the guest, it prints --anchor="define(.
  • export it with distrobox-export --bin print1
  • run print1 '--anchor="define(' in the host, it causes this error: distrobox-enter: eval: line 614: syntax error near unexpected token '('

Expected behavior
Running print1 '--anchor="define(' in the host prints --anchor="define(

Desktop (please complete the following information):

  • Are you using podman, docker or lilipod? podman
  • Which version or podman? 4.9.3
  • Which version of distrobox? 1.7.0
  • Which host distribution? OpenSUSE Aeon
  • How did you install distrobox? Pre-installed in the OS

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions