pan3793 commented on code in PR #7542:
URL: https://github.com/apache/kyuubi/pull/7542#discussion_r3526070542
##########
kyuubi-common/src/main/scala/org/apache/kyuubi/Utils.scala:
##########
Review Comment:
`mkdirs` runs before validation, so a failed check leaves an empty directory
behind.
##########
kyuubi-common/src/main/scala/org/apache/kyuubi/Utils.scala:
##########
@@ -229,6 +229,10 @@ object Utils extends Logging {
val currentTime = new SimpleDateFormat("yyyyMMddHHmmss").format(new
Date())
val identifier = s"$currentTime-${tempFileIdCounter.incrementAndGet()}"
val filePath = Paths.get(dir.toString, s"$prefix-$identifier$suffix")
+ if (!filePath.normalize().startsWith(dir.normalize())) {
+ throw new IOException(
Review Comment:
`source` leaks if it goes here
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]