修复Sftp递归删除目录时使用相对路径可能导致死循环的问题(pr#1380@Gitee)

This commit is contained in:
Looly 2025-09-27 19:46:11 +08:00
parent 0c6c959ee1
commit aa6b1332d5
2 changed files with 6 additions and 1 deletions

View File

@ -2,7 +2,7 @@
# 🚀Changelog
-------------------------------------------------------------------------------------------------------------
# 5.8.41(2025-09-24)
# 5.8.41(2025-09-27)
### 🐣新特性
* 【core 】 增加`WeakKeyValueConcurrentMap`及其关联类,同时废弃`WeakConcurrentMap`并替换issue#4039@Github
@ -30,6 +30,7 @@
* 【db 】 修复`NamedSql.replaceVar`关键字处理问题issue#4062@Github
* 【db 】 修复`DialectRunner.count`方法中去除包含多字段order by子句的SQL语句时错误问题issue#4066@Github
* 【extra 】 修复`JschSessionPool`并发问题pr#4079@Github
* 【extra 】 修复`Sftp`递归删除目录时使用相对路径可能导致死循环的问题pr#1380@Gitee
-------------------------------------------------------------------------------------------------------------
# 5.8.40(2025-08-26)

View File

@ -462,8 +462,12 @@ public class Sftp extends AbstractFtp {
fileName = entry.getFilename();
if (false == ".".equals(fileName) && false == "..".equals(fileName)) {
if (entry.getAttrs().isDir()) {
// pr#1380Gitee 当目录名包含特殊字符 \u000b会导致不断进入同一目录循环
// 此处强制使用绝对路径
delDir(dirPath + "/" + fileName);
} else {
// pr#1380Gitee 当目录名包含特殊字符 \u000b会导致不断进入同一目录循环
// 此处强制使用绝对路径
delFile(dirPath + "/" + fileName);
}
}