Created attachment 730431 [details] Patch to make rlogind work again by keeping slave file descriptor open Fedora 18, rsh-server-0.17-69.fc18 When rlogind is enabled, attempts to rlogin will result in one of two things happening (which one happens appears to be random): Either the connection gets closed right away ("rlogin: connection closed"), or the shell is invoked and receives keystrokes but nothing is echoed back (so no prompt or command output appears, making the rlogin process appear to be hung). The cause is a change that was made to /bin/login in the util-linux package, as described in lkml.org/lkml/2012/6/5/145 Rlogind has the following code: --------------------- pid = forkpty(&master, line, NULL, &win); ... if (pid == 0) { ... child(hname, termtype, lusername, authenticated, rusername); } ioctl(netfd, FIONBIO, &on); ioctl(master, FIONBIO, &on); ioctl(master, TIOCPKT, &on); ---------------------- forkpty allocates a pty pair, but the slave end is open only in the child process, which calls "child(...)" which in turn execs /bin/login. /bin/login now closes all its file descriptors before doing a vhangup on the tty (it used to do the close only after the vhangup). Apparently, doing this on the slave end of a pty will RESET the packet mode that the parent set by ioctl(master, TIOCPKT, &on), and as a result the pty pair no longer operates in packet mode, making it unusable by rlogind. (To test: insert a small sleep into the parent's code before ioctl(master, TIOCPKT, &on), enough to delay the call until after the child has done the vhangup (usleep(100000) is sufficient on our system) and then rlogind works just fine). The attached patch fixes the issue by splitting the call to forkpty into separate calls to openpty, fork, and login_tty, thereby enabling the parent to keep a file descriptor to the slave pty open, so that packet mode does not get reset.
This package has changed ownership in the Fedora Package Database. Reassigning to the new owner of this component.
rsh-0.17-71.fc19 has been submitted as an update for Fedora 19. https://admin.fedoraproject.org/updates/rsh-0.17-71.fc19
Package rsh-0.17-71.fc19: * should fix your issue, * was pushed to the Fedora 19 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing rsh-0.17-71.fc19' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2013-5708/rsh-0.17-71.fc19 then log in and leave karma (feedback).
rsh-0.17-71.fc19 has been pushed to the Fedora 19 stable repository. If problems still persist, please make note of it in this bug report.