Hi all,
In JSch-0.1.37, Session.connect(int) sets
isConnected=true in line 208, but the
connectThread is only created later after
Authentication is done.
This leads to an NPE when Session.disconnect()
is called from a different Thread, before the
Authentication is finished: In line 1459,
isConnected is already true, but in the
synchronized(connectThread)
statement the connectThread does not yet
exist.
I'm not sure how to best address this, but one
option might be that disconnect() does this:
if(connectThread==null) {
//Not yet authenticated: Signal cancellation
synchronized(this) {
isConnected = false;
}
}
and, the connect(int) method checks for isConnected
still true at the right places during authentication.
For another method addressing this in the client code
(checking connect status in the MyUserInfo), see
https://bugs.eclipse.org/bugs/show_bug.cgi?id=240420#c9
Thoughts?
Cheers,
--
Martin Oberhuber, Senior Member of Technical Staff, Wind River
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf
> Of Atsuhiko Yamanaka
> Sent: Wednesday, July 09, 2008 2:25 AM
> To: [EMAIL PROTECTED]
> Cc: [email protected]
> Subject: Re: [JSch-users] trying to set TERM=dumb on a
> terminal shellvia ChannelShell interface
>
> Hi,
>
> +-From: "Alan Ezust" <[EMAIL PROTECTED]> --
> |_Date: Tue, 8 Jul 2008 11:09:17 -0700 _______
> |
> |Hello everyone. I'm the author of the SshConsolePlugin for JEdit.
> |I'm trying to do a channelShell.setEnv("TERM", "dumb"), so that I
> |don't have to see all these funny vt100 characters in the console
> |shell.
> |It doesn't seem to work. I get this error whenever I try to set an
> |environment variable.
>
> To enable 'setEnv', you need to add 'AcceptEnv TERM' to
> '/etc/ssh/sshd_config', if you are connecting to OpenSSH's sshd.
>
> To change terminal type without 'setEnv', you can invoke
> channelShell.setPtyType("dumb");
> before connecting it.
>
> Sincerely,
> --
> Atsuhiko Yamanaka
> JCraft,Inc.
> 1-14-20 HONCHO AOBA-KU,
> SENDAI, MIYAGI 980-0014 Japan.
> Tel +81-22-723-2150
> +1-415-578-3454
> Fax +81-22-224-8773
> Skype callto://jcraft/
>
> --------------------------------------------------------------
> -----------
> Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
> Studies have shown that voting for your favorite open source project,
> along with a healthy diet, reduces your potential for chronic lameness
> and boredom. Vote Now at http://www.sourceforge.net/community/cca08
> _______________________________________________
> JSch-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jsch-users
>
-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
JSch-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jsch-users