Do not allow the same callback function to be registered more that

once in fatal_callback_register().
Add fatal_callback_deregister() to deregister a callback.
This commit is contained in:
Todd C. Miller
2014-05-12 11:45:17 -06:00
parent 2e3fbaa2c5
commit ffb07443c3
3 changed files with 37 additions and 0 deletions

View File

@@ -576,6 +576,9 @@ sudoers_policy_close(int exit_status, int error_code)
if (ISSET(sudo_mode, MODE_RUN|MODE_EDIT))
(void)sudo_auth_end_session(runas_pw);
/* Deregister the callback for fatal()/fatalx(). */
fatal_callback_deregister(sudoers_cleanup);
/* Free remaining references to password and group entries. */
/* XXX - move cleanup to function in sudoers.c */
sudo_pw_delref(sudo_user.pw);