mtrojnar / osslsigncode

OpenSSL based Authenticode signing for PE/MSI/Java CAB files
Other
778 stars 131 forks source link

Delete the output file in case of error #315

Closed olszomal closed 10 months ago

olszomal commented 11 months ago

Fix #313

mtrojnar commented 11 months ago

Won't it delete the input file if the input file and the output file are the same?

olszomal commented 11 months ago

If the input file and the output file are the same, the program will fail to create the output file and will exit without deleting the file.

mtrojnar commented 11 months ago

If the input file and the output file are the same, the program will fail to create the output file and will exit without deleting the file.

Are you saying that it was not possible to replicate the bug described in #313? Could this issue be specific to a particular host operating system?

olszomal commented 11 months ago

The error:

Unrecognized file type - file is too short: <input file.exe>

says that the <input file.exe> input file may have previously been saved as a 0kb file.

I fixed the issue of leaving the output file as a 0kb file in case of error.

@Niaxor Could you take a look?

mtrojnar commented 11 months ago

On Windows, test.exe, TEST.EXE and .\test.exe are all the same file. I'd prefer osslsigncode to never overwrite an existing file regardless of its name.