Skip to content
This repository has been archived by the owner on Feb 24, 2020. It is now read-only.

functional test: check PATH variable for trailer \n character #2942

Merged
merged 1 commit into from
Jul 19, 2016

Conversation

alepuccetti
Copy link
Contributor

@alepuccetti alepuccetti commented Jul 18, 2016

This patch implements the test for #2901,
it tests that $PATH does not end with \n\0 but with \0.

This fixes #2905
Related to #2893

This patch also introduces the --check-path flag in inspect.go to carry out the test.

@iaguis
Copy link
Member

iaguis commented Jul 18, 2016

s/path/patch/ for some instances of path in the commit message :)

@@ -83,6 +84,7 @@ var (
func init() {
globalFlagset.BoolVar(&globalFlags.ReadStdin, "read-stdin", false, "Read a line from stdin")
globalFlagset.BoolVar(&globalFlags.CheckTty, "check-tty", false, "Check if stdin is a terminal")
globalFlagset.BoolVar(&globalFlags.CheckPath, "check-path", false, "Check if environament variable PATH do not terminate with \\n\\0")
Copy link
Member

Choose a reason for hiding this comment

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

s/environament/environment

"does not"

if len(v) == 0 {
continue
}
if strings.Contains(string(v), "PATH=") {
Copy link
Member

Choose a reason for hiding this comment

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

This patch implements the test for rkt#2901,
it tests that `$PATH` does not contain `\n`.

This fixes rkt#2905
Related to rkt#2893

This patch also introduces the `--check-path` flag in `inspect.go` to carry out the test.
@alepuccetti
Copy link
Contributor Author

Patch updated, not sure if error is related

@iaguis
Copy link
Member

iaguis commented Jul 19, 2016

It seems to be #2943

@iaguis iaguis added this to the v1.11.0 milestone Jul 19, 2016
@iaguis
Copy link
Member

iaguis commented Jul 19, 2016

LGTM

@iaguis iaguis merged commit 2f10a30 into rkt:master Jul 19, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement test for newline char at the end of environment variables
3 participants