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 小時 新手友好度 62/100
builtbybel/CrapFixer#112 ·
-
area-ai untriaged
難度 2/5 1-3 小時 新手友好度 85/100
dotnet/extensions#7790 ·
維護者通常 1 天內回覆
-
Beginner Friendly T: Bugfix
難度 2/5 1-3 小時 新手友好度 82/100
space-wizards/space-station-14#46220 ·
維護者通常 1 天內回覆
-
P2 testing
難度 1/5 1 小時以內 新手友好度 90/100
維護者通常 1 天內回覆
-
area-Infrastructure-coreclr os-ios os-maccatalyst os-tvos untriaged
難度 2/5 1-3 小時 新手友好度 78/100
dotnet/runtime#134766 · 3 則留言 ·
維護者通常 1 天內回覆