From nobody Sun Jun 28 00:44:15 2026 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4gnrJc1shCz6jF86 for ; Sun, 28 Jun 2026 00:44:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gnrJb54gkz3lN9 for ; Sun, 28 Jun 2026 00:44:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782607455; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PIvsI4wAZYdsEh+dHr2Yup477Zv0bsh7ipZyOBM6658=; b=ck4kx4r4xbmWNnogxb9uwkBV4CaXPT9edcXWk9YHOyxJRjrQm1qJI1o7EoNiC3EgXLbdSJ nwlOHjCEBBR4XIWl4D62mf2BmnjEUo4oBJ8Kfy+eOjDVIIU8jvkMUvtHsW7qJo20gYUAUG 7e1hax7V62Bw7ocbjVOCYiO4C13CYl8+ynEP7DMzNjaJ2yyRVeWnC3CUie4R8MIU72b4pE AQlEV5QMtEcQVmOv8Soe41aYcSHHOx3BOf4lE3LoZ8N4qQOxLusC3+kTZEHSSNb4Rtk0wi Fz/nwcE+cllGA77nHe7dSr6aCHIdeMLlGmQ78zB+gzdmw2M6to0qFwM5AyCHUw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1782607455; a=rsa-sha256; cv=none; b=ZU68QEvHEO2SFN6ZGH4lioYNV3PrLXC+JpW7QzUuB1gRiJxbWL8aLg9bGVprFoH8XFrIO/ vRVA56Dy+GeGqbSKORXJ3ob0lek59IXAa3zGU4hpB6sy5WBkAGhQ7KW6gDwxMQvL+vLcfo X9YtTqCpzwrZfRdTeycJMI4BF8vN8+A0EWEQLulv3VTafZfAt7AZJT3a1+b1r+2Aq0JR9y UoUgvb8Q8jWm+O/CdA3VT97W6hbDMqxpemLI99qBLJWkmC7frW44k5TSi2E1KuUAVexBWB azklgHgksg3M3/YE7QTKY5SolozvE0TtffEnFfqq9exRFB/jOVP+CEPIaSNi5Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782607455; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PIvsI4wAZYdsEh+dHr2Yup477Zv0bsh7ipZyOBM6658=; b=WtjtcplPaKkNkrJUzdusMPWpunCRbtawHPsMpb2rfmEcwGaXhnd03gvrBE5jM9BljKVuPJ 8uTw2MC0/2eyhoKw2Dtr3Mm4JlyvFSQUBrgJx+HkTv0h2u5t8+ln0LlMrusjp95+TSl0Es dOm+lY89iIxNR7GgscjuGXcTg0ncdLB2FJO7ux1cK6fy2ZokIY2t1AM1phfnXF6QlOqmV6 TdpmdFa5wbWd+r9q4LGMuvLTVGHfyiSiXTQCEPrfW2EnhvdEmY/6UrC2Hc0i+VoLAD2cFY wQhTrECfaTZVXqPmdUO93hjlHcLJZlWhCHJMfJZ2+aT2nn1h6H+lC8vOyLszbA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gnrJb3cj3znGG for ; Sun, 28 Jun 2026 00:44:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3f1c5 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 28 Jun 2026 00:44:15 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Ziaee Subject: git: 9e6c043af191 - stable/15 - symlink.7: Clean up markup and tag SPDX List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 9e6c043af1910cab8f18350d8be9eea48b64b371 Auto-Submitted: auto-generated Date: Sun, 28 Jun 2026 00:44:15 +0000 Message-Id: <6a406e5f.3f1c5.73c03769@gitrepo.freebsd.org> The branch stable/15 has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=9e6c043af1910cab8f18350d8be9eea48b64b371 commit 9e6c043af1910cab8f18350d8be9eea48b64b371 Author: Alexander Ziaee AuthorDate: 2026-06-12 15:47:54 +0000 Commit: Alexander Ziaee CommitDate: 2026-06-28 00:36:10 +0000 symlink.7: Clean up markup and tag SPDX Also unwind some parentheticals. MFC after: 3 days (cherry picked from commit e821152cc71dbd09f5bd28be86499165c553f3ae) --- bin/ln/symlink.7 | 92 ++++++++++++++++++++++++++++++-------------------------- 1 file changed, 49 insertions(+), 43 deletions(-) diff --git a/bin/ln/symlink.7 b/bin/ln/symlink.7 index db251e1d2985..5cb883efed36 100644 --- a/bin/ln/symlink.7 +++ b/bin/ln/symlink.7 @@ -1,4 +1,6 @@ -.\"- +.\" +.\" SPDX-License-Identifier: BSD-3-Clause +.\" .\" Copyright (c) 1992, 1993, 1994 .\" The Regents of the University of California. All rights reserved. .\" @@ -68,9 +70,9 @@ in which case the links are dereferenced until an object that is not a symbolic link is found, a symbolic link which references a file which does not exist is found, or a loop is detected. -(Loop detection is done by placing an upper limit on the number of +Loop detection is done by placing an upper limit on the number of links that may be followed, and an error results if this limit is -exceeded.) +exceeded. .Pp There are four separate areas that need to be discussed. They are as follows: @@ -84,11 +86,11 @@ Mount options to ignore symbolic links. Symbolic links specified as command line arguments to utilities that are not traversing a file tree. .It -Symbolic links encountered by utilities that are traversing a file tree -(either specified on the command line or encountered as part of the -file hierarchy walk). +Symbolic links encountered by utilities that are traversing a file tree, +either specified on the command line or encountered as part of the +file hierarchy walk. .El -.Ss System calls. +.Ss System calls The first area is symbolic links used as file name arguments for system calls. .Pp @@ -182,19 +184,26 @@ system call was added later when the limitations of the new became apparent. .Ss Mount options .Fx -has a +has a .Xr mount 8 -option nosymfollow. When this option is enabled, the kernel -does not follow symlinks on the mounted file system and return EACCES. +option +.Cm nosymfollow . +When this option is enabled, the kernel +does not follow symlinks on the mounted file system and return +.Er EACCES . You can still create or remove symlinks, or read the value of a symbolic link. .Pp This option is intended to be used when mounting file systems from -untrusted external storage systems or public writable /tmp file systems +untrusted external storage systems or public writable +.Pa /tmp +file systems to prevent symlink-based privilege escalation and sandbox escape attacks. .Pp -The mount option nosymfollow first appeared in +The mount option +.Cm nosymfollow +first appeared in .Fx 3.0 -.Ss Commands not traversing a file tree. +.Ss Commands not traversing a file tree The second area is symbolic links, specified as command line file name arguments, to commands which are not traversing a file tree. .Pp @@ -215,7 +224,7 @@ optionally traverse file trees, e.g.\& the command is included in this rule, while the command .Dq Li "chown -R file" is not. -(The latter is described in the third area, below.) +The latter is described in the third area, below. .Pp If it is explicitly intended that the command operate on the symbolic link instead of following the symbolic link, e.g., it is desired that @@ -242,20 +251,20 @@ and .Xr rm 1 commands do not follow symbolic links named as arguments, but respectively attempt to rename and delete them. -(Note, if the symbolic link references a file via a relative path, +Note, if the symbolic link references a file via a relative path, moving it to another directory may very well cause it to stop working, -since the path may no longer be correct.) +since the path may no longer be correct. .Pp The .Xr ls 1 command is also an exception to this rule. For compatibility with historic systems (when -.Nm ls +.Xr ls 1 is not doing a tree walk, i.e., the .Fl R option is not specified), the -.Nm ls +.Xr ls 1 command follows symbolic links named as arguments if the .Fl H or @@ -267,14 +276,14 @@ or if the or .Fl l options are not specified. -(The -.Nm ls +The +.Xr ls 1 command is the only command where the .Fl H and .Fl L options affect its behavior even though it is not doing a walk of -a file tree.) +a file tree. .Pp The .Xr file 1 @@ -292,11 +301,11 @@ The system differs from historical .Bx 4 systems in that the -.Nm chown +.Sy chown and -.Nm chgrp +.Sy chgrp commands follow symbolic links specified on the command line. -.Ss Commands traversing a file tree. +.Ss Commands traversing a file tree The following commands either optionally or always traverse file trees: .Xr chflags 1 , .Xr chgrp 1 , @@ -328,7 +337,7 @@ as well as any symbolic links encountered in the tree traversal of .Dq Li directory , because symbolic links may be removed. In no case will -.Nm rm +.Xr rm 1 affect the file which .Dq Li slink references in any way. @@ -342,22 +351,21 @@ This is often referred to as a .Dq physical walk, as opposed to a .Dq logical -walk (where symbolic links referencing directories are followed). +walk where symbolic links referencing directories are followed. .Pp As consistently as possible, you can make commands doing a file tree walk follow any symbolic links named on the command line, regardless of the type of file they reference, by specifying the .Fl H -(for -.Dq half\-logical ) +.Pq Dq half-logical flag. This flag is intended to make the command line name space look like the logical name space. -(Note, for commands that do not always do file tree traversals, the +Note, for commands that do not always do file tree traversals, the .Fl H flag will be ignored if the .Fl R -flag is not also specified.) +flag is not also specified. .Pp For example, the command .Dq Li "chown -HR user slink" @@ -380,16 +388,15 @@ walk follow any symbolic links named on the command line, as well as any symbolic links encountered during the traversal, regardless of the type of file they reference, by specifying the .Fl L -(for -.Dq logical ) +.Pq Dq logical flag. This flag is intended to make the entire name space look like the logical name space. -(Note, for commands that do not always do file tree traversals, the +Note, for commands that do not always do file tree traversals, the .Fl L flag will be ignored if the .Fl R -flag is not also specified.) +flag is not also specified. .Pp For example, the command .Dq Li "chown -LR user slink" @@ -398,19 +405,18 @@ will change the owner of the file referenced by If .Dq Li slink references a directory, -.Nm chown +.Xr chown 1 will traverse the file hierarchy rooted in the directory that it references. In addition, if any symbolic links are encountered in any file tree that -.Nm chown +.Xr chown 1 traverses, they will be treated in the same fashion as .Dq Li slink . .Pp As consistently as possible, you can specify the default behavior by specifying the .Fl P -(for -.Dq physical ) +.Pq Dq physical flag. This flag is intended to make the entire name space look like the physical name space. @@ -439,11 +445,11 @@ and .Xr rm 1 commands have exceptions to these rules. The -.Nm rm +.Xr rm 1 command operates on the symbolic link, and not the file it references, and therefore never follows a symbolic link. The -.Nm rm +.Xr rm 1 command does not support the .Fl H , .Fl L @@ -453,7 +459,7 @@ options. .Pp To maintain compatibility with historic systems, the -.Nm ls +.Xr ls 1 command acts a little differently. If you do not specify the .Fl F , @@ -461,12 +467,12 @@ If you do not specify the or .Fl l options, -.Nm ls +.Xr ls 1 will follow symbolic links specified on the command line. If the .Fl L flag is specified, -.Nm ls +.Xr ls 1 follows all symbolic links, regardless of their type, whether specified on the command line or encountered in the tree walk.