upstream: Add "-h" flag to sftp chown/chgrp/chmod commands to
request they do not follow symlinks. Requires recently-committed
lsetstat@openssh.com extension on the server side.
ok markus@ dtucker@
OpenBSD-Commit-ID: f93bb3f6f7eb2fb7ef1e59126e72714f1626d604
diff --git a/sftp.1 b/sftp.1
index 7140bc1..722a344 100644
--- a/sftp.1
+++ b/sftp.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: sftp.1,v 1.122 2018/11/16 02:30:20 djm Exp $
+.\" $OpenBSD: sftp.1,v 1.123 2019/01/16 23:23:45 djm Exp $
.\"
.\" Copyright (c) 2001 Damien Miller. All rights reserved.
.\"
@@ -22,7 +22,7 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd $Mdocdate: November 16 2018 $
+.Dd $Mdocdate: January 16 2019 $
.Dt SFTP 1
.Os
.Sh NAME
@@ -316,31 +316,52 @@
If
.Ar path
is not specified, then change directory to the one the session started in.
-.It Ic chgrp Ar grp Ar path
+.It Xo Ic chgrp
+.Op Fl h
+.Ar grp
+.Ar path
+.Xc
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.
-.It Ic chmod Ar mode Ar path
+.It Xo Ic chmod
+.Op Fl h
+.Ar mode
+.Ar path
+.Xc
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.
-.It Ic chown Ar own Ar path
+.It Xo Ic chown
+.Op Fl h
+.Ar own
+.Ar path
+.Xc
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