execute elf add executable permissions check. (#7769)
This commit is contained in:
parent
fd3b432915
commit
2aa4510aa8
|
@ -1150,6 +1150,11 @@ pid_t lwp_execve(char *filename, int debug, int argc, char **argv, char **envp)
|
||||||
return -RT_ERROR;
|
return -RT_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (access(filename, X_OK) != 0)
|
||||||
|
{
|
||||||
|
return -EACCES;
|
||||||
|
}
|
||||||
|
|
||||||
lwp = lwp_new();
|
lwp = lwp_new();
|
||||||
|
|
||||||
if (lwp == RT_NULL)
|
if (lwp == RT_NULL)
|
||||||
|
|
|
@ -2246,6 +2246,11 @@ sysret_t sys_execve(const char *path, char *const argv[], char *const envp[])
|
||||||
int i;
|
int i;
|
||||||
struct lwp_args_info args_info;
|
struct lwp_args_info args_info;
|
||||||
|
|
||||||
|
if (access(path, X_OK) != 0)
|
||||||
|
{
|
||||||
|
return -EACCES;
|
||||||
|
}
|
||||||
|
|
||||||
lwp = lwp_self();
|
lwp = lwp_self();
|
||||||
thread = rt_thread_self();
|
thread = rt_thread_self();
|
||||||
uni_thread = 1;
|
uni_thread = 1;
|
||||||
|
|
Loading…
Reference in New Issue