[Debconf-devel] Teletype bug?

Colin Watson cjwatson at debian.org
Thu Nov 22 22:59:32 UTC 2007


I saw this bug:

  https://bugs.launchpad.net/ubuntu/+source/debconf/+bug/130519

... and I think it's because the Teletype frontend leaves need_tty set
to true but doesn't bail out if there's no controlling tty. Is that
correct? Is this patch (copied and pasted from Readline) the right fix?
Just wanted to check I hadn't misunderstood Teletype.

Index: Debconf/FrontEnd/Teletype.pm
===================================================================
--- Debconf/FrontEnd/Teletype.pm	(revision 2248)
+++ Debconf/FrontEnd/Teletype.pm	(working copy)
@@ -38,6 +38,11 @@
 	my $this=shift;
 
 	$this->SUPER::init(@_);
+
+	# Yeah, you need a controlling tty. Make sure there is one.
+	open(TESTTY, "/dev/tty") || die gettext("This frontend requires a controlling tty.")."\n";
+	close TESTTY;
+
 	$this->interactive(1);
 	$this->linecount(0);
 }

Thanks,

-- 
Colin Watson                                       [cjwatson at debian.org]



More information about the Debconf-devel mailing list