🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.bugs.4bsd
Article #62

rshd depends on risky assumption

#62
From: Doug Gwyn
Date: Wed, 23 Aug 1989 07:18
14 lines
1178 bytes
The 4.3BSD rshd (normally in its child branch) unconditionally closes an FD
named "f" in the source code without checking whether f = 0, 1, or 2.  If
inetd always starts the slave process with all three FDs open, this will work,
but it seems an unsafe assumption.  (Only FD 0 is documented as being set up
by inetd.)  There's no particular reason FD "f" shouldn't have been closed
back where the dup2(f,*)s occur, being careful not to close(f) unless f > 2.

By the way, to anyone who studies the rsh/rshd implementation, it should be
apparent that it would be really useful to have a way to ask the kernel to
"pump" data from one socket into another, instead of having to spawn a child
process to do the pumping.  With the kernel doing it, there would be far fewer
context switches.

Yours for improved plumbing...
Technical Details
Message-ID: <10803@smoke.BRL.MIL>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!ginosko!ctrsol!cica!iuvax!purdue!haven!adm!smoke!gwyn

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!ginosko!ctrsol!cica!iuvax!purdue!haven!adm!smoke!gwyn
From: gwyn@smoke.BRL.MIL (Doug Gwyn)
Newsgroups: comp.bugs.4bsd
Subject: rshd depends on risky assumption
Keywords: 4.3BSD rshd bug
Message-ID: <10803@smoke.BRL.MIL>
Date: 23 Aug 89 07:18:43 GMT
Organization: Ballistic Research Lab (BRL), APG, MD.
Lines: 14