FastZip.CreateZip crashes when used with certain buggy Directory enumeration on .NET 5
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 25/100
Direzione di ricerca
Inizia in FastZip.cs, intorno alla riga indicata, e verifica come CreateZip utilizza FileSystemScanner. Esamina il punto di estensione richiesto e la soluzione alternativa fornita per l'enumerazione, quindi conferma che un chiamante può fornire uno scanner personalizzato per il caso .NET 5 descritto senza che FastZip.CreateZip fallisca.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- C#
- Stelle
- 3.9k
- Fork
- 1k
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di icsharpcode/SharpZipLib
-
*no response* bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
icsharpcode/SharpZipLib#905 · 1 commento ·
-
bug bzip2
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
icsharpcode/SharpZipLib#904 ·
-
SetLevel in ZipFileApertaenhancement zip
Difficoltà 2/5 1-2 giorni Idoneità per principianti 55/100
icsharpcode/SharpZipLib#903 ·
-
*no response* bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 32/100
icsharpcode/SharpZipLib#901 · 1 commento ·
-
*no response* bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
icsharpcode/SharpZipLib#894 · 1 commento ·
Tutte le issue di icsharpcode/SharpZipLib
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
fluentassertions/fluentassertions#3353 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
Difficoltà 2/5 Mezza giornata Idoneità per principianti 78/100
unoplatform/uno#24769 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
AvaloniaUI/Avalonia#22323 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
microsoft/onnxruntime-genai#2633 ·
I maintainer di solito rispondono entro 1 giorno