FastZip.CreateZip crashes when used with certain buggy Directory enumeration on .NET 5
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 25/100
Piste de recherche
Commencez dans FastZip.cs, autour de la ligne référencée, et examinez comment CreateZip utilise FileSystemScanner. Examinez le point d’extension demandé et la solution de contournement fournie pour l’énumération, puis confirmez qu’un appelant peut fournir un scanner personnalisé pour le cas .NET 5 décrit sans que FastZip.CreateZip échoue.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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
- Langage dominant
- C#
- Étoiles
- 3.9k
- Forks
- 1k
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Préparer son environnement
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de icsharpcode/SharpZipLib
-
*no response* bug
Difficulté 1/5 Moins d'une heure Accessibilité débutants 78/100
icsharpcode/SharpZipLib#905 · 1 commentaire ·
-
bug bzip2
Difficulté 4/5 3-5 jours Accessibilité débutants 45/100
icsharpcode/SharpZipLib#904 ·
-
SetLevel in ZipFileOuverteenhancement zip
Difficulté 2/5 1-2 jours Accessibilité débutants 55/100
icsharpcode/SharpZipLib#903 ·
-
*no response* bug
Difficulté 4/5 3-5 jours Accessibilité débutants 32/100
icsharpcode/SharpZipLib#901 · 1 commentaire ·
-
*no response* bug
Difficulté 4/5 3-5 jours Accessibilité débutants 35/100
icsharpcode/SharpZipLib#894 · 1 commentaire ·
Toutes les issues de icsharpcode/SharpZipLib
Issues similaires
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
AvaloniaUI/Avalonia#22323 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
microsoft/onnxruntime-genai#2633 ·
Les mainteneurs répondent en général sous 1 jour
-
FluentDataGrid: pinned column offsets leak into the grid of an open RowDetails (master-detail)OuverteNot reproducible
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
microsoft/fluentui-blazor#5350 · 4 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
python triage
Difficulté 2/5 1-3 heures Accessibilité débutants 85/100
microsoft/semantic-kernel#14491 ·
Les mainteneurs répondent en général sous 2 jours
-
area:jobads-cv FE mvp P3
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
klasolsson81/jobbliggaren#1878 ·
Les mainteneurs répondent en général sous 1 jour