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

Michael Stevens updated SSHD-115:
---------------------------------
    Description: 
Stress testing the SFTP Subsystem I found protocol errors when file creation 
failed. This is due to a missing return after the error status is sent.

The patch is simple...

{code}
--- SftpSubsystem.java  (revision 1086267)
+++ SftpSubsystem.java  (working copy)
@@ -409,6 +409,7 @@
                             if (((pflags & SSH_FXF_CREAT) != 0)) {
                                 if (!file.isWritable()) {
                                     sendStatus(id, SSH_FX_FAILURE, "Can not 
create " + path);
+                                    return;
                                 }
                                 file.create();
                             }
{code}


  was:
Stress testing the SFTP Subsystem I found protocol errors when file creation 
failed. This is due to a missing return after the error status is sent.

The patch is simple...

--- SftpSubsystem.java  (revision 1086267)
+++ SftpSubsystem.java  (working copy)
@@ -409,6 +409,7 @@
                             if (((pflags & SSH_FXF_CREAT) != 0)) {
                                 if (!file.isWritable()) {
                                     sendStatus(id, SSH_FX_FAILURE, "Can not 
create " + path);
+                                    return;
                                 }
                                 file.create();
                             }



> Missing return handling SFTP SSH_FXP_OPEN cannot create error
> -------------------------------------------------------------
>
>                 Key: SSHD-115
>                 URL: https://issues.apache.org/jira/browse/SSHD-115
>             Project: MINA SSHD
>          Issue Type: Bug
>    Affects Versions: 0.5.0
>            Reporter: Michael Stevens
>            Assignee: Guillaume Nodet
>             Fix For: 0.6.0
>
>
> Stress testing the SFTP Subsystem I found protocol errors when file creation 
> failed. This is due to a missing return after the error status is sent.
> The patch is simple...
> {code}
> --- SftpSubsystem.java        (revision 1086267)
> +++ SftpSubsystem.java        (working copy)
> @@ -409,6 +409,7 @@
>                              if (((pflags & SSH_FXF_CREAT) != 0)) {
>                                  if (!file.isWritable()) {
>                                      sendStatus(id, SSH_FX_FAILURE, "Can not 
> create " + path);
> +                                    return;
>                                  }
>                                  file.create();
>                              }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to