[jira] [Commented] (SSHD-953) ProcessShellCommandFactory does not parse quoted arguments correctly

2019-10-29 Thread Lyor Goldstein (Jira)


[ 
https://issues.apache.org/jira/browse/SSHD-953?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16962241#comment-16962241
 ] 

Lyor Goldstein commented on SSHD-953:
-

I disagree - why should the command parser strip quotes ? After all they +mean+ 
something and are not there just as syntactic sugar - i.e., the shell 
interpreter handles them in a special manner. Please note that as a  quick 
workaround you can write +your own+ command factory that creates a 
{{ShellFactory}} instance from an +array+ of strings that is the result of 
parsing it your way...

Specifically for SCP why not use the [MINA SSHD SCP 
client|https://github.com/apache/mina-sshd/blob/master/docs/scp.md] instead of 
a command and avoid these issues?

> ProcessShellCommandFactory does not parse quoted arguments correctly
> 
>
> Key: SSHD-953
> URL: https://issues.apache.org/jira/browse/SSHD-953
> Project: MINA SSHD
>  Issue Type: Improvement
>Affects Versions: 2.3.0
>Reporter: Niklas Rosenstein
>Priority: Minor
>
> {code:java}
> sshServer.setCommandFactory(new ProcessShellCommandFactory();
> {code}
> This command factory does not parse quoted arguments correctly. Example:
> {code}
> "scp -t -r -p '/Volumes/data/input.csv'"
> {code}
> The last argument is parsed as
> {code}
> "'/Volumes/git/data/input.csv'"
> {code}
> when it should be parsed as
> {code}
> "/Volumes/git/data/input.csv"
> {code}
> (note the missing single quotes)
> The implementation of the parsing uses {{GenericUtils.split()}} rather than a 
> function that handles quotes correctly.
> {code}
> ShellFactory factory = new 
> ProcessShellFactory(GenericUtils.split(command, ' '));
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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



[jira] [Updated] (SSHD-953) ProcessShellCommandFactory does not parse quoted arguments correctly

2019-10-29 Thread Lyor Goldstein (Jira)


 [ 
https://issues.apache.org/jira/browse/SSHD-953?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Lyor Goldstein updated SSHD-953:

Issue Type: Improvement  (was: Bug)

> ProcessShellCommandFactory does not parse quoted arguments correctly
> 
>
> Key: SSHD-953
> URL: https://issues.apache.org/jira/browse/SSHD-953
> Project: MINA SSHD
>  Issue Type: Improvement
>Affects Versions: 2.3.0
>Reporter: Niklas Rosenstein
>Priority: Minor
>
> {code:java}
> sshServer.setCommandFactory(new ProcessShellCommandFactory();
> {code}
> This command factory does not parse quoted arguments correctly. Example:
> {code}
> "scp -t -r -p '/Volumes/data/input.csv'"
> {code}
> The last argument is parsed as
> {code}
> "'/Volumes/git/data/input.csv'"
> {code}
> when it should be parsed as
> {code}
> "/Volumes/git/data/input.csv"
> {code}
> (note the missing single quotes)
> The implementation of the parsing uses {{GenericUtils.split()}} rather than a 
> function that handles quotes correctly.
> {code}
> ShellFactory factory = new 
> ProcessShellFactory(GenericUtils.split(command, ' '));
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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



[jira] [Updated] (SSHD-953) ProcessShellCommandFactory does not parse quoted arguments correctly

2019-10-29 Thread Lyor Goldstein (Jira)


 [ 
https://issues.apache.org/jira/browse/SSHD-953?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Lyor Goldstein updated SSHD-953:

Priority: Minor  (was: Major)

> ProcessShellCommandFactory does not parse quoted arguments correctly
> 
>
> Key: SSHD-953
> URL: https://issues.apache.org/jira/browse/SSHD-953
> Project: MINA SSHD
>  Issue Type: Bug
>Affects Versions: 2.3.0
>Reporter: Niklas Rosenstein
>Priority: Minor
>
> {code:java}
> sshServer.setCommandFactory(new ProcessShellCommandFactory();
> {code}
> This command factory does not parse quoted arguments correctly. Example:
> {code}
> "scp -t -r -p '/Volumes/data/input.csv'"
> {code}
> The last argument is parsed as
> {code}
> "'/Volumes/git/data/input.csv'"
> {code}
> when it should be parsed as
> {code}
> "/Volumes/git/data/input.csv"
> {code}
> (note the missing single quotes)
> The implementation of the parsing uses {{GenericUtils.split()}} rather than a 
> function that handles quotes correctly.
> {code}
> ShellFactory factory = new 
> ProcessShellFactory(GenericUtils.split(command, ' '));
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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



[jira] [Commented] (SSHD-952) What is the expected behavior of waitForSpace(long millis) method on default timeout of 30 seconds

2019-10-29 Thread Lyor Goldstein (Jira)


[ 
https://issues.apache.org/jira/browse/SSHD-952?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16962231#comment-16962231
 ] 

Lyor Goldstein commented on SSHD-952:
-

{quote}
on timeout thread get released and it spawns a new thread on timeout
{quote}
I think it only +seems+ that way - reminder: the code is using +asynchronous 
NIO+ calls along with a thread pool. I think what happens here is that after 
one thread times out, another thread takes its place and waits for space to 
become available. IMO, the more interesting question to ask is +why+ is there a 
timeout on waiting for channel data space.

> What is the expected behavior of waitForSpace(long millis) method on default 
> timeout of 30 seconds
> --
>
> Key: SSHD-952
> URL: https://issues.apache.org/jira/browse/SSHD-952
> Project: MINA SSHD
>  Issue Type: Question
>Affects Versions: 2.2.0
>Reporter: Anudeep
>Priority: Major
>
> Hi Team,
> Can you please let us know the expected behavior of waitForSpace(long millis) 
> method of Window.java class . As per our test we see on timeout thread get 
> released and it spawns a new thread on timeout. Is this an expected behavior ?
> 2019-10-24 12:33:26,123 DEBUG [org.apache.sshd.server.channel.ChannelSession] 
> (Thread-44 (HornetQ-client-global-threads-407809182)) 
> flush(ChannelOutputStream[ChannelSession[id=0, 
> recipient=43]-ServerSessionImpl[administrator@/141.137.237.205:58628]] 
> SSH_MSG_CHANNEL_DATA) failed (SocketTimeoutException) to wait for space of 
> len=1190: waitForCondition(Window[server/remote](ChannelSession[id=0, 
> recipient=43]-ServerSessionImpl[administrator@/141.137.237.205:58628])) 
> timeout exceeded: 2
> 2019-10-24 12:33:46,126 DEBUG [org.apache.sshd.server.channel.ChannelSession] 
> (Thread-44 (HornetQ-client-global-threads-407809182)) 
> flush(ChannelOutputStream[ChannelSession[id=0, 
> recipient=43]-ServerSessionImpl[administrator@/141.137.237.205:58628]] 
> SSH_MSG_CHANNEL_DATA) failed (SocketTimeoutException) to wait for space of 
> len=1190: waitForCondition(Window[server/remote](ChannelSession[id=0, 
> recipient=43]-ServerSessionImpl[administrator@/141.137.237.205:58628])) 
> timeout exceeded: 2
> 2019-10-24 12:34:06,129 DEBUG [org.apache.sshd.server.channel.ChannelSession] 
> (Thread-44 (HornetQ-client-global-threads-407809182)) 
> flush(ChannelOutputStream[ChannelSession[id=0, 
> recipient=43]-ServerSessionImpl[administrator@/141.137.237.205:58628]] 
> SSH_MSG_CHANNEL_DATA) failed (SocketTimeoutException) to wait for space of 
> len=1190: waitForCondition(Window[server/remote](ChannelSession[id=0, 
> recipient=43]-ServerSessionImpl[administrator@/141.137.237.205:58628])) 
> timeout exceeded: 2



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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



[jira] [Commented] (SSHD-952) What is the expected behavior of waitForSpace(long millis) method on default timeout of 30 seconds

2019-10-29 Thread Lyor Goldstein (Jira)


[ 
https://issues.apache.org/jira/browse/SSHD-952?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16962225#comment-16962225
 ] 

Lyor Goldstein commented on SSHD-952:
-

{quote}
the expected behavior of waitForSpace(long millis) method of Window.java class
{quote}
See the Javadoc:
{quote}
Waits until some data becomes available or timeout expires
{quote}
Quick reminder: according to [RFC-4254 - section 
5|https://tools.ietf.org/html/rfc4254#section-5]
{quote}
Channels are flow-controlled.  No data may be sent to a channel until
 a message is received to indicate that window space is available.
{quote}
This code simply implements that logic

> What is the expected behavior of waitForSpace(long millis) method on default 
> timeout of 30 seconds
> --
>
> Key: SSHD-952
> URL: https://issues.apache.org/jira/browse/SSHD-952
> Project: MINA SSHD
>  Issue Type: Question
>Affects Versions: 2.2.0
>Reporter: Anudeep
>Priority: Major
>
> Hi Team,
> Can you please let us know the expected behavior of waitForSpace(long millis) 
> method of Window.java class . As per our test we see on timeout thread get 
> released and it spawns a new thread on timeout. Is this an expected behavior ?
> 2019-10-24 12:33:26,123 DEBUG [org.apache.sshd.server.channel.ChannelSession] 
> (Thread-44 (HornetQ-client-global-threads-407809182)) 
> flush(ChannelOutputStream[ChannelSession[id=0, 
> recipient=43]-ServerSessionImpl[administrator@/141.137.237.205:58628]] 
> SSH_MSG_CHANNEL_DATA) failed (SocketTimeoutException) to wait for space of 
> len=1190: waitForCondition(Window[server/remote](ChannelSession[id=0, 
> recipient=43]-ServerSessionImpl[administrator@/141.137.237.205:58628])) 
> timeout exceeded: 2
> 2019-10-24 12:33:46,126 DEBUG [org.apache.sshd.server.channel.ChannelSession] 
> (Thread-44 (HornetQ-client-global-threads-407809182)) 
> flush(ChannelOutputStream[ChannelSession[id=0, 
> recipient=43]-ServerSessionImpl[administrator@/141.137.237.205:58628]] 
> SSH_MSG_CHANNEL_DATA) failed (SocketTimeoutException) to wait for space of 
> len=1190: waitForCondition(Window[server/remote](ChannelSession[id=0, 
> recipient=43]-ServerSessionImpl[administrator@/141.137.237.205:58628])) 
> timeout exceeded: 2
> 2019-10-24 12:34:06,129 DEBUG [org.apache.sshd.server.channel.ChannelSession] 
> (Thread-44 (HornetQ-client-global-threads-407809182)) 
> flush(ChannelOutputStream[ChannelSession[id=0, 
> recipient=43]-ServerSessionImpl[administrator@/141.137.237.205:58628]] 
> SSH_MSG_CHANNEL_DATA) failed (SocketTimeoutException) to wait for space of 
> len=1190: waitForCondition(Window[server/remote](ChannelSession[id=0, 
> recipient=43]-ServerSessionImpl[administrator@/141.137.237.205:58628])) 
> timeout exceeded: 2



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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



[jira] [Updated] (SSHD-953) ProcessShellCommandFactory does not parse quoted arguments correctly

2019-10-29 Thread Niklas Rosenstein (Jira)


 [ 
https://issues.apache.org/jira/browse/SSHD-953?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Niklas Rosenstein updated SSHD-953:
---
Description: 
{code:java}
sshServer.setCommandFactory(new ProcessShellCommandFactory();
{code}

This command factory does not parse quoted arguments correctly. Example:

{code}
"scp -t -r -p '/Volumes/git/data/input.csv'"
{code}

The last argument is parsed as

{code}
"'/Volumes/git/data/input.csv'"
{code}

when it should be parsed as

{code}
"/Volumes/git/data/input.csv"
{code}

(note the missing single quotes)

The implementation of the parsing uses {{GenericUtils.split()}} rather than a 
function that handles quotes correctly.

{code}
ShellFactory factory = new 
ProcessShellFactory(GenericUtils.split(command, ' '));
{code}


  was:
{code:java}
sshServer.setCommandFactory(new ProcessShellCommandFactory();

{code}
{code:java}
 {code}


> ProcessShellCommandFactory does not parse quoted arguments correctly
> 
>
> Key: SSHD-953
> URL: https://issues.apache.org/jira/browse/SSHD-953
> Project: MINA SSHD
>  Issue Type: Bug
>Affects Versions: 2.3.0
>Reporter: Niklas Rosenstein
>Priority: Major
>
> {code:java}
> sshServer.setCommandFactory(new ProcessShellCommandFactory();
> {code}
> This command factory does not parse quoted arguments correctly. Example:
> {code}
> "scp -t -r -p '/Volumes/git/data/input.csv'"
> {code}
> The last argument is parsed as
> {code}
> "'/Volumes/git/data/input.csv'"
> {code}
> when it should be parsed as
> {code}
> "/Volumes/git/data/input.csv"
> {code}
> (note the missing single quotes)
> The implementation of the parsing uses {{GenericUtils.split()}} rather than a 
> function that handles quotes correctly.
> {code}
> ShellFactory factory = new 
> ProcessShellFactory(GenericUtils.split(command, ' '));
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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



[jira] [Updated] (SSHD-953) ProcessShellCommandFactory does not parse quoted arguments correctly

2019-10-29 Thread Niklas Rosenstein (Jira)


 [ 
https://issues.apache.org/jira/browse/SSHD-953?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Niklas Rosenstein updated SSHD-953:
---
Description: 
{code:java}
sshServer.setCommandFactory(new ProcessShellCommandFactory();
{code}

This command factory does not parse quoted arguments correctly. Example:

{code}
"scp -t -r -p '/Volumes/data/input.csv'"
{code}

The last argument is parsed as

{code}
"'/Volumes/git/data/input.csv'"
{code}

when it should be parsed as

{code}
"/Volumes/git/data/input.csv"
{code}

(note the missing single quotes)

The implementation of the parsing uses {{GenericUtils.split()}} rather than a 
function that handles quotes correctly.

{code}
ShellFactory factory = new 
ProcessShellFactory(GenericUtils.split(command, ' '));
{code}


  was:
{code:java}
sshServer.setCommandFactory(new ProcessShellCommandFactory();
{code}

This command factory does not parse quoted arguments correctly. Example:

{code}
"scp -t -r -p '/Volumes/git/data/input.csv'"
{code}

The last argument is parsed as

{code}
"'/Volumes/git/data/input.csv'"
{code}

when it should be parsed as

{code}
"/Volumes/git/data/input.csv"
{code}

(note the missing single quotes)

The implementation of the parsing uses {{GenericUtils.split()}} rather than a 
function that handles quotes correctly.

{code}
ShellFactory factory = new 
ProcessShellFactory(GenericUtils.split(command, ' '));
{code}



> ProcessShellCommandFactory does not parse quoted arguments correctly
> 
>
> Key: SSHD-953
> URL: https://issues.apache.org/jira/browse/SSHD-953
> Project: MINA SSHD
>  Issue Type: Bug
>Affects Versions: 2.3.0
>Reporter: Niklas Rosenstein
>Priority: Major
>
> {code:java}
> sshServer.setCommandFactory(new ProcessShellCommandFactory();
> {code}
> This command factory does not parse quoted arguments correctly. Example:
> {code}
> "scp -t -r -p '/Volumes/data/input.csv'"
> {code}
> The last argument is parsed as
> {code}
> "'/Volumes/git/data/input.csv'"
> {code}
> when it should be parsed as
> {code}
> "/Volumes/git/data/input.csv"
> {code}
> (note the missing single quotes)
> The implementation of the parsing uses {{GenericUtils.split()}} rather than a 
> function that handles quotes correctly.
> {code}
> ShellFactory factory = new 
> ProcessShellFactory(GenericUtils.split(command, ' '));
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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



[jira] [Created] (SSHD-953) ProcessShellCommandFactory does not parse quoted arguments correctly

2019-10-29 Thread Niklas Rosenstein (Jira)
Niklas Rosenstein created SSHD-953:
--

 Summary: ProcessShellCommandFactory does not parse quoted 
arguments correctly
 Key: SSHD-953
 URL: https://issues.apache.org/jira/browse/SSHD-953
 Project: MINA SSHD
  Issue Type: Bug
Affects Versions: 2.3.0
Reporter: Niklas Rosenstein


{code:java}
sshServer.setCommandFactory(new ProcessShellCommandFactory();

{code}
{code:java}
 {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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



[jira] [Commented] (SSHD-951) Query on how to restart sshd server in single jboss session

2019-10-29 Thread Sivanagarajup (Jira)


[ 
https://issues.apache.org/jira/browse/SSHD-951?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16961759#comment-16961759
 ] 

Sivanagarajup commented on SSHD-951:


Hi [~lgoldstein],

Thank you for quick response.

We tried by setting same old keyprovider for new sshd instance, now able to 
start ssh session after every restart.

We will post if any other issues on this way.

Regards

Siva

> Query on how to restart sshd server in single jboss session
> ---
>
> Key: SSHD-951
> URL: https://issues.apache.org/jira/browse/SSHD-951
> Project: MINA SSHD
>  Issue Type: Question
>Affects Versions: 2.2.0
>Reporter: Sivanagarajup
>Priority: Major
>
> Hi Team,
> We are facing an issue with version *sshd-core-2.2.0*
> In the same session once we stoped ssh server we are not able to start the 
> ssh server again.
> it is throwing exception below
> {code:java}
> Caused by: java.lang.IllegalStateException: Can not start the server again
> Caused by: java.lang.IllegalStateException: Can not start the server again at 
> org.apache.sshd.server.SshServer.start(SshServer.java:293) 
> {code}
> As per your code in *org.apache.sshd.server.SshServer -> start()*
> {code:java}
> public void start() throws IOException {
>if (isClosed()) {
> throw new IllegalStateException("Can not start the server again");
>}
> --
> --
> }{code}
>  it is not allowing us to start sshd server again.
> Note: Once we restarted our jboss server then we are able to start sshd 
> server. 
> But we need to start/stop the ssh server multiple times in single session
> Could you please help us on above issue.
>  
> Thanks
> Siva



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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



[jira] [Created] (SSHD-952) What is the expected behavior of waitForSpace(long millis) method on default timeout of 30 seconds

2019-10-29 Thread Anudeep (Jira)
Anudeep created SSHD-952:


 Summary: What is the expected behavior of waitForSpace(long 
millis) method on default timeout of 30 seconds
 Key: SSHD-952
 URL: https://issues.apache.org/jira/browse/SSHD-952
 Project: MINA SSHD
  Issue Type: Question
Affects Versions: 2.2.0
Reporter: Anudeep


Hi Team,

Can you please let us know the expected behavior of waitForSpace(long millis) 
method of Window.java class . As per our test we see on timeout thread get 
released and it spawns a new thread on timeout. Is this an expected behavior ?

2019-10-24 12:33:26,123 DEBUG [org.apache.sshd.server.channel.ChannelSession] 
(Thread-44 (HornetQ-client-global-threads-407809182)) 
flush(ChannelOutputStream[ChannelSession[id=0, 
recipient=43]-ServerSessionImpl[administrator@/141.137.237.205:58628]] 
SSH_MSG_CHANNEL_DATA) failed (SocketTimeoutException) to wait for space of 
len=1190: waitForCondition(Window[server/remote](ChannelSession[id=0, 
recipient=43]-ServerSessionImpl[administrator@/141.137.237.205:58628])) timeout 
exceeded: 2

2019-10-24 12:33:46,126 DEBUG [org.apache.sshd.server.channel.ChannelSession] 
(Thread-44 (HornetQ-client-global-threads-407809182)) 
flush(ChannelOutputStream[ChannelSession[id=0, 
recipient=43]-ServerSessionImpl[administrator@/141.137.237.205:58628]] 
SSH_MSG_CHANNEL_DATA) failed (SocketTimeoutException) to wait for space of 
len=1190: waitForCondition(Window[server/remote](ChannelSession[id=0, 
recipient=43]-ServerSessionImpl[administrator@/141.137.237.205:58628])) timeout 
exceeded: 2

2019-10-24 12:34:06,129 DEBUG [org.apache.sshd.server.channel.ChannelSession] 
(Thread-44 (HornetQ-client-global-threads-407809182)) 
flush(ChannelOutputStream[ChannelSession[id=0, 
recipient=43]-ServerSessionImpl[administrator@/141.137.237.205:58628]] 
SSH_MSG_CHANNEL_DATA) failed (SocketTimeoutException) to wait for space of 
len=1190: waitForCondition(Window[server/remote](ChannelSession[id=0, 
recipient=43]-ServerSessionImpl[administrator@/141.137.237.205:58628])) timeout 
exceeded: 2





--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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