Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/go/internal/envcmd: double check plan 9 behavior in PrintEnv when null byte present in value #59979

Open
matloob opened this issue May 4, 2023 · 4 comments
Assignees
Labels
ExpertNeeded NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. OS-Plan9
Milestone

Comments

@matloob
Copy link
Contributor

matloob commented May 4, 2023

We'd like a plan 9 expert to double check this: In PrintEnv in cmd/go/internal/envcmd/env.go, plan9's handling behavior is different based on whether there's a null byte. If there's not a null byte present it quotes the string, and if there isn't it puts them in a parenthesized list, but doesn't quote each of the listed strings. We want to make sure that not quoting each of the strings in the list is the intended behavior.

@bcmills
Copy link
Contributor

bcmills commented May 4, 2023

This is in the context of https://go.dev/cl/488375 / #58508.

(attn @golang/plan9)

@bcmills bcmills added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label May 4, 2023
@bcmills bcmills added this to the Backlog milestone May 4, 2023
@millerresearch
Copy link
Contributor

In practice only GOPATH is likely to have a list value, and if a Plan 9 directory name in the path needed quoting it would likely cause all sorts of pain. But in theory one could have, for example, a directory with spaces in its name (imported from another OS?) and failing to quote it would mean that the output from go env could not safely be executed in the shell to assign GOPATH correctly.

Therefore my opinion is that the elements of a list should be individually quoted.

@bcmills
Copy link
Contributor

bcmills commented May 4, 2023

I suspect that Russ is the only person on the Go team familiar enough with the Plan 9 shell to implement quoting, but if someone wants to contribute a fix once CL 488375 is merged I'd be glad to review it.

@millerresearch millerresearch self-assigned this May 4, 2023
@millerresearch
Copy link
Contributor

if someone wants to contribute a fix once CL 488375 is merged I'd be glad to review it.

I'll do it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ExpertNeeded NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. OS-Plan9
Projects
None yet
Development

No branches or pull requests

3 participants