char **NewArgv = NULL;
struct sudo_user sudo_user;
FILE *sudoers_fp = NULL;
-static char *runas_homedir = NULL; /* XXX */
struct interface *interfaces;
int num_interfaces;
int tgetpass_flags;
extern int errorlineno;
+static char *runas_homedir = NULL; /* XXX */
+#if defined(RLIMIT_CORE) && !defined(SUDO_DEVEL)
+static struct rlimit corelimit;
+#endif /* RLIMIT_CORE */
/*
* Table of "bad" envariables to remove and len for strncmp()
exit(0);
}
- /* Become specified user or root. */
- set_perms(PERM_RUNAS, sudo_mode);
-
/* Set $HOME for `sudo -H' */
if ((sudo_mode & MODE_RESET_HOME) && runas_homedir)
(void) sudo_setenv("HOME", runas_homedir);
exit(1);
}
+ /* Restore coredumpsize resource limit. */
+#if defined(RLIMIT_CORE) && !defined(SUDO_DEVEL)
+ (void) setrlimit(RLIMIT_CORE, &corelimit);
+#endif /* RLIMIT_CORE */
+
+ /* Become specified user or root. */
+ set_perms(PERM_RUNAS, sudo_mode);
+
#ifndef PROFILING
if ((sudo_mode & MODE_BACKGROUND) && fork() > 0)
exit(0);
/*
* Turn off core dumps.
*/
+ (void) getrlimit(RLIMIT_CORE, &corelimit);
rl.rlim_cur = rl.rlim_max = 0;
(void) setrlimit(RLIMIT_CORE, &rl);
#endif /* RLIMIT_CORE */