lzmadec icon indicating copy to clipboard operation
lzmadec copied to clipboard

7z binary failing doesn't result in go error

Open lalaithion opened this issue 3 years ago • 0 comments

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.

lalaithion avatar Jan 07 '22 22:01 lalaithion