Include setjmp.h in sudoers.h

Move error_jmp into plugin_error.c
Rename sudoers_plugin_cleanup sudoers_cleanup
Make sudoers warning/error functions work when sudo_conv is NULL
This commit is contained in:
Todd C. Miller
2012-11-25 09:33:33 -05:00
parent 3b5f786994
commit 3e5bd8dc52
6 changed files with 70 additions and 46 deletions

View File

@@ -71,7 +71,6 @@
# include <selinux/selinux.h>
#endif
#include <ctype.h>
#include <setjmp.h>
#ifndef HAVE_GETADDRINFO
# include "compat/getaddrinfo.h"
#endif
@@ -120,9 +119,6 @@ static struct sudo_nss_list *snl;
int NewArgc;
char **NewArgv;
/* Declared here instead of plugin_error.c for static sudo builds. */
sigjmp_buf error_jmp;
int
sudoers_policy_init(void *info, char * const envp[])
{
@@ -905,12 +901,12 @@ cb_runas_default(const char *user)
* Cleanup hook for error()/errorx()
*/
void
sudoers_plugin_cleanup(int gotsignal)
sudoers_cleanup(int gotsignal)
{
struct sudo_nss *nss;
if (!gotsignal) {
debug_decl(sudoers_plugin_cleanup, SUDO_DEBUG_PLUGIN)
debug_decl(sudoers_cleanup, SUDO_DEBUG_PLUGIN)
if (snl != NULL) {
tq_foreach_fwd(snl, nss)
nss->close(nss);