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

Lyor Goldstein edited comment on SSHD-1127 at 2/17/21, 5:09 PM:
----------------------------------------------------------------

{quote}
But commercial sftp server libraries are able to successfully propagate 
messages to all clients FileZilla, WinScp, Putty, Terminal.
As for example, Maverick based SFTP server uses this API
{quote}
When you say "commercial sftp server libraries" you most likely refer to 
Maverick. We have had dealings with this library in the past and we encountered 
a few "extensions" and/or incompatible implementations. Currently we do not 
consider this a priority issue, so (again) if you really need this feature, I 
am afraid you will need to contribute the code to MINA SSHD.

As a side issue, please note that relying on this mechanism to convey 
information to the users is fraught with danger and pitfalls (e.g., language 
issues, incompatibilities, stderr pipeline not being consumed by peer, etc., 
etc., etc.) I therefore wonder why is it such a major concern. Nice to have ? 
Yes. Mandatory ? Not so sure.


was (Author: lgoldstein):
{quote}
But commercial sftp server libraries are able to successfully propagate 
messages to all clients FileZilla, WinScp, Putty, Terminal.
As for example, Maverick based SFTP server uses this API
{quote}
When you say "commercial sftp server libraries" you refer to Maverick. We have 
had dealings with this library in the past and we encountered a few 
"extensions" and/or incompatible implementations. Currently we do not consider 
this a priority issue, so (again) if you really need this feature, I am afraid 
you will need to contribute the code to MINA SSHD.

As a side issue, please note that relying on this mechanism to convey 
information to the users is fraught with danger and pitfalls (e.g., language 
issues, incompatibilities, stderr pipeline not being consumed by peer, etc., 
etc., etc.) I therefore wonder why is it such a major concern. Nice to have ? 
Yes. Mandatory ? Not so sure.

> SFTP/SCP SftpErrorStatusDataHandler is not propagating back proper custom 
> messages to the client
> ------------------------------------------------------------------------------------------------
>
>                 Key: SSHD-1127
>                 URL: https://issues.apache.org/jira/browse/SSHD-1127
>             Project: MINA SSHD
>          Issue Type: Improvement
>            Reporter: Susmit Sarkar
>            Priority: Minor
>
> Hi Team,
> *SftpErrorStatusDataHandler* is not propagating back proper custom messages 
> to the client. Although it works fine with clients like FileZilla and WinSCP, 
> we don't get a proper message for Unix-based SFTP command-line client.
> We can say that there is no issue with the implementation as it's working for 
> clients like FileZilla and WinScp, so the code is fine. I agree with you on 
> that.
> But commercial sftp server libraries are able to successfully propagate 
> messages to all clients FileZilla, WinScp, Putty, Terminal.
> As for example, Maverick based SFTP server uses this API:
> {code:java}
> // code placeholder
> import com.maverick.sshd.SessionChannel;
> SessionChannel.sendStderrData("Too many concurrent logins. Please try again 
> later.\n".getBytes("US-ASCII"));{code}
> [http://maverick-legacy-server-javadocs.s3-website-eu-west-1.amazonaws.com/com/maverick/sshd/SessionChannel.html#sendStderrData-byte:A-]
> I think a similar implementation should be introduced in the MINA library for 
> future release.
> While reading the doc I came across this: 
> ([https://github.com/apache/mina-sshd/blob/ac45b617272303058193db193650e7f2db3d1872/docs/sftp.md])
> If the registered handler implements {{ChannelSessionAware}} then it will 
> also be informed of the registered {{ChannelSession}} when it is provided to 
> the {{SftpSubsystem}} itself. This can be used to register an extended data 
> writer that can handle data sent via the STDERR channel. *Note:* this feature 
> is allowed according to [SFTP version 4 - section 
> 3.1|https://tools.ietf.org/html/draft-ietf-secsh-filexfer-04#section-3.1]:
> Packets are sent and received on stdout and stdin. Data sent on stderr by the 
> server SHOULD be considered debug or supplemental error information, and MAY 
> be displayed to the user.
> *however, the current code provides no built-in support for this feature.*
> sftp> PUT docker-compose.yml
>  debug3: Looking up docker-compose.yml
>  Uploading docker-compose.yml to /dmicons/docker-compose.yml
>  debug3: Sent message SSH2_FXP_OPEN I:8 P:/dmicons/docker-compose.yml
>  remote open("/dmicons/docker-compose.yml"): Failure
> *---------------------------------------------------------------*
> Same operation in WinScp loggers are coming as:
> 2021-02-17 18:42:44.322 - Uploading a file to a full filesystem (HDD).
>  * 2021-02-17 18:42:44.322 - Exceeding a user disk quota.
>  . 2021-02-17 18:42:44.322 Asking user:
>  . 2021-02-17 18:42:44.322 Cannot create remote file 
> '/dmicons/IBM_UserTest.log'. ("General failure (server should provide error 
> description).
>  . 2021-02-17 18:42:44.322 Error code: 4
>  . 2021-02-17 18:42:44.322 *Error message from server: User admin is not 
> allowed to execute this SFTP command because of policy SFTP20*
> Thanks,
> Susmit 



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to