lzmadec
lzmadec copied to clipboard
7z binary failing doesn't result in go error
If you have an encrypted archive with the wrong password, and call archive.GetFileReader(path) instead of giving an error in go, this code simply returns an empty reader.
At the very least, adding something like
stderr, err := cmd.StderrPipe()
if err != nil {
return nil, err
}
go io.Copy(os.Stderr, stderr)
allows someone looking at the process output to see that something is wrong.
I don't know why NewEncryptedArchive isn't returning an error on creation, but it isn't for me.