]> granicus.if.org Git - sudo/commitdiff
Call cleanup() before exit in log_error() instead of calling
authorTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 17 Dec 2007 12:28:51 +0000 (12:28 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 17 Dec 2007 12:28:51 +0000 (12:28 +0000)
sudo_ldap_close() directly.  ldap_conn can now be static to sudo.c

logging.c
sudo.c
sudo.h

index 7f5070b13a6fcd1621f61694a8c49712b3427b3f..b697b7179a14319ba1267471b0d8aeca0475c394 100644 (file)
--- a/logging.c
+++ b/logging.c
@@ -394,10 +394,7 @@ log_error(flags, fmt, va_alist)
        efree(logline);
 
     if (!ISSET(flags, NO_EXIT)) {
-#ifdef HAVE_LDAP
-       if (ldap_conn != NULL)
-           sudo_ldap_close(ldap_conn);
-#endif
+       cleanup(0);
        exit(1);
     }
 }
diff --git a/sudo.c b/sudo.c
index 79aa7a955406ee692d8c4946f906d6720c3b8f5d..6406d85ec5cc27a30cf728692595cfc4f5637c64 100644 (file)
--- a/sudo.c
+++ b/sudo.c
@@ -150,7 +150,7 @@ char *login_style;
 sigaction_t saved_sa_int, saved_sa_quit, saved_sa_tstp, saved_sa_chld;
 static char *runas_user;
 static char *runas_group;
-void *ldap_conn;
+static void *ldap_conn;
 
 int
 main(argc, argv, envp)
diff --git a/sudo.h b/sudo.h
index 7d854a4dd3d7ce8e6eb2e5d4bc9856a1311553b4..52a4f94d8e8327a76cc65e23a6c72b8e163add4d 100644 (file)
--- a/sudo.h
+++ b/sudo.h
@@ -292,7 +292,6 @@ extern struct passwd *auth_pw, *list_pw;
 
 extern int tgetpass_flags;
 extern uid_t timestamp_uid;
-extern void *ldap_conn;
 #endif
 #ifndef errno
 extern int errno;