> Thanks for responding, Paul.
>
> I had many ssh woes yesterday, so I did not get a chance to respond.
>
> Paul Newhouse wrote:
>
> > > I have ssh-2.2.0, but "find" can not find pty.c, nor ttymodes.c. I
> > > have looked manually, too.
> >
> > Where does 2.2.0 check for "tcgetattr"?
>
> I do not know, and I am not much of a C programmer.
> Below is the output from a grep for "tcgetattr", does any of it look like
> a promising place to start? readpass.c?
I don't run SSH 2 because I don't like the license for it, I'm basing all of this on
1.2.27.
> apps/ssh/readpass.c: tcgetattr(fileno(f), &tio);
> apps/ssh/sshttyflags.c: if (tcgetattr(fd, &tio) < 0)
> apps/ssh/sshttyflags.c: ssh_warning("tcgetattr: %.100s", strerror(errno));
I'd put one of my debuging messages after this line here
> apps/ssh/sshttyflags.c: if (tcgetattr(fd, &tio) < 0)
> lib/sshreadline/sshreadline.c: if (tcgetattr(fd, fd_tio) < 0)
> lib/sshreadline/sshreadline.c: ssh_warning("Warning: tcgetattr failed in "
here
> lib/sshsession/sshtty.c: if (tcgetattr(fd, &tio) < 0)
> lib/sshsession/sshtty.c: perror("tcgetattr");
and here. Little gems like this:
log_msg("%s:%d tcgetattr 1 -failed %d %s (%s)\n",
__FILE__, __LINE__, fd, strerror(errno),
Also look for where it's doing
isatty(...)
and instrument those as well. Then try pushing "ptem" & "ldterm" just before
the one that is failing (make it a tty). Hmmm, actually you know where it is failing
> Gary
>
> >
> > Paul
> >
> > > Gary
> > >
> > > On Oct 12, 3:57am, Paul Newhouse wrote:
> > > > Subject: RE: Error: You have no controlling terminal.Can't
> initialize
> > > read
> > > > >The error is coming from ssh2.c where it tries to open /dev/tty
> and
> > > fails.
It's right here.
Hmmmm, I might be steering you wrong with this. It's not that your tty isn't
configured
correctly, it's that you don't have a tty. You could try opening /dev/null in this
case
and pushing the modules on to that file descriptor? Pretty gross but, ...
Paul
> > > > >Looking at the ssh man pages I thought adding a "-t" would allocate
>a
> > > tty.
> > > > >But no luck there. Apart from hacking the source code to comment
>out
> > > that test
> > > > >does anyone have any suggestions?
> > > >
> > > > There is an example in pty.c. I put the following in ttymodes.c
>about
> > > line 284:
> > > >
> > > > if (tcgetattr(fd, &tio) < 0)
> > > > {
> > > > char *c = ttyname(fd);
> > > >
> > > > + ioctl(fd, I_PUSH, "ptem"); /* push ptem */
> > > > + ioctl(fd, I_PUSH, "ldterm"); /* push ldterm */
> > > >
> > > > if (tcgetattr(fd, &tio) < 0) {
> > > > packet_put_char(TTY_OP_END);
> > > > log_msg("tcgetattr: %.100s", strerror(errno));
> > > > log_msg("%s:%d tcgetattr 1 -failed %d %s
>(%s)\n",
> > > > __FILE__, __LINE__, fd, strerror(errno),
> c ==
> > > NULL ? "<null>" : c);
> > > > return;
> > > > }
> > > > }
> > > >
> > > > Good luck,
> > > > Paul
> > > >-- End of excerpt from Paul Newhouse
> > >
> > >
> > >
> >-- End of excerpt from Paul Newhouse
>
>
>
> --
> Gary Strahan, Ph.D.
> _____________________________________________________________________
>
> Gary Strahan, Ph.D. [EMAIL PROTECTED]
> Department of Pharmaceutical Sciences Phone: USA-410-706-3118
> University of Maryland at Baltimore FAX: USA-410-706-0346
> _____________________________________________________________________
>
>
> Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B)
> This email address may not be added to any commercial mail
> list with out permission. Violation of this statute with
> advertisements, SPAM, or other unrequested mail will result
> in a suit for a MINIMUM of $500 damages/incident, $1500 for
> repeats.
>