Call cleanup() before exit in log_error() instead of calling

sudo_ldap_close() directly.  ldap_conn can now be static to sudo.c
This commit is contained in:
Todd C. Miller
2007-12-17 12:28:51 +00:00
parent ed88a812ec
commit ff0a538d04
3 changed files with 2 additions and 6 deletions

View File

@@ -394,10 +394,7 @@ log_error(flags, fmt, va_alist)
efree(logline); efree(logline);
if (!ISSET(flags, NO_EXIT)) { if (!ISSET(flags, NO_EXIT)) {
#ifdef HAVE_LDAP cleanup(0);
if (ldap_conn != NULL)
sudo_ldap_close(ldap_conn);
#endif
exit(1); exit(1);
} }
} }

2
sudo.c
View File

@@ -150,7 +150,7 @@ char *login_style;
sigaction_t saved_sa_int, saved_sa_quit, saved_sa_tstp, saved_sa_chld; sigaction_t saved_sa_int, saved_sa_quit, saved_sa_tstp, saved_sa_chld;
static char *runas_user; static char *runas_user;
static char *runas_group; static char *runas_group;
void *ldap_conn; static void *ldap_conn;
int int
main(argc, argv, envp) main(argc, argv, envp)

1
sudo.h
View File

@@ -292,7 +292,6 @@ extern struct passwd *auth_pw, *list_pw;
extern int tgetpass_flags; extern int tgetpass_flags;
extern uid_t timestamp_uid; extern uid_t timestamp_uid;
extern void *ldap_conn;
#endif #endif
#ifndef errno #ifndef errno
extern int errno; extern int errno;