prevents MCKERNEL_RLIMIT_STACK from overwriting
When mcexec reduces a stack, mcexec stores the original RLIMIT_STACK in environment variable MCKERNEL_RLIMIT_STACK. A fix to prohibit overwrite of this time. Therefore, the value of RLIMIT_STACK of the McKernel's process is decided in the following order. (1) If environment variable MCKERNEL_RLIMIT_STACK exists; the value. (2) A value of RLIMIT_STACK in the mcexec starting.
This commit is contained in:
@ -491,8 +491,8 @@ static int reduce_stack(struct rlimit *orig_rlim, char *argv[])
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define ALLOW_OVERWRITE 1
|
#define DO_NOT_OVERWRITE 0
|
||||||
error = setenv(rlimit_stack_envname, newval, ALLOW_OVERWRITE);
|
error = setenv(rlimit_stack_envname, newval, DO_NOT_OVERWRITE);
|
||||||
if (error) {
|
if (error) {
|
||||||
__eprintf("failed to setenv(%s)\n", rlimit_stack_envname);
|
__eprintf("failed to setenv(%s)\n", rlimit_stack_envname);
|
||||||
return 1;
|
return 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user