[PATCH 1/5] sftp: add missing lsetstat at openssh.com documentation

Mike Frysinger vapier at gentoo.org
Mon Nov 30 15:57:00 AEDT 2020


---
 PROTOCOL      | 16 ++++++++++++++++
 sftp-server.c |  1 +
 sftp.1        | 27 ++++++++++++++++++---------
 3 files changed, 35 insertions(+), 9 deletions(-)

diff --git a/PROTOCOL b/PROTOCOL
index ecdacb9dc75e..abb083af3ea0 100644
--- a/PROTOCOL
+++ b/PROTOCOL
@@ -465,6 +465,22 @@ respond with a SSH_FXP_STATUS message.
 This extension is advertised in the SSH_FXP_VERSION hello with version
 "1".
 
+3.7. sftp: Extension request "lsetstat at openssh.com"
+
+This request is like the "setstat" command, but sets file attributes on
+symlinks.  It is implemented as a SSH_FXP_EXTENDED request with the
+following format:
+
+	uint32		id
+	string		"lsetstat at openssh.com"
+	string		path
+	ATTRS		attrs
+
+See the "setstat" command for more details.
+
+This extension is advertised in the SSH_FXP_VERSION hello with version
+"1".
+
 4. Miscellaneous changes
 
 4.1 Public key format
diff --git a/sftp-server.c b/sftp-server.c
index f00f39e64f68..ec3274d24cf5 100644
--- a/sftp-server.c
+++ b/sftp-server.c
@@ -671,6 +671,7 @@ process_init(void)
 	    /* fsync extension */
 	    (r = sshbuf_put_cstring(msg, "fsync at openssh.com")) != 0 ||
 	    (r = sshbuf_put_cstring(msg, "1")) != 0 || /* version */
+	    /* lsetstat extension */
 	    (r = sshbuf_put_cstring(msg, "lsetstat at openssh.com")) != 0 ||
 	    (r = sshbuf_put_cstring(msg, "1")) != 0) /* version */
 		fatal_fr(r, "compose");
diff --git a/sftp.1 b/sftp.1
index 1cfa5ec229e3..e9eec7feffa4 100644
--- a/sftp.1
+++ b/sftp.1
@@ -348,15 +348,18 @@ Change group of file
 .Ar path
 to
 .Ar grp .
-If the
-.Fl h
-flag is specified, then symlinks will not be followed.
 .Ar path
 may contain
 .Xr glob 7
 characters and may match multiple files.
 .Ar grp
 must be a numeric GID.
+.Pp
+If the
+.Fl h
+flag is specified, then symlinks will not be followed.
+Note that this is only supported by servers that implement
+the "lsetstat at openssh.com" extension.
 .It Xo Ic chmod
 .Op Fl h
 .Ar mode
@@ -366,13 +369,16 @@ Change permissions of file
 .Ar path
 to
 .Ar mode .
-If the
-.Fl h
-flag is specified, then symlinks will not be followed.
 .Ar path
 may contain
 .Xr glob 7
 characters and may match multiple files.
+.Pp
+If the
+.Fl h
+flag is specified, then symlinks will not be followed.
+Note that this is only supported by servers that implement
+the "lsetstat at openssh.com" extension.
 .It Xo Ic chown
 .Op Fl h
 .Ar own
@@ -382,15 +388,18 @@ Change owner of file
 .Ar path
 to
 .Ar own .
-If the
-.Fl h
-flag is specified, then symlinks will not be followed.
 .Ar path
 may contain
 .Xr glob 7
 characters and may match multiple files.
 .Ar own
 must be a numeric UID.
+.Pp
+If the
+.Fl h
+flag is specified, then symlinks will not be followed.
+Note that this is only supported by servers that implement
+the "lsetstat at openssh.com" extension.
 .It Xo Ic df
 .Op Fl hi
 .Op Ar path
-- 
2.28.0



More information about the openssh-unix-dev mailing list