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

Revert "Option --assume-execute-permission"

This reverts commit 4484acf9d6.
This commit is contained in:
Markus F.X.J. Oberhumer 2020-01-08 05:38:19 +01:00
parent 643e48efd7
commit 849bdd87e1
3 changed files with 3 additions and 7 deletions

View File

@ -872,9 +872,6 @@ static int do_option(int optc, const char *arg)
case 677:
opt->o_unix.force_pie = true;
break;
case 678:
opt->o_unix.assume_execute_permission = true;
break;
case '\0':
return -1;
@ -1027,7 +1024,6 @@ static const struct mfx_option longopts[] =
{"preserve-build-id", 0, 0, 675},
{"android-shlib", 0, 0, 676},
{"force-pie", 0, 0, 677},
{"assume-execute-permission", 0, 0, 678},
// watcom/le
{"le", 0x10, 0, 620}, // produce LE output
// win32/pe

View File

@ -148,7 +148,6 @@ struct options_t {
bool preserve_build_id; // copy the build-id to the compressed binary
bool android_shlib; // keep some ElfXX_Shdr for dlopen()
bool force_pie; // choose DF_1_PIE instead of is_shlib
bool assume_execute_permission; // do not check .st_mode for S_IXUSR
} o_unix;
struct {
bool le;

View File

@ -68,10 +68,11 @@ bool PackUnix::canPack()
if (exetype == 0)
return false;
#if defined(__unix__) && !defined(__MSYS2__)
// must be executable by owner
if (!opt->o_unix.assume_execute_permission // benefits __MSYS2__
&& (fi->st.st_mode & S_IXUSR) == 0)
if ((fi->st.st_mode & S_IXUSR) == 0)
throwCantPack("file not executable; try 'chmod +x'");
#endif
if (file_size < 4096)
throwCantPack("file is too small");