Mailing List Archive

sftp-server: Add nanoseconds support
Hello,

please, consider adding nanoseconds support to sftp-server.

BTW, the AIMS archive
(http://marc.theaimsgroup.com/?l=openssh-unix-dev&r=1&w=2) seems
broken (empty page).

Regards,
Opty
_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@mindrot.org
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev
Re: sftp-server: Add nanoseconds support [ In reply to ]
On 2021/09/03 15:56, Opty wrote:
> Hello,
>
> please, consider adding nanoseconds support to sftp-server.
>
> BTW, the AIMS archive
> (http://marc.theaimsgroup.com/?l=openssh-unix-dev&r=1&w=2) seems
> broken (empty page).

marc moved to a separate domain some time ago, the link on
https://www.openssh.com/list.html is correct:

https://marc.info/?l=openssh-unix-dev&r=1&w=2

_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@mindrot.org
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev
Re: sftp-server: Add nanoseconds support [ In reply to ]
On 3/9/21 11:26 pm, Opty wrote:
> please, consider adding nanoseconds support to sftp-server.

I'm not sure what time you want returned with nanosecond-resolution,
but, perhaps you mean the creation or last modification time of remote
files and directories.  I don't know what resolution SFTP provides but
it can't be greater than the underlying filesystem.  Most of them have
second-resolution.

I don't think openssh's sftp server can have a different resolution
without breaking compatibility with every sftp client.

_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@mindrot.org
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev
Re: sftp-server: Add nanoseconds support [ In reply to ]
On Sep 3, 2021, at 10:23 PM, David Newall <openssh@davidnewall.com> wrote:
> On 3/9/21 11:26 pm, Opty wrote:
>> please, consider adding nanoseconds support to sftp-server.
>
> I'm not sure what time you want returned with nanosecond-resolution, but, perhaps you mean the creation or last modification time of remote files and directories. I don't know what resolution SFTP provides but it can't be greater than the underlying filesystem. Most of them have second-resolution.
>
> I don't think openssh's sftp server can have a different resolution without breaking compatibility with every sftp client.


There is a version of the SFTP protocol defined which supports sub-second times, but it’s not widely implemented. A spec for the latest version can be found at https://datatracker.ietf.org/doc/html/draft-ietf-secsh-filexfer-13 <https://datatracker.ietf.org/doc/html/draft-ietf-secsh-filexfer-13>, which describes SFTP version 6, whereas most SFTP implementations (including OpenSSH last time I checked) only implement version 3.

It looks like the SUBSECOND_TIMES flag was added in version -04 of this draft (https://datatracker.ietf.org/doc/html/draft-ietf-secsh-filexfer-04 <https://datatracker.ietf.org/doc/html/draft-ietf-secsh-filexfer-04>), which sets an SFTP version number of 4. Section 10 of this draft summarizes the proposed differences between versions 3 and 4:

10.1 Changes between versions 4 and 3

Many of the changes between version 4 and version 3 are to the
attribute structure to make it more flexible for non-unix platforms.

o Clarify the use of stderr by the server.

o Clarify handling of very large read requests by the server.

o Make all filenames UTF-8.

o Added 'newline' extension.

o Made time fields 64 bit, and optionally have nanosecond resultion.

o Made file attribute owner and group strings so they can actually
be used on disparate systems.

o Added createtime field, and added separate flags for atime,
createtime, and mtime so they can be set separately.

o Split the file type out of the permissions field and into it's own
field (which is always present.)

o Added acl attribute.

o Added SSH_FXF_TEXT file open flag.

o Added flags field to the get stat commands so that the client can
specifically request information the server might not normally
included for performance reasons.

o Removed the long filename from the names structure-- it can now be
built from information available in the attrs structure.

o Added reserved range of packet numbers for extensions.

o Added several additional error codes.

It’s not legal to change the meaning of the SFTP file attribute flags that specify what attributes are present without changing the SFTP version number, so implementing sub-second files by itself would not be straightforward. You’d have to implement the rest of the changes proposed here as well, and it would only be useful if both the SFTP client and SFTP server had this new support and were able to negotiate the higher version number.
--
Ron Frederick
ronf@timeheart.net



_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@mindrot.org
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev
Re: sftp-server: Add nanoseconds support [ In reply to ]
On Sat, Sep 4, 2021 at 7:23 AM David Newall <openssh@davidnewall.com> wrote:
> On 3/9/21 11:26 pm, Opty wrote:
> > please, consider adding nanoseconds support to sftp-server.
>
> I'm not sure what time you want returned with nanosecond-resolution,
> but, perhaps you mean the creation or last modification time of remote
> files and directories. I don't know what resolution SFTP provides but
> it can't be greater than the underlying filesystem. Most of them have
> second-resolution.

I mean preserving file system timestamps like you mentioned. SFTP
provides seconds so far. Many file systems use sub-second timestamps:
https://kernelnewbies.org/y2038/vfs#Overview_of_file_systems

Regards,
Opty
_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@mindrot.org
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev
Re: sftp-server: Add nanoseconds support [ In reply to ]
On Sat, Sep 4, 2021 at 8:40 AM Ron Frederick <ronf@timeheart.net> wrote:
> There is a version of the SFTP protocol defined which supports sub-second times, but it’s not widely implemented. [...], whereas most SFTP implementations (including OpenSSH last time I checked) only implement version 3.
>
> It looks like the SUBSECOND_TIMES flag was added in version -04 of this draft (https://datatracker.ietf.org/doc/html/draft-ietf-secsh-filexfer-04), which sets an SFTP version number of 4. Section 10 of this draft summarizes the proposed differences between versions 3 and 4:
>
> [...]
>
> It’s not legal to change the meaning of the SFTP file attribute flags that specify what attributes are present without changing the SFTP version number, so implementing sub-second files by itself would not be straightforward. You’d have to implement the rest of the changes proposed here as well, and it would only be useful if both the SFTP client and SFTP server had this new support and were able to negotiate the higher version number.

Maybe the time for protocol upgrade has come? O:-) I see some more
benefits than just nanoseconds.

Regards,
Opty
_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@mindrot.org
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev
Re: sftp-server: Add nanoseconds support [ In reply to ]
On Sat, 2021-09-04 at 18:22 +0200, Opty wrote:
> I see some more
> benefits than just nanoseconds.

xattrs would be awesome... :D

_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@mindrot.org
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev
Re: sftp-server: Add nanoseconds support [ In reply to ]
On Sat, Sep 4, 2021 at 6:34 PM Christoph Anton Mitterer
<calestyo@scientia.net> wrote:
> On Sat, 2021-09-04 at 18:22 +0200, Opty wrote:
> > I see some more
> > benefits than just nanoseconds.
>
> xattrs would be awesome... :D

It seems that this will most probably not get any further attention so
I'm unsubscribing now because this list gets too much traffic for me.
Maybe one day I'll see you again. Who knows?

Regards,
Opty
_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@mindrot.org
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev