porting OpenSSH to QNX

Hi all,

currently I’m porting OpenSSH (version 2.2.0p1) to QNX. The OpenSSL library (needed
by OpenSSH) already runs fine (and my port has been included in the OpenSSL
distribution). Now I’ve a problem with OpenSSH: The code uses the functions
ttyslot() and initgroups(), which are not available. Does anybody have an idea what to do?

Andreas

Andreas Schneider <andreas@ds3.etech.fh-hamburg.de> wrote:

Hi all,

currently I’m porting OpenSSH (version 2.2.0p1) to QNX. The OpenSSL library (needed
by OpenSSH) already runs fine (and my port has been included in the OpenSSL
distribution). Now I’ve a problem with OpenSSH: The code uses the functions
ttyslot() and initgroups(), which are not available. Does anybody have an idea what to do?

It has already been ported…

http://www.qnx.com/~cdm/

chris

\

cdm@qnx.com > “The faster I go, the behinder I get.”

Chris McKillop – Lewis Carroll –
Software Engineer, QSSL
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

Chris McKillop <cdm@qnx.com> wrote:

Andreas Schneider <> andreas@ds3.etech.fh-hamburg.de> > wrote:
Hi all,

currently I’m porting OpenSSH (version 2.2.0p1) to QNX. The OpenSSL library (needed
by OpenSSH) already runs fine (and my port has been included in the OpenSSL
distribution). Now I’ve a problem with OpenSSH: The code uses the functions
ttyslot() and initgroups(), which are not available. Does anybody have an idea what to do?


It has already been ported…

http://www.qnx.com/~cdm/

Just realized you might have been talking about qnx4 and not nto!! :frowning: Sorry…

chris

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

cdm@qnx.com > “The faster I go, the behinder I get.”

Chris McKillop – Lewis Carroll –
Software Engineer, QSSL
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

#if defined(QNX) && !defined(QNXNTO)

#define ttyslot() 1

int initgroups(char *name,gid_t id)
{
return(0);
}

#endif


Andreas Schneider wrote:

Hi all,

currently I’m porting OpenSSH (version 2.2.0p1) to QNX. The OpenSSL library (needed
by OpenSSH) already runs fine (and my port has been included in the OpenSSL
distribution). Now I’ve a problem with OpenSSH: The code uses the functions
ttyslot() and initgroups(), which are not available. Does anybody have an idea what to do?

Andreas

Previously, liug@mama.indstate.edu wrote in qdn.public.porting:

#if defined(QNX) && !defined(QNXNTO)

#define ttyslot() 1

int initgroups(char *name,gid_t id)
{
return(0);
}

#endif

Thanks, now it compiled all right and, as far as I can tell after my
first tests, works fine. At first, there had been a problem with password
authentication, but it turned out to be the order of the crypto (=OpenSSL)
and qcrypt libraries linked to sshd, since there is a crypt() function in
both (the symbol had been overridden).
I mailed all the changes needed to compile OpenSSH under QNX 4 to the
OpenSSH developers so that they can include them into the next distribution.

Andreas

can u do “su” command after you ssh into a QNX4 box running your
openssh port?

Andreas Schneider wrote:

Previously, > liug@mama.indstate.edu > wrote in qdn.public.porting:
#if defined(QNX) && !defined(QNXNTO)

#define ttyslot() 1

int initgroups(char *name,gid_t id)
{
return(0);
}

#endif

Thanks, now it compiled all right and, as far as I can tell after my
first tests, works fine. At first, there had been a problem with password
authentication, but it turned out to be the order of the crypto (=OpenSSL)
and qcrypt libraries linked to sshd, since there is a crypt() function in
both (the symbol had been overridden).
I mailed all the changes needed to compile OpenSSH under QNX 4 to the
OpenSSH developers so that they can include them into the next distribution.

Andreas

d
liug@mama.indstate.edu wrote:
: can u do “su” command after you ssh into a QNX4 box running your
: openssh port?
No, unfortunetaly I can’t.
Additionally, there is also another problem I discovered after some
testing: When I’m logged in, I can’t ssh to anywhere else; it says
no controlling tty. I tried the ‘who’ command and saw that I was listed
as “System” with tty "//2 ". So it seems I don’t really get a
controlling tty, though it says at login time logon on /dev/ttyp0 (or
whatever is my current tty). Now I looked at the code where the pseudo
tty is acquired. But the code looks OK for me (an open() for the master
and the slave side). Then I tried to debug with “sshd -d”, but I got a
letter-salad where the tty is acquired (might there be a pointer mismatch??).
Has anyone an idea what to do?

Andreas

