--- /dev/null
+diff -urN sudo-1.6.7p5.orig/sudo.c sudo-1.6.7p5/sudo.c
+--- sudo-1.6.7p5.orig/sudo.c 2004-01-02 02:14:13.276501694 +0100
++++ sudo-1.6.7p5/sudo.c 2004-01-02 02:13:56.354024051 +0100
+@@ -382,7 +382,7 @@
+ */
+
+
+- if( is_selinux_enabled() ) {
++ if( is_selinux_enabled() > 0 ) {
+
+ security_context_t context_s; /* our security context as a string */
+ int context_length;
+@@ -569,7 +569,7 @@
+ exit(0);
+ }
+ #ifdef WITH_SELINUX
+- if( is_selinux_enabled() ) {
++ if( is_selinux_enabled() > 0) {
+ /* Fork, allowing parent to clean up after shell has executed */
+ pid_t childPid=fork();
+ if( childPid<0 ) {
+@@ -581,6 +581,7 @@
+ /* PARENT */
+ wait(NULL);
+
++ if (tty_context) {
+ #ifdef CANTSPELLGDB
+ printf("Restoring tty %s back to SID %d\n", ttyn, tty_context);
+ #endif
+@@ -588,6 +589,7 @@
+ /* Cleanup TTY Context */
+ setfilecon(ttyn,tty_context);
+ freecon(tty_context);
++ }
+
+ /* Done! */
+ exit(0);