On 2014/05/20 12:36, Philip Guenther wrote:
> On Tue, May 20, 2014 at 8:29 AM, Stuart Henderson <st...@openbsd.org> wrote:
> 
> > On 2014/05/20 16:41, viq wrote:
> > > I encountered a strange problem when trying to communicate with
> > net/ipcad:
> > >
> > > rsh localhost stats
> > > rsh: poll: Undefined error: 0
> >
> ...
> 
> > Note that ipcad listens on port 514 and provides *its own* cisco-ish
> > rshell interface that you connect to, this isn't about openbsd rshd.
> >
> > The error is coming from /usr/src/usr.bin/rsh/rsh.c:243 and since
> > nothing changed here in many years, I'm wondering if there's anything
> > up with poll(2). (If it's a direct bug with rsh, well, that's "fixed"
> > a different way in -current)..
> >
> ...
> 
> > 241                 if ((pfd[0].revents & (POLLERR|POLLHUP|POLLNVAL)) ||
> > 242                     (pfd[1].revents & (POLLERR|POLLHUP|POLLNVAL)))
> > >> 243                      err(1, "poll");
> >
> 
> It's reporting that the second fd, the stderr fd, has been closed by the
> other side (POLLHUP).  Does ipcad implement the expected ordering in the
> rsh protocol?
> 
> 
> Philip Guenther

Thanks for the cluebat / lesson in rsh :)

Seems it's actually racey, sometimes closing the stderr first, sometimes
closing port 514 first. So no it doesn't ... And rshd works fine,
reinforcing this i.e. seems like an ipcad bug. Still it seems odd
that it stopped working in 5.5 (though not enough for me to spend
longer looking!).

rsh     ipcad
54      55      ok
55      54      ok
55      55      fail

Anyway Viq, since rsh has gone away in -current, I suggest looking for
an alternative; there are various things which might be suitable depending
on what you're actually using it for ..

Now to remove my test rshd configs before I forget :-)

Reply via email to