Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!princeton!phoenix.Princeton.EDU!falstad!paul From: pfalstad@phoenix.princeton.edu (Paul Falstad) Newsgroups: comp.unix.wizards Subject: Re: BSD tty security, part 3: How to Fix It Message-ID: <67264@willbeavax.Princeton.EDU> Date: 4 May 91 23:32:55 GMT References: <12535@dog.ee.lbl.gov> <73525@eerie.acsu.Buffalo.EDU> <235@harem.clydeunix.com> Sender: gnus@idunno.Princeton.EDU Organization: League For Fighting Chartered Accountancy Lines: 17 wes@harem.clydeunix.com (Wes Peters) wrote: >I think write should reject any input not from a terminal: > if (!isatty(fileno(stdin))) { > fprintf(stderr, "write: input must be a terminal!\n"); >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)? Yes, but it doesn't take care of this: cat longfile | pty write sucker -- Paul Falstad pfalstad@phoenix.princeton.edu And on the roads, too, vicious gangs of KEEP LEFT signs! If Princeton knew my opinions, they'd have expelled me long ago.