gnodet-bot commented on code in PR #13487:
URL: https://github.com/apache/maven/pull/13487#discussion_r4267368844


##########
apache-maven/src/assembly/maven/bin/mvn:
##########
@@ -66,6 +66,26 @@ if $cygwin || $mingw ; then
   fi
 fi
 
+# A cygpath(1) from an unrelated POSIX emulation layer (e.g. the one shipped in
+# an Anaconda installation) can be found on the PATH first. It re-roots every
+# POSIX path under its own installation prefix, so all converted values point 
to
+# non-existing directories and the JVM dies with a bare ClassNotFoundException.
+# cygpath can convert relative paths too, but the current directory is the only
+# path that is known to exist at this point: verify that its Windows form can 
be
+# found on disk before trusting any of the later conversions.
+if $cygwin || $mingw ; then
+  _cygpath_bin=`( \unset -f command; \command -v cygpath )` || _cygpath_bin=
+  _probe_win=`cygpath --windows "$PWD"` || _probe_win=

Review Comment:
   💡 **Minor:** `cygpath` on this line is called without the `\` bypass prefix, 
unlike `\command -v cygpath` on the line above. If a shell function named 
`cygpath` were in scope, this would invoke the function rather than the binary.
   
   Not a regression — the rest of the script is consistent with this pattern 
(e.g. lines 108, 256, 278-283). Just worth noting if hardening ever comes up.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to