[jira] [Work logged] (SSHD-1257) Shell is not getting closed if the command has already closed the OutputStream it is using.

2022-03-31 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/SSHD-1257?focusedWorklogId=751409&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-751409
 ]

ASF GitHub Bot logged work on SSHD-1257:


Author: ASF GitHub Bot
Created on: 01/Apr/22 06:22
Start Date: 01/Apr/22 06:22
Worklog Time Spent: 10m 
  Work Description: lgoldstein commented on a change in pull request #214:
URL: https://github.com/apache/mina-sshd/pull/214#discussion_r840270775



##
File path: 
sshd-core/src/main/java/org/apache/sshd/server/channel/ChannelSession.java
##
@@ -908,7 +908,7 @@ protected void closeShell(int exitValue, boolean 
closeImmediately) throws IOExce
 
 if (!isClosing()) {
 if (out != null) {
-out.flush();

Review comment:
   > out.close() works because this is indeed the last use of this stream. 
Looks fine to me...
   
   I trust your judgment @tomaswolf 
   
   >  The intent is obviously to get all data from the command sent before the 
EOF is sent. But why not also flush or close err? What happens if the command 
writes something to the error stream? err gets closed only in the close() call 
in line 916, so that would flush it after the EOF (and the exit status) was 
sent. That's probably not OK.
   
   I tend to agree with you... 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 751409)
Time Spent: 1h 50m  (was: 1h 40m)

> Shell is not getting closed if the command has already closed the 
> OutputStream it is using.
> ---
>
> Key: SSHD-1257
> URL: https://issues.apache.org/jira/browse/SSHD-1257
> Project: MINA SSHD
>  Issue Type: Bug
>Affects Versions: 2.9.0
>Reporter: Vincent Latombe
>Priority: Major
>  Time Spent: 1h 50m
>  Remaining Estimate: 0h
>
> When running a org.apache.sshd.server.command.Command, if it happens to close 
> the OutputStream instance it is using, then later when the ssh session 
> closes, it attempts to flush the output stream before closing it.
> This causes the  following warning to be printed on server side
> {code:java}
> WARNING o.a.s.s.channel.ChannelSession#lambda$prepareCommand$0: 
> onExit(ChannelSession[id=0, 
> recipient=0]-ServerSessionImpl[admin@/0:0:0:0:0:0:0:1:49944]) code=0 
> message='' SshChannelClosedException closing shell: 
> flush(ChannelOutputStream[ChannelSession[id=0, 
> recipient=0]-ServerSessionImpl[admin@/0:0:0:0:0:0:0:1:49944]] 
> SSH_MSG_CHANNEL_DATA) length=0 - stream is already closed
> {code}
> and EOF is never sent to client.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org



[GitHub] [mina-sshd] lgoldstein commented on a change in pull request #214: [SSHD-1257] Make ChannelOutputStream#flush no-op if the stream is already closed

2022-03-31 Thread GitBox


lgoldstein commented on a change in pull request #214:
URL: https://github.com/apache/mina-sshd/pull/214#discussion_r840270775



##
File path: 
sshd-core/src/main/java/org/apache/sshd/server/channel/ChannelSession.java
##
@@ -908,7 +908,7 @@ protected void closeShell(int exitValue, boolean 
closeImmediately) throws IOExce
 
 if (!isClosing()) {
 if (out != null) {
-out.flush();

Review comment:
   > out.close() works because this is indeed the last use of this stream. 
Looks fine to me...
   
   I trust your judgment @tomaswolf 
   
   >  The intent is obviously to get all data from the command sent before the 
EOF is sent. But why not also flush or close err? What happens if the command 
writes something to the error stream? err gets closed only in the close() call 
in line 916, so that would flush it after the EOF (and the exit status) was 
sent. That's probably not OK.
   
   I tend to agree with you... 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org



[jira] [Work logged] (SSHD-1257) Shell is not getting closed if the command has already closed the OutputStream it is using.

2022-03-31 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/SSHD-1257?focusedWorklogId=751401&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-751401
 ]

ASF GitHub Bot logged work on SSHD-1257:


Author: ASF GitHub Bot
Created on: 01/Apr/22 05:36
Start Date: 01/Apr/22 05:36
Worklog Time Spent: 10m 
  Work Description: tomaswolf commented on a change in pull request #214:
URL: https://github.com/apache/mina-sshd/pull/214#discussion_r840247098



##
File path: 
sshd-core/src/main/java/org/apache/sshd/server/channel/ChannelSession.java
##
@@ -908,7 +908,7 @@ protected void closeShell(int exitValue, boolean 
closeImmediately) throws IOExce
 
 if (!isClosing()) {
 if (out != null) {
-out.flush();

Review comment:
   `out.close()` works because this is indeed the last use of this stream. 
Looks fine to me...
   
   Unrelated to this change:
   
   But the code is a bit strange anyway. The intent is obviously to get all 
data from the command sent before the EOF is sent. But why not also flush or 
close `err`? What happens if the command writes something to the error stream? 
`err` gets closed only in the `close()` call in line 916, so that would flush 
it after the EOF (and the exit status) was sent. That's probably not OK.
   
   And anyway: stderr is traditionally "unbuffered", i.e., flushed on newlines. 
I don't see anything in ChannelOutputStream that would implement that for 
SSH_MSG_CHANNEL_EXTENDED_DATA. Maybe that's OK; the command would be 
responsible for flushing it frequently then if desired.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 751401)
Time Spent: 1h 40m  (was: 1.5h)

> Shell is not getting closed if the command has already closed the 
> OutputStream it is using.
> ---
>
> Key: SSHD-1257
> URL: https://issues.apache.org/jira/browse/SSHD-1257
> Project: MINA SSHD
>  Issue Type: Bug
>Affects Versions: 2.9.0
>Reporter: Vincent Latombe
>Priority: Major
>  Time Spent: 1h 40m
>  Remaining Estimate: 0h
>
> When running a org.apache.sshd.server.command.Command, if it happens to close 
> the OutputStream instance it is using, then later when the ssh session 
> closes, it attempts to flush the output stream before closing it.
> This causes the  following warning to be printed on server side
> {code:java}
> WARNING o.a.s.s.channel.ChannelSession#lambda$prepareCommand$0: 
> onExit(ChannelSession[id=0, 
> recipient=0]-ServerSessionImpl[admin@/0:0:0:0:0:0:0:1:49944]) code=0 
> message='' SshChannelClosedException closing shell: 
> flush(ChannelOutputStream[ChannelSession[id=0, 
> recipient=0]-ServerSessionImpl[admin@/0:0:0:0:0:0:0:1:49944]] 
> SSH_MSG_CHANNEL_DATA) length=0 - stream is already closed
> {code}
> and EOF is never sent to client.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org



[GitHub] [mina-sshd] tomaswolf commented on a change in pull request #214: [SSHD-1257] Make ChannelOutputStream#flush no-op if the stream is already closed

2022-03-31 Thread GitBox


tomaswolf commented on a change in pull request #214:
URL: https://github.com/apache/mina-sshd/pull/214#discussion_r840247098



##
File path: 
sshd-core/src/main/java/org/apache/sshd/server/channel/ChannelSession.java
##
@@ -908,7 +908,7 @@ protected void closeShell(int exitValue, boolean 
closeImmediately) throws IOExce
 
 if (!isClosing()) {
 if (out != null) {
-out.flush();

Review comment:
   `out.close()` works because this is indeed the last use of this stream. 
Looks fine to me...
   
   Unrelated to this change:
   
   But the code is a bit strange anyway. The intent is obviously to get all 
data from the command sent before the EOF is sent. But why not also flush or 
close `err`? What happens if the command writes something to the error stream? 
`err` gets closed only in the `close()` call in line 916, so that would flush 
it after the EOF (and the exit status) was sent. That's probably not OK.
   
   And anyway: stderr is traditionally "unbuffered", i.e., flushed on newlines. 
I don't see anything in ChannelOutputStream that would implement that for 
SSH_MSG_CHANNEL_EXTENDED_DATA. Maybe that's OK; the command would be 
responsible for flushing it frequently then if desired.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org



[jira] [Work logged] (SSHD-1257) Shell is not getting closed if the command has already closed the OutputStream it is using.

2022-03-31 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/SSHD-1257?focusedWorklogId=751353&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-751353
 ]

ASF GitHub Bot logged work on SSHD-1257:


Author: ASF GitHub Bot
Created on: 01/Apr/22 02:36
Start Date: 01/Apr/22 02:36
Worklog Time Spent: 10m 
  Work Description: lgoldstein commented on a change in pull request #214:
URL: https://github.com/apache/mina-sshd/pull/214#discussion_r840186180



##
File path: 
sshd-core/src/main/java/org/apache/sshd/server/channel/ChannelSession.java
##
@@ -908,7 +908,7 @@ protected void closeShell(int exitValue, boolean 
closeImmediately) throws IOExce
 
 if (!isClosing()) {
 if (out != null) {
-out.flush();

Review comment:
   Not sure about this... "smells fishy" as well , though I cannot put my 
fiinger on it - will have to think about it.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 751353)
Time Spent: 1.5h  (was: 1h 20m)

> Shell is not getting closed if the command has already closed the 
> OutputStream it is using.
> ---
>
> Key: SSHD-1257
> URL: https://issues.apache.org/jira/browse/SSHD-1257
> Project: MINA SSHD
>  Issue Type: Bug
>Affects Versions: 2.9.0
>Reporter: Vincent Latombe
>Priority: Major
>  Time Spent: 1.5h
>  Remaining Estimate: 0h
>
> When running a org.apache.sshd.server.command.Command, if it happens to close 
> the OutputStream instance it is using, then later when the ssh session 
> closes, it attempts to flush the output stream before closing it.
> This causes the  following warning to be printed on server side
> {code:java}
> WARNING o.a.s.s.channel.ChannelSession#lambda$prepareCommand$0: 
> onExit(ChannelSession[id=0, 
> recipient=0]-ServerSessionImpl[admin@/0:0:0:0:0:0:0:1:49944]) code=0 
> message='' SshChannelClosedException closing shell: 
> flush(ChannelOutputStream[ChannelSession[id=0, 
> recipient=0]-ServerSessionImpl[admin@/0:0:0:0:0:0:0:1:49944]] 
> SSH_MSG_CHANNEL_DATA) length=0 - stream is already closed
> {code}
> and EOF is never sent to client.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org



[GitHub] [mina-sshd] lgoldstein commented on a change in pull request #214: [SSHD-1257] Make ChannelOutputStream#flush no-op if the stream is already closed

2022-03-31 Thread GitBox


lgoldstein commented on a change in pull request #214:
URL: https://github.com/apache/mina-sshd/pull/214#discussion_r840186180



##
File path: 
sshd-core/src/main/java/org/apache/sshd/server/channel/ChannelSession.java
##
@@ -908,7 +908,7 @@ protected void closeShell(int exitValue, boolean 
closeImmediately) throws IOExce
 
 if (!isClosing()) {
 if (out != null) {
-out.flush();

Review comment:
   Not sure about this... "smells fishy" as well , though I cannot put my 
fiinger on it - will have to think about it.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org



Re: MINA and TLS 1.3 (1ms sleep hack?)

2022-03-31 Thread Emmanuel Lécharny

Hi Guus,

On 31/03/2022 19:43, Guus der Kinderen wrote:

Thanks for the fast response Emmanuel,

Although I was able to build 2.2.0-SNAPSHOT, it doesn't seem to be API 
compatible with 2.1.3.


Things that I ran into:

  * SslFilter.DISABLE_ENCRYPTION_ONCE no longer exists (which we use to
implement StartTLS).


Yes, it was a source of problem. The way we deal with the requirement to 
send the StartTLS response in clear text *before* setting the SslFilter 
now is to use a dedicated filter. here is what we do in Apache Diectory 
Server:


public class StartTlsFilter extends IoFilterAdapter
{
/**
 * {@inheritDoc}
 */
@Override
public void filterWrite( NextFilter nextFilter, IoSession session, 
WriteRequest writeRequest ) throws Exception

{
if ( writeRequest.getOriginalMessage() instanceof 
StartTlsResponse )

{
// We need to bypass the SslFilter
IoFilterChain chain = session.getFilterChain();

for ( IoFilterChain.Entry entry : chain.getAll() )
{
IoFilter filter = entry.getFilter();

if ( filter instanceof SslFilter )
{
entry.getNextFilter().filterWrite( session, 
writeRequest );

}
}
}
else
{
nextFilter.filterWrite( session, writeRequest );
}
}
}

This is pretty straight forward: when we go through this filter with a 
StartTLS response message, we bypass the SslFilter, otherwise we call it.




  * SslFilter.SSL_SESSION no longer exists. Is SslFilter.SSL_SECURED a
drop-in replacement?


Yes. For instance, in FtpServer:

if (getFilterChain().contains(SslFilter.class)) {
SSLSession sslSession = 
(SSLSession)getAttribute(SslFilter.SSL_SECURED);




  * SslFilter.setUseClientMode(boolean) no longer exists.


It's computed automatically:

sslEngine.setUseClientMode(!session.isServer());

You may want to add the isServer() method in your IoSession 
implementation, but by default it's defined in the AbstractIoSession to be :



@Override
public boolean isServer() {
return (getService() instanceof IoAcceptor);
}



WIth all that commented out, I'm still getting errors, but I'm not sure 
if that's the same error, or if I'm now seeing a new error because I 
broke StartTLS (which our test depends on)


Most certainly it's broken because of teh lack of clear text response 
before the filter is set. See the added filter upper.




On Thu, Mar 31, 2022 at 3:37 PM Emmanuel Lécharny > wrote:


Hi Guus,

I have successfully ran Apache Directory LDAP API and Server with MINA
2.2.0-SNAPSHOT, which has a fully rewritten SSL handling code.

It seems there are some kind of race condition in MINA 2.0.X/2.1.X
and I
expect MINA 2.2.X solve this issue.

Could you give it a try ? You'll have to build the 2.2.X branch:

$ git clone -b 2.2.X https://gitbox.apache.org/repos/asf/mina.git
 mina-2.2.X
$ cd mina-2.2.X
$ mvn clean install

Just let me know if it's any better...

On 31/03/2022 14:53, Guus der Kinderen wrote:
 > Hi Emanuel,
 >
 > I remember that you wrote that you were engaged in an epic battle
with
 > an elusive TLS 1.3 bug in MINA. I'm now running into an issue
that is
 > specific to TLS 1.3, which occurs in MINA 2.1.3 as well as 2.1.6
(I did
 > not try other versions), and does /not/ occur with a connection
manager
 > that is not powered by MINA.
 >
 > The work-around that a third party developer found is surprising.
They
 > add a 1ms delay before starting to send data over a socket that
has just
 > finished the TLS handshake. With that delay, the problem is
consistently
 > gone. Without that delay, it consistently is reproducible.
 >
 > Their evaluation of the problem is documented here:
 > https://github.com/xmppjs/xmpp.js/issues/889

 > >
 >
 > My questions:
 >
 >   * Does this relate to the issue that you were trying to solve?
 >   * Why do we _consistently_ suffer from this, assuming that
others are
 >     able to use MINA with TLS 1.3 at least some of the time?
 >   * How do we prevent this issue without depending on the client
 >     applying the 1ms sleep workaroud?
 >
 > Kind regards,
 >
 >    Guus

-- 
*Emmanuel Lécharny - CTO* 205 Promenade des Anglais – 06200 NICE

T. +33 (0)4 89 97 36 50
P. +33 (0)6 08 33 32 61
emmanuel.lecha...@busit.com 
https://www.busit.com/ 



--
*Emmanuel Lécharny - CTO* 205 Promenade des Anglais – 06200 NICE
T. +

[jira] [Work logged] (SSHD-1257) Shell is not getting closed if the command has already closed the OutputStream it is using.

2022-03-31 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/SSHD-1257?focusedWorklogId=751158&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-751158
 ]

ASF GitHub Bot logged work on SSHD-1257:


Author: ASF GitHub Bot
Created on: 31/Mar/22 18:15
Start Date: 31/Mar/22 18:15
Worklog Time Spent: 10m 
  Work Description: Vlatombe edited a comment on pull request #214:
URL: https://github.com/apache/mina-sshd/pull/214#issuecomment-1084944783


   Just thought of an easier alternative... `close` takes care of flushing 
already and is a no-op if already closed.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 751158)
Time Spent: 1h 20m  (was: 1h 10m)

> Shell is not getting closed if the command has already closed the 
> OutputStream it is using.
> ---
>
> Key: SSHD-1257
> URL: https://issues.apache.org/jira/browse/SSHD-1257
> Project: MINA SSHD
>  Issue Type: Bug
>Affects Versions: 2.9.0
>Reporter: Vincent Latombe
>Priority: Major
>  Time Spent: 1h 20m
>  Remaining Estimate: 0h
>
> When running a org.apache.sshd.server.command.Command, if it happens to close 
> the OutputStream instance it is using, then later when the ssh session 
> closes, it attempts to flush the output stream before closing it.
> This causes the  following warning to be printed on server side
> {code:java}
> WARNING o.a.s.s.channel.ChannelSession#lambda$prepareCommand$0: 
> onExit(ChannelSession[id=0, 
> recipient=0]-ServerSessionImpl[admin@/0:0:0:0:0:0:0:1:49944]) code=0 
> message='' SshChannelClosedException closing shell: 
> flush(ChannelOutputStream[ChannelSession[id=0, 
> recipient=0]-ServerSessionImpl[admin@/0:0:0:0:0:0:0:1:49944]] 
> SSH_MSG_CHANNEL_DATA) length=0 - stream is already closed
> {code}
> and EOF is never sent to client.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org



[GitHub] [mina-sshd] Vlatombe edited a comment on pull request #214: [SSHD-1257] Make ChannelOutputStream#flush no-op if the stream is already closed

2022-03-31 Thread GitBox


Vlatombe edited a comment on pull request #214:
URL: https://github.com/apache/mina-sshd/pull/214#issuecomment-1084944783


   Just thought of an easier alternative... `close` takes care of flushing 
already and is a no-op if already closed.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org



[jira] [Work logged] (SSHD-1257) Shell is not getting closed if the command has already closed the OutputStream it is using.

2022-03-31 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/SSHD-1257?focusedWorklogId=751157&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-751157
 ]

ASF GitHub Bot logged work on SSHD-1257:


Author: ASF GitHub Bot
Created on: 31/Mar/22 18:14
Start Date: 31/Mar/22 18:14
Worklog Time Spent: 10m 
  Work Description: Vlatombe commented on pull request #214:
URL: https://github.com/apache/mina-sshd/pull/214#issuecomment-1084944783


   Just thought of an easier alternative...


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 751157)
Time Spent: 1h 10m  (was: 1h)

> Shell is not getting closed if the command has already closed the 
> OutputStream it is using.
> ---
>
> Key: SSHD-1257
> URL: https://issues.apache.org/jira/browse/SSHD-1257
> Project: MINA SSHD
>  Issue Type: Bug
>Affects Versions: 2.9.0
>Reporter: Vincent Latombe
>Priority: Major
>  Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> When running a org.apache.sshd.server.command.Command, if it happens to close 
> the OutputStream instance it is using, then later when the ssh session 
> closes, it attempts to flush the output stream before closing it.
> This causes the  following warning to be printed on server side
> {code:java}
> WARNING o.a.s.s.channel.ChannelSession#lambda$prepareCommand$0: 
> onExit(ChannelSession[id=0, 
> recipient=0]-ServerSessionImpl[admin@/0:0:0:0:0:0:0:1:49944]) code=0 
> message='' SshChannelClosedException closing shell: 
> flush(ChannelOutputStream[ChannelSession[id=0, 
> recipient=0]-ServerSessionImpl[admin@/0:0:0:0:0:0:0:1:49944]] 
> SSH_MSG_CHANNEL_DATA) length=0 - stream is already closed
> {code}
> and EOF is never sent to client.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org



[GitHub] [mina-sshd] Vlatombe commented on pull request #214: [SSHD-1257] Make ChannelOutputStream#flush no-op if the stream is already closed

2022-03-31 Thread GitBox


Vlatombe commented on pull request #214:
URL: https://github.com/apache/mina-sshd/pull/214#issuecomment-1084944783


   Just thought of an easier alternative...


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org



[jira] [Work logged] (SSHD-1257) Shell is not getting closed if the command has already closed the OutputStream it is using.

2022-03-31 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/SSHD-1257?focusedWorklogId=751148&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-751148
 ]

ASF GitHub Bot logged work on SSHD-1257:


Author: ASF GitHub Bot
Created on: 31/Mar/22 18:04
Start Date: 31/Mar/22 18:04
Worklog Time Spent: 10m 
  Work Description: Vlatombe commented on pull request #214:
URL: https://github.com/apache/mina-sshd/pull/214#issuecomment-1084934389


   > But wouldn't it be more appropriate then to do inChannelSession line 910
   
   It's not as simple, because `isOpen` is only defined on 
`ChannelOutputStream` but depending on cases it can be wrapped in 
`LoggingFilterOutputStream`.
   
   See 
https://github.com/apache/mina-sshd/blob/da2958172281ef20e51681afe036bd42c9cf843a/sshd-core/src/main/java/org/apache/sshd/server/channel/ChannelSession.java#L733-L743


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 751148)
Time Spent: 1h  (was: 50m)

> Shell is not getting closed if the command has already closed the 
> OutputStream it is using.
> ---
>
> Key: SSHD-1257
> URL: https://issues.apache.org/jira/browse/SSHD-1257
> Project: MINA SSHD
>  Issue Type: Bug
>Affects Versions: 2.9.0
>Reporter: Vincent Latombe
>Priority: Major
>  Time Spent: 1h
>  Remaining Estimate: 0h
>
> When running a org.apache.sshd.server.command.Command, if it happens to close 
> the OutputStream instance it is using, then later when the ssh session 
> closes, it attempts to flush the output stream before closing it.
> This causes the  following warning to be printed on server side
> {code:java}
> WARNING o.a.s.s.channel.ChannelSession#lambda$prepareCommand$0: 
> onExit(ChannelSession[id=0, 
> recipient=0]-ServerSessionImpl[admin@/0:0:0:0:0:0:0:1:49944]) code=0 
> message='' SshChannelClosedException closing shell: 
> flush(ChannelOutputStream[ChannelSession[id=0, 
> recipient=0]-ServerSessionImpl[admin@/0:0:0:0:0:0:0:1:49944]] 
> SSH_MSG_CHANNEL_DATA) length=0 - stream is already closed
> {code}
> and EOF is never sent to client.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org



[GitHub] [mina-sshd] Vlatombe commented on pull request #214: [SSHD-1257] Make ChannelOutputStream#flush no-op if the stream is already closed

2022-03-31 Thread GitBox


Vlatombe commented on pull request #214:
URL: https://github.com/apache/mina-sshd/pull/214#issuecomment-1084934389


   > But wouldn't it be more appropriate then to do inChannelSession line 910
   
   It's not as simple, because `isOpen` is only defined on 
`ChannelOutputStream` but depending on cases it can be wrapped in 
`LoggingFilterOutputStream`.
   
   See 
https://github.com/apache/mina-sshd/blob/da2958172281ef20e51681afe036bd42c9cf843a/sshd-core/src/main/java/org/apache/sshd/server/channel/ChannelSession.java#L733-L743


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org



[jira] [Work logged] (SSHD-1257) Shell is not getting closed if the command has already closed the OutputStream it is using.

2022-03-31 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/SSHD-1257?focusedWorklogId=751066&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-751066
 ]

ASF GitHub Bot logged work on SSHD-1257:


Author: ASF GitHub Bot
Created on: 31/Mar/22 16:40
Start Date: 31/Mar/22 16:40
Worklog Time Spent: 10m 
  Work Description: lgoldstein commented on a change in pull request #214:
URL: https://github.com/apache/mina-sshd/pull/214#discussion_r839816593



##
File path: 
sshd-core/src/main/java/org/apache/sshd/common/channel/ChannelOutputStream.java
##
@@ -195,9 +195,7 @@ public synchronized void write(byte[] buf, int s, int l) 
throws IOException {
 public synchronized void flush() throws IOException {
 Channel channel = getChannel();
 if (!isOpen()) {

Review comment:
   I agree with [~tomaswolf]-s suggestion...




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 751066)
Time Spent: 50m  (was: 40m)

> Shell is not getting closed if the command has already closed the 
> OutputStream it is using.
> ---
>
> Key: SSHD-1257
> URL: https://issues.apache.org/jira/browse/SSHD-1257
> Project: MINA SSHD
>  Issue Type: Bug
>Affects Versions: 2.9.0
>Reporter: Vincent Latombe
>Priority: Major
>  Time Spent: 50m
>  Remaining Estimate: 0h
>
> When running a org.apache.sshd.server.command.Command, if it happens to close 
> the OutputStream instance it is using, then later when the ssh session 
> closes, it attempts to flush the output stream before closing it.
> This causes the  following warning to be printed on server side
> {code:java}
> WARNING o.a.s.s.channel.ChannelSession#lambda$prepareCommand$0: 
> onExit(ChannelSession[id=0, 
> recipient=0]-ServerSessionImpl[admin@/0:0:0:0:0:0:0:1:49944]) code=0 
> message='' SshChannelClosedException closing shell: 
> flush(ChannelOutputStream[ChannelSession[id=0, 
> recipient=0]-ServerSessionImpl[admin@/0:0:0:0:0:0:0:1:49944]] 
> SSH_MSG_CHANNEL_DATA) length=0 - stream is already closed
> {code}
> and EOF is never sent to client.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org



[jira] [Work logged] (SSHD-1257) Shell is not getting closed if the command has already closed the OutputStream it is using.

2022-03-31 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/SSHD-1257?focusedWorklogId=751065&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-751065
 ]

ASF GitHub Bot logged work on SSHD-1257:


Author: ASF GitHub Bot
Created on: 31/Mar/22 16:39
Start Date: 31/Mar/22 16:39
Worklog Time Spent: 10m 
  Work Description: lgoldstein commented on a change in pull request #214:
URL: https://github.com/apache/mina-sshd/pull/214#discussion_r839815525



##
File path: 
sshd-core/src/main/java/org/apache/sshd/common/channel/ChannelOutputStream.java
##
@@ -195,9 +195,7 @@ public synchronized void write(byte[] buf, int s, int l) 
throws IOException {
 public synchronized void flush() throws IOException {
 Channel channel = getChannel();
 if (!isOpen()) {

Review comment:
   I don't think this is a good idea - what if the user meant to flush the 
stream but did not notice it is closed. The code would simply "swallow" the 
exception. AFAIK the stream contract is clear: do not call **any** method after 
calling *close()* (one *can* call *close()* as many times as one wants since it 
is idempotent),




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 751065)
Time Spent: 40m  (was: 0.5h)

> Shell is not getting closed if the command has already closed the 
> OutputStream it is using.
> ---
>
> Key: SSHD-1257
> URL: https://issues.apache.org/jira/browse/SSHD-1257
> Project: MINA SSHD
>  Issue Type: Bug
>Affects Versions: 2.9.0
>Reporter: Vincent Latombe
>Priority: Major
>  Time Spent: 40m
>  Remaining Estimate: 0h
>
> When running a org.apache.sshd.server.command.Command, if it happens to close 
> the OutputStream instance it is using, then later when the ssh session 
> closes, it attempts to flush the output stream before closing it.
> This causes the  following warning to be printed on server side
> {code:java}
> WARNING o.a.s.s.channel.ChannelSession#lambda$prepareCommand$0: 
> onExit(ChannelSession[id=0, 
> recipient=0]-ServerSessionImpl[admin@/0:0:0:0:0:0:0:1:49944]) code=0 
> message='' SshChannelClosedException closing shell: 
> flush(ChannelOutputStream[ChannelSession[id=0, 
> recipient=0]-ServerSessionImpl[admin@/0:0:0:0:0:0:0:1:49944]] 
> SSH_MSG_CHANNEL_DATA) length=0 - stream is already closed
> {code}
> and EOF is never sent to client.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org



[GitHub] [mina-sshd] lgoldstein commented on a change in pull request #214: [SSHD-1257] Make ChannelOutputStream#flush no-op if the stream is already closed

2022-03-31 Thread GitBox


lgoldstein commented on a change in pull request #214:
URL: https://github.com/apache/mina-sshd/pull/214#discussion_r839816593



##
File path: 
sshd-core/src/main/java/org/apache/sshd/common/channel/ChannelOutputStream.java
##
@@ -195,9 +195,7 @@ public synchronized void write(byte[] buf, int s, int l) 
throws IOException {
 public synchronized void flush() throws IOException {
 Channel channel = getChannel();
 if (!isOpen()) {

Review comment:
   I agree with [~tomaswolf]-s suggestion...




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org



[GitHub] [mina-sshd] lgoldstein commented on a change in pull request #214: [SSHD-1257] Make ChannelOutputStream#flush no-op if the stream is already closed

2022-03-31 Thread GitBox


lgoldstein commented on a change in pull request #214:
URL: https://github.com/apache/mina-sshd/pull/214#discussion_r839815525



##
File path: 
sshd-core/src/main/java/org/apache/sshd/common/channel/ChannelOutputStream.java
##
@@ -195,9 +195,7 @@ public synchronized void write(byte[] buf, int s, int l) 
throws IOException {
 public synchronized void flush() throws IOException {
 Channel channel = getChannel();
 if (!isOpen()) {

Review comment:
   I don't think this is a good idea - what if the user meant to flush the 
stream but did not notice it is closed. The code would simply "swallow" the 
exception. AFAIK the stream contract is clear: do not call **any** method after 
calling *close()* (one *can* call *close()* as many times as one wants since it 
is idempotent),




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org



[jira] [Work logged] (SSHD-1257) Shell is not getting closed if the command has already closed the OutputStream it is using.

2022-03-31 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/SSHD-1257?focusedWorklogId=751040&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-751040
 ]

ASF GitHub Bot logged work on SSHD-1257:


Author: ASF GitHub Bot
Created on: 31/Mar/22 15:36
Start Date: 31/Mar/22 15:36
Worklog Time Spent: 10m 
  Work Description: tomaswolf commented on pull request #214:
URL: https://github.com/apache/mina-sshd/pull/214#issuecomment-1084756936


   But wouldn't it be more appropriate then to do in`ChannelSession` line 910
   ```
   if (out != null && out.isOpen()) {
 out.flush();
   }
   ```
   ?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 751040)
Time Spent: 0.5h  (was: 20m)

> Shell is not getting closed if the command has already closed the 
> OutputStream it is using.
> ---
>
> Key: SSHD-1257
> URL: https://issues.apache.org/jira/browse/SSHD-1257
> Project: MINA SSHD
>  Issue Type: Bug
>Affects Versions: 2.9.0
>Reporter: Vincent Latombe
>Priority: Major
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> When running a org.apache.sshd.server.command.Command, if it happens to close 
> the OutputStream instance it is using, then later when the ssh session 
> closes, it attempts to flush the output stream before closing it.
> This causes the  following warning to be printed on server side
> {code:java}
> WARNING o.a.s.s.channel.ChannelSession#lambda$prepareCommand$0: 
> onExit(ChannelSession[id=0, 
> recipient=0]-ServerSessionImpl[admin@/0:0:0:0:0:0:0:1:49944]) code=0 
> message='' SshChannelClosedException closing shell: 
> flush(ChannelOutputStream[ChannelSession[id=0, 
> recipient=0]-ServerSessionImpl[admin@/0:0:0:0:0:0:0:1:49944]] 
> SSH_MSG_CHANNEL_DATA) length=0 - stream is already closed
> {code}
> and EOF is never sent to client.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org



[GitHub] [mina-sshd] tomaswolf commented on pull request #214: [SSHD-1257] Make ChannelOutputStream#flush no-op if the stream is already closed

2022-03-31 Thread GitBox


tomaswolf commented on pull request #214:
URL: https://github.com/apache/mina-sshd/pull/214#issuecomment-1084756936


   But wouldn't it be more appropriate then to do in`ChannelSession` line 910
   ```
   if (out != null && out.isOpen()) {
 out.flush();
   }
   ```
   ?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org



[jira] [Work logged] (SSHD-1257) Shell is not getting closed if the command has already closed the OutputStream it is using.

2022-03-31 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/SSHD-1257?focusedWorklogId=751013&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-751013
 ]

ASF GitHub Bot logged work on SSHD-1257:


Author: ASF GitHub Bot
Created on: 31/Mar/22 14:24
Start Date: 31/Mar/22 14:24
Worklog Time Spent: 10m 
  Work Description: Vlatombe commented on pull request #214:
URL: https://github.com/apache/mina-sshd/pull/214#issuecomment-1084658513


   @jglick 
https://github.com/apache/mina-sshd/blob/da2958172281ef20e51681afe036bd42c9cf843a/sshd-core/src/main/java/org/apache/sshd/server/channel/ChannelSession.java#L910-L912


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 751013)
Time Spent: 20m  (was: 10m)

> Shell is not getting closed if the command has already closed the 
> OutputStream it is using.
> ---
>
> Key: SSHD-1257
> URL: https://issues.apache.org/jira/browse/SSHD-1257
> Project: MINA SSHD
>  Issue Type: Bug
>Affects Versions: 2.9.0
>Reporter: Vincent Latombe
>Priority: Major
>  Time Spent: 20m
>  Remaining Estimate: 0h
>
> When running a org.apache.sshd.server.command.Command, if it happens to close 
> the OutputStream instance it is using, then later when the ssh session 
> closes, it attempts to flush the output stream before closing it.
> This causes the  following warning to be printed on server side
> {code:java}
> WARNING o.a.s.s.channel.ChannelSession#lambda$prepareCommand$0: 
> onExit(ChannelSession[id=0, 
> recipient=0]-ServerSessionImpl[admin@/0:0:0:0:0:0:0:1:49944]) code=0 
> message='' SshChannelClosedException closing shell: 
> flush(ChannelOutputStream[ChannelSession[id=0, 
> recipient=0]-ServerSessionImpl[admin@/0:0:0:0:0:0:0:1:49944]] 
> SSH_MSG_CHANNEL_DATA) length=0 - stream is already closed
> {code}
> and EOF is never sent to client.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org



[GitHub] [mina-sshd] Vlatombe commented on pull request #214: [SSHD-1257] Make ChannelOutputStream#flush no-op if the stream is already closed

2022-03-31 Thread GitBox


Vlatombe commented on pull request #214:
URL: https://github.com/apache/mina-sshd/pull/214#issuecomment-1084658513


   @jglick 
https://github.com/apache/mina-sshd/blob/da2958172281ef20e51681afe036bd42c9cf843a/sshd-core/src/main/java/org/apache/sshd/server/channel/ChannelSession.java#L910-L912


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org



[jira] [Work logged] (SSHD-1257) Shell is not getting closed if the command has already closed the OutputStream it is using.

2022-03-31 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/SSHD-1257?focusedWorklogId=750994&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-750994
 ]

ASF GitHub Bot logged work on SSHD-1257:


Author: ASF GitHub Bot
Created on: 31/Mar/22 13:51
Start Date: 31/Mar/22 13:51
Worklog Time Spent: 10m 
  Work Description: Vlatombe opened a new pull request #214:
URL: https://github.com/apache/mina-sshd/pull/214


   [SSHD-1257](https://issues.apache.org/jira/browse/SSHD-1257)
   
   If the command implementation closes the output stream at the end of its 
execution, the ssh server hangs.
   This changes the `ChannelOutputStream#flush` to become a no-op if it has 
been closed already.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 750994)
Remaining Estimate: 0h
Time Spent: 10m

> Shell is not getting closed if the command has already closed the 
> OutputStream it is using.
> ---
>
> Key: SSHD-1257
> URL: https://issues.apache.org/jira/browse/SSHD-1257
> Project: MINA SSHD
>  Issue Type: Bug
>Affects Versions: 2.9.0
>Reporter: Vincent Latombe
>Priority: Major
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> When running a org.apache.sshd.server.command.Command, if it happens to close 
> the OutputStream instance it is using, then later when the ssh session 
> closes, it attempts to flush the output stream before closing it.
> This causes the  following warning to be printed on server side
> {code:java}
> WARNING o.a.s.s.channel.ChannelSession#lambda$prepareCommand$0: 
> onExit(ChannelSession[id=0, 
> recipient=0]-ServerSessionImpl[admin@/0:0:0:0:0:0:0:1:49944]) code=0 
> message='' SshChannelClosedException closing shell: 
> flush(ChannelOutputStream[ChannelSession[id=0, 
> recipient=0]-ServerSessionImpl[admin@/0:0:0:0:0:0:0:1:49944]] 
> SSH_MSG_CHANNEL_DATA) length=0 - stream is already closed
> {code}
> and EOF is never sent to client.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org



[GitHub] [mina-sshd] Vlatombe opened a new pull request #214: [SSHD-1257] Make ChannelOutputStream#flush no-op if the stream is already closed

2022-03-31 Thread GitBox


Vlatombe opened a new pull request #214:
URL: https://github.com/apache/mina-sshd/pull/214


   [SSHD-1257](https://issues.apache.org/jira/browse/SSHD-1257)
   
   If the command implementation closes the output stream at the end of its 
execution, the ssh server hangs.
   This changes the `ChannelOutputStream#flush` to become a no-op if it has 
been closed already.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org



[jira] [Created] (SSHD-1257) Shell is not getting closed if the command has already closed the OutputStream it is using.

2022-03-31 Thread Vincent Latombe (Jira)
Vincent Latombe created SSHD-1257:
-

 Summary: Shell is not getting closed if the command has already 
closed the OutputStream it is using.
 Key: SSHD-1257
 URL: https://issues.apache.org/jira/browse/SSHD-1257
 Project: MINA SSHD
  Issue Type: Bug
Affects Versions: 2.9.0
Reporter: Vincent Latombe


When running a org.apache.sshd.server.command.Command, if it happens to close 
the OutputStream instance it is using, then later when the ssh session closes, 
it attempts to flush the output stream before closing it.

This causes the  following warning to be printed on server side
{code:java}
WARNING o.a.s.s.channel.ChannelSession#lambda$prepareCommand$0: 
onExit(ChannelSession[id=0, 
recipient=0]-ServerSessionImpl[admin@/0:0:0:0:0:0:0:1:49944]) code=0 message='' 
SshChannelClosedException closing shell: 
flush(ChannelOutputStream[ChannelSession[id=0, 
recipient=0]-ServerSessionImpl[admin@/0:0:0:0:0:0:0:1:49944]] 
SSH_MSG_CHANNEL_DATA) length=0 - stream is already closed
{code}
and EOF is never sent to client.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org



Re: Releasing a MINA 2.2.0-alpha soon ?

2022-03-31 Thread Emmanuel Lécharny

Ok, pb fixed with an added filter.

Now, I still get a NPE while trying to access the peerCertificate from 
the session, even after the Handshake has been completed...


On 30/03/2022 18:02, Emmanuel Lécharny wrote:

Hi Jonathan,

no, it's just that we try to send a clear text message after having set 
the SSLFilter, pretty much as what we had to workaround in Directory. 
I'm going to fix that.


On 25/03/2022 19:48, Jonathan Valliere wrote:

Are you trying to get the peer cert after the filter emits the connected
after the handshake completes? If you do it too early it won’t populate.

On Fri, Mar 25, 2022 at 2:33 PM Emmanuel Lécharny 
wrote:


Hi!

following the effort put in rewriting the Sslfilter (and all the inner
code) by Jonathan lately, I would like to know if we could mive forward
with an alpha version of this work.

I have tested it with Apache LDAP API and Apache Directory Server, with
success. I still have some work to do on FtpServer to have it working
with 2.2.X, we get some NPE when trying to fetch the peer certificate
from the SSLSession (for some unkown reason, when I call
sslSession.getPeerCertiticate() it returns null).

Wdyt ?
--
*Emmanuel Lécharny - CTO* 205 Promenade des Anglais – 06200 NICE
 


T. +33 (0)4 89 97 36 50
P. +33 (0)6 08 33 32 61
emmanuel.lecha...@busit.com https://www.busit.com/

-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org








--
*Emmanuel Lécharny - CTO* 205 Promenade des Anglais – 06200 NICE
T. +33 (0)4 89 97 36 50
P. +33 (0)6 08 33 32 61
emmanuel.lecha...@busit.com https://www.busit.com/

-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org