telnetd doesn't provide REMOTEHOST environment variable?
glhs329 at gmail.com
glhs329 at gmail.com
Wed Sep 19 19:29:18 UTC 2007
I just need the client's IP address, so no dns needed. I don't see how
the shell can determine it, because the stdin/out/err fd's are
"attached" to the pty. You can't use getpeername() because the peer is
telnetd!
I have a small patch that works for me on my BB v1.0 code.
Unfortunately, I'm not in a position right now to merge it up to the
latest telnetd code. If anyone else is interested, let me know. I'd be
glad to share what I have.
On 9/17/07, Mike Frysinger <vapier at gentoo.org> wrote:
> On Monday 17 September 2007, glhs329 at gmail.com wrote:
> > I went looking for "REMOTEHOST" because that's what I'm used to
> > getting on various Linux systems I use.
>
> *shrug* i dont think there's any telnet standard we could refer to here
>
> > Obviously REMOTE_ADDR would be fine, but I don't see it, either.
>
> i wasnt sure if it was a matter of you not seeing the var or if REMOTEHOST is
> supposed to be set to the reverse dns ...
>
> > In fact, maybe I'm missing something but I don't see where telnetd is
> > setting any environment variables.
> >
> > Could this be done in some other source file? I'm currently using BB
> > v1.0, but I also browsed the latest telnetd.c in the repository and
> > still don't see anything.
>
> hrm, no idea where i was looking ... when i wrote that e-mail, i was looking
> at some telnet code that setup envvars like REMOTE_ADDR, but clearly that
> wasnt telnet code in busybox
>
> looks like env setup is left up to the reader (and the shell) to handle
> -mike
>
>
More information about the busybox
mailing list