You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "gantzm (via GitHub)" <gi...@apache.org> on 2023/06/29 13:23:22 UTC

[GitHub] [mina-sshd] gantzm opened a new issue, #392: SCP failed with "Permission denied" and error not reported to user code.

gantzm opened a new issue, #392:
URL: https://github.com/apache/mina-sshd/issues/392

   ### Version
   
   2.10.0
   
   ### Bug description
   
   I'm attempting to scp a file from a Dropbear instance.  I don't have permissions to copy the file.  Dropbear reports permission denied, but that failure is never reported up to the calling code.
   
   
   ### Actual behavior
   
   
   The ScpHelper class logged this:
   
   `receiveNextCmd - ACK=1: scp: /directory1/directory2/file.xml: Permission denied`
   
   But this error appears to get ignored and never reported back to my calling code.  I don't receive any calls to my instance of ScpTransferEventListener.  The call to download on the ScpClient just returns, no exceptions or anything.
   
   When I look at the code in ScpHelper it appears to just log the error ACK and continue on:
   
   ```
       // NOTE: we rely on the fact that an SCP command does not start with an ACK code
       protected int receiveNextCmd() throws IOException {
           int c = in.read();
           if (c == -1) {
               return c;
           }
   
           if (c == ScpAckInfo.OK) {
               return c;
           }
   
           if ((c == ScpAckInfo.WARNING) || (c == ScpAckInfo.ERROR)) {
               String line = ScpIoUtils.readLine(in, csIn, true);
               if (log.isDebugEnabled()) {
                   log.debug("receiveNextCmd - ACK={}", new ScpAckInfo(c, line));
               }
           }
   
           return c;
       }
   ```
   
   
   ### Expected behavior
   
   
   I would expect this information to show up in the ScpAckInfo parameter of a call to handleFileEventAckInfo.  Or possibly an exception thrown to indicate a failure.
   
   ### Relevant log output
   
   ```Shell
   receiveNextCmd - ACK=1: scp: /directory1/directory2/file.xml: Permission denied
   ```
   
   
   ### Other information
   
   _No response_


-- 
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-unsubscribe@mina.apache.org.apache.org

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


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


Re: [I] SCP failed with "Permission denied" and error not reported to user code. [mina-sshd]

Posted by "lgoldstein (via GitHub)" <gi...@apache.org>.
lgoldstein commented on issue #392:
URL: https://github.com/apache/mina-sshd/issues/392#issuecomment-1805289578

   See also [#428](https://github.com/apache/mina-sshd/issues/428)


-- 
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-unsubscribe@mina.apache.org

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


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


Re: [I] SCP failed with "Permission denied" and error not reported to user code. [mina-sshd]

Posted by "tomaswolf (via GitHub)" <gi...@apache.org>.
tomaswolf commented on issue #392:
URL: https://github.com/apache/mina-sshd/issues/392#issuecomment-1877541569

   Should have been fixed by commit f908189c41a.


-- 
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-unsubscribe@mina.apache.org

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


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


Re: [I] SCP failed with "Permission denied" and error not reported to user code. [mina-sshd]

Posted by "tomaswolf (via GitHub)" <gi...@apache.org>.
tomaswolf closed issue #392: SCP failed with "Permission denied" and error not reported to user code.
URL: https://github.com/apache/mina-sshd/issues/392


-- 
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-unsubscribe@mina.apache.org

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


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


Re: [I] SCP failed with "Permission denied" and error not reported to user code. [mina-sshd]

Posted by "lgoldstein (via GitHub)" <gi...@apache.org>.
lgoldstein commented on issue #392:
URL: https://github.com/apache/mina-sshd/issues/392#issuecomment-1805867927

   See my reply for PR#428 - it may be the case that the server is signalling the permissions problem as a WARNING rather than an ERROR (see also the proposed fix for next version). Thank you though for helping focus the problematic code block - it helped a lot in diagnosing this issue as weel as PR#428


-- 
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-unsubscribe@mina.apache.org

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


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