Re: /dev/console should it always be available?

From: Theodore Y. Ts'o (tytso@MIT.EDU)
Date: Sat Feb 26 2000 - 16:18:41 EST


   Date: Sat, 26 Feb 2000 21:08:33 +0100
   From: Guest section DW <dwguest@win.tue.nl>

   You need to watch out for the problem that programs print messages to
   stdout or stderr without checking first whether fd 0, 1, 2 actually were
   open when the program was started. If some init variant opens /dev/console,
   and dups the fd twice to get 0,1,2 all will be fine with a console, but
   without a console programs may be called without good stdout and stderr.
   If now mount or e2fsck or some other program opens a disk device, and
   later prints something it may be printed to your disk instead of screen.

I don't know about mount, but e2fsck has had defensive coding to prevent
exactly this problem since version 1.13.

                                                        - Ted

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Feb 29 2000 - 21:00:15 EST