Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!uunet!viusys!uxui!unislc!harem!wes From: wes@harem.clydeunix.com (Wes Peters) Newsgroups: comp.unix.wizards Subject: Re: BSD tty security, part 3: How to Fix It Summary: Write rejecting piped input? Message-ID: <235@harem.clydeunix.com> Date: 2 May 91 18:55:27 GMT References: <7299:Apr2510:22:2091@kramden.acf.nyu.edu> <12535@dog.ee.lbl.gov> <73525@eerie.acsu.Buffalo.EDU> Organization: Raxco, Inc., Orem, UT Lines: 23 In article <15896:Apr2714:35:3991@kramden.acf.nyu.edu> brnstnd@kramden.acf.nyu.edu (Dan Bernstein) writes: > 3. Do people think it's a problem that ``write'' can flood a terminal > with output before the recipient has a chance to react? My version > limits output to 500 characters per line and one line a second. Does > anyone think that this affects legitimate uses of ``write''? If not, is > there any harm in adding the protection against accidents and abuse? I think write should reject any input not from a terminal: if (!isatty(fileno(stdin))) { fprintf(stderr, "write: input must be a terminal!\n"); exit(-1); } I know this will take care of 'cat longfile | write sucker', but does it also take care of a 'here is' document (i.e. shell << document)? Wes Peters -- #include The worst day sailing My opinions, your screen. is much better than Raxco had nothing to do with this! the best day at work. Wes Peters: wes@harem.clydeunix.com ...!sun!unislc!harem!wes