diff options
author | Aris Adamantiadis <aris@0xbadc0de.be> | 2005-08-10 13:22:52 +0000 |
---|---|---|
committer | Aris Adamantiadis <aris@0xbadc0de.be> | 2005-08-10 13:22:52 +0000 |
commit | 96a99bab7853998ec8c23da6bcb9ffb10855705d (patch) | |
tree | 25a79efb0fbcddb346fb65a4cdb554e78c7bec3b /sample.c | |
parent | 5c26ae735483d140f802d58b1872b2fe9468d219 (diff) | |
download | libssh-96a99bab7853998ec8c23da6bcb9ffb10855705d.tar.gz libssh-96a99bab7853998ec8c23da6bcb9ffb10855705d.tar.xz libssh-96a99bab7853998ec8c23da6bcb9ffb10855705d.zip |
The kex works, the client authentifies (with password) then it's possible to choose a subsystem. The channels don't completely work.
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@7 7dcaeef0-15fb-0310-b436-a5af3365683c
Diffstat (limited to 'sample.c')
-rw-r--r-- | sample.c | 22 |
1 files changed, 15 insertions, 7 deletions
@@ -176,22 +176,30 @@ void shell(SSH_SESSION *session){ CHANNEL *channel; struct termios terminal_local; int interactive=isatty(0); + channel = channel_new(session); if(interactive){ tcgetattr(0,&terminal_local); memcpy(&terminal,&terminal_local,sizeof(struct termios)); - cfmakeraw(&terminal_local); - tcsetattr(0,TCSANOW,&terminal_local); - setsignal(); } - signal(SIGTERM,do_cleanup); - channel = channel_new(session); - channel_open_session(channel); + if(channel_open_session(channel)){ + printf("error opening channel : %s\n",ssh_get_error(session)); + return; + } chan=channel; if(interactive){ channel_request_pty(channel); sizechanged(); } - channel_request_shell(channel); + if(channel_request_shell(channel)){ + printf("Requesting shell : %s\n",ssh_get_error(session)); + return; + } + if(interactive){ + cfmakeraw(&terminal_local); + tcsetattr(0,TCSANOW,&terminal_local); + setsignal(); + } + signal(SIGTERM,do_cleanup); select_loop(session,channel); } |