2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-31 06:15:37 +00:00

Add plugin_setjmp() wrapper for siglongjmp(error_jmp, 1) so we don't

need error_jmp to be extern.  Also add plugin_clearjmp() that clears
a flag so error()/errorx() knows when to call exit() vs. longjmp().
This commit is contained in:
Todd C. Miller
2012-11-25 09:34:26 -05:00
parent d658d12195
commit 5496ffe1e8
6 changed files with 49 additions and 24 deletions

View File

@@ -231,7 +231,7 @@ sudoers_policy_main(int argc, char * const argv[], int pwflag, char *env_add[],
(void) sigaction(SIGTSTP, &sa, &saved_sa_tstp);
/* XXX - would like to move this to policy.c but need the cleanup. */
if (sigsetjmp(error_jmp, 1)) {
if (plugin_setjmp() != 0) {
/* error recovery via error(), errorx() or log_fatal() */
rval = -1;
goto done;
@@ -522,6 +522,7 @@ bad:
rval = false;
done:
plugin_clearjmp();
rewind_perms();
/* Restore signal handlers before we exec. */