Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!ames!husc6!seismo!mcnc!duke!ndd From: ndd@duke.UUCP Newsgroups: comp.unix.wizards Subject: Re: Two process communication programs Message-ID: <9746@duke.cs.duke.edu> Date: Sat, 6-Jun-87 09:22:31 EDT Article-I.D.: duke.9746 Posted: Sat Jun 6 09:22:31 1987 Date-Received: Sun, 7-Jun-87 03:24:40 EDT References: <2071@emory.UUCP> Reply-To: ndd@duke.UUCP (Ned D. Danieley) Organization: Duke University, Durham NC Lines: 31 In article <2071@emory.UUCP> km@emory.UUCP (Ken Mandelberg) writes: >Most of the communications programs on Berkeley Unix (tip, rlogin, cu) >are split into two two processes on the local side, a reader and >writer. This makes sense to me in a System V environment with no >"select" system call. But why the extra process in tip and rlogin, >which are relatively recent and written just for BSD? >-- >Ken Mandelberg | {akgua,sb1,gatech}!emory!km USENET >Emory University | km@emory CSNET,BITNET >Dept of Math and CS | km.emory@csnet-relay ARPANET >Atlanta, Ga 30322 | Phone: (404) 727-7963 Tip is not relatively recent: it was certainly available around 1980 on the V7 system I was using at the time. Perhaps no one has rewritten it since. And, depending on what you are using, tip may not involve just two processes. I remember installing a security feature for tip that I got from the net. The problem was that tip made a lock file in /usr/spool/uucp, and then forked once to do the communicating. Unfortunately, you had to leave tip running as uucp so it could remove the lock, which meant that a user who did a shell escape would have uucp privileges. The hack was to fork two processes: one for the read and one for the write; they would reset to the user's id, and the parent would wait until they terminated, and then remove the lock. In retrospect, it seems as if this could have been handled without the extra process, but I thought it was a neat trick at the time. Ned Danieley Basic Arrhythmia Laboratory Duke University Medical Center