From nobody Wed Jun 4 22:53:13 2025 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 4bCNCZ13hQz5xm4p; Wed, 04 Jun 2025 22:53:14 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bCNCZ0NGDz3dYq; Wed, 04 Jun 2025 22:53:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749077594; 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=cqYZ4HJuURfz/SplLjuRHKlExkWALYW1Hozgm9WrHBo=; b=OpSaKqHUudAqKk0cC+jIZEjyXRrVoq1sLxsypjO6LCxtHcbeO8+rStW016Xi7D2Z8l/0tY VqEEc0Baoa4uUFO/nwY+xt4KXih9hk0YZzSsoU3xFsAL/XEtfpcpQsRxi2J1cLEEZcl54k bRwP+uRZkjhpGsT3XXosgyULxrRhwOLawk8Uo6ul/J9XFCHoigeLT38caqyVDhoi8WB7jP CPFNYsDi9afX2vQwIrXXEYAEbk+WJVC3wfdiyLbMp2M9Jz1Tf4QWMRmzbw7qDpgNddMgMy RDGzM9q61HN6OeY/OQHTdjKWq0/QlJYb8eMQUYvil4GOE2C/D9R9DB8qZPCAYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749077594; 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=cqYZ4HJuURfz/SplLjuRHKlExkWALYW1Hozgm9WrHBo=; b=e1xQM9yOqdHW6iJ6y2I6jh72RCkLo0ZKP+NXMVs+liqM8IQUAo1FivqQ7gDEEhKJ9ovXfM 9kLttUDOYNe40gy/plEqJJ6nLFzgebBKNwonTPi8OF2Q91NSXkIyWYTGoROiDKsyetprl9 SnMXuzUPRHguY/AqbYCR5Zk7uDYTLqD32i0v7OnEQ6ZuHBcjCsmjLgqA55f1t2M7gOxuFF KU++MuwBkvhCGHJK8MY9ZOpygrhI8ixrbwlJ6qeXyW2SM34i9JWJoGahBUXO3EfFSGQa7Z daQsRrC99nrOi9I5lJi6PY0CEsYQKDMfP5M0BsiRanNv81wg8DxqhRiESvf1YA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749077594; a=rsa-sha256; cv=none; b=qA7dsh1u5T8ztqjoXAJwC2ofdSlgSWmFUZfEpudh6TPdI0YMvvb5QAi7pW7Ni8Q6Cb7ZEa wLvkEwpEoG4nWXlzOTvB1Ybd/6Iz/oKfc5YxlPEUoMOcpF0d/0emDu4mzmpNNtZD60TgWQ KFNeMKPbkUuOm18QuNcZz47gxy6nGpbIIZ0UJbUK3Yf1gEOjNlStMUH0cPqfvPkJNTYz7M lwxK1OI0Sm/HbVDFhAopN+txAAz3KpOwPNt6R0YSEjCYi/pouqqzWTebKvrf+WEjauWzIW TEz/H+5ZPCt/SmwMFLYvJ0lLUNw57Sr0enw1AOoCVBwRpScQJzSo1IPaQzUrIg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bCNCY6yr3zkXw; Wed, 04 Jun 2025 22:53:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 554MrDKo093576; Wed, 4 Jun 2025 22:53:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 554MrDgZ093573; Wed, 4 Jun 2025 22:53:13 GMT (envelope-from git) Date: Wed, 4 Jun 2025 22:53:13 GMT Message-Id: <202506042253.554MrDgZ093573@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: 6b6542ec8446 - main - open.2: Document the O_NAMEDATTR flag 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6b6542ec84462c9d1fceb43bffb832e0fd556661 Auto-Submitted: auto-generated The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=6b6542ec84462c9d1fceb43bffb832e0fd556661 commit 6b6542ec84462c9d1fceb43bffb832e0fd556661 Author: Rick Macklem AuthorDate: 2025-06-04 22:50:16 +0000 Commit: Rick Macklem CommitDate: 2025-06-04 22:50:16 +0000 open.2: Document the O_NAMEDATTR flag Commit 2ec2ba7e232d added support for the O_NAMEDATTR flag to the open(2) and openat(2) syscalls for main. This patch updates the man page for this flag. Another man page that explains named attributes will be introduced in a future commit. This is a content change. Reviewed by: emaste (earlier version), kib (earlier version) Differential Revision: https://reviews.freebsd.org/D49691 Fixes: 2ec2ba7e232d ("vfs: Add VFS/syscall support for Solaris style extended attributes") --- lib/libsys/open.2 | 49 +++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 47 insertions(+), 2 deletions(-) diff --git a/lib/libsys/open.2 b/lib/libsys/open.2 index 6200723ed85c..84c4f02fce8a 100644 --- a/lib/libsys/open.2 +++ b/lib/libsys/open.2 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd February 28, 2025 +.Dd April 3, 2025 .Dt OPEN 2 .Os .Sh NAME @@ -210,6 +210,8 @@ record only the target path in the opened descriptor open file referenced by .Fa fd if path is empty +.It Dv O_NAMEDATTR +open a named attribute or named attribute directory .El .Pp Exactly one of the flags @@ -506,6 +508,42 @@ and the description of the .Dv O_CLOEXEC flag. .Pp +When the +.Dv O_NAMEDATTR +flag is specified for an +.Fn openat +where the +.Fa fd +argument is for a file object, +a named attribute for the file object +is opened and not the file object itself. +If the +.Dv O_CREAT +flag has been specified as well, the named attribute will be +created if it does not exist. +When the +.Dv O_NAMEDATTR +flag is specified for a +.Fn open , +a named attribute for the current working directory is opened and +not the current working directory. +The +.Fa path +argument for this +.Fn openat +or +.Fn open +must be a single component name with no embedded +.Ql / . +If the +.Fa path +argument is +.Ql .\& +then the named attribute directory for the file object is opened. +(See +.Xr named_attribute 7 +for more information.) +.Pp The system imposes a limit on the number of file descriptors open simultaneously by one process. The @@ -737,6 +775,10 @@ contains a ".." component, the .Dv vfs.lookup_cap_dotdot .Xr sysctl 3 is set, and the process is in capability mode. +.It Bq Er ENOATTR +.Dv O_NAMEDATTR +has been specified and the file object is not a named attribute +directory or named attribute. .El .Sh SEE ALSO .Xr chmod 2 , @@ -752,7 +794,8 @@ is set, and the process is in capability mode. .Xr umask 2 , .Xr write 2 , .Xr fopen 3 , -.Xr capsicum 4 +.Xr capsicum 4 , +.Xr named_attribute 7 .Sh STANDARDS These functions are specified by .St -p1003.1-2008 . @@ -801,6 +844,8 @@ function was introduced in .Fx 8.0 . .Dv O_DSYNC appeared in 13.0. +.Dv O_NAMEDATTR +appeared in 15.0. .Sh BUGS The .Fa mode