Bug 1555 - add attribute extensions to sftp-server
Summary: add attribute extensions to sftp-server
Status: NEW
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: sftp-server (show other bugs)
Version: 5.1p1
Hardware: All All
: P2 enhancement
Assignee: Assigned to nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-13 22:03 AEDT by Miklos Szeredi
Modified: 2023-01-17 01:11 AEDT (History)
6 users (show)

See Also:


Attachments
hard link protocol extension for sftp (6.63 KB, patch)
2009-02-13 22:05 AEDT, Miklos Szeredi
no flags Details | Diff
add protocol extension to ATTR message (9.08 KB, patch)
2009-02-13 22:07 AEDT, Miklos Szeredi
no flags Details | Diff
add attribute configuration message (5.34 KB, patch)
2009-02-13 22:10 AEDT, Miklos Szeredi
no flags Details | Diff
optimize attribute sending (1.88 KB, patch)
2009-02-13 22:11 AEDT, Miklos Szeredi
no flags Details | Diff
/home/djm/sftp-hardlink.diff (8.99 KB, patch)
2010-12-03 12:25 AEDT, Damien Miller
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Miklos Szeredi 2009-02-13 22:03:10 AEDT
Hard links are not used very often nowdays, but they do still have their uses and this is currently the most often requested improvement for SSHFS.

To detect hard links the st_nlink, st_dev and st_ino attributes are usually used.

I'll be attaching patches that add a hard link operation and extend the protocol to include all the common UNIX file attributes.
Comment 1 Miklos Szeredi 2009-02-13 22:05:28 AEDT
Created attachment 1601 [details]
hard link protocol extension for sftp

This patch that adds support for the creation of hard links over SFTP.
Comment 2 Miklos Szeredi 2009-02-13 22:07:57 AEDT
Created attachment 1602 [details]
add protocol extension to ATTR message

This patch adds all the missing commonly used UNIX attributes: st_dev,
st_ino, st_nlink, st_rdev, st_blocks, st_blksize, st_ctime.  In
addition it extends st_atime and st_mtime to 64bits, and adds
nanosecond resolution to all three timestamps.

This is implemented as an extension to the ATTR message.  This patch
alone is sufficient for SSHFS to be able to use these attributes.  The
following two patches optimize the bandwidth use for this extension.
Comment 3 Miklos Szeredi 2009-02-13 22:10:54 AEDT
Created attachment 1603 [details]
 add attribute configuration message

This patch adds a new extended request with which the client can
request which attributes it wants to receive.  By default only the
basic attributes are transferred, but the client can request that any
subset of the basic or extra attributes to be sent.  Attributes can be
selected separately for STAT and READDIR requests.

Also there's a flag to turn off the generation of long names in
READDIR requests.

The server also sends the attributes it can actually support in the
attribute configuration reply so the client may make decisions based
on the server's capabilities.
Comment 4 Miklos Szeredi 2009-02-13 22:11:41 AEDT
Created attachment 1604 [details]
optimize attribute sending

This patch turns off sending unnecessary attributes:

  - the nanosecond part of timestamps if they are zero
  - the 32bit atime and mtime if the 64bit atime/mtime are sent
Comment 5 David Rosenstrauch 2010-03-17 08:31:52 AEDT
Just wondering:  are there any plans to integrate these patches into a release at some point?
Comment 6 Damien Miller 2010-08-03 15:41:03 AEST
We are freezing for the OpenSSH 5.6 release. Retargetting these bugs to the next release.
Comment 7 Damien Miller 2010-12-03 12:25:37 AEDT
Created attachment 1971 [details]
/home/djm/sftp-hardlink.diff

revised patch
Comment 8 Damien Miller 2010-12-04 11:18:50 AEDT
hard link patch is submitted and will be released in OpenSSH 5.7
Comment 9 Jérôme Carretero 2013-09-22 06:52:38 AEST
It looks like the original patch was also providing more data for the stat() call, which is nice when performing directory walks on a remote filesystem.
Any chance for this stuf to be included some day?
Comment 10 Bert Haverkamp 2014-04-09 21:42:48 AEST
IMO, this bug should be closed as resolved, as the patch was included in version 5.7, right? Who is to do this?
Comment 11 Steven Xu 2023-01-17 01:11:16 AEDT
Coming here from https://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg1769655.html. I would love to have nanosecond file timestamp support, and extra attributes, in *OpenSSH*.

It seems to me that only the first patch here "/home/djm/sftp-hardlink.diff" got included.

The other patches didn't. Could they be included?