From a80d11cde5b153b0a820f1ce354943dd9669200c Mon Sep 17 00:00:00 2001 From: NAKAMURA Gou Date: Wed, 30 Oct 2013 12:22:51 +0900 Subject: [PATCH] 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. --- executer/user/mcexec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/executer/user/mcexec.c b/executer/user/mcexec.c index 45ea5a83..939735fa 100644 --- a/executer/user/mcexec.c +++ b/executer/user/mcexec.c @@ -491,8 +491,8 @@ static int reduce_stack(struct rlimit *orig_rlim, char *argv[]) return 1; } -#define ALLOW_OVERWRITE 1 - error = setenv(rlimit_stack_envname, newval, ALLOW_OVERWRITE); +#define DO_NOT_OVERWRITE 0 + error = setenv(rlimit_stack_envname, newval, DO_NOT_OVERWRITE); if (error) { __eprintf("failed to setenv(%s)\n", rlimit_stack_envname); return 1;