Trying to compile for OS/2

Dave Saville dave at deezee.org
Fri Dec 20 00:15:56 EST 2013


Hi

I hope I have found the right list :-) If not, my apologies and a pointer  
would be appreciated.

I am trying to compile openssh-6.3p1 for OS/2 aka EcomStation. For those  
unfamiliar OS/2 is a DOSish OS but usually porting *nix apps is pretty  
straightforward.

It is complicated by the fact that our current libc implementation of  
pipe() is flawed and I have to use socketpair() instead. I think I have  
found all the places where pipes are allocated and changed to use  
socketpair. It is further complicated by the fact that we don't have tty  
support either. :-) There is no /dev tree although /dev/console is  
supported internally.

Having said that it all compiles clean - after the insertion of a few casts  
here and there :-)

Using either ssh or sshd to tunnel works fine - both to each other and to  
"real" ssh on a linux box. But when it comes to interactive terminal both  
they, and sftp, fail.

ssh -vvvv shardik (which is a *nix box)
snip snip
debug1: Authentication succeeded (password).
Authenticated to shardik ([192.168.0.1]:22).
debug1: channel 0: new [client-session]
debug3: ssh_session2_open: channel_new: 0
debug2: channel 0: send open
debug1: Entering interactive session.
tcgetattr: Invalid argument
debug2: callback start
debug2: fd 3 setting TCP_NODELAY
debug3: packet_set_tos: set IP_TOS 0x10
debug2: client_session2_setup: id 0
debug2: channel 0: request pty-req confirm 1
debug1: tty_make_modes: no fd or tio
debug2: channel 0: request shell confirm 1
debug2: callback done
debug2: channel 0: open confirm rwindow 24576 rmax 32768
debug1: channel 0: free: client-session, nchannels 1
debug3: channel 0: status: The following connections are open:
    #0 client-session (t4 r0 i0/0 o0/0 fd 4/5 cc -1)

select: Invalid argument
Connection to shardik closed.
Transferred: sent 3552, received 1136 bytes, in 0.0 seconds
Bytes per second: sent 77217.4, received 24695.6
debug1: Exit status -1

The tcgetattr() error I have not tracked down yet but a Google search  
suggested that it could be ignored.

The select() error is in Clientloop.c/client_wait_until_can_do_something  
#655 and would appear to be because one of the file descripters, 4, is an  
OS/2 file handle. I have yet to work out why or where is got allocated.  
That line of code is executed many times before fd 4 appears when it  
immediately barfs.

I get similar problems with sshd but suspect that when I track down what's  
wrong with ssh the solution will be the same/similar.

It would help of course if I had an understanding of what called what and  
under what conditions to insert additional debugging statements.

I can't help feeling that it is something both obvious and silly.

TIA

-- 
Kind regards

Dave Saville


More information about the openssh-unix-dev mailing list