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:
parent
b586c35303
commit
f86d4f1992
11
src/work.cpp
11
src/work.cpp
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue
Block a user