Password zip is inconsisent
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 25/100
Direzione di ricerca
Inizia con il metodo CreateBackup fornito, in particolare con ZipOutputStream.Password e AESKeySize, e riproduci con 7zip il comportamento delle password di 98 caratteri rispetto a quelle di 99 caratteri. Confronta il comportamento dell’archivio generato e determina se le password lunghe dovrebbero funzionare; il lavoro è completato quando il comportamento è riproducibile e il risultato è corretto o chiaramente documentato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Describe the bug
Only passwords with length up to 98 seem to work, if i use 99 and i even copy/paste the password directly unzipping the archive using 7zip does not work. how come?
Seems a bit random and not sure if it would be safe for db backups in this case.
private static async Task CreateBackup(string zipFile, string pgDumpArgs)
{
ProcessStartInfo processInfo = new()
{
FileName = @"C:\Program Files\PostgreSQL\16\bin\pg_dump.exe",
Arguments = pgDumpArgs,
RedirectStandardOutput = true,
RedirectStandardError = true, // Capture error output
UseShellExecute = false,
CreateNoWindow = true
};
using Process process = Process.Start(processInfo);
if (process == null)
{
Console.WriteLine("Failed to start pg_dump process.");
return;
}
using (FileStream fsOut = File.Create(zipFile))
using (ZipOutputStream zipStream = new(fsOut))
{
zipStream.SetLevel(3); // 0-9, 9 being the highest level of compression
zipStream.Password = "z4KpjH+}H9H*g3K3Jb-9}M^jnMN^-!Zs+8UZ3sfxWg5T~@ZHJ:Eoz!AFNMwdf!g_2QpX#)}4WKwHLL%C?s1BB*wx%:cia0j=m7.W";
zipStream.UseZip64 = UseZip64.On; // Set to AsNeeded if you need Zip64
ZipEntry newEntry = new ZipEntry($"backup_{DateTime.Now:yyyyMMdd_HHmmss}.backup")
{
DateTime = DateTime.Now,
AESKeySize = 256 // AES-256 encryption
};
zipStream.PutNextEntry(newEntry);
var outputTask = process.StandardOutput.BaseStream.CopyToAsync(zipStream);
var errorTask = process.StandardError.ReadToEndAsync();
await Task.WhenAll(outputTask, errorTask);
zipStream.CloseEntry();
string errorOutput = await errorTask;
if (!string.IsNullOrEmpty(errorOutput))
{
Console.WriteLine($"pg_dump reported the following errors:\n{errorOutput}");
}
}
await process.WaitForExitAsync();
if (process.ExitCode != 0)
{
Console.WriteLine($"pg_dump failed with exit code {process.ExitCode}");
}
else
{
Console.WriteLine($"{zipFile} Database backup successfully completed.");
}
}
Reproduction Code
No response
Steps to reproduce
zip zip
Expected behavior
work
Operating System
Windows
Framework Version
Other
Tags
No response
Additional context
No response
- 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 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
-
FluentDataGrid: pinned column offsets leak into the grid of an open RowDetails (master-detail)ApertaNot reproducible
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
microsoft/fluentui-blazor#5350 · 4 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
python triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
microsoft/semantic-kernel#14491 ·
I maintainer di solito rispondono entro 2 giorni
-
area:jobads-cv FE mvp P3
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
klasolsson81/jobbliggaren#1878 ·
I maintainer di solito rispondono entro 1 giorno