[Pkg-shadow-devel] Bug#628843: login: tty hijacking - suggested solution inclusive patch + fix

Wolfgang Zarre lkdev at essax.com
Sat Mar 30 12:24:14 UTC 2013


Hello,

I'm adding a small fix to the suggested patch before just to avoid
messages on stderr if case of not having a controlling tty:



___BEGIN_PATCH___
--- shadow-4.1.5.1.orig/src/su.c	2013-03-29 21:52:11.930790904 +0100
+++ shadow-4.1.5.1/src/su.c	2013-03-30 13:03:49.813030646 +0100
@@ -356,7 +356,7 @@ static void prepare_close_session (void)
 	/* This avoids the callee to inject commands on
 	 * the caller's tty including srappy incidents. */
 	ret = ioctl( STDIN_FILENO, TCFLSH, TCIFLUSH);
-	if( ret == -1)
+	if( ret == -1 && errno != ENOTTY)
 		fprintf (stderr, _("%s: Flushing input: %s\n"), Prog, strerror( errno));

 	if (0 != caught) {
___END_PATCH___




with best regards

Wolf



More information about the Pkg-shadow-devel mailing list