Skip to content

dnf subcommands still splice user argv into the container shell unquoted #207

Description

@mobileoverlord

sdk run was fixed in #201: user argv was spliced into the container's shell script with a bare join(" "), so the container shell re-split and re-expanded it. The same splice is still raw at three other sites, found by @jetm reviewing that PR:

  • src/commands/sdk/dnf.rs:115
  • src/commands/ext/dnf.rs:358
  • src/commands/runtime/dnf.rs:303

All three are self.command.join(" ") on user-supplied argv, the identical shape.

The fix is now a one-liner each — #201 moved shell_escape to utils::shell and added join_argv — but it carries the same user-visible behavior change as #201 did: an argument containing a $VAR, a glob or a && stops being interpreted by the container shell and starts arriving literally. That is worth deciding deliberately for the dnf subcommands rather than folding into a sdk run fix, which is why it was left out of #201.

Wants a CHANGELOG entry and the same argv-boundary test per site.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions