Andreas,
Thanks for your reply. I’ll take a look at qsetlogin() tomorrow. Send() to Proc32, eh? I KNEW there had to be a secret handshake!
I think I found the logging problem, or at least one of them. In servconf.c find the section that initializes the facility and log level in function
read_server_config(). There is an assumption that the type of SyslogFacility and LogLevel are both integer-sized. They are not. Watcom’s default is to align on
a byte in structures, so options.log_level and .facility were being misread out of the structure. Even if you use the -zp4 flag to try to align, it fails, so
the right answer (I think) is the following:
case sLogFacility:
{
SyslogFacility *sptr;
sptr = (SyslogFacility *) &options->log_facility;
arg = strdelim(&cp);
value = log_facility_number(arg);
if (value == (SyslogFacility) -1)
fatal("%.200s line %d: unsupported log facility ‘%s’\n",
filename, linenum, arg ? arg : “”);
if (*sptr == -1)
*sptr = (SyslogFacility) value;
}
break;
case sLogLevel:
{
LogLevel *lptr;
lptr = (LogLevel *) &options->log_level;
arg = strdelim(&cp);
value = log_level_number(arg);
if (value == (LogLevel) -1)
fatal("%.200s line %d: unsupported log level ‘%s’\n",
filename, linenum, arg ? arg : “”);
if (*lptr == -1)
*lptr = (LogLevel) value;
}
break;
I have no idea why all the pointer jazz is necessary, but I think it is.
Regards,
-Jim
Andreas Schneider wrote:
Jim Parnell (> jparnell@wgate.com> ) wrote:
: The lack of a controlling terminal is the problem, but I do not know how to
: reliably create a controlling terminal. The following sshd code attempts to
: do this (after forking off the sshd daemon).
: * The first ioctl(TIOCNOTTY) call which tries to disconnect from the old controlling tty returns the error ENOMSG.
: * The setsid() call returns EPERM. Note that getpgrp() returns the process pid (getpid()) – It looks like the session may already be the process leader?
: * The last ioctl(TIOCSCTTY) call returns ENOENT (an undocumented return value, BTW)
: * Lastly, the fopen on “/dev/tty” in O_WRONLY also returns ENOENT
: Any help in this matter would be greatly appreciated.
Due to a tip from Frank Liu I had inserted a qsetlogin() - function in
pty.c, and now the creation of a controlling tty works (I’ve been working
on my own port last year). My version of the OpenSSH sources (2.2.0p1)
can be downloaded from
ftp://ds2.etech.fh-hamburg.de/pub/qnx/tcpip/openssh-2.2.0p1-qnx.tar.gz
Though there are still problems with my port. At first, there is a problem
with logging, and second the ssh daemon and the Dev.random device driver
sometimes have to be restarted because of an error as
Couldn’t open random pool “/dev/urandom”: Not enough memory
though the system is NOT out of memory.
If anyone knows help, please let me know.
-Andreas