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:
@@ -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. */
|
||||
|
Reference in New Issue
Block a user