Skip to content

Commit

Permalink
Guard Against Empty $CLASSPATH
Browse files Browse the repository at this point in the history
Previously, the classpath linking script would only guard against $CLASSPATH
not being set.  This could result in an empty value creating an invalid (and
possibly security vulnerable) ln command.  This change updates the guard to
also return early if the env var is set but empty.

[#2]

Signed-off-by: Ben Hale <[email protected]>
  • Loading branch information
nebhale committed May 26, 2020
1 parent bd3057f commit f4541dc
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tomcat/base_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ printf "Tomcat Access Logging enabled\n"
export JAVA_OPTS="${JAVA_OPTS} -Daccess.logging.enabled=true"
`))
Expect(layer.Profile["classpath.sh"]).To(Equal(fmt.Sprintf(`[[ -z "${CLASSPATH+x}" ]] && return
Expect(layer.Profile["classpath.sh"]).To(Equal(fmt.Sprintf(`[[ -z "${CLASSPATH}" ]] && return
printf "Linking \${CLASSPATH} entries to %%s\n" "%[1]s"
Expand Down
2 changes: 1 addition & 1 deletion tomcat/classpath.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[[ -z "${CLASSPATH+x}" ]] && return
[[ -z "${CLASSPATH}" ]] && return

printf "Linking \${CLASSPATH} entries to %s\n" "{{.path}}"

Expand Down
2 changes: 1 addition & 1 deletion tomcat/statik/statik.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f4541dc

Please sign in to comment.