You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "Thomas Wolf (Jira)" <ji...@apache.org> on 2021/11/22 12:37:00 UTC

[jira] [Commented] (SSHD-1228) Wrong creationTime in writeAttrs for SFTP

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

Thomas Wolf commented on SSHD-1228:
-----------------------------------

Looks like a copy-paste bug. Would you like to provide a PR on Github fixing this?

> Wrong creationTime in writeAttrs for SFTP
> -----------------------------------------
>
>                 Key: SSHD-1228
>                 URL: https://issues.apache.org/jira/browse/SSHD-1228
>             Project: MINA SSHD
>          Issue Type: Bug
>    Affects Versions: 2.7.0
>            Reporter: Samuel Padou
>            Priority: Minor
>
> InĀ {{SftpHelper#writeAttrsV4}} the {{lastAccessTime}} is written instead of the {{creationTime}}.
> {code:java}
> if ((flags & SftpConstants.SSH_FILEXFER_ATTR_CREATETIME) != 0) {
>     buffer = writeTime(buffer, version, flags, lastAccessTime);
> }
> {code}
> In my implementation I have a {{creationTime}} but no {{lastAccessTime}} so this cause a NPE (the flag is set because {{creationTime}} is not null but {{lastAccessTime}} is null when trying to write it), but this still write the wrong date even if both are available. Most clients seems to only show the {{lastModifiedTime}} though, so this is probably not very visible in most cases.



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

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