]> granicus.if.org Git - sudo/commitdiff
Re-enable cleanup functions in sudoers plugin and sudo driver
authorTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 28 May 2010 16:15:14 +0000 (12:15 -0400)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 28 May 2010 16:15:14 +0000 (12:15 -0400)
for error()/errorx().

plugins/sudoers/sudoers.c
src/exec.c
src/sudo.c

index 1c5fd9eee20ccd8c9b5fe4e78a4d3477fc27ea56..da7d15f1f64ed24290a00d44f16616b42c2e7ca0 100644 (file)
@@ -1144,11 +1144,6 @@ cleanup(int gotsignal)
        sudo_endpwent();
        sudo_endgrent();
     }
-#ifdef notyet
-    /* XXX */
-    if (def_transcript)
-       term_restore(STDIN_FILENO, 0);
-#endif
 }
 
 static int
index 7771a22178d5db52f2e976433f6023136aa5128d..ccea358fec5bc3e14426e571f4275cbdf0d81ed6 100644 (file)
@@ -149,6 +149,16 @@ pty_setup(uid_t uid)
     }
 }
 
+/*
+ * Cleanup hook for error()/errorx()
+ */
+void
+cleanup(int gotsignal)
+{
+    if (!tq_empty(&io_plugins))
+       term_restore(io_fds[SFD_USERTTY], 0);
+}
+
 /* Call I/O plugin tty input log method. */
 static int
 log_ttyin(char *buf, unsigned int n)
index fa7bed999becb388f7daccca3fa9a97127071f96..13df141179c7c169d90a372ab018136081d1c0b5 100644 (file)
@@ -625,30 +625,6 @@ disable_coredumps(void)
 #endif /* RLIMIT_CORE && !SUDO_DEVEL */
 }
 
-/*
- * Cleanup hook for error()/errorx()
- */
-void
-cleanup(int gotsignal)
-{
-#if 0 /* XXX */
-    struct sudo_nss *nss;
-
-    if (!gotsignal) {
-       if (snl != NULL) {
-           tq_foreach_fwd(snl, nss)
-               nss->close(nss);
-       }
-       sudo_endpwent();
-       sudo_endgrent();
-    }
-#ifdef _PATH_SUDO_TRANSCRIPT
-    if (def_transcript)
-       term_restore(STDIN_FILENO, 0);
-#endif
-#endif
-}
-
 /*
  * Setup the execution environment immediately prior to the call to execve()
  * Returns TRUE on success and FALSE on failure.