1
0
mirror of https://github.com/upx/upx synced 2025-09-28 19:06:07 +08:00

Don't compress write protected files unless we make a backup.

committer: mfx <mfx> 974485024 +0000
This commit is contained in:
Markus F.X.J. Oberhumer 2000-11-17 18:17:04 +00:00
parent b586c35303
commit f86d4f1992

View File

@ -75,6 +75,17 @@ void do_one_file(const char *iname, char *oname)
#endif
if (st.st_size <= 0)
throwIOException("empty file -- skipped");
if ((st.st_mode & S_IWUSR) == 0)
{
if (opt->output_name)
nop;
else if (opt->to_stdout)
nop;
else if (opt->backup)
nop;
else
throwIOException("file is write protected -- skipped");
}
InputFile fi;
fi.st = st;