pty wrapper?

Is there a pseudo-tty wrapper that I can jam into inetd.conf that
will do the “magic” of binding a master/slave side of a pty on
a spawned process? I want to be able to start an arbitrary “regular”
TCP/IP-unaware program when someone telnets to a particular port.

Currently, the TCP/IP-unaware program needs to have the following
parameters set on the telnet session:

mode line
mode edit
set crlf

as well as some judicious use of “fflush” on stdout… A pain.

Thanks,
-RK


[If replying via email, you’ll need to click on the URL that’s emailed to you
afterwards to forward the email to me – spam filters and all that]
Robert Krten, PDP minicomputer collector http://www.parse.com/~pdp8/

Simon Casady <casady@acm.org> wrote:

On 12 Mar 2004 23:57:33 GMT, Robert Krten <> rk@parse.com> > wrote:


Is there a pseudo-tty wrapper that I can jam into inetd.conf that
will do the “magic” of binding a master/slave side of a pty on
a spawned process? I want to be able to start an arbitrary “regular”
TCP/IP-unaware program when someone telnets to a particular port.

Currently, the TCP/IP-unaware program needs to have the following
parameters set on the telnet session:

mode line
mode edit
set crlf

as well as some judicious use of “fflush” on stdout… A pain.

Thanks,
-RK

telnetd ?
I am not sure I understand. Inetd is designed to start tcp/ip unaware
programs. Do you want to automatically login a telnet session and
start a program ? Then perhaps you want rlogind.

I’m probably the one who doesn’t understand :slight_smile:

I wrote a chess program that uses “fgets” to get data from stdin.
I’m expecting the user to simply “telnet” to a given port on my
machine.

When I put the chess program in inetd, the user has to hit ^J
to cause a newline to be entered, rather than just hitting return.
Also, characters from the user aren’t echoed.
So, in short, the way that inetd starts the program, and the
way that the telnet client program accesses said programs is
different (in an annoying way) than what a user gets when they
login to a pty-controlled session and run a program…

I (naively) thought that if I could put a pty between the inetd
end of things and the “regular, TCP/IP unaware program” end of
things, that these problems would go away…

Am I confused? :slight_smile:

Cheers,
-RK


Using M2, Opera’s revolutionary e-mail client: > http://www.opera.com/m2/


[If replying via email, you’ll need to click on the URL that’s emailed to you
afterwards to forward the email to me – spam filters and all that]
Robert Krten, PDP minicomputer collector http://www.parse.com/~pdp8/

On 12 Mar 2004 23:57:33 GMT, Robert Krten <rk@parse.com> wrote:

Is there a pseudo-tty wrapper that I can jam into inetd.conf that
will do the “magic” of binding a master/slave side of a pty on
a spawned process? I want to be able to start an arbitrary “regular”
TCP/IP-unaware program when someone telnets to a particular port.

Currently, the TCP/IP-unaware program needs to have the following
parameters set on the telnet session:

mode line
mode edit
set crlf

as well as some judicious use of “fflush” on stdout… A pain.

Thanks,
-RK

telnetd ?

I am not sure I understand. Inetd is designed to start tcp/ip unaware
programs. Do you want to automatically login a telnet session and
start a program ? Then perhaps you want rlogind.

\

Using M2, Opera’s revolutionary e-mail client: http://www.opera.com/m2/

I (naively) thought that if I could put a pty between the inetd
end of things and the “regular, TCP/IP unaware program” end of
things, that these problems would go away…

Are you using the telnet from QNX6? If so, try using the one from a BSD
install and see if that behaves better.

chris


Chris McKillop <cdm@qnx.com> “The faster I go, the behinder I get.”
Software Engineer, QSSL – Lewis Carroll –
http://qnx.wox.org/

Chris McKillop <cdm@qnx.com> wrote:

I (naively) thought that if I could put a pty between the inetd
end of things and the “regular, TCP/IP unaware program” end of
things, that these problems would go away…


Are you using the telnet from QNX6? If so, try using the one from a BSD
install and see if that behaves better.

Yup. much better, exactly as I would suspect. :slight_smile:

Windoze sucks too, however; my buddy reports it doesn’t even do the newline
to newline/carriage return expansion on the output :slight_smile:

Cheers,
-RK


[If replying via email, you’ll need to click on the URL that’s emailed to you
afterwards to forward the email to me – spam filters and all that]
Robert Krten, PDP minicomputer collector http://www.parse.com/~pdp8/

On 16 Mar 2004 02:00:29 GMT, Robert Krten wrote:

Chris McKillop <> cdm@qnx.com> > wrote:

Are you using the telnet from QNX6? If so, try using the one from a BSD
install and see if that behaves better.

Yup. much better, exactly as I would suspect. > :slight_smile:

Windoze sucks too, however; my buddy reports it doesn’t even do the newline
to newline/carriage return expansion on the output > :slight_smile:

Cheers,
-RK

Did you try the ‘crlf’ option from within telnet?

telnet> set crlf

Rob Rutherford

Robert Rutherford <ruzz@nospamplease.ruzz.com> wrote:

On 16 Mar 2004 02:00:29 GMT, Robert Krten wrote:

Chris McKillop <> cdm@qnx.com> > wrote:

Are you using the telnet from QNX6? If so, try using the one from a BSD
install and see if that behaves better.

Yup. much better, exactly as I would suspect. > :slight_smile:

Windoze sucks too, however; my buddy reports it doesn’t even do the newline
to newline/carriage return expansion on the output > :slight_smile:

Cheers,
-RK

Did you try the ‘crlf’ option from within telnet?

telnet> set crlf

And around and around we go :slight_smile: Yes, that was mentioned in the first post – the
fact that you need to specify this stuff to make telnet behave, rather than
having it “just work”…

Cheers,
-RK


[If replying via email, you’ll need to click on the URL that’s emailed to you
afterwards to forward the email to me – spam filters and all that]
Robert Krten, PDP minicomputer collector http://www.parse.com/~pdp8/

Yup. much better, exactly as I would suspect. > :slight_smile:

The trouble is that the telnet spec does not specify how a client should
behave if it doesn’t talk to a telnet server. The telnet out-of-band
protocol allows the server and client to communicate this behavior. Since
our telnet is basically BSD4.4/NetBSD I am guessing that FreeBSD has done
something to change the default behavior (ie: we aren’t setting something at
compile time).

This is why web interfaces are nicer to setup and manage. :wink:

chris


Chris McKillop <cdm@qnx.com> “The faster I go, the behinder I get.”
Software Engineer, QSSL – Lewis Carroll –
http://qnx.wox.org/