Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/cmd/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func init() {
flags.StringVarP(&createFlags.container,
"container",
"c",
"",
os.Getenv("TOOLBOX_DEFAULT_CONTAINER"),
"Assign a different name to the Toolbx container")

flags.StringVarP(&createFlags.distro,
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/enter.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func init() {
flags.StringVarP(&enterFlags.container,
"container",
"c",
"",
os.Getenv("TOOLBOX_DEFAULT_CONTAINER"),
"Enter a Toolbx container with the given name")

flags.StringVarP(&enterFlags.distro,
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func init() {
flags.StringVarP(&runFlags.container,
"container",
"c",
"",
os.Getenv("TOOLBOX_DEFAULT_CONTAINER"),
"Run command inside a Toolbx container with the given name")

flags.StringVarP(&runFlags.distro,
Expand Down
1 change: 1 addition & 0 deletions src/pkg/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ var (
"SHELL",
"SSH_AUTH_SOCK",
"TERM",
"TOOLBOX_DEFAULT_CONTAINER",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Adding TOOLBOX_DEFAULT_CONTAINER to preservedEnvironmentVariables causes it to be passed from the host into containers during toolbox run. This leaks host-side tool configuration into the container's environment, which can lead to unexpected behavior and breaks isolation. For example, a script inside a container might behave differently depending on the host's TOOLBOX_DEFAULT_CONTAINER setting.

To avoid this, please remove this variable from the list. The main feature of this PR (using the variable on the host) will still work correctly.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Going to wait for human confirmation of this because if the above is correct, I misunderstood it completely :) in my testing this was needed to get a toolbox foo to run correctly when running within a toolbox itself.

"TOOLBOX_PATH",
"USER",
"VTE_VERSION",
Expand Down