This is a known issue with the old non-free “ssh” and several
other terminal emulators such as “xterm”: no controlling tty.
I was trying to ask QSSL for help when working on the QNXFree86
porting project because QSSL apparently got the xterm working
in their commercial X11 product for QNX4. Unfortunately they
couldn’t help me because QNXFree86 is a free project and they
don’t have the resource to help. We ended up using JC’s hack,
which requires setuid root. sshd runs as root anyway, so it
may not be a problem as terminal emulators, still the hack
looks ugly.

Frank


Andreas Schneider wrote:

d
liug@mama.indstate.edu > wrote:
: can u do “su” command after you ssh into a QNX4 box running your
: openssh port?
No, unfortunetaly I can’t.
Additionally, there is also another problem I discovered after some
testing: When I’m logged in, I can’t ssh to anywhere else; it says
no controlling tty. I tried the ‘who’ command and saw that I was listed
as “System” with tty "//2 ". So it seems I don’t really get a
controlling tty, though it says at login time logon on /dev/ttyp0 (or
whatever is my current tty). Now I looked at the code where the pseudo
tty is acquired. But the code looks OK for me (an open() for the master
and the slave side). Then I tried to debug with “sshd -d”, but I got a
letter-salad where the tty is acquired (might there be a pointer mismatch??).
Has anyone an idea what to do?

Andreas

liug@mama.indstate.edu wrote:
: This is a known issue with the old non-free “ssh” and several
: other terminal emulators such as “xterm”: no controlling tty.
: I was trying to ask QSSL for help when working on the QNXFree86
: porting project because QSSL apparently got the xterm working
: in their commercial X11 product for QNX4. Unfortunately they
: couldn’t help me because QNXFree86 is a free project and they
: don’t have the resource to help. We ended up using JC’s hack,
: which requires setuid root. sshd runs as root anyway, so it
: may not be a problem as terminal emulators, still the hack
: looks ugly.

: Frank

It looks like I’ve got to use that hack, too. Since I hear from
it for the first time now, what is it? Perhaps I should download
the QNXFree86 source and have a look at the “xterm” part.

Andreas

I’m having some problems trying to get OpenSSL 0.9.6 compiled using either the native cc or gcc-2.95.2. If I compile it with DES enabled, I get to this point:

cc -I… -I…/…/include -DL_ENDIAN -DTERMIO -c read_pwd.c -o read_pwd.o
read_pwd.c:145: termio.h: No such file or directory
cc: error 33

I get the same error with gcc.

How have people been successful in getting OpenSSL compiled. I apologize in advance if this is a real newbie question, I’m new to qnx and C. My next goal is to get openssh working.

Any help is appreciated.

deimos <deimos@lewman.org> wrote:

I’m having some problems trying to get OpenSSL 0.9.6 compiled using either the native cc or gcc-2.95.2. If I compile it with DES enabled, I get to this point:

cc -I… -I…/…/include -DL_ENDIAN -DTERMIO -c read_pwd.c -o read_pwd.o
read_pwd.c:145: termio.h: No such file or directory
cc: error 33

I get the same error with gcc.

How have people been successful in getting OpenSSL compiled. I apologize in advance if this is a real newbie question, I’m new to qnx and C. My next goal is to get openssh working.

Any help is appreciated.

Well, it could be where it is looking for termio.h. At which point
you can either “ln -s” to the place it is looking for it or you can
change the code so it looks for it in the right place. You are also
going to run into some strageness with select() and some very BSD/UNIX
assumptions in the code. You can just nab pre-built binaries from
my webpage - http://staff.qnx.com/~cdm/.

chris

Are you talking about QNX4 or QNX6 (aka RTP)?
If later, I believe CDM from QSSL has done that already, though, as
other people complained, none of the changes have gone back to the
original package. You may be able to ask him directly for the source code.
frank

On Fri, 12 Jan 2001, deimos wrote:

I’m having some problems trying to get OpenSSL 0.9.6 compiled using either the native cc or gcc-2.95.2. If I compile it with DES enabled, I get to this point:

cc -I… -I…/…/include -DL_ENDIAN -DTERMIO -c read_pwd.c -o read_pwd.o
read_pwd.c:145: termio.h: No such file or directory
cc: error 33

I get the same error with gcc.

How have people been successful in getting OpenSSL compiled. I apologize in advance if this is a real newbie question, I’m new to qnx and C. My next goal is to get openssh working.

Any help is appreciated.

Frank Liu <liug@mama.indstate.edu> wrote:

Are you talking about QNX4 or QNX6 (aka RTP)?
If later, I believe CDM from QSSL has done that already, though, as
other people complained, none of the changes have gone back to the
original package. You may be able to ask him directly for the source code.

:slight_smile: I really didn’t make many changes at all. Perhaps I will sit down
and try it again and put both the source and the binary on my webpage.
I didn’t remember it being all that hard to build so I didn’t see the
point in uploading the source since you can get it online.

chris

\

cdm@qnx.com > “The faster I go, the behinder I get.”

Chris McKillop – Lewis Carroll –
Software Engineer, QSSL
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<