From nobody Mon Jun 15 22:57:07 2026 X-Original-To: dev-commits-src-main@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 4gfQVX0W2Gz6j47M for ; Mon, 15 Jun 2026 22:57:08 +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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gfQVW5pVqz3p1h for ; Mon, 15 Jun 2026 22:57:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781564227; 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=FYBQw3jjhM6iJmB75GlbIlBwOYfMVJ1ohzgTklvNw9s=; b=BuexHBHreYbCq5HC9Mt95EdGo7DUGGdDqT/vMCQtjEgzeMSoMPR/423F9wud2emfrBlJ+q R210Rz2SCcBo4X1UMYa1z3l7hC9Ob29oXfyD6sNNL7OxAVVcTFajJxKsXlWMmNu9L3vNIQ PVS+jdxEPMy5uzBdhbs8w2hiIbOUvU7AqaPqnYUsWh5197KTNvyYup+6tPmyQxZoQGH9a/ rLX1n4sYKKWhryqSFy1vskH7ihDEh8ITv2NLnQIEnMqsZlpWyQOWS180AJW19QGqgWjOJL IJtkYd1Jbdv/XSA7LASksLBZMxqzrCrJaD2Ra993+k8Hd5/CUW98SGOD7px76Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781564227; a=rsa-sha256; cv=none; b=ywvEVOpRxqsza8mM0d8BUIGr22j0atHfbZe3TGutcS6VTmAsR9IvIpBRYRF0lhJ2bs5d05 Mk32dlcRfeVOKyxbgJ7gsl4QaT6C5Bh80DRDldtz5RAhH989pXUcwaoHKRtLDcTDbF0SeK gX906Wb7qNHdF2Ok9KTBf/bjcCY3yT7zWyGkca8DEcXtRrTqg5qKX8WPrO/ozMytPOnmtF naWDQV6/5t+jsXZKgUph7J7gaAva7UJjpiOKVSry6rJqsXbMQ5CbDgR/lZ/OZuUyadvWP0 Y+TmfhuJXFA1wlmHIoY4dqrfwo9CZI+aPsc7tB3eUNVwjX8Jx+zHR1XTmx07Nw== 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=1781564227; 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=FYBQw3jjhM6iJmB75GlbIlBwOYfMVJ1ohzgTklvNw9s=; b=PWimAV790hT3ItCsGd7YDAc3PBzi4G1jnKuKfsTK7aSwMyY0aPG1O2pLQJQL1tZraRhsUn ezgoL5/JgR6tuphVE1k5Bu9pQm86JKmI1scB7JH1/Xbi9rj1GFwEbOz0E8hmvN4AtEbB4o yMbNX6mRTjYaLXIh/4UhKvnuFgucwUwl/V95tEyvPXUPUy5UUpGD9nYlVi8oNRw1xMRP4C DTbF5Q6XidjvJdiKvqiQltJQrK9IXEmq91SvsOogOsWHPUOAA53hI/6btHaWD5v/KwSmg0 xrZyxlOy//Ujm1iL4Rnr3MyeoGrlixmRzbzU2grxd1qTFZUSODPeXjqM7n1WBw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gfQVW5FHtz1DZt for ; Mon, 15 Jun 2026 22:57:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 4542c by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Jun 2026 22:57:07 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Ziaee Subject: git: e821152cc71d - main - symlink.7: Clean up markup and tag SPDX List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: e821152cc71dbd09f5bd28be86499165c553f3ae Auto-Submitted: auto-generated Date: Mon, 15 Jun 2026 22:57:07 +0000 Message-Id: <6a308343.4542c.52fed828@gitrepo.freebsd.org> The branch main has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=e821152cc71dbd09f5bd28be86499165c553f3ae commit e821152cc71dbd09f5bd28be86499165c553f3ae Author: Alexander Ziaee AuthorDate: 2026-06-12 15:47:54 +0000 Commit: Alexander Ziaee CommitDate: 2026-06-15 22:49:29 +0000 symlink.7: Clean up markup and tag SPDX Also unwind some parentheticals. MFC after: 3 days --- 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.