FastZip.CreateZip crashes when used with certain buggy Directory enumeration on .NET 5
还没有人认领这个 Issue。
评估
调研方向
从引用的行附近开始检查 FastZip.cs,并查看 CreateZip 如何使用 FileSystemScanner。检查所请求的扩展点和提供的枚举变通方案,然后确认调用方可以针对所描述的 .NET 5 情况提供自定义 scanner,而不会导致 FastZip.CreateZip 失败。
由索引模型根据 Issue 内容生成。
描述
Not really a bug, more like a feature suggestion.
Steps to reproduce
- In .net 5, directory enumeration has bugs with WebDav (https://github.com/dotnet/runtime/issues/46723#issuecomment-928090089), not fixed in .net 6 and with no other immediate official solution in sight;
- This causes crashes when calling
FastZip.CreateZipas the GetDirectories/GetFiles return invalid data; - A workaround is available - use something like this on the GetDirectories-returned data:
public static string[] FixupNet5Enumeration(string[] items)
{
return items
.Select(t => t.TrimEnd('\0'))
.Where(t => {
var itemName = Path.GetFileName(t);
return itemName != "." && itemName != "..";
})
.ToArray();
}
- SharpZipLib nicely wraps the
Directory.GetDirectoriescall into theFileSystemScannerclass. However it is not possible to supply customFileSystemScanners toFastZip.CreateZip. It would be helpful in this case as I could just copy that class and insert the required fixup calls. It would be necessary to create an interface aroundFileSystemScannerand to change topublicthe method
What do you think?
Expected behavior
FastZip.CreateZip should offer an override to specify custom FileSystemScanners.
Actual behavior
FastZip.CreateZip throws exception as the paths returned by Directory.GetDirectories are not valid paths.
Version of SharpZipLib
1.3.3
Obtained from (only keep the relevant lines)
- Package installed using NuGet
- 主要语言
- C#
- 星标
- 3.9k
- 派生
- 1k
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
icsharpcode/SharpZipLib 的其他 Issue
-
*no response* bug
难度 1/5 1 小时以内 新手友好度 78/100
icsharpcode/SharpZipLib#905 · 1 条评论 ·
-
bug bzip2
难度 4/5 3-5 天 新手友好度 45/100
icsharpcode/SharpZipLib#904 ·
-
enhancement zip
难度 2/5 1-2 天 新手友好度 55/100
icsharpcode/SharpZipLib#903 ·
-
*no response* bug
难度 4/5 3-5 天 新手友好度 32/100
icsharpcode/SharpZipLib#901 · 1 条评论 ·
-
*no response* bug
难度 4/5 3-5 天 新手友好度 35/100
icsharpcode/SharpZipLib#894 · 1 条评论 ·
查看 icsharpcode/SharpZipLib 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 88/100
microsoft/onnxruntime-genai#2633 ·
维护者通常 1 天内回复
-
python triage
难度 2/5 1-3 小时 新手友好度 85/100
microsoft/semantic-kernel#14491 ·
维护者通常 2 天内回复
-
area:jobads-cv FE mvp P3
难度 2/5 1-3 小时 新手友好度 88/100
klasolsson81/jobbliggaren#1878 ·
维护者通常 1 天内回复
-
bug help wanted
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
SubtitleEdit/subtitleedit#15331 · 2 条评论 ·
维护者通常 1 天内回复