From nobody Sun Dec 10 03:15:23 2023 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 4Snqkh1XvWz53wdb; Sun, 10 Dec 2023 03:15:24 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Snqkh153Tz3JVK; Sun, 10 Dec 2023 03:15:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702178124; 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=Audf5NUNW9kd1GEiVHpV2f1XqE70AkO9SpaCVGE3Pfk=; b=BcQ5LrNTZZTWJv20AG4qRQ04ui0FVVXATNqOw5OcPTTTaFbZgXQuFviEMyHt6DwS/Y3Q3I R0P2ago2x5MzCjQ1pv5XNa9U+gM/YEkAeqVY8Jd8VYS57FpYAz6ftKnFh/Iz8O8qYCPjGx fzvt6YOgeWGyj6/bugIOknOwI+v0XWF6oaFF9Aki4aIo3FR6xlzrnob0E+DUV3bfZxQ8J0 FBwywNenS8hvaOhmmm1Er1/7kax87IRM+KnaqhmkDTRwWJ/cOREkM5aglxJFrXWXLyvg95 CPzSoCVn92mmxaORnTF8papifqdWXwWxlaRJDbeAVy0f/I0zN9MEz7hy7OXniA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702178124; a=rsa-sha256; cv=none; b=SSjC1DwuVjz3ifs3SgJKrP7ovs1buD8h70LVA8+itT0CMHvBOeZlOuwdGMpCFwbGVMAt9b o9ta63MgFOphIEIhNbyGCouxQn9+LgtQ1uzzkXaM8V/R9CNDedDcD1GoqNVOwKHi/2gVC6 nXIn2QPccYKFMN4x1piXsO2cq2nLGPUcBrQklPAW/43ZvMEibx8hIzVJPBWAJ9UlWC4nho PFEduXOg3hKEE3zAUqWn2tbjHXmbh+CwtcUyS27CajoBiyH9ncrMla8JvmevFs/uBYz1eG tPGwLbp3UafmpDNiJuJH7RSVPc/hG2nvWycq4G349LakQGc3f44pHVjvxmQZYQ== 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=1702178124; 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=Audf5NUNW9kd1GEiVHpV2f1XqE70AkO9SpaCVGE3Pfk=; b=NdKB+cg8Ta0LaI+yrLdS0MlaulD/2jUlMzvLtgHEniJCo3KTHuMxwNTjsbj7w/D4thRbeY dRjEMzYwNa1uraMJxXIVOfVn67cEOuJzppo3+jpVKM4yIVx0GfFgOSe/ogmmVD8fbbXBtS 55a/I1RbtFKoxo36RwSD+G8QxAEysVRKCLOdonBCb6Smi8UopeXpPuRbfktclyc5K801fy 9KfZqibOdXRfxHZaQV6FuKl7cML8s7TkgaKiuvWUq7nAO8qnwZBHs/85kUooixuooj2IiY DRL1cAX+ANO0I7aR8fIEv6YNpbJCtSmiZvE+QsXjIbZxsPeHXzAJcX/QCHpR/g== 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 4Snqkh09FRzWvT; Sun, 10 Dec 2023 03:15:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BA3FNbT053141; Sun, 10 Dec 2023 03:15:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BA3FNjG053138; Sun, 10 Dec 2023 03:15:23 GMT (envelope-from git) Date: Sun, 10 Dec 2023 03:15:23 GMT Message-Id: <202312100315.3BA3FNjG053138@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ka Ho Ng Subject: git: 1ed12844a186 - stable/14 - termcap.small: Include xterm-256color 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: khng X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1ed12844a18610451ffc93155d825e5cfcfd9747 Auto-Submitted: auto-generated The branch stable/14 has been updated by khng: URL: https://cgit.FreeBSD.org/src/commit/?id=1ed12844a18610451ffc93155d825e5cfcfd9747 commit 1ed12844a18610451ffc93155d825e5cfcfd9747 Author: Ka Ho Ng AuthorDate: 2023-12-02 05:55:56 +0000 Commit: Ka Ho Ng CommitDate: 2023-12-10 03:15:08 +0000 termcap.small: Include xterm-256color MFC after: 7 days Reviewed by: imp, jhb Differential Revision: https://reviews.freebsd.org/D42784 (cherry picked from commit 1da7f3f6f72b2245e458fc7195733268ae4a1136) --- etc/termcap/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/etc/termcap/Makefile b/etc/termcap/Makefile index 4b403c446359..cd5516f3e04b 100644 --- a/etc/termcap/Makefile +++ b/etc/termcap/Makefile @@ -14,8 +14,8 @@ TERMCAP_SMALL_ENTS?= SC cons25 cons25-m cons25-w cons25l1 cons25l1-m \ cons50l1-w cons50l2 cons50l2-m cons50l7 cons50l7-m cons50r cons50r-m \ cons50r-mv cons50r-v cons60 cons60-m cons60-w cons60l1 cons60l1-m \ cons60l1-w cons60l2 cons60l2-m cons60l7 cons60l7-m cons60r cons60r-m \ - cons60r-mv cons60r-v ecma[+]italics vt100 xterm xterm-basic xterm-clear \ - xterm-color xterm-new xterm-r6 xterm-r6-clear + cons60r-mv cons60r-v ecma[+]italics vt100 xterm xterm-256color xterm-basic \ + xterm-clear xterm-color xterm-new xterm-r6 xterm-r6-clear termcap.small: termcap set -e; \ From nobody Sun Dec 10 09:06:39 2023 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 4SnzX01bGzz53RxP; Sun, 10 Dec 2023 09:06:40 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SnzX01LJjz4DfM; Sun, 10 Dec 2023 09:06:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702199200; 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=q+POckeQmI+5axgZRJ4o7whkRvxonReQPwPLKvRjwUE=; b=CYC8U0hVN5URGCe3/vochVciqXgDG0mpTj+MwaOhiWR6KynrMphybZizQfbv72+2rBbh4H eTmeeQTkGU7acxTLXTKxj8K/4OGfTrba8mtUCWiLrvT1e+3le3P7J9fC8vgrQIqgd66SWJ dC8VWxPLVP8U6RhwYjEVw2DB5l7TLi3BlzZaUdhrYr2/wzalFCSEut9Mni5/zdrz/rJb1a 03Q7fCOeSuBCUxfUX6jP8NhJ63wSiMeKaloInuRHuDNHkAP40M+weR7dmyGPzse/g7g9cl K+RmrNPSTSC7uvhjDTKCVo2ZGahcsIOpCTbSnScyvZB13UX9+dP0Y6rQBrol0w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702199200; a=rsa-sha256; cv=none; b=yjSTKc7NsCQ4yix/DmUU4+jvdxYcP0jSbOu08J4Hu81Jm7oI6XznOdSEqLTD7CBM1AnCHq 8OaKn0f2OcB5Wx9f2ha2PK/APBplom5WD1Q89WDXrkYozQR3c414SvqI6ierxx08CXnqBl bADrnv/ecgeyLGkfshb9qN4/7PVAoPwAHrj7WbX/MfTDzKmEtiZx+gS1Hi0h/6SnlYbFBN uGJ25sDtNbyxMzQNkGi3qCl6gmxy/mGRJkLOXjNB4ZtjrEa86A3DW8k8ac7SwLZ1pQlQze ijZpzCIzwtE8qj/cpX6Agw+GVMnsil0XqDZOsi9qRIHSE8AKCCHqg4RMpz/LJw== 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=1702199200; 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=q+POckeQmI+5axgZRJ4o7whkRvxonReQPwPLKvRjwUE=; b=WUjxaz8in2osVr3iLXuzXozwRRfkK2IXqIRghBagIw3kF3383soi8J1okrn+V+BNDvUyLL xNyZK5VbtGOZJhFtlUx9adawP+tCzsgzXKw3uJqflnh18QJlzWfPvvuwC3Dk/XRiPgaelO URm4xVciE/6r1vZOWrlF+7lmPfVPOuwiwqfiOM9vNufxVJzfiJ18AXqXltDTdwf5PnH9tJ MAY7XZl8X81R8b1aHFmCv8mCWEK6qvxh6LHltOphWujfppDScxuaiJBktBKjEdkwqhVxBa SOUmcDVD8heGkGoJeUsWw1fN7rRXv73ooh5up7zpgK/OlMycWwVLXrZNYD4X/g== 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 4SnzX00HQfzj1N; Sun, 10 Dec 2023 09:06:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BA96dik037609; Sun, 10 Dec 2023 09:06:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BA96djY037606; Sun, 10 Dec 2023 09:06:39 GMT (envelope-from git) Date: Sun, 10 Dec 2023 09:06:39 GMT Message-Id: <202312100906.3BA96djY037606@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Xin LI Subject: git: 29553f9e8caf - stable/14 - MFV: xz 5.4.5 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: delphij X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 29553f9e8caf40103bbdfae6407d441a83be74fa Auto-Submitted: auto-generated The branch stable/14 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=29553f9e8caf40103bbdfae6407d441a83be74fa commit 29553f9e8caf40103bbdfae6407d441a83be74fa Author: Xin LI AuthorDate: 2023-11-26 00:55:52 +0000 Commit: Xin LI CommitDate: 2023-12-10 09:06:26 +0000 MFV: xz 5.4.5 (cherry picked from commit ca6a6373bdaed010d6cbfb27f7249ae96009409d) --- contrib/xz/ChangeLog | 870 ++++++++++++++++++++- contrib/xz/FREEBSD-Xlist | 1 - contrib/xz/FREEBSD-upgrade | 2 - contrib/xz/THANKS | 4 + contrib/xz/doxygen/Doxyfile | 7 +- contrib/xz/src/common/mythread.h | 2 +- contrib/xz/src/common/sysdefs.h | 10 +- contrib/xz/src/common/tuklib_integer.h | 282 +++++-- contrib/xz/src/liblzma/api/lzma.h | 4 +- contrib/xz/src/liblzma/api/lzma/version.h | 4 +- contrib/xz/src/liblzma/check/check.h | 7 + contrib/xz/src/liblzma/check/crc64_fast.c | 8 + contrib/xz/src/liblzma/check/crc64_table.c | 6 +- contrib/xz/src/liblzma/common/common.c | 6 +- contrib/xz/src/liblzma/common/common.h | 36 +- contrib/xz/src/liblzma/common/index.c | 6 + contrib/xz/src/liblzma/common/index.h | 2 +- contrib/xz/src/liblzma/common/memcmplen.h | 2 +- .../xz/src/liblzma/common/stream_flags_common.h | 3 + contrib/xz/src/liblzma/liblzma.pc.in | 1 + contrib/xz/src/liblzma/lz/lz_encoder_hash.h | 1 + contrib/xz/src/liblzma/lzma/fastpos.h | 1 + contrib/xz/src/liblzma/lzma/fastpos_tablegen.c | 2 + contrib/xz/src/liblzma/rangecoder/price.h | 1 + contrib/xz/src/lzmainfo/lzmainfo.c | 6 +- contrib/xz/src/xz/coder.c | 3 +- contrib/xz/src/xz/file_io.c | 40 +- contrib/xz/src/xz/file_io.h | 4 +- contrib/xz/src/xz/hardware.h | 3 +- contrib/xz/src/xz/message.h | 30 +- contrib/xz/src/xz/options.c | 3 +- contrib/xz/src/xz/util.c | 89 +-- contrib/xz/src/xz/util.h | 10 +- contrib/xz/src/xz/xz.1 | 1 - contrib/xz/src/xzdec/xzdec.c | 9 +- lib/liblzma/config.h | 6 +- 36 files changed, 1298 insertions(+), 174 deletions(-) diff --git a/contrib/xz/ChangeLog b/contrib/xz/ChangeLog index 64c79dbce0bc..4dd0978ef313 100644 --- a/contrib/xz/ChangeLog +++ b/contrib/xz/ChangeLog @@ -1,4 +1,870 @@ -commit c1e396a9ac1c1c28ce4ede5cbadb955c516477bc +commit 49053c0a649f4c8bd2b8d97ce915f401fbc0f3d9 +Author: Jia Tan +Date: 2023-10-31 22:30:29 +0800 + + Bump version and soname for 5.4.5. + + src/liblzma/Makefile.am | 2 +- + src/liblzma/api/lzma/version.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit 84c0cfc556287628df871703672879e530d0391f +Author: Jia Tan +Date: 2023-11-01 20:18:30 +0800 + + Add NEWS for 5.4.5. + + NEWS | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 74 insertions(+) + +commit d90ed84db9770712e2421e170076b43bda9b64a7 +Author: Lasse Collin +Date: 2023-10-31 21:41:09 +0200 + + liblzma: Fix compilation of fastpos_tablegen.c. + + The macro lzma_attr_visibility_hidden has to be defined to make + fastpos.h usable. The visibility attribute is irrelevant to + fastpos_tablegen.c so simply #define the macro to an empty value. + + fastpos_tablegen.c is never built by the included build systems + and so the problem wasn't noticed earlier. It's just a standalone + program for generating fastpos_table.c. + + Fixes: https://github.com/tukaani-project/xz/pull/69 + Thanks to GitHub user Jamaika1. + + src/liblzma/lzma/fastpos_tablegen.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit 9b1268538b0b2c6c0a121f95165de65fc71ad23c +Author: Jia Tan +Date: 2023-10-31 21:51:40 +0800 + + Build: Fix text wrapping in an output message. + + configure.ac | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +commit 068ee436f4a8a706125ef43e8228b30001b1554e +Author: Lasse Collin +Date: 2023-10-22 17:59:11 +0300 + + liblzma: Use lzma_always_inline in memcmplen.h. + + src/liblzma/common/memcmplen.h | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +commit 6cdf0a7b7974baf58c1fd20ec3278f3b84ae56e5 +Author: Lasse Collin +Date: 2023-10-30 17:43:03 +0200 + + liblzma: #define lzma_always_inline in common.h. + + src/liblzma/common/common.h | 17 +++++++++++++++++ + 1 file changed, 17 insertions(+) + +commit 33daad3961a4f07f3902b40f13e823e6e43e85da +Author: Lasse Collin +Date: 2023-10-22 17:15:32 +0300 + + liblzma: Use lzma_attr_visibility_hidden on private extern declarations. + + These variables are internal to liblzma and not exposed in the API. + + src/liblzma/check/check.h | 7 +++++++ + src/liblzma/common/stream_flags_common.h | 3 +++ + src/liblzma/lz/lz_encoder_hash.h | 1 + + src/liblzma/lzma/fastpos.h | 1 + + src/liblzma/rangecoder/price.h | 1 + + 5 files changed, 13 insertions(+) + +commit 6961a5ac7df178bfc2b7a181c40575847bc3035f +Author: Lasse Collin +Date: 2023-10-22 17:08:39 +0300 + + liblzma: #define lzma_attr_visibility_hidden in common.h. + + In ELF shared libs: + + -fvisibility=hidden affects definitions of symbols but not + declarations.[*] This doesn't affect direct calls to functions + inside liblzma as a linker can replace a call to lzma_foo@plt + with a call directly to lzma_foo when -fvisibility=hidden is used. + + [*] It has to be like this because otherwise every installed + header file would need to explictly set the symbol visibility + to default. + + When accessing extern variables that aren't defined in the + same translation unit, compiler assumes that the variable has + the default visibility and thus indirection is needed. Unlike + function calls, linker cannot optimize this. + + Using __attribute__((__visibility__("hidden"))) with the extern + variable declarations tells the compiler that indirection isn't + needed because the definition is in the same shared library. + + About 15+ years ago, someone told me that it would be good if + the CRC tables would be defined in the same translation unit + as the C code of the CRC functions. While I understood that it + could help a tiny amount, I didn't want to change the code because + a separate translation unit for the CRC tables was needed for the + x86 assembly code anyway. But when visibility attributes are + supported, simply marking the extern declaration with the + hidden attribute will get identical result. When there are only + a few affected variables, this is trivial to do. I wish I had + understood this back then already. + + src/liblzma/common/common.h | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +commit 5b9e16764905d06fa8e8339ba185ddfee304e5fb +Author: Lasse Collin +Date: 2023-09-30 22:54:28 +0300 + + liblzma: Refer to MinGW-w64 instead of MinGW in the API headers. + + MinGW (formely a MinGW.org Project, later the MinGW.OSDN Project + at ) has GCC 9.2.0 as the + most recent GCC package (released 2021-02-02). The project might + still be alive but majority of people have switched to MinGW-w64. + Thus it seems clearer to refer to MinGW-w64 in our API headers too. + Building with MinGW is likely to still work but I haven't tested it + in the recent years. + + src/liblzma/api/lzma.h | 4 ++-- + src/liblzma/api/lzma/version.h | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +commit 36fabdbe67c8a8fbdc3ac695a91fc443a1328cc4 +Author: Lasse Collin +Date: 2023-09-27 00:58:17 +0300 + + CMake: Use -D_FILE_OFFSET_BITS=64 if (and only if) needed. + + A CMake option LARGE_FILE_SUPPORT is created if and only if + -D_FILE_OFFSET_BITS=64 affects sizeof(off_t). + + This is needed on many 32-bit platforms and even with 64-bit builds + with MinGW-w64 to get support for files larger than 2 GiB. + + CMakeLists.txt | 7 ++++- + cmake/tuklib_large_file_support.cmake | 52 +++++++++++++++++++++++++++++++++++ + 2 files changed, 58 insertions(+), 1 deletion(-) + +commit 989c8c354cbd2d20fbae4a432a3e31f5bc1cb9bf +Author: Lasse Collin +Date: 2023-09-30 02:14:25 +0300 + + CMake: Generate and install liblzma.pc if not using MSVC. + + Autotools based build uses -pthread and thus adds it to Libs.private + in liblzma.pc. CMake doesn't use -pthread at all if pthread functions + are available in libc so Libs.private doesn't get -pthread either. + + CMakeLists.txt | 21 +++++++++++++++++++++ + 1 file changed, 21 insertions(+) + +commit 983f3b458dc79c5976a4237fdfe4f8079f8d8830 +Author: Lasse Collin +Date: 2023-09-30 01:13:13 +0300 + + CMake: Rearrange the PACKAGE_ variables. + + The windres workaround now replaces spaces with \x20 so + the package name isn't repeated. + + These changes will help with creation of liblzma.pc. + + CMakeLists.txt | 26 +++++++++++++++----------- + 1 file changed, 15 insertions(+), 11 deletions(-) + +commit 4083c8e9501a48934a5fb563d2c3ce2ae143cd27 +Author: Lasse Collin +Date: 2023-09-29 20:46:11 +0300 + + liblzma: Add Cflags.private to liblzma.pc.in for MSYS2. + + It properly adds -DLZMA_API_STATIC when compiling code that + will be linked against static liblzma. Having it there on + systems other than Windows does no harm. + + See: https://www.msys2.org/docs/pkgconfig/ + + src/liblzma/liblzma.pc.in | 1 + + 1 file changed, 1 insertion(+) + +commit 661549ecb7a9b136d72a01c137d9776c75d52d51 +Author: Lasse Collin +Date: 2023-09-27 22:46:20 +0300 + + CMake: Create liblzma.def when building liblzma.dll with MinGW-w64. + + CMakeLists.txt | 20 ++++++++++++++++++++ + cmake/remove-ordinals.cmake | 26 ++++++++++++++++++++++++++ + 2 files changed, 46 insertions(+) + +commit 0e546eb4da05c52b7d257e5bd85e15c51c4d86a3 +Author: Lasse Collin +Date: 2023-10-26 21:44:42 +0300 + + CMake: Change one CMAKE_CURRENT_SOURCE_DIR to CMAKE_CURRENT_LIST_DIR. + + In this case they have identical values. + + CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit da4d04e4d6e199d28b58bd2e0df4e120c52dd5d7 +Author: Lasse Collin +Date: 2023-10-01 19:10:57 +0300 + + CMake/Windows: Fix the import library filename. + + Both PREFIX and IMPORT_PERFIX have to be set to "" to get + liblzma.dll and liblzma.dll.a. + + CMakeLists.txt | 1 + + 1 file changed, 1 insertion(+) + +commit 007558a358c48a0175cc8d47d11798d7967282ab +Author: Lasse Collin +Date: 2023-10-11 19:47:44 +0300 + + CMake: Don't shadow the cache entry ENABLE_THREADS with a normal variable. + + Using set(ENABLE_THREADS "posix") is confusing because it sets + a new normal variable and leaves the cache entry with the same + name unchanged. The intent wasn't to change the cache entry so + this switches to a different variable name. + + CMakeLists.txt | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +commit 7d01de67ee3dd76cfc12c23220e2e4cdc59708f1 +Author: Lasse Collin +Date: 2023-10-09 21:12:31 +0300 + + CMake: Edit threading related messages. + + It's mostly to change from "thread method" to "threading method". + + CMakeLists.txt | 19 ++++++++++--------- + 1 file changed, 10 insertions(+), 9 deletions(-) + +commit f8edcf3da689aad4b21e139197725450f2c456a0 +Author: Lasse Collin +Date: 2023-10-09 20:59:24 +0300 + + CMake: Use FATAL_ERROR if user-supplied options aren't understood. + + This way typos are caught quickly and compounding error messages + are avoided (a single typo could cause more than one error). + + This keeps using SEND_ERROR when the system is lacking a feature + (like threading library or sandboxing method). This way the whole + configuration log will be generated in case someone wishes to + report a problem upstream. + + CMakeLists.txt | 28 ++++++++++++++-------------- + 1 file changed, 14 insertions(+), 14 deletions(-) + +commit 1695021e4a233a9388ddd428654c1447f0ea3bfb +Author: Jia Tan +Date: 2023-10-19 16:09:01 +0800 + + CMake: Add ALLOW_CLMUL_CRC option to enable/disable CLMUL. + + The option is enabled by default, but will only be visible to a user + listing cache variables or using a CMake GUI application if the + immintrin.h header file is found. + + This mirrors our Autotools build --disable-clmul-crc functionality. + + CMakeLists.txt | 40 +++++++++++++++++++++++----------------- + 1 file changed, 23 insertions(+), 17 deletions(-) + +commit 5056bc51071d1a07097c5667a0d5bd85242e31b9 +Author: Lasse Collin +Date: 2023-10-14 17:56:59 +0300 + + tuklib_integer: Revise unaligned reads and writes on strict-align archs. + + In XZ Utils context this doesn't matter much because + unaligned reads and writes aren't used in hot code + when TUKLIB_FAST_UNALIGNED_ACCESS isn't #defined. + + src/common/tuklib_integer.h | 256 ++++++++++++++++++++++++++++++++------------ + 1 file changed, 189 insertions(+), 67 deletions(-) + +commit 9e14743ee5ba79181076bc33952245d5b18fbc58 +Author: Lasse Collin +Date: 2023-09-23 02:21:49 +0300 + + tuklib_integer: Add missing write64be and write64le fallback functions. + + src/common/tuklib_integer.h | 34 ++++++++++++++++++++++++++++++++++ + 1 file changed, 34 insertions(+) + +commit 4cc91ceb3992ef4f51302b56178c3b2c2aeaaaad +Author: Jia Tan +Date: 2023-10-12 20:12:18 +0800 + + Build: Update visibility.m4 from Gnulib. + + Updating from version 6 -> 8 from upstream. Declarations for variables + and function bodies were added to avoid unnecessary failures with + -Werror. + + m4/visibility.m4 | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +commit 1824a6007cb1c8d5d7abcc7bf649148bc06fa72c +Author: Lasse Collin +Date: 2023-10-06 19:36:35 +0300 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 8fdc71a27d07b10a3da52432432e080b6d577642 +Author: Jia Tan +Date: 2023-09-29 20:14:39 +0800 + + CMake: Rename xz and man page symlink custom targets. + + The Ninja Generator for CMake cannot have a custom target and its + BYPRODUCTS have the same name. This has prevented Ninja builds on + Unix-like systems since the xz symlinks were introduced in + 80a1a8bb838842a2be343bd88ad1462c21c5e2c9. + + CMakeLists.txt | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 38171492ded6426ddf53d0c200fa8c93fcd02a60 +Author: Lasse Collin +Date: 2023-09-27 19:54:35 +0300 + + CMake: Fix Windows build with Clang/LLVM 17. + + llvm-windres 17.0.0 has more accurate emulation of GNU windres, so + the hack for GNU windres must now be used with llvm-windres too. + + LLVM 16.0.6 has the old behavior and there likely won't be more + 16.x releases. So we can simply check for >= 17.0.0. + + The workaround must not be used with Clang that is acting in + MSVC mode. This checks for the known environments that need + the workaround instead of using "NOT MSVC". + + See also: + https://github.com/llvm/llvm-project/commit/2bcc0fdc58a220cb9921b47ec8a32c85f2511a47 + + CMakeLists.txt | 26 ++++++++++++++------------ + 1 file changed, 14 insertions(+), 12 deletions(-) + +commit 1bce6fe48334b5df33d0487a9cbe41950122230e +Author: Jia Tan +Date: 2023-09-27 00:02:11 +0800 + + liblzma: Avoid compiler warning without creating extra symbol. + + When the generic fast crc64 method is used, then we omit + lzma_crc64_table[][]. + + The C standards don't allow an empty translation unit which can be + avoided by declaring something, without exporting any symbols. + + src/liblzma/check/crc64_table.c | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +commit dce95a593e6cd9779110aa1e314abd8b35c75f6b +Author: Lasse Collin +Date: 2023-09-26 17:24:15 +0300 + + Build: Update the comment about -Werror usage in checks. + + configure.ac | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +commit f3c32762ae309afa2fe330e7fb397acfdedc4d37 +Author: Lasse Collin +Date: 2023-09-26 13:51:31 +0300 + + Build: Fix underquoted AC_LANG_SOURCE. + + It made no practical difference in this case. + + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 7dd57f2f2c8fde93fa42b4dbf6d9860717723b41 +Author: Lasse Collin +Date: 2023-09-26 13:14:37 +0300 + + Build: Silence Autoconf warning. + + There was a use of AC_COMPILE_IFELSE that didn't use + AC_LANG_SOURCE and Autoconf warned about this. The omission + had been intentional but it turned out that this didn't do + what I thought it would. + + Autoconf 2.71 manual gives an impression that AC_LANG_SOURCE + inserts all #defines that have been made with AC_DEFINE so + far (confdefs.h). The idea was that omitting AC_LANG_SOURCE + would mean that only the exact code included in the + AC_COMPILE_IFELSE call would be compiled. + + With C programs this is not true: the #defines get added without + AC_LANG_SOURCE too. There seems to be no neat way to avoid this. + Thus, with the C language at least, adding AC_LANG_SOURCE makes + no other difference than silencing a warning from Autoconf. The + generated "configure" remains identical. (Docs of AC_LANG_CONFTEST + say that the #defines have been inserted since Autoconf 2.63b and + that AC_COMPILE_IFELSE uses AC_LANG_CONFTEST. So the behavior is + documented if one also reads the docs of macros that one isn't + calling directly.) + + Any extra code, including #defines, can cause problems for + these two tests because these tests must use -Werror. + CC=clang CFLAGS=-Weverything is the most extreme example. + It enables -Wreserved-macro-identifier which warns about + It's possible to write a test file that passes -Weverything but + it becomes impossible when Autoconf inserts confdefs.h. + + So this commit adds AC_LANG_SOURCE to silence Autoconf warnings. + A different solution is needed for -Werror tests. + + configure.ac | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +commit edec253e418562f3164a01ecc8805295fa022efa +Author: Jia Tan +Date: 2023-09-26 00:47:26 +0800 + + Build: Remove Gnulib dependency from tests. + + The tests do not use any Gnulib replacements so they do not need to link + libgnu.a or have /lib in the include path. + + tests/Makefile.am | 7 +------ + 1 file changed, 1 insertion(+), 6 deletions(-) + +commit 46cb133ce7360496eecca1255b364c05f0205855 +Author: Jia Tan +Date: 2023-09-26 00:43:43 +0800 + + CMake: Remove /lib from tests include path. + + The tests never included anything from /lib, so this was not needed. + + CMakeLists.txt | 1 - + 1 file changed, 1 deletion(-) + +commit 4ae13cfe0dedb8ddc3cf9ded8cd1ac09361b3bd1 +Author: Lasse Collin +Date: 2023-09-24 16:32:32 +0300 + + sysdefs.h: Update the comment about __USE_MINGW_ANSI_STDIO. + + src/common/sysdefs.h | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +commit 660c8c29e57d30dbd5009ef1f0ec1bbe195ccef6 +Author: Lasse Collin +Date: 2023-09-22 02:33:29 +0300 + + xz: Windows: Don't (de)compress to special files like "con" or "nul". + + Before this commit, the following writes "foo" to the + console and deletes the input file: + + echo foo | xz > con_xz + xz --suffix=_xz --decompress con_xz + + It cannot happen without --suffix because names like con.xz + are also special and so attempting to decompress con.xz + (or compress con to con.xz) will already fail when opening + the input file. + + Similar thing is possible when compressing. The following + writes to "nul" and the input file "n" is deleted. + + echo foo | xz > n + xz --suffix=ul n + + Now xz checks if the destination is a special file before + continuing. DOS/DJGPP version had a check for this but + Windows (and OS/2) didn't. + + src/xz/file_io.c | 35 ++++++++++++++++++++++++++++------- + 1 file changed, 28 insertions(+), 7 deletions(-) + +commit b7ce6e80786fc0c08ed129e8ee262ea96a5473a1 +Author: Lasse Collin +Date: 2023-09-21 20:42:52 +0300 + + CMake: Wrap two overlong lines that are possible to wrap. + + CMakeLists.txt | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +commit 1595f454d5c8257c668cccd6a86dd68175d5c430 +Author: Lasse Collin +Date: 2023-09-21 20:36:31 +0300 + + CMake: Add a comment about threads on Cygwin. + + CMakeLists.txt | 1 + + 1 file changed, 1 insertion(+) + +commit 5be6275f19784cdd5a954f0188045c8ff4934d54 +Author: Lasse Collin +Date: 2023-09-12 21:12:34 +0300 + + CMake: Bump maximum policy version to 3.27. + + There are several new policies. CMP0149 may affect the Windows SDK + version that CMake will choose by default. The new behavior is more + predictable, always choosing the latest SDK version by default. + + The other new policies shouldn't affect this package. + + CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit e515643d7524851d1eb7dab73453e26d8521324c +Author: Lasse Collin +Date: 2023-09-08 19:08:57 +0300 + + Doxygen: Add more C macro names to PREDEFINED. + + doxygen/Doxyfile | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +commit e3478ae4f36cd06522a2fef023860893f068434d +Author: Lasse Collin +Date: 2023-09-11 18:47:26 +0300 + + liblzma: Move a few __attribute__ uses in function declarations. + + The API headers have many attributes but these were left + as is for now. + + src/liblzma/common/common.c | 6 ++++-- + src/liblzma/common/common.h | 8 ++++---- + src/liblzma/common/memcmplen.h | 3 ++- + 3 files changed, 10 insertions(+), 7 deletions(-) + +commit b71b8922ef3971e5ccffd1e213888d44abe21d11 +Author: Lasse Collin +Date: 2023-09-11 19:03:35 +0300 + + xz, xzdec, lzmainfo: Use tuklib_attr_noreturn. + + For compatibility with C23's [[noreturn]], tuklib_attr_noreturn + must be at the beginning of declaration (before "extern" or + "static", and even before any GNU C's __attribute__). + + This commit also moves all other function attributes to + the beginning of function declarations. "extern" is kept + at the beginning of a line so the attributes are listed on + separate lines before "extern" or "static". + + src/lzmainfo/lzmainfo.c | 6 ++++-- + src/xz/coder.c | 3 ++- + src/xz/hardware.h | 3 ++- + src/xz/message.h | 30 +++++++++++++++++------------- + src/xz/options.c | 3 ++- + src/xz/util.h | 8 ++++---- + src/xzdec/xzdec.c | 9 ++++++--- + 7 files changed, 37 insertions(+), 25 deletions(-) + +commit 359e5c6cb128dab64ea6070d21d1c240f96cea6b +Author: Lasse Collin +Date: 2023-09-11 18:53:31 +0300 + + Remove incorrect uses of __attribute__((__malloc__)). + + xrealloc() is obviously incorrect, modern GCC docs even + mention realloc() as an example where this attribute + cannot be used. + + liblzma's lzma_alloc() and lzma_alloc_zero() would be + correct uses most of the time but custom allocators + may use a memory pool or otherwise hold the pointer + so aliasing issues could happen in theory. + + The xstrdup() case likely was correct but I removed it anyway. + Now there are no __malloc__ attributes left in the code. + The allocations aren't in hot paths so this should make + no practical difference. + + src/liblzma/common/common.c | 4 ++-- + src/liblzma/common/common.h | 4 ++-- + src/xz/util.h | 4 ++-- + 3 files changed, 6 insertions(+), 6 deletions(-) + +commit 589b4cba22fccb1dbc919df5d134aefb2b5a6b01 +Author: Lasse Collin +Date: 2023-09-19 14:03:45 +0300 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 43728ed2267e921fbdfa699ee1e91b105ab0e98b +Author: Lasse Collin +Date: 2023-09-14 16:35:46 +0300 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit caf00e0988ba47842cfd93dfbb17f7d30120d6e7 +Author: Lasse Collin +Date: 2023-09-14 16:34:07 +0300 + + liblzma: Mark crc64_clmul() with __attribute__((__no_sanitize_address__)). + + Thanks to Agostino Sarubbo. + Fixes: https://github.com/tukaani-project/xz/issues/62 + + src/liblzma/check/crc64_fast.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +commit a70e96d2da761b8b3a77bf14e08002d871e5950b +Author: Jia Tan +Date: 2023-09-12 22:36:12 +0800 + + CMake: Fix time.h checks not running on second CMake run. + + If CMake was configured more than once, HAVE_CLOCK_GETTIME and + HAVE_CLOCK_MONOTONIC would not be set as compile definitions. The check + for librt being needed to provide HAVE_CLOCK_GETTIME was also + simplified. + + CMakeLists.txt | 18 ++++++++++-------- + 1 file changed, 10 insertions(+), 8 deletions(-) + +commit d5275d83bd2a9701c5feb8666785007c074b1359 +Author: Jia Tan +Date: 2023-09-12 22:34:06 +0800 + + CMake: Fix unconditionally defining HAVE_CLOCK_MONOTONIC. + + If HAVE_CLOCK_GETTIME was defined, then HAVE_CLOCK_MONOTONIC was always + added as a compile definition even if the check for it failed. + + CMakeLists.txt | 8 +++----- + 1 file changed, 3 insertions(+), 5 deletions(-) + +commit 1f6e7c68fbdeeaa9482fc77de090be63d90912fd +Author: Lasse Collin +Date: 2023-08-31 19:50:05 +0300 + + xz: Refactor thousand separator detection and disable it on MSVC. + + Now the two variations of the format strings are created with + a macro, and the whole detection code can be easily disabled + on platforms where thousand separator formatting is known to + not work (MSVC has no support, and on DJGPP 2.05 it can have + problems in some cases). + + src/xz/util.c | 89 ++++++++++++++++++++++++++++++----------------------------- + 1 file changed, 45 insertions(+), 44 deletions(-) + +commit ef71f83973a20cc28a3221f85681922026ea33f5 +Author: Lasse Collin +Date: 2023-08-31 18:14:43 +0300 + + xz: Fix a too relaxed assertion and remove uses of SSIZE_MAX. + + SSIZE_MAX isn't readily available on MSVC. Removing it means + that there is one thing less to worry when porting to MSVC. + + src/xz/file_io.c | 5 ++--- + src/xz/file_io.h | 4 ++-- + 2 files changed, 4 insertions(+), 5 deletions(-) + +commit cf8ba7c3a89e37736b926dfbe85dffeff725db47 +Author: Jia Tan +Date: 2023-08-28 23:14:45 +0800 + + Tests: Improve invalid unpadded size check in test_lzma_index_append(). + + This check was extended to test the code added to fix a failing assert + in 68bda971bb8b666a009331455fcedb4e18d837a4. + + tests/test_index.c | 26 +++++++++++++++++++++++--- + 1 file changed, 23 insertions(+), 3 deletions(-) + +commit 4a4180ce74788e97e90b9aab579bfd7c6dce3f59 +Author: Jia Tan +Date: 2023-08-28 21:54:41 +0800 + + Tests: Improve comments in test_index.c. + + tests/test_index.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 4b23b84b89e39a5117e16f66c3b01db4f08ed3e7 +Author: Jia Tan +Date: 2023-08-28 21:52:54 +0800 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 773f1e8622cb1465df528cb16a749517650acd93 +Author: Jia Tan +Date: 2023-08-28 21:50:16 +0800 + + liblzma: Update assert in vli_ceil4(). + + The argument to vli_ceil4() should always guarantee the return value + is also a valid lzma_vli. Thus the highest three valid lzma_vli values + are invalid arguments. All uses of the function ensure this so the + assert is updated to match this. + + src/liblzma/common/index.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 68bda971bb8b666a009331455fcedb4e18d837a4 +Author: Jia Tan +Date: 2023-08-28 21:31:25 +0800 + + liblzma: Add overflow check for Unpadded size in lzma_index_append(). + + This was not a security bug since there was no path to overflow + UINT64_MAX in lzma_index_append() or when it calls index_file_size(). + The bug was discovered by a failing assert() in vli_ceil4() when called + from index_file_size() when unpadded_sum (the sum of the compressed size + of current Stream and the unpadded_size parameter) exceeds LZMA_VLI_MAX. + + Previously, the unpadded_size parameter was checked to be not greater + than UNPADDED_SIZE_MAX, but no check was done once compressed_base was + added. + + This could not have caused an integer overflow in index_file_size() when + called by lzma_index_append(). The calculation for file_size breaks down + into the sum of: + + - Compressed base from all previous Streams + - 2 * LZMA_STREAM_HEADER_SIZE (size of the current Streams header and + footer) + - stream_padding (can be set by lzma_index_stream_padding()) + - Compressed base from the current Stream + - Unpadded size (parameter to lzma_index_append()) + + The sum of everything except for Unpadded size must be less than + LZMA_VLI_MAX. This is guarenteed by overflow checks in the functions + that can set these values including lzma_index_stream_padding(), + lzma_index_append(), and lzma_index_cat(). The maximum value for + Unpadded size is enforced by lzma_index_append() to be less than or + equal UNPADDED_SIZE_MAX. Thus, the sum cannot exceed UINT64_MAX since + LZMA_VLI_MAX is half of UINT64_MAX. + + Thanks to Joona Kannisto for reporting this. + + src/liblzma/common/index.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +commit b41bb79c602481d7ea93d65f5b3e3f08dc54233b +Author: Jia Tan +Date: 2023-08-28 22:18:29 +0800 + + Translations: Update the Esperanto translation. + + po/eo.po | 47 +++++++++++++++++++++++++++++------------------ + 1 file changed, 29 insertions(+), 18 deletions(-) + +commit 6614e6d4bf8e2b5af6eb73930148e0ffc8d2265a +Author: Jia Tan +Date: 2023-08-09 20:55:36 +0800 + + Docs: Update INSTALL for --enable-threads method win95. + + The Autotools build allows win95 threads and --enable-small together now + if the compiler supports __attribute__((__constructor__)). + + INSTALL | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +commit bfb623ad96fa6f1dbc0c560403c4296e3c8e26c9 +Author: Jia Tan +Date: 2023-08-09 20:54:15 +0800 + + CMake: Conditionally allow win95 threads and --enable-small. + + CMakeLists.txt | 27 +++++++++++++++++++-------- + 1 file changed, 19 insertions(+), 8 deletions(-) + +commit e919ebb29ac9f5270cd7176a39d0d3b4cea875a9 +Author: Jia Tan +Date: 2023-08-09 20:35:16 +0800 + + Build: Conditionally allow win95 threads and --enable-small. + + When the compiler supports __attribute__((__constructor__)) + mythread_once() is never used, even with --enable-small. A configuration + with win95 threads and --enable-small will compile and be thread safe so + it can be allowed. + + This isn't a very common configuration since MSVC does not support + __attribute__((__constructor__)), but MINGW32 and CLANG32 environments + for MSYS2 can use win95 threads and have + __attribute__((__constructor__)) support. + + configure.ac | 21 +++++++++++++-------- + 1 file changed, 13 insertions(+), 8 deletions(-) + +commit c0c0cd4a483a672b66a13761583bc4f84d86d501 +Author: Jamaika1 +Date: 2023-08-08 14:07:59 +0200 + + mythread.h: Fix typo error in Vista threads mythread_once(). + + The "once_" variable was accidentally referred to as just "once". This + prevented building with Vista threads when + HAVE_FUNC_ATTRIBUTE_CONSTRUCTOR was not defined. + + src/common/mythread.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit d93fbefcc48a8737fdf5678ce66d1c1d605752a0 +Author: Jia Tan +Date: 2023-08-03 20:10:21 +0800 + + Tests: Style fixes to test_lzip_decoder.c. + + tests/test_lzip_decoder.c | 36 ++++++++++++++++++++++++------------ + 1 file changed, 24 insertions(+), 12 deletions(-) + +commit 65981d8e45741fd1502e007609469e1d60312e69 +Author: Jia Tan +Date: 2023-08-03 15:56:20 +0800 + + Translations: Update the Chinese (simplified) translation. + + po/zh_CN.po | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit a108ed589171d683c34238a87e358b87f69e39a0 +Author: Lasse Collin +Date: 2023-08-02 17:15:12 +0300 + + xz: Omit an empty paragraph on the man page. + + src/xz/xz.1 | 1 - + 1 file changed, 1 deletion(-) + +commit 03c51c5c08fe3579d8bbc8eea8251a1128001330 Author: Jia Tan Date: 2023-08-02 20:32:20 +0800 @@ -8,7 +874,7 @@ Date: 2023-08-02 20:32:20 +0800 src/liblzma/api/lzma/version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) -commit 7d266d25ae323a2dc5f2e254c991ef84b997adad +commit d7fa3f1b58a77f79b1a4e12452418b5555632e18 Author: Jia Tan Date: 2023-08-02 20:30:07 +0800 diff --git a/contrib/xz/FREEBSD-Xlist b/contrib/xz/FREEBSD-Xlist index 060a6718b73c..fdbd69ce6d82 100644 --- a/contrib/xz/FREEBSD-Xlist +++ b/contrib/xz/FREEBSD-Xlist @@ -1,4 +1,3 @@ -$FreeBSD$ */*/*/Makefile.* */*/Makefile.* */.gitignore diff --git a/contrib/xz/FREEBSD-upgrade b/contrib/xz/FREEBSD-upgrade index 986197c1463b..400bfe70eee7 100644 --- a/contrib/xz/FREEBSD-upgrade +++ b/contrib/xz/FREEBSD-upgrade @@ -1,5 +1,3 @@ -$FreeBSD$ - xz The source code is pulled with git: diff --git a/contrib/xz/THANKS b/contrib/xz/THANKS index cf7c59c844c5..0206af938f1a 100644 --- a/contrib/xz/THANKS +++ b/contrib/xz/THANKS @@ -19,6 +19,7 @@ has been important. :-) In alphabetical order: - Jakub Bogusz - Adam Borowski - Maarten Bosmans + - Lukas Braune - Benjamin Buch - Trent W. Buck - Kevin R. Bulgrien @@ -64,6 +65,7 @@ has been important. :-) In alphabetical order: - Jouk Jansen - Jun I Jin - Kiyoshi Kanazawa + - Joona Kannisto - Per Øyvind Karlsen - Iouri Kharon - Thomas Klausner @@ -127,6 +129,7 @@ has been important. :-) In alphabetical order: - Torsten Rupp - Stephen Sachs - Jukka Salmi + - Agostino Sarubbo - Alexandre Sauvé - Benno Schulenberg - Andreas Schwab @@ -138,6 +141,7 @@ has been important. :-) In alphabetical order: - Brad Smith - Bruce Stark *** 1293 LINES SKIPPED *** From nobody Sun Dec 10 09:09:50 2023 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 4Snzbf6ryYz53SDY; Sun, 10 Dec 2023 09:09:50 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Snzbf6Yv8z4F63; Sun, 10 Dec 2023 09:09:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702199390; 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=WjjF1EsL371JhJ4a2Mgh16qO0WThaFlewzyRwH4YU4A=; b=sWDwFPpS1UV6qWiJNYGwSmDHHk5nRih9li67ygSH559gkCMsls1wJkPENmdr1C3n6WOfph IMCAvceI/uvjtZVWDyy/qvkwgeks7RyiknsN83TCIJYEYpqaLn4egUFOeMfdIoXgXdl5De 9UzFRPymNaJeKJwKXbBLC69Pua9f/tbZ1flS+MIhdgMXjFcjdN5J3iFO7zmflO0RNBgUsw you5yN9/TUtAr1HfvCYmcU2JZzlUKa0X1Ba8WWSP3SvooRnizYQYMjt2nEBgenLBaI6tMQ /pO6ltNNn9YQMV55wU4Iek2nFeDMyQRpldzeo/qx0WshkFAaRqQZ+rcug65cCA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702199390; a=rsa-sha256; cv=none; b=cZB+H9DW7gn4PIfzXmANHViTJij3T6ZyDliD6R1Y4ML5vRy36FON08QGqd85hBqSeg8EAW uG0TW14NvlmqmIDwZKKo1+8mGpqOktsjWx+uWrNjzXO8fSIFfhkN+xQh9plmzHLPY0Rj9V aG69rQVuRFs9ofTRUhDhYUJPV9DrlAQKNghuzAbJeqmeduWXkzT+y9cZCaUteErFKa8YVD 5zoXOO/OVD+ebyqsT9MIU27s+N+GgMvaPtcmjcTWZPmOgo6NqwlvKV4J49X/2OfXPha8l/ jCLRc4ZIjaSS33CNaaZ40WoYdTXZYXYaAOl50NigC+A6MYmeGOD6x2vr2voM7w== 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=1702199390; 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=WjjF1EsL371JhJ4a2Mgh16qO0WThaFlewzyRwH4YU4A=; b=C5uPbq+noe22XjZuXQRcQUm7rOsM9bjjGV1zc2GnpCBzmrgFYfgVnqZl+CdqlRalXw68IY SH3icHJ3wHhE1y4FIdxyng/FjJscoItlaflcnXvzLpgXlp6KSo1vf5hXfdxFQrpWI487jd BitfWPW3fP39+Ikzz+gnnGx9FqqI1dqelsHDESWFbGfOWzux+/DIYIsrKk3PNx12ajBYnT 7+IFqRZhdIrxRxbklazI45Rsw8xShTqNsVhqe6SSzOHELvzHQK7tXJOZwQgjs+IM66qy5Y pRV/IcrkWfoxp/4cs4voh6SuUKILwCYhYjs9nQYiBvh58BZVzp3QD5lVPuv6UQ== 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 4Snzbf5dprzj37; Sun, 10 Dec 2023 09:09:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BA99o4Z038141; Sun, 10 Dec 2023 09:09:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BA99oFB038138; Sun, 10 Dec 2023 09:09:50 GMT (envelope-from git) Date: Sun, 10 Dec 2023 09:09:50 GMT Message-Id: <202312100909.3BA99oFB038138@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Xin LI Subject: git: f82906a49bbc - stable/13 - MFC: xz 5.4.5 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: delphij X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f82906a49bbc7910c4942b9720a90b6034b87dd7 Auto-Submitted: auto-generated The branch stable/13 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=f82906a49bbc7910c4942b9720a90b6034b87dd7 commit f82906a49bbc7910c4942b9720a90b6034b87dd7 Author: Xin LI AuthorDate: 2023-05-12 22:49:34 +0000 Commit: Xin LI CommitDate: 2023-12-10 09:08:36 +0000 MFC: xz 5.4.5 (cherry picked from commit ca6a6373bdaed010d6cbfb27f7249ae96009409d) (cherry picked from commit 1f3ced26d4946ff2e24472432a275efb9ba1f2ca) (cherry picked from commit b333cd44de6db4d3182add2f80870c7a96d570d9) --- contrib/xz/ChangeLog | 1837 ++++++++++++++++++++ contrib/xz/FREEBSD-Xlist | 1 - contrib/xz/FREEBSD-upgrade | 2 - contrib/xz/README | 4 + contrib/xz/THANKS | 9 + contrib/xz/doxygen/Doxyfile | 7 +- contrib/xz/src/common/mythread.h | 4 +- contrib/xz/src/common/sysdefs.h | 10 +- contrib/xz/src/common/tuklib_integer.h | 294 +++- contrib/xz/src/liblzma/api/lzma.h | 6 +- contrib/xz/src/liblzma/api/lzma/container.h | 9 +- contrib/xz/src/liblzma/api/lzma/filter.h | 4 +- contrib/xz/src/liblzma/api/lzma/lzma12.h | 4 +- contrib/xz/src/liblzma/api/lzma/version.h | 4 +- contrib/xz/src/liblzma/check/check.h | 7 + contrib/xz/src/liblzma/check/crc64_fast.c | 8 + contrib/xz/src/liblzma/check/crc64_table.c | 6 +- contrib/xz/src/liblzma/common/alone_encoder.c | 11 - .../xz/src/liblzma/common/block_buffer_encoder.c | 2 +- contrib/xz/src/liblzma/common/common.c | 6 +- contrib/xz/src/liblzma/common/common.h | 38 +- contrib/xz/src/liblzma/common/file_info.c | 2 +- contrib/xz/src/liblzma/common/index.c | 6 + contrib/xz/src/liblzma/common/index.h | 2 +- contrib/xz/src/liblzma/common/lzip_decoder.c | 2 +- contrib/xz/src/liblzma/common/memcmplen.h | 21 +- contrib/xz/src/liblzma/common/stream_decoder_mt.c | 8 +- contrib/xz/src/liblzma/common/stream_encoder_mt.c | 2 +- .../xz/src/liblzma/common/stream_flags_common.h | 3 + contrib/xz/src/liblzma/common/string_conversion.c | 10 +- contrib/xz/src/liblzma/liblzma.pc.in | 1 + contrib/xz/src/liblzma/lz/lz_encoder.h | 2 +- contrib/xz/src/liblzma/lz/lz_encoder_hash.h | 1 + contrib/xz/src/liblzma/lzma/fastpos.h | 1 + contrib/xz/src/liblzma/lzma/fastpos_tablegen.c | 2 + contrib/xz/src/liblzma/lzma/lzma_encoder.c | 4 +- contrib/xz/src/liblzma/rangecoder/price.h | 1 + contrib/xz/src/lzmainfo/lzmainfo.c | 6 +- contrib/xz/src/xz/args.c | 5 +- contrib/xz/src/xz/coder.c | 11 +- contrib/xz/src/xz/file_io.c | 48 +- contrib/xz/src/xz/file_io.h | 4 +- contrib/xz/src/xz/hardware.c | 4 +- contrib/xz/src/xz/hardware.h | 3 +- contrib/xz/src/xz/list.c | 11 +- contrib/xz/src/xz/message.c | 2 +- contrib/xz/src/xz/message.h | 30 +- contrib/xz/src/xz/options.c | 3 +- contrib/xz/src/xz/util.c | 89 +- contrib/xz/src/xz/util.h | 10 +- contrib/xz/src/xz/xz.1 | 10 +- contrib/xz/src/xzdec/xzdec.c | 9 +- lib/liblzma/config.h | 6 +- 53 files changed, 2355 insertions(+), 237 deletions(-) diff --git a/contrib/xz/ChangeLog b/contrib/xz/ChangeLog index 52375b492a14..4dd0978ef313 100644 --- a/contrib/xz/ChangeLog +++ b/contrib/xz/ChangeLog @@ -1,3 +1,1840 @@ +commit 49053c0a649f4c8bd2b8d97ce915f401fbc0f3d9 +Author: Jia Tan +Date: 2023-10-31 22:30:29 +0800 + + Bump version and soname for 5.4.5. + + src/liblzma/Makefile.am | 2 +- + src/liblzma/api/lzma/version.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit 84c0cfc556287628df871703672879e530d0391f +Author: Jia Tan +Date: 2023-11-01 20:18:30 +0800 + + Add NEWS for 5.4.5. + + NEWS | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 74 insertions(+) + +commit d90ed84db9770712e2421e170076b43bda9b64a7 +Author: Lasse Collin +Date: 2023-10-31 21:41:09 +0200 + + liblzma: Fix compilation of fastpos_tablegen.c. + + The macro lzma_attr_visibility_hidden has to be defined to make + fastpos.h usable. The visibility attribute is irrelevant to + fastpos_tablegen.c so simply #define the macro to an empty value. + + fastpos_tablegen.c is never built by the included build systems + and so the problem wasn't noticed earlier. It's just a standalone + program for generating fastpos_table.c. + + Fixes: https://github.com/tukaani-project/xz/pull/69 + Thanks to GitHub user Jamaika1. + + src/liblzma/lzma/fastpos_tablegen.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit 9b1268538b0b2c6c0a121f95165de65fc71ad23c +Author: Jia Tan +Date: 2023-10-31 21:51:40 +0800 + + Build: Fix text wrapping in an output message. + + configure.ac | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +commit 068ee436f4a8a706125ef43e8228b30001b1554e +Author: Lasse Collin +Date: 2023-10-22 17:59:11 +0300 + + liblzma: Use lzma_always_inline in memcmplen.h. + + src/liblzma/common/memcmplen.h | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +commit 6cdf0a7b7974baf58c1fd20ec3278f3b84ae56e5 +Author: Lasse Collin +Date: 2023-10-30 17:43:03 +0200 + + liblzma: #define lzma_always_inline in common.h. + + src/liblzma/common/common.h | 17 +++++++++++++++++ + 1 file changed, 17 insertions(+) + +commit 33daad3961a4f07f3902b40f13e823e6e43e85da +Author: Lasse Collin +Date: 2023-10-22 17:15:32 +0300 + + liblzma: Use lzma_attr_visibility_hidden on private extern declarations. + + These variables are internal to liblzma and not exposed in the API. + + src/liblzma/check/check.h | 7 +++++++ + src/liblzma/common/stream_flags_common.h | 3 +++ + src/liblzma/lz/lz_encoder_hash.h | 1 + + src/liblzma/lzma/fastpos.h | 1 + + src/liblzma/rangecoder/price.h | 1 + + 5 files changed, 13 insertions(+) + +commit 6961a5ac7df178bfc2b7a181c40575847bc3035f +Author: Lasse Collin +Date: 2023-10-22 17:08:39 +0300 + + liblzma: #define lzma_attr_visibility_hidden in common.h. + + In ELF shared libs: + + -fvisibility=hidden affects definitions of symbols but not + declarations.[*] This doesn't affect direct calls to functions + inside liblzma as a linker can replace a call to lzma_foo@plt + with a call directly to lzma_foo when -fvisibility=hidden is used. + + [*] It has to be like this because otherwise every installed + header file would need to explictly set the symbol visibility + to default. + + When accessing extern variables that aren't defined in the + same translation unit, compiler assumes that the variable has + the default visibility and thus indirection is needed. Unlike + function calls, linker cannot optimize this. + + Using __attribute__((__visibility__("hidden"))) with the extern + variable declarations tells the compiler that indirection isn't + needed because the definition is in the same shared library. + + About 15+ years ago, someone told me that it would be good if + the CRC tables would be defined in the same translation unit + as the C code of the CRC functions. While I understood that it + could help a tiny amount, I didn't want to change the code because + a separate translation unit for the CRC tables was needed for the + x86 assembly code anyway. But when visibility attributes are + supported, simply marking the extern declaration with the + hidden attribute will get identical result. When there are only + a few affected variables, this is trivial to do. I wish I had + understood this back then already. + + src/liblzma/common/common.h | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +commit 5b9e16764905d06fa8e8339ba185ddfee304e5fb +Author: Lasse Collin +Date: 2023-09-30 22:54:28 +0300 + + liblzma: Refer to MinGW-w64 instead of MinGW in the API headers. + + MinGW (formely a MinGW.org Project, later the MinGW.OSDN Project + at ) has GCC 9.2.0 as the + most recent GCC package (released 2021-02-02). The project might + still be alive but majority of people have switched to MinGW-w64. + Thus it seems clearer to refer to MinGW-w64 in our API headers too. + Building with MinGW is likely to still work but I haven't tested it + in the recent years. + + src/liblzma/api/lzma.h | 4 ++-- + src/liblzma/api/lzma/version.h | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +commit 36fabdbe67c8a8fbdc3ac695a91fc443a1328cc4 +Author: Lasse Collin +Date: 2023-09-27 00:58:17 +0300 + + CMake: Use -D_FILE_OFFSET_BITS=64 if (and only if) needed. + + A CMake option LARGE_FILE_SUPPORT is created if and only if + -D_FILE_OFFSET_BITS=64 affects sizeof(off_t). + + This is needed on many 32-bit platforms and even with 64-bit builds + with MinGW-w64 to get support for files larger than 2 GiB. + + CMakeLists.txt | 7 ++++- + cmake/tuklib_large_file_support.cmake | 52 +++++++++++++++++++++++++++++++++++ + 2 files changed, 58 insertions(+), 1 deletion(-) + +commit 989c8c354cbd2d20fbae4a432a3e31f5bc1cb9bf +Author: Lasse Collin +Date: 2023-09-30 02:14:25 +0300 + + CMake: Generate and install liblzma.pc if not using MSVC. + + Autotools based build uses -pthread and thus adds it to Libs.private + in liblzma.pc. CMake doesn't use -pthread at all if pthread functions + are available in libc so Libs.private doesn't get -pthread either. + + CMakeLists.txt | 21 +++++++++++++++++++++ + 1 file changed, 21 insertions(+) + +commit 983f3b458dc79c5976a4237fdfe4f8079f8d8830 +Author: Lasse Collin +Date: 2023-09-30 01:13:13 +0300 + + CMake: Rearrange the PACKAGE_ variables. + + The windres workaround now replaces spaces with \x20 so + the package name isn't repeated. + + These changes will help with creation of liblzma.pc. + + CMakeLists.txt | 26 +++++++++++++++----------- + 1 file changed, 15 insertions(+), 11 deletions(-) + +commit 4083c8e9501a48934a5fb563d2c3ce2ae143cd27 +Author: Lasse Collin +Date: 2023-09-29 20:46:11 +0300 + + liblzma: Add Cflags.private to liblzma.pc.in for MSYS2. + + It properly adds -DLZMA_API_STATIC when compiling code that + will be linked against static liblzma. Having it there on + systems other than Windows does no harm. + + See: https://www.msys2.org/docs/pkgconfig/ + + src/liblzma/liblzma.pc.in | 1 + + 1 file changed, 1 insertion(+) + +commit 661549ecb7a9b136d72a01c137d9776c75d52d51 +Author: Lasse Collin +Date: 2023-09-27 22:46:20 +0300 + + CMake: Create liblzma.def when building liblzma.dll with MinGW-w64. + + CMakeLists.txt | 20 ++++++++++++++++++++ + cmake/remove-ordinals.cmake | 26 ++++++++++++++++++++++++++ + 2 files changed, 46 insertions(+) + +commit 0e546eb4da05c52b7d257e5bd85e15c51c4d86a3 +Author: Lasse Collin +Date: 2023-10-26 21:44:42 +0300 + + CMake: Change one CMAKE_CURRENT_SOURCE_DIR to CMAKE_CURRENT_LIST_DIR. + + In this case they have identical values. + + CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit da4d04e4d6e199d28b58bd2e0df4e120c52dd5d7 +Author: Lasse Collin +Date: 2023-10-01 19:10:57 +0300 + + CMake/Windows: Fix the import library filename. + + Both PREFIX and IMPORT_PERFIX have to be set to "" to get + liblzma.dll and liblzma.dll.a. + + CMakeLists.txt | 1 + + 1 file changed, 1 insertion(+) + +commit 007558a358c48a0175cc8d47d11798d7967282ab +Author: Lasse Collin +Date: 2023-10-11 19:47:44 +0300 + + CMake: Don't shadow the cache entry ENABLE_THREADS with a normal variable. + + Using set(ENABLE_THREADS "posix") is confusing because it sets + a new normal variable and leaves the cache entry with the same + name unchanged. The intent wasn't to change the cache entry so + this switches to a different variable name. + + CMakeLists.txt | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +commit 7d01de67ee3dd76cfc12c23220e2e4cdc59708f1 +Author: Lasse Collin +Date: 2023-10-09 21:12:31 +0300 + + CMake: Edit threading related messages. + + It's mostly to change from "thread method" to "threading method". + + CMakeLists.txt | 19 ++++++++++--------- + 1 file changed, 10 insertions(+), 9 deletions(-) + +commit f8edcf3da689aad4b21e139197725450f2c456a0 +Author: Lasse Collin +Date: 2023-10-09 20:59:24 +0300 + + CMake: Use FATAL_ERROR if user-supplied options aren't understood. + + This way typos are caught quickly and compounding error messages + are avoided (a single typo could cause more than one error). + + This keeps using SEND_ERROR when the system is lacking a feature + (like threading library or sandboxing method). This way the whole + configuration log will be generated in case someone wishes to + report a problem upstream. + + CMakeLists.txt | 28 ++++++++++++++-------------- + 1 file changed, 14 insertions(+), 14 deletions(-) + +commit 1695021e4a233a9388ddd428654c1447f0ea3bfb +Author: Jia Tan +Date: 2023-10-19 16:09:01 +0800 + + CMake: Add ALLOW_CLMUL_CRC option to enable/disable CLMUL. + + The option is enabled by default, but will only be visible to a user + listing cache variables or using a CMake GUI application if the + immintrin.h header file is found. + + This mirrors our Autotools build --disable-clmul-crc functionality. + + CMakeLists.txt | 40 +++++++++++++++++++++++----------------- + 1 file changed, 23 insertions(+), 17 deletions(-) + +commit 5056bc51071d1a07097c5667a0d5bd85242e31b9 +Author: Lasse Collin +Date: 2023-10-14 17:56:59 +0300 + + tuklib_integer: Revise unaligned reads and writes on strict-align archs. + + In XZ Utils context this doesn't matter much because + unaligned reads and writes aren't used in hot code + when TUKLIB_FAST_UNALIGNED_ACCESS isn't #defined. + + src/common/tuklib_integer.h | 256 ++++++++++++++++++++++++++++++++------------ + 1 file changed, 189 insertions(+), 67 deletions(-) + +commit 9e14743ee5ba79181076bc33952245d5b18fbc58 +Author: Lasse Collin +Date: 2023-09-23 02:21:49 +0300 + + tuklib_integer: Add missing write64be and write64le fallback functions. + + src/common/tuklib_integer.h | 34 ++++++++++++++++++++++++++++++++++ + 1 file changed, 34 insertions(+) + +commit 4cc91ceb3992ef4f51302b56178c3b2c2aeaaaad +Author: Jia Tan +Date: 2023-10-12 20:12:18 +0800 + + Build: Update visibility.m4 from Gnulib. + + Updating from version 6 -> 8 from upstream. Declarations for variables + and function bodies were added to avoid unnecessary failures with + -Werror. + + m4/visibility.m4 | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +commit 1824a6007cb1c8d5d7abcc7bf649148bc06fa72c +Author: Lasse Collin +Date: 2023-10-06 19:36:35 +0300 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 8fdc71a27d07b10a3da52432432e080b6d577642 +Author: Jia Tan +Date: 2023-09-29 20:14:39 +0800 + + CMake: Rename xz and man page symlink custom targets. + + The Ninja Generator for CMake cannot have a custom target and its + BYPRODUCTS have the same name. This has prevented Ninja builds on + Unix-like systems since the xz symlinks were introduced in + 80a1a8bb838842a2be343bd88ad1462c21c5e2c9. + + CMakeLists.txt | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 38171492ded6426ddf53d0c200fa8c93fcd02a60 +Author: Lasse Collin +Date: 2023-09-27 19:54:35 +0300 + + CMake: Fix Windows build with Clang/LLVM 17. + + llvm-windres 17.0.0 has more accurate emulation of GNU windres, so + the hack for GNU windres must now be used with llvm-windres too. + + LLVM 16.0.6 has the old behavior and there likely won't be more + 16.x releases. So we can simply check for >= 17.0.0. + + The workaround must not be used with Clang that is acting in + MSVC mode. This checks for the known environments that need + the workaround instead of using "NOT MSVC". + + See also: + https://github.com/llvm/llvm-project/commit/2bcc0fdc58a220cb9921b47ec8a32c85f2511a47 + + CMakeLists.txt | 26 ++++++++++++++------------ + 1 file changed, 14 insertions(+), 12 deletions(-) + +commit 1bce6fe48334b5df33d0487a9cbe41950122230e +Author: Jia Tan +Date: 2023-09-27 00:02:11 +0800 + + liblzma: Avoid compiler warning without creating extra symbol. + + When the generic fast crc64 method is used, then we omit + lzma_crc64_table[][]. + + The C standards don't allow an empty translation unit which can be + avoided by declaring something, without exporting any symbols. + + src/liblzma/check/crc64_table.c | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +commit dce95a593e6cd9779110aa1e314abd8b35c75f6b +Author: Lasse Collin +Date: 2023-09-26 17:24:15 +0300 + + Build: Update the comment about -Werror usage in checks. + + configure.ac | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +commit f3c32762ae309afa2fe330e7fb397acfdedc4d37 +Author: Lasse Collin +Date: 2023-09-26 13:51:31 +0300 + + Build: Fix underquoted AC_LANG_SOURCE. + + It made no practical difference in this case. + + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 7dd57f2f2c8fde93fa42b4dbf6d9860717723b41 +Author: Lasse Collin +Date: 2023-09-26 13:14:37 +0300 + + Build: Silence Autoconf warning. + + There was a use of AC_COMPILE_IFELSE that didn't use + AC_LANG_SOURCE and Autoconf warned about this. The omission + had been intentional but it turned out that this didn't do + what I thought it would. + + Autoconf 2.71 manual gives an impression that AC_LANG_SOURCE + inserts all #defines that have been made with AC_DEFINE so + far (confdefs.h). The idea was that omitting AC_LANG_SOURCE + would mean that only the exact code included in the + AC_COMPILE_IFELSE call would be compiled. + + With C programs this is not true: the #defines get added without + AC_LANG_SOURCE too. There seems to be no neat way to avoid this. + Thus, with the C language at least, adding AC_LANG_SOURCE makes + no other difference than silencing a warning from Autoconf. The + generated "configure" remains identical. (Docs of AC_LANG_CONFTEST + say that the #defines have been inserted since Autoconf 2.63b and + that AC_COMPILE_IFELSE uses AC_LANG_CONFTEST. So the behavior is + documented if one also reads the docs of macros that one isn't + calling directly.) + + Any extra code, including #defines, can cause problems for + these two tests because these tests must use -Werror. + CC=clang CFLAGS=-Weverything is the most extreme example. + It enables -Wreserved-macro-identifier which warns about + It's possible to write a test file that passes -Weverything but + it becomes impossible when Autoconf inserts confdefs.h. + + So this commit adds AC_LANG_SOURCE to silence Autoconf warnings. + A different solution is needed for -Werror tests. + + configure.ac | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +commit edec253e418562f3164a01ecc8805295fa022efa +Author: Jia Tan +Date: 2023-09-26 00:47:26 +0800 + + Build: Remove Gnulib dependency from tests. + + The tests do not use any Gnulib replacements so they do not need to link + libgnu.a or have /lib in the include path. + + tests/Makefile.am | 7 +------ + 1 file changed, 1 insertion(+), 6 deletions(-) + +commit 46cb133ce7360496eecca1255b364c05f0205855 +Author: Jia Tan +Date: 2023-09-26 00:43:43 +0800 + + CMake: Remove /lib from tests include path. + + The tests never included anything from /lib, so this was not needed. + + CMakeLists.txt | 1 - + 1 file changed, 1 deletion(-) + +commit 4ae13cfe0dedb8ddc3cf9ded8cd1ac09361b3bd1 +Author: Lasse Collin +Date: 2023-09-24 16:32:32 +0300 + + sysdefs.h: Update the comment about __USE_MINGW_ANSI_STDIO. + + src/common/sysdefs.h | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +commit 660c8c29e57d30dbd5009ef1f0ec1bbe195ccef6 +Author: Lasse Collin +Date: 2023-09-22 02:33:29 +0300 + + xz: Windows: Don't (de)compress to special files like "con" or "nul". + + Before this commit, the following writes "foo" to the + console and deletes the input file: + + echo foo | xz > con_xz + xz --suffix=_xz --decompress con_xz + + It cannot happen without --suffix because names like con.xz + are also special and so attempting to decompress con.xz + (or compress con to con.xz) will already fail when opening + the input file. + + Similar thing is possible when compressing. The following + writes to "nul" and the input file "n" is deleted. + + echo foo | xz > n + xz --suffix=ul n + + Now xz checks if the destination is a special file before + continuing. DOS/DJGPP version had a check for this but + Windows (and OS/2) didn't. + + src/xz/file_io.c | 35 ++++++++++++++++++++++++++++------- + 1 file changed, 28 insertions(+), 7 deletions(-) + +commit b7ce6e80786fc0c08ed129e8ee262ea96a5473a1 +Author: Lasse Collin +Date: 2023-09-21 20:42:52 +0300 + + CMake: Wrap two overlong lines that are possible to wrap. + + CMakeLists.txt | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +commit 1595f454d5c8257c668cccd6a86dd68175d5c430 +Author: Lasse Collin +Date: 2023-09-21 20:36:31 +0300 + + CMake: Add a comment about threads on Cygwin. + + CMakeLists.txt | 1 + + 1 file changed, 1 insertion(+) + +commit 5be6275f19784cdd5a954f0188045c8ff4934d54 +Author: Lasse Collin +Date: 2023-09-12 21:12:34 +0300 + + CMake: Bump maximum policy version to 3.27. + + There are several new policies. CMP0149 may affect the Windows SDK + version that CMake will choose by default. The new behavior is more + predictable, always choosing the latest SDK version by default. + + The other new policies shouldn't affect this package. + + CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit e515643d7524851d1eb7dab73453e26d8521324c +Author: Lasse Collin +Date: 2023-09-08 19:08:57 +0300 + + Doxygen: Add more C macro names to PREDEFINED. + + doxygen/Doxyfile | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +commit e3478ae4f36cd06522a2fef023860893f068434d +Author: Lasse Collin +Date: 2023-09-11 18:47:26 +0300 + + liblzma: Move a few __attribute__ uses in function declarations. + + The API headers have many attributes but these were left + as is for now. + + src/liblzma/common/common.c | 6 ++++-- + src/liblzma/common/common.h | 8 ++++---- + src/liblzma/common/memcmplen.h | 3 ++- + 3 files changed, 10 insertions(+), 7 deletions(-) + +commit b71b8922ef3971e5ccffd1e213888d44abe21d11 +Author: Lasse Collin +Date: 2023-09-11 19:03:35 +0300 + + xz, xzdec, lzmainfo: Use tuklib_attr_noreturn. + + For compatibility with C23's [[noreturn]], tuklib_attr_noreturn + must be at the beginning of declaration (before "extern" or + "static", and even before any GNU C's __attribute__). + + This commit also moves all other function attributes to + the beginning of function declarations. "extern" is kept + at the beginning of a line so the attributes are listed on + separate lines before "extern" or "static". + + src/lzmainfo/lzmainfo.c | 6 ++++-- + src/xz/coder.c | 3 ++- + src/xz/hardware.h | 3 ++- + src/xz/message.h | 30 +++++++++++++++++------------- + src/xz/options.c | 3 ++- + src/xz/util.h | 8 ++++---- + src/xzdec/xzdec.c | 9 ++++++--- + 7 files changed, 37 insertions(+), 25 deletions(-) + +commit 359e5c6cb128dab64ea6070d21d1c240f96cea6b +Author: Lasse Collin +Date: 2023-09-11 18:53:31 +0300 + + Remove incorrect uses of __attribute__((__malloc__)). + + xrealloc() is obviously incorrect, modern GCC docs even + mention realloc() as an example where this attribute + cannot be used. + + liblzma's lzma_alloc() and lzma_alloc_zero() would be + correct uses most of the time but custom allocators + may use a memory pool or otherwise hold the pointer + so aliasing issues could happen in theory. + + The xstrdup() case likely was correct but I removed it anyway. + Now there are no __malloc__ attributes left in the code. + The allocations aren't in hot paths so this should make + no practical difference. + + src/liblzma/common/common.c | 4 ++-- + src/liblzma/common/common.h | 4 ++-- + src/xz/util.h | 4 ++-- + 3 files changed, 6 insertions(+), 6 deletions(-) + +commit 589b4cba22fccb1dbc919df5d134aefb2b5a6b01 +Author: Lasse Collin +Date: 2023-09-19 14:03:45 +0300 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 43728ed2267e921fbdfa699ee1e91b105ab0e98b +Author: Lasse Collin +Date: 2023-09-14 16:35:46 +0300 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit caf00e0988ba47842cfd93dfbb17f7d30120d6e7 +Author: Lasse Collin +Date: 2023-09-14 16:34:07 +0300 + + liblzma: Mark crc64_clmul() with __attribute__((__no_sanitize_address__)). + + Thanks to Agostino Sarubbo. + Fixes: https://github.com/tukaani-project/xz/issues/62 + + src/liblzma/check/crc64_fast.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +commit a70e96d2da761b8b3a77bf14e08002d871e5950b +Author: Jia Tan +Date: 2023-09-12 22:36:12 +0800 + + CMake: Fix time.h checks not running on second CMake run. + + If CMake was configured more than once, HAVE_CLOCK_GETTIME and + HAVE_CLOCK_MONOTONIC would not be set as compile definitions. The check + for librt being needed to provide HAVE_CLOCK_GETTIME was also + simplified. + + CMakeLists.txt | 18 ++++++++++-------- + 1 file changed, 10 insertions(+), 8 deletions(-) + +commit d5275d83bd2a9701c5feb8666785007c074b1359 +Author: Jia Tan +Date: 2023-09-12 22:34:06 +0800 + + CMake: Fix unconditionally defining HAVE_CLOCK_MONOTONIC. + + If HAVE_CLOCK_GETTIME was defined, then HAVE_CLOCK_MONOTONIC was always + added as a compile definition even if the check for it failed. + + CMakeLists.txt | 8 +++----- + 1 file changed, 3 insertions(+), 5 deletions(-) + +commit 1f6e7c68fbdeeaa9482fc77de090be63d90912fd +Author: Lasse Collin +Date: 2023-08-31 19:50:05 +0300 + + xz: Refactor thousand separator detection and disable it on MSVC. + + Now the two variations of the format strings are created with + a macro, and the whole detection code can be easily disabled + on platforms where thousand separator formatting is known to + not work (MSVC has no support, and on DJGPP 2.05 it can have + problems in some cases). + + src/xz/util.c | 89 ++++++++++++++++++++++++++++++----------------------------- + 1 file changed, 45 insertions(+), 44 deletions(-) + +commit ef71f83973a20cc28a3221f85681922026ea33f5 +Author: Lasse Collin +Date: 2023-08-31 18:14:43 +0300 + + xz: Fix a too relaxed assertion and remove uses of SSIZE_MAX. + + SSIZE_MAX isn't readily available on MSVC. Removing it means + that there is one thing less to worry when porting to MSVC. + + src/xz/file_io.c | 5 ++--- + src/xz/file_io.h | 4 ++-- + 2 files changed, 4 insertions(+), 5 deletions(-) + +commit cf8ba7c3a89e37736b926dfbe85dffeff725db47 +Author: Jia Tan +Date: 2023-08-28 23:14:45 +0800 + + Tests: Improve invalid unpadded size check in test_lzma_index_append(). + + This check was extended to test the code added to fix a failing assert + in 68bda971bb8b666a009331455fcedb4e18d837a4. + + tests/test_index.c | 26 +++++++++++++++++++++++--- + 1 file changed, 23 insertions(+), 3 deletions(-) + +commit 4a4180ce74788e97e90b9aab579bfd7c6dce3f59 +Author: Jia Tan +Date: 2023-08-28 21:54:41 +0800 + + Tests: Improve comments in test_index.c. + + tests/test_index.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 4b23b84b89e39a5117e16f66c3b01db4f08ed3e7 +Author: Jia Tan +Date: 2023-08-28 21:52:54 +0800 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 773f1e8622cb1465df528cb16a749517650acd93 +Author: Jia Tan +Date: 2023-08-28 21:50:16 +0800 + + liblzma: Update assert in vli_ceil4(). + + The argument to vli_ceil4() should always guarantee the return value + is also a valid lzma_vli. Thus the highest three valid lzma_vli values + are invalid arguments. All uses of the function ensure this so the + assert is updated to match this. + + src/liblzma/common/index.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 68bda971bb8b666a009331455fcedb4e18d837a4 +Author: Jia Tan +Date: 2023-08-28 21:31:25 +0800 + + liblzma: Add overflow check for Unpadded size in lzma_index_append(). + + This was not a security bug since there was no path to overflow + UINT64_MAX in lzma_index_append() or when it calls index_file_size(). + The bug was discovered by a failing assert() in vli_ceil4() when called + from index_file_size() when unpadded_sum (the sum of the compressed size + of current Stream and the unpadded_size parameter) exceeds LZMA_VLI_MAX. + + Previously, the unpadded_size parameter was checked to be not greater + than UNPADDED_SIZE_MAX, but no check was done once compressed_base was + added. + + This could not have caused an integer overflow in index_file_size() when + called by lzma_index_append(). The calculation for file_size breaks down + into the sum of: + + - Compressed base from all previous Streams + - 2 * LZMA_STREAM_HEADER_SIZE (size of the current Streams header and + footer) + - stream_padding (can be set by lzma_index_stream_padding()) + - Compressed base from the current Stream + - Unpadded size (parameter to lzma_index_append()) + + The sum of everything except for Unpadded size must be less than + LZMA_VLI_MAX. This is guarenteed by overflow checks in the functions + that can set these values including lzma_index_stream_padding(), + lzma_index_append(), and lzma_index_cat(). The maximum value for + Unpadded size is enforced by lzma_index_append() to be less than or + equal UNPADDED_SIZE_MAX. Thus, the sum cannot exceed UINT64_MAX since + LZMA_VLI_MAX is half of UINT64_MAX. + + Thanks to Joona Kannisto for reporting this. + + src/liblzma/common/index.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +commit b41bb79c602481d7ea93d65f5b3e3f08dc54233b +Author: Jia Tan +Date: 2023-08-28 22:18:29 +0800 + + Translations: Update the Esperanto translation. + + po/eo.po | 47 +++++++++++++++++++++++++++++------------------ + 1 file changed, 29 insertions(+), 18 deletions(-) + +commit 6614e6d4bf8e2b5af6eb73930148e0ffc8d2265a +Author: Jia Tan +Date: 2023-08-09 20:55:36 +0800 + + Docs: Update INSTALL for --enable-threads method win95. + + The Autotools build allows win95 threads and --enable-small together now + if the compiler supports __attribute__((__constructor__)). + + INSTALL | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +commit bfb623ad96fa6f1dbc0c560403c4296e3c8e26c9 +Author: Jia Tan +Date: 2023-08-09 20:54:15 +0800 + + CMake: Conditionally allow win95 threads and --enable-small. + + CMakeLists.txt | 27 +++++++++++++++++++-------- + 1 file changed, 19 insertions(+), 8 deletions(-) + +commit e919ebb29ac9f5270cd7176a39d0d3b4cea875a9 +Author: Jia Tan +Date: 2023-08-09 20:35:16 +0800 + + Build: Conditionally allow win95 threads and --enable-small. + + When the compiler supports __attribute__((__constructor__)) + mythread_once() is never used, even with --enable-small. A configuration + with win95 threads and --enable-small will compile and be thread safe so + it can be allowed. + + This isn't a very common configuration since MSVC does not support + __attribute__((__constructor__)), but MINGW32 and CLANG32 environments + for MSYS2 can use win95 threads and have + __attribute__((__constructor__)) support. + + configure.ac | 21 +++++++++++++-------- + 1 file changed, 13 insertions(+), 8 deletions(-) + +commit c0c0cd4a483a672b66a13761583bc4f84d86d501 +Author: Jamaika1 +Date: 2023-08-08 14:07:59 +0200 + + mythread.h: Fix typo error in Vista threads mythread_once(). + + The "once_" variable was accidentally referred to as just "once". This + prevented building with Vista threads when + HAVE_FUNC_ATTRIBUTE_CONSTRUCTOR was not defined. + + src/common/mythread.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit d93fbefcc48a8737fdf5678ce66d1c1d605752a0 +Author: Jia Tan +Date: 2023-08-03 20:10:21 +0800 + + Tests: Style fixes to test_lzip_decoder.c. + + tests/test_lzip_decoder.c | 36 ++++++++++++++++++++++++------------ + 1 file changed, 24 insertions(+), 12 deletions(-) + +commit 65981d8e45741fd1502e007609469e1d60312e69 +Author: Jia Tan +Date: 2023-08-03 15:56:20 +0800 + + Translations: Update the Chinese (simplified) translation. + + po/zh_CN.po | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit a108ed589171d683c34238a87e358b87f69e39a0 +Author: Lasse Collin +Date: 2023-08-02 17:15:12 +0300 + + xz: Omit an empty paragraph on the man page. + + src/xz/xz.1 | 1 - + 1 file changed, 1 deletion(-) + +commit 03c51c5c08fe3579d8bbc8eea8251a1128001330 +Author: Jia Tan +Date: 2023-08-02 20:32:20 +0800 + + Bump version and soname for 5.4.4. + + src/liblzma/Makefile.am | 2 +- + src/liblzma/api/lzma/version.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit d7fa3f1b58a77f79b1a4e12452418b5555632e18 +Author: Jia Tan +Date: 2023-08-02 20:30:07 +0800 + + Add NEWS for 5.4.4. + + NEWS | 43 +++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 43 insertions(+) + +commit 6a1093c0004c42eeaef312456c295671496dd67a +Author: Lasse Collin +Date: 2023-08-02 15:19:43 +0300 + + build-aux/manconv.sh: Fix US-ASCII and UTF-8 output. + + groff defaults to SGR escapes. Using -P-c passes -c to grotty + which restores the old behavior. Perhaps there is a better way to + get pure plain text output but this works for now. + + build-aux/manconv.sh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit f6f9f5651a7e2d89f588981533155ab850e063f7 +Author: Lasse Collin +Date: 2023-08-01 19:10:43 +0300 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 0dd83ba8767dad722e0f0f94e0e4146e290a28cb +Author: Lasse Collin +Date: 2023-08-01 18:22:24 +0300 + *** 2905 LINES SKIPPED *** From nobody Sun Dec 10 17:47:19 2023 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 4SpC4l6x7Pz549Bh; Sun, 10 Dec 2023 17:47:19 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SpC4l6QhBz3Wy3; Sun, 10 Dec 2023 17:47:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702230439; 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=GxPkIvEMArKm0bZgQqHgEnXro1U+GuLhWQ+cK+bi3xY=; b=vilhKEOqwEqxBfPM4BbPgInJOdZrxqvOKt7WYpuwMf/NMFuJKmnAT5IAxBxFcwKJeeCrxW VslH6HV/IHfDf1QrmTuzv61EnHdEAm0FUjM+2Yu2uw887feGzD7qNprI912QSyBn2JEKPI 1SebotkKFDBwMXvL5ayVHdQAKfA0lSpp6I+9EIc8AH4oo+kO20Ec5lq6bGpbc0zBgX/cJk Ieu4zIAvCowddtecosAgg/HjJ0VqRHq2GPDtEq4tyaCKisj8T4StyhWyXAAlWV02wMAvFR aWSC+ScKJahK3N17rF3B5XBNwFRG+LuHlHeQR/+vDYsiMoS7BeOa9ChiL1ZEgg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702230439; a=rsa-sha256; cv=none; b=V7upSSaXu254MvR/G47T8/zceHTxYmeuilGPyfURtN3kdBMX+UlVImGUxhNqtkYLC8nb5M 5z0pcZ/P9v5YfXYmvInZMvb1iYjG1T0ECs587yV10bzTxmhrLxgEJu9yXtfEgP35Y8o06B ePre/EJFEppN0kcK/vPd91BTP7GU9oIyhzgTVDWY/rmpVmw5U3zf3W7UAoHmOtNkE5ktOA cKv/93269Vf2k8fRy2tbhae17A8rkIRY3jx1mwqx6X0ts6n0iNd57K4hhkx63jMQHyG2yw 3+RahE257AczHUzSnE/vd8etyO64KiBI/O2rzml4TeQ6CAqspBw6d72Noa7t5Q== 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=1702230439; 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=GxPkIvEMArKm0bZgQqHgEnXro1U+GuLhWQ+cK+bi3xY=; b=Q3cpDRraYqtm4pHdX9Q9tNkRbA5pOcn7K8eegCL9QFeze51Sm1x4cDCDlME6HuF4fbhVjl G40cy7zTjVgXJxPAq2jrjtoSViqXuxwtv0FPh7Voc8EM9KSplKHGasHCjdEuAB4AgKSbJP g05pJNNHYFqLSwK+ziDoy1VYbaA+xcQ19RRACgxX39jv0kdyn3Jo4/p6AbKjumGf2triyN nlaLvGeguBFNLqRCeaCibvp7bH2jQz8ip4py1lP5KbjbMMfiinhvpyQVefTG1aQxE1Cr3O ObN5XtjvQF2aJUvLoKyUYJ3NEpyn5llzS8tV8mlakZQocZxKkmCWvA5Y+9sKCw== 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 4SpC4l5T3HzxS7; Sun, 10 Dec 2023 17:47:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BAHlJPZ008872; Sun, 10 Dec 2023 17:47:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BAHlJ1R008869; Sun, 10 Dec 2023 17:47:19 GMT (envelope-from git) Date: Sun, 10 Dec 2023 17:47:19 GMT Message-Id: <202312101747.3BAHlJ1R008869@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: c2b39a756fe7 - stable/14 - OpenZFS: Ensure that zfs_getattr() initializes the va_rdev field 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c2b39a756fe7463cff5c715c2375700efef1e799 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=c2b39a756fe7463cff5c715c2375700efef1e799 commit c2b39a756fe7463cff5c715c2375700efef1e799 Author: Mark Johnston AuthorDate: 2023-12-07 16:20:11 +0000 Commit: Ed Maste CommitDate: 2023-12-10 17:46:57 +0000 OpenZFS: Ensure that zfs_getattr() initializes the va_rdev field Otherwise the field is left uninitialized, leading to a possible kernel memory disclosure to userspace or to the network. Use the same initialization value we use in zfsctl_common_getattr(). Reported-by: KMSAN Sponsored-by: The FreeBSD Foundation Reviewed-by: Brian Behlendorf Reviewed-by: Ed Maste Signed-off-by: Mark Johnston (cherry picked from commit 11656234b560c401dec6a16e1bf048b20fd31aac) --- sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c index 3302f043620a..93bbfa8e3ef2 100644 --- a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c +++ b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c @@ -2007,6 +2007,8 @@ zfs_getattr(vnode_t *vp, vattr_t *vap, int flags, cred_t *cr) vap->va_size = zp->z_size; if (vp->v_type == VBLK || vp->v_type == VCHR) vap->va_rdev = zfs_cmpldev(rdev); + else + vap->va_rdev = 0; vap->va_gen = zp->z_gen; vap->va_flags = 0; /* FreeBSD: Reset chflags(2) flags. */ vap->va_filerev = zp->z_seq; From nobody Sun Dec 10 17:48:03 2023 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 4SpC5c0bXxz549Cy; Sun, 10 Dec 2023 17:48:04 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SpC5c05vkz3XRw; Sun, 10 Dec 2023 17:48:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702230484; 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=1poISVvrd3U4btueTtSVTTuv1sO26vbsQ9w/b0d8V2g=; b=I9UUC/1a4an8B4A9oHvThAhMnrecKZmbRxQ1vL6b8HK83b1FCXldqopEUbpF96r4OvgJbv X8bpCywR//6mmc8AyvltHVRlTVJvqVKbfY8lLQ1JNk0Jf9Rn1oJ7q9R7NITEAekKXqcHCg tc4Z6RxoUCs2b25ot7oV5os4MYNa2AAS9LVQH5UAOnVY8iUIPldFajOUtEey41/6N1iKoH TD1/DTnnkuqb56yyJdnL4lsqsiiIH09LFbbCf0wIK99HcfpfcvQGizAfVgO4wzfeM64ekE XamWyeTFr9XVQ9Arg506yQ9NucioooZskRyyGz2Xd9eCt0ogPiOb/BCJYQIPSQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702230484; a=rsa-sha256; cv=none; b=QqeyP1XjRKgP/m+JZO1CNm/6AJOUT8VTSWOoDC93sMV64V3vcPPVfZHeMX2dGHM7bSteiK FduuJ6LRKl/za9a0QCXegLyZoVq8udf8naJeRt+JaY0MyvDABK3zDbMhsQGa+ik7exPyng GsX2oz/LinnUtis28e/25lzmLHm2QlzjST5HmiVr8SsbnJL7KlKiJ5LAw+sNpwR438q8fF 8PT+RcD7VOx4I64hkJhvSJEigUZ+D7fekKKCOwTxQOg+2Yh1SwmswS8Xn4ZRN9Se7hCjzp 8mZ/ivMBUCYytAxuZt7rKylLsqRA7TQH7WI6tY5gBS95M903XXOPzfC5o3c5zg== 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=1702230484; 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=1poISVvrd3U4btueTtSVTTuv1sO26vbsQ9w/b0d8V2g=; b=Bsw93khoWUocOTohVVBvEPFA8924f/FJ4Ya8+gvNlYYDsw5mCX4GQ8ZEKWQjmjdjITTb1O WkIFoQPH7B1+rCnXJC4rCu/nMocifFn/eUM8qKqVti09/G8hbT4vqbZnNF7vwPQ+ySPX3n i32ZG2fnHzCV4ToIYGc3pQyC/qXNYae7e90n4rxtdAPXE7uxgeUG9hZXmSwQA/HAC2CdTc tEtpkkM/cZ0sf6F6ITFqrg4LUWyqxDnQYBM8QNd9ZDb8E/tAWrIyBlVYDC2hLggHxOHCgv 4p1UiNJKbAqJzin4JuJO//7fQMwwghOF/nt9DPqcYuOySodVX+ytKriQXUxeoA== 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 4SpC5b6Hq4zxkg; Sun, 10 Dec 2023 17:48:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BAHm3IO009151; Sun, 10 Dec 2023 17:48:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BAHm3SZ009148; Sun, 10 Dec 2023 17:48:03 GMT (envelope-from git) Date: Sun, 10 Dec 2023 17:48:03 GMT Message-Id: <202312101748.3BAHm3SZ009148@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 5a23e4aa88e4 - stable/13 - OpenZFS: Ensure that zfs_getattr() initializes the va_rdev field 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5a23e4aa88e4bf412bf3650b8536140a34e754d5 Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=5a23e4aa88e4bf412bf3650b8536140a34e754d5 commit 5a23e4aa88e4bf412bf3650b8536140a34e754d5 Author: Mark Johnston AuthorDate: 2023-12-07 16:20:11 +0000 Commit: Ed Maste CommitDate: 2023-12-10 17:47:28 +0000 OpenZFS: Ensure that zfs_getattr() initializes the va_rdev field Otherwise the field is left uninitialized, leading to a possible kernel memory disclosure to userspace or to the network. Use the same initialization value we use in zfsctl_common_getattr(). Reported-by: KMSAN Sponsored-by: The FreeBSD Foundation Reviewed-by: Brian Behlendorf Reviewed-by: Ed Maste Signed-off-by: Mark Johnston (cherry picked from commit 11656234b560c401dec6a16e1bf048b20fd31aac) --- sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c index ea6388dd515e..53126fdd6ec9 100644 --- a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c +++ b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c @@ -2067,6 +2067,8 @@ zfs_getattr(vnode_t *vp, vattr_t *vap, int flags, cred_t *cr) vap->va_size = zp->z_size; if (vp->v_type == VBLK || vp->v_type == VCHR) vap->va_rdev = zfs_cmpldev(rdev); + else + vap->va_rdev = 0; vap->va_gen = zp->z_gen; vap->va_flags = 0; /* FreeBSD: Reset chflags(2) flags. */ vap->va_filerev = zp->z_seq; From nobody Sun Dec 10 17:49:43 2023 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 4SpC7W6j3fz549D4; Sun, 10 Dec 2023 17:49:43 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SpC7W68FPz3XZ8; Sun, 10 Dec 2023 17:49:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702230583; 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=wsG/+Ir8TWnABo5uEXUU0s+3OD+DXp3AjKvjfsYroOc=; b=wesp34jQRhO+bIr82opG7k5GoFjJe+66cB5Q/3Ds7A6WYKq5InWbh3sC4X7kFXT2JQ82xV G90lhPWTPXC4YWm4Fn1wJmFbDNcoOzZtb6z508XCa624YSzxAVAnUT4UbPMa2Yl1juYmcY OR4zff5Nf+wP5dvNGb2kBzUUj2Ihv0J7nFJxjp8Y8MUInyAtKMB09+bFtOu/i0QbUY+/OZ q+7t5v0GlqrGYcF+wPrH+M0V/sEJwHZMzeSGJHhzTjE/qA1LlxmrNH6rdZaoi4jLyfyoJq X+USxHffD8H2xq56kTjsZ+khiW/hvCgpKyA4vO9H2hs6S08syrh2x0i2oLwu3g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702230583; a=rsa-sha256; cv=none; b=qYJSlhjLZj9POvX+57MiUn1oos/uCqykpnf8ra88Fgf7IQhvGknChKGQTfPPfMlVgRqM8O PkUk3X99lS/NDQlMCX+jTRQPSaXhvKiLjT8c3P8GiSkEfvJS0VIikRVwkepL1d2CPah47C OKAW+0zyaebrsvT+0W06nPKZjB6bzfbc5Q9QPvIXyO7G85Ey/c9yejzioeuO9NBQC4EOkA 7mst9RWgFjAAxNHWb1Q7ZAv7LcZNiLmCh2uf0em+AhoUOzTSkfE0a9bCDTfaAMJnRbr9BR HL1Inb/oFTkG42QglQxLXZa1i74ehFjLBkAFPDhXnWjMS99/r00WVHLgd9pOJg== 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=1702230583; 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=wsG/+Ir8TWnABo5uEXUU0s+3OD+DXp3AjKvjfsYroOc=; b=OGWGZFgMOnAoXEa5oT+7NX80Injh+lXvv4egaPMW5qEjSdgCxxAPihI6+PSKpwVF8DNy4Y riL4RifdlhnuBFIoW05OH/HWacp/ilYcPM08P5empKDRtolwPu8vP8pAxzn8iBth2rTl9R opazuxunxAak3EgIJOwrPjAW0RR2jHW/YKI0PZHcEuS141zJlUhhX7fNenrRYg7pE0n0wS FvmeZfzf2hg72xiY2NTs95peOd5tA50TK00N+vM6RTINdTDkdnpyRpP65DGyiPteAxWk9G Vs+mZd4gCZFoL7nj3JCXVguV4xTzzsPgII1CM63q2CyI7HywgP0qqoifkxd0Nw== 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 4SpC7W5D7Szxkj; Sun, 10 Dec 2023 17:49:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BAHnhRD009564; Sun, 10 Dec 2023 17:49:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BAHnh7E009561; Sun, 10 Dec 2023 17:49:43 GMT (envelope-from git) Date: Sun, 10 Dec 2023 17:49:43 GMT Message-Id: <202312101749.3BAHnh7E009561@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: a9dcfac2fd6a - stable/12 - OpenZFS: Ensure that zfs_getattr() initializes the va_rdev field 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: a9dcfac2fd6a26671b707d15727935ed24c681b5 Auto-Submitted: auto-generated The branch stable/12 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=a9dcfac2fd6a26671b707d15727935ed24c681b5 commit a9dcfac2fd6a26671b707d15727935ed24c681b5 Author: Mark Johnston AuthorDate: 2023-12-07 16:20:11 +0000 Commit: Ed Maste CommitDate: 2023-12-10 17:48:51 +0000 OpenZFS: Ensure that zfs_getattr() initializes the va_rdev field Otherwise the field is left uninitialized, leading to a possible kernel memory disclosure to userspace or to the network. Use the same initialization value we use in zfsctl_common_getattr(). Reported-by: KMSAN Sponsored-by: The FreeBSD Foundation Reviewed-by: Brian Behlendorf Reviewed-by: Ed Maste Signed-off-by: Mark Johnston (cherry picked from commit 11656234b560c401dec6a16e1bf048b20fd31aac) (cherry picked from commit af1e8b52d26502bac9a2484b87d1879334debd67) Differential Revision: https://reviews.freebsd.org/D42987 --- sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c index c61714bb358a..34f3476c2064 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c @@ -2735,6 +2735,8 @@ zfs_getattr(vnode_t *vp, vattr_t *vap, int flags, cred_t *cr, #else if (vp->v_type == VBLK || vp->v_type == VCHR) vap->va_rdev = zfs_cmpldev(rdev); + else + vap->va_rdev = 0; #endif vap->va_seq = zp->z_seq; vap->va_flags = 0; /* FreeBSD: Reset chflags(2) flags. */ From nobody Sun Dec 10 19:58:16 2023 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 4SpFzr5nFlz54KkJ; Sun, 10 Dec 2023 19:58: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SpFzr50mkz4D4M; Sun, 10 Dec 2023 19:58:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702238296; 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=a0xnDT/irJIk0jJ/LKq/Yl7NsRlfq85TKpTEEuSuAro=; b=bkmnqDS+CklgN6BLXxA2D6xQzUhfopezpyuTQP3S+BFamGt4QR7IKy4Bf1uboh2tl4B8oP QepBT39RHbed14cdFoHLgX0MTQDSuyufF0xfqgVBYRFWdgzchX+AFW+86G9WIUmTTHsyDL xaIjo4+8kUbWlf/ChLRN2NNPjqWWyZ6n/3FdtH+Rk6vQ050Vq/Ych81YrDMU7SxLEiR/Sv xvAMTs6xo25KOhZ2M6ZzAY19PxF8s7CZo/cd84LY+NMZDuu99VvytABTgsk0xUaEMdNYmF nGDKIpPX/0J+MVS4Io3/Jw+F3DVEH7BlpYuEY2vUKazrKPTl8KQg4AQAo/Kzbg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702238296; a=rsa-sha256; cv=none; b=H6+GCwZPnWab7sHLoRQTOuDOyGFNv2Mbvk7krJdiPso8sLmqWd6b55/beLu7rTZcgEAaLs uhNJKH/iHQUDN04axVT+FSugnwKG7Kntwa8M0UybuA+EMSoaoX5j+r8dqWob4WXvOVtVHG VQKKrFEC83LCLX9Lna6eClV4+pS5RVm1HYnHU3dzl1+lZUvXRRX+WwS9ZeKoPX/3AZyQBH VjRvYkHRJ3H1uwdnYA2099Wz/heP2JRZ5+JdvxHxoqOVMrJm1Ni/swSFZZigucczss38Xb DkXg53UFBYu6riAmQ51QrGt4MFeaK1/r+J94BvKs8raY8/tDAq848IpppkA4og== 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=1702238296; 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=a0xnDT/irJIk0jJ/LKq/Yl7NsRlfq85TKpTEEuSuAro=; b=ux7uDa0KJ4ZLbR3Ivc2Yc7Oo7XbvX5wrlIrP7dRe8GwUnW4QAIWYgvONMT0HlpRF/Ca89H MRPMuu7CMZ+ACEXW3pRr620eXlrQVVznPghUhpq2/7c6pYUnTce/5BTrXbkLsEPIGM2XTG o4q8j8BQIpz5oOXHhN4JBDTiKl4vGiPowc+hNsWd8uGoV3KfdJQN1znGC0o/VM9d6c4o9P srkhF1Q0bejduap/UwNbeHSYkC5S3GfhKn0BI+ZDZcIogJ4JeNNxaJu3Ay6h7w+YGK9IUJ 5FDt0rNfYJ0+vJCr3iyqotcOHZTuGN0MKKo3rzRmDmMwBH2VajAN6PglsC7BzA== 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 4SpFzr3vD0z11bp; Sun, 10 Dec 2023 19:58:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BAJwGjQ026662; Sun, 10 Dec 2023 19:58:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BAJwGHA026659; Sun, 10 Dec 2023 19:58:16 GMT (envelope-from git) Date: Sun, 10 Dec 2023 19:58:16 GMT Message-Id: <202312101958.3BAJwGHA026659@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Sergey A. Osokin" Subject: git: 0e2f61fc03fe - stable/14 - bsd-family-tree: add macOS 14 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: osa X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0e2f61fc03febeab8c4cb3d738948b83d7aed2f1 Auto-Submitted: auto-generated The branch stable/14 has been updated by osa: URL: https://cgit.FreeBSD.org/src/commit/?id=0e2f61fc03febeab8c4cb3d738948b83d7aed2f1 commit 0e2f61fc03febeab8c4cb3d738948b83d7aed2f1 Author: Sergey A. Osokin AuthorDate: 2023-09-28 21:42:08 +0000 Commit: Sergey A. Osokin CommitDate: 2023-12-10 19:56:59 +0000 bsd-family-tree: add macOS 14 (cherry picked from commit 992ec09f37837a3f7d131bc70a66d6e41b814e9b) --- share/misc/bsd-family-tree | 3 +++ 1 file changed, 3 insertions(+) diff --git a/share/misc/bsd-family-tree b/share/misc/bsd-family-tree index 208523bd1fcb..4a9d1466ac9a 100644 --- a/share/misc/bsd-family-tree +++ b/share/misc/bsd-family-tree @@ -446,6 +446,8 @@ FreeBSD 5.2 | | | | | | | | OpenBSD 7.3 | | FreeBSD | | | | | 13.2 | | | | + | macOS | | | + | 14 | | | | | | | | FreeBSD 14 -current | NetBSD -current OpenBSD -current DragonFly -current | | | | | @@ -872,6 +874,7 @@ FreeBSD 12.4 2022-12-05 [FBD] DragonFly 6.4 2022-12-30 [DFB] OpenBSD 7.3 2023-04-10 [OBD] FreeBSD 13.2 2023-04-11 [FBD] +macOS 14 2023-09-26 [APL] Bibliography ------------------------ From nobody Sun Dec 10 19:58:17 2023 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 4SpFzs67FZz54KXN; Sun, 10 Dec 2023 19:58:17 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SpFzs5BWVz4DMm; Sun, 10 Dec 2023 19:58:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702238297; 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=+0QD2h/8k7BBJj5wjeO+Eil2oo5LkDpxboayouzLRGA=; b=LcZbc7Z2VVHq6eycunt2wQDL0O0un7U3+rF1bqoYCioEaZJMY14AOwyYSCiJlNo+6oFPge c8Bz0+wvm147GOImcbyr+f3tBDb8pbMPrQ3SriiY1TOPwdXyhWf2lk3kJNEcZW3E92JJkm IGJEJC/iVSL7LQAphPJGy+cI6BMm81TUg70u16xadz9WjLnhnqFbK+TU9R020jgnvGcb9b maPX63iG7jsKEOntRrx2fgvC19xdO1Cg6ztHXr/B32MBlxWKP3mWgduyuYq34ASeC2YAsO IURM7Y1FtYNEUj78ELTkKcyZ96OjLbsIXvk+mP6AuWt6mMjJsVVQFE8pUuVnPw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702238297; a=rsa-sha256; cv=none; b=orIDpsuVycUPQqTFJCrH/B0mD5SMZA5bMTqx5+61KK0jgT2I91p+CFOBZmOrLr4rRQy4w+ IfJWe5uctdXaHkqvsGUWGs3YKZZM2U40jGvatb/ikWpCMuDdHdOrNesuCd4e4IejwxY5uv /1uuhKZdWu2p+iCgGjHu7e2cfWr65YPUkPRwUoD5d+VAtPkVPhvJaaz9X19ljh3dn9ZWpt 2eeSGV6ODQunIqa/qPRAUJFX2CveHQOxJpfZbLI1e6Z2U+GuMiaA2OKAlgFxzzFH4W6vDy 6WXdUhEz0x4WjdI/PfwSrFjR7HjHtWFPC3F9wfbpFwT1beynC3AbTOl+t4pYkA== 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=1702238297; 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=+0QD2h/8k7BBJj5wjeO+Eil2oo5LkDpxboayouzLRGA=; b=e5fZBGcQBmHYAr5+gCNQTbXHaDgC5VeLhTiAYwo6jpk16C/XcWXV5MzIba2PR+aCeamcwf yamkKTWVg2Eo3jBec5QQrkGs8nE6JGxRpH61f0VcMmHbtYW/0ttQ3B2+pxpREaOcIuPMHw wqO4PS9YXkfUzfcJWkmyuTiTMZgyks8MDKJRlF44CBfGbqMcwnt6ZfWoz1lREKMGSbHyPu rDGWn/Q0NO1NE16mUGmAiKKjNWMqTIKH6+tPvokQkCxE5I+WPWnSmAFn2ATgGU3j3Cz8JD +kKagnFx6lrQnXdtC7OHW03XjbGTVM6vriMsMmu/QqpkrEcycumgw5CmcK0tqw== 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 4SpFzs46Gsz11Yj; Sun, 10 Dec 2023 19:58:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BAJwHeQ026704; Sun, 10 Dec 2023 19:58:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BAJwHeU026701; Sun, 10 Dec 2023 19:58:17 GMT (envelope-from git) Date: Sun, 10 Dec 2023 19:58:17 GMT Message-Id: <202312101958.3BAJwHeU026701@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Sergey A. Osokin" Subject: git: 66182d944cb5 - stable/14 - bsd-family-tree: add OpenBSD 7.4 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: osa X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 66182d944cb5e622489cecfebd6d3b18fb6308be Auto-Submitted: auto-generated The branch stable/14 has been updated by osa: URL: https://cgit.FreeBSD.org/src/commit/?id=66182d944cb5e622489cecfebd6d3b18fb6308be commit 66182d944cb5e622489cecfebd6d3b18fb6308be Author: Sergey A. Osokin AuthorDate: 2023-10-16 20:19:12 +0000 Commit: Sergey A. Osokin CommitDate: 2023-12-10 19:57:30 +0000 bsd-family-tree: add OpenBSD 7.4 (cherry picked from commit 8c630381b43cc4d83c99305df3f732b0583ff8f2) --- share/misc/bsd-family-tree | 2 ++ 1 file changed, 2 insertions(+) diff --git a/share/misc/bsd-family-tree b/share/misc/bsd-family-tree index 4a9d1466ac9a..503cc04ab2d7 100644 --- a/share/misc/bsd-family-tree +++ b/share/misc/bsd-family-tree @@ -448,6 +448,7 @@ FreeBSD 5.2 | | | | | 13.2 | | | | | macOS | | | | 14 | | | + | | | OpenBSD 7.4 | | | | | | FreeBSD 14 -current | NetBSD -current OpenBSD -current DragonFly -current | | | | | @@ -875,6 +876,7 @@ DragonFly 6.4 2022-12-30 [DFB] OpenBSD 7.3 2023-04-10 [OBD] FreeBSD 13.2 2023-04-11 [FBD] macOS 14 2023-09-26 [APL] +OpenBSD 7.4 2023-10-16 [OBD] Bibliography ------------------------ From nobody Sun Dec 10 19:58:18 2023 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 4SpFzt74tFz54Ktv; Sun, 10 Dec 2023 19:58:18 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SpFzt6LZdz4DNF; Sun, 10 Dec 2023 19:58:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702238298; 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=3hOlIaeaBjKWt0AL740Rqgasakzn/eFRQM+3NFNC/T8=; b=mNif+yUOOy0yjArdBIz+6kpn74wv+REuogLbySO1azLh7ucc9X3XNpLyu9o4F9EGo0v2X5 xGnQ7ug+muToTGItCKsDG3kIvySH6/o1VozZaeF8mkww93IFAjVd3UFcPraKa/6vOokOeF 4f+X9mQTTDwjjGQynQi28ItuFtpqb0b8L9e/qejoSd5tUJdHa+Od6E5QXmJ5RePo7kLjB3 pKKuPB7jT9MxURAKf54xwLR/mTMbV+WM3j6QjVe4RB3EhOU51SMz4zhRXvPD97AZCaC87C vTcYEja5TyDhOiUY4fi/Elf8cj02kUSLizPwhCI8/G0P+8Fe9iMp+iqscwBaPg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702238298; a=rsa-sha256; cv=none; b=ECpwyGOpDTiSfJig+Dm4C3iRpCfaIOi9oSaJv4ZV4E/o/SPjxEgwmlZjy+5CLAnuxNtAbT Plcnjj9TU9SY7y5DJyrRUyGWtG8IlMpGBYJE4ZIevrDANsn1OzHEAbHoc2urhg1dwohXfI 8wqLQCOAzLMc5/BokU9QL4BcDqom5UQZBD3oRHD8/j4+ofbRYxpst3lqtUOV8fZXR+Q3sn PsuVnxyROt+x9cYXRklMGsDmZ6CVtXlhYiJT9RGI/BSpvYFzIsiGgVDnv7T/gAUMbmfXEW VwpDk6elI7nWLsnbpLbFM+qOSMgZ+T3En6pT7Ayev9x9V+JYWc1XZUvZ1YIOPA== 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=1702238298; 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=3hOlIaeaBjKWt0AL740Rqgasakzn/eFRQM+3NFNC/T8=; b=Az1jIeYdrifTpuw+H533NTuOTiJTBcyuYq+yKG7W1bsFPAGwARJe8mTjk0i23AJauoPgsq NQL8q1A8t2vacyZSiKo6XzqSepl3MKx6ICbcx5GhnvfDevk8iHy7W0AbmJ28iK7iCDGJdh /a6DzvnB6s2vvdSUdUoPkwyuOKnNGto6H96c4KfFtWljdI9L7seWSfoq/mc2HvGhE6909F ccEutb2kwsHsWNTL1gQnZKWZ/KKWOmPVTuzV9suyfrpbD4ytjr0/k3YIRuaOUAdIqSmgeT nA3H7PDc+1pK7EzeGdD7ZlYVaXOt1GK9DY4UHuQ47D2unOxORbOIV/ORKh2uaA== 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 4SpFzt53klz11Yk; Sun, 10 Dec 2023 19:58:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BAJwIc5026748; Sun, 10 Dec 2023 19:58:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BAJwINT026745; Sun, 10 Dec 2023 19:58:18 GMT (envelope-from git) Date: Sun, 10 Dec 2023 19:58:18 GMT Message-Id: <202312101958.3BAJwINT026745@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Sergey A. Osokin" Subject: git: 3b46583420e4 - stable/14 - bsd-family-tree: add FreeBSD 14 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: osa X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 3b46583420e453f7055caa9ac965ca5497075139 Auto-Submitted: auto-generated The branch stable/14 has been updated by osa: URL: https://cgit.FreeBSD.org/src/commit/?id=3b46583420e453f7055caa9ac965ca5497075139 commit 3b46583420e453f7055caa9ac965ca5497075139 Author: Sergey A. Osokin AuthorDate: 2023-12-07 14:26:12 +0000 Commit: Sergey A. Osokin CommitDate: 2023-12-10 19:57:40 +0000 bsd-family-tree: add FreeBSD 14 (cherry picked from commit 25f37779bdeba6856f92d0bc94f74582566fcb0f) --- share/misc/bsd-family-tree | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/share/misc/bsd-family-tree b/share/misc/bsd-family-tree index 503cc04ab2d7..d81c8829f4e8 100644 --- a/share/misc/bsd-family-tree +++ b/share/misc/bsd-family-tree @@ -449,8 +449,10 @@ FreeBSD 5.2 | | | | | macOS | | | | 14 | | | | | | OpenBSD 7.4 | + *--FreeBSD | | | | + | 14.0 | | | | | | | | | -FreeBSD 14 -current | NetBSD -current OpenBSD -current DragonFly -current +FreeBSD 15 -current | NetBSD -current OpenBSD -current DragonFly -current | | | | | v v v v v @@ -877,6 +879,7 @@ OpenBSD 7.3 2023-04-10 [OBD] FreeBSD 13.2 2023-04-11 [FBD] macOS 14 2023-09-26 [APL] OpenBSD 7.4 2023-10-16 [OBD] +FreeBSD 14.0 2023-11-20 [FBD] Bibliography ------------------------ From nobody Sun Dec 10 20:00:35 2023 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 4SpG2W2RH0z54L1k; Sun, 10 Dec 2023 20:00:35 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SpG2W1ymMz4F70; Sun, 10 Dec 2023 20:00:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702238435; 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=7YpKg6Uqgh9Z8KzSl0yDPs1cCOcpC2+By8phLyQfPwI=; b=L98/RMl39/W5b3vMXBF4qSjrPAUtjoCXaYSTzQtTogeRezEFak07hKadymp80lT54aos7u Qw1y6DasQ6+7rjGbnbgh+hEkdy9ak9Ye40AVEuRm6BPmDmBaOjea4gJuTmIJUJXxowbjAP vvBc2Qk06HF3iiRdtFL0AbKgfznG4QYKiwrbMHQSyqknTbZvvM85z7Su2OHHxhIkBAxpSn eweNIFdnjBNIQKF6pt2BcSKb2d5r/CRsAZUrbnIYNUTXRpW1Hr66dOEJwYqyfLEzBegMv2 U/B0pwRjxact7oPw2+cYYdjbQmTzysCez/crxZ57Ad6uoDcReWe+zdKTMZCKRA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702238435; a=rsa-sha256; cv=none; b=lmHDfG22XN3M2clmZm8HinIx4SQelf39j3yBvkChX3gX/jMUr8IHXup2s2+9Q9OcFxSbnw LZiqhmQu6Jcg+XlA4eq1tAMQCiJSCFO2I6yp6y/DNzcbAnAdJtBwxf9NWqyVt1q7oNHQUE qzkmcI/JxBIZhyeRmbyZr9CTQ9ysq4G+jcZmYiz2p7564HRBtxGRWdiLm7fQMvK1AA+zzB 1yBzlRUFg7HdR+G/kL+6nkbcVWBf9wxQwyJuJgL9cfzqeT1o9uepKGHzv9vUJc/lN++R+8 yssIPmP1pQveJT+24q55d8gmww46QJWHTWrBkZFjXgn2ojY7GNknuopwhbuRhQ== 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=1702238435; 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=7YpKg6Uqgh9Z8KzSl0yDPs1cCOcpC2+By8phLyQfPwI=; b=UnxdffLoabLajy1djSbqcCGvv2pWj/Grzp0vTuMq7uGW0pmOsvmN050F64dWxhi48Cp2nb Fb2QrPPR9M+WLzPWqM7pKRWuf1UxzjdAdQQDkzfdeJ8OEqKRXJ6qEl8fs5748lgpFfY9sr 5Un0jZEqwiq0/Nxh4jz3Tgy+GexhKr/eZFSG/ra9p7PqwMPNrh0YYOSTTg4nCvRzbNc/dG O6LRIzPaSot3+D7Dg7PcSgznGFtMgyOwUEXprltumQd0sa6etyduat7GzHkCmUk8lzW+Zg TkLh3Hv6eDnlEjZV+J2jZTHlRIZ5JOAbmKrNPHXoLkfVtvT+zca3Qaf1whFbZg== 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 4SpG2W0vCXz11WT; Sun, 10 Dec 2023 20:00:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BAK0Zfi036763; Sun, 10 Dec 2023 20:00:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BAK0Zxo036760; Sun, 10 Dec 2023 20:00:35 GMT (envelope-from git) Date: Sun, 10 Dec 2023 20:00:35 GMT Message-Id: <202312102000.3BAK0Zxo036760@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Sergey A. Osokin" Subject: git: 6539e67cf8c2 - stable/13 - bsd-family-tree: add macOS 14 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: osa X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6539e67cf8c27d62ce4c0eaa26039c96ab23667c Auto-Submitted: auto-generated The branch stable/13 has been updated by osa: URL: https://cgit.FreeBSD.org/src/commit/?id=6539e67cf8c27d62ce4c0eaa26039c96ab23667c commit 6539e67cf8c27d62ce4c0eaa26039c96ab23667c Author: Sergey A. Osokin AuthorDate: 2023-09-28 21:42:08 +0000 Commit: Sergey A. Osokin CommitDate: 2023-12-10 19:59:50 +0000 bsd-family-tree: add macOS 14 (cherry picked from commit 992ec09f37837a3f7d131bc70a66d6e41b814e9b) --- share/misc/bsd-family-tree | 3 +++ 1 file changed, 3 insertions(+) diff --git a/share/misc/bsd-family-tree b/share/misc/bsd-family-tree index 208523bd1fcb..4a9d1466ac9a 100644 --- a/share/misc/bsd-family-tree +++ b/share/misc/bsd-family-tree @@ -446,6 +446,8 @@ FreeBSD 5.2 | | | | | | | | OpenBSD 7.3 | | FreeBSD | | | | | 13.2 | | | | + | macOS | | | + | 14 | | | | | | | | FreeBSD 14 -current | NetBSD -current OpenBSD -current DragonFly -current | | | | | @@ -872,6 +874,7 @@ FreeBSD 12.4 2022-12-05 [FBD] DragonFly 6.4 2022-12-30 [DFB] OpenBSD 7.3 2023-04-10 [OBD] FreeBSD 13.2 2023-04-11 [FBD] +macOS 14 2023-09-26 [APL] Bibliography ------------------------ From nobody Sun Dec 10 20:00:36 2023 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 4SpG2X5ww8z54L6Q; Sun, 10 Dec 2023 20:00:36 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SpG2X3kcMz4FCR; Sun, 10 Dec 2023 20:00:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702238436; 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=wV2/08X9qIGBsRwTC2rk6P5rvFZUjOGV/6z54H1igbw=; b=AL6sPm8VqZmc70jg4DjvUqvYrm2IkIb04woSRrNC+I2D4jGLsuiZMB40FSJ9uVGQisaplY dBbJzSwKwC71UAEQj5IHNurtPPPlgJqAzxRaEJ4H8kZchJNSPj26iE3d0XdkBXo8XK0bZv /YaSeotOt0GSEWYEnuVrt/mTrvBBTPmdIkFn91Yw+zctQbELfyBx2fZDVkxQ7zJBgxab5l r18FXr4DwR4mrcbkSxzbO2is7hrzbGTan5peMzzIZ1OyWISFH7LDSCjKS/7UKmCHe582CB Nxf541AInv41JjfNz/UN0x2ErD00B3+8MmEUZsb/lQHncl4KjwoGPcbcCIrllQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702238436; a=rsa-sha256; cv=none; b=jMvWUl7kh0KZN2IYk+1jQE3Ws+k0teY2jx7gf5AOhAu+UnHsspFexdOpB2m+wKQ/ggtm7z X5808VIm2zDaS1u46Qh++MFnAMwSy1bkdxfE1026KOGtOpPrHwxcW0Ep8GS4pUrEW9AU7K Ub/OLTxKC4200XsPonAu1sCkHWrGKt+gUvXwReBhHY0P3JNHzy8axgBLZqYT9NYuY5rCPS Uw5t+fF320mtlPeRpRPlEwIQxZzNC77ie/H0j2KK5XaKJZ9fl5OSh0XI7EtQZbrwchndNm 8wT+69sh6+nf2+AqFu/aNE2FrPbudIq7l8KUSS/58VtTdkR2R8Q3h4y3RAegwQ== 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=1702238436; 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=wV2/08X9qIGBsRwTC2rk6P5rvFZUjOGV/6z54H1igbw=; b=yteJOyCDFHVIP8kcURh5actkFt8EhabqW8nGgppy8AcYnIHdmzkJNyGWcOD4ZUh97HxHon eWvfiKXJb4Ow3IYGZ/Bi38bFeekWFEEQPgz99FLgL1XyjY+EOIyFoHKbxpwph41A3mzcs2 mp/wJD+2fZg9amlfD+NmCnKQza455uEVt0xfhA+1fm0AsmlkcK/402stTm2t1o5b5LWYqZ 1sWssiLM4LSGqXX4l2goV2x6QMAEHT/649+yT3RTROnnMI5crCyd3PgRe6/jt6KrIgGMIH 5NJmXjGrxKsQWsV5fApRLAnkIKLHzXS1dV99EFCZbeQCRKwaQyjlSd2y9v1RwQ== 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 4SpG2X1fQDz11WW; Sun, 10 Dec 2023 20:00:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BAK0ah4036808; Sun, 10 Dec 2023 20:00:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BAK0ahb036805; Sun, 10 Dec 2023 20:00:36 GMT (envelope-from git) Date: Sun, 10 Dec 2023 20:00:36 GMT Message-Id: <202312102000.3BAK0ahb036805@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Sergey A. Osokin" Subject: git: a639aaa5f8ef - stable/13 - bsd-family-tree: add OpenBSD 7.4 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: osa X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a639aaa5f8efbda08939faa69af633ad70587968 Auto-Submitted: auto-generated The branch stable/13 has been updated by osa: URL: https://cgit.FreeBSD.org/src/commit/?id=a639aaa5f8efbda08939faa69af633ad70587968 commit a639aaa5f8efbda08939faa69af633ad70587968 Author: Sergey A. Osokin AuthorDate: 2023-10-16 20:19:12 +0000 Commit: Sergey A. Osokin CommitDate: 2023-12-10 19:59:58 +0000 bsd-family-tree: add OpenBSD 7.4 (cherry picked from commit 8c630381b43cc4d83c99305df3f732b0583ff8f2) --- share/misc/bsd-family-tree | 2 ++ 1 file changed, 2 insertions(+) diff --git a/share/misc/bsd-family-tree b/share/misc/bsd-family-tree index 4a9d1466ac9a..503cc04ab2d7 100644 --- a/share/misc/bsd-family-tree +++ b/share/misc/bsd-family-tree @@ -448,6 +448,7 @@ FreeBSD 5.2 | | | | | 13.2 | | | | | macOS | | | | 14 | | | + | | | OpenBSD 7.4 | | | | | | FreeBSD 14 -current | NetBSD -current OpenBSD -current DragonFly -current | | | | | @@ -875,6 +876,7 @@ DragonFly 6.4 2022-12-30 [DFB] OpenBSD 7.3 2023-04-10 [OBD] FreeBSD 13.2 2023-04-11 [FBD] macOS 14 2023-09-26 [APL] +OpenBSD 7.4 2023-10-16 [OBD] Bibliography ------------------------ From nobody Sun Dec 10 20:00:37 2023 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 4SpG2Y4H5Sz54Kvx; Sun, 10 Dec 2023 20:00:37 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SpG2Y3hrtz4FPJ; Sun, 10 Dec 2023 20:00:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702238437; 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=tgXAwU4L5tJKCGGBSy7HgFY7UnqsPLVTsQfrQKJQiP8=; b=u4ILEgZXeOXcwsXSfG65X5VwJpogZzA1tlIx56BoaC4/Kpz/z0FsgLW1r9oa928A8R1yiu Q32lTTWPHPext/Jw39Q85ZnzIYQQWZYCd1fOtGzvZMn1+LySBIMVXOz+vJSyi9eHHPDz59 nO1lh222kkCIQHBQsaNA0wXBW9qzvrMSFzGuoHp7k2+kg4fiiPom42Xug5ypcVgO6Xbv4t Jg8/aqx3KVA3J2zl5kaoyY/9d66eobFY1ieE34Om05eGK5pp8++btbwfE9QmA2optgA6SJ m0MEyjD3WhhxfeHaEHOGDgXgqNAiV8BHIT/3u0NTPyVBwFEvb3nc5zpKX8NltQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702238437; a=rsa-sha256; cv=none; b=dHV/f6+T6yiAXbOGd8nvwrDUUoXyVexo+cUzQWVaUNx+CZXIFTmb2TWj2aNIVtWe7g/U7w CgMEWwQDc0wusRyceGWdkNBaBABbF3yGnDDjQtMS968PH8Lpx9aUiYP5atfFKqF8gfwMG4 F8lCdhOelK/xQlgRsw3u441cZ0zwyfj0ZsZftRJVy10+y5imIXgINa8gaBmjQH4fJF+9Ur +p5M1j68gL41b6K2ieycFbTugmoGzXbfHW805RxEUz2uTH/yghUMC1erW5JX3/FQALTG2Z +A4t+rT0NajaCaTydSz9SnuQGsZ7u4gYVC128hyYt1IWKqV4smbUcntPvZhhrA== 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=1702238437; 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=tgXAwU4L5tJKCGGBSy7HgFY7UnqsPLVTsQfrQKJQiP8=; b=ADuEaozqsXVLr99fFAgTyIpe9XwIrZEMM3ra2xxwwP0mbFPW7K6i6CtadExyHMpmDQH81o Mq50uNlxclCclkafnRoEA0fzUwYaG3YWcFdcX3E+0MOu3fKde3CyhFPEAIs5BHn/A1O3FA jvTcheP9JTVrhmOtjlD0ihO7eaSd10VOwVr7pvZQ3ABCO1pYuboukSeoyDREYiZ5ACuc7v r7XrP1AGizI5ViOtqOUQlvRoRfYY1vzvvUAB0o9UAr1QJ/N6O2x0ptBsnE9Q4hF5m32/Ke TvAw4xPfSNIOUBOFUiI5YnTVmxmHU2+a6PrXw8TXPRXX2v+IV3Y27YHo8HLu4A== 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 4SpG2Y2dTlz11NK; Sun, 10 Dec 2023 20:00:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BAK0b6E036850; Sun, 10 Dec 2023 20:00:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BAK0bSJ036847; Sun, 10 Dec 2023 20:00:37 GMT (envelope-from git) Date: Sun, 10 Dec 2023 20:00:37 GMT Message-Id: <202312102000.3BAK0bSJ036847@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Sergey A. Osokin" Subject: git: 7a241fa3182b - stable/13 - bsd-family-tree: add FreeBSD 14 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: osa X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7a241fa3182ba3e72a4e72011c6441a98cd63b0b Auto-Submitted: auto-generated The branch stable/13 has been updated by osa: URL: https://cgit.FreeBSD.org/src/commit/?id=7a241fa3182ba3e72a4e72011c6441a98cd63b0b commit 7a241fa3182ba3e72a4e72011c6441a98cd63b0b Author: Sergey A. Osokin AuthorDate: 2023-12-07 14:26:12 +0000 Commit: Sergey A. Osokin CommitDate: 2023-12-10 20:00:05 +0000 bsd-family-tree: add FreeBSD 14 (cherry picked from commit 25f37779bdeba6856f92d0bc94f74582566fcb0f) --- share/misc/bsd-family-tree | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/share/misc/bsd-family-tree b/share/misc/bsd-family-tree index 503cc04ab2d7..d81c8829f4e8 100644 --- a/share/misc/bsd-family-tree +++ b/share/misc/bsd-family-tree @@ -449,8 +449,10 @@ FreeBSD 5.2 | | | | | macOS | | | | 14 | | | | | | OpenBSD 7.4 | + *--FreeBSD | | | | + | 14.0 | | | | | | | | | -FreeBSD 14 -current | NetBSD -current OpenBSD -current DragonFly -current +FreeBSD 15 -current | NetBSD -current OpenBSD -current DragonFly -current | | | | | v v v v v @@ -877,6 +879,7 @@ OpenBSD 7.3 2023-04-10 [OBD] FreeBSD 13.2 2023-04-11 [FBD] macOS 14 2023-09-26 [APL] OpenBSD 7.4 2023-10-16 [OBD] +FreeBSD 14.0 2023-11-20 [FBD] Bibliography ------------------------ From nobody Mon Dec 11 00:24:38 2023 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 4SpMvB4sYfz53YLG; Mon, 11 Dec 2023 00:24:38 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SpMvB4Lszz4bQG; Mon, 11 Dec 2023 00:24:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702254278; 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=I3CxMZuZoIYKRxEuF6OsOS8NZwYGEbXRbf5LKlf5jE0=; b=Gd5zvhY7USiAt4mBN+VfLMGfSZTRdlAxUgaKQBi9gc+CUW9PSZ0CMvu0TaQZqE2x6IXFLK SOcKwcyFqeBYCDuSX7VxtFpDG8jERVN7ZFUs1a67EcPzkL0a1TbGxu++NCPcRnbkNowpoz zhco4RYoaALyud99jrX0S0HhrTyrtp/KizfsAtggBE7VmWhg2FXdu869cW9y6diVP8DJMs 4+qfyeBVUbotuvSDje+JJXbV/fjdmAF1gP8S843Xt0oOHUqDh55rEvcYEhff9q6gawzyyR 87rr57rZXVbHjymLgXkBOC0C4cRaQoqUQXjSUw8S+XwEbXmptT2fLp4wlMjTJQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702254278; a=rsa-sha256; cv=none; b=iQcHo+1J2fwU5LWxhPpnLWjMiCHdi+RrJmqx8Obyi3tFtZPl3CalwX15Twy5GOV5ClUQnc 3TVjWwYktk92Iv8h/IOgTY6nI8idIlp8+luX2OLV9BZ0qimLHDSkjte7QeDyDN00UxkRym 6Sapexd4EryEUrgik8APv9d7I8ZC6iTFJDrrfvavwhRIJpRgziIgfgmeMUvqsZXcrSTW/y J30axpd3YUbM0ygRcvqN2tUBcXw4Old03BmFuVwx8rYFU0RKc0kPJU7pbOwttBJUsGXhYw 7Jqb+X7EuJmJVgeIe9Rtn7nkfNLfd7ALGY9Xv6BePSH9XiS7Lvj+TzAaEdsVRg== 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=1702254278; 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=I3CxMZuZoIYKRxEuF6OsOS8NZwYGEbXRbf5LKlf5jE0=; b=r0bv3eBhEXzG6fWK8sGxI2b7q8uxiUo3WgJWAUBjY4alVSENksYBtedgnjz2SOFx6YH/Zj BJyrhs8CAGzmJMjU6Q8QsAyoMJ6EBHlxtRma9Norw/hYtldRWZrB1TkBvT+Tqbw1lBX52+ 75rPlR6FdCTTRerTYHJPbVTCkCaHopc/KaU4hCvrJluciNsjjzeS6NljBTmblEriTjrP4N Nz4jwa8JcPOpYmbNIDlEocudC67thq4x37l0ozO3sh3xOBoiQK2SQuS7bDKOiNb/Mk2BgC 6zPGlFNdf2LuVXt1QnMGCfsfJNE4YrXVGFS8Y9FQCxQdEaLUKuTXyJIEov25CQ== 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 4SpMvB3QF2z188t; Mon, 11 Dec 2023 00:24:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BB0OcFO079014; Mon, 11 Dec 2023 00:24:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BB0OccF079011; Mon, 11 Dec 2023 00:24:38 GMT (envelope-from git) Date: Mon, 11 Dec 2023 00:24:38 GMT Message-Id: <202312110024.3BB0OccF079011@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 8e41bbf2457e - stable/14 - zfs tests: Silence clang warning 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8e41bbf2457ee2269935ccab405de120f54db3c4 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=8e41bbf2457ee2269935ccab405de120f54db3c4 commit 8e41bbf2457ee2269935ccab405de120f54db3c4 Author: Jose Luis Duran AuthorDate: 2023-11-07 15:05:15 +0000 Commit: Mark Johnston CommitDate: 2023-12-11 00:23:05 +0000 zfs tests: Silence clang warning "assigning to 'pattern_t *' from 'const pattern_t *' discards qualifiers" Reviewed by: asomers Reported by: clang MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D42791 (cherry picked from commit 5b36076d28ad1920b178da93d667dcfeae426494) --- tests/sys/cddl/zfs/tests/txg_integrity/fsync_integrity.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/sys/cddl/zfs/tests/txg_integrity/fsync_integrity.c b/tests/sys/cddl/zfs/tests/txg_integrity/fsync_integrity.c index 17c6b63d45d8..5aba7a83225f 100644 --- a/tests/sys/cddl/zfs/tests/txg_integrity/fsync_integrity.c +++ b/tests/sys/cddl/zfs/tests/txg_integrity/fsync_integrity.c @@ -106,7 +106,7 @@ typedef struct { typedef struct { int thread_num; - pattern_t* pat; + const pattern_t* pat; } thread_data_t; @@ -354,7 +354,7 @@ verify_file(int fd, const pattern_t* p_pat){ /* Writes a special marker to every byte within the chunk */ static void -write_chunk(pattern_t* p_pat, int chunk_idx, int thread_num) +write_chunk(const pattern_t* p_pat, int chunk_idx, int thread_num) { uint32_t chunk_start, chunk_end; get_chunk_range(p_pat, chunk_idx, &chunk_start, &chunk_end); From nobody Tue Dec 12 00:30:13 2023 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 4SpzzB0xn5z54JFW; Tue, 12 Dec 2023 00:30: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SpzzB0LyFz3Nq9; Tue, 12 Dec 2023 00:30:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702341014; 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=WLX4RZKMep36kOcfKsBenCgzPd/jq+/MwjK2He3kT1c=; b=PK6EjAky7qM3Wx3zP3lC99QX5hx3turLzLzqF0ytp/JHPgyGEB5qDDZhFtz7BI1dwoNjbF 0R0I2Do311yquQ+KVKtwhe3toU36Pn2ZzxsObYD/QpPS2tq+lrfJ6vDgNRVgGVqQvcYqh+ mfkhkNfUkV+RETqoJE8is1WXHoHu+r5CrX/zyJb3cnY6hC6XA2/YnXmwRZf5mfv7KkiepE vf7/s4BlCYb+yJqH33cSGzfZ5Lz1LrSiizSDKUW+yXche8behEBl3vPuYEB36OorDqOKFh UKbWAC+C9epIwxPKB40znUOs4ogwIhC/6Y01ctvZdpMtdYfboL8r3HqkRWt1JQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702341014; a=rsa-sha256; cv=none; b=M6Nw4mHrp+FhtgAA1bQrNkYtOwYTAgKxntmvgjtzaQDH5fVfINdjYG2oN4v0jhYS2Wy09E wbR2OhAz5L5Y0IsB1PnjV9Ek6q+ewBOGZ15y4J1E3oLlgalMzcqj29loL29YGv7v9vNdQz y+VxBSU+Z5Q3rFjTqgJD6w+V4C/g66APlOCW7P4J4P/URut5u9drjHl6UHThooqeRjphBr YFnyWISFo03NibrgZ5N3PD62QzlZxgmZ9/ZSuSmVNjmnXJIvNUF98B6NyJFjby54WpwJYN ZMoyzKY+T7kI1+KFgTJY7aa7S6Lf+jDxx9NSAV4zQhckDL8+6iKXzlL4y9aCRg== 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=1702341014; 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=WLX4RZKMep36kOcfKsBenCgzPd/jq+/MwjK2He3kT1c=; b=xb0vhljWiTacTvKoLw6BB2GxkaUAu/NBTqXXPFrsqKzpV8LMHcJfwidK904gJgZHa/w1hO fWAaN/LaAVZfGLdyreVEQmS/UjHnldKm4PGtGJ8lLBelyEXVhIY93SUt6XieADf7j1xYnW J+PW0kP7SxyuKJYuqwyFEy5xVyVuDGDYH4UR2yV3L3n3b9mpW60lNDNd4Vrs9xHBId+0x5 +V4eCFlF2eQjhY8Ynm7bAWQEnW4FIY8TcQ8fVNkvEL+Nhp8XA/e4ddC+QfAGuJTtARyLBE nv4sqjJ0GzuyJaFmKL7T+HMtlkl1+g/Gad+2U3DmobC0Qo9tUZV5dlcEgf/yqA== 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 4Spzz96PrszspM; Tue, 12 Dec 2023 00:30:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BC0UDTE000295; Tue, 12 Dec 2023 00:30:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BC0UDaW000290; Tue, 12 Dec 2023 00:30:13 GMT (envelope-from git) Date: Tue, 12 Dec 2023 00:30:13 GMT Message-Id: <202312120030.3BC0UDaW000290@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: d264ddb9c7f8 - stable/14 - bhnd: Correct the softc size in the siba_bhndb_driver definition 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d264ddb9c7f8739be22170ec660110a0f4c2ec8f Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=d264ddb9c7f8739be22170ec660110a0f4c2ec8f commit d264ddb9c7f8739be22170ec660110a0f4c2ec8f Author: Mark Johnston AuthorDate: 2023-12-05 18:47:03 +0000 Commit: Mark Johnston CommitDate: 2023-12-12 00:30:05 +0000 bhnd: Correct the softc size in the siba_bhndb_driver definition struct siba_bhndb_softc embeds struct siba_softc and adds an extra field, "quirks". In practice, this bug was harmless since "quirks" is unconditionally initialized during driver attach and would have lived in the redzone of the softc allocation, but KASAN catches the out-of-bounds access. PR: 275515 Reported by: Frank Hilgendorf MFC after: 1 week (cherry picked from commit 4c3aa00c0a0093c78f42d138bb9eef9b1a7cbb39) --- sys/dev/bhnd/siba/siba_bhndb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/bhnd/siba/siba_bhndb.c b/sys/dev/bhnd/siba/siba_bhndb.c index b806f9535e73..59243be18938 100644 --- a/sys/dev/bhnd/siba/siba_bhndb.c +++ b/sys/dev/bhnd/siba/siba_bhndb.c @@ -286,7 +286,7 @@ static device_method_t siba_bhndb_methods[] = { }; DEFINE_CLASS_2(bhnd, siba_bhndb_driver, siba_bhndb_methods, - sizeof(struct siba_softc), bhnd_bhndb_driver, siba_driver); + sizeof(struct siba_bhndb_softc), bhnd_bhndb_driver, siba_driver); DRIVER_MODULE(siba_bhndb, bhndb, siba_bhndb_driver, NULL, NULL); From nobody Tue Dec 12 19:13:50 2023 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 4SqSvf3zXwz54KBr; Tue, 12 Dec 2023 19:13:50 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SqSvf2ghDz3YtX; Tue, 12 Dec 2023 19:13:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702408430; 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=r5Ff1ckif/F99WBCB/k0hO+AcdyHT5RYhoz1M0KNZ9U=; b=UW3PW6bznj+z5bHticMP1I9irPBJZB8YKPpLtPYSR8cRdrKyAI9sbbzyoGYTY+fxLo5esG FfMZh3uELoMv0ZqWMs54tMIpKC8HtH05NYOif/ZzncE4XI7oI62ZeDmEbLIBB3nO6WaTb2 Oa+Qh6YmDwo6ygRUdKShCGs9vA8hbf/iBBzU22gdx4SDt5WByj/qYq4LyxNso4ADgn2rBJ BjXGJJFNuw0qeidQIFi1HlflVNV5mRg1S2V7/A9PqMZ2tZaSQewEzcxmBCFBmFDT2T0Nbe gsc0CkKxHNDH/t+E1rgzlMTf47jHmNzYn/0XdwkNOCiT89jruQgCt4+gGKEygQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702408430; a=rsa-sha256; cv=none; b=uugUl6PyTdktpdTYNLipT3DtiLZHfstOZjVy7PYI00F3U5+BKzDFgUhbjWLeX/w7ZulIf2 Z9ac3sn7IWmiGxrBPIN0jBSPsxgX42Fmcb79T7uUlqg9D+fwhYoSVlLKZ4dRC/GkARVFFx TFxziQTNMf+wQD+CHkMVKTeBLzwKOLUCsNzIvD9I7dfMzzv6VhoZy3Ypctb0nWWMzWy2yz UtYE280jtMDqt14x1MudVs5UzCyWHCYzaFlJxXKn6VagOUmpFEDLc9TyiXPbCb+L9CLMi+ 0528EkCMmN1v+lvTi5q7AAPrX0F6WvDc71OjvxRNAHHEh9K9R1cLqMY/1Nl7qg== 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=1702408430; 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=r5Ff1ckif/F99WBCB/k0hO+AcdyHT5RYhoz1M0KNZ9U=; b=jtwwVI7rA/DR/2NI0fZ/nF9aXQAYNuFTwklxjIbVqSwbi+e3m9iL84/ie5crO/MZOyn/eL pfvSyTdcj0s4kCQ8Ao3ceBc4WX/o/t1g+I9450iaBrSzySU4hsveXwIyGOQUck1nk4M1eS GPraPTIGmi98bY8RpZLQvRMdc038IWwPn0FeaLjdWGPXnoCNUSX9o1pipy9Zh71FWoSifD KTxTWSabjiFQaz2EjYB14ILaOEwfJsQ7J1Iu+WRrtuoRwNqyuvSJAyAnpS5L/EECLF5m4J T4JlzvFsMbbgx5lWzps0NkqIgg9bQ40Oi+uMM7YqXBUfAYlyDWzkQmL9yh89eg== 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 4SqSvf1ds5zCbS; Tue, 12 Dec 2023 19:13:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BCJDoCG087110; Tue, 12 Dec 2023 19:13:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BCJDo9R087107; Tue, 12 Dec 2023 19:13:50 GMT (envelope-from git) Date: Tue, 12 Dec 2023 19:13:50 GMT Message-Id: <202312121913.3BCJDo9R087107@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 8d42f85d9d7b - stable/14 - nfsclient: Propagate copyin() errors from nfsm_uiombuf() 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8d42f85d9d7b5394edbe6f18c1e96c0d35d49b3c Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=8d42f85d9d7b5394edbe6f18c1e96c0d35d49b3c commit 8d42f85d9d7b5394edbe6f18c1e96c0d35d49b3c Author: Mark Johnston AuthorDate: 2023-12-12 01:04:56 +0000 Commit: Mark Johnston CommitDate: 2023-12-12 19:11:51 +0000 nfsclient: Propagate copyin() errors from nfsm_uiombuf() Approved by: so Security: SA-23:18.nfsclient Reviewed by: rmacklem Sponsored by: The FreeBSD Foundation (cherry picked from commit 6fa843f6e647a1a1e0e42af1e7abc9e903699f31) --- sys/fs/nfs/nfs_var.h | 2 +- sys/fs/nfsclient/nfs_clcomsubs.c | 23 ++++++++++++++++------- sys/fs/nfsclient/nfs_clrpcops.c | 23 ++++++++++++++++++++--- sys/fs/nfsclient/nfs_clvnops.c | 4 ++-- 4 files changed, 39 insertions(+), 13 deletions(-) diff --git a/sys/fs/nfs/nfs_var.h b/sys/fs/nfs/nfs_var.h index 133850dcde0e..578fb3ce1340 100644 --- a/sys/fs/nfs/nfs_var.h +++ b/sys/fs/nfs/nfs_var.h @@ -370,7 +370,7 @@ int nfsrpc_destroysession(struct nfsmount *, struct nfsclsession *, struct ucred *, NFSPROC_T *); /* nfs_clcomsubs.c */ -void nfsm_uiombuf(struct nfsrv_descript *, struct uio *, int); +int nfsm_uiombuf(struct nfsrv_descript *, struct uio *, int); struct mbuf *nfsm_uiombuflist(struct uio *, int, u_int); u_int8_t *nfscl_getmyip(struct nfsmount *, struct in6_addr *, int *); int nfsm_getfh(struct nfsrv_descript *, struct nfsfh **); diff --git a/sys/fs/nfsclient/nfs_clcomsubs.c b/sys/fs/nfsclient/nfs_clcomsubs.c index 7912ab56140f..270f39d03c90 100644 --- a/sys/fs/nfsclient/nfs_clcomsubs.c +++ b/sys/fs/nfsclient/nfs_clcomsubs.c @@ -51,12 +51,12 @@ NFSCLSTATEMUTEX; * copies a uio scatter/gather list to an mbuf chain. * NOTE: can only handle iovcnt == 1 */ -void +int nfsm_uiombuf(struct nfsrv_descript *nd, struct uio *uiop, int siz) { char *uiocp; struct mbuf *mp, *mp2; - int xfer, left, mlen; + int error, xfer, left, mlen; int uiosiz, clflg, rem; char *mcp, *tcp; @@ -104,8 +104,11 @@ nfsm_uiombuf(struct nfsrv_descript *nd, struct uio *uiop, int siz) xfer = (left > mlen) ? mlen : left; if (uiop->uio_segflg == UIO_SYSSPACE) NFSBCOPY(uiocp, mcp, xfer); - else - copyin(uiocp, mcp, xfer); + else { + error = copyin(uiocp, mcp, xfer); + if (error != 0) + return (error); + } mp->m_len += xfer; left -= xfer; uiocp += xfer; @@ -148,6 +151,7 @@ nfsm_uiombuf(struct nfsrv_descript *nd, struct uio *uiop, int siz) } nd->nd_bpos = mcp; nd->nd_mb = mp; + return (0); } /* @@ -160,7 +164,7 @@ nfsm_uiombuflist(struct uio *uiop, int siz, u_int maxext) { char *uiocp; struct mbuf *mp, *mp2, *firstmp; - int extpg, extpgsiz = 0, i, left, mlen, rem, xfer; + int error, extpg, extpgsiz = 0, i, left, mlen, rem, xfer; int uiosiz, clflg; char *mcp, *tcp; @@ -218,8 +222,13 @@ nfsm_uiombuflist(struct uio *uiop, int siz, u_int maxext) xfer = (left > mlen) ? mlen : left; if (uiop->uio_segflg == UIO_SYSSPACE) NFSBCOPY(uiocp, mcp, xfer); - else - copyin(uiocp, mcp, xfer); + else { + error = copyin(uiocp, mcp, xfer); + if (error != 0) { + m_freem(firstmp); + return (NULL); + } + } mp->m_len += xfer; mcp += xfer; if (maxext > 0) { diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c index 207a51c4aece..c986b3927f1b 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -2104,7 +2104,12 @@ nfsrpc_writerpc(vnode_t vp, struct uio *uiop, int *iomode, *tl++ = x; /* total to this offset */ *tl = x; /* size of this write */ } - nfsm_uiombuf(nd, uiop, len); + error = nfsm_uiombuf(nd, uiop, len); + if (error != 0) { + m_freem(nd->nd_mreq); + free(nd, M_TEMP); + return (error); + } /* * Although it is tempting to do a normal Getattr Op in the * NFSv4 compound, the result can be a nearly hung client @@ -6321,6 +6326,10 @@ nfscl_doiods(vnode_t vp, struct uio *uiop, int *iomode, int *must_commit, iovlen = uiop->uio_iov->iov_len; m = nfsm_uiombuflist(uiop, len, 0); + if (m == NULL) { + error = EFAULT; + break; + } } tdrpc = drpc = malloc(sizeof(*drpc) * (mirrorcnt - 1), M_TEMP, M_WAITOK | @@ -6893,7 +6902,11 @@ nfsrpc_writeds(vnode_t vp, struct uio *uiop, int *iomode, int *must_commit, *tl++ = txdr_unsigned(len); *tl++ = txdr_unsigned(*iomode); *tl = txdr_unsigned(len); - nfsm_uiombuf(nd, uiop, len); + error = nfsm_uiombuf(nd, uiop, len); + if (error != 0) { + m_freem(nd->nd_mreq); + return (error); + } nrp = dsp->nfsclds_sockp; if (nrp == NULL) /* If NULL, use the MDS socket. */ @@ -8982,7 +8995,11 @@ nfsrpc_setextattr(vnode_t vp, const char *name, struct uio *uiop, nfsm_strtom(nd, name, strlen(name)); NFSM_BUILD(tl, uint32_t *, NFSX_UNSIGNED); *tl = txdr_unsigned(uiop->uio_resid); - nfsm_uiombuf(nd, uiop, uiop->uio_resid); + error = nfsm_uiombuf(nd, uiop, uiop->uio_resid); + if (error != 0) { + m_freem(nd->nd_mreq); + return (error); + } NFSM_BUILD(tl, uint32_t *, NFSX_UNSIGNED); *tl = txdr_unsigned(NFSV4OP_GETATTR); NFSGETATTR_ATTRBIT(&attrbits); diff --git a/sys/fs/nfsclient/nfs_clvnops.c b/sys/fs/nfsclient/nfs_clvnops.c index cfb5e90739a4..e93f8e83daa4 100644 --- a/sys/fs/nfsclient/nfs_clvnops.c +++ b/sys/fs/nfsclient/nfs_clvnops.c @@ -1587,7 +1587,7 @@ ncl_readrpc(struct vnode *vp, struct uio *uiop, struct ucred *cred) error = nfscl_doiods(vp, uiop, NULL, NULL, NFSV4OPEN_ACCESSREAD, 0, cred, uiop->uio_td); NFSCL_DEBUG(4, "readrpc: aft doiods=%d\n", error); - if (error != 0) + if (error != 0 && error != EFAULT) error = nfsrpc_read(vp, uiop, cred, uiop->uio_td, &nfsva, &attrflag); if (attrflag) { @@ -1618,7 +1618,7 @@ ncl_writerpc(struct vnode *vp, struct uio *uiop, struct ucred *cred, error = nfscl_doiods(vp, uiop, iomode, must_commit, NFSV4OPEN_ACCESSWRITE, 0, cred, uiop->uio_td); NFSCL_DEBUG(4, "writerpc: aft doiods=%d\n", error); - if (error != 0) + if (error != 0 && error != EFAULT) error = nfsrpc_write(vp, uiop, iomode, must_commit, cred, uiop->uio_td, &nfsva, &attrflag, called_from_strategy, ioflag); From nobody Tue Dec 12 19:14:16 2023 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 4SqSw85DCLz54KX6; Tue, 12 Dec 2023 19:14: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SqSw84VWnz3ZXv; Tue, 12 Dec 2023 19:14:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702408456; 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=8uUG/tfpElWr1EuNdmzQujwetGkg2h7M/c8ZRh0VsM0=; b=a45LEyURCOGJn1sl4RHeHleQ9nECLBDRk8PVZQRR+r2yu1ZEMfMWN80IYDCpreiZUUiXyo ananRkJU3MVfneVZsddDaXAIgJRwny9aaVlfbeW/5Ty5LIDpRQ4QVWLCIDEfW5lz2W8VD4 sdcOYjc2+fMGVSvYXtmC7gOl7LHf8XyfJuZ5tyiL8DGnuWaRJx45A1MMRnKrRiK027liHm McnXi4D2GriIsPpTQnsUBkpWYNFEfN9rrTQVF94TfrAWWhHzdrJzNbw9UI1nEuPLDTy1uY S4QvvMAEEchiMbzKEH0B5n73Uq7tlETKd204mmJLx6E0YRTtbIC+bNCaYkQ96A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702408456; a=rsa-sha256; cv=none; b=D6D7Y/whBR4GBuTtHeUMgqjtT2QHt7YleScMmH/+Xn4KP/qliwfNXlCC/C3wzmYgljHghS 7LHFHXFQKACWkmf4oz06s6Va6+MaaogfOSRgw1VqpeEjZ9ftqf4F9MLDX08acXRMkatdYj vijaKe2IVTVgqYEyCtsCtFMG5toXnUc1SuW8M2ndwEMNegzWPsQifz7Cqz13qwafhYt45H t3g6MQoAK3cgXvf7+970xa+MCpoHG0uR3vRXa0+LzS1L87w7epi9TAmkSEcCE4rNmEMdjz iKGhN8yNErQ8sXlPRBqkQbTRfHMk6/L+HUdNLmv/Bvf4TqBTDE/v3LNnlChFDA== 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=1702408456; 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=8uUG/tfpElWr1EuNdmzQujwetGkg2h7M/c8ZRh0VsM0=; b=shvBqeQCa8T/so0nsDFPS1qvI4hE/djubssbTjdvwGf6JzOREIrueshv6ymlO143zXgnA5 DWeAWhQbpt8gk3M1Ft/w1Tvjd0aZUx4PClFriiu75scl3ATmLO1EZNskKGLhkNDD53E7vk PdejFjX8YjyX+83N6AOyAeJbRYndAESJYL0BDzWwcOGa9+pzppgwmtHbkIAXsyR4lR1UO+ 9g4LFV4GGOdaRqHFw54bjHA9xil2LZN5oPxn/wBTzDSEE7Rq+lQ+XNgLDtHMuMWW8NBBOJ oyfmf7XlDWC8IOd35XSIRQTHHyLW6hT0EzX31WzFXrYrOIrrwJFJXDO5nKwgiw== 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 4SqSw83Z1GzCbT; Tue, 12 Dec 2023 19:14:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BCJEG8r087293; Tue, 12 Dec 2023 19:14:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BCJEGgm087290; Tue, 12 Dec 2023 19:14:16 GMT (envelope-from git) Date: Tue, 12 Dec 2023 19:14:16 GMT Message-Id: <202312121914.3BCJEGgm087290@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: f1d1d50e1d08 - stable/13 - nfsclient: Propagate copyin() errors from nfsm_uiombuf() 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f1d1d50e1d089f0bfcd38e5f08b1e8bf5a1d64c3 Auto-Submitted: auto-generated The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=f1d1d50e1d089f0bfcd38e5f08b1e8bf5a1d64c3 commit f1d1d50e1d089f0bfcd38e5f08b1e8bf5a1d64c3 Author: Mark Johnston AuthorDate: 2023-12-12 01:04:56 +0000 Commit: Mark Johnston CommitDate: 2023-12-12 19:12:06 +0000 nfsclient: Propagate copyin() errors from nfsm_uiombuf() Approved by: so Security: SA-23:18.nfsclient Reviewed by: rmacklem Sponsored by: The FreeBSD Foundation (cherry picked from commit 6fa843f6e647a1a1e0e42af1e7abc9e903699f31) --- sys/fs/nfs/nfs_var.h | 2 +- sys/fs/nfsclient/nfs_clcomsubs.c | 23 ++++++++++++++++------- sys/fs/nfsclient/nfs_clrpcops.c | 23 ++++++++++++++++++++--- sys/fs/nfsclient/nfs_clvnops.c | 4 ++-- 4 files changed, 39 insertions(+), 13 deletions(-) diff --git a/sys/fs/nfs/nfs_var.h b/sys/fs/nfs/nfs_var.h index 61badf781a0a..8cdc08fba433 100644 --- a/sys/fs/nfs/nfs_var.h +++ b/sys/fs/nfs/nfs_var.h @@ -367,7 +367,7 @@ int nfsrpc_destroysession(struct nfsmount *, struct nfsclsession *, struct ucred *, NFSPROC_T *); /* nfs_clcomsubs.c */ -void nfsm_uiombuf(struct nfsrv_descript *, struct uio *, int); +int nfsm_uiombuf(struct nfsrv_descript *, struct uio *, int); struct mbuf *nfsm_uiombuflist(struct uio *, int, u_int); u_int8_t *nfscl_getmyip(struct nfsmount *, struct in6_addr *, int *); int nfsm_getfh(struct nfsrv_descript *, struct nfsfh **); diff --git a/sys/fs/nfsclient/nfs_clcomsubs.c b/sys/fs/nfsclient/nfs_clcomsubs.c index f52de5d601ee..f2031220b80e 100644 --- a/sys/fs/nfsclient/nfs_clcomsubs.c +++ b/sys/fs/nfsclient/nfs_clcomsubs.c @@ -51,12 +51,12 @@ NFSCLSTATEMUTEX; * copies a uio scatter/gather list to an mbuf chain. * NOTE: can only handle iovcnt == 1 */ -void +int nfsm_uiombuf(struct nfsrv_descript *nd, struct uio *uiop, int siz) { char *uiocp; struct mbuf *mp, *mp2; - int xfer, left, mlen; + int error, xfer, left, mlen; int uiosiz, clflg, rem; char *mcp, *tcp; @@ -104,8 +104,11 @@ nfsm_uiombuf(struct nfsrv_descript *nd, struct uio *uiop, int siz) xfer = (left > mlen) ? mlen : left; if (uiop->uio_segflg == UIO_SYSSPACE) NFSBCOPY(uiocp, mcp, xfer); - else - copyin(uiocp, mcp, xfer); + else { + error = copyin(uiocp, mcp, xfer); + if (error != 0) + return (error); + } mp->m_len += xfer; left -= xfer; uiocp += xfer; @@ -148,6 +151,7 @@ nfsm_uiombuf(struct nfsrv_descript *nd, struct uio *uiop, int siz) } nd->nd_bpos = mcp; nd->nd_mb = mp; + return (0); } /* @@ -160,7 +164,7 @@ nfsm_uiombuflist(struct uio *uiop, int siz, u_int maxext) { char *uiocp; struct mbuf *mp, *mp2, *firstmp; - int extpg, extpgsiz = 0, i, left, mlen, rem, xfer; + int error, extpg, extpgsiz = 0, i, left, mlen, rem, xfer; int uiosiz, clflg; char *mcp, *tcp; @@ -218,8 +222,13 @@ nfsm_uiombuflist(struct uio *uiop, int siz, u_int maxext) xfer = (left > mlen) ? mlen : left; if (uiop->uio_segflg == UIO_SYSSPACE) NFSBCOPY(uiocp, mcp, xfer); - else - copyin(uiocp, mcp, xfer); + else { + error = copyin(uiocp, mcp, xfer); + if (error != 0) { + m_freem(firstmp); + return (NULL); + } + } mp->m_len += xfer; mcp += xfer; if (maxext > 0) { diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c index 569132aee43c..63b9f7755fd3 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -1929,7 +1929,12 @@ nfsrpc_writerpc(vnode_t vp, struct uio *uiop, int *iomode, *tl++ = x; /* total to this offset */ *tl = x; /* size of this write */ } - nfsm_uiombuf(nd, uiop, len); + error = nfsm_uiombuf(nd, uiop, len); + if (error != 0) { + m_freem(nd->nd_mreq); + free(nd, M_TEMP); + return (error); + } /* * Although it is tempting to do a normal Getattr Op in the * NFSv4 compound, the result can be a nearly hung client @@ -6043,6 +6048,10 @@ nfscl_doiods(vnode_t vp, struct uio *uiop, int *iomode, int *must_commit, iovlen = uiop->uio_iov->iov_len; m = nfsm_uiombuflist(uiop, len, 0); + if (m == NULL) { + error = EFAULT; + break; + } } tdrpc = drpc = malloc(sizeof(*drpc) * (mirrorcnt - 1), M_TEMP, M_WAITOK | @@ -6615,7 +6624,11 @@ nfsrpc_writeds(vnode_t vp, struct uio *uiop, int *iomode, int *must_commit, *tl++ = txdr_unsigned(len); *tl++ = txdr_unsigned(*iomode); *tl = txdr_unsigned(len); - nfsm_uiombuf(nd, uiop, len); + error = nfsm_uiombuf(nd, uiop, len); + if (error != 0) { + m_freem(nd->nd_mreq); + return (error); + } nrp = dsp->nfsclds_sockp; if (nrp == NULL) /* If NULL, use the MDS socket. */ @@ -8701,7 +8714,11 @@ nfsrpc_setextattr(vnode_t vp, const char *name, struct uio *uiop, nfsm_strtom(nd, name, strlen(name)); NFSM_BUILD(tl, uint32_t *, NFSX_UNSIGNED); *tl = txdr_unsigned(uiop->uio_resid); - nfsm_uiombuf(nd, uiop, uiop->uio_resid); + error = nfsm_uiombuf(nd, uiop, uiop->uio_resid); + if (error != 0) { + m_freem(nd->nd_mreq); + return (error); + } NFSM_BUILD(tl, uint32_t *, NFSX_UNSIGNED); *tl = txdr_unsigned(NFSV4OP_GETATTR); NFSGETATTR_ATTRBIT(&attrbits); diff --git a/sys/fs/nfsclient/nfs_clvnops.c b/sys/fs/nfsclient/nfs_clvnops.c index 02449e64e508..642963694a0a 100644 --- a/sys/fs/nfsclient/nfs_clvnops.c +++ b/sys/fs/nfsclient/nfs_clvnops.c @@ -1581,7 +1581,7 @@ ncl_readrpc(struct vnode *vp, struct uio *uiop, struct ucred *cred) error = nfscl_doiods(vp, uiop, NULL, NULL, NFSV4OPEN_ACCESSREAD, 0, cred, uiop->uio_td); NFSCL_DEBUG(4, "readrpc: aft doiods=%d\n", error); - if (error != 0) + if (error != 0 && error != EFAULT) error = nfsrpc_read(vp, uiop, cred, uiop->uio_td, &nfsva, &attrflag, NULL); if (attrflag) { @@ -1612,7 +1612,7 @@ ncl_writerpc(struct vnode *vp, struct uio *uiop, struct ucred *cred, error = nfscl_doiods(vp, uiop, iomode, must_commit, NFSV4OPEN_ACCESSWRITE, 0, cred, uiop->uio_td); NFSCL_DEBUG(4, "writerpc: aft doiods=%d\n", error); - if (error != 0) + if (error != 0 && error != EFAULT) error = nfsrpc_write(vp, uiop, iomode, must_commit, cred, uiop->uio_td, &nfsva, &attrflag, called_from_strategy, ioflag); From nobody Tue Dec 12 19:17:36 2023 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 4SqT002zLyz54KYr; Tue, 12 Dec 2023 19:17:36 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SqT002Y0Bz3b2j; Tue, 12 Dec 2023 19:17:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702408656; 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=VB8j/KWsnpeiZGbvXyyXIl/RbyJy+0QK0pxAY3i0xXg=; b=bDR1wDP3gRcQQvPa2wPbtroyEIvg2AsBDwKzWGmwGz5LAD4SWPNCKJX8efL6EJRSyONVZn 7s1HhnfczgUlrKgUMoLGN8Ctc6jB+O3FgAW7sQg84a68xdWchQiE48As3nYfmkGoSsgD4/ uJDvBaDqveph3fpvlSofsLm7k3PLv9d28zzM4wqArBSwTGDKU85nOeIHuZT0Vn6YUgK+Y9 rAd6wQzWtkBPXjygK3CTJ8roNw1sLLau84Gc2lBR5TVTwF9Gr6lu6gkBlRuFskJQxc1k6F mJ9vGMzAhRkn8zjDO2+jEnm1PW9IqTOVV69Nt45wcjtmCVzMlCXRmIMoGvIi5w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702408656; a=rsa-sha256; cv=none; b=GSPj3yKNpUtRf/OWV2pweg3HYhrKcHnRdRmkixvoeALE4uQHD/RJYd6f9hqQL8Ae+ZOqRs 3Z082Tkr5tUMWLf+EqvB3Vcax1W44IrrBeOtSmnGoY4Z1pHdtelmxf5FQDPkvED4LzArHm WGlFSFsZ+rRb8U2C7JeeoCHBRCkhpjBYjj+YLLHOSRA/on3WUeKDIZmKZm36d+UjDUO22D sJZYWnPumruk8UCATXIcJdGVfuPX4ADGjdy7q8ZaB6RKhJZM2Rk6jHqNiYsWmKYB3Ny6ZQ zuwXMmbrtSUCuNeMDCASllvtOoBxnhSRMGe/p+0v4lpPvE9U06OrSP+1LdsFXA== 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=1702408656; 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=VB8j/KWsnpeiZGbvXyyXIl/RbyJy+0QK0pxAY3i0xXg=; b=E2wuHSRMr9auUANSAc04jOluiNRH28vsDV0aYO1Co4QBXjGHLU8qlgGoti0y5QeuahDhfj SLWayzkN0LxzcysnK7NYbAgBjAHJYBcFimaUm7VjDLQgy8KueW36nlfpvGs0+ZQQm3cI+E USVuK8Ez+T7WrDl8Yue83DwpOGJ6ofmn6AIGenfoCCmoVFvu7xUTwLkToQCpUEmKlHvfqx JVHysM80Wird3io9PO01c81EL5/G7lzr0fh6dqngn6vqcQTrciBXnDquq1DHP9rvI4741u C6ulXw6kGugI3Au3+b1Qi3Z7iqSHv8igjHYCAboxZiwY6wHQAnLug/yIA3LiFg== 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 4SqT001bQDzCZl; Tue, 12 Dec 2023 19:17:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BCJHaFf087918; Tue, 12 Dec 2023 19:17:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BCJHaRY087915; Tue, 12 Dec 2023 19:17:36 GMT (envelope-from git) Date: Tue, 12 Dec 2023 19:17:36 GMT Message-Id: <202312121917.3BCJHaRY087915@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: ab60666a00c9 - releng/14.0 - nfsclient: Propagate copyin() errors from nfsm_uiombuf() 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.0 X-Git-Reftype: branch X-Git-Commit: ab60666a00c9af196f2c1e3532dbedc1e8cf3687 Auto-Submitted: auto-generated The branch releng/14.0 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=ab60666a00c9af196f2c1e3532dbedc1e8cf3687 commit ab60666a00c9af196f2c1e3532dbedc1e8cf3687 Author: Mark Johnston AuthorDate: 2023-12-12 01:04:56 +0000 Commit: Mark Johnston CommitDate: 2023-12-12 19:14:05 +0000 nfsclient: Propagate copyin() errors from nfsm_uiombuf() Approved by: so Security: SA-23:18.nfsclient Reviewed by: rmacklem Sponsored by: The FreeBSD Foundation (cherry picked from commit 6fa843f6e647a1a1e0e42af1e7abc9e903699f31) (cherry picked from commit 8d42f85d9d7b5394edbe6f18c1e96c0d35d49b3c) --- sys/fs/nfs/nfs_var.h | 2 +- sys/fs/nfsclient/nfs_clcomsubs.c | 23 ++++++++++++++++------- sys/fs/nfsclient/nfs_clrpcops.c | 23 ++++++++++++++++++++--- sys/fs/nfsclient/nfs_clvnops.c | 4 ++-- 4 files changed, 39 insertions(+), 13 deletions(-) diff --git a/sys/fs/nfs/nfs_var.h b/sys/fs/nfs/nfs_var.h index 133850dcde0e..578fb3ce1340 100644 --- a/sys/fs/nfs/nfs_var.h +++ b/sys/fs/nfs/nfs_var.h @@ -370,7 +370,7 @@ int nfsrpc_destroysession(struct nfsmount *, struct nfsclsession *, struct ucred *, NFSPROC_T *); /* nfs_clcomsubs.c */ -void nfsm_uiombuf(struct nfsrv_descript *, struct uio *, int); +int nfsm_uiombuf(struct nfsrv_descript *, struct uio *, int); struct mbuf *nfsm_uiombuflist(struct uio *, int, u_int); u_int8_t *nfscl_getmyip(struct nfsmount *, struct in6_addr *, int *); int nfsm_getfh(struct nfsrv_descript *, struct nfsfh **); diff --git a/sys/fs/nfsclient/nfs_clcomsubs.c b/sys/fs/nfsclient/nfs_clcomsubs.c index 7912ab56140f..270f39d03c90 100644 --- a/sys/fs/nfsclient/nfs_clcomsubs.c +++ b/sys/fs/nfsclient/nfs_clcomsubs.c @@ -51,12 +51,12 @@ NFSCLSTATEMUTEX; * copies a uio scatter/gather list to an mbuf chain. * NOTE: can only handle iovcnt == 1 */ -void +int nfsm_uiombuf(struct nfsrv_descript *nd, struct uio *uiop, int siz) { char *uiocp; struct mbuf *mp, *mp2; - int xfer, left, mlen; + int error, xfer, left, mlen; int uiosiz, clflg, rem; char *mcp, *tcp; @@ -104,8 +104,11 @@ nfsm_uiombuf(struct nfsrv_descript *nd, struct uio *uiop, int siz) xfer = (left > mlen) ? mlen : left; if (uiop->uio_segflg == UIO_SYSSPACE) NFSBCOPY(uiocp, mcp, xfer); - else - copyin(uiocp, mcp, xfer); + else { + error = copyin(uiocp, mcp, xfer); + if (error != 0) + return (error); + } mp->m_len += xfer; left -= xfer; uiocp += xfer; @@ -148,6 +151,7 @@ nfsm_uiombuf(struct nfsrv_descript *nd, struct uio *uiop, int siz) } nd->nd_bpos = mcp; nd->nd_mb = mp; + return (0); } /* @@ -160,7 +164,7 @@ nfsm_uiombuflist(struct uio *uiop, int siz, u_int maxext) { char *uiocp; struct mbuf *mp, *mp2, *firstmp; - int extpg, extpgsiz = 0, i, left, mlen, rem, xfer; + int error, extpg, extpgsiz = 0, i, left, mlen, rem, xfer; int uiosiz, clflg; char *mcp, *tcp; @@ -218,8 +222,13 @@ nfsm_uiombuflist(struct uio *uiop, int siz, u_int maxext) xfer = (left > mlen) ? mlen : left; if (uiop->uio_segflg == UIO_SYSSPACE) NFSBCOPY(uiocp, mcp, xfer); - else - copyin(uiocp, mcp, xfer); + else { + error = copyin(uiocp, mcp, xfer); + if (error != 0) { + m_freem(firstmp); + return (NULL); + } + } mp->m_len += xfer; mcp += xfer; if (maxext > 0) { diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c index 8fe9158384a0..7f886ad286e7 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -2046,7 +2046,12 @@ nfsrpc_writerpc(vnode_t vp, struct uio *uiop, int *iomode, *tl++ = x; /* total to this offset */ *tl = x; /* size of this write */ } - nfsm_uiombuf(nd, uiop, len); + error = nfsm_uiombuf(nd, uiop, len); + if (error != 0) { + m_freem(nd->nd_mreq); + free(nd, M_TEMP); + return (error); + } /* * Although it is tempting to do a normal Getattr Op in the * NFSv4 compound, the result can be a nearly hung client @@ -6261,6 +6266,10 @@ nfscl_doiods(vnode_t vp, struct uio *uiop, int *iomode, int *must_commit, iovlen = uiop->uio_iov->iov_len; m = nfsm_uiombuflist(uiop, len, 0); + if (m == NULL) { + error = EFAULT; + break; + } } tdrpc = drpc = malloc(sizeof(*drpc) * (mirrorcnt - 1), M_TEMP, M_WAITOK | @@ -6833,7 +6842,11 @@ nfsrpc_writeds(vnode_t vp, struct uio *uiop, int *iomode, int *must_commit, *tl++ = txdr_unsigned(len); *tl++ = txdr_unsigned(*iomode); *tl = txdr_unsigned(len); - nfsm_uiombuf(nd, uiop, len); + error = nfsm_uiombuf(nd, uiop, len); + if (error != 0) { + m_freem(nd->nd_mreq); + return (error); + } nrp = dsp->nfsclds_sockp; if (nrp == NULL) /* If NULL, use the MDS socket. */ @@ -8918,7 +8931,11 @@ nfsrpc_setextattr(vnode_t vp, const char *name, struct uio *uiop, nfsm_strtom(nd, name, strlen(name)); NFSM_BUILD(tl, uint32_t *, NFSX_UNSIGNED); *tl = txdr_unsigned(uiop->uio_resid); - nfsm_uiombuf(nd, uiop, uiop->uio_resid); + error = nfsm_uiombuf(nd, uiop, uiop->uio_resid); + if (error != 0) { + m_freem(nd->nd_mreq); + return (error); + } NFSM_BUILD(tl, uint32_t *, NFSX_UNSIGNED); *tl = txdr_unsigned(NFSV4OP_GETATTR); NFSGETATTR_ATTRBIT(&attrbits); diff --git a/sys/fs/nfsclient/nfs_clvnops.c b/sys/fs/nfsclient/nfs_clvnops.c index 383d45ba260b..0bfbbf3b07d9 100644 --- a/sys/fs/nfsclient/nfs_clvnops.c +++ b/sys/fs/nfsclient/nfs_clvnops.c @@ -1587,7 +1587,7 @@ ncl_readrpc(struct vnode *vp, struct uio *uiop, struct ucred *cred) error = nfscl_doiods(vp, uiop, NULL, NULL, NFSV4OPEN_ACCESSREAD, 0, cred, uiop->uio_td); NFSCL_DEBUG(4, "readrpc: aft doiods=%d\n", error); - if (error != 0) + if (error != 0 && error != EFAULT) error = nfsrpc_read(vp, uiop, cred, uiop->uio_td, &nfsva, &attrflag); if (attrflag) { @@ -1618,7 +1618,7 @@ ncl_writerpc(struct vnode *vp, struct uio *uiop, struct ucred *cred, error = nfscl_doiods(vp, uiop, iomode, must_commit, NFSV4OPEN_ACCESSWRITE, 0, cred, uiop->uio_td); NFSCL_DEBUG(4, "writerpc: aft doiods=%d\n", error); - if (error != 0) + if (error != 0 && error != EFAULT) error = nfsrpc_write(vp, uiop, iomode, must_commit, cred, uiop->uio_td, &nfsva, &attrflag, called_from_strategy, ioflag); From nobody Tue Dec 12 19:17:37 2023 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 4SqT016nkFz54KYs; Tue, 12 Dec 2023 19:17:37 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SqT013W81z3Zx6; Tue, 12 Dec 2023 19:17:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702408657; 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=r9iWFmsWByAxBZgrwOp/B4lM76GBR0qMT26QstBRX8w=; b=c8eQH5ZPxMcH+Gl5ADq2jziEeFSXOcwQCz4V4Q3RDTcvSjrfpNGwpxHoXi55cE4IckaGvg GHrO8dTko4d9m9nTInm2inZeTjyXG1s1es9E2+alfA5tVkUHnOBx+7Zr/sKKj5CsjOGmIv Tb1VAQl2IXbSyzTObYCojMqb/tNZH6gE5eDU7hR4TJl+YhjOYscto7YFurKjeesN4HfHpc i3l850A4NuSQ91EZSkGofx4T2N5CJusrA/U9eVHUlBiqxJzvHykrVQUPj2naGId7/ZNAjM 3LFUbdsXyzqN0FbiC1zkc15RTHZaY0rEWwYqec/mR8BOmJRbQ1ScekCdmlLvOw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702408657; a=rsa-sha256; cv=none; b=ynCwpcir1ZjzDYwQIEdhaz2IwFGcJ6+pFZrTvXm3uz8XrqSRJOiyu8zbt/aAWmEqfHpRbI BbmsZlH0CpqNDXZkrIr3vMVx27UwA7XZZMdWAVBH1GO2F1RyP7KHoGw3pe6PMEF73KHRyk qoNQM+nte8A7OwthUdJDksD/smopVzl/2gDPJRum8HTSRBZBbSrnhoUee4IHmiX3ywT06J 7kk7O+9jFTonxxXSAk5JRyn8AO5eT+7wkYpgZjV9B2QWXvfLNGnE/oQooIH4YXMJU46ewK yeMinFq0o6djInBtz3VNK7/6HGi1ES07J4w3oN6Zwj/0vXuLemZK3RRnhncZ3A== 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=1702408657; 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=r9iWFmsWByAxBZgrwOp/B4lM76GBR0qMT26QstBRX8w=; b=o1bbM4Rt+Bl/Cd86gW2JPQkqMf3ja7gUka6llbXRIwBRpjJjehIPNMe00PDxj8krTeMx/T HthkcOotQFr8CJvpZ3vSspJ752yNzb782TdtEq3ymHfLLmgOX06K//iLZa6QBCvZX2c9Y2 8LpajGsAJc9ibLQF3Wqc9cWn2DVIkc+hNcMkBnbtFUjuCNhfRWgogpvqzUGhhTxKIrpFwb fmdLGxhqrTv7VS8w+nL3AKqwHfBt12RXeGx9l7rqziPDkqRbz9cQxKgS3PYSLs7uRm8/Z0 7EJwxEDmHH61pa198LFkQM8J3utHe7yoQJ4Lhttg76Lg0YgvvjsDiO32ft85Vg== 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 4SqT012cK2zC7p; Tue, 12 Dec 2023 19:17:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BCJHbuN087974; Tue, 12 Dec 2023 19:17:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BCJHb4Y087971; Tue, 12 Dec 2023 19:17:37 GMT (envelope-from git) Date: Tue, 12 Dec 2023 19:17:37 GMT Message-Id: <202312121917.3BCJHb4Y087971@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 20fae1e16990 - releng/14.0 - Add an UPDATING entry and bump the branch version 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.0 X-Git-Reftype: branch X-Git-Commit: 20fae1e1699021d4f277819f7b32bf1178a1a991 Auto-Submitted: auto-generated The branch releng/14.0 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=20fae1e1699021d4f277819f7b32bf1178a1a991 commit 20fae1e1699021d4f277819f7b32bf1178a1a991 Author: Mark Johnston AuthorDate: 2023-12-12 19:15:09 +0000 Commit: Mark Johnston CommitDate: 2023-12-12 19:15:09 +0000 Add an UPDATING entry and bump the branch version Approved by: so --- UPDATING | 5 +++++ sys/conf/newvers.sh | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/UPDATING b/UPDATING index 0af118a3f624..673957975366 100644 --- a/UPDATING +++ b/UPDATING @@ -12,6 +12,11 @@ Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before updating system packages and/or ports. +20231212: + 14.0-RELEASE-p3 SA-23:18.nfsclient + + NFS client data corruption and kernel memory disclosure [SA-23:18.nfsclient] + 20231205: 14.0-RELEASE-p2 SA-23:17.pf EN-23:17.ossl diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index d78502b8c4a5..c1d998125dfe 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -53,7 +53,7 @@ TYPE="FreeBSD" REVISION="14.0" -BRANCH="RELEASE-p2" +BRANCH="RELEASE-p3" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From nobody Tue Dec 12 19:18:17 2023 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 4SqT0p1T5Bz54KcZ; Tue, 12 Dec 2023 19:18:18 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SqT0p0xyNz3bPB; Tue, 12 Dec 2023 19:18:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702408698; 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=FAPp3tyGvqvu2k10PNw72pLOLMsvFvHPqdsz2tPOWmk=; b=ZmEWE4U6Vt+6QuMLos/5ou4QqDkpqdO22rBH58QlmaSbjzmfzA7nJZF4Bfz298Ff3TqCiB wOkIsg7qmw28wWraqkSs+NekB0tsDsOL4h8P3EKSHA9LRVUfRzOcLQjiQgBWIAKDWGMEWy Dd5b0+nkLfpJ/HglBzt2qttueITiit5/vspcMxvc5eU75Zn7ayU9SNX6Ph1AJZ+lYmbCOl 5b7Cu6UQTOA10C2986XHECSpxLWHannkBFHFMAfyhmONYIrGwJG71SV9G2d7wZCYqsZFeX ZZoMLglyAysbS2e0DA/YB+V5OjVNsE88YO6Bo/l4/RjsvUoxkzM/ag0WfFWlWA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702408698; a=rsa-sha256; cv=none; b=Msp9KOfPnIw8fclkRQkAqPYI6nvakheVQOZsN0kP1j7BeTfKDFLXxJ3jAtwfecPZ03RlL/ ODoOsg1fA/stXteLSR6wRNnm+7I1KmfECsK5I3X3KyUCSh6d963kFN3+2QiPNRULDDiDQY OVlS+AhqAB3Nu1y7+eor7Hyi2JgwjZLA4EE+iBcDj+jH0778uZY1djx3OLizxw8h2mU8rr wSSFqxm/vKxxyIMEvaPFly6eAz7QSCkl3jVNhk+9PvBxarX75xVddxDpwaxPsgkHrwnqG4 25glRjADuCT+1xqnTnZeHT+zvL4HwoQrOVhNXBl1Spuvt5Up/f1AWyQHZNiO+A== 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=1702408698; 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=FAPp3tyGvqvu2k10PNw72pLOLMsvFvHPqdsz2tPOWmk=; b=oQgSQV8ktKJMr2lfhqvBqNCCMD9xpf5QEN8wkZAp5dEWCVRh3Xizzip/9BGehG2apVO5ph PdYmwlO3yQZ7JADjDq7TUWH6hHW+NxQ9coaQFjwAfYwBxwAfRIQ4t1aErcEF89soIdrdD7 Pe0ty/aroPOmrtL+fSpxq5KDjgbS16AkHZkkx53KzCytMx2nltGtqlj+0odgxRRK1wCf11 xUINUVqO1GuCXuDXl4VmTc9nh5ki+TamTjrX3n6iEw38FoBOUbJwKwfw25DaPP9r8x2qAi W0oQf4qgpewVipi8c6G/arS9C2NHyl+VWtHwaR1qGYimPOkDkpHee0g1WctC2A== 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 4SqT0p01rhzBqx; Tue, 12 Dec 2023 19:18:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BCJIHfJ088228; Tue, 12 Dec 2023 19:18:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BCJIH67088224; Tue, 12 Dec 2023 19:18:17 GMT (envelope-from git) Date: Tue, 12 Dec 2023 19:18:17 GMT Message-Id: <202312121918.3BCJIH67088224@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 3f079b3f2f33 - releng/13.2 - nfsclient: Propagate copyin() errors from nfsm_uiombuf() 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: 3f079b3f2f3371ae1c2a11d00a8ddfe183f4ecba Auto-Submitted: auto-generated The branch releng/13.2 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=3f079b3f2f3371ae1c2a11d00a8ddfe183f4ecba commit 3f079b3f2f3371ae1c2a11d00a8ddfe183f4ecba Author: Mark Johnston AuthorDate: 2023-12-12 01:04:56 +0000 Commit: Mark Johnston CommitDate: 2023-12-12 19:15:39 +0000 nfsclient: Propagate copyin() errors from nfsm_uiombuf() Approved by: so Security: SA-23:18.nfsclient Reviewed by: rmacklem Sponsored by: The FreeBSD Foundation (cherry picked from commit 6fa843f6e647a1a1e0e42af1e7abc9e903699f31) (cherry picked from commit f1d1d50e1d089f0bfcd38e5f08b1e8bf5a1d64c3) --- sys/fs/nfs/nfs_var.h | 2 +- sys/fs/nfsclient/nfs_clcomsubs.c | 23 ++++++++++++++++------- sys/fs/nfsclient/nfs_clrpcops.c | 23 ++++++++++++++++++++--- sys/fs/nfsclient/nfs_clvnops.c | 4 ++-- 4 files changed, 39 insertions(+), 13 deletions(-) diff --git a/sys/fs/nfs/nfs_var.h b/sys/fs/nfs/nfs_var.h index 9dd3be3d5c42..ac0c75b8d3f4 100644 --- a/sys/fs/nfs/nfs_var.h +++ b/sys/fs/nfs/nfs_var.h @@ -368,7 +368,7 @@ int nfsrpc_destroysession(struct nfsmount *, struct nfsclsession *, struct ucred *, NFSPROC_T *); /* nfs_clcomsubs.c */ -void nfsm_uiombuf(struct nfsrv_descript *, struct uio *, int); +int nfsm_uiombuf(struct nfsrv_descript *, struct uio *, int); struct mbuf *nfsm_uiombuflist(struct uio *, int, u_int); u_int8_t *nfscl_getmyip(struct nfsmount *, struct in6_addr *, int *); int nfsm_getfh(struct nfsrv_descript *, struct nfsfh **); diff --git a/sys/fs/nfsclient/nfs_clcomsubs.c b/sys/fs/nfsclient/nfs_clcomsubs.c index 640d47fed93d..7aa7e3f84479 100644 --- a/sys/fs/nfsclient/nfs_clcomsubs.c +++ b/sys/fs/nfsclient/nfs_clcomsubs.c @@ -53,12 +53,12 @@ NFSCLSTATEMUTEX; * copies a uio scatter/gather list to an mbuf chain. * NOTE: can only handle iovcnt == 1 */ -void +int nfsm_uiombuf(struct nfsrv_descript *nd, struct uio *uiop, int siz) { char *uiocp; struct mbuf *mp, *mp2; - int xfer, left, mlen; + int error, xfer, left, mlen; int uiosiz, clflg, rem; char *mcp, *tcp; @@ -106,8 +106,11 @@ nfsm_uiombuf(struct nfsrv_descript *nd, struct uio *uiop, int siz) xfer = (left > mlen) ? mlen : left; if (uiop->uio_segflg == UIO_SYSSPACE) NFSBCOPY(uiocp, mcp, xfer); - else - copyin(uiocp, mcp, xfer); + else { + error = copyin(uiocp, mcp, xfer); + if (error != 0) + return (error); + } mp->m_len += xfer; left -= xfer; uiocp += xfer; @@ -150,6 +153,7 @@ nfsm_uiombuf(struct nfsrv_descript *nd, struct uio *uiop, int siz) } nd->nd_bpos = mcp; nd->nd_mb = mp; + return (0); } /* @@ -162,7 +166,7 @@ nfsm_uiombuflist(struct uio *uiop, int siz, u_int maxext) { char *uiocp; struct mbuf *mp, *mp2, *firstmp; - int extpg, extpgsiz = 0, i, left, mlen, rem, xfer; + int error, extpg, extpgsiz = 0, i, left, mlen, rem, xfer; int uiosiz, clflg; char *mcp, *tcp; @@ -220,8 +224,13 @@ nfsm_uiombuflist(struct uio *uiop, int siz, u_int maxext) xfer = (left > mlen) ? mlen : left; if (uiop->uio_segflg == UIO_SYSSPACE) NFSBCOPY(uiocp, mcp, xfer); - else - copyin(uiocp, mcp, xfer); + else { + error = copyin(uiocp, mcp, xfer); + if (error != 0) { + m_freem(firstmp); + return (NULL); + } + } mp->m_len += xfer; mcp += xfer; if (maxext > 0) { diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c index 51c7bb25d357..854fad6c56c7 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -1890,7 +1890,12 @@ nfsrpc_writerpc(vnode_t vp, struct uio *uiop, int *iomode, *tl++ = x; /* total to this offset */ *tl = x; /* size of this write */ } - nfsm_uiombuf(nd, uiop, len); + error = nfsm_uiombuf(nd, uiop, len); + if (error != 0) { + m_freem(nd->nd_mreq); + free(nd, M_TEMP); + return (error); + } /* * Although it is tempting to do a normal Getattr Op in the * NFSv4 compound, the result can be a nearly hung client @@ -5981,6 +5986,10 @@ nfscl_doiods(vnode_t vp, struct uio *uiop, int *iomode, int *must_commit, iovlen = uiop->uio_iov->iov_len; m = nfsm_uiombuflist(uiop, len, 0); + if (m == NULL) { + error = EFAULT; + break; + } } tdrpc = drpc = malloc(sizeof(*drpc) * (mirrorcnt - 1), M_TEMP, M_WAITOK | @@ -6553,7 +6562,11 @@ nfsrpc_writeds(vnode_t vp, struct uio *uiop, int *iomode, int *must_commit, *tl++ = txdr_unsigned(len); *tl++ = txdr_unsigned(*iomode); *tl = txdr_unsigned(len); - nfsm_uiombuf(nd, uiop, len); + error = nfsm_uiombuf(nd, uiop, len); + if (error != 0) { + m_freem(nd->nd_mreq); + return (error); + } nrp = dsp->nfsclds_sockp; if (nrp == NULL) /* If NULL, use the MDS socket. */ @@ -8639,7 +8652,11 @@ nfsrpc_setextattr(vnode_t vp, const char *name, struct uio *uiop, nfsm_strtom(nd, name, strlen(name)); NFSM_BUILD(tl, uint32_t *, NFSX_UNSIGNED); *tl = txdr_unsigned(uiop->uio_resid); - nfsm_uiombuf(nd, uiop, uiop->uio_resid); + error = nfsm_uiombuf(nd, uiop, uiop->uio_resid); + if (error != 0) { + m_freem(nd->nd_mreq); + return (error); + } NFSM_BUILD(tl, uint32_t *, NFSX_UNSIGNED); *tl = txdr_unsigned(NFSV4OP_GETATTR); NFSGETATTR_ATTRBIT(&attrbits); diff --git a/sys/fs/nfsclient/nfs_clvnops.c b/sys/fs/nfsclient/nfs_clvnops.c index 02e5e3540d72..4fb76fce088e 100644 --- a/sys/fs/nfsclient/nfs_clvnops.c +++ b/sys/fs/nfsclient/nfs_clvnops.c @@ -1579,7 +1579,7 @@ ncl_readrpc(struct vnode *vp, struct uio *uiop, struct ucred *cred) error = nfscl_doiods(vp, uiop, NULL, NULL, NFSV4OPEN_ACCESSREAD, 0, cred, uiop->uio_td); NFSCL_DEBUG(4, "readrpc: aft doiods=%d\n", error); - if (error != 0) + if (error != 0 && error != EFAULT) error = nfsrpc_read(vp, uiop, cred, uiop->uio_td, &nfsva, &attrflag, NULL); if (attrflag) { @@ -1610,7 +1610,7 @@ ncl_writerpc(struct vnode *vp, struct uio *uiop, struct ucred *cred, error = nfscl_doiods(vp, uiop, iomode, must_commit, NFSV4OPEN_ACCESSWRITE, 0, cred, uiop->uio_td); NFSCL_DEBUG(4, "writerpc: aft doiods=%d\n", error); - if (error != 0) + if (error != 0 && error != EFAULT) error = nfsrpc_write(vp, uiop, iomode, must_commit, cred, uiop->uio_td, &nfsva, &attrflag, called_from_strategy, ioflag); From nobody Tue Dec 12 19:18:19 2023 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 4SqT0q3bzTz54KYy; Tue, 12 Dec 2023 19:18:19 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SqT0q38Fnz3bV9; Tue, 12 Dec 2023 19:18:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702408699; 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=X/6CJwiHS7I4KpMaBjaung0bzAXLnguf4u4H+5zBGkc=; b=oSUGFHRWXgzr+3Knxc54mZEYHDJuLa+qH/olp8OkatH79Cuy4Uj/CJVixCrb8yJ2iqaZar nx+QXLhu/fgjzALNNpwcHNoC5hnE4tgJ5tZe9+Cj01kz6N2ulydmcQfcSgudX0dJ0UBPla eV7OMl6Y6uEj4POlzB98bSEXCW95IOh4YQTjYPLThNj7KEpsJ69QYldSaV7+8rhWpUY01x ZBGD6UOz85iC5XxDBeYlKGRmHDRcFwpudu4OMf/UKcrAspDxXr32BWSxIZv/B3B1TvRFCU B+5bLMSEdIi54C2HoUNb26hx2C1E0NOhfybDPBzopHZKc/8pnF5eNVOzX9jfBw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702408699; a=rsa-sha256; cv=none; b=tpBh5YKsrTgY161cFQdl1apSoVKa1r+NoYA5gWWOGGc1PPLcb3WVfs8ICtJhQgMwm2gmQD rKNAvFY65LthaYw0t3y9CycvgBJSecSgZlgI/TXWcA2AoH42Cac2Vda48YBWWwZZlIPEb5 IlLBhPycbXaePJu3L5lOX1uFQnyFmZmg3TSzZFtKCLbGQWH2kAmDYxB+poVP1ilHh40dOD TydgU4brWBKS9MN/VYuQAA1KX+Qg6LiBy3TuxK968SRItD0EwGhcXiT3OPP1GyNTqA0s9c tAuGuxXVjsGT5pQBdnyIIgbw62CLY/rw3Oyiq8iRdcr1K8CB1Ggt3kMEFCkL3A== 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=1702408699; 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=X/6CJwiHS7I4KpMaBjaung0bzAXLnguf4u4H+5zBGkc=; b=GlZz+twvSOH1TEcAL/ELy4JyEswIi4vCnFNN5Tv+XYKqwYltGyCsqZdKLGMxtRlw7otXI0 eFsZmmlQOxpDG1PnTtsAczoHpqivKra2NoX3osNRA0lzNfJehrvrOPPZXiO6K+2E29BNTk ELFWxTU6tLwlGo3xhNWsmpUeKW9vJIW5jjbEQH7ikfVwqKIdtP1SRmgF0ORQ1D2POzWm7i HGrosF851TrWsTBRPrbGky7iVD/B6xqlqE92+oa2jUAFa0/LoQ9w5cvHfn7qg/4uwmC375 SKO0Ozu/IyoatGbA/1YKi0GCcg+7Q6c3nl4g9G2kqxOMaBE1DEqHnaYj0+b88w== 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 4SqT0q1xS2zCZm; Tue, 12 Dec 2023 19:18:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BCJIJ5E088289; Tue, 12 Dec 2023 19:18:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BCJIJjQ088286; Tue, 12 Dec 2023 19:18:19 GMT (envelope-from git) Date: Tue, 12 Dec 2023 19:18:19 GMT Message-Id: <202312121918.3BCJIJjQ088286@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: eb1c4ee0180f - releng/13.2 - Add UPDATING entries and bump the branch version 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: eb1c4ee0180f673a3b82fc6e763294f0e0173cd2 Auto-Submitted: auto-generated The branch releng/13.2 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=eb1c4ee0180f673a3b82fc6e763294f0e0173cd2 commit eb1c4ee0180f673a3b82fc6e763294f0e0173cd2 Author: Mark Johnston AuthorDate: 2023-12-12 19:16:35 +0000 Commit: Mark Johnston CommitDate: 2023-12-12 19:16:35 +0000 Add UPDATING entries and bump the branch version Approved by: so --- UPDATING | 5 +++++ sys/conf/newvers.sh | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/UPDATING b/UPDATING index d03d434a87d8..8ed94c3a241d 100644 --- a/UPDATING +++ b/UPDATING @@ -12,6 +12,11 @@ Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before updating system packages and/or ports. +20231212: + 13.2-RELEASE-p8 SA-23:18.nfsclient + + NFS client data corruption and kernel memory disclosure [SA-23:18.nfsclient] + 20231205: 13.2-RELEASE-p7 SA-23:17.pf EN-23:15.sanitizer diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index 627c99e8b973..fb24da9b4dac 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -54,7 +54,7 @@ TYPE="FreeBSD" REVISION="13.2" -BRANCH="RELEASE-p7" +BRANCH="RELEASE-p8" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From nobody Wed Dec 13 20:06:14 2023 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 4Sr61f5Hgzz54FkD; Wed, 13 Dec 2023 20:06: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sr61f4lBMz4YVK; Wed, 13 Dec 2023 20:06:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702497974; 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=Bll2/SAr0fw55QlCNNxXZpMZWWf44zyxDyuYdzot3nw=; b=ewcoN4ug1CVF/qyO4+XTDlzGzpTv1HEN4QqZBEswIZIGSa8o0Ebqs0Sn4RuQgDDWH++8Cm sT5F3lDMWYjNW8jlqPvvxVJvtxy1kDG9Mzk1+3m1dKoYHl+b1fh55XHiDBlozsi2kg7KqC Rj75/W3HVxiILk1qaG222O/JckmBcUBWvzHreHEcMo7VDBgipAHlYC42k5PQj1kTYJo3Tv /yUDknc/JPSHMFMXY4+prfJqzimMm9EZr45KfPGzeJKLeoMHLbjXsw5YioJMKhgZiKUxBY Q/SiEOeAGKyiRqqTap05hjkeIFxci6JhIDX1gyyWsC5eukRj9fqXuOf7qYBPdQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702497974; a=rsa-sha256; cv=none; b=RH9Pr4jG/udGvE/1BrnpKUU6/zfwF49ts7psmqso3B2Lwn4QZl7ANxxqO6smTXoafP4pE8 7+QpFuiYA+z2zdY4d25KboKahrSAHGfIyuNdbw29pW2g95WUn1VIeXp3qAH/fwXk/n3HGK Bis5qxyRshQDGoOSJmYxeEyHBj0aePZaY8o+EaGPhHH50WKVP7cMT71MzJW1glNd5gBfwn He+SldCfJXrfxdLklggYL8ZON2uFrFyoAXKaiGCEsBw7xl3/XbYD4PMuF7W2WpshJf5hxS KDlNgVr4NWMc3EnCBFH3wP4NBsy8mOTdFA5FW/Xx37Fn2NCjl84ODocgny06Cg== 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=1702497974; 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=Bll2/SAr0fw55QlCNNxXZpMZWWf44zyxDyuYdzot3nw=; b=txMtlLHIRp0oJT6Y27ZU9SSXQXqeUG2NRq7+8ms6OygvmlQS50oZTgzoLp5GlYxTemwOPL f5etBasdX2Af/2JveOq0lbQOfUlQcqeue5Np3OWd9XKXXq+EY7mwlZ6y5t0TG8Zxng317+ 8bw+8OMJExySn6nHzbdWoklxeVQnMXjSAb/kXUgVsXl5uFl0suonuzwP/QzDI1jeGeaBMq vZE2K7pLTDP57wen0wwPVBXlPepMRD1tiDc3gp+L1dMc4xvvGuNHqJsFB4D047N+SDDNlh pjebxTvtThYTmGbD61B3EYehttpDhAt7SKiwUBuxYg9SSrsIqTXomOGgDuzQVA== 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 4Sr61f3dqNz1C0p; Wed, 13 Dec 2023 20:06:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BDK6EoB086713; Wed, 13 Dec 2023 20:06:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BDK6ERK086710; Wed, 13 Dec 2023 20:06:14 GMT (envelope-from git) Date: Wed, 13 Dec 2023 20:06:14 GMT Message-Id: <202312132006.3BDK6ERK086710@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 59fa6d8148e5 - stable/13 - taclib: 0 (not set) is a valid auth type in authorization requests. 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 59fa6d8148e5998fb95a4a4314492435959e3ddf Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=59fa6d8148e5998fb95a4a4314492435959e3ddf commit 59fa6d8148e5998fb95a4a4314492435959e3ddf Author: Dag-Erling Smørgrav AuthorDate: 2023-05-22 10:00:42 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-12-13 16:08:13 +0000 taclib: 0 (not set) is a valid auth type in authorization requests. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: rew Differential Revision: https://reviews.freebsd.org/D40132 (cherry picked from commit 951beab15d397942b5306aae292cd16564abe9f9) --- lib/libtacplus/taclib.h | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/libtacplus/taclib.h b/lib/libtacplus/taclib.h index ae5235e6a713..e0eb88fd7e10 100644 --- a/lib/libtacplus/taclib.h +++ b/lib/libtacplus/taclib.h @@ -58,6 +58,7 @@ struct tac_handle; #define TAC_AUTHEN_SENDAUTH 0x04 /* Authentication types */ +#define TAC_AUTHEN_TYPE_NOT_SET 0x00 #define TAC_AUTHEN_TYPE_ASCII 0x01 #define TAC_AUTHEN_TYPE_PAP 0x02 #define TAC_AUTHEN_TYPE_CHAP 0x03 From nobody Wed Dec 13 20:06:15 2023 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 4Sr61g5Qnfz54FLf; Wed, 13 Dec 2023 20:06:15 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sr61g4vJgz4YKc; Wed, 13 Dec 2023 20:06:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702497975; 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=OU+yZV42DG290VPQJws1IfD/R/XCs+Mp3wsNIDall9Q=; b=Z0ubPQC90/WBAEfBb5+sCWB0UPkTSMDp3Eg9hLkEnCHGdbXcezA1lg0RAuUk0ASdWEYsSx a7V8fHgxSE2JtFa0ZDAhQxN6Cnj42IIHpkJ3/ifkPl9LryYBPppcHNLr6JUytNPhrF1+6A GzdbMRiAkH/VTJsNPsq2fRcwX9I/8YiOuElSN6AHTiK5i66cSLzXBhAufyWCEWchjXnpfU mnbJ44kP5mSE4BuFlscx5FT/B6otjiAKfpEkjUn0Wg3HQAjs5wGUWjC7T1Hw3qL/unzEgt fyomsB5doP3IB9y51YAphGlRYkmod2NNi++YKOjqCbSya0atznomy/R8DI70CQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702497975; a=rsa-sha256; cv=none; b=ixwrPr2uyY6q0k1tFlaxtIKuA8lzVjBmz3hsYs96nUVpXqNp5tKh0bJyAau3DDffMWWf/S y96z+Hc/yRHxDmliUdjqBHXOphqSo2rjcRK+2LaOoNja43UxUsEg9gDQX4z50LDIZG8n2+ yL2cqwA3HW1XsntDayZ0Z6/RrcONGWNTiOK59PHmbpqLu1n/wr4ptJZO9VMMskN14X3ls6 q3i0BsFRCGcFWbnmo0ut81A6C8Q5WXaVgwggeOvlEyf4ARfaDpmiy6+6ogIQn/D61Db5aV GkBnlfcuyoJ0Uv6fzMJreLJr/P8BR7xLxdP+qERzo36hoQvvCEsA0tafiTlFkg== 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=1702497975; 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=OU+yZV42DG290VPQJws1IfD/R/XCs+Mp3wsNIDall9Q=; b=hXto+W3IlINt+2XeyuhiB4JEzUF+hGWr3c+EGq+G2YbKUsmzdZ52raZ81e1F+LokpGqIKy aIzJJUg2wzPmuL6SEzaGKMLRKs2ZRT9hso6uzdVjAGaNS+VngFObynAWB3jX3E+0ow2tvc yVd2tSGNVVwYDfL5yUlVBdLBbmZulXw8O2B4Vsv4SjV0yb44ikcNET2n0VfGNND6Was7Nr 2Ad9x0SRIpkWtSDiyBTJrI0sCiksUdmab9kpIe1sNdF6RPAMa0iUcgGr0ynz/OARX/cdBK 37SifWksXELNcIMdczjDF5ZIreklVzYtzhGZC5hRhlzbV5d7plfOlLwqBCmogQ== 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 4Sr61g40pbz1BXb; Wed, 13 Dec 2023 20:06:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BDK6Fls086761; Wed, 13 Dec 2023 20:06:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BDK6FkX086758; Wed, 13 Dec 2023 20:06:15 GMT (envelope-from git) Date: Wed, 13 Dec 2023 20:06:15 GMT Message-Id: <202312132006.3BDK6FkX086758@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 96fabd5cbc32 - stable/13 - Add nss_tacplus, a TACACS+ NSS module. 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 96fabd5cbc32e3ddbe6ce926ee96ffe75ccbb153 Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=96fabd5cbc32e3ddbe6ce926ee96ffe75ccbb153 commit 96fabd5cbc32e3ddbe6ce926ee96ffe75ccbb153 Author: Dag-Erling Smørgrav AuthorDate: 2023-05-22 10:00:48 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-12-13 16:08:13 +0000 Add nss_tacplus, a TACACS+ NSS module. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D40133 (cherry picked from commit 6c5cdba1bafe77428b7721e49cc2b944885ec71a) --- lib/Makefile | 4 +- lib/nss_tacplus/Makefile | 9 ++ lib/nss_tacplus/nss_tacplus.8 | 86 +++++++++++++ lib/nss_tacplus/nss_tacplus.c | 273 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 371 insertions(+), 1 deletion(-) diff --git a/lib/Makefile b/lib/Makefile index e5dd8bf1c550..49a57d619fb9 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -105,7 +105,8 @@ SUBDIR= ${SUBDIR_BOOTSTRAP} \ liby \ libz \ libzstd \ - ncurses + ncurses \ + nss_tacplus # Inter-library dependencies. When the makefile for a library contains LDADD # libraries, those libraries should be listed as build order dependencies here. @@ -141,6 +142,7 @@ SUBDIR_DEPEND_liblzma= libthr .if ${MK_OFED} != "no" SUBDIR_DEPEND_libpcap= ofed .endif +SUBDIR_DEPEND_nss_tacplus= libtacplus .if !defined(COMPAT_32BIT) SUBDIR+= flua diff --git a/lib/nss_tacplus/Makefile b/lib/nss_tacplus/Makefile new file mode 100644 index 000000000000..f39788cfbdea --- /dev/null +++ b/lib/nss_tacplus/Makefile @@ -0,0 +1,9 @@ +LIB= nss_tacplus +SRCS= ${LIB}.8 +SHLIB_MAJOR= 1 +SHLIB_NAME= ${LIB}.so.${SHLIB_MAJOR} +LIBADD= tacplus +MK_INSTALLIB= no +MAN= ${LIB}.8 + +.include diff --git a/lib/nss_tacplus/nss_tacplus.8 b/lib/nss_tacplus/nss_tacplus.8 new file mode 100644 index 000000000000..4aaff4b5dd3a --- /dev/null +++ b/lib/nss_tacplus/nss_tacplus.8 @@ -0,0 +1,86 @@ +.\"- +.\" Copyright (c) 2023 Klara, Inc. +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.Dd May 17, 2023 +.Dt NSS_TACPLUS 8 +.Os +.Sh NAME +.Nm nss_tacplus +.Nd TACACS+ nsswitch module +.Sh SYNOPSIS +.Ic passwd : files tacplus +.Sh DESCRIPTION +The +.Nm +module is a loadable NSS module which provides a minimal identity +service using a TACACS+ backend. +.Pp +Due to the limitations of the TACACS+ protocol, the functionality +provided by the +.Nm +module is very limited: it can look up a user by name, but not by uid, +and it cannot enumerate users. +.Pp +To look up a user, the +.Nm +module submits an authorization request with authentication method +.Dv TAC_PLUS_AUTHEN_METH_NOT_SET , +authentication type +.Dv TAC_PLUS_AUTHEN_TYPE_NOT_SET , +and authentication service +.Dv TAC_PLUS_AUTHEN_SVC_LOGIN , +for the +.Dq shell +service. +If the response status is either +.Dv TAC_PLUS_AUTHOR_STATUS_PASS_ADD +or +.Dv TAC_PLUS_AUTHOR_STATUS_PASS_REPL , +the user is considered to exist and the +.Nm +module fills out a +.Vt struct passwd +for it. +.Pp +The following attributes, if included in the response from the TACACS+ +server, are used to construct the response: +.Bl -tag -width GECOS +.It Va UID +Numeric user ID. +Must be between 0 and +.Dv UID_MAX . +Defaults to 65534. +.It Va GID +Numeric primary group ID. +Must be between 0 and +.Dv GID_MAX . +Defaults to 65534. +.It Va GECOS +Display name. +If not provided, the user name is used instead. +.It Va HOME +Home directory. +Defaults to +.Pa / . +.It Va SHELL +Shell. +Defaults to +.Pa /bin/sh . +.El +.Pp +Case is ignored when matching attribute names. +If an attribute is included multiple times, the last value takes +effect. +.Sh SEE ALSO +.Xr libtacplus 3 , +.Xr tacplus.conf 5 , +.Xr pam_tacplus 8 +.Sh HISTORY +.An -nosplit +The +.Nm +module and this manual page were written by +.An Dag-Erling Smørgrav Aq Mt des@FreeBSD.org +for Klara Systems. diff --git a/lib/nss_tacplus/nss_tacplus.c b/lib/nss_tacplus/nss_tacplus.c new file mode 100644 index 000000000000..a59332504bc0 --- /dev/null +++ b/lib/nss_tacplus/nss_tacplus.c @@ -0,0 +1,273 @@ +/*- + * Copyright (c) 2023 Klara, Inc. + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +extern int __isthreaded; + +#define DEF_UID 65534 +#define DEF_GID 65534 +#define DEF_DIR "/" +#define DEF_SHELL "/bin/sh" + +ns_mtab *nss_module_register(const char *, unsigned int *, + nss_module_unregister_fn *); + +static void +tacplus_error(struct tac_handle *h, const char *func) +{ + if (h == NULL) + syslog(LOG_ERR, "%s(): %m", func); + else + syslog(LOG_ERR, "%s(): %s", func, tac_strerror(h)); +} + +static pthread_key_t tacplus_key; + +static void +tacplus_fini(void *p) +{ + struct tac_handle **h = p; + + tac_close(*h); + free(h); +} + +static void +tacplus_keyinit(void) +{ + (void)pthread_key_create(&tacplus_key, tacplus_fini); +} + +static struct tac_handle * +tacplus_get_handle(void) +{ + static pthread_once_t keyinit = PTHREAD_ONCE_INIT; + static struct tac_handle *sth; + struct tac_handle **h = &sth; + int ret; + + if (__isthreaded && !pthread_main_np()) { + if ((ret = pthread_once(&keyinit, tacplus_keyinit)) != 0) + return (NULL); + if ((h = pthread_getspecific(tacplus_key)) == NULL) { + if ((h = calloc(1, sizeof(*h))) == NULL) + return (NULL); + if ((pthread_setspecific(tacplus_key, h)) != 0) { + free(h); + return (NULL); + } + } + } + if (*h == NULL) { + if ((*h = tac_open()) == NULL) { + tacplus_error(*h, "tac_open"); + return (NULL); + } + if (tac_config(*h, NULL) != 0) { + tacplus_error(*h, "tac_config"); + tac_close(*h); + *h = NULL; + return (NULL); + } + } + return (*h); +} + +static char * +tacplus_copystr(const char *str, char **buffer, size_t *bufsize) +{ + char *copy = *buffer; + size_t len = strlen(str) + 1; + + if (len > *bufsize) { + errno = ERANGE; + return (NULL); + } + memcpy(copy, str, len); + *buffer += len; + *bufsize -= len; + return (copy); +} + +static int +tacplus_getpwnam_r(const char *name, struct passwd *pwd, char *buffer, + size_t bufsize) +{ + struct tac_handle *h; + char *av, *key, *value, *end; + intmax_t num; + int i, ret; + + if ((h = tacplus_get_handle()) == NULL) + return (NS_UNAVAIL); + ret = tac_create_author(h, TAC_AUTHEN_METH_NOT_SET, + TAC_AUTHEN_TYPE_NOT_SET, TAC_AUTHEN_SVC_LOGIN); + if (ret < 0) { + tacplus_error(h, "tac_create_author"); + return (NS_TRYAGAIN); + } + if (tac_set_user(h, name) < 0) { + tacplus_error(h, "tac_set_user"); + return (NS_TRYAGAIN); + } + if (tac_set_av(h, 0, "service=shell") < 0) { + tacplus_error(h, "tac_set_av"); + return (NS_TRYAGAIN); + } + ret = tac_send_author(h); + switch (TAC_AUTHOR_STATUS(ret)) { + case TAC_AUTHOR_STATUS_PASS_ADD: + case TAC_AUTHOR_STATUS_PASS_REPL: + /* found */ + break; + case TAC_AUTHOR_STATUS_FAIL: + return (NS_NOTFOUND); + case TAC_AUTHOR_STATUS_ERROR: + return (NS_UNAVAIL); + default: + tacplus_error(h, "tac_send_author"); + return (NS_UNAVAIL); + } + memset(pwd, 0, sizeof(*pwd)); + + /* copy name */ + pwd->pw_name = tacplus_copystr(name, &buffer, &bufsize); + if (pwd->pw_name == NULL) + return (NS_RETURN); + + /* no password */ + pwd->pw_passwd = tacplus_copystr("*", &buffer, &bufsize); + if (2 > bufsize) + return (NS_RETURN); + + /* default uid and gid */ + pwd->pw_uid = DEF_UID; + pwd->pw_gid = DEF_GID; + + /* get attribute-value pairs from TACACS+ response */ + for (i = 0; i < TAC_AUTHEN_AV_COUNT(ret); i++) { + if ((av = tac_get_av(h, i)) == NULL) { + tacplus_error(h, "tac_get_av"); + return (NS_UNAVAIL); + } + key = av; + if ((value = strchr(av, '=')) == NULL) { + free(av); + return (NS_RETURN); + } + *value++ = '\0'; + if (strcasecmp(key, "uid") == 0) { + num = strtoimax(value, &end, 10); + if (end == value || *end != '\0' || + num < 0 || num > (intmax_t)UID_MAX) { + errno = EINVAL; + free(av); + return (NS_RETURN); + } + pwd->pw_uid = num; + } else if (strcasecmp(key, "gid") == 0) { + num = strtoimax(value, &end, 10); + if (end == value || *end != '\0' || + num < 0 || num > (intmax_t)GID_MAX) { + errno = EINVAL; + free(av); + return (NS_RETURN); + } + pwd->pw_gid = num; + } else if (strcasecmp(av, "gecos") == 0) { + pwd->pw_gecos = tacplus_copystr(value, &buffer, + &bufsize); + if (pwd->pw_gecos == NULL) { + free(av); + return (NS_RETURN); + } + } else if (strcasecmp(av, "home") == 0) { + pwd->pw_dir = tacplus_copystr(value, &buffer, + &bufsize); + if (pwd->pw_dir == NULL) { + free(av); + return (NS_RETURN); + } + } else if (strcasecmp(av, "shell") == 0) { + pwd->pw_shell = tacplus_copystr(value, &buffer, + &bufsize); + if (pwd->pw_shell == NULL) { + free(av); + return (NS_RETURN); + } + } + free(av); + } + + /* gecos equal to name if none was provided */ + if (pwd->pw_gecos == NULL) + pwd->pw_gecos = pwd->pw_name; + + /* default home directory if none was provided */ + if (pwd->pw_dir == NULL) + pwd->pw_dir = tacplus_copystr(DEF_DIR, &buffer, &bufsize); + if (pwd->pw_dir == NULL) + return (NS_RETURN); + + /* default shell if none was provided */ + if (pwd->pw_shell == NULL) + pwd->pw_shell = tacplus_copystr(DEF_SHELL, &buffer, &bufsize); + if (pwd->pw_shell == NULL) + return (NS_RETURN); + + /* done! */ + return (NS_SUCCESS); +} + +static int +nss_tacplus_getpwnam_r(void *retval, void *mdata __unused, va_list ap) +{ + char *name = va_arg(ap, char *); + struct passwd *pwd = va_arg(ap, struct passwd *); + char *buffer = va_arg(ap, char *); + size_t bufsize = va_arg(ap, size_t); + int *result = va_arg(ap, int *); + int ret; + + errno = 0; + ret = tacplus_getpwnam_r(name, pwd, buffer, bufsize); + if (ret == NS_SUCCESS) { + *(void **)retval = pwd; + *result = 0; + } else { + *(void **)retval = NULL; + *result = errno; + } + return (ret); +} + +ns_mtab * +nss_module_register(const char *name __unused, unsigned int *plen, + nss_module_unregister_fn *unreg) +{ + static ns_mtab mtab[] = { + { "passwd", "getpwnam_r", &nss_tacplus_getpwnam_r, NULL }, + }; + + *plen = nitems(mtab); + *unreg = NULL; + return (mtab); +} From nobody Wed Dec 13 20:06:16 2023 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 4Sr61h6dZ4z54FkK; Wed, 13 Dec 2023 20:06: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sr61h5x1sz4YYw; Wed, 13 Dec 2023 20:06:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702497976; 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=UTHveEvZLpNuJzBX7ufjYYh1F4obR6ATJrRihAmTSrE=; b=Yw1+vPjJIf93l0VZQEWCiRt0jmaBVtg5HU4YhzKGroeG25Ogp15g3ZLoVQ3UKlKwRhYOih G2TbKf3iv0OcC1jVEbiVZBuK9HpkFaWK/u5+7sR1nbkiOf7TTk8+19J7t/Y/TfLTwUmh40 s7c15ecWlTouH5Pvv8SgpuBAe1s4mhWasZRyaLWzbjZWcVAxSGqUg1D5eR3bS4R4aYlNgq Ba6jkqjh/2d28QJq4LK9VJZVPH1eKPliKUKPl0gYMfUqT2klLaxKHZ/2bQ2jKaDlat3FTr HAWd6t/PN2aYe6QdT3tfCqE/9IGwbIbRa5O+Svt8LZlbqmvqBz1jEgEJJeMY8w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702497976; a=rsa-sha256; cv=none; b=wkcdrfPlHeZmF+Pox4fhT1d4S/PfPDdc/traL2uUxfanPndYlvkRy4SmwfhtEdpVPNuJW3 vJ8laZkSEoPnJrom3SaWLpV2CiCkVqxSj2gjOZ4rg6tpjJJfb77sn2TbTep8tn07xHcFf8 zVb/zSvPlzEKjC9cXUyZZVLGdvX+qtdm3Ihf0FbwKw7MK2dQRl/tq3/5dvD5WXgJax8Y8r /ikRzuegI/XgZduw4QOvgDnNnc5odMmxQ36ZJrQYuKWFKLqHHKUlMiVJDv3uL3IrDLnDMu 59QeX7M995DimrsnWwbDR1ca8KRSjRpPM+MTCTenL1NdzoJ5GixPXsp/WMljwA== 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=1702497976; 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=UTHveEvZLpNuJzBX7ufjYYh1F4obR6ATJrRihAmTSrE=; b=tgxURQma42yHKjs/qRWj0FcBfCFSiVD3pb9MwYC+2Smr2qcfuq3FhfotlkfXZXZHVFIc18 sd3Vnx2lXzl5HEi9oZggcBWTRK4es5oLjLjYYx7YnoXCpKulHDIx8B1pPZIXJnYtlYemuR 0MBNq/NvaYUc32QllYgSs9BsQkQoSVUjRU/ZpCmM93nL3svGDRfaI54f+Y8kS1Z6CHJ2SQ vZ7TCf/E4Lo2vP4PH4U16/meBxc4afnNtFh+oDXWVa+JvFAHfBPso3BGosW2egWsNg1T+v Zl3M6Tpfz2ASYLMq87ojGdtLyKcEs0hO2V3dZ8KnAI3hZLatxQnzRVbusPlf/A== 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 4Sr61h52RBz1C3C; Wed, 13 Dec 2023 20:06:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BDK6G1p086818; Wed, 13 Dec 2023 20:06:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BDK6GCW086815; Wed, 13 Dec 2023 20:06:16 GMT (envelope-from git) Date: Wed, 13 Dec 2023 20:06:16 GMT Message-Id: <202312132006.3BDK6GCW086815@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 5761f8a7de9f - stable/13 - libtacplus: Allow additional AV pairs to be configured. 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5761f8a7de9fa0248e1d7e2be751de1c6d9aa973 Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=5761f8a7de9fa0248e1d7e2be751de1c6d9aa973 commit 5761f8a7de9fa0248e1d7e2be751de1c6d9aa973 Author: Dag-Erling Smørgrav AuthorDate: 2023-06-13 16:04:22 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-12-13 16:08:13 +0000 libtacplus: Allow additional AV pairs to be configured. * Replace hand-rolled input tokenizer with openpam_readlinev() which supports line continuations and has better quoting and escaping. * Simplify string handling by merging struct clnt_str and struct srvr_str into just struct tac_str. * Each server entry in the configuration file can now have up to 255 AV pairs which will be appended to the ones returned by the server in response to a successful authorization request. This allows nss_tacplus(8) to be used with servers which do not provide identity information beyond confirming the existence of the user. This adds a dependency on libpam, however libtacplus is currently only used by pam_tacplus(8) (which is already always used with libpam) and the very recently added nss_tacplus(8) (which is extremely niche). In the longer term it might be a good idea to split this out into a separate library. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: pauamma_gundo.com, markj Differential Revision: https://reviews.freebsd.org/D40285 Relnotes: yes (cherry picked from commit 21850106fdda5269bc881f0e62839dff3d9edf47) --- UPDATING | 7 + lib/libtacplus/Makefile | 2 +- lib/libtacplus/taclib.c | 347 +++++++++++++++++----------------------- lib/libtacplus/taclib_private.h | 63 ++++---- lib/libtacplus/tacplus.conf.5 | 42 ++--- share/mk/src.libnames.mk | 2 +- 6 files changed, 206 insertions(+), 257 deletions(-) diff --git a/UPDATING b/UPDATING index 67809e8fc4dc..21873313b3be 100644 --- a/UPDATING +++ b/UPDATING @@ -12,6 +12,13 @@ Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before updating system packages and/or ports. +20230913: + Improvements to libtacplus(8) mean that tacplus.conf(5) now + follows POSIX shell syntax rules. This may cause TACACS+ + authentication to fail if the shared secret contains a single + quote, double quote, or backslash character which isn't + already properly quoted or escaped. + 20230619: To enable pf rdr rules for connections initiated from the host, pf filter rules can be optionally enabled for packets delivered diff --git a/lib/libtacplus/Makefile b/lib/libtacplus/Makefile index b658d6ce02ba..43567350aeac 100644 --- a/lib/libtacplus/Makefile +++ b/lib/libtacplus/Makefile @@ -27,7 +27,7 @@ LIB= tacplus SRCS= taclib.c INCS= taclib.h CFLAGS+= -Wall -LIBADD= md +LIBADD= md pam SHLIB_MAJOR= 5 MAN= libtacplus.3 tacplus.conf.5 diff --git a/lib/libtacplus/taclib.c b/lib/libtacplus/taclib.c index 6577876ef44f..00bee367ca9f 100644 --- a/lib/libtacplus/taclib.c +++ b/lib/libtacplus/taclib.c @@ -34,6 +34,7 @@ #include #include +#include #include #include #include @@ -45,32 +46,34 @@ #include #include +#include +#include + #include "taclib_private.h" static int add_str_8(struct tac_handle *, u_int8_t *, - struct clnt_str *); + struct tac_str *); static int add_str_16(struct tac_handle *, u_int16_t *, - struct clnt_str *); + struct tac_str *); static int protocol_version(int, int, int); static void close_connection(struct tac_handle *); static int conn_server(struct tac_handle *); static void crypt_msg(struct tac_handle *, struct tac_msg *); -static void *dup_str(struct tac_handle *, const struct srvr_str *, +static void *dup_str(struct tac_handle *, const struct tac_str *, size_t *); static int establish_connection(struct tac_handle *); -static void free_str(struct clnt_str *); +static void free_str(struct tac_str *); static void generr(struct tac_handle *, const char *, ...) __printflike(2, 3); static void gen_session_id(struct tac_msg *); static int get_srvr_end(struct tac_handle *); -static int get_srvr_str(struct tac_handle *, const char *, - struct srvr_str *, size_t); -static void init_clnt_str(struct clnt_str *); -static void init_srvr_str(struct srvr_str *); +static int get_str(struct tac_handle *, const char *, + struct tac_str *, size_t); +static void init_str(struct tac_str *); static int read_timed(struct tac_handle *, void *, size_t, const struct timeval *); static int recv_msg(struct tac_handle *); -static int save_str(struct tac_handle *, struct clnt_str *, +static int save_str(struct tac_handle *, struct tac_str *, const void *, size_t); static int send_msg(struct tac_handle *); static int split(char *, char *[], int, char *, size_t); @@ -88,7 +91,7 @@ static void create_msg(struct tac_handle *, int, int, int); * for the next time. */ static int -add_str_8(struct tac_handle *h, u_int8_t *fld, struct clnt_str *cs) +add_str_8(struct tac_handle *h, u_int8_t *fld, struct tac_str *cs) { u_int16_t len; @@ -112,7 +115,7 @@ add_str_8(struct tac_handle *h, u_int8_t *fld, struct clnt_str *cs) * for the next time. */ static int -add_str_16(struct tac_handle *h, u_int16_t *fld, struct clnt_str *cs) +add_str_16(struct tac_handle *h, u_int16_t *fld, struct tac_str *cs) { size_t len; @@ -234,7 +237,7 @@ close_connection(struct tac_handle *h) static int conn_server(struct tac_handle *h) { - const struct tac_server *srvp = &h->servers[h->cur_server]; + struct tac_server *srvp = &h->servers[h->cur_server]; int flags; if ((h->fd = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP)) == -1) { @@ -355,7 +358,7 @@ crypt_msg(struct tac_handle *h, struct tac_msg *msg) * though they have no content. */ static void * -dup_str(struct tac_handle *h, const struct srvr_str *ss, size_t *len) +dup_str(struct tac_handle *h, const struct tac_str *ss, size_t *len) { unsigned char *p; @@ -402,10 +405,10 @@ establish_connection(struct tac_handle *h) * Free a client string, obliterating its contents first for security. */ static void -free_str(struct clnt_str *cs) +free_str(struct tac_str *cs) { if (cs->data != NULL) { - memset(cs->data, 0, cs->len); + memset_s(cs->data, cs->len, 0, cs->len); free(cs->data); cs->data = NULL; cs->len = 0; @@ -456,8 +459,8 @@ get_srvr_end(struct tac_handle *h) } static int -get_srvr_str(struct tac_handle *h, const char *field, - struct srvr_str *ss, size_t len) +get_str(struct tac_handle *h, const char *field, + struct tac_str *ss, size_t len) { if (h->srvr_pos + len > ntohl(h->response.length)) { generr(h, "Invalid length field in %s response from server " @@ -472,19 +475,12 @@ get_srvr_str(struct tac_handle *h, const char *field, } static void -init_clnt_str(struct clnt_str *cs) +init_str(struct tac_str *cs) { cs->data = NULL; cs->len = 0; } -static void -init_srvr_str(struct srvr_str *ss) -{ - ss->data = NULL; - ss->len = 0; -} - static int read_timed(struct tac_handle *h, void *buf, size_t len, const struct timeval *deadline) @@ -597,7 +593,7 @@ recv_msg(struct tac_handle *h) } static int -save_str(struct tac_handle *h, struct clnt_str *cs, const void *data, +save_str(struct tac_handle *h, struct tac_str *cs, const void *data, size_t len) { free_str(cs); @@ -687,84 +683,14 @@ send_msg(struct tac_handle *h) return 0; } -/* - * Destructively split a string into fields separated by white space. - * `#' at the beginning of a field begins a comment that extends to the - * end of the string. Fields may be quoted with `"'. Inside quoted - * strings, the backslash escapes `\"' and `\\' are honored. - * - * Pointers to up to the first maxfields fields are stored in the fields - * array. Missing fields get NULL pointers. - * - * The return value is the actual number of fields parsed, and is always - * <= maxfields. - * - * On a syntax error, places a message in the msg string, and returns -1. - */ static int -split(char *str, char *fields[], int maxfields, char *msg, size_t msglen) -{ - char *p; - int i; - static const char ws[] = " \t"; - - for (i = 0; i < maxfields; i++) - fields[i] = NULL; - p = str; - i = 0; - while (*p != '\0') { - p += strspn(p, ws); - if (*p == '#' || *p == '\0') - break; - if (i >= maxfields) { - snprintf(msg, msglen, "line has too many fields"); - return -1; - } - if (*p == '"') { - char *dst; - - dst = ++p; - fields[i] = dst; - while (*p != '"') { - if (*p == '\\') { - p++; - if (*p != '"' && *p != '\\' && - *p != '\0') { - snprintf(msg, msglen, - "invalid `\\' escape"); - return -1; - } - } - if (*p == '\0') { - snprintf(msg, msglen, - "unterminated quoted string"); - return -1; - } - *dst++ = *p++; - } - *dst = '\0'; - p++; - if (*p != '\0' && strspn(p, ws) == 0) { - snprintf(msg, msglen, "quoted string not" - " followed by white space"); - return -1; - } - } else { - fields[i] = p; - p += strcspn(p, ws); - if (*p != '\0') - *p++ = '\0'; - } - i++; - } - return i; -} - -int -tac_add_server(struct tac_handle *h, const char *host, int port, - const char *secret, int timeout, int flags) +tac_add_server_av(struct tac_handle *h, const char *host, int port, + const char *secret, int timeout, int flags, const char *const *avs) { struct tac_server *srvp; + const char *p; + size_t len; + int i; if (h->num_servers >= MAXSERVERS) { generr(h, "Too many TACACS+ servers specified"); @@ -790,8 +716,46 @@ tac_add_server(struct tac_handle *h, const char *host, int port, return -1; srvp->timeout = timeout; srvp->flags = flags; + srvp->navs = 0; + for (i = 0; avs[i] != NULL; i++) { + if (i >= MAXAVPAIRS) { + generr(h, "too many AV pairs"); + goto fail; + } + for (p = avs[i], len = 0; is_arg(*p); p++) + len++; + if (p == avs[i] || *p != '=') { + generr(h, "invalid AV pair %d", i); + goto fail; + } + while (*p++ != '\0') + len++; + if ((srvp->avs[i].data = xstrdup(h, avs[i])) == NULL) + goto fail; + srvp->avs[i].len = len; + srvp->navs++; + } h->num_servers++; return 0; +fail: + memset_s(srvp->secret, strlen(srvp->secret), 0, strlen(srvp->secret)); + free(srvp->secret); + srvp->secret = NULL; + for (i = 0; i < srvp->navs; i++) { + free(srvp->avs[i].data); + srvp->avs[i].data = NULL; + srvp->avs[i].len = 0; + } + return -1; +} + +int +tac_add_server(struct tac_handle *h, const char *host, int port, + const char *secret, int timeout, int flags) +{ + const char *const *avs = { NULL }; + + return tac_add_server_av(h, host, port, secret, timeout, flags, avs); } void @@ -819,12 +783,22 @@ tac_close(struct tac_handle *h) free(h); } +static void +freev(char **fields, int nfields) +{ + if (fields != NULL) { + while (nfields-- > 0) + free(fields[nfields]); + free(fields); + } +} + int tac_config(struct tac_handle *h, const char *path) { FILE *fp; - char buf[MAXCONFLINE]; - int linenum; + char **fields; + int linenum, nfields; int retval; if (path == NULL) @@ -834,46 +808,23 @@ tac_config(struct tac_handle *h, const char *path) return -1; } retval = 0; - linenum = 0; - while (fgets(buf, sizeof buf, fp) != NULL) { - int len; - char *fields[4]; - int nfields; - char msg[ERRSIZE]; + linenum = nfields = 0; + fields = NULL; + while ((fields = openpam_readlinev(fp, &linenum, &nfields)) != NULL) { char *host, *res; char *port_str; char *secret; char *timeout_str; - char *options_str; char *end; unsigned long timeout; int port; int options; + int i; - linenum++; - len = strlen(buf); - /* We know len > 0, else fgets would have returned NULL. */ - if (buf[len - 1] != '\n') { - if (len >= sizeof buf - 1) - generr(h, "%s:%d: line too long", path, - linenum); - else - generr(h, "%s:%d: missing newline", path, - linenum); - retval = -1; - break; - } - buf[len - 1] = '\0'; - - /* Extract the fields from the line. */ - nfields = split(buf, fields, 4, msg, sizeof msg); - if (nfields == -1) { - generr(h, "%s:%d: %s", path, linenum, msg); - retval = -1; - break; - } - if (nfields == 0) + if (nfields == 0) { + freev(fields, nfields); continue; + } if (nfields < 2) { generr(h, "%s:%d: missing shared secret", path, linenum); @@ -882,8 +833,6 @@ tac_config(struct tac_handle *h, const char *path) } host = fields[0]; secret = fields[1]; - timeout_str = fields[2]; - options_str = fields[3]; /* Parse and validate the fields. */ res = host; @@ -899,7 +848,10 @@ tac_config(struct tac_handle *h, const char *path) } } else port = 0; - if (timeout_str != NULL) { + i = 2; + if (nfields > i && strlen(fields[i]) > 0 && + strspn(fields[i], "0123456789") == strlen(fields[i])) { + timeout_str = fields[i]; timeout = strtoul(timeout_str, &end, 10); if (timeout_str[0] == '\0' || *end != '\0') { generr(h, "%s:%d: invalid timeout", path, @@ -907,22 +859,17 @@ tac_config(struct tac_handle *h, const char *path) retval = -1; break; } + i++; } else timeout = TIMEOUT; options = 0; - if (options_str != NULL) { - if (strcmp(options_str, "single-connection") == 0) - options |= TAC_SRVR_SINGLE_CONNECT; - else { - generr(h, "%s:%d: invalid option \"%s\"", - path, linenum, options_str); - retval = -1; - break; - } - }; - - if (tac_add_server(h, host, port, secret, timeout, - options) == -1) { + if (nfields > i && + strcmp(fields[i], "single-connection") == 0) { + options |= TAC_SRVR_SINGLE_CONNECT; + i++; + } + if (tac_add_server_av(h, host, port, secret, timeout, + options, (const char *const *)(fields + i)) == -1) { char msg[ERRSIZE]; strcpy(msg, h->errmsg); @@ -930,9 +877,10 @@ tac_config(struct tac_handle *h, const char *path) retval = -1; break; } + memset_s(secret, strlen(secret), 0, strlen(secret)); + freev(fields, nfields); } - /* Clear out the buffer to wipe a possible copy of a shared secret */ - memset(buf, 0, sizeof buf); + freev(fields, nfields); fclose(fp); return retval; } @@ -1038,17 +986,17 @@ tac_open(void) h->num_servers = 0; h->cur_server = 0; h->errmsg[0] = '\0'; - init_clnt_str(&h->user); - init_clnt_str(&h->port); - init_clnt_str(&h->rem_addr); - init_clnt_str(&h->data); - init_clnt_str(&h->user_msg); + init_str(&h->user); + init_str(&h->port); + init_str(&h->rem_addr); + init_str(&h->data); + init_str(&h->user_msg); for (i=0; iavs[i])); - init_srvr_str(&(h->srvr_avs[i])); + init_str(&(h->avs[i])); + init_str(&(h->srvr_avs[i])); } - init_srvr_str(&h->srvr_msg); - init_srvr_str(&h->srvr_data); + init_str(&h->srvr_msg); + init_str(&h->srvr_data); } return h; } @@ -1091,8 +1039,8 @@ tac_send_authen(struct tac_handle *h) /* Scan the optional fields in the reply. */ ar = &h->response.u.authen_reply; h->srvr_pos = offsetof(struct tac_authen_reply, rest[0]); - if (get_srvr_str(h, "msg", &h->srvr_msg, ntohs(ar->msg_len)) == -1 || - get_srvr_str(h, "data", &h->srvr_data, ntohs(ar->data_len)) == -1 || + if (get_str(h, "msg", &h->srvr_msg, ntohs(ar->msg_len)) == -1 || + get_str(h, "data", &h->srvr_data, ntohs(ar->data_len)) == -1 || get_srvr_end(h) == -1) return -1; @@ -1112,6 +1060,7 @@ tac_send_author(struct tac_handle *h) char dbgstr[64]; struct tac_author_request *areq = &h->request.u.author_request; struct tac_author_response *ares = &h->response.u.author_response; + struct tac_server *srvp; h->request.length = htonl(offsetof(struct tac_author_request, rest[0])); @@ -1145,23 +1094,25 @@ tac_send_author(struct tac_handle *h) /* Send the message and retrieve the reply. */ if (send_msg(h) == -1 || recv_msg(h) == -1) return -1; + srvp = &h->servers[h->cur_server]; /* Update the offset in the response packet based on av pairs count */ h->srvr_pos = offsetof(struct tac_author_response, rest[0]) + ares->av_cnt; /* Scan the optional fields in the response. */ - if (get_srvr_str(h, "msg", &h->srvr_msg, ntohs(ares->msg_len)) == -1 || - get_srvr_str(h, "data", &h->srvr_data, ntohs(ares->data_len)) ==-1) + if (get_str(h, "msg", &h->srvr_msg, ntohs(ares->msg_len)) == -1 || + get_str(h, "data", &h->srvr_data, ntohs(ares->data_len)) ==-1) return -1; /* Get each AV pair (just setting pointers, not malloc'ing) */ clear_srvr_avs(h); for (i=0; iav_cnt; i++) { snprintf(dbgstr, sizeof dbgstr, "av-pair-%d", i); - if (get_srvr_str(h, dbgstr, &(h->srvr_avs[i]), + if (get_str(h, dbgstr, &(h->srvr_avs[i]), ares->rest[i]) == -1) return -1; + h->srvr_navs++; } /* Should have ended up at the end */ @@ -1172,7 +1123,7 @@ tac_send_author(struct tac_handle *h) if (!h->single_connect) close_connection(h); - return ares->av_cnt << 8 | ares->status; + return (h->srvr_navs + srvp->navs) << 8 | ares->status; } int @@ -1206,8 +1157,8 @@ tac_send_acct(struct tac_handle *h) /* reply */ h->srvr_pos = offsetof(struct tac_acct_reply, rest[0]); - if (get_srvr_str(h, "msg", &h->srvr_msg, ntohs(ar->msg_len)) == -1 || - get_srvr_str(h, "data", &h->srvr_data, ntohs(ar->data_len)) == -1 || + if (get_str(h, "msg", &h->srvr_msg, ntohs(ar->msg_len)) == -1 || + get_str(h, "data", &h->srvr_data, ntohs(ar->data_len)) == -1 || get_srvr_end(h) == -1) return -1; @@ -1270,41 +1221,41 @@ tac_set_av(struct tac_handle *h, u_int index, const char *av) char * tac_get_av(struct tac_handle *h, u_int index) { - if (index >= MAXAVPAIRS) - return NULL; - return dup_str(h, &(h->srvr_avs[index]), NULL); + struct tac_server *srvp; + + if (index < h->srvr_navs) + return dup_str(h, &h->srvr_avs[index], NULL); + index -= h->srvr_navs; + srvp = &h->servers[h->cur_server]; + if (index < srvp->navs) + return xstrdup(h, srvp->avs[index].data); + return NULL; } char * tac_get_av_value(struct tac_handle *h, const char *attribute) { - int i, len; - const char *ch, *end; - const char *candidate; - int candidate_len; + int i, attr_len; int found_seperator; - struct srvr_str srvr; + char *ch, *end; + struct tac_str *candidate; + struct tac_str value; + struct tac_server *srvp = &h->servers[h->cur_server]; - if (attribute == NULL || ((len = strlen(attribute)) == 0)) + if (attribute == NULL || (attr_len = strlen(attribute)) == 0) return NULL; - for (i=0; isrvr_avs[i].data; - candidate_len = h->srvr_avs[i].len; + for (i = 0; i < h->srvr_navs + srvp->navs; i++) { + if (i < h->srvr_navs) + candidate = &h->srvr_avs[i]; + else + candidate = &srvp->avs[i - h->srvr_navs]; - /* - * Valid 'srvr_avs' guaranteed to be contiguous starting at - * index 0 (not necessarily the case with 'avs'). Break out - * when the "end" of the list has been reached. - */ - if (!candidate) - break; - - if (len < candidate_len && - !strncmp(candidate, attribute, len)) { + if (attr_len < candidate->len && + strncmp(candidate->data, attribute, attr_len) == 0) { - ch = candidate + len; - end = candidate + candidate_len; + ch = candidate->data + attr_len; + end = candidate->data + candidate->len; /* * Sift out the white space between A and V (should not @@ -1331,9 +1282,9 @@ tac_get_av_value(struct tac_handle *h, const char *attribute) * dup_str() will handle srvr.len == 0 correctly. */ if (found_seperator == 1) { - srvr.len = end - ch; - srvr.data = ch; - return dup_str(h, &srvr, NULL); + value.len = end - ch; + value.data = ch; + return dup_str(h, &value, NULL); } } } @@ -1352,8 +1303,10 @@ static void clear_srvr_avs(struct tac_handle *h) { int i; - for (i=0; isrvr_avs[i])); + + for (i = 0; i < h->srvr_navs; i++) + init_str(&(h->srvr_avs[i])); + h->srvr_navs = 0; } diff --git a/lib/libtacplus/taclib_private.h b/lib/libtacplus/taclib_private.h index 665616f1f200..43203b72f6ca 100644 --- a/lib/libtacplus/taclib_private.h +++ b/lib/libtacplus/taclib_private.h @@ -58,30 +58,8 @@ #define TAC_UNENCRYPTED 0x01 #define TAC_SINGLE_CONNECT 0x04 -struct tac_server { - struct sockaddr_in addr; /* Address of server */ - char *secret; /* Shared secret */ - int timeout; /* Timeout in seconds */ - int flags; -}; - -/* - * An optional string of bytes specified by the client for inclusion in - * a request. The data is always a dynamically allocated copy that - * belongs to the library. It is copied into the request packet just - * before sending the request. - */ -struct clnt_str { - void *data; - size_t len; -}; - -/* - * An optional string of bytes from a server response. The data resides - * in the response packet itself, and must not be freed. - */ -struct srvr_str { - const void *data; +struct tac_str { + char *data; size_t len; }; @@ -171,6 +149,15 @@ struct tac_msg { } u; }; +struct tac_server { + struct sockaddr_in addr; /* Address of server */ + char *secret; /* Shared secret */ + int timeout; /* Timeout in seconds */ + int flags; + unsigned int navs; + struct tac_str avs[MAXAVPAIRS]; +}; + struct tac_handle { int fd; /* Socket file descriptor */ struct tac_server servers[MAXSERVERS]; /* Servers to contact */ @@ -180,20 +167,30 @@ struct tac_handle { int last_seq_no; char errmsg[ERRSIZE]; /* Most recent error message */ - struct clnt_str user; - struct clnt_str port; - struct clnt_str rem_addr; - struct clnt_str data; - struct clnt_str user_msg; - struct clnt_str avs[MAXAVPAIRS]; + struct tac_str user; + struct tac_str port; + struct tac_str rem_addr; + struct tac_str data; + struct tac_str user_msg; + struct tac_str avs[MAXAVPAIRS]; struct tac_msg request; struct tac_msg response; int srvr_pos; /* Scan position in response body */ - struct srvr_str srvr_msg; - struct srvr_str srvr_data; - struct srvr_str srvr_avs[MAXAVPAIRS]; + unsigned int srvr_navs; + struct tac_str srvr_msg; + struct tac_str srvr_data; + struct tac_str srvr_avs[MAXAVPAIRS]; }; +#define is_alpha(ch) /* alphabetical */ \ + (((ch) >= 'A' && (ch) <= 'Z') || ((ch) >= 'a' && (ch) <= 'z')) +#define is_num(ch) /* numerical */ \ + ((ch) >= '0' && (ch) <= '9') +#define is_alnum(ch) /* alphanumerical */ \ + (is_alpha(ch) || is_num(ch)) +#define is_arg(ch) /* valid in an argument name */ \ + (is_alnum(ch) || (ch) == '_' || (ch) == '-') + #endif diff --git a/lib/libtacplus/tacplus.conf.5 b/lib/libtacplus/tacplus.conf.5 index 9016a25faad0..2653c664d67e 100644 --- a/lib/libtacplus/tacplus.conf.5 +++ b/lib/libtacplus/tacplus.conf.5 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd July 29, 1998 +.Dd June 13, 2023 .Dt TACPLUS.CONF 5 .Os .Sh NAME @@ -44,23 +44,9 @@ Leading white space is ignored, as are empty lines and lines containing only comments. .Pp -A TACACS+ server is described by two to four fields on a line. -The -fields are separated by white space. -The -.Ql # -character at the beginning of a field begins a comment, which extends -to the end of the line. -A field may be enclosed in double quotes, -in which case it may contain white space and/or begin with the -.Ql # -character. -Within a quoted string, the double quote character can -be represented by -.Ql \e\&" , -and the backslash can be represented by -.Ql \e\e . -No other escape sequences are supported. +A TACACS+ server is described by a minimum of two fields on a line. +The fields are separated by whitespace and follow the same rules for +comments, quoting, escaping, and line continuation as the POSIX shell. .Pp The first field specifies the server host, either as a fully qualified domain name or as a @@ -81,12 +67,11 @@ An empty secret disables the normal encryption mechanism, causing all data to cross the network in cleartext. .Pp -The third field contains a decimal integer specifying the timeout -in seconds for communicating with the server. +The optional third field may contain a decimal integer specifying the +timeout in seconds for communicating with the server. The timeout applies separately to each connect, write, and read operation. -If this field -is omitted, it defaults to 3 seconds. +If this field is omitted, it defaults to 3 seconds. .Pp The optional fourth field may contain the string .Ql single-connection . @@ -96,6 +81,11 @@ sessions. Some older TACACS+ servers become confused if this option is specified. .Pp +Any subsequent fields must be of the form +.Ar attribute Ns = Ns Ar value +and will be appended to authorization responses as if they had been +sent by the server. +.Pp Up to 10 TACACS+ servers may be specified. The servers are tried in order, until a valid response is received or the list is exhausted. @@ -118,11 +108,13 @@ shared secrets, it should not be readable except by root. tacserver.domain.com OurLittleSecret # A server using a non-standard port, with an increased timeout and -# the "single-connection" option. -auth.domain.com:4333 "Don't tell!!" 15 single-connection +# the "single-connection" option, and overrides for the for uid, gid +# and shell attributes. +auth.domain.com:4333 "Don't tell!!" 15 single-connection \e + uid=1001 gid=20 shell="/usr/local/bin/zsh" # A server specified by its IP address: -192.168.27.81 $X*#..38947ax-+= +192.168.27.81 $X*#..38947ax-+= shell="/sbin/nologin" .Ed .Sh SEE ALSO .Xr libtacplus 3 diff --git a/share/mk/src.libnames.mk b/share/mk/src.libnames.mk index 054fa9099025..4963a9c02436 100644 --- a/share/mk/src.libnames.mk +++ b/share/mk/src.libnames.mk @@ -396,7 +396,7 @@ _DP_c+= ssp_nonshared .endif _DP_stats= sbuf pthread _DP_stdthreads= pthread -_DP_tacplus= md +_DP_tacplus= md pam _DP_nvpair= spl _DP_panelw= ncursesw _DP_rpcsec_gss= gssapi From nobody Wed Dec 13 20:06:17 2023 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 4Sr61k1ZQFz54FV0; Wed, 13 Dec 2023 20:06:18 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sr61k0DZWz4Yfj; Wed, 13 Dec 2023 20:06:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702497978; 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=hKNschQcx98sQVb2Orpq1nLnZrtOWo7jRhGWc+Dnf9o=; b=MK35yyVpe79Bc3WRGcGE7bkSbyWwX+Vduf8tFQVys0bJ4g5PeoICkgVRX8IxpyWTLlSMAp nToi1TykWUXanuX+F8RADRmV2/ayxcMuioFv906qfLoAA0gNNrut5+w8aQ1JAnuj6ckYF3 KNeLohq/wg1eYmpRMaT9chF49pRdJWD1jYXk4gETE+14szmjjs64vukfO6kId0dcHaOVTg QaYk12nlH7AEVl03y9KanywMbZxzeYkp/RPuhRRPgY7yY9KxNI8e9VfBGRFxPqgvt+LBnh RD2ux3uvzyOYOJDXW5Ee0C1UdiXBEuXJRWXYA2GOcWUTLN0xSYOKyDlQ0rZ3/g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702497978; a=rsa-sha256; cv=none; b=F7PQdnwH61f6AKcngq3UisM7Q8jJT3IbCYl+k3GluR5j4CMNmtkBWuXWUKSY2hzMsQAH23 jMVvg7wTJke5MHUdp+iAONo9WZdMIEcO0I8L2uMmJoQArSdhF+jv6P6cH0he140tm7FvqB qEBXc7cfyumiZJn0nuJZPsF1Wi3k2brgQnYW+10i39AOoof3t+Mlht9r5sdJIujLF4jqfs csWzIDNGlESEXhIjwIRg5vo5u/hoaDDvDBrSECaFJoBXIIQivgY4ONYMvOy2JiWxWT5OJS XvTzMoJILdpw6lqV+CyAS+DGE6axMS90aAVNQa028GCrHSfYqSKlFeemH2sjKA== 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=1702497978; 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=hKNschQcx98sQVb2Orpq1nLnZrtOWo7jRhGWc+Dnf9o=; b=L4VQ+7MmDWPnFfd5svSusHDb3kv0kr5Btxt6SjV4D0vAzI9IDCogKMO+WTMVUjEBhvSOq8 OEli1Xx6oi8ttCZLfkkI0zswQgZZM8AHN4/4CrG80wYaTaj1GNlsqhoFeRZGyVwC/yJZX1 X877PsZm4FKAZ57MM1nvkpdM67t1zmHdT/k2FjhDMalwXGyPQJVKK6BButTuowLqG0fG1t hscjHanewl++veHG/yLDzxqC0jIntvNPMwMxHO1Eu0G4oX28dy0YpUcihF1Jr8xB3BJEcC mJgoI5iVSJ5RbIpACScUDTi3t0PEbOsYtKGz5Kreeh9b8oO65pvT5vqQjrsYFA== 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 4Sr61j634nz1Blj; Wed, 13 Dec 2023 20:06:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BDK6Hpm086869; Wed, 13 Dec 2023 20:06:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BDK6HQO086866; Wed, 13 Dec 2023 20:06:17 GMT (envelope-from git) Date: Wed, 13 Dec 2023 20:06:17 GMT Message-Id: <202312132006.3BDK6HQO086866@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: fd5db125e7fc - stable/13 - Fix prebuild race between libpam and libtacplus. 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: fd5db125e7fc3d687e713b8993146eb148c5be2b Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=fd5db125e7fc3d687e713b8993146eb148c5be2b commit fd5db125e7fc3d687e713b8993146eb148c5be2b Author: Dag-Erling Smørgrav AuthorDate: 2023-06-21 20:58:54 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-12-13 16:08:13 +0000 Fix prebuild race between libpam and libtacplus. Fixes: 21850106fdda MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: kevans, emaste Differential Revision: https://reviews.freebsd.org/D40702 (cherry picked from commit bd9049eeff458fc7ee256a891ba285519c6ce550) --- Makefile.inc1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index 423c5924d39c..42707c3ccfbc 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -3050,7 +3050,8 @@ _generic_libs+= ${_DIR} .endif .endfor -lib/libopie__L lib/libtacplus__L: lib/libmd__L +lib/libopie__L: lib/libmd__L +lib/libtacplus__L: lib/libmd__L lib/libpam/libpam__L .if ${MK_CDDL} != "no" _cddl_lib_libumem= cddl/lib/libumem From nobody Wed Dec 13 20:06:18 2023 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 4Sr61l3g9kz54FnJ; Wed, 13 Dec 2023 20:06:19 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sr61l1nwzz4Yhg; Wed, 13 Dec 2023 20:06:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702497979; 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=myafYLLpQUjqPetfBToFxtkf9S4qToaSpbiEQSt014M=; b=ORgkHz7IfO42XRbxzBSoT3rzO6ol71L7GGTNyoN7jrMrOm8n/NkWrp6qCXPYSoQ2DAoyWj W60LeOIK6Uf5c/a1u3fNTjqwUAE0fVxwKRQykjQmfrBl5PsdyriaSzY8QewLJMpzCHTNQ0 WomWOBuV3SHO1jQZvSAtwn7OOXHUZ7EnlwPXXrAeYnCQh89BUSstNAwn4kGd4e4+REvve+ AYcj9wxiB7cLB/Opx6L4RWj9K9YhSDwk4tfz90wX/NaJwsNkdQ5YLUGkqMlzYr57R2fcqr Yp7jgtWp7rTd9SCsWpoost1uyyN6vYIHb+2+tCYDYY1EkZTVLJWVoGTMqgf8ww== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702497979; a=rsa-sha256; cv=none; b=P8Po5WJq246XsN1yjm4qOk3bZUhtDxYdEnrJQPnPyLzXIiJri3vIRvXsSDc5/UyFVJ8fZs GbeN4Z4+JcvpZwZn9T7zKxVkJSBEMwoPo0C4eQUJJZj/XeFTpMzhTm8q3J9gAxzxmdheNG 0V/oDfzdYEPE90ivcFXz5C1hJbIwearfllaXNDYV2fnT7LUM7i1sfd4Hq0WRJvoSg97bTj Uqo3y3sWnCsCbQlpBGhLZ1nyL31FcMY761UFhTmqYUo0lnNa+qNTI8ihd1Ye98u4WynuCZ wzOFuEnqub8nbcRkFIGCGid9s4ubJwjCpYWTOzswfkjmyvqfN4PbuMSuH1yHCQ== 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=1702497979; 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=myafYLLpQUjqPetfBToFxtkf9S4qToaSpbiEQSt014M=; b=VMtvrvbMmffesAlAszMjlZiupFJqxA+Eq91O6+CTTmw4rl+5cUip/p1+UR7OM6zVf+GHOm TQAlg3wjm4cpmhACnP4Cd/dRzVPGOTzHn/yEsM63JndgXrjuRclsJODzgpD483VgS531js nHXlnixljyBewK5J8W++cOEPEaDsjIoDvlCjRuSVELMQSBwaIlq2YREYW5kZ2KZhAl1xX5 /WO9s/ZGmiqEz/zm8rLrJQnntANoTW4pcTJQN/VqZGotyPzmQAPwDRhXUyYqX/rfIy3cPA cxCObU0l168O0RcgAFyYXcIms2m0LM07D2cGfiCI0sTV9tBzq91IRwGGglPiMg== 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 4Sr61k742nz1Bxc; Wed, 13 Dec 2023 20:06:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BDK6Ilb086917; Wed, 13 Dec 2023 20:06:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BDK6IOv086914; Wed, 13 Dec 2023 20:06:18 GMT (envelope-from git) Date: Wed, 13 Dec 2023 20:06:18 GMT Message-Id: <202312132006.3BDK6IOv086914@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 4437c6a18825 - stable/13 - nss_tacplus: Support setting the login class. 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4437c6a1882570ab54acf70d7d91e82fbd2a05b7 Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=4437c6a1882570ab54acf70d7d91e82fbd2a05b7 commit 4437c6a1882570ab54acf70d7d91e82fbd2a05b7 Author: Dag-Erling Smørgrav AuthorDate: 2023-06-13 16:06:27 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-12-13 16:08:13 +0000 nss_tacplus: Support setting the login class. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: thj Differential Revision: https://reviews.freebsd.org/D40376 (cherry picked from commit 246aec9a3ce305272f35e6416910024f602a03c1) --- lib/nss_tacplus/nss_tacplus.8 | 5 ++++- lib/nss_tacplus/nss_tacplus.c | 12 ++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/lib/nss_tacplus/nss_tacplus.8 b/lib/nss_tacplus/nss_tacplus.8 index 4aaff4b5dd3a..f5c87a836f9a 100644 --- a/lib/nss_tacplus/nss_tacplus.8 +++ b/lib/nss_tacplus/nss_tacplus.8 @@ -3,7 +3,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.Dd May 17, 2023 +.Dd June 13, 2023 .Dt NSS_TACPLUS 8 .Os .Sh NAME @@ -57,6 +57,9 @@ Numeric primary group ID. Must be between 0 and .Dv GID_MAX . Defaults to 65534. +.It Va CLASS +Login class. +Left blank if not provided. .It Va GECOS Display name. If not provided, the user name is used instead. diff --git a/lib/nss_tacplus/nss_tacplus.c b/lib/nss_tacplus/nss_tacplus.c index a59332504bc0..e18ffe2315ce 100644 --- a/lib/nss_tacplus/nss_tacplus.c +++ b/lib/nss_tacplus/nss_tacplus.c @@ -24,6 +24,7 @@ extern int __isthreaded; #define DEF_UID 65534 #define DEF_GID 65534 +#define DEF_CLASS "" #define DEF_DIR "/" #define DEF_SHELL "/bin/sh" @@ -192,6 +193,13 @@ tacplus_getpwnam_r(const char *name, struct passwd *pwd, char *buffer, return (NS_RETURN); } pwd->pw_gid = num; + } else if (strcasecmp(av, "class") == 0) { + pwd->pw_class = tacplus_copystr(value, &buffer, + &bufsize); + if (pwd->pw_class == NULL) { + free(av); + return (NS_RETURN); + } } else if (strcasecmp(av, "gecos") == 0) { pwd->pw_gecos = tacplus_copystr(value, &buffer, &bufsize); @@ -217,6 +225,10 @@ tacplus_getpwnam_r(const char *name, struct passwd *pwd, char *buffer, free(av); } + /* default class if none was provided */ + if (pwd->pw_class == NULL) + pwd->pw_class = tacplus_copystr(DEF_CLASS, &buffer, &bufsize); + /* gecos equal to name if none was provided */ if (pwd->pw_gecos == NULL) pwd->pw_gecos = pwd->pw_name; From nobody Wed Dec 13 20:06:19 2023 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 4Sr61m2JXzz54Fgr; Wed, 13 Dec 2023 20:06:20 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sr61m1FPpz4Yht; Wed, 13 Dec 2023 20:06:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702497980; 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=I6AyUXtxTKHgDGfLq2Hig3HwZDxunnBp41WVgu5zZsU=; b=js9RWqn9jJpt3OwnpjTCpuCnRavAVMkVH5/tj7ImzproYrOzhH/6lG8fxyh6//gNV4LrXM GtMLYXAMVrnehIANBoQ5ollWOAzjV5khGDqMHqQRlXqmZEvLLlgagL+at05eRA9etHTrtl gXAZs09Dx0zTLNFD0Hfy88GhKNNvcRZ+URtYLBexJwPmtNCeQ8skQFLd3C05Ixxui/bC8T NlkmMnTc1KNnSZspOlgTf7EiL5DktklisI+XxJkuNSbqLSzLAQzj+WpNxy5YmV8DVm7X8t hRf+7itd+I+S6MhrNBRdDcrv35ihGmBCQjytK7Qb5FL9hr4epB7iQO6iRMf+0w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702497980; a=rsa-sha256; cv=none; b=LbO2LBoyRFMK1YiLz4E3AC5bMFrD+joXPw2rnrHLYlPaRwSHDNmpfWNC2cmyoX3f254a94 C+uc6Q3N9p7Szcetn38y3/dSh9a0PS7W9JqDdUvveNjQnGJTqzF65DsLBrP/mcq/pIKsOo AMKSHPWCEKKZrknkNF7cvIwWF4XNdErttL8JQyAlMg5ylZbjUudf099CNRFpWt6qm+q0v8 JJ/5pTR3S/uxZRSLPrVrggB/LRn6ZougQaL+10ajphvq4BEtMMbhEQDDdrAkKObx0W20Tx XF46Y4rNGAaX8QRubMuchi9KsM3NLHVfzqEZ4ylVVL7jFmJJJoqDnQsuKgFM0A== 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=1702497980; 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=I6AyUXtxTKHgDGfLq2Hig3HwZDxunnBp41WVgu5zZsU=; b=PmNXUZEHhRpsvxCgcOhspH5FASAX8RmxXirdsRM9e+bMxwscj4wCb7bSQ1pVg2yIdnLHKI Qc8kdzQJ/6I2HSwBsikjCXb5Hf/JkncPs4aqXUy7RCy3+LgikZoxVKHEc5vW/JOeiAxluI wDNgfLqYBIsSZsqGY+uPNBLqOSWg/OIBO6bh+SEqHsp8c4i7UL2F7d5a1QEHyIGR05Ow/A K/H8CrBg05Y7Z+Gzm9jtkgY+PJTHd1P41sWAiWTxrGyvh0jsbR8ixBD91uUZRPELxubdCG bvd+Q6Y4pFvyefjUSvSM+G9DBMlZvNMvDr6FL/W71IP1yTu+SSkQEY3rWIJMDQ== 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 4Sr61m0M59z1Bxd; Wed, 13 Dec 2023 20:06:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BDK6Jre086973; Wed, 13 Dec 2023 20:06:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BDK6Jf6086970; Wed, 13 Dec 2023 20:06:19 GMT (envelope-from git) Date: Wed, 13 Dec 2023 20:06:19 GMT Message-Id: <202312132006.3BDK6Jf6086970@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: abbe12a5266a - stable/13 - nss_tacplus: Provide dummy setpwent(), getpwent_r(), endpwent(). 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: abbe12a5266aea17de82300e245d18908c8671dc Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=abbe12a5266aea17de82300e245d18908c8671dc commit abbe12a5266aea17de82300e245d18908c8671dc Author: Dag-Erling Smørgrav AuthorDate: 2023-08-31 07:49:41 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-12-13 16:08:13 +0000 nss_tacplus: Provide dummy setpwent(), getpwent_r(), endpwent(). These aren't really needed, since TACACS+ does not support enumeration, but providing placeholders keeps nsdispatch() from complaining that they're missing. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D41658 (cherry picked from commit 56b74a2d856c4d65a4b5c72d1352067b6b469d3b) --- lib/nss_tacplus/nss_tacplus.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/lib/nss_tacplus/nss_tacplus.c b/lib/nss_tacplus/nss_tacplus.c index e18ffe2315ce..238d7bf301ad 100644 --- a/lib/nss_tacplus/nss_tacplus.c +++ b/lib/nss_tacplus/nss_tacplus.c @@ -271,12 +271,43 @@ nss_tacplus_getpwnam_r(void *retval, void *mdata __unused, va_list ap) return (ret); } +static int +nss_tacplus_setpwent(void *retval __unused, void *mdata __unused, + va_list ap __unused) +{ + return (NS_SUCCESS); +} + +static int +nss_tacplus_getpwent_r(void *retval, void *mdata __unused, va_list ap) +{ + struct passwd *pwd __unused = va_arg(ap, struct passwd *); + char *buffer __unused = va_arg(ap, char *); + size_t bufsize __unused = va_arg(ap, size_t); + int *result = va_arg(ap, int *); + + *(void **)retval = NULL; + *result = 0; + return (NS_SUCCESS); + +} + +static int +nss_tacplus_endpwent(void *retval __unused, void *mdata __unused, + va_list ap __unused) +{ + return (NS_SUCCESS); +} + ns_mtab * nss_module_register(const char *name __unused, unsigned int *plen, nss_module_unregister_fn *unreg) { static ns_mtab mtab[] = { { "passwd", "getpwnam_r", &nss_tacplus_getpwnam_r, NULL }, + { "passwd", "setpwent", &nss_tacplus_setpwent, NULL }, + { "passwd", "getpwent_r", &nss_tacplus_getpwent_r, NULL }, + { "passwd", "endpwent", &nss_tacplus_endpwent, NULL }, }; *plen = nitems(mtab); From nobody Wed Dec 13 20:06:21 2023 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 4Sr61n4Cbjz54Frm; Wed, 13 Dec 2023 20:06:21 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sr61n3ZnHz4Ylx; Wed, 13 Dec 2023 20:06:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702497981; 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=7wBGU/HzKn0s5YNLUPm+Si9X5ZED+Rb/y5RHRAKcyDk=; b=dot1tJrmkSGZUTMuJyS+9FeCuF2LopjzaQiv4bqGQ+m+JOQzzJ6wsweCURQSEmlGu4ddl3 xv54ml1AjtqbJLDnJgmMq7b20wDhZGjiAu5wvpfGWHBxTFzp+rDJnrLY0V+rhZxYVmWkf1 A3LmUarzexZ4XwBZvd5gYiPh4wwhO8oKKAYTrhxUHWSBVLB6Q/bGCUhPOdqzN/sjxhhyN6 9LgJCa6gbA9PCCY/LskwtUQ36jzF0v/o0SdK1YGb10ICohKi3wrgojNbVaejzxGBSGx3xo K+3813CZMYcM/occQ6bB2Ig6FzbIeGAceLq+aPHve239JiXw70zm1Bmhk2pl4w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702497981; a=rsa-sha256; cv=none; b=wg2eY2Yl/ivqjM3HU9p6JFaUNT+AuAdqf9TSGzuzqq4WkcReHOeRqOSTxB8oEQ2xbFo9s5 QpDJI9blYH8Z+m5bFE8RCQodKHqoGq7OMXinxmWWwAmrJ+r7vWzA7e+dy7R2CNF0Ci9noS EewFPCPvFQHtzETrBctTPIIG+y4yWVjvK8JfS1TEEY5PTx0o5DeLoWLCNF9S/xhMEm10KY rdEruojYqxweocJ9hw7XEY4KWLNrC4a9bubYG/h20ojytkFP9GZC/Poeu1MC6zV654AWZy JjMtBq5imf0mATMW71ulDtX8sO+4sFObLTXD4Fl1n9wgLrO2vVs0/OPk8a5wKA== 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=1702497981; 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=7wBGU/HzKn0s5YNLUPm+Si9X5ZED+Rb/y5RHRAKcyDk=; b=M2UIJ7MfiLgPBWLmjDL7nTncSnWQdu86eo1aiIUY3FUC+2odiIi3fl93fFqqzXYRwizzWM zmPvHAjoMyeeSHC7HPzu/kMgMv36rW5Ud9HDoS0IVLbzA1G0TmBNn+rweXQuIdeq7ncFKe 9O/tHmlTJYLGy12BviwaLhGPeuN69VQdUwPZDx+3Pf0WaX2qfvo3ISSbodZypgDlek34h+ 8MDQEnwl0wEJWrXhGzv6gptsawuDhjNfCKvnS+4Sf2Ov1kPXJpN6SOIZHyGR8aUVJv7STo 0tn3R3FSY9cGUSNMEQ8REAAXyMsdh7EuNlW6we2PWbznAYEnVV8MyRRgTzUcgg== 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 4Sr61n1kPSz1C3D; Wed, 13 Dec 2023 20:06:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BDK6Lsf087015; Wed, 13 Dec 2023 20:06:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BDK6LoS087012; Wed, 13 Dec 2023 20:06:21 GMT (envelope-from git) Date: Wed, 13 Dec 2023 20:06:21 GMT Message-Id: <202312132006.3BDK6LoS087012@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 7ef70d24eee7 - stable/13 - Update tzcode to 2023c. 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7ef70d24eee731375fe17a8ef1a30573338d9468 Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=7ef70d24eee731375fe17a8ef1a30573338d9468 commit 7ef70d24eee731375fe17a8ef1a30573338d9468 Author: Dag-Erling Smørgrav AuthorDate: 2023-04-26 09:46:18 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-12-13 16:11:02 +0000 Update tzcode to 2023c. MFC after: 3 weeks Sponsored by: Klara, Inc. Reviewed by: philip Differential Revision: https://reviews.freebsd.org/D39712 (cherry picked from commit 75411d157232ee3b4789b92c9205453e7d59a3d2) --- contrib/tzcode/CONTRIBUTING | 2 +- contrib/tzcode/Makefile | 54 ++++---- contrib/tzcode/NEWS | 143 ++++++++++++++++++--- contrib/tzcode/asctime.c | 29 ++++- contrib/tzcode/date.1 | 5 +- contrib/tzcode/date.c | 15 +-- contrib/tzcode/localtime.c | 152 ++++++++++++---------- contrib/tzcode/newctime.3 | 22 +++- contrib/tzcode/newstrftime.3 | 2 +- contrib/tzcode/newtzset.3 | 5 +- contrib/tzcode/private.h | 135 +++++++++++++++----- contrib/tzcode/strftime.c | 6 +- contrib/tzcode/theory.html | 66 ++++++---- contrib/tzcode/time2posix.3 | 3 - contrib/tzcode/tz-art.html | 21 +++- contrib/tzcode/tz-how-to.html | 6 +- contrib/tzcode/tz-link.html | 93 ++++++++++---- contrib/tzcode/tzfile.5 | 5 +- contrib/tzcode/tzfile.h | 6 +- contrib/tzcode/tzselect.8 | 2 +- contrib/tzcode/tzselect.ksh | 287 +++++++++++++++++++++++++++++------------- contrib/tzcode/version | 2 +- contrib/tzcode/zdump.8 | 3 - contrib/tzcode/zdump.c | 85 +++++++------ contrib/tzcode/zic.8 | 19 +-- contrib/tzcode/zic.c | 67 +++++----- lib/libc/stdtime/Symbol.map | 1 + 27 files changed, 839 insertions(+), 397 deletions(-) diff --git a/contrib/tzcode/CONTRIBUTING b/contrib/tzcode/CONTRIBUTING index 4c0f56a50265..6d800e4c03a3 100644 --- a/contrib/tzcode/CONTRIBUTING +++ b/contrib/tzcode/CONTRIBUTING @@ -18,7 +18,7 @@ To email small changes, please run a POSIX shell command like 'diff -u old/europe new/europe >myfix.patch', and attach 'myfix.patch' to the email. -For more-elaborate or possibly-controversial changes, +For more-elaborate or possibly controversial changes, such as renaming, adding or removing zones, please read "Theory and pragmatics of the tz code and data" . diff --git a/contrib/tzcode/Makefile b/contrib/tzcode/Makefile index afb9d538a203..0e56af89e2a4 100644 --- a/contrib/tzcode/Makefile +++ b/contrib/tzcode/Makefile @@ -35,22 +35,14 @@ DATAFORM= main LOCALTIME= Factory -# The POSIXRULES macro controls interpretation of nonstandard and obsolete -# POSIX-like TZ settings like TZ='EET-2EEST' that lack DST transition rules. -# Such a setting uses the rules in a template file to determine -# "spring forward" and "fall back" days and times; the environment -# variable itself specifies UT offsets of standard and daylight saving time. -# +# The POSIXRULES macro controls interpretation of POSIX-like TZ +# settings like TZ='EET-2EEST' that lack DST transition rules. # If POSIXRULES is '-', no template is installed; this is the default. -# # Any other value for POSIXRULES is obsolete and should not be relied on, as: # * It does not work correctly in popular implementations such as GNU/Linux. # * It does not work even in tzcode, except for historical timestamps # that precede the last explicit transition in the POSIXRULES file. # Hence it typically does not work for current and future timestamps. -# In short, software should avoid ruleless settings like TZ='EET-2EEST' -# and so should not depend on the value of POSIXRULES. -# # If, despite the above, you want a template for handling these settings, # you can change the line below (after finding the timezone you want in the # one of the $(TDATA) source files, or adding it to a source file). @@ -63,7 +55,7 @@ LOCALTIME= Factory POSIXRULES= - # Also see TZDEFRULESTRING below, which takes effect only -# if the time zone files cannot be accessed. +# if POSIXRULES is '-' or if the template file cannot be accessed. # Installation locations. @@ -211,7 +203,7 @@ LDLIBS= # -DHAVE_DECL_ENVIRON if declares 'environ' # -DHAVE_DECL_TIMEGM=0 if does not declare timegm # -DHAVE_DIRECT_H if mkdir needs (MS-Windows) -# -DHAVE_GENERIC=0 if _Generic does not work* +# -DHAVE__GENERIC=0 if _Generic does not work* # -DHAVE_GETRANDOM if getrandom works (e.g., GNU/Linux), # -DHAVE_GETRANDOM=0 to avoid using getrandom # -DHAVE_GETTEXT if gettext works (e.g., GNU/Linux, FreeBSD, Solaris), @@ -220,7 +212,7 @@ LDLIBS= # -DHAVE_INCOMPATIBLE_CTIME_R if your system's time.h declares # ctime_r and asctime_r incompatibly with the POSIX standard # (Solaris when _POSIX_PTHREAD_SEMANTICS is not defined). -# -DHAVE_INTTYPES_H=0 if does not work* +# -DHAVE_INTTYPES_H=0 if does not work*+ # -DHAVE_LINK=0 if your system lacks a link function # -DHAVE_LOCALTIME_R=0 if your system lacks a localtime_r function # -DHAVE_LOCALTIME_RZ=0 if you do not want zdump to use localtime_rz @@ -229,22 +221,24 @@ LDLIBS= # -DHAVE_POSIX_DECLS=0 if your system's include files do not declare # functions like 'link' or variables like 'tzname' required by POSIX # -DHAVE_SETENV=0 if your system lacks the setenv function -# -DHAVE_SNPRINTF=0 if your system lacks the snprintf function +# -DHAVE_SNPRINTF=0 if your system lacks the snprintf function+ # -DHAVE_STDCKDINT_H=0 if neither nor substitutes like # __builtin_add_overflow work* -# -DHAVE_STDINT_H=0 if does not work* +# -DHAVE_STDINT_H=0 if does not work*+ # -DHAVE_STRFTIME_L if declares locale_t and strftime_l # -DHAVE_STRDUP=0 if your system lacks the strdup function -# -DHAVE_STRTOLL=0 if your system lacks the strtoll function +# -DHAVE_STRTOLL=0 if your system lacks the strtoll function+ # -DHAVE_SYMLINK=0 if your system lacks the symlink function # -DHAVE_SYS_STAT_H=0 if does not work* # -DHAVE_TZSET=0 if your system lacks a tzset function # -DHAVE_UNISTD_H=0 if does not work* # -DHAVE_UTMPX_H=0 if does not work* # -Dlocale_t=XXX if your system uses XXX instead of locale_t +# -DPORT_TO_C89 if tzcode should also run on C89 platforms+ # -DRESERVE_STD_EXT_IDS if your platform reserves standard identifiers # with external linkage, e.g., applications cannot define 'localtime'. # -Dssize_t=long on hosts like MS-Windows that lack ssize_t +# -DSUPPORT_C89 if the tzcode library should support C89 callers+ # -DSUPPRESS_TZDIR to not prepend TZDIR to file names; this has # security implications and is not recommended for general use # -DTHREAD_SAFE to make localtime.c thread-safe, as POSIX requires; @@ -256,7 +250,13 @@ LDLIBS= # -DTZ_DOMAINDIR=\"/path\" to use "/path" for gettext directory; # the default is system-supplied, typically "/usr/lib/locale" # -DTZDEFRULESTRING=\",date/time,date/time\" to default to the specified -# DST transitions if the time zone files cannot be accessed +# DST transitions for POSIX-style TZ strings lacking them, +# in the usual case where POSIXRULES is '-'. If not specified, +# TZDEFRULESTRING defaults to US rules for future DST transitions. +# This mishandles some past timestamps, as US DST rules have changed. +# It also mishandles settings like TZ='EET-2EEST' for eastern Europe, +# as Europe and US DST rules differ. +# -DTZNAME_MAXIMUM=N to limit time zone abbreviations to N bytes (default 255) # -DUNINIT_TRAP if reading uninitialized storage can cause problems # other than simply getting garbage data # -DUSE_LTZ=0 to build zdump with the system time zone library @@ -273,6 +273,8 @@ LDLIBS= # $(GCC_DEBUG_FLAGS) if you are using recent GCC and want lots of checking # # * Options marked "*" can be omitted if your compiler is C23 compatible. +# * Options marked "+" are obsolescent and are planned to be removed +# once the code assumes C99 or later. # # Select instrumentation via "make GCC_INSTRUMENT='whatever'". GCC_INSTRUMENT = \ @@ -351,6 +353,7 @@ GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 -fno-common \ # functions to be added to the time conversion library. # "offtime" is like "gmtime" except that it accepts a second (long) argument # that gives an offset to add to the time_t when converting it. +# "offtime_r" is to "offtime" what "gmtime_r" is to "gmtime". # "timelocal" is equivalent to "mktime". # "timeoff" is like "timegm" except that it accepts a second (long) argument # that gives an offset to use when converting to a time_t. @@ -363,7 +366,7 @@ GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 -fno-common \ # -DNETBSD_INSPIRED=0 # to the end of the "CFLAGS=" line. Otherwise, the functions # "localtime_rz", "mktime_z", "tzalloc", and "tzfree" are added to the -# time library, and if STD_INSPIRED is also defined the functions +# time library, and if STD_INSPIRED is also defined to nonzero the functions # "posix2time_z" and "time2posix_z" are added as well. # The functions ending in "_z" (or "_rz") are like their unsuffixed # (or suffixed-by-"_r") counterparts, except with an extra first @@ -455,16 +458,13 @@ SAFE_CHARSET3= 'abcdefghijklmnopqrstuvwxyz{|}~' SAFE_CHARSET= $(SAFE_CHARSET1)$(SAFE_CHARSET2)$(SAFE_CHARSET3) SAFE_CHAR= '[]'$(SAFE_CHARSET)'-]' -# These characters are Latin-1, and so are likely to be displayable -# even in editors with limited character sets. -UNUSUAL_OK_LATIN_1 = «°±»½¾× -# This IPA symbol is represented in Unicode as the composition of -# U+0075 and U+032F, and U+032F is not considered alphabetic by some -# grep implementations that do not grok composition. -UNUSUAL_OK_IPA = u̯ +# These non-alphabetic, non-ASCII printable characters are Latin-1, +# and so are likely displayable even in editors like XEmacs 21 +# that have limited display capabilities. +UNUSUAL_OK_LATIN_1 = ¡¢£¤¥¦§¨©«¬®¯°±²³´¶·¸¹»¼½¾¿×÷ # Non-ASCII non-letters that OK_CHAR allows, as these characters are # useful in commentary. -UNUSUAL_OK_CHARSET= $(UNUSUAL_OK_LATIN_1)$(UNUSUAL_OK_IPA) +UNUSUAL_OK_CHARSET= $(UNUSUAL_OK_LATIN_1) # Put this in a bracket expression to match spaces. s = [:space:] @@ -833,7 +833,7 @@ check_slashed_abbrs: $(TDATA_TO_CHECK) CHECK_CC_LIST = { n = split($$1,a,/,/); for (i=2; i<=n; i++) print a[1], a[i]; } -check_sorted: backward backzone iso3166.tab zone.tab zone1970.tab +check_sorted: backward backzone $(AWK) '/^Link/ {printf "%.5d %s\n", g, $$3} !/./ {g++}' \ backward | LC_ALL=C sort -cu $(AWK) '/^Zone/ {print $$2}' backzone | LC_ALL=C sort -cu diff --git a/contrib/tzcode/NEWS b/contrib/tzcode/NEWS index 701e490e4834..b54538aa4a82 100644 --- a/contrib/tzcode/NEWS +++ b/contrib/tzcode/NEWS @@ -1,5 +1,116 @@ News for the tz database +Release 2023c - 2023-03-28 12:42:14 -0700 + + Changes to past and future timestamps + + Model Lebanon's DST chaos by reverting data to tzdb 2023a. + (Thanks to Rany Hany for the heads-up.) + + +Release 2023b - 2023-03-23 19:50:38 -0700 + + Changes to future timestamps + + This year Lebanon springs forward April 20/21 not March 25/26. + (Thanks to Saadallah Itani.) [This was reverted in 2023c.] + + +Release 2023a - 2023-03-22 12:39:33 -0700 + + Briefly: + Egypt now uses DST again, from April through October. + This year Morocco springs forward April 23, not April 30. + Palestine delays the start of DST this year. + Much of Greenland still uses DST from 2024 on. + America/Yellowknife now links to America/Edmonton. + tzselect can now use current time to help infer timezone. + The code now defaults to C99 or later. + Fix use of C23 attributes. + + Changes to future timestamps + + Starting in 2023, Egypt will observe DST from April's last Friday + through October's last Thursday. (Thanks to Ahmad ElDardiry.) + Assume the transition times are 00:00 and 24:00, respectively. + + In 2023 Morocco's spring-forward transition after Ramadan + will occur April 23, not April 30. (Thanks to Milamber.) + Adjust predictions for future years accordingly. This affects + predictions for 2023, 2031, 2038, and later years. + + This year Palestine will delay its spring forward from + March 25 to April 29 due to Ramadan. (Thanks to Heba Hamad.) + Make guesses for future Ramadans too. + + Much of Greenland, represented by America/Nuuk, will continue to + observe DST using European Union rules. When combined with + Greenland's decision not to change the clocks in fall 2023, + America/Nuuk therefore changes from -03/-02 to -02/-01 effective + 2023-10-29 at 01:00 UTC. (Thanks to Thomas M. Steenholdt.) + This change from 2022g doesn't affect timestamps until 2024-03-30, + and doesn't affect tm_isdst until 2023-03-25. + + Changes to past timestamps + + America/Yellowknife has changed from a Zone to a backward + compatibility Link, as it no longer differs from America/Edmonton + since 1970. (Thanks to Almaz Mingaleev.) This affects some + pre-1948 timestamps. The old data are now in 'backzone'. + + Changes to past time zone abbreviations + + When observing Moscow time, Europe/Kirov and Europe/Volgograd now + use the abbreviations MSK/MSD instead of numeric abbreviations, + for consistency with other timezones observing Moscow time. + + Changes to code + + You can now tell tzselect local time, to simplify later choices. + Select the 'time' option in its first prompt. + + You can now compile with -DTZNAME_MAXIMUM=N to limit time zone + abbreviations to N bytes (default 255). The reference runtime + library now rejects POSIX-style TZ strings that contain longer + abbreviations, treating them as UTC. Previously the limit was + platform dependent and abbreviations were silently truncated to + 16 bytes even when the limit was greater than 16. + + The code by default is now designed for C99 or later. To build in + a C89 environment, compile with -DPORT_TO_C89. To support C89 + callers of the tzcode library, compile with -DSUPPORT_C89. The + two new macros are transitional aids planned to be removed in a + future version, when C99 or later will be required. + + The code now builds again on pre-C99 platforms, if you compile + with -DPORT_TO_C89. This fixes a bug introduced in 2022f. + + On C23-compatible platforms tzcode no longer uses syntax like + 'static [[noreturn]] void usage(void);'. Instead, it uses + '[[noreturn]] static void usage(void);' as strict C23 requires. + (Problem reported by Houge Langley.) + + The code's functions now constrain their arguments with the C + 'restrict' keyword consistently with their documentation. + This may allow future optimizations. + + zdump again builds standalone with ckdadd and without setenv, + fixing a bug introduced in 2022g. (Problem reported by panic.) + + leapseconds.awk can now process a leap seconds file that never + expires; this might be useful if leap seconds are discontinued. + + Changes to commentary + + tz-link.html has a new section "Coordinating with governments and + distributors". (Thanks to Neil Fuller for some of the text.) + + To improve tzselect diagnostics, zone1970.tab's comments column is + now limited to countries that have multiple timezones. + + Note that leap seconds are planned to be discontinued by 2035. + + Release 2022g - 2022-11-29 08:58:31 -0800 Briefly: @@ -596,7 +707,7 @@ Release 2021b - 2021-09-24 16:23:00 -0700 Starting with 2020a, zic -L truncated its output according to the "Expires" directive or "#expires" comment in the leapseconds file. The resulting TZif files omitted daylight saving transitions after - the leap second table expired, which led to far less-accurate + the leap second table expired, which led to far less accurate predictions of times after the expiry. Although future timestamps cannot be converted accurately in the presence of leap seconds, it is more accurate to convert near-future timestamps with a few @@ -616,7 +727,7 @@ Release 2021b - 2021-09-24 16:23:00 -0700 zic -L LEAPFILE -r @LO no longer generates an invalid TZif file that omits leap second information for the range LO..B when LO falls between two leap seconds A and B. Instead, it generates a - TZif version 4 file that represents the previously-missing + TZif version 4 file that represents the previously missing information. The TZif reader now allows the leap second table to begin with a @@ -670,7 +781,7 @@ Release 2021b - 2021-09-24 16:23:00 -0700 Fix a bug with 'zic -r @X' when X is a negative leap second that has a nonnegative correction. Without the fix, the output file was truncated so that X appeared to be a positive leap second. - Fix a similar, even-less-likely bug when truncating at a positive + Fix a similar, even less likely bug when truncating at a positive leap second that has a nonpositive correction. zic -r now reports an error if given rolling leap seconds, as this @@ -691,7 +802,7 @@ Release 2021b - 2021-09-24 16:23:00 -0700 fixing a bug introduced in 2014g. zdump -v now outputs timestamps at boundaries of what localtime - and gmtime can represent, instead of the less-useful timestamps + and gmtime can represent, instead of the less useful timestamps one day after the minimum and one day before the maximum. (Thanks to Arthur David Olson for prototype code, and to Manuela Friedrich for debugging help.) @@ -2311,7 +2422,7 @@ Release 2016g - 2016-09-13 08:56:38 -0700 names internally. zdump has a new -i option to generate transitions in a - more-compact but still human-readable format. This option is + smaller but still human-readable format. This option is experimental, and the output format may change in future versions. (Thanks to Jon Skeet for suggesting that an option was needed, and thanks to Tim Parenti and Chris Rovick for further comments.) @@ -2333,7 +2444,7 @@ Release 2016g - 2016-09-13 08:56:38 -0700 release 2016g, the version number is now something like '2016g-23-g50556e3-dirty' instead of the misleading '2016g'. Tagged releases use the same version number format as before, - e.g., '2016g'. To support the more-accurate version number, its + e.g., '2016g'. To support the more accurate version number, its specification has moved from a line in the Makefile to a new source file 'version'. @@ -2964,7 +3075,7 @@ Release 2014i - 2014-10-21 22:04:57 -0700 Since Belarus is not changing its clocks even though Moscow is, the time zone abbreviation in Europe/Minsk is changing from FET - to its more-traditional value MSK on 2014-10-26 at 01:00. + to its more traditional value MSK on 2014-10-26 at 01:00. (Thanks to Alexander Bokovoy for the heads-up about Belarus.) The new abbreviation IDT stands for the pre-1976 use of UT +08 in @@ -3056,7 +3167,7 @@ Release 2014h - 2014-09-25 18:59:03 -0700 Changes affecting build procedure - 'make check' now checks better for properly-sorted data. + 'make check' now checks better for properly sorted data. Changes affecting documentation and commentary @@ -3557,7 +3668,7 @@ Release 2014a - 2014-03-07 23:30:29 -0800 Changes affecting past timestamps - Fiji ended DST on 2014-01-19 at 02:00, not the previously-scheduled 03:00. + Fiji ended DST on 2014-01-19 at 02:00, not the previously scheduled 03:00. (Thanks to Steffen Thorsen.) Ukraine switched from Moscow to Eastern European time on 1990-07-01 @@ -3811,7 +3922,7 @@ Release 2013e - 2013-09-19 23:50:04 -0700 Allow POSIX-like TZ strings where the transition time's hour can range from -167 through 167, instead of the POSIX-required 0 through 24. E.g., TZ='FJT-12FJST,M10.3.1/146,M1.3.4/75' for the - new Fiji rules. This is a more-compact way to represent + new Fiji rules. This is a more compact way to represent far-future timestamps for America/Godthab, America/Santiago, Antarctica/Palmer, Asia/Gaza, Asia/Hebron, Asia/Jerusalem, Pacific/Easter, and Pacific/Fiji. Other zones are unaffected by @@ -3819,7 +3930,7 @@ Release 2013e - 2013-09-19 23:50:04 -0700 Allow POSIX-like TZ strings where daylight saving time is in effect all year. E.g., TZ='WART4WARST,J1/0,J365/25' for Western - Argentina Summer Time all year. This supports a more-compact way + Argentina Summer Time all year. This supports a more compact way to represent the 2013d data for America/Argentina/San_Luis. Because of the change for San Luis noted above this change does not affect the current data. (Thanks to Andrew Main (Zefram) for @@ -3908,13 +4019,13 @@ Release 2013e - 2013-09-19 23:50:04 -0700 zdump now outputs "UT" when referring to Universal Time, not "UTC". "UTC" does not make sense for timestamps that predate the introduction - of UTC, whereas "UT", a more-generic term, does. (Thanks to Steve Allen + of UTC, whereas "UT", a more generic term, does. (Thanks to Steve Allen for clarifying UT vs UTC.) Data changes affecting behavior of tzselect and similar programs - Country code BQ is now called the more-common name "Caribbean Netherlands" - rather than the more-official "Bonaire, St Eustatius & Saba". + Country code BQ is now called the more common name "Caribbean Netherlands" + rather than the more official "Bonaire, St Eustatius & Saba". Remove from zone.tab the names America/Montreal, America/Shiprock, and Antarctica/South_Pole, as they are equivalent to existing @@ -4098,7 +4209,7 @@ Release 2013c - 2013-04-19 16:17:40 -0700 Macquarie Island is politically part of Australia, not Antarctica. (Thanks to Tobias Conradi.) - Sort Macquarie more-consistently with other parts of Australia. + Sort Macquarie more consistently with other parts of Australia. (Thanks to Tim Parenti.) @@ -5322,7 +5433,7 @@ Release data1998g - 1998-08-11 03:28:35 -0000 Release data1998f - 1998-07-20 13:50:00 -0000 [tzdata1998f.tar.gz is missing!] - Update the "leapseconds" file to include the newly-announced + Update the "leapseconds" file to include the newly announced insertion at the end of 1998. diff --git a/contrib/tzcode/asctime.c b/contrib/tzcode/asctime.c index 1a6486f38163..b129ea22dd1b 100644 --- a/contrib/tzcode/asctime.c +++ b/contrib/tzcode/asctime.c @@ -52,8 +52,18 @@ enum { STD_ASCTIME_BUF_SIZE = 26 }; */ static char buf_asctime[2*3 + 5*INT_STRLEN_MAXIMUM(int) + 7 + 2 + 1 + 1]; +/* A similar buffer for ctime. + C89 requires that they be the same buffer. + This requirement was removed in C99, so support it only if requested, + as support is more likely to lead to bugs in badly written programs. */ +#if SUPPORT_C89 +# define buf_ctime buf_asctime +#else +static char buf_ctime[sizeof buf_asctime]; +#endif + char * -asctime_r(register const struct tm *timeptr, char *buf) +asctime_r(struct tm const *restrict timeptr, char *restrict buf) { static const char wday_name[][4] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" @@ -93,7 +103,8 @@ asctime_r(register const struct tm *timeptr, char *buf) timeptr->tm_mday, timeptr->tm_hour, timeptr->tm_min, timeptr->tm_sec, year); - if (strlen(result) < STD_ASCTIME_BUF_SIZE || buf == buf_asctime) + if (strlen(result) < STD_ASCTIME_BUF_SIZE + || buf == buf_ctime || buf == buf_asctime) return strcpy(buf, result); else { errno = EOVERFLOW; @@ -106,3 +117,17 @@ asctime(register const struct tm *timeptr) { return asctime_r(timeptr, buf_asctime); } + +char * +ctime_r(const time_t *timep, char *buf) +{ + struct tm mytm; + struct tm *tmp = localtime_r(timep, &mytm); + return tmp ? asctime_r(tmp, buf) : NULL; +} + +char * +ctime(const time_t *timep) +{ + return ctime_r(timep, buf_ctime); +} diff --git a/contrib/tzcode/date.1 b/contrib/tzcode/date.1 index 043e568117df..e8107212364d 100644 --- a/contrib/tzcode/date.1 +++ b/contrib/tzcode/date.1 @@ -1,6 +1,6 @@ .\" This file is in the public domain, so clarified as of .\" 2009-05-17 by Arthur David Olson. -.TH date 1 +.TH date 1 "" "Time Zone Database" .SH NAME date \- show and set date and time .SH SYNOPSIS @@ -156,7 +156,8 @@ hexadecimal (leading 0x), preceded by an optional sign. .br /usr/share/zoneinfo timezone information directory .br -/usr/share/zoneinfo/posixrules used with POSIX-style TZ's +/usr/share/zoneinfo/posixrules default DST rules (obsolete, + and can cause bugs if present) .br /usr/share/zoneinfo/GMT for UTC leap seconds .sp diff --git a/contrib/tzcode/date.c b/contrib/tzcode/date.c index 11c5e5fe8d49..b62f04d768bc 100644 --- a/contrib/tzcode/date.c +++ b/contrib/tzcode/date.c @@ -42,7 +42,7 @@ static void display(const char *, time_t); static void dogmt(void); static void errensure(void); static void timeout(FILE *, const char *, const struct tm *); -static ATTRIBUTE_NORETURN void usage(void); +ATTRIBUTE_NORETURN static void usage(void); int main(const int argc, char *argv[]) @@ -86,7 +86,9 @@ main(const int argc, char *argv[]) else if (! (TIME_T_MIN <= secs && secs <= TIME_T_MAX)) errno = ERANGE; if (errno) { - perror(optarg); + char const *e = strerror(errno); + fprintf(stderr, _("date: %s: %s\n"), + optarg, e); errensure(); exit(retval); } @@ -124,10 +126,10 @@ dogmt(void) continue; #if defined ckd_add && defined ckd_mul if (!ckd_add(&n, n, 2) && !ckd_mul(&n, n, sizeof *fakeenv) - && n <= SIZE_MAX) + && n <= INDEX_MAX) fakeenv = malloc(n); #else - if (n <= min(PTRDIFF_MAX, SIZE_MAX) / sizeof *fakeenv - 2) + if (n <= INDEX_MAX / sizeof *fakeenv - 2) fakeenv = malloc((n + 2) * sizeof *fakeenv); #endif if (fakeenv == NULL) { @@ -194,10 +196,9 @@ timeout(FILE *fp, char const *format, struct tm const *tmp) for ( ; ; ) { #ifdef ckd_mul - bool bigger = !ckd_mul(&size, size, 2) && size <= SIZE_MAX; + bool bigger = !ckd_mul(&size, size, 2) && size <= INDEX_MAX; #else - bool bigger = (size <= min(PTRDIFF_MAX, SIZE_MAX) / 2 - && (size *= 2, true)); + bool bigger = size <= INDEX_MAX / 2 && (size *= 2, true); #endif char *newcp = bigger ? realloc(cp, size) : NULL; if (!newcp) { diff --git a/contrib/tzcode/localtime.c b/contrib/tzcode/localtime.c index a8beaf47319a..3bf9378fe673 100644 --- a/contrib/tzcode/localtime.c +++ b/contrib/tzcode/localtime.c @@ -47,10 +47,6 @@ static int lock(void) { return 0; } static void unlock(void) { } #endif -#ifndef TZ_ABBR_MAX_LEN -# define TZ_ABBR_MAX_LEN 16 -#endif /* !defined TZ_ABBR_MAX_LEN */ - #ifndef TZ_ABBR_CHAR_SET # define TZ_ABBR_CHAR_SET \ "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 :+-._" @@ -128,12 +124,11 @@ static char const UNSPEC[] = "-00"; for ttunspecified to work without crashing. */ enum { CHARS_EXTRA = max(sizeof UNSPEC, 2) - 1 }; -#ifdef TZNAME_MAX -# define MY_TZNAME_MAX TZNAME_MAX -#endif /* defined TZNAME_MAX */ -#ifndef TZNAME_MAX -# define MY_TZNAME_MAX 255 -#endif /* !defined TZNAME_MAX */ +/* Limit to time zone abbreviation length in POSIX-style TZ strings. + This is distinct from TZ_MAX_CHARS, which limits TZif file contents. */ +#ifndef TZNAME_MAXIMUM +# define TZNAME_MAXIMUM 255 +#endif struct state { int leapcnt; @@ -146,7 +141,7 @@ struct state { unsigned char types[TZ_MAX_TIMES]; struct ttinfo ttis[TZ_MAX_TYPES]; char chars[max(max(TZ_MAX_CHARS + CHARS_EXTRA, sizeof "UTC"), - 2 * (MY_TZNAME_MAX + 1))]; + 2 * (TZNAME_MAXIMUM + 1))]; struct lsinfo lsis[TZ_MAX_LEAPS]; /* The time type to use for early times or if no transitions. @@ -203,6 +198,9 @@ static pthread_once_t gmt_once = PTHREAD_ONCE_INIT; static pthread_once_t gmtime_once = PTHREAD_ONCE_INIT; static pthread_key_t gmtime_key; static int gmtime_key_error; +static pthread_once_t offtime_once = PTHREAD_ONCE_INIT; +static pthread_key_t offtime_key; +static int offtime_key_error; static pthread_once_t localtime_once = PTHREAD_ONCE_INIT; static pthread_key_t localtime_key; static int localtime_key_error; @@ -213,9 +211,14 @@ static int localtime_key_error; ** ctime, gmtime, localtime] return values in one of two static ** objects: a broken-down time structure and an array of char. ** Thanks to Paul Eggert for noting this. +** +** This requirement was removed in C99, so support it only if requested, +** as support is more likely to lead to bugs in badly written programs. */ +#if SUPPORT_C89 static struct tm tm; +#endif #if 2 <= HAVE_TZNAME + TZ_TIME_T char * tzname[2] = { @@ -367,27 +370,28 @@ settzname(void) #endif } -static void +/* Replace bogus characters in time zone abbreviations. + Return 0 on success, an errno value if a time zone abbreviation is + too long. */ +static int scrub_abbrs(struct state *sp) { int i; - /* - ** First, replace bogus characters. - */ + + /* Reject overlong abbreviations. */ + for (i = 0; i < sp->charcnt - (TZNAME_MAXIMUM + 1); ) { + int len = strlen(&sp->chars[i]); + if (TZNAME_MAXIMUM < len) + return EOVERFLOW; + i += len + 1; + } + + /* Replace bogus characters. */ for (i = 0; i < sp->charcnt; ++i) if (strchr(TZ_ABBR_CHAR_SET, sp->chars[i]) == NULL) sp->chars[i] = TZ_ABBR_ERR_CHAR; - /* - ** Second, truncate long abbreviations. - */ - for (i = 0; i < sp->typecnt; ++i) { - register const struct ttinfo * const ttisp = &sp->ttis[i]; - char *cp = &sp->chars[ttisp->tt_desigidx]; - if (strlen(cp) > TZ_ABBR_MAX_LEN && - strcmp(cp, GRANDPARENTED) != 0) - *(cp + TZ_ABBR_MAX_LEN) = '\0'; - } + return 0; } #ifdef DETECT_TZ_CHANGES @@ -898,7 +902,7 @@ is_digit(char c) ** Return a pointer to that character. */ -static ATTRIBUTE_REPRODUCIBLE const char * +ATTRIBUTE_REPRODUCIBLE static const char * getzname(register const char *strp) { register char c; @@ -919,7 +923,7 @@ getzname(register const char *strp) ** We don't do any checking here; checking is done later in common-case code. */ -static ATTRIBUTE_REPRODUCIBLE const char * +ATTRIBUTE_REPRODUCIBLE static const char * getqzname(register const char *strp, const int delim) { register int c; @@ -1199,14 +1203,12 @@ tzparse(const char *name, struct state *sp, struct state *basep) name = getzname(name); stdlen = name - stdname; } - if (!stdlen) + if (! (0 < stdlen && stdlen <= TZNAME_MAXIMUM)) return false; name = getoffset(name, &stdoffset); if (name == NULL) return false; charcnt = stdlen + 1; - if (sizeof sp->chars < charcnt) - return false; if (basep) { if (0 < basep->timecnt) atlo = basep->ats[basep->timecnt - 1]; @@ -1233,11 +1235,9 @@ tzparse(const char *name, struct state *sp, struct state *basep) name = getzname(name); dstlen = name - dstname; /* length of DST abbr. */ } - if (!dstlen) + if (! (0 < dstlen && dstlen <= TZNAME_MAXIMUM)) return false; charcnt += dstlen + 1; - if (sizeof sp->chars < charcnt) - return false; if (*name != '\0' && *name != ',' && *name != ';') { name = getoffset(name, &dstoffset); if (name == NULL) @@ -1511,7 +1511,7 @@ zoneinit(struct state *sp, char const *name) if (err != 0 && name && name[0] != ':' && tzparse(name, sp, NULL)) err = 0; if (err == 0) - scrub_abbrs(sp); + err = scrub_abbrs(sp); return err; } } @@ -1732,7 +1732,8 @@ localsub(struct state const *sp, time_t const *timep, int_fast32_t setname, #if NETBSD_INSPIRED struct tm * -localtime_rz(struct state *sp, time_t const *timep, struct tm *tmp) +localtime_rz(struct state *restrict sp, time_t const *restrict timep, + struct tm *restrict tmp) { return localsub(sp, timep, 0, tmp); } @@ -1766,6 +1767,9 @@ localtime_key_init(void) struct tm * localtime(const time_t *timep) { +#if !SUPPORT_C89 + static struct tm tm; +#endif struct tm *p_tm = &tm; if (__isthreaded != 0) { @@ -1788,7 +1792,7 @@ localtime(const time_t *timep) } struct tm * -localtime_r(const time_t *timep, struct tm *tmp) +localtime_r(const time_t *restrict timep, struct tm *restrict tmp) { return localtime_tzset(timep, tmp, false); } @@ -1821,7 +1825,7 @@ gmtsub(ATTRIBUTE_MAYBE_UNUSED struct state const *sp, time_t const *timep, */ struct tm * -gmtime_r(const time_t *timep, struct tm *tmp) +gmtime_r(time_t const *restrict timep, struct tm *restrict tmp) { _once(&gmt_once, gmtcheck); return gmtsub(gmtptr, timep, 0, tmp); @@ -1837,6 +1841,9 @@ gmtime_key_init(void) struct tm * gmtime(const time_t *timep) { +#if !SUPPORT_C89 + static struct tm tm; +#endif struct tm *p_tm = &tm; if (__isthreaded != 0) { @@ -1858,16 +1865,50 @@ gmtime(const time_t *timep) return gmtime_r(timep, p_tm); } -#ifdef STD_INSPIRED +#if STD_INSPIRED + +struct tm * +offtime_r(time_t const *restrict timep, long offset, struct tm *restrict tmp) +{ + _once(&gmt_once, gmtcheck); + return gmtsub(gmtptr, timep, offset, tmp); +} + +static void +offtime_key_init(void) +{ + + offtime_key_error = _pthread_key_create(&offtime_key, free); +} struct tm * offtime(const time_t *timep, long offset) { - _once(&gmt_once, gmtcheck); - return gmtsub(gmtptr, timep, offset, &tm); +#if !SUPPORT_C89 + static struct tm tm; +#endif + struct tm *p_tm = &tm; + + if (__isthreaded != 0) { + _pthread_once(&offtime_once, offtime_key_init); + if (offtime_key_error != 0) { + errno = offtime_key_error; + return (NULL); + } + if ((p_tm = _pthread_getspecific(offtime_key)) == NULL) { + if ((p_tm = malloc(sizeof(*p_tm))) == NULL) { + return (NULL); + } + if (_pthread_setspecific(offtime_key, p_tm) != 0) { + free(p_tm); + return (NULL); + } + } + } + return offtime_r(timep, offset, p_tm); } -#endif /* defined STD_INSPIRED */ +#endif /* ** Return the number of leap years through the end of the given year @@ -2003,27 +2044,6 @@ timesub(const time_t *timep, int_fast32_t offset, return tmp; } -char * -ctime(const time_t *timep) -{ -/* -** Section 4.12.3.2 of X3.159-1989 requires that -** The ctime function converts the calendar time pointed to by timer -** to local time in the form of a string. It is equivalent to -** asctime(localtime(timer)) -*/ - struct tm *tmp = localtime(timep); - return tmp ? asctime(tmp) : NULL; -} - -char * -ctime_r(const time_t *timep, char *buf) -{ - struct tm mytm; - struct tm *tmp = localtime_r(timep, &mytm); - return tmp ? asctime_r(tmp, buf) : NULL; -} - /* ** Adapted from code provided by Robert Elz, who writes: ** The "best" way to do mktime I think is based on an idea of Bob @@ -2465,7 +2485,7 @@ mktime_tzname(struct state *sp, struct tm *tmp, bool setname) #if NETBSD_INSPIRED time_t -mktime_z(struct state *sp, struct tm *tmp) +mktime_z(struct state *restrict sp, struct tm *restrict tmp) { return mktime_tzname(sp, tmp, false); } @@ -2487,7 +2507,7 @@ mktime(struct tm *tmp) return t; } -#ifdef STD_INSPIRED +#if STD_INSPIRED time_t timelocal(struct tm *tmp) { @@ -2539,7 +2559,7 @@ leapcorr(struct state const *sp, time_t t) ** XXX--is the below the right way to conditionalize?? */ -#ifdef STD_INSPIRED +#if STD_INSPIRED /* NETBSD_INSPIRED_EXTERN functions are exported to callers if NETBSD_INSPIRED is defined, and are private otherwise. */ @@ -2628,7 +2648,7 @@ posix2time(time_t t) return t; } -#endif /* defined STD_INSPIRED */ +#endif /* STD_INSPIRED */ #if TZ_TIME_T diff --git a/contrib/tzcode/newctime.3 b/contrib/tzcode/newctime.3 index e25d841ef537..05bb7deaba51 100644 --- a/contrib/tzcode/newctime.3 +++ b/contrib/tzcode/newctime.3 @@ -1,6 +1,6 @@ .\" This file is in the public domain, so clarified as of .\" 2009-05-17 by Arthur David Olson. -.TH NEWCTIME 3 +.TH newctime 3 "" "Time Zone Database" .SH NAME asctime, ctime, difftime, gmtime, localtime, mktime \- convert date and time .SH SYNOPSIS @@ -11,13 +11,13 @@ asctime, ctime, difftime, gmtime, localtime, mktime \- convert date and time .PP .BR "extern char *tzname[];" " /\(** (optional) \(**/" .PP -.B char *ctime(time_t const *clock); +.B [[deprecated]] char *ctime(time_t const *clock); .PP .B char *ctime_r(time_t const *clock, char *buf); .PP .B double difftime(time_t time1, time_t time0); .PP -.B char *asctime(struct tm const *tm); +.B [[deprecated]] char *asctime(struct tm const *tm); .PP .B "char *asctime_r(struct tm const *restrict tm," .B " char *restrict result);" @@ -91,6 +91,15 @@ introduction of UTC and are some other flavor of Universal Time (UT). Some implementations support leap seconds, in contradiction to POSIX. .PP The +.B ctime +function is deprecated starting in C23. +Callers can use +.B localtime_r +and +.B strftime +instead. +.PP +The .B localtime and .B gmtime @@ -128,6 +137,10 @@ converts a time value contained in a structure to a string, as shown in the above example, and returns a pointer to the string. +This function is deprecated starting in C23. +Callers can use +.B strftime +instead. .PP The .B mktime @@ -283,7 +296,8 @@ continue to exist in this form in future releases of this code. .br /usr/share/zoneinfo/localtime local timezone file *** 1870 LINES SKIPPED *** From nobody Wed Dec 13 20:06:22 2023 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 4Sr61p55GZz54FLn; Wed, 13 Dec 2023 20:06:22 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sr61p3kF9z4YpN; Wed, 13 Dec 2023 20:06:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702497982; 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=WTLJ8xajZGxoC49L4nntC/e3IpvEmVhog92bnc2wBpg=; b=M3kaQ55+gntyZ95AlPywa55usbST0AYI+Km6aXdB22yHCaWOOdBhIZgnHSFncGlnqXDXp3 8V8WIF8u6PQ1Y7zJWJzMPSqYXYszQGS9qgbb4G1udNbHDLXjIajhbALOgjFY2g4Om/uKoh A5RuEmJsZxdZh9U0Vtw4G9aWXjaqXxE5xBdtS9mz+O1tq0KNShPZIYG6+QU7P4HFI6Ezqx JOdNDADJSsIh7JZJUoOewNKEw3/jLQpK5CcOUZbb3zsRLQlxQhBcSPNEgjMkQ06LO/A7vJ tINlwaraqAkbZTsNMKsNlxfl2W8yR7Q2dioyeTxa+q7u+MlckXjXQ4bvEhKuZA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702497982; a=rsa-sha256; cv=none; b=xIilenwQ1I6wvJ0RTMyx8Xkrs2ucqQ/S1Ri05VKDJMRWnHSWRUcXxTQeBYqFMVw/7LcFxv WkHk5jzcG76TSBkAk3v5y5bVNXwFyqW44qTVwx48FK6wDKyh1msLYpZ6phM0Ib5BEUcI1o bRYu5BBId+BtDPUWyeGViyQRioHuObzb53EQVjGGHBOeAFtllhCdgUC175wFgwtdyM7TFd QzcfirBPhBy5vWDIfgFEu72Dqmk1kFPewnAi5c4NYdusMQFEYpU9n96dTxByUbmNdcSpTK 9MyMveYh7WbUJSHZVPtiIefxUqD9ZgyIZ1ELyW3wdJQAE4PZ7rmMMFoNMU0wCQ== 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=1702497982; 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=WTLJ8xajZGxoC49L4nntC/e3IpvEmVhog92bnc2wBpg=; b=PqYN0IUV55rnqqEP6NAO0cIKVXq85sd5xfHKR/dhlAg2iP8NVm5hy67QKt8N0qOjhloUBd +vdimyCDRzLzm6zhoAyulPbCXcQW+EFr2fXT81q2FHG3aFq8dNVHtnY36rvBMak4JhhdUN HPsYCoB+UFf66Af3XWvIP2rdR9i2geH2RnR5COYnrkr+/7QpyYXBfH56SqlvrsZWWhpAlj yeJzFSjE7J/vA4B9rsRBd3iBCHdRIaZb5phZUQe+v12dputRA89dP1HwBXIaOUWEnTXRnK 9z74n5XmFcoGKXl+ycfwq5o/TvZuSsAdMOilNxMUXNpgCRNIY3jdPz+yoJrI3g== 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 4Sr61p2knwz1C3F; Wed, 13 Dec 2023 20:06:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BDK6MSW087063; Wed, 13 Dec 2023 20:06:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BDK6MQm087060; Wed, 13 Dec 2023 20:06:22 GMT (envelope-from git) Date: Wed, 13 Dec 2023 20:06:22 GMT Message-Id: <202312132006.3BDK6MQm087060@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 06c9bece28c3 - stable/13 - growfs: make exit codes more consistent 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 06c9bece28c397111f10f14d9ab22208cf61f5c4 Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=06c9bece28c397111f10f14d9ab22208cf61f5c4 commit 06c9bece28c397111f10f14d9ab22208cf61f5c4 Author: Mina Galić AuthorDate: 2023-10-05 18:24:53 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-12-13 16:19:56 +0000 growfs: make exit codes more consistent We have overused err(1), so it's hard to distinguish when an error is very, very serious, and when it's just a user-error, or even harmless. This patch changes the current behaviour to distinguish between the following three: 1 for usage errors 2 for recoverable errors 3 or higher for unrecoverable errors Reviewed by: jilles, pauamma_gundo.com, des Differential Revision: https://reviews.freebsd.org/D27161 (cherry picked from commit 70a0fb43f91cfe3d08db7cb443d9690f8bff065e) --- sbin/growfs/growfs.8 | 6 +++++- sbin/growfs/growfs.c | 42 +++++++++++++++++++++--------------------- 2 files changed, 26 insertions(+), 22 deletions(-) diff --git a/sbin/growfs/growfs.8 b/sbin/growfs/growfs.8 index ec606f8caf8f..171cd5592c32 100644 --- a/sbin/growfs/growfs.8 +++ b/sbin/growfs/growfs.8 @@ -36,7 +36,7 @@ .\" .\" $TSHeader: src/sbin/growfs/growfs.8,v 1.3 2000/12/12 19:31:00 tomsoft Exp $ .\" -.Dd December 13, 2017 +.Dd October 3, 2023 .Dt GROWFS 8 .Os .Sh NAME @@ -88,6 +88,10 @@ This value defaults to the size of the raw partition specified in .Nm will enlarge the file system to the size of the entire partition). .El +.Sh EXIT STATUS +Exit status is 0 on success, and >= 1 on errors. +Errors recoverable by user action are indicated by 2. +OS errors, which are usually not recoverable, are indicated by 3 or greater. .Sh EXAMPLES Expand root file system to fill up available space: .Dl growfs / diff --git a/sbin/growfs/growfs.c b/sbin/growfs/growfs.c index 423ecbeed722..22d4f895ed26 100644 --- a/sbin/growfs/growfs.c +++ b/sbin/growfs/growfs.c @@ -147,7 +147,7 @@ growfs(int fsi, int fso, unsigned int Nflag) */ fscs = (struct csum *)calloc((size_t)1, (size_t)sblock.fs_cssize); if (fscs == NULL) - errx(1, "calloc failed"); + errx(3, "calloc failed"); memcpy(fscs, osblock.fs_csp, osblock.fs_cssize); free(osblock.fs_csp); osblock.fs_csp = NULL; @@ -259,7 +259,7 @@ growfs(int fsi, int fso, unsigned int Nflag) * and all the alternates back to disk. */ if (!Nflag && sbput(fso, &sblock, sblock.fs_ncg) != 0) - errc(2, EIO, "could not write updated superblock"); + errc(3, EIO, "could not write updated superblock"); DBG_PRINT0("fscs written\n"); #ifdef FS_DEBUG @@ -1339,7 +1339,7 @@ main(int argc, char **argv) size <<= 30; size <<= 10; } else - errx(1, "unknown suffix on -s argument"); + errx(2, "unknown suffix on -s argument"); break; case 'v': /* for compatibility to newfs */ break; @@ -1364,23 +1364,23 @@ main(int argc, char **argv) statfsp = getmntpoint(*argv); device = getdev(*argv, statfsp); if (device == NULL) - errx(1, "cannot find special device for %s", *argv); + errx(2, "cannot find special device for %s", *argv); fsi = open(device, O_RDONLY); if (fsi < 0) - err(1, "%s", device); + err(3, "%s", device); /* * Try to guess the slice size if not specified. */ if (ioctl(fsi, DIOCGMEDIASIZE, &mediasize) == -1) - err(1,"DIOCGMEDIASIZE"); + err(3,"DIOCGMEDIASIZE"); /* * Check if that partition is suitable for growing a file system. */ if (mediasize < 1) - errx(1, "partition is unavailable"); + errx(2, "partition is unavailable"); /* * Read the current superblock, and take a backup. @@ -1388,16 +1388,16 @@ main(int argc, char **argv) if ((ret = sbget(fsi, &fs, STDSB)) != 0) { switch (ret) { case ENOENT: - errx(1, "superblock not recognized"); + errx(2, "superblock not recognized"); default: - errc(1, ret, "unable to read superblock"); + errc(3, ret, "unable to read superblock"); } } /* * Check for filesystem that was unclean at mount time. */ if ((fs->fs_flags & (FS_UNCLEAN | FS_NEEDSFSCK)) != 0) - errx(1, "%s is not clean - run fsck.\n", *argv); + errx(2, "%s is not clean - run fsck.\n", *argv); memcpy(&osblock, fs, fs->fs_sbsize); free(fs); memcpy((void *)&fsun1, (void *)&fsun2, osblock.fs_sbsize); @@ -1418,7 +1418,7 @@ main(int argc, char **argv) mediasize, "B", HN_AUTOSCALE, HN_B | HN_NOSPACE | HN_DECIMAL); - errx(1, "requested size %s is larger " + errx(2, "requested size %s is larger " "than the available %s", oldsizebuf, newsizebuf); } } @@ -1439,7 +1439,7 @@ main(int argc, char **argv) if (size == (uint64_t)(osblock.fs_size * osblock.fs_fsize)) errx(0, "requested size %s is equal to the current " "filesystem size %s", newsizebuf, oldsizebuf); - errx(1, "requested size %s is smaller than the current " + errx(2, "requested size %s is smaller than the current " "filesystem size %s", newsizebuf, oldsizebuf); } @@ -1451,7 +1451,7 @@ main(int argc, char **argv) * Are we really growing? */ if (osblock.fs_size >= sblock.fs_size) { - errx(1, "we are not growing (%jd->%jd)", + errx(3, "we are not growing (%jd->%jd)", (intmax_t)osblock.fs_size, (intmax_t)sblock.fs_size); } @@ -1461,7 +1461,7 @@ main(int argc, char **argv) if (yflag == 0) { for (j = 0; j < FSMAXSNAP; j++) { if (sblock.fs_snapinum[j]) { - errx(1, "active snapshot found in file system; " + errx(2, "active snapshot found in file system; " "please remove all snapshots before " "using growfs"); } @@ -1506,14 +1506,14 @@ main(int argc, char **argv) if (statfsp != NULL && (statfsp->f_flags & MNT_RDONLY) == 0) { fso = open(_PATH_UFSSUSPEND, O_RDWR); if (fso == -1) - err(1, "unable to open %s", _PATH_UFSSUSPEND); + err(3, "unable to open %s", _PATH_UFSSUSPEND); error = ioctl(fso, UFSSUSPEND, &statfsp->f_fsid); if (error != 0) - err(1, "UFSSUSPEND"); + err(3, "UFSSUSPEND"); } else { fso = open(device, O_WRONLY); if (fso < 0) - err(1, "%s", device); + err(3, "%s", device); } } @@ -1522,7 +1522,7 @@ main(int argc, char **argv) */ testbuf = malloc(sblock.fs_fsize); if (testbuf == NULL) - err(1, "malloc"); + err(3, "malloc"); rdfs((ufs2_daddr_t)((size - sblock.fs_fsize) / DEV_BSIZE), sblock.fs_fsize, testbuf, fsi); wtfs((ufs2_daddr_t)((size - sblock.fs_fsize) / DEV_BSIZE), @@ -1577,7 +1577,7 @@ main(int argc, char **argv) fragroundup(&sblock, sblock.fs_ncg * sizeof(struct csum)); if (osblock.fs_size >= sblock.fs_size) - errx(1, "not enough new space"); + errx(3, "not enough new space"); DBG_PRINT0("sblock calculated\n"); @@ -1591,11 +1591,11 @@ main(int argc, char **argv) if (statfsp != NULL && (statfsp->f_flags & MNT_RDONLY) == 0) { error = ioctl(fso, UFSRESUME); if (error != 0) - err(1, "UFSRESUME"); + err(3, "UFSRESUME"); } error = close(fso); if (error != 0) - err(1, "close"); + err(3, "close"); if (statfsp != NULL && (statfsp->f_flags & MNT_RDONLY) != 0 && chkdoreload(statfsp, warn) != 0) exit(9); From nobody Wed Dec 13 20:06:23 2023 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 4Sr61r0t56z54Fqd; Wed, 13 Dec 2023 20:06:24 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sr61q4MRPz4YxP; Wed, 13 Dec 2023 20:06:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702497983; 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=jTwEgdT/oLifh7gVMcTDvpMptNwMKXPMAejaUjhC/ek=; b=lIJtqL6c+zbuS96TBPk3bINBp4qdZCXkbc5xZPLdy2Nu/aB8I8FOTVYqVJfbjgSfdFBKBq dOJ+aAB1JdiosbyVCx6IapYHEtO1LwIwe2KdZZUb7L7QqS8DrHuPmlAKHbL6PKglY6rK2J +qXSvgm625Tc29ZJRUk4zOArRZhtXgw6dZRrdi8SMxv+7dCJgiMDcPvo3yji5pW+9I4DKT H0A/4Mq5OA1xoXdhHpnXzuCdUvBG02734kD5sE3KtySxAuf57DR5HEXFJDDT7iEwc8LcMD FGdZmzWjcw/oRUA+YLgXD9gmz2ZNaEYVLtqMQME2EnCMY0gPUtwrTd2a9nUiPg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702497983; a=rsa-sha256; cv=none; b=oqZkbBs/yW8Uz1hV/dnqUOcPfVX/9XjAov1Ctxjtabmhlgf75RtT9gs7cGr5klHFq02wLP LjeuOR/KN0Yu6HrkA91ZiIJpCLaJ4dTMC0l3TwiYI99nmUc5RcrhjzSs1mEes+kNgA2z8k jkimWrDjt8F/HCOyutBXI46YE2g3y+YxSTxKlcXk52/HibMbMYWbFv1J2hSk7q5rShzAL/ Nlb1ndeojkHWZlsxuujVkYHIvrLdSrJmY6KJvOki+9+0t9X+PPEVuAWz9HTfghP3qpS+Dy 7G5TGdFjOsAtZDSUF0apbaVPC8b29S7z/c8fByuqSjv6vpwOEP/NyPnPTkxgaw== 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=1702497983; 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=jTwEgdT/oLifh7gVMcTDvpMptNwMKXPMAejaUjhC/ek=; b=ERAkV1wDqzsxBQmFBDc1k5juIIQaLxOpLft2q0bOVQORdQ2Ok3qj7Evgq0AEsdEz47q4f6 0IIikjpkHOVPJrMGilKhicDBKhYWMi9ki6upQrMMTBjDOa4dLSaX8RiUpp66pw51Oanleh Mf04M7E46ZT2g15pMaUrt4pUHrOfQnGVH//j6fQLJU5lEUH/4xfP5nFb7SJrSIkvzllyiK +TImXE24nBwOAnlxbs9zs/z3bO038fdOkEKAgjraZjiA4Jesb3+fOWMO5umZ9cZWVD4rn4 DGNhOgTr5W51OkBS+hrsBXYUWnYEIOUzbFb6R2z8hTeSP0vB/F53WJbOyKUpaQ== 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 4Sr61q3Sm6z1C3G; Wed, 13 Dec 2023 20:06:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BDK6NS1087111; Wed, 13 Dec 2023 20:06:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BDK6Nhx087108; Wed, 13 Dec 2023 20:06:23 GMT (envelope-from git) Date: Wed, 13 Dec 2023 20:06:23 GMT Message-Id: <202312132006.3BDK6Nhx087108@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: b64f569e5c05 - stable/13 - daemon: use kqueue for all events 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b64f569e5c051ff1acbfd7fefb3d32005957fc80 Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=b64f569e5c051ff1acbfd7fefb3d32005957fc80 commit b64f569e5c051ff1acbfd7fefb3d32005957fc80 Author: Ihor Antonov AuthorDate: 2023-04-14 05:10:29 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-12-13 16:21:03 +0000 daemon: use kqueue for all events Refactor daemon to use kqueue/kevent instead of signals. This changes allows to simplify the code in several ways: - the execution flow is now linear, no async events. - several variables became redundant and got removed. - all event handling is now concentrated inside of the event loop, which makes code reading and comprehension easier. - new kqueuex(2) call is used for CLOEXEC, but maintained closing the kq fd prior to execve() to ease later MFC No UX/API changes are intended. Reviewed by: kevans Pull Request: https://github.com/freebsd/freebsd-src/pull/701 (cherry picked from commit 8935a3993219be76c7ea03e9ad4509657d08af6c) --- usr.sbin/daemon/daemon.c | 508 ++++++++++++++++++++++------------------------- 1 file changed, 239 insertions(+), 269 deletions(-) diff --git a/usr.sbin/daemon/daemon.c b/usr.sbin/daemon/daemon.c index 5bed64eaa0db..48609ad03d68 100644 --- a/usr.sbin/daemon/daemon.c +++ b/usr.sbin/daemon/daemon.c @@ -32,6 +32,7 @@ #include #include +#include #include #include @@ -57,11 +58,14 @@ #define LBUF_SIZE 4096 +enum daemon_mode { + MODE_DAEMON = 0, /* simply daemonize, no supervision */ + MODE_SUPERVISE, /* initial supervision state */ + MODE_TERMINATING, /* user requested termination */ + MODE_NOCHILD, /* child is terminated, final state of the event loop */ +}; + struct daemon_state { - sigset_t mask_orig; - sigset_t mask_read; - sigset_t mask_term; - sigset_t mask_susp; int pipe_fd[2]; char **argv; const char *child_pidfile; @@ -72,6 +76,8 @@ struct daemon_state { const char *user; struct pidfh *parent_pidfh; struct pidfh *child_pidfh; + enum daemon_mode mode; + int pid; int keep_cur_workdir; int restart_delay; int stdmask; @@ -79,33 +85,25 @@ struct daemon_state { int syslog_facility; int keep_fds_open; int output_fd; - bool supervision_enabled; - bool child_eof; bool restart_enabled; bool syslog_enabled; bool log_reopen; }; -static void setup_signals(struct daemon_state *); static void restrict_process(const char *); -static void handle_term(int); -static void handle_chld(int); -static void handle_hup(int); static int open_log(const char *); static void reopen_log(struct daemon_state *); static bool listen_child(int, struct daemon_state *); static int get_log_mapping(const char *, const CODE *); static void open_pid_files(struct daemon_state *); static void do_output(const unsigned char *, size_t, struct daemon_state *); -static void daemon_sleep(time_t, long); +static void daemon_sleep(struct daemon_state *); static void daemon_state_init(struct daemon_state *); static void daemon_eventloop(struct daemon_state *); static void daemon_terminate(struct daemon_state *); - -static volatile sig_atomic_t terminate = 0; -static volatile sig_atomic_t child_gone = 0; -static volatile sig_atomic_t pid = 0; -static volatile sig_atomic_t do_log_reopen = 0; +static void daemon_exec(struct daemon_state *); +static bool daemon_is_child_dead(struct daemon_state *); +static void daemon_set_child_pipe(struct daemon_state *); static const char shortopts[] = "+cfHSp:P:ru:o:s:l:t:m:R:T:h"; @@ -170,6 +168,10 @@ main(int argc, char *argv[]) daemon_state_init(&state); + /* Signals are processed via kqueue */ + signal(SIGHUP, SIG_IGN); + signal(SIGTERM, SIG_IGN); + /* * Supervision mode is enabled if one of the following options are used: * --child-pidfile -p @@ -205,7 +207,7 @@ main(int argc, char *argv[]) errx(5, "unrecognized syslog facility"); } state.syslog_enabled = true; - state.supervision_enabled = true; + state.mode = MODE_SUPERVISE; break; case 'm': state.stdmask = strtol(optarg, &p, 10); @@ -221,19 +223,19 @@ main(int argc, char *argv[]) * daemon could open the specified file and set it's * descriptor as both stderr and stout before execve() */ - state.supervision_enabled = true; + state.mode = MODE_SUPERVISE; break; case 'p': state.child_pidfile = optarg; - state.supervision_enabled = true; + state.mode = MODE_SUPERVISE; break; case 'P': state.parent_pidfile = optarg; - state.supervision_enabled = true; + state.mode = MODE_SUPERVISE; break; case 'r': state.restart_enabled = true; - state.supervision_enabled = true; + state.mode = MODE_SUPERVISE; break; case 'R': state.restart_enabled = true; @@ -249,11 +251,11 @@ main(int argc, char *argv[]) errx(4, "unrecognized syslog priority"); } state.syslog_enabled = true; - state.supervision_enabled = true; + state.mode = MODE_SUPERVISE; break; case 'S': state.syslog_enabled = true; - state.supervision_enabled = true; + state.mode = MODE_SUPERVISE; break; case 't': state.title = optarg; @@ -261,7 +263,7 @@ main(int argc, char *argv[]) case 'T': state.syslog_tag = optarg; state.syslog_enabled = true; - state.supervision_enabled = true; + state.mode = MODE_SUPERVISE; break; case 'u': state.user = optarg; @@ -302,246 +304,212 @@ main(int argc, char *argv[]) * to be able to report the error intelligently */ open_pid_files(&state); + + /* + * TODO: add feature to avoid backgrounding + * i.e. --foreground, -f + */ if (daemon(state.keep_cur_workdir, state.keep_fds_open) == -1) { warn("daemon"); daemon_terminate(&state); } - /* Write out parent pidfile if needed. */ - pidfile_write(state.parent_pidfh); - if (state.supervision_enabled) { - /* Block SIGTERM to avoid racing until the child is spawned. */ - if (sigprocmask(SIG_BLOCK, &state.mask_term, &state.mask_orig)) { - warn("sigprocmask"); - daemon_terminate(&state); - } + if (state.mode == MODE_DAEMON) { + daemon_exec(&state); + } - setup_signals(&state); + /* Write out parent pidfile if needed. */ + pidfile_write(state.parent_pidfh); - /* - * Try to protect against pageout kill. Ignore the - * error, madvise(2) will fail only if a process does - * not have superuser privileges. - */ - (void)madvise(NULL, 0, MADV_PROTECT); - } do { + state.mode = MODE_SUPERVISE; daemon_eventloop(&state); - close(state.pipe_fd[0]); - state.pipe_fd[0] = -1; - } while (state.restart_enabled && !terminate); + daemon_sleep(&state); + } while (state.restart_enabled); daemon_terminate(&state); } +static void +daemon_exec(struct daemon_state *state) +{ + pidfile_write(state->child_pidfh); -/* - * Main event loop: fork the child and watch for events. - * In legacy mode simply execve into the target process. - * - * Signal handling logic: - * - * - SIGTERM is masked while there is no child. - * - * - SIGCHLD is masked while reading from the pipe. SIGTERM has to be - * caught, to avoid indefinite blocking on read(). - * - * - Both SIGCHLD and SIGTERM are masked before calling sigsuspend() - * to avoid racing. - * - * - After SIGTERM is recieved and propagated to the child there are - * several options on what to do next: - * - read until EOF - * - read until EOF but only for a while - * - bail immediately - * Currently the third option is used, because otherwise there is no - * guarantee that read() won't block indefinitely if the child refuses - * to depart. To handle the second option, a different approach - * would be needed (procctl()?). - * - * - Child's exit might be detected by receiveing EOF from the pipe. - * But the child might have closed its stdout and stderr, so deamon - * must wait for the SIGCHLD to ensure that the child is actually gone. + if (state->user != NULL) { + restrict_process(state->user); + } + + /* Ignored signals remain ignored after execve, unignore them */ + signal(SIGHUP, SIG_DFL); + signal(SIGTERM, SIG_DFL); + execvp(state->argv[0], state->argv); + /* execvp() failed - report error and exit this process */ + err(1, "%s", state->argv[0]); +} + +/* Main event loop: fork the child and watch for events. + * After SIGTERM is recieved and propagated to the child there are + * several options on what to do next: + * - read until EOF + * - read until EOF but only for a while + * - bail immediately + * Currently the third option is used, because otherwise there is no + * guarantee that read() won't block indefinitely if the child refuses + * to depart. To handle the second option, a different approach + * would be needed (procctl()?). */ static void daemon_eventloop(struct daemon_state *state) { - if (state->supervision_enabled) { - if (pipe(state->pipe_fd)) { - err(1, "pipe"); - } - /* - * Spawn a child to exec the command. - */ - child_gone = 0; - pid = fork(); + struct kevent event; + int kq; + int ret; + + /* + * Try to protect against pageout kill. Ignore the + * error, madvise(2) will fail only if a process does + * not have superuser privileges. + */ + (void)madvise(NULL, 0, MADV_PROTECT); + + if (pipe(state->pipe_fd)) { + err(1, "pipe"); } - /* fork failed, this can only happen when supervision is enabled */ - if (pid == -1) { - warn("fork"); - daemon_terminate(state); + kq = kqueuex(KQUEUE_CLOEXEC); + EV_SET(&event, state->pipe_fd[0], EVFILT_READ, EV_ADD|EV_CLEAR, 0, 0, + NULL); + if (kevent(kq, &event, 1, NULL, 0, NULL) == -1) { + err(EXIT_FAILURE, "failed to register kevent"); } - /* fork succeeded, this is child's branch or supervision is disabled */ - if (pid == 0) { - pidfile_write(state->child_pidfh); + EV_SET(&event, SIGHUP, EVFILT_SIGNAL, EV_ADD, 0, 0, NULL); + if (kevent(kq, &event, 1, NULL, 0, NULL) == -1) { + err(EXIT_FAILURE, "failed to register kevent"); + } - if (state->user != NULL) { - restrict_process(state->user); - } - /* - * In supervision mode, the child gets the original sigmask, - * and dup'd pipes. - */ - if (state->supervision_enabled) { - close(state->pipe_fd[0]); - if (sigprocmask(SIG_SETMASK, &state->mask_orig, NULL)) { - err(1, "sigprogmask"); - } - if (state->stdmask & STDERR_FILENO) { - if (dup2(state->pipe_fd[1], STDERR_FILENO) == -1) { - err(1, "dup2"); - } - } - if (state->stdmask & STDOUT_FILENO) { - if (dup2(state->pipe_fd[1], STDOUT_FILENO) == -1) { - err(1, "dup2"); - } - } - if (state->pipe_fd[1] != STDERR_FILENO && - state->pipe_fd[1] != STDOUT_FILENO) { - close(state->pipe_fd[1]); - } - } - execvp(state->argv[0], state->argv); - /* execvp() failed - report error and exit this process */ - err(1, "%s", state->argv[0]); + EV_SET(&event, SIGTERM, EVFILT_SIGNAL, EV_ADD, 0, 0, NULL); + if (kevent(kq, &event, 1, NULL, 0, NULL) == -1) { + err(EXIT_FAILURE, "failed to register kevent"); } - /* - * else: pid > 0 - * fork succeeded, this is the parent branch, this can only happen when - * supervision is enabled. - * - * Unblock SIGTERM - now there is a valid child PID to signal to. - */ - if (sigprocmask(SIG_UNBLOCK, &state->mask_term, NULL)) { - warn("sigprocmask"); - daemon_terminate(state); + EV_SET(&event, SIGCHLD, EVFILT_SIGNAL, EV_ADD, 0, 0, NULL); + if (kevent(kq, &event, 1, NULL, 0, NULL) == -1) { + err(EXIT_FAILURE, "failed to register kevent"); } - close(state->pipe_fd[1]); - state->pipe_fd[1] = -1; + memset(&event, 0, sizeof(struct kevent)); - setproctitle("%s[%d]", state->title, (int)pid); - for (;;) { - if (child_gone && state->child_eof) { - break; - } + /* Spawn a child to exec the command. */ + state->pid = fork(); - if (terminate) { - daemon_terminate(state); - } + /* fork failed, this can only happen when supervision is enabled */ + switch (state->pid) { + case -1: + warn("fork"); + state->mode = MODE_NOCHILD; + return; + /* fork succeeded, this is child's branch */ + case 0: + close(kq); + daemon_set_child_pipe(state); + daemon_exec(state); + break; + } - if (state->child_eof) { - if (sigprocmask(SIG_BLOCK, &state->mask_susp, NULL)) { - warn("sigprocmask"); - daemon_terminate(state); - } - while (!terminate && !child_gone) { - sigsuspend(&state->mask_orig); - } - if (sigprocmask(SIG_UNBLOCK, &state->mask_susp, NULL)) { - warn("sigprocmask"); - daemon_terminate(state); - } + /* case: pid > 0; fork succeeded */ + close(state->pipe_fd[1]); + state->pipe_fd[1] = -1; + setproctitle("%s[%d]", state->title, (int)state->pid); + + while (state->mode != MODE_NOCHILD) { + ret = kevent(kq, NULL, 0, &event, 1, NULL); + switch (ret) { + case -1: + err(EXIT_FAILURE, "kevent wait"); + case 0: continue; } - if (sigprocmask(SIG_BLOCK, &state->mask_read, NULL)) { - warn("sigprocmask"); - daemon_terminate(state); + if (event.flags & EV_ERROR) { + errx(EXIT_FAILURE, "Event error: %s", + strerror(event.data)); } - state->child_eof = !listen_child(state->pipe_fd[0], state); + switch (event.filter) { + case EVFILT_SIGNAL: + + switch (event.ident) { + case SIGCHLD: + if (daemon_is_child_dead(state)) { + /* child is dead, read all until EOF */ + state->pid = -1; + state->mode = MODE_NOCHILD; + while (listen_child(state->pipe_fd[0], + state)) + ; + } + continue; + case SIGTERM: + if (state->mode != MODE_SUPERVISE) { + /* user is impatient */ + /* TODO: warn about repeated SIGTERM? */ + continue; + } - if (sigprocmask(SIG_UNBLOCK, &state->mask_read, NULL)) { - warn("sigprocmask"); - daemon_terminate(state); - } + state->mode = MODE_TERMINATING; + state->restart_enabled = false; + if (state->pid > 0) { + kill(state->pid, SIGTERM); + } + /* + * TODO set kevent timer to exit + * unconditionally after some time + */ + continue; + case SIGHUP: + if (state->log_reopen && state->output_fd >= 0) { + reopen_log(state); + } + continue; + } + break; - } + case EVFILT_READ: + /* + * detecting EOF is no longer necessary + * if child closes the pipe daemon will stop getting + * EVFILT_READ events + */ - /* - * At the end of the loop the the child is already gone. - * Block SIGTERM to avoid racing until the child is spawned. - */ - if (sigprocmask(SIG_BLOCK, &state->mask_term, NULL)) { - warn("sigprocmask"); - daemon_terminate(state); + if (event.data > 0) { + (void)listen_child(state->pipe_fd[0], state); + } + continue; + default: + continue; + } } - /* sleep before exiting mainloop if restart is enabled */ - if (state->restart_enabled && !terminate) { - daemon_sleep(state->restart_delay, 0); - } + close(kq); + close(state->pipe_fd[0]); + state->pipe_fd[0] = -1; } static void -daemon_sleep(time_t secs, long nsecs) +daemon_sleep(struct daemon_state *state) { - struct timespec ts = { secs, nsecs }; + struct timespec ts = { state->restart_delay, 0 }; - while (!terminate && nanosleep(&ts, &ts) == -1) { + if (!state->restart_enabled) { + return; + } + while (nanosleep(&ts, &ts) == -1) { if (errno != EINTR) { err(1, "nanosleep"); } } } -/* - * Setup SIGTERM, SIGCHLD and SIGHUP handlers. - * To avoid racing SIGCHLD with SIGTERM corresponding - * signal handlers mask the other signal. - */ -static void -setup_signals(struct daemon_state *state) -{ - struct sigaction act_term = { 0 }; - struct sigaction act_chld = { 0 }; - struct sigaction act_hup = { 0 }; - - /* Setup SIGTERM */ - act_term.sa_handler = handle_term; - sigemptyset(&act_term.sa_mask); - sigaddset(&act_term.sa_mask, SIGCHLD); - if (sigaction(SIGTERM, &act_term, NULL) == -1) { - warn("sigaction"); - daemon_terminate(state); - } - - /* Setup SIGCHLD */ - act_chld.sa_handler = handle_chld; - sigemptyset(&act_chld.sa_mask); - sigaddset(&act_chld.sa_mask, SIGTERM); - if (sigaction(SIGCHLD, &act_chld, NULL) == -1) { - warn("sigaction"); - daemon_terminate(state); - } - - /* Setup SIGHUP if configured */ - if (!state->log_reopen || state->output_fd < 0) { - return; - } - - act_hup.sa_handler = handle_hup; - sigemptyset(&act_hup.sa_mask); - if (sigaction(SIGHUP, &act_hup, NULL) == -1) { - warn("sigaction"); - daemon_terminate(state); - } -} - static void open_pid_files(struct daemon_state *state) { @@ -610,6 +578,8 @@ restrict_process(const char *user) * * Return value of false is assumed to mean EOF or error, and true indicates to * continue reading. + * + * TODO: simplify signature - state contains pipefd */ static bool listen_child(int fd, struct daemon_state *state) @@ -621,9 +591,6 @@ listen_child(int fd, struct daemon_state *state) assert(state != NULL); assert(bytes_read < LBUF_SIZE - 1); - if (do_log_reopen) { - reopen_log(state); - } rv = read(fd, buf + bytes_read, LBUF_SIZE - bytes_read - 1); if (rv > 0) { unsigned char *cp; @@ -695,42 +662,6 @@ do_output(const unsigned char *buf, size_t len, struct daemon_state *state) } } -/* - * We use the global PID acquired directly from fork. If there is no valid - * child pid, the handler should be blocked and/or child_gone == 1. - */ -static void -handle_term(int signo) -{ - if (pid > 0 && !child_gone) { - kill(pid, signo); - } - terminate = 1; -} - -static void -handle_chld(int signo __unused) -{ - - for (;;) { - int rv = waitpid(-1, NULL, WNOHANG); - if (pid == rv) { - child_gone = 1; - break; - } else if (rv == -1 && errno != EINTR) { - warn("waitpid"); - return; - } - } -} - -static void -handle_hup(int signo __unused) -{ - - do_log_reopen = 1; -} - static int open_log(const char *outfn) { @@ -743,7 +674,6 @@ reopen_log(struct daemon_state *state) { int outfd; - do_log_reopen = 0; outfd = open_log(state->output_filename); if (state->output_fd >= 0) { close(state->output_fd); @@ -763,9 +693,9 @@ daemon_state_init(struct daemon_state *state) .parent_pidfile = NULL, .title = NULL, .user = NULL, - .supervision_enabled = false, - .child_eof = false, + .mode = MODE_DAEMON, .restart_enabled = false, + .pid = 0, .keep_cur_workdir = 1, .restart_delay = 1, .stdmask = STDOUT_FILENO | STDERR_FILENO, @@ -778,25 +708,23 @@ daemon_state_init(struct daemon_state *state) .output_fd = -1, .output_filename = NULL, }; - - sigemptyset(&state->mask_susp); - sigemptyset(&state->mask_read); - sigemptyset(&state->mask_term); - sigemptyset(&state->mask_orig); - sigaddset(&state->mask_susp, SIGTERM); - sigaddset(&state->mask_susp, SIGCHLD); - sigaddset(&state->mask_term, SIGTERM); - sigaddset(&state->mask_read, SIGCHLD); - } static _Noreturn void daemon_terminate(struct daemon_state *state) { assert(state != NULL); - close(state->output_fd); - close(state->pipe_fd[0]); - close(state->pipe_fd[1]); + + if (state->output_fd >= 0) { + close(state->output_fd); + } + if (state->pipe_fd[0] >= 0) { + close(state->pipe_fd[0]); + } + + if (state->pipe_fd[1] >= 0) { + close(state->pipe_fd[1]); + } if (state->syslog_enabled) { closelog(); } @@ -810,3 +738,45 @@ daemon_terminate(struct daemon_state *state) */ exit(1); } + +/* + * Returns true if SIGCHILD came from state->pid + * This function could hang if SIGCHILD was emittied for a reason other than + * child dying (e.g., ptrace attach). + */ +static bool +daemon_is_child_dead(struct daemon_state *state) +{ + for (;;) { + int who = waitpid(-1, NULL, WNOHANG); + if (state->pid == who) { + return true; + } + if (who == -1 && errno != EINTR) { + warn("waitpid"); + return false; + } + } +} + +static void +daemon_set_child_pipe(struct daemon_state *state) +{ + if (state->stdmask & STDERR_FILENO) { + if (dup2(state->pipe_fd[1], STDERR_FILENO) == -1) { + err(1, "dup2"); + } + } + if (state->stdmask & STDOUT_FILENO) { + if (dup2(state->pipe_fd[1], STDOUT_FILENO) == -1) { + err(1, "dup2"); + } + } + if (state->pipe_fd[1] != STDERR_FILENO && + state->pipe_fd[1] != STDOUT_FILENO) { + close(state->pipe_fd[1]); + } + + /* The child gets dup'd pipes. */ + close(state->pipe_fd[0]); +} From nobody Wed Dec 13 20:06:24 2023 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 4Sr61s0z8gz54Fkg; Wed, 13 Dec 2023 20:06:25 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sr61r5hcTz4YvD; Wed, 13 Dec 2023 20:06:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702497984; 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=/ywwi/U4iT5mjcDkoPniASoH0GjEl74GVWTeIwV+b8I=; b=XfbKZMHfTLg6anGVszTW3Dvy2tDpVnL/AvqFs2QKseDn+dsFKfmtyM8vsbzq9e80GLnuq9 7CA6mMHCOWisxCHiSCnME6AOFh2/94nX77F/gRQUiUCFjkdDlCmKSNoRPi7GPbuKDC9tD0 uykN5g6C1plhs9oeKdRovaZxlJeaDfInm8JtE35jLVZYzNtt2W4qQe8pVMTFDQYPZ6pDog eIL/dd/8/d+RdvzCrijpSGm8FYYaCbrcuTMk8Quc5R1ezjM0g+Vc5yesm8OHYV1GUCzRYp Yv6w6ipCXCs9S5ScxHMlLUmkoVVWcmvq/9oOkvVSwVryhrd17sll1zkmmZFPmw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702497984; a=rsa-sha256; cv=none; b=crJCygDxg29widsgnmPck56xsyMBCBrlh5XO6GrZXS4aseoDRwAu1XJYtLhOT9ZG1rItX8 7Qgsv2D5+qBw0Tiw2sR9CjD/Klyk+m28g7+u+xAaddrfJvcaG9P1qfZNYhbbGHI0O+AZRw EjEPsRpMXAn7/BSkClqSg9ZQaazHPLeaR8qUsLyzZS1W14QIIszVAmlXCdW07gLD8u+UOR I1ah0n9so3Il21dxMrbPb04CRgMwIFaGjQWhPRspGY5Bkt5WuYeeXc27tfBmk0n2JkXywU zOO2hDkpDrit9SnfUD3/6aUdr3SXCeP7QEU1Cy44zcYEBJNJqGW+7IoChNwviA== 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=1702497984; 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=/ywwi/U4iT5mjcDkoPniASoH0GjEl74GVWTeIwV+b8I=; b=fuESXmBY8mGvvvakBKNAgGozKX0XET/wis2FHSq9Y6HC297JIBf84PfMwwi4U09BxTZ534 51YyLjMcN+h7WiSJZZ+/WbjYDjCbRsYsk9sYU4PFi7OP+liTRsGFz/pnNfGAd4ZgPaP34i 6BU9JjDx/MVTZCl9yqAJiXmLEbfllSmGbV9eivwon7r9miB7Fk7/8FzmDMcMxBEY36a712 lilP8/FAzaHqtZN8UXsKp/7ICtsmqwcdWxTXvpW62KOg65MKY/9s0SnaX2Fng0VgattySX FclMpXzk/Nh/gEeJhtjRUyTYkJ5URI/hMYDS8ANnTit5Sg4ccDh3Pe7akCV1Jg== 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 4Sr61r4VVDz1Blk; Wed, 13 Dec 2023 20:06:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BDK6Obn087168; Wed, 13 Dec 2023 20:06:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BDK6OIx087165; Wed, 13 Dec 2023 20:06:24 GMT (envelope-from git) Date: Wed, 13 Dec 2023 20:06:24 GMT Message-Id: <202312132006.3BDK6OIx087165@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 0147143008ec - stable/13 - daemon: EINTR from kevent(2) is not a fatal error 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0147143008ec5a8246a22a2b27e2a7a67e8b26a0 Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=0147143008ec5a8246a22a2b27e2a7a67e8b26a0 commit 0147143008ec5a8246a22a2b27e2a7a67e8b26a0 Author: Kyle Evans AuthorDate: 2023-05-05 15:12:13 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-12-13 16:21:09 +0000 daemon: EINTR from kevent(2) is not a fatal error Simply resume waiting for events rather than exiting if we took a signal here. This at least fixes running programs under daemon(8) in the face of suspend/resume, which I suspect hits us with a spurious EINTR rather than a signal anyways. Reported and tested by: manu Fixes: 8935a3993219b ("daemon: use kqueue for all events") (cherry picked from commit 494e7dfdbe6ecfe572228ed39f5c794954da068c) --- usr.sbin/daemon/daemon.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/usr.sbin/daemon/daemon.c b/usr.sbin/daemon/daemon.c index 48609ad03d68..dfbb609ce10d 100644 --- a/usr.sbin/daemon/daemon.c +++ b/usr.sbin/daemon/daemon.c @@ -425,6 +425,8 @@ daemon_eventloop(struct daemon_state *state) ret = kevent(kq, NULL, 0, &event, 1, NULL); switch (ret) { case -1: + if (errno == EINTR) + continue; err(EXIT_FAILURE, "kevent wait"); case 0: continue; From nobody Wed Dec 13 20:06:25 2023 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 4Sr61t06Wfz54Fgw; Wed, 13 Dec 2023 20:06:26 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sr61s6N6Zz4Yvc; Wed, 13 Dec 2023 20:06:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702497985; 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=6eq9irGsF57Q5acdBBnI6lCE/dUzfbRNUUoaAYzu6pA=; b=RLO/ZY5tSpIh6Luh5DoLqS4a/WI4CNlR5AoOu0uSCOMPu4zMEYi4w8zK+BESGlFYhl/Yfx KALMt3SDcTgajzNub3+CYCokTgL244SnoQut2qZRkI9m/qFre7Yuce7Ih0ZDPeDsSxijpH +PAo1urI9qji7G3bSPHa7/So4pIlLwVQXxipgZh7uXzKNCjJrneSVp9Qw6OxySIXdvl39g fohkPoYxH9vxBuwiOz9WfAagaQurgoQbtINoeFut1E1gETEdrXDfe0VpEYvK7wQIkcWX8L cIzyRnBHwSod8ThNf3CJf8WiE0WyqmkpdRV6o/1xLWqkSr8OU+wB+S8rn2sgKw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702497985; a=rsa-sha256; cv=none; b=TkozqxE+3tser063F8/0S/hb6VkVjzAqc1WsC4KVldtvEbzvLEdGU1m+GiotZD6fbuucr9 uM3+6ybt18QZipZTCqsXAPiK6Vur6wOxQdL7EoEcdP796y4dlfoWQKMR9toGLEbnGwY0na oif/A20QNaZiJO2746JIVammWTaXBdg5XEnbkUVwUMfGvkJQKViK2b5p60hlVLjBlSU89j 3RjzaS4+QRyJkkaxQ1IPrP/wX5vTszWBOT11BY8joWoT5xUtaQgMbK2yWu4Erbztx67VI9 F/AFxS2J4MJn+8iekHO2sQflKoFaGzhDQd2a7beuzHPe0Lw1MwuTh05tkpmGNA== 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=1702497985; 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=6eq9irGsF57Q5acdBBnI6lCE/dUzfbRNUUoaAYzu6pA=; b=kq5WeYfH/fVCQEdSwB9zSc22l+3HSR4WKaarFP68hXOnjiUP911dHBugD7SJIkC6sEmnA0 O5LLuFLUAP68bGP7nWnOCghsezSdqCcxdz3zzqAplxe4nsKEKzWds0kvErkZVdnmpYhEHz 79aErriBk0LNKg7lh6U4lcsKhp0SB2KxLved05NPKDEBq2zdy5bU/v8dMlbhy09Y6I1jER 9YCiII6UZKS51jERu7qrqCketnvzkayDUaYlY7snna1WV0XK36dFygLyvab04aMHeH+s7p swEHpmVWUknz/UkTHNjwh7syrqGduDKP2wkFWk4RAgUSUp2hkjj6MfaV14oVFQ== 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 4Sr61s5VFhz1C5S; Wed, 13 Dec 2023 20:06:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BDK6P8i087210; Wed, 13 Dec 2023 20:06:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BDK6PCp087207; Wed, 13 Dec 2023 20:06:25 GMT (envelope-from git) Date: Wed, 13 Dec 2023 20:06:25 GMT Message-Id: <202312132006.3BDK6PCp087207@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 70bf48a72a01 - stable/13 - daemon: Disable stdio buffering. 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 70bf48a72a0148ab17605f41ff62c0177f1e724a Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=70bf48a72a0148ab17605f41ff62c0177f1e724a commit 70bf48a72a0148ab17605f41ff62c0177f1e724a Author: Dag-Erling Smørgrav AuthorDate: 2023-10-06 16:44:52 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-12-13 16:21:13 +0000 daemon: Disable stdio buffering. The daemon utility already does its own buffering and retransmits its child's output line by line. There's no need for stdio to add its own buffering on top of this. MFC after: 1 week Sponsored by: Modirum MDPay Reviewed by: allanjude Differential Revision: https://reviews.freebsd.org/D42111 (cherry picked from commit cec8e6ba64ccab7fb0d9fa531ebad9228233334d) --- usr.sbin/daemon/daemon.c | 1 + 1 file changed, 1 insertion(+) diff --git a/usr.sbin/daemon/daemon.c b/usr.sbin/daemon/daemon.c index dfbb609ce10d..65e6bb7ca190 100644 --- a/usr.sbin/daemon/daemon.c +++ b/usr.sbin/daemon/daemon.c @@ -420,6 +420,7 @@ daemon_eventloop(struct daemon_state *state) close(state->pipe_fd[1]); state->pipe_fd[1] = -1; setproctitle("%s[%d]", state->title, (int)state->pid); + setbuf(stdout, NULL); while (state->mode != MODE_NOCHILD) { ret = kevent(kq, NULL, 0, &event, 1, NULL); From nobody Wed Dec 13 20:06:26 2023 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 4Sr61v1dlzz54FnV; Wed, 13 Dec 2023 20:06:27 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sr61v080bz4Z3j; Wed, 13 Dec 2023 20:06:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702497987; 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=BIvybEcBQJ92/4OVPqHZwsyCuoqVB/8R7Ou4A8jFyAc=; b=xZI1h41VNMJA/tKJB9UlBIk3aMu9zQIQ1Lx6zIZHOlUh7b4j/r0jrEdu0EgEhscT7dD/zm UPUF4h6QiIBb1aDgUtM2qwNXiP7wPT7Thzxi76xHEICr+lptACfe9hFS/6F9171FbdZyNm AJhxtYy8tQfu6KXW3ga/+KsgfAxdVeDjxyaaQVAtYHXklZSwnR5XYG8gk1QPMo4P0JzlPy kB9T6YyooIvnPjVH5FNS7z+Q+bdTOd/X91WQaEkW7Lae7UiOFS8jRyT6tb/A5xROzrIfTS +hkLbPXj6SlPXlFwwu+PUiC7X2pvEI8c7PWlz96BmKCG0L97m+wN4TBReLlU3Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702497987; a=rsa-sha256; cv=none; b=wzSa273y6AqDcIlWL4u2japAuvGQmdXMXlwOyAgCX5SQwcSFMmWBkQxStJ417kx4jUc1Hm ZPeHeB2YGull/h7IIRZcZKIVWgSkEqFI6pcLUU/yqKLqmDsu6xjh1jkftcFW3ex6dseMSJ kBehi8v/lqi3U55+NW/6PZf7GVuEDs2kzoDtipD3QUGwZfKJSPWT7vqvN03AMMaOgQ+RVW 3cVmkCg6SUXNCC3AfqNV7kirSBLtH03lcKKaqpsgHc4wXHBTc432e9aRvaPlor8V6MHRsi AMLilCoCCPFDfiqrep8blGcRjvnVFOGUnDCc90UL44/zx/9pI+TUtYh3vVd0EQ== 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=1702497987; 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=BIvybEcBQJ92/4OVPqHZwsyCuoqVB/8R7Ou4A8jFyAc=; b=aH6I2ABqZfJGIfVO7zOkclo4l2xlhQ1gvW7HBTsQBbhY701RX6Vr3COqVtx2i1/5QT7PqE 1NGcT5IX6udTetRXccdy+shou9u0y+8/85y9jxeelRnUqtQ0A4rF1aHmx/WfwbLSuwfBuv vEyAFOSBaS3fYjo68M/k0ENvsNed6vDDSBIqVqWgI4q4J7vOM58DGWLccf5wAVd55/Lgc0 Bnt98vi2r5Tn8raSnDnnsq7t95jGRhkS9W7AMa0tvDy9U0zDIcDsM9Y8u+1v5OkEtkoFvk QE1FUFJDpnbG73ScUNduiDfL4DQ3zPrMJbQJsJcu9ymWr5qPWNHeGBRwkg3OnQ== 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 4Sr61t5pX7z1C0q; Wed, 13 Dec 2023 20:06:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BDK6Q9W087270; Wed, 13 Dec 2023 20:06:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BDK6Qkb087267; Wed, 13 Dec 2023 20:06:26 GMT (envelope-from git) Date: Wed, 13 Dec 2023 20:06:26 GMT Message-Id: <202312132006.3BDK6Qkb087267@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: dc7d88c71d2b - stable/13 - libfetch, fetch: Stop recommending the use of ca_root_nss. 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: dc7d88c71d2be3363c94045fe439e21b8a838687 Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=dc7d88c71d2be3363c94045fe439e21b8a838687 commit dc7d88c71d2be3363c94045fe439e21b8a838687 Author: Dag-Erling Smørgrav AuthorDate: 2023-10-08 04:35:15 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-12-13 16:21:29 +0000 libfetch, fetch: Stop recommending the use of ca_root_nss. MFC after: 3 days Reviewed by: kevans, emaste Differential Revision: https://reviews.freebsd.org/D42119 (cherry picked from commit 2821a7498f65d357c68166e1978b491abef1ca4a) --- lib/libfetch/fetch.3 | 15 +-------------- usr.bin/fetch/fetch.1 | 14 ++------------ 2 files changed, 3 insertions(+), 26 deletions(-) diff --git a/lib/libfetch/fetch.3 b/lib/libfetch/fetch.3 index 34047d253991..663209f8fc79 100644 --- a/lib/libfetch/fetch.3 +++ b/lib/libfetch/fetch.3 @@ -24,7 +24,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd November 24, 2020 +.Dd October 7, 2023 .Dt FETCH 3 .Os .Sh NAME @@ -409,19 +409,6 @@ library, is currently unimplemented. .Sh HTTPS SCHEME Based on HTTP SCHEME. -By default the peer is verified using the CA bundle located in -.Pa /usr/local/etc/ssl/cert.pem . -If this file does not exist, -.Pa /etc/ssl/cert.pem -is used instead. -If neither file exists, and -.Ev SSL_CA_CERT_PATH -has not been set, -OpenSSL's default CA cert and path settings apply. -The certificate bundle can contain multiple CA certificates. -A common source of a current CA bundle is -.Pa \%security/ca_root_nss . -.Pp The CA bundle used for peer verification can be changed by setting the environment variables .Ev SSL_CA_CERT_FILE diff --git a/usr.bin/fetch/fetch.1 b/usr.bin/fetch/fetch.1 index 2737373c98bf..7238226998fc 100644 --- a/usr.bin/fetch/fetch.1 +++ b/usr.bin/fetch/fetch.1 @@ -28,7 +28,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 October 29, 2020 +.Dd October 7, 2023 .Dt FETCH 1 .Os .Sh NAME @@ -131,18 +131,8 @@ only. .It Fl -ca-cert= Ns Ar file [SSL] Path to certificate bundle containing trusted CA certificates. -If not specified, -.Pa /usr/local/etc/ssl/cert.pem -is used. -If this file does not exist, -.Pa /etc/ssl/cert.pem -is used instead. -If neither file exists and no CA path has been configured, +Otherwise, OpenSSL's default CA cert and path settings apply. -The certificate bundle can contain multiple CA certificates. -The -.Pa security/ca_root_nss -port is a common source of a current CA bundle. .It Fl -ca-path= Ns Ar dir [SSL] The directory From nobody Wed Dec 13 20:06:27 2023 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 4Sr61w3h5nz54Fqh; Wed, 13 Dec 2023 20:06:28 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sr61w0Xtkz4Yyd; Wed, 13 Dec 2023 20:06:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702497988; 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=5oSD2oVY1mqAw0NPxjfB2qmK+1/vegyzF4vw0WX6jHg=; b=iZF8nxX4ucJ/wvO0isEuDzywZGGZa4i9tQnVyTJ0nzHS6oZP9n9aQdVT50RanO2qQ+uQgb tpQmRJgl18PdRSfiwil3P5WFoT810Ev1vNKAfQEhpSP9jPQRSbrheMN3vv0/ZOv2vMG0IZ DOTrThWkxZ5FdpDwChYHXTycQZN1RMzmetIjvu39ysxMTkBmb/lQg2XMJLac+XAJApH5KE nEIV+I4E2/AlWdurWuVrDFvOrxMwiYPVdp64wU49WEAtEbkKNsU+uPE98Ah02KDg2T5cDD +stwDWAwiGTfbzGbU9no/QSv8PLFvjbt+OdKpfQM6n19byhkWOZ1OVdJo+4+zQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702497988; a=rsa-sha256; cv=none; b=MbZThBz43Sz5CuGxFG9SsKgXHg5D6Vl5MhX15eDfgqBebJ1BAyDca0jpBmuz6xaJDwtp2Y 35aQ8Nd4wK/9sKiR+89LIoVChrWnyQoadQC/058KWUIsuDLwW/PvjUE1a1dHZg35aimWDy 3JpgJ8TxyVOOxU1uKy9y+nKxQFcHvuNAZfmqFTfmhB9iX6QYojXaBvjmMygylvWBfeQeVl LAb89fBRHW9F1tF0SnPISY/BKgMwJefSj+tLsvF/hKTzxM4iE/9KN2OGsCEJm5+EYUw1B/ GfaXqdfJzALB2uxQefwJFhwNfILtyvlTBGmQ54J3F4q7un7Gd3fiw+bPpykoSg== 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=1702497988; 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=5oSD2oVY1mqAw0NPxjfB2qmK+1/vegyzF4vw0WX6jHg=; b=thWgJ+UwDV5PKdkkqBS/eOXg7ukdhUIWNyZbYmYE2XkBsHI89RlUtrfyPlCj3t4GUAgZsq OVpk3qnUv6FVaBnexzQJgQw/uuYvLmPW5sS0lN9ES6Wxz8JxlIlBWYxujo56L4PbXIU7dp 2mDULdYx3fZvsNvjAcZRst2kFwwxjhsggad8MuXiFebEBsbtDTVanvuNYT/dBtNv6RjIt4 0U7wZ0Iq9L54leJtxgk8NIlCy2aScQcAKu//A4FgAGsqL3/nulgwvkYEXtMyhRMz9OMJgr LbCo7v59TWcp/NjNAEpi13B1qf1Pph0siXQTiwrYp+s0dGN9nWAeZN0IwtDvig== 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 4Sr61v6mr5z1C3H; Wed, 13 Dec 2023 20:06:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BDK6Rfb087312; Wed, 13 Dec 2023 20:06:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BDK6RXu087309; Wed, 13 Dec 2023 20:06:27 GMT (envelope-from git) Date: Wed, 13 Dec 2023 20:06:27 GMT Message-Id: <202312132006.3BDK6RXu087309@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 0648be66c477 - stable/13 - ping: Simplify protocol selection. 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0648be66c4776de2e6490cbfe1f7857d1383bb06 Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=0648be66c4776de2e6490cbfe1f7857d1383bb06 commit 0648be66c4776de2e6490cbfe1f7857d1383bb06 Author: Dag-Erling Smørgrav AuthorDate: 2023-10-10 22:47:46 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-12-13 16:39:36 +0000 ping: Simplify protocol selection. * Interrupt the option loop as soon as we have an indication of which protocol is intended. * If we end up having to perform a DNS lookup, loop over the entire result looking for either IPv4 or IPv6 addresses. Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. Reviewed by: rscheff, kevans, allanjude Differential Revision: https://reviews.freebsd.org/D42137 (cherry picked from commit 7fd2c91a291bd518e012b438d6ca6fdd04d39dbf) ping: Consistently use EX_NOHOST for DNS failures. Traditionally, ping returned exit code EX_NOHOST if a DNS lookup failed. That is still the case for the legacy code in the new merged ping, but not for IPv6 targets, nor when a DNS lookup is performed in order to determine which version of the tool to invoke. While here, also make sure that the error message is consistent. Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D42159 (cherry picked from commit c4ffb80ef18f6b581dc28c14bc579e0e7c73438c) ping: Add missing ATF boilerplate. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D42161 (cherry picked from commit fc7143b48341fb16ef5b2262c7cd5b5c47056112) --- sbin/ping/main.c | 129 ++++++++++++++++++++----------------------- sbin/ping/ping6.c | 5 +- sbin/ping/tests/ping_test.sh | 67 ++++++++++++++++++++-- 3 files changed, 124 insertions(+), 77 deletions(-) diff --git a/sbin/ping/main.c b/sbin/ping/main.c index 6321178e1228..2e2d3170fd13 100644 --- a/sbin/ping/main.c +++ b/sbin/ping/main.c @@ -39,6 +39,7 @@ #include #include #include +#include #include #include "main.h" @@ -62,112 +63,102 @@ int main(int argc, char *argv[]) { -#if defined(INET) && defined(INET6) +#if defined(INET) struct in_addr a; - struct in6_addr a6; #endif -#if defined(INET) || defined(INET6) - struct addrinfo hints; +#if defined(INET6) + struct in6_addr a6; #endif - int ch; -#ifdef INET - bool ipv4 = false; +#if defined(INET) && defined(INET6) + struct addrinfo hints, *res, *ai; + const char *target; + int error; #endif -#ifdef INET6 - bool ipv6 = false; + int opt; +#ifdef INET6 if (strcmp(getprogname(), "ping6") == 0) - ipv6 = true; + return ping6(argc, argv); #endif - while ((ch = getopt(argc, argv, ":" OPTSTR)) != -1) { - switch(ch) { + while ((opt = getopt(argc, argv, ":" OPTSTR)) != -1) { + switch (opt) { #ifdef INET case '4': - ipv4 = true; - break; + goto ping4; #endif #ifdef INET6 case '6': - ipv6 = true; - break; + goto ping6; #endif -#if defined(INET) && defined(INET6) case 'S': /* * If -S is given with a numeric parameter, * force use of the corresponding version. */ +#ifdef INET if (inet_pton(AF_INET, optarg, &a) == 1) - ipv4 = true; - else if (inet_pton(AF_INET6, optarg, &a6) == 1) - ipv6 = true; - break; + goto ping4; +#endif +#ifdef INET6 + if (inet_pton(AF_INET6, optarg, &a6) == 1) + goto ping6; #endif + break; default: break; } } + /* + * For IPv4, only one positional argument, the target, is allowed. + * For IPv6, multiple positional argument are allowed; the last + * one is the target, and preceding ones are intermediate hops. + * This nuance is lost here, but the only case where it matters is + * an error. + */ if (optind >= argc) usage(); - optreset = 1; - optind = 1; #if defined(INET) && defined(INET6) - if (ipv4 && ipv6) - errx(1, "-4 and -6 cannot be used simultaneously"); -#endif - -#if defined(INET) && defined(INET6) - if (inet_pton(AF_INET, argv[argc - 1], &a) == 1) { - if (ipv6) - errx(1, "IPv6 requested but IPv4 target address " - "provided"); + target = argv[argc - 1]; + memset(&hints, 0, sizeof(hints)); + hints.ai_socktype = SOCK_RAW; + if (feature_present("inet") && !feature_present("inet6")) hints.ai_family = AF_INET; - } - else if (inet_pton(AF_INET6, argv[argc - 1], &a6) == 1) { - if (ipv4) - errx(1, "IPv4 requested but IPv6 target address " - "provided"); + if (feature_present("inet6") && !feature_present("inet")) hints.ai_family = AF_INET6; - } else if (ipv6) - hints.ai_family = AF_INET6; - else if (ipv4) - hints.ai_family = AF_INET; - else { - if (!feature_present("inet6")) - hints.ai_family = AF_INET; - else if (!feature_present("inet")) - hints.ai_family = AF_INET6; - else { - struct addrinfo *res; - - memset(&hints, 0, sizeof(hints)); - hints.ai_socktype = SOCK_RAW; - hints.ai_family = AF_UNSPEC; - getaddrinfo(argv[argc - 1], NULL, &hints, &res); - if (res != NULL) { - hints.ai_family = res[0].ai_family; - freeaddrinfo(res); - } + else + hints.ai_family = AF_UNSPEC; + error = getaddrinfo(target, NULL, &hints, &res); + if (res == NULL) + errx(EX_NOHOST, "cannot resolve %s: %s", + target, gai_strerror(error)); + for (ai = res; ai != NULL; ai = ai->ai_next) { + if (ai->ai_family == AF_INET) { + freeaddrinfo(res); + goto ping4; + } + if (ai->ai_family == AF_INET6) { + freeaddrinfo(res); + goto ping6; } } -#elif defined(INET) - hints.ai_family = AF_INET; -#elif defined(INET6) - hints.ai_family = AF_INET6; + freeaddrinfo(res); + errx(EX_NOHOST, "cannot resolve %s", target); #endif - #ifdef INET - if (hints.ai_family == AF_INET) - return ping(argc, argv); -#endif /* INET */ +ping4: + optreset = 1; + optind = 1; + return ping(argc, argv); +#endif #ifdef INET6 - if (hints.ai_family == AF_INET6) - return ping6(argc, argv); -#endif /* INET6 */ - errx(1, "Unknown host"); +ping6: + optreset = 1; + optind = 1; + return ping6(argc, argv); +#endif } void diff --git a/sbin/ping/ping6.c b/sbin/ping/ping6.c index 0edeb01b2dc0..d1f4c192b4c4 100644 --- a/sbin/ping/ping6.c +++ b/sbin/ping/ping6.c @@ -677,14 +677,15 @@ ping6(int argc, char *argv[]) error = cap_getaddrinfo(capdns, target, NULL, &hints, &res); if (error) - errx(1, "%s", gai_strerror(error)); + errx(EX_NOHOST, "cannot resolve %s: %s", + target, gai_strerror(error)); if (res->ai_canonname) hostname = strdup(res->ai_canonname); else hostname = target; if (!res->ai_addr) - errx(1, "cap_getaddrinfo failed"); + errx(EX_NOHOST, "cannot resolve %s", target); (void)memcpy(&dst, res->ai_addr, res->ai_addrlen); diff --git a/sbin/ping/tests/ping_test.sh b/sbin/ping/tests/ping_test.sh index ba0e38cb24b0..6cebdecc4f99 100644 --- a/sbin/ping/tests/ping_test.sh +++ b/sbin/ping/tests/ping_test.sh @@ -106,6 +106,7 @@ ping6_c1_s8_t1_body() check_ping_statistics std.out $(atf_get_srcdir)/ping_6_c1_s8_t1.out } +atf_test_case ping_c1t6 ping_c1t6_head() { atf_set "descr" "-t6 is not interpreted as -t -6 by ping" @@ -116,6 +117,7 @@ ping_c1t6_body() atf_check -s exit:0 -o ignore -e empty ping -c1 -t6 127.0.0.1 } +atf_test_case ping_c1t4 ping6_c1t4_head() { atf_set "descr" "-t4 is not interpreted as -t -4 by ping6" @@ -126,6 +128,7 @@ ping6_c1t4_body() atf_check -s exit:0 -o ignore -e empty ping6 -c1 -t4 ::1 } +atf_test_case ping_46 ping_46_head() { atf_set "descr" "-4 and -6 cannot be used simultaneously" @@ -135,21 +138,69 @@ ping_46_body() require_ipv4 require_ipv6 atf_check -s exit:1 \ - -e match:"-4 and -6 cannot be used simultaneously" \ + -e match:"illegal option -- 6" \ ping -4 -6 localhost } -ping6_46_head() +atf_test_case ping_64 +ping_64_head() { atf_set "descr" "-4 and -6 cannot be used simultaneously" } -ping6_46_body() +ping_64_body() { require_ipv4 require_ipv6 atf_check -s exit:1 \ - -e match:"-4 and -6 cannot be used simultaneously" \ - ping6 -4 -6 localhost + -e match:"illegal option -- 4" \ + ping -6 -4 localhost +} + +atf_test_case ping6_4 +ping6_4_head() +{ + atf_set "descr" "ping6 does not accept -4" +} +ping6_4_body() +{ + require_ipv4 + require_ipv6 + atf_check -s exit:1 \ + -e match:"illegal option -- 4" \ + ping6 -4 localhost +} + +atf_test_case ping_nohost +ping_nohost_head() +{ + atf_set "descr" "ping a nonexistent host" +} +ping_nohost_body() +{ + atf_check -s exit:68 -e match:"cannot resolve" \ + ping nonexistent.in-addr.arpa. +} + +atf_test_case ping4_nohost +ping4_nohost_head() +{ + atf_set "descr" "ping -4 a nonexistent host" +} +ping4_nohost_body() +{ + atf_check -s exit:68 -e match:"cannot resolve" \ + ping -4 nonexistent.in-addr.arpa. +} + +atf_test_case ping6_nohost +ping6_nohost_head() +{ + atf_set "descr" "ping -6 a nonexistent host" +} +ping6_nohost_body() +{ + atf_check -s exit:68 -e match:"cannot resolve" \ + ping -6 nonexistent.in-addr.arpa. } atf_test_case "inject_opts" "cleanup" @@ -212,7 +263,11 @@ atf_init_test_cases() atf_add_test_case ping_c1t6 atf_add_test_case ping6_c1t4 atf_add_test_case ping_46 - atf_add_test_case ping6_46 + atf_add_test_case ping_64 + atf_add_test_case ping6_4 + atf_add_test_case ping_nohost + atf_add_test_case ping4_nohost + atf_add_test_case ping6_nohost atf_add_test_case inject_opts atf_add_test_case inject_pip atf_add_test_case inject_reply From nobody Wed Dec 13 20:06:28 2023 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 4Sr61x2NLdz54FVP; Wed, 13 Dec 2023 20:06:29 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sr61x1GCzz4Yyq; Wed, 13 Dec 2023 20:06:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702497989; 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=IfhFUD+Dfyx8XfJhtojD6JLqrHDewht8YVavBSN2dg4=; b=Lny6+539kxFbFdvVVJkppW5z46HTSqEKNcZqtw348YDV/QZCKJOT/d4hXwpWo2JnVyi9ag P3mc+l4bIUzCRjhnKRG3CVEG4wpkVeA1ChWwAAwYRP9sglPFrMmSIngqTMsvjp35GSN7g4 3nboEkmfAi4OFgPrAvQf9yUrBzGn/UQH0Z2JrzlRENAimuUk6Xtoli4bp3Yx9xGqege8ys f2dmB/bIpKDv9SbVFEcdnWqh24scs33q2gZFj7DcVLH/TrCZmxz9SJ/q/QoahYTySyMXWB A92wH0Jdu9jmLt1VBHLPTGEmCy08Sr2OnKwJC5lTIvSYPcdZkgkTDvOBpbUoHw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702497989; a=rsa-sha256; cv=none; b=M8khSe/cEPSeAn40XJBfTat746FS6AY5uvCNgcp4wnuSMJoERxAQM+QbsUI5ACNzUQ3v/z /5vJGIm5Hobo18Sh5QrV6e868WxLiVcy/H3tygL/4cXWsiEZsPgk4UFCSP59trk0wyJt3c IRwfDrOnsRo6H/f1/WcUoKOKKV/0PrV8Ug/1+9SgCtGokzynyilYmi+I3aCZo823etMDc4 No6DHUEYqUnBj1mf8i9mVNUb5RirhadoDf3B1yTsVsUUbGd+3alWWqg3EFayBKzUvKdCi4 wfGOjgIBXg/KTsmRFLbZXueqx3tGA0H1BoO6GWrC6oVIB6EA3DX4/nwrEpmGDQ== 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=1702497989; 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=IfhFUD+Dfyx8XfJhtojD6JLqrHDewht8YVavBSN2dg4=; b=HjLkU8L9NNwazrX3JXLihx1KJ+S1vT+PSUmU1s3Q+5GXiLYySmzhQ+suaC6wS5VqNcCAlI u1c0KAQEem/6q4U6nQMNsXNHHPIv47103X4vXGTGqpIzwou+9OAWrbRI1BtkfWj7IfQeiD 2kaS87KrGt6mXm/tJJqS/2qWepxXJ/lHVdYwJMeur8ZkgHVJB29ypcxdvailBaYREsOlgC Iz0gHa9U614hH+mUL1qAAcWhVL/iCqwTh2bpk9ZkHEen6NDV2CazPpIYoxSvEmzfQ7q8wc 4ZF4rkmjDuKV3QzJVMgP6oMap/al+/hKi+3Gadc/OcAJsQXetL0qQ4/5Ftd6XA== 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 4Sr61x0MqSz1Bll; Wed, 13 Dec 2023 20:06:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BDK6SuO087348; Wed, 13 Dec 2023 20:06:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BDK6SV2087345; Wed, 13 Dec 2023 20:06:28 GMT (envelope-from git) Date: Wed, 13 Dec 2023 20:06:28 GMT Message-Id: <202312132006.3BDK6SV2087345@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 064f91f65f82 - stable/13 - hesiod: Modernize. 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 064f91f65f82a486efc35c843d23d092e46204c8 Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=064f91f65f82a486efc35c843d23d092e46204c8 commit 064f91f65f82a486efc35c843d23d092e46204c8 Author: Dag-Erling Smørgrav AuthorDate: 2023-10-18 14:05:37 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-12-13 16:39:37 +0000 hesiod: Modernize. Reviewed by: zlei Differential Revision: https://reviews.freebsd.org/D42190 (cherry picked from commit 64fc8a936c868345a8f687fe2797474c5fcf35cb) --- lib/libc/net/hesiod.c | 42 +++++++++++++----------------------------- 1 file changed, 13 insertions(+), 29 deletions(-) diff --git a/lib/libc/net/hesiod.c b/lib/libc/net/hesiod.c index fbead770730f..14ed2c7ce641 100644 --- a/lib/libc/net/hesiod.c +++ b/lib/libc/net/hesiod.c @@ -81,8 +81,7 @@ static void translate_errors(void); * initialize a hesiod_p. */ int -hesiod_init(context) - void **context; +hesiod_init(void **context) { struct hesiod_p *ctx; const char *p, *configname; @@ -136,8 +135,7 @@ hesiod_init(context) * Deallocates the hesiod_p. */ void -hesiod_end(context) - void *context; +hesiod_end(void *context) { struct hesiod_p *ctx = (struct hesiod_p *) context; @@ -227,10 +225,7 @@ hesiod_to_bind(void *context, const char *name, const char *type) * by the resolver. */ char ** -hesiod_resolve(context, name, type) - void *context; - const char *name; - const char *type; +hesiod_resolve(void *context, const char *name, const char *type) { struct hesiod_p *ctx = (struct hesiod_p *) context; char *bindname, **retvec; @@ -249,9 +244,7 @@ hesiod_resolve(context, name, type) /*ARGSUSED*/ void -hesiod_free_list(context, list) - void *context; - char **list; +hesiod_free_list(void *context, char **list) { char **p; @@ -269,9 +262,7 @@ hesiod_free_list(context, list) * or ctx->rhs which need to be freed by the caller. */ static int -read_config_file(ctx, filename) - struct hesiod_p *ctx; - const char *filename; +read_config_file(struct hesiod_p *ctx, const char *filename) { char *key, *data, *p, **which; char buf[MAXDNAME + 7]; @@ -363,9 +354,7 @@ read_config_file(ctx, filename) * return a list of them. */ static char ** -get_txt_records(qclass, name) - int qclass; - const char *name; +get_txt_records(int qclass, const char *name) { HEADER *hp; unsigned char qbuf[PACKETSZ], abuf[MAX_HESRESP], *p, *eom, *eor; @@ -489,16 +478,14 @@ static void *context; static int errval = HES_ER_UNINIT; int -hes_init() +hes_init(void) { init_context(); return errval; } char * -hes_to_bind(name, type) - const char *name; - const char *type; +hes_to_bind(const char *name, const char *type) { static char *bindname; if (init_context() < 0) @@ -512,9 +499,7 @@ hes_to_bind(name, type) } char ** -hes_resolve(name, type) - const char *name; - const char *type; +hes_resolve(const char *name, const char *type) { static char **list; @@ -535,20 +520,19 @@ hes_resolve(name, type) } int -hes_error() +hes_error(void) { return errval; } void -hes_free(hp) - char **hp; +hes_free(char **hp) { hesiod_free_list(context, hp); } static int -init_context() +init_context(void) { if (!inited) { inited = 1; @@ -562,7 +546,7 @@ init_context() } static void -translate_errors() +translate_errors(void) { switch (errno) { case ENOENT: From nobody Wed Dec 13 20:06:30 2023 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 4Sr61y2kfbz54Fqn; Wed, 13 Dec 2023 20:06:30 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sr61y2Dgnz4Z8v; Wed, 13 Dec 2023 20:06:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702497990; 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=9K+QGidL62ZT03pMqzgOpLkoK6jqaLW12RRk7uHGcNU=; b=tFtKlY1lri9vGdegMRFDBd6sDg/ynJ+MdPrxBbl2mHZkVKU+kIxwO4+MsiZVxm0bo2sKyJ iOsxmgIEOnpOxfcqIbry3fvBhQrZfDbPrvYqerXRWo/LZ2UUINWMcwdyz5XLPkIEXefcu4 CE3mSqgA2tV2lMv54IMxlxUNHJnN8WvGJADN+/CjKNSeC/6uMcd/bBOHbTsaxYe6iqMAqi PSpiekRUI23Fv8Bc5GOZ+rkZYSNmoRC+xpihzVZBgVpbVzHuO6tqawJhiCQBOnw7l48db0 V/Q8lwjlbBdIvL01SeQiGIZ4P5TzZYAMHaEIQlDOlfuISdb6q6oJhquEFSWHIQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702497990; a=rsa-sha256; cv=none; b=pzkNRlZw4mfc1IUyl/W3PVvnGLArNW1m8ou7em/YPoeUhHM9S81ZXFwNx06xnsRb0Ms6xK Rhj8+DyBuig+kPPVLFLbBkdvDysCBxJiCuHy3EkR2VZ2SqihcRNbtY6kPJuq3iGGOLZEEO Ay1PZggow0TmnzjLcNrppERZq+fP23PgH6/LchWogArmgOdWMydzS1JxLusf9xo5Y/6u3+ uOTszHqZCBSxKF92Fg0UTMiEfR/mZBFGl51FRH+/gUzXZkkpaDrLlsxRgL9/GhRm/olztZ bx+EjJeHOjsluGofY3vrHQfUJGQO9rqgE2Ac4roKAgyeP4SerIBbry6nFXoXnw== 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=1702497990; 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=9K+QGidL62ZT03pMqzgOpLkoK6jqaLW12RRk7uHGcNU=; b=A2I6USX4gBqEozUQCa+AxIEDY7kfbDew7zcXsgAXCC3pvyLIg0zjLWefb0OjgQfkNHH8bB QnCUswgI91Q8Tz+bFye0vPbcXGddmkPPSKoFUSmPSRD1yIVEyAX8UVM5aZaCU1P3HHnKen hd98lhE8DvzcExa9Kevw5q19zX5or22B4Ek1OZJYMWjZ5KhWr6zeBz8zaCWBZWputolN+Y V2hGzw1/ebpObj+h3EFL/xVejvVbiH5aVb2+RNo+865i7Cjm3f4JcxdHxKRSE3gxXtsGay es4xN9TTTzDi5mXAUu5LHKPb15PeUCVsQ5JecG3Q4Jv0n7Ie8t1StW2nAzZBRg== 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 4Sr61y1LD6z1BXc; Wed, 13 Dec 2023 20:06:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BDK6U03087393; Wed, 13 Dec 2023 20:06:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BDK6U72087390; Wed, 13 Dec 2023 20:06:30 GMT (envelope-from git) Date: Wed, 13 Dec 2023 20:06:30 GMT Message-Id: <202312132006.3BDK6U72087390@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: e6a359060aeb - stable/13 - bitstring: Support large bit strings. 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e6a359060aeb5b5438676dd3be53bdc203b01df3 Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=e6a359060aeb5b5438676dd3be53bdc203b01df3 commit e6a359060aeb5b5438676dd3be53bdc203b01df3 Author: Dag-Erling Smørgrav AuthorDate: 2023-11-22 22:30:03 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-12-13 16:39:37 +0000 bitstring: Support large bit strings. Replace int with either size_t or ssize_t (depending on context) in order to support bit strings up to SSIZE_MAX bits in length. Since some of the arguments that need to change type are pointers, we must resort to light preprocessor trickery to avoid breaking existing code. MFC after: 3 weeks Sponsored by: Klara, Inc. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D42698 (cherry picked from commit c56f45f2a9da7d989b79fd6c34b63100609ff9ae) --- share/man/man3/bitstring.3 | 50 ++++++------- sys/sys/bitstring.h | 158 +++++++++++++++++------------------------ tests/sys/sys/bitstring_test.c | 90 ++++++++++++++++++++++- 3 files changed, 181 insertions(+), 117 deletions(-) diff --git a/share/man/man3/bitstring.3 b/share/man/man3/bitstring.3 index ac87ac6d9124..808cd48f384b 100644 --- a/share/man/man3/bitstring.3 +++ b/share/man/man3/bitstring.3 @@ -57,7 +57,7 @@ .\" .\" @(#)bitstring.3 8.1 (Berkeley) 7/19/93 .\" -.Dd August 8, 2021 +.Dd November 21, 2023 .Dt BITSTRING 3 .Os .Sh NAME @@ -85,49 +85,49 @@ .Sh SYNOPSIS .In bitstring.h .Ft bitstr_t * -.Fn bit_alloc "int nbits" +.Fn bit_alloc "size_t nbits" .Ft void -.Fn bit_decl "bitstr_t *name" "int nbits" +.Fn bit_decl "bitstr_t *name" "size_t nbits" .Ft void -.Fn bit_clear "bitstr_t *name" "int bit" +.Fn bit_clear "bitstr_t *name" "size_t bit" .Ft void -.Fn bit_count "bitstr_t *name" "int count" "int nbits" "int *value" +.Fn bit_count "bitstr_t *name" "size_t count" "size_t nbits" "ssize_t *value" .Ft void -.Fn bit_ffc "bitstr_t *name" "int nbits" "int *value" +.Fn bit_ffc "bitstr_t *name" "size_t nbits" "ssize_t *value" .Ft void -.Fn bit_ffs "bitstr_t *name" "int nbits" "int *value" +.Fn bit_ffs "bitstr_t *name" "size_t nbits" "ssize_t *value" .Ft void -.Fn bit_ffc_at "bitstr_t *name" "int start" "int nbits" "int *value" +.Fn bit_ffc_at "bitstr_t *name" "size_t start" "size_t nbits" "ssize_t *value" .Ft void -.Fn bit_ffs_at "bitstr_t *name" "int start" "int nbits" "int *value" +.Fn bit_ffs_at "bitstr_t *name" "size_t start" "size_t nbits" "ssize_t *value" .Ft void -.Fn bit_ff_at "bitstr_t *name" "int start" "int nbits" "int match" "int *value" +.Fn bit_ff_at "bitstr_t *name" "size_t start" "size_t nbits" "int match" "ssize_t *value" .Ft void -.Fn bit_ffc_area "bitstr_t *name" "int nbits" "int size" "int *value" +.Fn bit_ffc_area "bitstr_t *name" "size_t nbits" "size_t size" "ssize_t *value" .Ft void -.Fn bit_ffs_area "bitstr_t *name" "int nbits" "int size" "int *value" +.Fn bit_ffs_area "bitstr_t *name" "size_t nbits" "size_t size" "ssize_t *value" .Ft void -.Fn bit_ffc_area_at "bitstr_t *name" "int start" "int nbits" "int size" "int *value" +.Fn bit_ffc_area_at "bitstr_t *name" "size_t start" "size_t nbits" "size_t size" "ssize_t *value" .Ft void -.Fn bit_ffs_area_at "bitstr_t *name" "int start" "int nbits" "int size" "int *value" +.Fn bit_ffs_area_at "bitstr_t *name" "size_t start" "size_t nbits" "size_t size" "ssize_t *value" .Ft void -.Fn bit_ff_area_at "bitstr_t *name" "int start" "int nbits" "int size" "int match" "int *value" -.Fn bit_foreach "bitstr_t *name" "int nbits" "int var" -.Fn bit_foreach_at "bitstr_t *name" "int start" "int nbits" "int var" -.Fn bit_foreach_unset "bitstr_t *name" "int nbits" "int var" -.Fn bit_foreach_unset_at "bitstr_t *name" "int start" "int nbits" "int var" +.Fn bit_ff_area_at "bitstr_t *name" "size_t start" "size_t nbits" "size_t size" "int match" "ssize_t *value" +.Fn bit_foreach "bitstr_t *name" "size_t nbits" "size_t var" +.Fn bit_foreach_at "bitstr_t *name" "size_t start" "size_t nbits" "size_t var" +.Fn bit_foreach_unset "bitstr_t *name" "size_t nbits" "size_t var" +.Fn bit_foreach_unset_at "bitstr_t *name" "size_t start" "size_t nbits" "size_t var" .Ft void -.Fn bit_nclear "bitstr_t *name" "int start" "int stop" +.Fn bit_nclear "bitstr_t *name" "size_t start" "size_t stop" .Ft void -.Fn bit_nset "bitstr_t *name" "int start" "int stop" +.Fn bit_nset "bitstr_t *name" "size_t start" "size_t stop" .Ft int -.Fn bit_ntest "bitstr_t *name" "int start" "int stop" "int match" +.Fn bit_ntest "bitstr_t *name" "size_t start" "size_t stop" "int match" .Ft void -.Fn bit_set "bitstr_t *name" "int bit" +.Fn bit_set "bitstr_t *name" "size_t bit" .Ft int -.Fn bitstr_size "int nbits" +.Fn bitstr_size "size_t nbits" .Ft int -.Fn bit_test "bitstr_t *name" "int bit" +.Fn bit_test "bitstr_t *name" "size_t bit" .Sh DESCRIPTION These macros operate on strings of bits. .Pp diff --git a/sys/sys/bitstring.h b/sys/sys/bitstring.h index 127de2ebc419..8a976962dd36 100644 --- a/sys/sys/bitstring.h +++ b/sys/sys/bitstring.h @@ -75,35 +75,33 @@ typedef unsigned long bitstr_t; #define _BITSTR_MASK (~0UL) #define _BITSTR_BITS (sizeof(bitstr_t) * 8) -#ifdef roundup2 -#define _bit_roundup2 roundup2 -#else -#define _bit_roundup2(x, y) (((x)+((y)-1))&(~((y)-1))) /* if y is powers of two */ -#endif +/* round up x to the next multiple of y if y is a power of two */ +#define _bit_roundup2(x, y) \ + (((size_t)(x) + (y) - 1) & ~((size_t)(y) - 1)) /* bitstr_t in bit string containing the bit. */ -static inline int -_bit_idx(int _bit) +static inline size_t +_bit_idx(size_t _bit) { return (_bit / _BITSTR_BITS); } /* bit number within bitstr_t at _bit_idx(_bit). */ -static inline int -_bit_offset(int _bit) +static inline size_t +_bit_offset(size_t _bit) { return (_bit % _BITSTR_BITS); } /* Mask for the bit within its long. */ static inline bitstr_t -_bit_mask(int _bit) +_bit_mask(size_t _bit) { return (1UL << _bit_offset(_bit)); } static inline bitstr_t -_bit_make_mask(int _start, int _stop) +_bit_make_mask(size_t _start, size_t _stop) { return ((_BITSTR_MASK << _bit_offset(_start)) & (_BITSTR_MASK >> (_BITSTR_BITS - _bit_offset(_stop) - 1))); @@ -111,18 +109,18 @@ _bit_make_mask(int _start, int _stop) /*----------------------------- Public Interface -----------------------------*/ /* Number of bytes allocated for a bit string of nbits bits */ -#define bitstr_size(_nbits) (_bit_roundup2(_nbits, _BITSTR_BITS) / 8) +#define bitstr_size(_nbits) (_bit_roundup2((_nbits), _BITSTR_BITS) / 8) /* Allocate a bit string initialized with no bits set. */ #ifdef _KERNEL static inline bitstr_t * -bit_alloc(int _nbits, struct malloc_type *type, int flags) +bit_alloc(size_t _nbits, struct malloc_type *type, int flags) { return ((bitstr_t *)malloc(bitstr_size(_nbits), type, flags | M_ZERO)); } #else static inline bitstr_t * -bit_alloc(int _nbits) +bit_alloc(size_t _nbits) { return ((bitstr_t *)calloc(bitstr_size(_nbits), 1)); } @@ -134,28 +132,28 @@ bit_alloc(int _nbits) /* Is bit N of bit string set? */ static inline int -bit_test(const bitstr_t *_bitstr, int _bit) +bit_test(const bitstr_t *_bitstr, size_t _bit) { return ((_bitstr[_bit_idx(_bit)] & _bit_mask(_bit)) != 0); } /* Set bit N of bit string. */ static inline void -bit_set(bitstr_t *_bitstr, int _bit) +bit_set(bitstr_t *_bitstr, size_t _bit) { _bitstr[_bit_idx(_bit)] |= _bit_mask(_bit); } /* clear bit N of bit string name */ static inline void -bit_clear(bitstr_t *_bitstr, int _bit) +bit_clear(bitstr_t *_bitstr, size_t _bit) { _bitstr[_bit_idx(_bit)] &= ~_bit_mask(_bit); } /* Are bits in [start ... stop] in bit string all 0 or all 1? */ static inline int -bit_ntest(const bitstr_t *_bitstr, int _start, int _stop, int _match) +bit_ntest(const bitstr_t *_bitstr, size_t _start, size_t _stop, int _match) { const bitstr_t *_stopbitstr; bitstr_t _mask; @@ -183,7 +181,7 @@ bit_ntest(const bitstr_t *_bitstr, int _start, int _stop, int _match) /* Set bits start ... stop inclusive in bit string. */ static inline void -bit_nset(bitstr_t *_bitstr, int _start, int _stop) +bit_nset(bitstr_t *_bitstr, size_t _start, size_t _stop) { bitstr_t *_stopbitstr; @@ -206,7 +204,7 @@ bit_nset(bitstr_t *_bitstr, int _start, int _stop) /* Clear bits start ... stop inclusive in bit string. */ static inline void -bit_nclear(bitstr_t *_bitstr, int _start, int _stop) +bit_nclear(bitstr_t *_bitstr, size_t _start, size_t _stop) { bitstr_t *_stopbitstr; @@ -228,20 +226,17 @@ bit_nclear(bitstr_t *_bitstr, int _start, int _stop) } /* Find the first '_match'-bit in bit string at or after bit start. */ -static inline void -bit_ff_at(bitstr_t *_bitstr, int _start, int _nbits, int _match, - int *_result) +static inline ssize_t +bit_ff_at_(bitstr_t *_bitstr, size_t _start, size_t _nbits, int _match) { bitstr_t *_curbitstr; bitstr_t *_stopbitstr; bitstr_t _mask; bitstr_t _test; - int _value; + ssize_t _value; - if (_start >= _nbits || _nbits <= 0) { - *_result = -1; - return; - } + if (_start >= _nbits || _nbits <= 0) + return (-1); _curbitstr = _bitstr + _bit_idx(_start); _stopbitstr = _bitstr + _bit_idx(_nbits - 1); @@ -255,51 +250,40 @@ bit_ff_at(bitstr_t *_bitstr, int _start, int _nbits, int _match, _value = ((_curbitstr - _bitstr) * _BITSTR_BITS) + ffsl(_test) - 1; if (_test == 0 || - (_bit_offset(_nbits) != 0 && _value >= _nbits)) + (_bit_offset(_nbits) != 0 && (size_t)_value >= _nbits)) _value = -1; - *_result = _value; + return (_value); } +#define bit_ff_at(_bitstr, _start, _nbits, _match, _resultp) \ + *(_resultp) = bit_ff_at_((_bitstr), (_start), (_nbits), (_match)) /* Find the first bit set in bit string at or after bit start. */ -static inline void -bit_ffs_at(bitstr_t *_bitstr, int _start, int _nbits, int *_result) -{ - bit_ff_at(_bitstr, _start, _nbits, 1, _result); -} +#define bit_ffs_at(_bitstr, _start, _nbits, _resultp) \ + *(_resultp) = bit_ff_at_((_bitstr), (_start), (_nbits), 1) /* Find the first bit clear in bit string at or after bit start. */ -static inline void -bit_ffc_at(bitstr_t *_bitstr, int _start, int _nbits, int *_result) -{ - bit_ff_at(_bitstr, _start, _nbits, 0, _result); -} +#define bit_ffc_at(_bitstr, _start, _nbits, _resultp) \ + *(_resultp) = bit_ff_at_((_bitstr), (_start), (_nbits), 0) /* Find the first bit set in bit string. */ -static inline void -bit_ffs(bitstr_t *_bitstr, int _nbits, int *_result) -{ - bit_ffs_at(_bitstr, /*start*/0, _nbits, _result); -} +#define bit_ffs(_bitstr, _nbits, _resultp) \ + *(_resultp) = bit_ff_at_((_bitstr), 0, (_nbits), 1) /* Find the first bit clear in bit string. */ -static inline void -bit_ffc(bitstr_t *_bitstr, int _nbits, int *_result) -{ - bit_ffc_at(_bitstr, /*start*/0, _nbits, _result); -} +#define bit_ffc(_bitstr, _nbits, _resultp) \ + *(_resultp) = bit_ff_at_((_bitstr), 0, (_nbits), 0) /* Find contiguous sequence of at least size '_match'-bits at or after start */ -static inline void -bit_ff_area_at(bitstr_t *_bitstr, int _start, int _nbits, int _size, - int _match, int *_result) +static inline ssize_t +bit_ff_area_at_(bitstr_t *_bitstr, size_t _start, size_t _nbits, size_t _size, + int _match) { bitstr_t *_curbitstr, _mask, _test; - int _value, _last, _shft, _maxshft; + size_t _last, _shft, _maxshft; + ssize_t _value; - if (_start + _size > _nbits || _nbits <= 0) { - *_result = -1; - return; - } + if (_start + _size > _nbits || _nbits <= 0) + return (-1); _mask = _match ? _BITSTR_MASK : 0; _maxshft = _bit_idx(_size - 1) == 0 ? _size : (int)_BITSTR_BITS; @@ -330,48 +314,37 @@ bit_ff_area_at(bitstr_t *_bitstr, int _start, int _nbits, int _size, break; /* A solution here needs bits from the next word. */ } - *_result = _value; + return (_value); } +#define bit_ff_area_at(_bitstr, _start, _nbits, _size, _match, _resultp) \ + *(_resultp) = bit_ff_area_at_(_bitstr, _start, _nbits, _size, _match); /* Find contiguous sequence of at least size set bits at or after start */ -static inline void -bit_ffs_area_at(bitstr_t *_bitstr, int _start, int _nbits, int _size, - int *_result) -{ - bit_ff_area_at(_bitstr, _start, _nbits, _size, 1, _result); -} +#define bit_ffs_area_at(_bitstr, _start, _nbits, _size, _resultp) \ + *(_resultp) = bit_ff_area_at_((_bitstr), (_start), (_nbits), (_size), 1) /* Find contiguous sequence of at least size cleared bits at or after start */ -static inline void -bit_ffc_area_at(bitstr_t *_bitstr, int _start, int _nbits, int _size, - int *_result) -{ - bit_ff_area_at(_bitstr, _start, _nbits, _size, 0, _result); -} +#define bit_ffc_area_at(_bitstr, _start, _nbits, _size, _resultp) \ + *(_resultp) = bit_ff_area_at_((_bitstr), (_start), (_nbits), (_size), 0) /* Find contiguous sequence of at least size set bits in bit string */ -static inline void -bit_ffs_area(bitstr_t *_bitstr, int _nbits, int _size, int *_result) -{ - bit_ffs_area_at(_bitstr, /*start*/0, _nbits, _size, _result); -} +#define bit_ffs_area(_bitstr, _nbits, _size, _resultp) \ + *(_resultp) = bit_ff_area_at_((_bitstr), 0, (_nbits), (_size), 1) /* Find contiguous sequence of at least size cleared bits in bit string */ -static inline void -bit_ffc_area(bitstr_t *_bitstr, int _nbits, int _size, int *_result) -{ - bit_ffc_area_at(_bitstr, /*start*/0, _nbits, _size, _result); -} +#define bit_ffc_area(_bitstr, _nbits, _size, _resultp) \ + *(_resultp) = bit_ff_area_at_((_bitstr), 0, (_nbits), (_size), 0) /* Count the number of bits set in a bitstr of size _nbits at or after _start */ -static inline void -bit_count(bitstr_t *_bitstr, int _start, int _nbits, int *_result) +static inline ssize_t +bit_count_(bitstr_t *_bitstr, size_t _start, size_t _nbits) { bitstr_t *_curbitstr, mask; - int _value = 0, curbitstr_len; + size_t curbitstr_len; + ssize_t _value = 0; if (_start >= _nbits) - goto out; + return (0); _curbitstr = _bitstr + _bit_idx(_start); _nbits -= _BITSTR_BITS * _bit_idx(_start); @@ -383,6 +356,8 @@ bit_count(bitstr_t *_bitstr, int _start, int _nbits, int *_result) mask = _bit_make_mask(_start, _bit_offset(curbitstr_len - 1)); _value += __bitcountl(*_curbitstr & mask); _curbitstr++; + if (_nbits < _BITSTR_BITS) + return (_value); _nbits -= _BITSTR_BITS; } while (_nbits >= (int)_BITSTR_BITS) { @@ -395,23 +370,24 @@ bit_count(bitstr_t *_bitstr, int _start, int _nbits, int *_result) _value += __bitcountl(*_curbitstr & mask); } -out: - *_result = _value; + return (_value); } +#define bit_count(_bitstr, _start, _nbits, _resultp) \ + *(_resultp) = bit_count_((_bitstr), (_start), (_nbits)) /* Traverse all set bits, assigning each location in turn to iter */ #define bit_foreach_at(_bitstr, _start, _nbits, _iter) \ - for (bit_ffs_at((_bitstr), (_start), (_nbits), &(_iter)); \ + for ((_iter) = bit_ff_at_((_bitstr), (_start), (_nbits), 1); \ (_iter) != -1; \ - bit_ffs_at((_bitstr), (_iter) + 1, (_nbits), &(_iter))) + (_iter) = bit_ff_at_((_bitstr), (_iter) + 1, (_nbits), 1)) #define bit_foreach(_bitstr, _nbits, _iter) \ bit_foreach_at(_bitstr, /*start*/0, _nbits, _iter) /* Traverse all unset bits, assigning each location in turn to iter */ #define bit_foreach_unset_at(_bitstr, _start, _nbits, _iter) \ - for (bit_ffc_at((_bitstr), (_start), (_nbits), &(_iter)); \ + for ((_iter) = bit_ff_at_((_bitstr), (_start), (_nbits), 0); \ (_iter) != -1; \ - bit_ffc_at((_bitstr), (_iter) + 1, (_nbits), &(_iter))) + (_iter) = bit_ff_at_((_bitstr), (_iter) + 1, (_nbits), 0)) #define bit_foreach_unset(_bitstr, _nbits, _iter) \ bit_foreach_unset_at(_bitstr, /*start*/0, _nbits, _iter) diff --git a/tests/sys/sys/bitstring_test.c b/tests/sys/sys/bitstring_test.c index 0c214b9e67a7..a48042a4a063 100644 --- a/tests/sys/sys/bitstring_test.c +++ b/tests/sys/sys/bitstring_test.c @@ -1,5 +1,6 @@ /*- * Copyright (c) 2014 Spectra Logic Corporation + * Copyright (c) 2023 Klara, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -31,7 +32,7 @@ #include #include -#include +#include #include @@ -51,6 +52,7 @@ bitstring_run_heap_test(testfunc_t *test, int nbits) bitstr_t *bitstr = bit_alloc(nbits); test(bitstr, nbits, "heap"); + free(bitstr); } static void @@ -862,6 +864,91 @@ BITSTRING_TC_DEFINE(bit_foreach_unset_at) } } +/* + * Perform various tests on large bit strings. We can't simply add larger + * sizes to bitstring_runner as most of the existing tests are exhaustive + * and would take forever to run for large values of nbits. + * + * On 32-bit platforms, we use nbits = SSIZE_MAX (2147483647) bits, which + * is the largest we can hope to support; on 64-bit platforms, we use + * nbits = INT_MAX + 30 (2147483677), which is small enough to be + * practicable yet large enough to reveal arithmetic overflow bugs. + */ +ATF_TC_WITHOUT_HEAD(bitstr_large); +ATF_TC_BODY(bitstr_large, tc) +{ + size_t nbits = INT_MAX < SSIZE_MAX ? (size_t)INT_MAX + 30 : SSIZE_MAX; + size_t early = 5, late = nbits - 5; + ssize_t fc, fs; + bitstr_t *b; + + /* Check for overflow in size calculation */ + ATF_REQUIRE(nbits >= (size_t)INT_MAX); + ATF_REQUIRE(bitstr_size(nbits) >= nbits / 8); + + /* Allocate the bit string */ + ATF_REQUIRE(b = bit_alloc(nbits)); + + /* Check that we allocated enough */ + ATF_REQUIRE(malloc_usable_size(b) >= bitstr_size(nbits)); + + /* Check ffc, ffs on all-zeroes string */ + bit_ffc(b, nbits, &fc); + ATF_CHECK_EQ(0L, fc); + bit_ffs(b, nbits, &fs); + ATF_CHECK_EQ(-1L, fs); + + /* Set, test, and clear an early bit */ + bit_set(b, early); + bit_ffs(b, nbits, &fs); + ATF_CHECK_EQ((ssize_t)early, fs); + ATF_CHECK_EQ(0, bit_test(b, early - 1)); + ATF_CHECK(bit_test(b, early) != 0); + ATF_CHECK_EQ(0, bit_test(b, early + 1)); + bit_clear(b, early); + ATF_CHECK_EQ(0, bit_test(b, early)); + + /* Set, test, and clear an early bit range */ + bit_nset(b, early - 1, early + 1); + bit_ffs(b, nbits, &fs); + ATF_CHECK_EQ((ssize_t)early - 1, fs); + ATF_CHECK_EQ(0, bit_test(b, early - 2)); + ATF_CHECK(bit_test(b, early - 1)); + ATF_CHECK(bit_test(b, early)); + ATF_CHECK(bit_test(b, early + 1)); + ATF_CHECK_EQ(0, bit_test(b, early + 2)); + bit_nclear(b, early - 1, early + 1); + ATF_CHECK_EQ(0, bit_test(b, early - 1)); + ATF_CHECK_EQ(0, bit_test(b, early)); + ATF_CHECK_EQ(0, bit_test(b, early + 1)); + + /* Set, test, and clear a late bit */ + bit_set(b, late); + bit_ffs(b, nbits, &fs); + ATF_CHECK_EQ((ssize_t)late, fs); + ATF_CHECK_EQ(0, bit_test(b, late - 1)); + ATF_CHECK(bit_test(b, late) != 0); + ATF_CHECK_EQ(0, bit_test(b, late + 1)); + bit_clear(b, late); + ATF_CHECK_EQ(0, bit_test(b, late)); + + /* Set, test, and clear a late bit range */ + bit_nset(b, late - 1, late + 1); + bit_ffs(b, nbits, &fs); + ATF_CHECK_EQ((ssize_t)late - 1, fs); + ATF_CHECK_EQ(0, bit_test(b, late - 2)); + ATF_CHECK(bit_test(b, late - 1)); + ATF_CHECK(bit_test(b, late)); + ATF_CHECK(bit_test(b, late + 1)); + ATF_CHECK_EQ(0, bit_test(b, late + 2)); + bit_nclear(b, late - 1, late + 1); + ATF_CHECK_EQ(0, bit_test(b, late - 1)); + ATF_CHECK_EQ(0, bit_test(b, late)); + ATF_CHECK_EQ(0, bit_test(b, late + 1)); + + free(b); +} + ATF_TP_ADD_TCS(tp) { @@ -884,6 +971,7 @@ ATF_TP_ADD_TCS(tp) BITSTRING_TC_ADD(tp, bit_foreach_at); BITSTRING_TC_ADD(tp, bit_foreach_unset); BITSTRING_TC_ADD(tp, bit_foreach_unset_at); + ATF_TP_ADD_TC(tp, bitstr_large); return (atf_no_error()); } From nobody Wed Dec 13 20:06:31 2023 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 4Sr61z3XCLz54FM3; Wed, 13 Dec 2023 20:06:31 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sr61z2zJ7z4ZLT; Wed, 13 Dec 2023 20:06:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702497991; 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=1J7TaL+oS/kPGc/d+pyFlUy8XEgzZJgAt8saJXU0IC8=; b=sVbG16q9g30S3C5K6Z4AhI2LSDU7ITR2nD/6PM6nlXdI1KKghpgSL8NrTgN593YxpH5gi4 Nh7w8ntaHVTHLJ6RMc5huQrr6arJMdzNKnoZuMpBmz3ztCEoi6jG86IHLakjWEZzPbqeiC IpYMD0Z6z+GC3NPqfqyCB+DeIJ1osQcx9hYvB/97/ZwRt0vSjL+JJ25oDmpJ1TNlYsMfwT BKwGuGexoB/9gMh3q1IeWLry1cltcrlHKTsPY3E/CUjjY8vm6ctLfX1S40bwZGLGjFMfzx /dwloo/KSbik8Wa+CacUGh8oCjEc/DsyNNPbMD6CwiDX+Ogsv9Nu796G3yDX8Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702497991; a=rsa-sha256; cv=none; b=BjryYRugo4k3V7vOhfo8qi6QrTGG+LHbIjZjTZCj527Gifl919VjZXK5T7oaDwo/InK9SW lTzDKM9hM7yqVTLZpP3g1U1NIqjTCNdGxfMqS3t1mBQ7iPjakewPA3o7FYNqMngvJKBVUl VdMA0eH5y0j8ey/FSXcBRgjpwk+E0u8Jns/i/v+mZ/cll/TpLM8dWbHvh8pJUP/9cDmRhc /MkGJuL3hBn4UvzlGoKqxmcMu20q7miDyg02Wr9R9C3IEaWYpiczpwKbb2SMZHGd7lDmC2 WpgMXkH0jkkmZfT7K+zqd9gnSSgy73UEvw1x3KPB+sU1CpkXo9jbaA1xCVj1rQ== 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=1702497991; 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=1J7TaL+oS/kPGc/d+pyFlUy8XEgzZJgAt8saJXU0IC8=; b=PLpzAchD27wjT6OW4jsZ/51Jh/7kgDh9eTNKtv7vqy4naLM0D/Rd0rQ9gOvUWQhNHfScpo RTZkCZUFHHwwMb4lhDWc8Dj/PAzyx/EWKS9nf64THxpmzITXyQ7489IYSIKTzMttekBSyT GFWBfxD3eqDbCJ1zxWcilY6bKFHx0K1yDUpxfuZ6tbfYEJMmh5rR13RrJO7OvAPNmH+0Hh QKiOlN4GkimE7u6VWCzJXIt6BqLjIGvbifE4ZtQnGMMZwPdxkZadw1REiaqYyAZpqvMAj8 R32lItAxIPDFgyefBN+h3NtL5uKH5H0wpEfZQ+JUIx8LlCgWGYUusTsLls9h+w== 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 4Sr61z20GHz1C0r; Wed, 13 Dec 2023 20:06:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BDK6V8T087441; Wed, 13 Dec 2023 20:06:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BDK6VLv087438; Wed, 13 Dec 2023 20:06:31 GMT (envelope-from git) Date: Wed, 13 Dec 2023 20:06:31 GMT Message-Id: <202312132006.3BDK6VLv087438@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 585762c3733f - stable/13 - Improve usability of head(1) and tail(1): 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 585762c3733f3446fe2dad63a1f460903731927c Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=585762c3733f3446fe2dad63a1f460903731927c commit 585762c3733f3446fe2dad63a1f460903731927c Author: Xin LI AuthorDate: 2022-07-13 04:14:25 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-12-13 16:39:38 +0000 Improve usability of head(1) and tail(1): - Consistently support -q (quiet) and -v (verbose) - Allow specifying numbers with SI prefixes supported by expand_number(3) - Remove 2^31 limit on lines for head(1) MFC after: 2 weeks Reviewed by: lwhsu, pauamma, gbe Relnotes: yes Differential Revision: https://reviews.freebsd.org/D35720 (cherry picked from commit 643ac419fafba89f5adda0e0ea75b538727453fb) --- usr.bin/head/Makefile | 1 + usr.bin/head/head.1 | 24 +++++++++++++++++++--- usr.bin/head/head.c | 33 +++++++++++++++++++++--------- usr.bin/head/tests/head_test.sh | 45 +++++++++++++++++++++++++++++++++++++++++ usr.bin/tail/Makefile | 1 + usr.bin/tail/extern.h | 2 +- usr.bin/tail/forward.c | 6 +++--- usr.bin/tail/tail.1 | 25 ++++++++++++++++------- usr.bin/tail/tail.c | 22 ++++++++++++++------ usr.bin/tail/tests/tail_test.sh | 44 ++++++++++++++++++++++++++++++++++++++++ 10 files changed, 173 insertions(+), 30 deletions(-) diff --git a/usr.bin/head/Makefile b/usr.bin/head/Makefile index 0b4cf4b2a5d6..dbf9834da9a0 100644 --- a/usr.bin/head/Makefile +++ b/usr.bin/head/Makefile @@ -3,6 +3,7 @@ .include PROG= head +LIBADD= util HAS_TESTS= SUBDIR.${MK_TESTS}+= tests diff --git a/usr.bin/head/head.1 b/usr.bin/head/head.1 index 3a68f5a8ba82..2a0416d9883f 100644 --- a/usr.bin/head/head.1 +++ b/usr.bin/head/head.1 @@ -27,7 +27,7 @@ .\" .\" @(#)head.1 8.1 (Berkeley) 6/6/93 .\" -.Dd April 10, 2018 +.Dd June 12, 2022 .Dt HEAD 1 .Os .Sh NAME @@ -35,6 +35,7 @@ .Nd display first lines of a file .Sh SYNOPSIS .Nm +.Op Fl qv .Op Fl n Ar count | Fl c Ar bytes .Op Ar .Sh DESCRIPTION @@ -58,14 +59,30 @@ of each of the specified files. Print .Ar count lines of each of the specified files. +.Pp +Both +.Ar count +and +.Ar bytes +may also be specified with size suffixes supported by +.Xr expand_number 3 . +.It Fl q , Fl -quiet , Fl -silent +Suppresses printing of headers when multiple files are being examined. +.It Fl v , Fl -verbose +Prepend each file with a header. .El .Pp -If more than a single file is specified, each file is preceded by a +If more than a single file is specified, or if the +.Fl v +option is used, each file is preceded by a header consisting of the string .Dq ==> XXX <== where .Dq XXX is the name of the file. +The +.Fl q +flag disables the printing of the header in all cases. .Sh EXIT STATUS .Ex -std .Sh EXAMPLES @@ -82,7 +99,8 @@ in the following way to, for example, display only line 500 from the file .Pp .Dl $ head -n 500 foo | tail -n 1 .Sh SEE ALSO -.Xr tail 1 +.Xr tail 1 , +.Xr expand_number 3 .Sh HISTORY The .Nm diff --git a/usr.bin/head/head.c b/usr.bin/head/head.c index 0b76132e434c..de4faf632979 100644 --- a/usr.bin/head/head.c +++ b/usr.bin/head/head.c @@ -55,6 +55,8 @@ static char sccsid[] = "@(#)head.c 8.2 (Berkeley) 5/4/95"; #include #include +#include + #include #include @@ -64,7 +66,7 @@ static char sccsid[] = "@(#)head.c 8.2 (Berkeley) 5/4/95"; * Bill Joy UCB August 24, 1977 */ -static void head(FILE *, int); +static void head(FILE *, intmax_t); static void head_bytes(FILE *, off_t); static void obsolete(char *[]); static void usage(void); @@ -73,6 +75,9 @@ static const struct option long_opts[] = { {"bytes", required_argument, NULL, 'c'}, {"lines", required_argument, NULL, 'n'}, + {"quiet", no_argument, NULL, 'q'}, + {"silent", no_argument, NULL, 'q'}, + {"verbose", no_argument, NULL, 'v'}, {NULL, no_argument, NULL, 0} }; @@ -80,29 +85,37 @@ int main(int argc, char *argv[]) { FILE *fp; - char *ep; off_t bytecnt; - int ch, first, linecnt, eval; + intmax_t linecnt; + int ch, first, eval; fileargs_t *fa; cap_rights_t rights; + int qflag = 0; + int vflag = 0; linecnt = -1; eval = 0; bytecnt = -1; obsolete(argv); - while ((ch = getopt_long(argc, argv, "+n:c:", long_opts, NULL)) != -1) { + while ((ch = getopt_long(argc, argv, "+n:c:qv", long_opts, NULL)) != -1) { switch(ch) { case 'c': - bytecnt = strtoimax(optarg, &ep, 10); - if (*ep || bytecnt <= 0) + if (expand_number(optarg, &bytecnt) || bytecnt <= 0) errx(1, "illegal byte count -- %s", optarg); break; case 'n': - linecnt = strtol(optarg, &ep, 10); - if (*ep || linecnt <= 0) + if (expand_number(optarg, &linecnt) || linecnt <= 0) errx(1, "illegal line count -- %s", optarg); break; + case 'q': + qflag = 1; + vflag = 0; + break; + case 'v': + qflag = 0; + vflag = 1; + break; case '?': default: usage(); @@ -132,7 +145,7 @@ main(int argc, char *argv[]) eval = 1; continue; } - if (argc > 1) { + if (vflag || (qflag == 0 && argc > 1)) { (void)printf("%s==> %s <==\n", first ? "" : "\n", *argv); first = 0; @@ -153,7 +166,7 @@ main(int argc, char *argv[]) } static void -head(FILE *fp, int cnt) +head(FILE *fp, intmax_t cnt) { char *cp; size_t error, readlen; diff --git a/usr.bin/head/tests/head_test.sh b/usr.bin/head/tests/head_test.sh index fb9f28c1d2af..2dfc1896f6ef 100755 --- a/usr.bin/head/tests/head_test.sh +++ b/usr.bin/head/tests/head_test.sh @@ -118,6 +118,48 @@ read_from_stdin_body() { atf_check cmp outfile expectfile } +atf_test_case silent_header +silent_header_head() { + atf_set "descr" "Test head(1)'s silent header feature" +} +silent_header_body() { + #head(1) defaults to head -n 10 if no args are given. + jot 11 1 11 > file1 + jot 11 2 12 > file2 + jot 10 1 10 > expectfile + jot 10 2 11 >> expectfile + head -q file1 file2 > outfile + atf_check cmp outfile expectfile +} + +atf_test_case verbose_header +verbose_header_head() { + atf_set "descr" "Test head(1)'s verbose header feature" +} +verbose_header_body() { + #head(1) defaults to head -n 10 if no args are given. + jot -b test 10 > file1 + echo '==> file1 <==' > expectfile + cat file1 >> expectfile + head -v file1 > outfile + atf_check cmp outfile expectfile +} + +atf_test_case si_number +si_number_head() { + atf_set "descr" "Test head(1)'s SI number feature" +} +si_number_body() { + jot -b aaaaaaa 129 > file1 + jot -b aaaaaaa 128 > expectfile + head -c 1k file1 > outfile + atf_check cmp outfile expectfile + jot 1025 1 1025 > file1 + jot 1024 1 1024 > expectfile + head -n 1k file1 > outfile + atf_check cmp outfile expectfile +} + atf_init_test_cases() { atf_add_test_case empty_file atf_add_test_case default_no_options @@ -128,4 +170,7 @@ atf_init_test_cases() { atf_add_test_case missing_line_count atf_add_test_case invalid_line_count atf_add_test_case read_from_stdin + atf_add_test_case silent_header + atf_add_test_case verbose_header + atf_add_test_case si_number } diff --git a/usr.bin/tail/Makefile b/usr.bin/tail/Makefile index cd85466cdc38..17cf55eb49e5 100644 --- a/usr.bin/tail/Makefile +++ b/usr.bin/tail/Makefile @@ -4,6 +4,7 @@ PROG= tail SRCS= forward.c misc.c read.c reverse.c tail.c +LIBADD= util .if ${MK_CASPER} != "no" && !defined(RESCUE) LIBADD+= casper diff --git a/usr.bin/tail/extern.h b/usr.bin/tail/extern.h index cbf70f27e28d..830f9be79ab1 100644 --- a/usr.bin/tail/extern.h +++ b/usr.bin/tail/extern.h @@ -75,5 +75,5 @@ int mapprint(struct mapinfo *, off_t, off_t); int maparound(struct mapinfo *, off_t); void printfn(const char *, int); -extern int Fflag, fflag, qflag, rflag, rval, no_files; +extern int Fflag, fflag, qflag, rflag, rval, no_files, vflag; extern fileargs_t *fa; diff --git a/usr.bin/tail/forward.c b/usr.bin/tail/forward.c index 48516a730a50..f991b2517c48 100644 --- a/usr.bin/tail/forward.c +++ b/usr.bin/tail/forward.c @@ -243,8 +243,8 @@ show(file_info_t *file) int ch; while ((ch = getc(file->fp)) != EOF) { - if (last != file && no_files > 1) { - if (!qflag) + if (last != file) { + if (vflag || (qflag == 0 && no_files > 1)) printfn(file->file_name, 1); last = file; } @@ -322,7 +322,7 @@ follow(file_info_t *files, enum STYLE style, off_t off) if (file->fp) { active = 1; n++; - if (no_files > 1 && !qflag) + if (vflag || (qflag == 0 && no_files > 1)) printfn(file->file_name, 1); forward(file->fp, file->file_name, style, off, &file->st); if (Fflag && fileno(file->fp) != STDIN_FILENO) diff --git a/usr.bin/tail/tail.1 b/usr.bin/tail/tail.1 index 19c4046b6683..38e8f95b9f59 100644 --- a/usr.bin/tail/tail.1 +++ b/usr.bin/tail/tail.1 @@ -30,7 +30,7 @@ .\" .\" @(#)tail.1 8.1 (Berkeley) 6/6/93 .\" -.Dd March 22, 2020 +.Dd July 12, 2022 .Dt TAIL 1 .Os .Sh NAME @@ -39,7 +39,7 @@ .Sh SYNOPSIS .Nm .Op Fl F | f | r -.Op Fl q +.Op Fl qv .Oo .Fl b Ar number | Fl c Ar number | Fl n Ar number .Oc @@ -115,7 +115,7 @@ option if reading from standard input rather than a file. The location is .Ar number lines. -.It Fl q +.It Fl q, Fl -quiet, Fl -silent Suppresses printing of headers when multiple files are being examined. .It Fl r The @@ -134,16 +134,26 @@ from the beginning or end of the input from which to begin the display. The default for the .Fl r option is to display all of the input. +.It Fl v, Fl -verbose +Prepend each file with a header. .El .Pp -If more than a single file is specified, each file is preceded by a +If more than a single file is specified, or if the +.Fl v +option is used, each file is preceded by a header consisting of the string .Dq Li "==> " Ns Ar XXX Ns Li " <==" where .Ar XXX -is the name of the file unless +is the name of the file. +The .Fl q -flag is specified. +flag disables the printing of the header in all cases. +.Pp +All +.Ar number +arguments may also be specified with size suffixes supported by +.Xr expand_number 3 . .Sh EXIT STATUS .Ex -std .Sh EXAMPLES @@ -166,7 +176,8 @@ from the beginning and then follow the file as usual: .Sh SEE ALSO .Xr cat 1 , .Xr head 1 , -.Xr sed 1 +.Xr sed 1 , +.Xr expand_number 3 .Sh STANDARDS The .Nm diff --git a/usr.bin/tail/tail.c b/usr.bin/tail/tail.c index 5babd89135ca..492a6494628d 100644 --- a/usr.bin/tail/tail.c +++ b/usr.bin/tail/tail.c @@ -56,12 +56,14 @@ static const char sccsid[] = "@(#)tail.c 8.1 (Berkeley) 6/6/93"; #include #include +#include + #include #include #include "extern.h" -int Fflag, fflag, qflag, rflag, rval, no_files; +int Fflag, fflag, qflag, rflag, rval, no_files, vflag; fileargs_t *fa; static void obsolete(char **); @@ -72,6 +74,9 @@ static const struct option long_opts[] = {"blocks", required_argument, NULL, 'b'}, {"bytes", required_argument, NULL, 'c'}, {"lines", required_argument, NULL, 'n'}, + {"quiet", no_argument, NULL, 'q'}, + {"silent", no_argument, NULL, 'q'}, + {"verbose", no_argument, NULL, 'v'}, {NULL, no_argument, NULL, 0} }; @@ -85,7 +90,6 @@ main(int argc, char *argv[]) enum STYLE style; int ch, first; file_info_t file, *filep, *files; - char *p; cap_rights_t rights; /* @@ -103,8 +107,9 @@ main(int argc, char *argv[]) #define ARG(units, forward, backward) { \ if (style) \ usage(); \ - off = strtoll(optarg, &p, 10) * (units); \ - if (*p) \ + if (expand_number(optarg, &off)) \ + err(1, "illegal offset -- %s", optarg); \ + if (off > INT64_MAX / units || off < INT64_MIN / units ) \ errx(1, "illegal offset -- %s", optarg); \ switch(optarg[0]) { \ case '+': \ @@ -124,7 +129,7 @@ main(int argc, char *argv[]) obsolete(argv); style = NOTSET; off = 0; - while ((ch = getopt_long(argc, argv, "+Fb:c:fn:qr", long_opts, NULL)) != + while ((ch = getopt_long(argc, argv, "+Fb:c:fn:qrv", long_opts, NULL)) != -1) switch(ch) { case 'F': /* -F is superset of (and implies) -f */ @@ -144,10 +149,15 @@ main(int argc, char *argv[]) break; case 'q': qflag = 1; + vflag = 0; break; case 'r': rflag = 1; break; + case 'v': + vflag = 1; + qflag = 0; + break; case '?': default: usage(); @@ -227,7 +237,7 @@ main(int argc, char *argv[]) ierr(fn); continue; } - if (argc > 1 && !qflag) { + if (vflag || (qflag == 0 && argc > 1)) { printfn(fn, !first); first = 0; } diff --git a/usr.bin/tail/tests/tail_test.sh b/usr.bin/tail/tests/tail_test.sh index 412d198713e6..0b845dff0cf8 100755 --- a/usr.bin/tail/tests/tail_test.sh +++ b/usr.bin/tail/tests/tail_test.sh @@ -351,6 +351,47 @@ follow_rename_body() atf_check kill $pid } +atf_test_case silent_header +silent_header_head() { + atf_set "descr" "Test tail(1)'s silent header feature" +} +silent_header_body() { + jot 11 1 11 > file1 + jot 11 2 12 > file2 + jot 10 2 11 > expectfile + jot 10 3 12 >> expectfile + tail -q file1 file2 > outfile + atf_check cmp outfile expectfile +} + +atf_test_case verbose_header +verbose_header_head() { + atf_set "descr" "Test tail(1)'s verbose header feature" +} +verbose_header_body() { + jot 11 1 11 > file1 + echo '==> file1 <==' > expectfile + jot 10 2 11 >> expectfile + tail -v file1 > outfile + atf_check cmp outfile expectfile +} + +atf_test_case si_number +si_number_head() { + atf_set "descr" "Test tail(1)'s SI number feature" +} +si_number_body() { + jot -b aaaaaaa 129 > file1 + jot -b aaaaaaa 128 > expectfile + tail -c 1k file1 > outfile + atf_check cmp outfile expectfile + jot 1025 1 1025 > file1 + jot 1024 2 1025 > expectfile + tail -n 1k file1 > outfile + atf_check cmp outfile expectfile +} + + atf_init_test_cases() { atf_add_test_case empty_r @@ -371,4 +412,7 @@ atf_init_test_cases() atf_add_test_case follow atf_add_test_case follow_stdin atf_add_test_case follow_rename + atf_add_test_case silent_header + atf_add_test_case verbose_header + atf_add_test_case si_number } From nobody Wed Dec 13 20:06:32 2023 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 4Sr6204Tkjz54Fh6; Wed, 13 Dec 2023 20:06:32 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sr6203jt8z4Z7L; Wed, 13 Dec 2023 20:06:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702497992; 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=t0tqAXG8aq/G+eFf9Z1Mowh/xVyYq0B1syFcWOCyTio=; b=EE01HmxmgAFEITEVhe2yFglN4k2ufYT+RMdpTh0G1cgijO8EfLl2AnbfH9CPjvssvzWXVR iO3VBIgJmDmX+cvdB7gx7rtf8gA1j054809DxbDjXR1WT+19Xe9QRzl1T0wU69GUbHRXte Z5mKnbHDXriWgIJSIj9ETo8wCNVZuFFYvIy7bMHyVu+wZzPDXA6r2R+mfeU9FD4KeTO8KL OEsu+AG7lDCamScp1gq3XZMnw2WnqH/8UViRkTfaj+iTlHBvINK870x147fxiqVVw0gbTW HO4pTGLi0z9z/pvtue5g4q8a8EGKugDVTgh+azcPQTuz3m/ID/pcxQc0Y3AoxQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702497992; a=rsa-sha256; cv=none; b=Z9mJYX+R4LTdGdub15xqLoVCRAPLxrd97qu6X8pfMIq9Z1tdhnoPoA1sZavkNVo6ZrTsQF oATAu7Gd+s/Gi5P05NKs25Ul/gkHdSLc5YXKCaRYyVeqrzwO6oUprUjZCNrEg2is9D4/sD iy4M31OJe5uvV3JIoQEXGU5dOWTlC0QW4uZnZP/89sh8BJRt88kkWyR+UeubXbi9j1ukAp 4p/jAIdvp9r+mpK2ZRFlDBqECSFQOCUnEQM4cTcwcAF7RymMyFIEIlEaYz/9yWps6rQ4PK bBArYhC0LqHVB4jrGO7GOb8lWBGzdRz86MO0tq+AySMnicZE1f9zvk6dHR6CPw== 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=1702497992; 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=t0tqAXG8aq/G+eFf9Z1Mowh/xVyYq0B1syFcWOCyTio=; b=OpeAwNCFuAtm4zycSOql3yU/8gCMeYKV0tcMIUosupc728JHlzSCHBgah1Pol6srJd9n3s U2WW3BSMCpdHYT2lh/BiECKG/l2S94tMEcaAf2KShUWebH0zyRisxfAtbjO5VAAXU8l9T1 KEzM3TqMYvzQwwdEH+/Vgdl2zUm5AdcsS3OMTr+9MVWnuwyjKNDaFRul8qJFyXtdbb6gKE Hv91y4DwriO52ZPZIjLsWkfyPkIis/AiLMmhQTBfRmqjx4XCwlTkSuMEgZqR7oI8fE5AE/ Wpa5klM+h1eCjiEuhzoPGVymyOx9Heb6QfckB0KTqXQGi4eVhcv1WW6RPtxHrg== 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 4Sr6202qVZz1Bxf; Wed, 13 Dec 2023 20:06:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BDK6WCT087504; Wed, 13 Dec 2023 20:06:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BDK6W5l087501; Wed, 13 Dec 2023 20:06:32 GMT (envelope-from git) Date: Wed, 13 Dec 2023 20:06:32 GMT Message-Id: <202312132006.3BDK6W5l087501@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 3109a31bf21b - stable/13 - tail: Retry kevent if the system call was interrupted 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3109a31bf21b50aded5f27900e7a58490daeac48 Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=3109a31bf21b50aded5f27900e7a58490daeac48 commit 3109a31bf21b50aded5f27900e7a58490daeac48 Author: Warner Losh AuthorDate: 2023-02-19 03:04:29 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-12-13 16:39:38 +0000 tail: Retry kevent if the system call was interrupted kevent returns EINTR when I suspend / resume. This causes tail -f and tail -F to exit with interrupt system call. Ignore this error and try kevent again. Sponsored by: Netflix (cherry picked from commit ef6f20ce47613db7cc615b45f4b6fa1eb99ae0ba) --- usr.bin/tail/forward.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/usr.bin/tail/forward.c b/usr.bin/tail/forward.c index f991b2517c48..e2a3eb77aade 100644 --- a/usr.bin/tail/forward.c +++ b/usr.bin/tail/forward.c @@ -408,10 +408,16 @@ follow(file_info_t *files, enum STYLE style, off_t off) /* * In the -F case we set a timeout to ensure that * we re-stat the file at least once every second. + * If we've recieved EINTR, ignore it. Both reasons + * for its generation are transient. */ - n = kevent(kq, NULL, 0, ev, 1, Fflag ? &ts : NULL); - if (n < 0) - err(1, "kevent"); + do { + n = kevent(kq, NULL, 0, ev, 1, Fflag ? &ts : NULL); + if (n < 0 && errno == EINTR) + continue; + if (n < 0) + err(1, "kevent"); + } while (n < 0); if (n == 0) { /* timeout */ break; From nobody Wed Dec 13 20:06:33 2023 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 4Sr6220gHjz54Fkx; Wed, 13 Dec 2023 20:06:34 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sr6214rY2z4ZJw; Wed, 13 Dec 2023 20:06:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702497993; 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=ba+6YLXMTxXmjfwLL2u7W6Kb7+Zp8j0sFynPY68HjOg=; b=tH6VMowAe8GlKfRWSryQ6vnwnSlyTHpM8aseNco871S/7r9vUUVGqX+pl3wXA1khxSi6X0 L960VG0Fa6dyHyR6TmWTraGlMhWLw8QOZ3+68Z8Yr2e+Yixy13d2j5cBz0O78XxQT/A1U1 DC0rilykrTr0D2yBzf0Ls77MISyNQkE4BOiE2RiKRVKEVWtbgoRdr2m90/iYPoE8A8HaJ9 pMDgywBLBWbdvHqU+Aihi2eUSnl7ut5dQCXg67d9wqVxPv8drR2n+2VkdvpQZQeGYLbWmu oaYSB6orzyoek8mtLCWdX5+blDrjwc55xBswMaOCQe0Nj/DGlXPmO4aKAjoI3g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702497993; a=rsa-sha256; cv=none; b=Nn/noEANQjeUdxovSovC+JPprZLN5liPAP2EI3bgia5tZK3iLDpCbkwRZ3fmWCgMvz9f+S b51LJhKPjp4eGnvJFZFw1HtVBhz+5WVTEH0yD0Hj7saEN5Ovq2G6peEDM/9eeG874VTR9A uCmQRCNn361Ywge8dOnFhTA3oqxbByd9OvNFfT106oKFjL79DNRlPUHUkRI8MPOjWYhE8L QyOxpm8nNzMYNPQjkimsPfMe4nXiHb3iLhKtKZ+rWpPRic5xZUjkkWJSO/ZothHrP+xA2N 0hXHVFmK//fCZwIG8IH5c30iMFZ6mie4+tWjxiHoPRkioJKNfFy94RWqgWRW+Q== 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=1702497993; 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=ba+6YLXMTxXmjfwLL2u7W6Kb7+Zp8j0sFynPY68HjOg=; b=iNPEhRAmNjcxgmFkaDaGWiaQWHjhv0UAQdXSbmwHDkfsVNGreKQbaq7h62IKZ8bi3qYgsN Rixu3UHapmdI1RNK9hdJCnbiKS5pVx013vgw9n6TilNWF+pBx4yZFuusrfxOH46bLzUwVD YnzmMg35eyt/nchnH/ZfImzt+ketVktZqEvSWVrkKZmMuv9KX6r9gZQLSXYmh6fFFAu/6i 977ABRehYiuAZaQIlZZzsyIO+TQmnJbsiwuli8k757LLae7onZeZ/XFYW1nnd0Olrs78HR Onfqns9J8g4W/k2OZxvaUXzP8j9Tif/179wGWlYaulWsUjXYWRsdl2Bm0joIMQ== 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 4Sr6213yfcz1BBr; Wed, 13 Dec 2023 20:06:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BDK6X7W087571; Wed, 13 Dec 2023 20:06:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BDK6XYF087568; Wed, 13 Dec 2023 20:06:33 GMT (envelope-from git) Date: Wed, 13 Dec 2023 20:06:33 GMT Message-Id: <202312132006.3BDK6XYF087568@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 58073ccbe358 - stable/13 - tail: Verify correct behavior when input does not end in a newline. 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 58073ccbe358ecc0c470b9b6d767bcfcf5e5292e Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=58073ccbe358ecc0c470b9b6d767bcfcf5e5292e commit 58073ccbe358ecc0c470b9b6d767bcfcf5e5292e Author: Dag-Erling Smørgrav AuthorDate: 2023-03-16 15:36:49 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-12-13 16:39:38 +0000 tail: Verify correct behavior when input does not end in a newline. Sponsored by: Klara, Inc. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D39116 (cherry picked from commit fa3af3ce5010740f28faed22e0a1e819491f26b4) --- usr.bin/tail/tests/tail_test.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/usr.bin/tail/tests/tail_test.sh b/usr.bin/tail/tests/tail_test.sh index 0b845dff0cf8..8123a310fe67 100755 --- a/usr.bin/tail/tests/tail_test.sh +++ b/usr.bin/tail/tests/tail_test.sh @@ -391,6 +391,19 @@ si_number_body() { atf_check cmp outfile expectfile } +atf_test_case no_lf_at_eof +no_lf_at_eof_head() +{ + atf_set "descr" "File does not end in newline" +} +no_lf_at_eof_body() +{ + printf "a\nb\nc" >infile + atf_check -o inline:"c" tail -1 infile + atf_check -o inline:"b\nc" tail -2 infile + atf_check -o inline:"a\nb\nc" tail -3 infile + atf_check -o inline:"a\nb\nc" tail -4 infile +} atf_init_test_cases() { @@ -415,4 +428,5 @@ atf_init_test_cases() atf_add_test_case silent_header atf_add_test_case verbose_header atf_add_test_case si_number + atf_add_test_case no_lf_at_eof } From nobody Wed Dec 13 20:06:34 2023 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 4Sr62329YVz54FRw; Wed, 13 Dec 2023 20:06:35 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sr6225dwcz4ZMh; Wed, 13 Dec 2023 20:06:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702497994; 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=jbz3q9m0Sg7WH5Cdzk3E/Tzrn5cVWnXC5xBMVzH8ydk=; b=RQ1LQxv4+JKVoRz4tgZjUuaUZ45Y3hj17016gZjMD2EqpSIwjw/U1weX1Bg8XJVcYv19lL DlikLHymnMEklYe+rTR6oiNu9R9ewH0Y3BHAWE7Dybm26Vlxk2e0ph9kgh82AC+S5uJQxU M8ZXTt9LjxfwMgpNWmZdhSdpkZCJn6fsvpN30dV4yduPrvPZ6yhlCKHn2Dfka/c8sulMVX 6+SfKP8m5Van+KFR+1P8kI4HuO18wqRO6uTQ/87KBclGWpaRa5iIuw2joiOFnwhOR0MV1a 6z7dyHovsNv+JhE6hJbi8P9mzythcoktU0WPiy1b5JU0nQ5amKt9NcUAvEXNcw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702497994; a=rsa-sha256; cv=none; b=qtJD1jV8cDpgV6FuQ/8mGYqvoFDlQTK5v+8aKJDBC8cVmdNZn2v/tnW1uHoLuRqiEtdnrz 9Qefy2HIHGpHRiXHmYnRQV7c3N7E9QEHWV57tCUeq42tzjxuT/Xom4A2PYJt0KnaQUYMAk sHjBOSUloRvh5S3QBuF5SHcPCiBpdjJFFvQuQgOSmpj+xiCdHlrdgrOIZiEg4wFsa8jjeT 9JeflWYXUxSqTNLFzDPSziQW8ekQe7rDGrsPsqYL+KqEXdkZVR7uWG5pxHTh8FYvoW9Fg6 urotKjmLCqXwktKAuQuINd9mCeuBeJOBW2LCrs9cybSfB9Zxz34bQ01oeGhgQw== 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=1702497994; 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=jbz3q9m0Sg7WH5Cdzk3E/Tzrn5cVWnXC5xBMVzH8ydk=; b=jb2Ef+Kytf4pHctZjr+OIn7N4ftMcVWceiTHB269J+zoHn6HOh5ClZ+16z53qS+Dfbvanm hYgXjioH/7qpHg+lSxW9Ad82Zzv/lDuEuWWagyjfEFI5N6IFfitUXW7WFSqwovlgW8UYAK fZCyEukB7JI5DdkmXBvkJApLZrqymqlYrqGcq04Gp2cfugLQjUb6amhrkNKSzNqwaAOJQt 1JG0+jxr0TsckhV8CksfCG4RhU+h0hdz3Nsn1LVEiXaFSXUuExZYHV4LPWP7AgLPHtYBKx tdaqKGaqu3OGVEfLC7G3STyFTgHiS+bRuFWKoNXGjscpsYzf3vow3tOMudkafA== 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 4Sr6224jfNz1BXd; Wed, 13 Dec 2023 20:06:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BDK6Y2x087614; Wed, 13 Dec 2023 20:06:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BDK6YgO087611; Wed, 13 Dec 2023 20:06:34 GMT (envelope-from git) Date: Wed, 13 Dec 2023 20:06:34 GMT Message-Id: <202312132006.3BDK6YgO087611@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: ed64bde3c525 - stable/13 - tail.1: Lint with mandoc(1) 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ed64bde3c5258bf6b0fb201b7c1bede43734c266 Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=ed64bde3c5258bf6b0fb201b7c1bede43734c266 commit ed64bde3c5258bf6b0fb201b7c1bede43734c266 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2023-11-28 16:10:12 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-12-13 16:39:38 +0000 tail.1: Lint with mandoc(1) MFC after: 3 days Sponsored by: Klara, Inc. (cherry picked from commit 51c27021b2818cc626500d7723dc82291e3eecaa) --- usr.bin/tail/tail.1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.bin/tail/tail.1 b/usr.bin/tail/tail.1 index 38e8f95b9f59..a76f754b18b9 100644 --- a/usr.bin/tail/tail.1 +++ b/usr.bin/tail/tail.1 @@ -30,7 +30,7 @@ .\" .\" @(#)tail.1 8.1 (Berkeley) 6/6/93 .\" -.Dd July 12, 2022 +.Dd November 28, 2023 .Dt TAIL 1 .Os .Sh NAME @@ -115,7 +115,7 @@ option if reading from standard input rather than a file. The location is .Ar number lines. -.It Fl q, Fl -quiet, Fl -silent +.It Fl q , Fl -quiet , Fl -silent Suppresses printing of headers when multiple files are being examined. .It Fl r The @@ -134,7 +134,7 @@ from the beginning or end of the input from which to begin the display. The default for the .Fl r option is to display all of the input. -.It Fl v, Fl -verbose +.It Fl v , Fl -verbose Prepend each file with a header. .El .Pp From nobody Wed Dec 13 20:06:35 2023 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 4Sr6240r0Tz54FMD; Wed, 13 Dec 2023 20:06:36 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sr62372X4z4ZVP; Wed, 13 Dec 2023 20:06:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702497996; 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=m9R1MIMQsAinZIjn7M2aGlN/ad7PvXHzHmF2lgpjbP8=; b=w23YcO/dU04/U6YgG/osb0LlWLwjx913kOsjWzlMF2YUMF5ZkYp+rDO4O0UvjnuygmsKpH 5MjMHmEHL4NbD7NOw5C/qPjugjAlRNYsgPmf6+M0lyGQ+m7NY90RbnZctpJanvfv3EbvcN fendEZfgNJtcTLMKTcxZLe53VapM87WgivxDEaFFqbqhCIYb5qelh4J9dsKrIdIuWbY9mk 3C4AZhUH5JO9ShLmLxhKMIbIPA51jricTSRky48rXCuEIw35xH7O2ynTg+svhw1OjAaK7m 6/HzdggkrnrwIvMYCvXaFqn0YCNzYWNl9Cp7tDiVXz4CbuCKJc41VM+Cd9tZkw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702497996; a=rsa-sha256; cv=none; b=Rh9R9XYM/GkYxeu9Tz+RSARYdkQpiHYPh2x+GKZtYPIRs9UMC9NTTukvIOWtkHBTQaVmDy iDQzGB7qT6OfqJKSsyTX9bfO758ozSvzCKRgg0G0ffDBGilIetjP+1T2PlUpRbC/J1OHho Ff8yH7BA4Btj/+1YqRky21REOOoDRrQuk78WSzzy0n86R9tNU+01mZiK/MgD7r0PhtBvIT M+oyw0ZcenlFqqf/DBXTTHtdN2mY7ouyQygn6T9A6hRWJjoW8rR4jIFSQFGbJkezRsv5Tr QpDU5hY1CjdNjy26q8U9qHvv+6kT1TDeFZOfe/160XANHVVYMsZN/J90uB/Y7Q== 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=1702497996; 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=m9R1MIMQsAinZIjn7M2aGlN/ad7PvXHzHmF2lgpjbP8=; b=Wg2BGvIiHNQXq6C9BffC/X2sep7aLNDVpV3/bNEm5KsVWhXVnyINLk8tIuzBj3YOF6fVeO azaK0sf7F2XtaWRgInu6uVA0iZE0FKZ5046tB2eV5SibFGtsn24SXfoGTZKrIQaA9mOa32 xPFitGOdbXXw5/giMvl4aDCg9cIEefaqhH/cW8ouM1TWNotbUVq+mbTufAP9NRRZe6qitR CsH1wHSqQpJ+Ke1V7/lF0WQB2qXn03qV/7qGpQSdtlbRBORlBYbEXtkEErwJE5eibWqhR5 UgYiq0R2I9SNY2WR1JDRQk9TNdWW5Q1nEFA5YMoLjmw7Bd/FEtdNdS+RJZMPRA== 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 4Sr62365Ggz1C0s; Wed, 13 Dec 2023 20:06:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BDK6Zqe087668; Wed, 13 Dec 2023 20:06:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BDK6Z2M087665; Wed, 13 Dec 2023 20:06:35 GMT (envelope-from git) Date: Wed, 13 Dec 2023 20:06:35 GMT Message-Id: <202312132006.3BDK6Z2M087665@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 817f2d83bd50 - stable/13 - tail: Fix heap overflow in -F case. 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 817f2d83bd50e88cb85e38e551fdaa5e79116b17 Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=817f2d83bd50e88cb85e38e551fdaa5e79116b17 commit 817f2d83bd50e88cb85e38e551fdaa5e79116b17 Author: Dag-Erling Smørgrav AuthorDate: 2023-11-29 21:48:50 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-12-13 16:39:38 +0000 tail: Fix heap overflow in -F case. The number of events we track can vary over time, but we only allocate enough space for the exact number of events we are tracking when we first begin, resulting in a trivially reproducable heap overflow. Fix this by allocating enough space for the greatest possible number of events (two per file) and clean up the code a bit. Also add a test case which triggers the aforementioned heap overflow, although we don't currently have a way to detect it. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: allanjude, markj Differential Revision: https://reviews.freebsd.org/D42839 (cherry picked from commit 621f45532c5887c96b708ce232c52878d0053325) tail: Clean up error messages. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D42842 (cherry picked from commit b70e57be2cfe83ec9f410e2f317ea38aaac61a98) --- usr.bin/tail/forward.c | 39 ++++++++++++++++++--------------------- usr.bin/tail/read.c | 8 ++++---- usr.bin/tail/reverse.c | 2 +- usr.bin/tail/tail.c | 6 +++--- usr.bin/tail/tests/tail_test.sh | 21 ++++++++++++++++++++- 5 files changed, 46 insertions(+), 30 deletions(-) diff --git a/usr.bin/tail/forward.c b/usr.bin/tail/forward.c index e2a3eb77aade..a0f66262608a 100644 --- a/usr.bin/tail/forward.c +++ b/usr.bin/tail/forward.c @@ -275,7 +275,7 @@ set_events(file_info_t *files) action = USE_KQUEUE; for (i = 0, file = files; i < no_files; i++, file++) { - if (! file->fp) + if (!file->fp) continue; if (fstatfs(fileno(file->fp), &sf) == 0 && @@ -307,27 +307,21 @@ set_events(file_info_t *files) void follow(file_info_t *files, enum STYLE style, off_t off) { - int active, ev_change, i, n = -1; + int active, ev_change, i, n; struct stat sb2; file_info_t *file; FILE *ftmp; struct timespec ts; /* Position each of the files */ - - file = files; active = 0; - n = 0; - for (i = 0; i < no_files; i++, file++) { - if (file->fp) { - active = 1; - n++; - if (vflag || (qflag == 0 && no_files > 1)) - printfn(file->file_name, 1); - forward(file->fp, file->file_name, style, off, &file->st); - if (Fflag && fileno(file->fp) != STDIN_FILENO) - n++; - } + for (i = 0, file = files; i < no_files; i++, file++) { + if (!file->fp) + continue; + active = 1; + if (vflag || (qflag == 0 && no_files > 1)) + printfn(file->file_name, 1); + forward(file->fp, file->file_name, style, off, &file->st); } if (!Fflag && !active) return; @@ -337,9 +331,14 @@ follow(file_info_t *files, enum STYLE style, off_t off) kq = kqueue(); if (kq < 0) err(1, "kqueue"); - ev = malloc(n * sizeof(struct kevent)); - if (! ev) - err(1, "Couldn't allocate memory for kevents."); + /* + * The number of kqueue events we track may vary over time and may + * even grow past its initial value in the -F case, but it will + * never exceed two per file, so just preallocate that. + */ + ev = malloc(no_files * 2 * sizeof(struct kevent)); + if (ev == NULL) + err(1, "failed to allocate memory for kevents"); set_events(files); for (;;) { @@ -413,9 +412,7 @@ follow(file_info_t *files, enum STYLE style, off_t off) */ do { n = kevent(kq, NULL, 0, ev, 1, Fflag ? &ts : NULL); - if (n < 0 && errno == EINTR) - continue; - if (n < 0) + if (n < 0 && errno != EINTR) err(1, "kevent"); } while (n < 0); if (n == 0) { diff --git a/usr.bin/tail/read.c b/usr.bin/tail/read.c index ff025b31d64c..67bc5750cd0b 100644 --- a/usr.bin/tail/read.c +++ b/usr.bin/tail/read.c @@ -72,7 +72,7 @@ bytes(FILE *fp, const char *fn, off_t off) char *sp; if ((sp = p = malloc(off)) == NULL) - err(1, "malloc"); + err(1, "failed to allocate memory"); for (wrap = 0, ep = p + off; (ch = getc(fp)) != EOF;) { *p = ch; @@ -146,7 +146,7 @@ lines(FILE *fp, const char *fn, off_t off) int blen, cnt, recno, wrap; if ((llines = calloc(off, sizeof(*llines))) == NULL) - err(1, "calloc"); + err(1, "failed to allocate memory"); p = sp = NULL; blen = cnt = recno = wrap = 0; rc = 0; @@ -154,7 +154,7 @@ lines(FILE *fp, const char *fn, off_t off) while ((ch = getc(fp)) != EOF) { if (++cnt > blen) { if ((sp = realloc(sp, blen += 1024)) == NULL) - err(1, "realloc"); + err(1, "failed to allocate memory"); p = sp + cnt - 1; } *p++ = ch; @@ -163,7 +163,7 @@ lines(FILE *fp, const char *fn, off_t off) llines[recno].blen = cnt + 256; if ((llines[recno].l = realloc(llines[recno].l, llines[recno].blen)) == NULL) - err(1, "realloc"); + err(1, "failed to allocate memory"); } bcopy(sp, llines[recno].l, llines[recno].len = cnt); cnt = 0; diff --git a/usr.bin/tail/reverse.c b/usr.bin/tail/reverse.c index 12231530e679..67d27d487d1c 100644 --- a/usr.bin/tail/reverse.c +++ b/usr.bin/tail/reverse.c @@ -212,7 +212,7 @@ r_buf(FILE *fp, const char *fn) while ((tl = malloc(sizeof(bfelem_t))) == NULL) { first = TAILQ_FIRST(&head); if (TAILQ_EMPTY(&head)) - err(1, "malloc"); + err(1, "failed to allocate memory"); enomem += first->len; TAILQ_REMOVE(&head, first, entries); free(first); diff --git a/usr.bin/tail/tail.c b/usr.bin/tail/tail.c index 492a6494628d..c206b11863a5 100644 --- a/usr.bin/tail/tail.c +++ b/usr.bin/tail/tail.c @@ -173,7 +173,7 @@ main(int argc, char *argv[]) cap_rights_set(&rights, CAP_EVENT); if (caph_rights_limit(STDIN_FILENO, &rights) < 0 || caph_limit_stderr() < 0 || caph_limit_stdout() < 0) - err(1, "can't limit stdio rights"); + err(1, "unable to limit stdio rights"); fa = fileargs_init(argc, argv, O_RDONLY, 0, &rights, FA_OPEN); if (fa == NULL) @@ -213,7 +213,7 @@ main(int argc, char *argv[]) if (*argv && fflag) { files = malloc(no_files * sizeof(struct file_info)); if (files == NULL) - err(1, "Couldn't malloc space for file descriptors."); + err(1, "failed to allocate memory for file descriptors"); for (filep = files; (fn = *argv++); filep++) { filep->file_name = fn; @@ -308,7 +308,7 @@ obsolete(char *argv[]) /* Malloc space for dash, new option and argument. */ len = strlen(*argv); if ((start = p = malloc(len + 3)) == NULL) - err(1, "malloc"); + err(1, "failed to allocate memory"); *p++ = '-'; /* diff --git a/usr.bin/tail/tests/tail_test.sh b/usr.bin/tail/tests/tail_test.sh index 8123a310fe67..9c941f8a2c2f 100755 --- a/usr.bin/tail/tests/tail_test.sh +++ b/usr.bin/tail/tests/tail_test.sh @@ -329,10 +329,28 @@ follow_stdin_body() atf_check kill $pid } +atf_test_case follow_create +follow_create_head() +{ + atf_set "descr" "Verify that -F works when a file is created" +} +follow_create_body() +{ + local pid + + rm -f infile + tail -F infile > outfile & + pid=$! + seq 1 5 >infile + sleep 2 + atf_check cmp infile outfile + atf_check kill $pid +} + atf_test_case follow_rename follow_rename_head() { - atf_set "descr" "Verify that -F works" + atf_set "descr" "Verify that -F works when a file is replaced" } follow_rename_body() { @@ -424,6 +442,7 @@ atf_init_test_cases() atf_add_test_case stdin atf_add_test_case follow atf_add_test_case follow_stdin + atf_add_test_case follow_create atf_add_test_case follow_rename atf_add_test_case silent_header atf_add_test_case verbose_header From nobody Wed Dec 13 20:07:00 2023 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 4Sr62X3SD2z54FMQ; Wed, 13 Dec 2023 20:07:00 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sr62X2bVzz4bdn; Wed, 13 Dec 2023 20:07:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702498020; 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=U+G9LBYFfnrN9PGBG3H03ilPIW/rsf/bqj3PfTX8KgA=; b=eJyFzJxKUzynUGGvOCdhkH3m7J6Ma2xakrM+bMVXc/GOB5jY3XmphhnfrvOggv6W+bPyOD bcnNUOjGP2EvrFz9qJzbiVMF0SJJkAGLBko50i6YPLDq+QdTR9s2ncQZK3S2kXzSvu6QGr x9JB5uPIcIBkfP0AYj7WTRnTmXK18lLlyJIfruWj0coqopDdPIKF9x5cigSHykbnME5voc TZvEQufEt1pxePpV44KgnnGWyX7hBXYS79srZIznBjB4Tvdv5SLW/V36wLVXqFR1jiWqYL TRNHKEjjt2381/b50jt6Ls/JqisbDQ0EYGJ/S6zD3WcAidt1c+LU7EOgRA+PiQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702498020; a=rsa-sha256; cv=none; b=bPQc/cjIYMUR4+VNJ+1GWKmt8/fu6JmYCAF0M6uDPQJqgmxT5++nLGpMjw8JUipEvRtP6k UzQ3CLsHpciWS44Rb75toPxipG0arlCKyJ5qCsflPYuDWrvf9I5pS3kxAscvfZwreHaAx1 pwbqzSGPU5yAs/NifJtoSHvBSs4YlB8wjlJflsgxBOY3zNdp0X5FkTSusrEzGr54u98q/j L4Oj/qdLxvS1yIi2QsS595bYlDXeNUcBPzR7Y7F1Q7iqdOPuEDjHQ67//TIyDcna9aprAj 1RNK7GoID2kJ9E0FRFdGqHvWErCbv096U0fTRkOPh+ZAuExi2ySdcoqTben0Vg== 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=1702498020; 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=U+G9LBYFfnrN9PGBG3H03ilPIW/rsf/bqj3PfTX8KgA=; b=gHEAO0v6U7wnDjXqn9kRWWVv2WJTiSj2q9JFxqmE2R2b5yjfGjQFi9DAfZBfOaSR02wpaT /6+CCNUpaHRxeTg/Ft42WeaStavu4vxrN5wvi+kwPU8LF83WbFTjRXP62t5IzAAWX+gPlm 9p3VpZjAxwoNbiLDakOztdwjW0oVcggbkrbxMd3lMNqZJrsNIcKU5EAUM0cWHL0EaMPtm9 j4iQxlTDgkCSmsIovzcVfqdVqdHFo6OFkBOzzrazcobo5Zr1LQgNDh4auntqVd6EwXL932 81TZHCm2aJTuJH8TaSj6VblxeJmiJXkzwrA62w7uIRHhFORf9MrheVLZ9UGqAg== 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 4Sr62X1K84z1C5T; Wed, 13 Dec 2023 20:07:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BDK70Ec087997; Wed, 13 Dec 2023 20:07:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BDK70Ii087994; Wed, 13 Dec 2023 20:07:00 GMT (envelope-from git) Date: Wed, 13 Dec 2023 20:07:00 GMT Message-Id: <202312132007.3BDK70Ii087994@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: fdbd1da14068 - stable/14 - growfs: make exit codes more consistent 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: fdbd1da14068b4c7751057030b26b2df345060e4 Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=fdbd1da14068b4c7751057030b26b2df345060e4 commit fdbd1da14068b4c7751057030b26b2df345060e4 Author: Mina Galić AuthorDate: 2023-10-05 18:24:53 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-12-13 16:23:57 +0000 growfs: make exit codes more consistent We have overused err(1), so it's hard to distinguish when an error is very, very serious, and when it's just a user-error, or even harmless. This patch changes the current behaviour to distinguish between the following three: 1 for usage errors 2 for recoverable errors 3 or higher for unrecoverable errors Reviewed by: jilles, pauamma_gundo.com, des Differential Revision: https://reviews.freebsd.org/D27161 (cherry picked from commit 70a0fb43f91cfe3d08db7cb443d9690f8bff065e) --- sbin/growfs/growfs.8 | 6 +++++- sbin/growfs/growfs.c | 42 +++++++++++++++++++++--------------------- 2 files changed, 26 insertions(+), 22 deletions(-) diff --git a/sbin/growfs/growfs.8 b/sbin/growfs/growfs.8 index f83c3c00cf1f..9a6076017c74 100644 --- a/sbin/growfs/growfs.8 +++ b/sbin/growfs/growfs.8 @@ -36,7 +36,7 @@ .\" .\" $TSHeader: src/sbin/growfs/growfs.8,v 1.3 2000/12/12 19:31:00 tomsoft Exp $ .\" -.Dd December 13, 2017 +.Dd October 3, 2023 .Dt GROWFS 8 .Os .Sh NAME @@ -88,6 +88,10 @@ This value defaults to the size of the raw partition specified in .Nm will enlarge the file system to the size of the entire partition). .El +.Sh EXIT STATUS +Exit status is 0 on success, and >= 1 on errors. +Errors recoverable by user action are indicated by 2. +OS errors, which are usually not recoverable, are indicated by 3 or greater. .Sh EXAMPLES Expand root file system to fill up available space: .Dl growfs / diff --git a/sbin/growfs/growfs.c b/sbin/growfs/growfs.c index fc314d19a4e3..a63002271af1 100644 --- a/sbin/growfs/growfs.c +++ b/sbin/growfs/growfs.c @@ -147,7 +147,7 @@ growfs(int fsi, int fso, unsigned int Nflag) */ fscs = (struct csum *)calloc((size_t)1, (size_t)sblock.fs_cssize); if (fscs == NULL) - errx(1, "calloc failed"); + errx(3, "calloc failed"); memcpy(fscs, osblock.fs_csp, osblock.fs_cssize); free(osblock.fs_csp); osblock.fs_csp = NULL; @@ -259,7 +259,7 @@ growfs(int fsi, int fso, unsigned int Nflag) * and all the alternates back to disk. */ if (!Nflag && sbput(fso, &sblock, sblock.fs_ncg) != 0) - errc(2, EIO, "could not write updated superblock"); + errc(3, EIO, "could not write updated superblock"); DBG_PRINT0("fscs written\n"); #ifdef FS_DEBUG @@ -1339,7 +1339,7 @@ main(int argc, char **argv) size <<= 30; size <<= 10; } else - errx(1, "unknown suffix on -s argument"); + errx(2, "unknown suffix on -s argument"); break; case 'v': /* for compatibility to newfs */ break; @@ -1364,23 +1364,23 @@ main(int argc, char **argv) statfsp = getmntpoint(*argv); device = getdev(*argv, statfsp); if (device == NULL) - errx(1, "cannot find special device for %s", *argv); + errx(2, "cannot find special device for %s", *argv); fsi = open(device, O_RDONLY); if (fsi < 0) - err(1, "%s", device); + err(3, "%s", device); /* * Try to guess the slice size if not specified. */ if (ioctl(fsi, DIOCGMEDIASIZE, &mediasize) == -1) - err(1,"DIOCGMEDIASIZE"); + err(3,"DIOCGMEDIASIZE"); /* * Check if that partition is suitable for growing a file system. */ if (mediasize < 1) - errx(1, "partition is unavailable"); + errx(2, "partition is unavailable"); /* * Read the current superblock, and take a backup. @@ -1388,16 +1388,16 @@ main(int argc, char **argv) if ((ret = sbget(fsi, &fs, UFS_STDSB, 0)) != 0) { switch (ret) { case ENOENT: - errx(1, "superblock not recognized"); + errx(2, "superblock not recognized"); default: - errc(1, ret, "unable to read superblock"); + errc(3, ret, "unable to read superblock"); } } /* * Check for filesystem that was unclean at mount time. */ if ((fs->fs_flags & (FS_UNCLEAN | FS_NEEDSFSCK)) != 0) - errx(1, "%s is not clean - run fsck.\n", *argv); + errx(2, "%s is not clean - run fsck.\n", *argv); memcpy(&osblock, fs, fs->fs_sbsize); free(fs); memcpy((void *)&fsun1, (void *)&fsun2, osblock.fs_sbsize); @@ -1418,7 +1418,7 @@ main(int argc, char **argv) mediasize, "B", HN_AUTOSCALE, HN_B | HN_NOSPACE | HN_DECIMAL); - errx(1, "requested size %s is larger " + errx(2, "requested size %s is larger " "than the available %s", oldsizebuf, newsizebuf); } } @@ -1439,7 +1439,7 @@ main(int argc, char **argv) if (size == (uint64_t)(osblock.fs_size * osblock.fs_fsize)) errx(0, "requested size %s is equal to the current " "filesystem size %s", newsizebuf, oldsizebuf); - errx(1, "requested size %s is smaller than the current " + errx(2, "requested size %s is smaller than the current " "filesystem size %s", newsizebuf, oldsizebuf); } @@ -1451,7 +1451,7 @@ main(int argc, char **argv) * Are we really growing? */ if (osblock.fs_size >= sblock.fs_size) { - errx(1, "we are not growing (%jd->%jd)", + errx(3, "we are not growing (%jd->%jd)", (intmax_t)osblock.fs_size, (intmax_t)sblock.fs_size); } @@ -1461,7 +1461,7 @@ main(int argc, char **argv) if (yflag == 0) { for (j = 0; j < FSMAXSNAP; j++) { if (sblock.fs_snapinum[j]) { - errx(1, "active snapshot found in file system; " + errx(2, "active snapshot found in file system; " "please remove all snapshots before " "using growfs"); } @@ -1506,14 +1506,14 @@ main(int argc, char **argv) if (statfsp != NULL && (statfsp->f_flags & MNT_RDONLY) == 0) { fso = open(_PATH_UFSSUSPEND, O_RDWR); if (fso == -1) - err(1, "unable to open %s", _PATH_UFSSUSPEND); + err(3, "unable to open %s", _PATH_UFSSUSPEND); error = ioctl(fso, UFSSUSPEND, &statfsp->f_fsid); if (error != 0) - err(1, "UFSSUSPEND"); + err(3, "UFSSUSPEND"); } else { fso = open(device, O_WRONLY); if (fso < 0) - err(1, "%s", device); + err(3, "%s", device); } } @@ -1522,7 +1522,7 @@ main(int argc, char **argv) */ testbuf = malloc(sblock.fs_fsize); if (testbuf == NULL) - err(1, "malloc"); + err(3, "malloc"); rdfs((ufs2_daddr_t)((size - sblock.fs_fsize) / DEV_BSIZE), sblock.fs_fsize, testbuf, fsi); wtfs((ufs2_daddr_t)((size - sblock.fs_fsize) / DEV_BSIZE), @@ -1577,7 +1577,7 @@ main(int argc, char **argv) fragroundup(&sblock, sblock.fs_ncg * sizeof(struct csum)); if (osblock.fs_size >= sblock.fs_size) - errx(1, "not enough new space"); + errx(3, "not enough new space"); DBG_PRINT0("sblock calculated\n"); @@ -1591,11 +1591,11 @@ main(int argc, char **argv) if (statfsp != NULL && (statfsp->f_flags & MNT_RDONLY) == 0) { error = ioctl(fso, UFSRESUME); if (error != 0) - err(1, "UFSRESUME"); + err(3, "UFSRESUME"); } error = close(fso); if (error != 0) - err(1, "close"); + err(3, "close"); if (statfsp != NULL && (statfsp->f_flags & MNT_RDONLY) != 0 && chkdoreload(statfsp, warn) != 0) exit(9); From nobody Wed Dec 13 20:07:01 2023 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 4Sr62Y445Jz54FS7; Wed, 13 Dec 2023 20:07:01 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sr62Y3BQtz4bhG; Wed, 13 Dec 2023 20:07:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702498021; 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=Aj6YArpLYb+5COf/N7bZ14Gw8/OOSo882vVTRDq7uQc=; b=eofxFEpGFy/yRGxqbYcppFaRMbE2x8q4cQ3ptAaNgd+WGClcT8A9w8iHWr6WvEfM6Fj58V fzXd59izPNw5iIFxCo9Vp+YP+jM2zhEhc0F7SgW8+TW8oNshrK7gfYvUH5jzCH1bLI81Ba bZ9mC26Kf8GJ4XxyCUcBjhWqb+zCavy9Ao66Og9VJGHJv94SVANgpKJgP6s5cb9NF3EQcE UTzeYHMiSeq4Y3qr4QpcDmlAagNcePvHY3EoaGnQeqX3/+4lg9Qyg5DyNo16H1QoFQ0XeV rzD5pnvN8UzEVSup0bwCpytmi7dzbGQZmVge5GSyMQcC/RfhsP0txM1unXcO7A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702498021; a=rsa-sha256; cv=none; b=Wa34cNs4O0H9Y7sCBMkhePKZVacr7IT9jbb+wrBxf2OZP/MW5E/OMmHu4aK8UufPVURlth hyeE3Ybzh7mA0t92neZ6fYxHLHDrvea+IiDnx0bD3srZxQPPoca7G/tiR+uSPpCkYuNB6n unnigule0LATiuiWkQB6RjP73etEaKguiZWijX1Ziv0doPvENeM9O31nrN0XLLYW50dmIk Z1JYZlGTpxBDeKwTHiE5tYyPLJysLQCh/6kas1WfLZ6zxEd5YgJfZc9TvuAv/u4n2HNyXS N0aWWYvWTKFsIb+yRcZclJPYEWW81Zl0DpHYihLYd6TYElOIiGEKSk9kfKYaXA== 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=1702498021; 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=Aj6YArpLYb+5COf/N7bZ14Gw8/OOSo882vVTRDq7uQc=; b=Si4EztaKIN5GmSReaMathu7Mp2aG6LqnN9k/ztx607OVplWJjKMQvN8jUwaL25QyOSuFA+ EV7WN+8Uy2JZALOJ9OIsGoHIug8+eFfBQ+3G+70Sl7KL1HD93EA7dgocZ19FElEo2S5r/3 iWHoOhWn0ZUjYcS5aPhoT9mg3RqgY7FqUTsZfeNtFIu9p51COXLLSs+082OnEAwlIJdYom XR8v0b3cZXbt9PwolMUCsf/lIYlbTxNDu4V30mzzmP2YfhGysGk060Im0lbG5+ahO8+1s8 UCQsxEQDxMgTRFEcT7MPsviWjRlwSia9DM6ac+0lvDQXIt6A9p28Y1i3hISPkQ== 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 4Sr62Y26yqz1C3J; Wed, 13 Dec 2023 20:07:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BDK71Zh088042; Wed, 13 Dec 2023 20:07:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BDK716e088039; Wed, 13 Dec 2023 20:07:01 GMT (envelope-from git) Date: Wed, 13 Dec 2023 20:07:01 GMT Message-Id: <202312132007.3BDK716e088039@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: c7a0acd832d9 - stable/14 - daemon: Disable stdio buffering. 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c7a0acd832d98b889aca95d336b19410b0517178 Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=c7a0acd832d98b889aca95d336b19410b0517178 commit c7a0acd832d98b889aca95d336b19410b0517178 Author: Dag-Erling Smørgrav AuthorDate: 2023-10-06 16:44:52 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-12-13 16:23:57 +0000 daemon: Disable stdio buffering. The daemon utility already does its own buffering and retransmits its child's output line by line. There's no need for stdio to add its own buffering on top of this. MFC after: 1 week Sponsored by: Modirum MDPay Reviewed by: allanjude Differential Revision: https://reviews.freebsd.org/D42111 (cherry picked from commit cec8e6ba64ccab7fb0d9fa531ebad9228233334d) --- usr.sbin/daemon/daemon.c | 1 + 1 file changed, 1 insertion(+) diff --git a/usr.sbin/daemon/daemon.c b/usr.sbin/daemon/daemon.c index dfbb609ce10d..65e6bb7ca190 100644 --- a/usr.sbin/daemon/daemon.c +++ b/usr.sbin/daemon/daemon.c @@ -420,6 +420,7 @@ daemon_eventloop(struct daemon_state *state) close(state->pipe_fd[1]); state->pipe_fd[1] = -1; setproctitle("%s[%d]", state->title, (int)state->pid); + setbuf(stdout, NULL); while (state->mode != MODE_NOCHILD) { ret = kevent(kq, NULL, 0, &event, 1, NULL); From nobody Wed Dec 13 20:07:02 2023 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 4Sr62Z588qz54FMX; Wed, 13 Dec 2023 20:07:02 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sr62Z3sMGz4bhn; Wed, 13 Dec 2023 20:07:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702498022; 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=cQVAj9QYL1+nx0fI5hb0ypQuhHq7tZHG9r54xiz+sdI=; b=sdJ4843UxH6l45C4evssc5YQfEf4XsB6lqSKpIMDmZZ6L4YLY8uTCLVcSedv9Ugo2Udnij 3o7sjs2KZUocOuRWqcEAyd89q1h3xHRmrUOUeG04M7RJ8fuR7AyQL96iOlnCtXowBBd5n1 Qa2dCAMty3CVB8716icwrnLpaydrUL2LtwFyrOVDq7KU6jSCnq/P206WjUVOwFvjOZC0W3 qmVb/gUDfhoZuB02jvS4NLBmjJO5uWxh8fvbVF2cS+hJXZaJ0Trl6afRziLZv7OOwbwBJS yyapW7RoPlPJakLou1D9zKZjiEDhC2riGOJCk8mYp0dnyD2X4Bx10iA0YTaJ8w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702498022; a=rsa-sha256; cv=none; b=AXM92K8utj88QWqw2ZzY2FJH4u5bVBx+BaELHXCmg8+c6RW5ReCDMvr3eweSt8c9fydCbr JzADbcxWg4OOCftbvQmWjqte8pZUpZW9y6ljMQWhXz+QRpDik1DtEOCzViBxviAqRk0nj1 1O1GrJGJGb9r/xbbbmR3txprOZYbVtwtQtsZHxhfwy+cdvdgXpRAUB0oxHM94Qo9igrptL jUJm0AhHOZZXCyTONNfT0rbv6IN+9lSUphJymYOloV72G24ryjcTZZ+QQ0Kl3ziGqENIad mafS4bOWr3Q1PR1L5ml522oEAuz4mOK9c5Yd/9IRbqFGnUJ/cEMo+8VN6iJBmw== 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=1702498022; 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=cQVAj9QYL1+nx0fI5hb0ypQuhHq7tZHG9r54xiz+sdI=; b=VmHFA+UXoR7QBOWVoTrL3NSv0z5XHTcrh4eiKdnxMzhwo/f7MT4xdLVyDf0JWANmtoqfJx aA8jqdl8w2cpkGjApV7lXkqEyLEdY1H/N74oPk2CJE2zso7wBGZEqrkhGx3da0eTqC+Lw2 3jIXZzHGG9ikudmLtQ41QHIWD3mRLY2SjzxUEwo54QZujddZS7mQbCJ8RfrP5D5ZD6sp/n MSMs99K2ijN7r/bzcr6GeYmE4eGui/+AmkHnTIb66Hd9Xi4RuuBuPaPSKJGnFnbaL3iaRg Qo2VlYhDAVxCE2vuh/k+0QlrdzXYRWtSPwHhENEJ1P95pTP0UDpIYqz3chM0lg== 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 4Sr62Z2y0Rz1C3K; Wed, 13 Dec 2023 20:07:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BDK72Ah088101; Wed, 13 Dec 2023 20:07:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BDK72Fw088099; Wed, 13 Dec 2023 20:07:02 GMT (envelope-from git) Date: Wed, 13 Dec 2023 20:07:02 GMT Message-Id: <202312132007.3BDK72Fw088099@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 6d0ea82cc252 - stable/14 - libfetch, fetch: Stop recommending the use of ca_root_nss. 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 6d0ea82cc2520726e49d9f03e1b67734608139e7 Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=6d0ea82cc2520726e49d9f03e1b67734608139e7 commit 6d0ea82cc2520726e49d9f03e1b67734608139e7 Author: Dag-Erling Smørgrav AuthorDate: 2023-10-08 04:35:15 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-12-13 16:23:57 +0000 libfetch, fetch: Stop recommending the use of ca_root_nss. MFC after: 3 days Reviewed by: kevans, emaste Differential Revision: https://reviews.freebsd.org/D42119 (cherry picked from commit 2821a7498f65d357c68166e1978b491abef1ca4a) --- lib/libfetch/fetch.3 | 15 +-------------- usr.bin/fetch/fetch.1 | 14 ++------------ 2 files changed, 3 insertions(+), 26 deletions(-) diff --git a/lib/libfetch/fetch.3 b/lib/libfetch/fetch.3 index 9082f338f7c1..5f7489799cf6 100644 --- a/lib/libfetch/fetch.3 +++ b/lib/libfetch/fetch.3 @@ -24,7 +24,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd November 24, 2020 +.Dd October 7, 2023 .Dt FETCH 3 .Os .Sh NAME @@ -409,19 +409,6 @@ library, is currently unimplemented. .Sh HTTPS SCHEME Based on HTTP SCHEME. -By default the peer is verified using the CA bundle located in -.Pa /usr/local/etc/ssl/cert.pem . -If this file does not exist, -.Pa /etc/ssl/cert.pem -is used instead. -If neither file exists, and -.Ev SSL_CA_CERT_PATH -has not been set, -OpenSSL's default CA cert and path settings apply. -The certificate bundle can contain multiple CA certificates. -A common source of a current CA bundle is -.Pa \%security/ca_root_nss . -.Pp The CA bundle used for peer verification can be changed by setting the environment variables .Ev SSL_CA_CERT_FILE diff --git a/usr.bin/fetch/fetch.1 b/usr.bin/fetch/fetch.1 index 2737373c98bf..7238226998fc 100644 --- a/usr.bin/fetch/fetch.1 +++ b/usr.bin/fetch/fetch.1 @@ -28,7 +28,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 October 29, 2020 +.Dd October 7, 2023 .Dt FETCH 1 .Os .Sh NAME @@ -131,18 +131,8 @@ only. .It Fl -ca-cert= Ns Ar file [SSL] Path to certificate bundle containing trusted CA certificates. -If not specified, -.Pa /usr/local/etc/ssl/cert.pem -is used. -If this file does not exist, -.Pa /etc/ssl/cert.pem -is used instead. -If neither file exists and no CA path has been configured, +Otherwise, OpenSSL's default CA cert and path settings apply. -The certificate bundle can contain multiple CA certificates. -The -.Pa security/ca_root_nss -port is a common source of a current CA bundle. .It Fl -ca-path= Ns Ar dir [SSL] The directory From nobody Wed Dec 13 20:07:03 2023 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 4Sr62c00hDz54FsT; Wed, 13 Dec 2023 20:07:04 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sr62b56H2z4bqg; Wed, 13 Dec 2023 20:07:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702498023; 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=luEdy6gw6s2EOPwW9YVMYzcxF1XJn5gAciqZLgepmHU=; b=EH4L4aV1VtmQqk4q4aoJxW67fE+w4vnaBrceir67YeR55qMw+VqJG+ECkRtSIEt/8iGx+t IdkUfYuSbHyJ6cqh+kLDoRexyL3EcEPbVr0k1Mf1w7t5vBu8jiKYrg3U2q/i+/3R6NsVDV 4hHU49WKBdk7H1OJpBKvS8RM4PJqxNXQIRhyadsZnBV9d5D9XZkddfmz9hYnRALh7IEQab V5kcRMu+DNlgKZmjXehLELRb2GDyBUPNZVcFpT6aI61Aia9BrdnvjRw2Kkte1HSeqcsTYl psvlLBbK6FP8F1970/dlEBPfHs/unlrf74v5bGYGQRZyxXVUH3K3/WTdcupixA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702498023; a=rsa-sha256; cv=none; b=Na5E4h3vSUiMT5YR2sKl3IGcZwrsHSCtkeOlUeF5nPR4DL5JlUX2sm8Rf+PaaX+DqqtPUM wnFSSzZG3Lilaixy2quge7IBFez/Yso7hyawMXHE3soDotxUsDAnXtca7N0ZqYKoi9jJYp riaD8K6JMu5PUDLJaPOzk5elnkr18pbHcNwM9hwPrsVRDoPfKA4NANAIwpQFtZB7x+tWaH IImH/NnXN+tY1Oj3BFD1BFhozY30/nmOwzWuCmeoN+eNQdzOhd0h3dvJQ2lg7gyxvhJRiE ZXHjCY+sWTbXwk1eHcurfcGrnt8IOrha+OCnWeIZOhjh7d54j5WKeUU9f52rrQ== 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=1702498023; 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=luEdy6gw6s2EOPwW9YVMYzcxF1XJn5gAciqZLgepmHU=; b=bj5IpjZGogR6kYmRk6o5/6E372KMvYAtXTIEn4ZDKRTcvd0L5lYYO+zGknP6zKdLj+dwuT i15ZOtyUbg2/yhrwvuI6LrxbSLGkjS+r5VfVlmAaQzRBFkun8fZei6XJVEJFwbY/GpoE6K LmHPC8J//YHA2skKUirdg+MfC2sTh42fv6ZfsalStFdMHVDFHWvWyNMZu+05mLugG3zDIZ FYH7W5EIigdSRL5mCiQjHDaEm38rcyzLlKllrm650LpA47DRqVTmR/RP5Sw2kOwbcjpqm0 KyqhHCQYWoNmTPwusedUcM+85zvZ0Is703U0R2Z0/JQqMW/1ZsARc1nMxRSHaQ== 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 4Sr62b48xYz1C3L; Wed, 13 Dec 2023 20:07:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BDK73Cg088144; Wed, 13 Dec 2023 20:07:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BDK739o088141; Wed, 13 Dec 2023 20:07:03 GMT (envelope-from git) Date: Wed, 13 Dec 2023 20:07:03 GMT Message-Id: <202312132007.3BDK739o088141@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 8b55607a7fa3 - stable/14 - ping: Simplify protocol selection. 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8b55607a7fa31c359d12f1e7252b5e5b1130faa8 Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=8b55607a7fa31c359d12f1e7252b5e5b1130faa8 commit 8b55607a7fa31c359d12f1e7252b5e5b1130faa8 Author: Dag-Erling Smørgrav AuthorDate: 2023-10-10 22:47:46 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-12-13 16:41:46 +0000 ping: Simplify protocol selection. * Interrupt the option loop as soon as we have an indication of which protocol is intended. * If we end up having to perform a DNS lookup, loop over the entire result looking for either IPv4 or IPv6 addresses. Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. Reviewed by: rscheff, kevans, allanjude Differential Revision: https://reviews.freebsd.org/D42137 (cherry picked from commit 7fd2c91a291bd518e012b438d6ca6fdd04d39dbf) ping: Consistently use EX_NOHOST for DNS failures. Traditionally, ping returned exit code EX_NOHOST if a DNS lookup failed. That is still the case for the legacy code in the new merged ping, but not for IPv6 targets, nor when a DNS lookup is performed in order to determine which version of the tool to invoke. While here, also make sure that the error message is consistent. Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D42159 (cherry picked from commit c4ffb80ef18f6b581dc28c14bc579e0e7c73438c) ping: Add missing ATF boilerplate. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D42161 (cherry picked from commit fc7143b48341fb16ef5b2262c7cd5b5c47056112) --- sbin/ping/main.c | 129 ++++++++++++++++++++----------------------- sbin/ping/ping6.c | 5 +- sbin/ping/tests/ping_test.sh | 67 ++++++++++++++++++++-- 3 files changed, 124 insertions(+), 77 deletions(-) diff --git a/sbin/ping/main.c b/sbin/ping/main.c index 5b710b09e985..65896a5dba7b 100644 --- a/sbin/ping/main.c +++ b/sbin/ping/main.c @@ -41,6 +41,7 @@ #include #include #include +#include #include #include "main.h" @@ -86,112 +87,102 @@ double tsumsq = 0.0; /* sum of all times squared, for std. dev. */ int main(int argc, char *argv[]) { -#if defined(INET) && defined(INET6) +#if defined(INET) struct in_addr a; - struct in6_addr a6; #endif -#if defined(INET) || defined(INET6) - struct addrinfo hints; +#if defined(INET6) + struct in6_addr a6; #endif - int ch; -#ifdef INET - bool ipv4 = false; +#if defined(INET) && defined(INET6) + struct addrinfo hints, *res, *ai; + const char *target; + int error; #endif -#ifdef INET6 - bool ipv6 = false; + int opt; +#ifdef INET6 if (strcmp(getprogname(), "ping6") == 0) - ipv6 = true; + return ping6(argc, argv); #endif - while ((ch = getopt(argc, argv, ":" OPTSTR)) != -1) { - switch(ch) { + while ((opt = getopt(argc, argv, ":" OPTSTR)) != -1) { + switch (opt) { #ifdef INET case '4': - ipv4 = true; - break; + goto ping4; #endif #ifdef INET6 case '6': - ipv6 = true; - break; + goto ping6; #endif -#if defined(INET) && defined(INET6) case 'S': /* * If -S is given with a numeric parameter, * force use of the corresponding version. */ +#ifdef INET if (inet_pton(AF_INET, optarg, &a) == 1) - ipv4 = true; - else if (inet_pton(AF_INET6, optarg, &a6) == 1) - ipv6 = true; - break; + goto ping4; +#endif +#ifdef INET6 + if (inet_pton(AF_INET6, optarg, &a6) == 1) + goto ping6; #endif + break; default: break; } } + /* + * For IPv4, only one positional argument, the target, is allowed. + * For IPv6, multiple positional argument are allowed; the last + * one is the target, and preceding ones are intermediate hops. + * This nuance is lost here, but the only case where it matters is + * an error. + */ if (optind >= argc) usage(); - optreset = 1; - optind = 1; #if defined(INET) && defined(INET6) - if (ipv4 && ipv6) - errx(1, "-4 and -6 cannot be used simultaneously"); -#endif - -#if defined(INET) && defined(INET6) - if (inet_pton(AF_INET, argv[argc - 1], &a) == 1) { - if (ipv6) - errx(1, "IPv6 requested but IPv4 target address " - "provided"); + target = argv[argc - 1]; + memset(&hints, 0, sizeof(hints)); + hints.ai_socktype = SOCK_RAW; + if (feature_present("inet") && !feature_present("inet6")) hints.ai_family = AF_INET; - } - else if (inet_pton(AF_INET6, argv[argc - 1], &a6) == 1) { - if (ipv4) - errx(1, "IPv4 requested but IPv6 target address " - "provided"); + if (feature_present("inet6") && !feature_present("inet")) hints.ai_family = AF_INET6; - } else if (ipv6) - hints.ai_family = AF_INET6; - else if (ipv4) - hints.ai_family = AF_INET; - else { - if (!feature_present("inet6")) - hints.ai_family = AF_INET; - else if (!feature_present("inet")) - hints.ai_family = AF_INET6; - else { - struct addrinfo *res; - - memset(&hints, 0, sizeof(hints)); - hints.ai_socktype = SOCK_RAW; - hints.ai_family = AF_UNSPEC; - getaddrinfo(argv[argc - 1], NULL, &hints, &res); - if (res != NULL) { - hints.ai_family = res[0].ai_family; - freeaddrinfo(res); - } + else + hints.ai_family = AF_UNSPEC; + error = getaddrinfo(target, NULL, &hints, &res); + if (res == NULL) + errx(EX_NOHOST, "cannot resolve %s: %s", + target, gai_strerror(error)); + for (ai = res; ai != NULL; ai = ai->ai_next) { + if (ai->ai_family == AF_INET) { + freeaddrinfo(res); + goto ping4; + } + if (ai->ai_family == AF_INET6) { + freeaddrinfo(res); + goto ping6; } } -#elif defined(INET) - hints.ai_family = AF_INET; -#elif defined(INET6) - hints.ai_family = AF_INET6; + freeaddrinfo(res); + errx(EX_NOHOST, "cannot resolve %s", target); #endif - #ifdef INET - if (hints.ai_family == AF_INET) - return ping(argc, argv); -#endif /* INET */ +ping4: + optreset = 1; + optind = 1; + return ping(argc, argv); +#endif #ifdef INET6 - if (hints.ai_family == AF_INET6) - return ping6(argc, argv); -#endif /* INET6 */ - errx(1, "Unknown host"); +ping6: + optreset = 1; + optind = 1; + return ping6(argc, argv); +#endif } /* diff --git a/sbin/ping/ping6.c b/sbin/ping/ping6.c index a71ef8a84aee..10deb57ad6bc 100644 --- a/sbin/ping/ping6.c +++ b/sbin/ping/ping6.c @@ -654,14 +654,15 @@ ping6(int argc, char *argv[]) error = cap_getaddrinfo(capdns, target, NULL, &hints, &res); if (error) - errx(1, "%s", gai_strerror(error)); + errx(EX_NOHOST, "cannot resolve %s: %s", + target, gai_strerror(error)); if (res->ai_canonname) hostname = strdup(res->ai_canonname); else hostname = target; if (!res->ai_addr) - errx(1, "cap_getaddrinfo failed"); + errx(EX_NOHOST, "cannot resolve %s", target); (void)memcpy(&dst, res->ai_addr, res->ai_addrlen); diff --git a/sbin/ping/tests/ping_test.sh b/sbin/ping/tests/ping_test.sh index 4a2dda0ebcce..5a12ace104d7 100644 --- a/sbin/ping/tests/ping_test.sh +++ b/sbin/ping/tests/ping_test.sh @@ -106,6 +106,7 @@ ping6_c1_s8_t1_body() check_ping_statistics std.out $(atf_get_srcdir)/ping_6_c1_s8_t1.out } +atf_test_case ping_c1t6 ping_c1t6_head() { atf_set "descr" "-t6 is not interpreted as -t -6 by ping" @@ -116,6 +117,7 @@ ping_c1t6_body() atf_check -s exit:0 -o ignore -e empty ping -c1 -t6 127.0.0.1 } +atf_test_case ping_c1t4 ping6_c1t4_head() { atf_set "descr" "-t4 is not interpreted as -t -4 by ping6" @@ -126,6 +128,7 @@ ping6_c1t4_body() atf_check -s exit:0 -o ignore -e empty ping6 -c1 -t4 ::1 } +atf_test_case ping_46 ping_46_head() { atf_set "descr" "-4 and -6 cannot be used simultaneously" @@ -135,21 +138,69 @@ ping_46_body() require_ipv4 require_ipv6 atf_check -s exit:1 \ - -e match:"-4 and -6 cannot be used simultaneously" \ + -e match:"illegal option -- 6" \ ping -4 -6 localhost } -ping6_46_head() +atf_test_case ping_64 +ping_64_head() { atf_set "descr" "-4 and -6 cannot be used simultaneously" } -ping6_46_body() +ping_64_body() { require_ipv4 require_ipv6 atf_check -s exit:1 \ - -e match:"-4 and -6 cannot be used simultaneously" \ - ping6 -4 -6 localhost + -e match:"illegal option -- 4" \ + ping -6 -4 localhost +} + +atf_test_case ping6_4 +ping6_4_head() +{ + atf_set "descr" "ping6 does not accept -4" +} +ping6_4_body() +{ + require_ipv4 + require_ipv6 + atf_check -s exit:1 \ + -e match:"illegal option -- 4" \ + ping6 -4 localhost +} + +atf_test_case ping_nohost +ping_nohost_head() +{ + atf_set "descr" "ping a nonexistent host" +} +ping_nohost_body() +{ + atf_check -s exit:68 -e match:"cannot resolve" \ + ping nonexistent.in-addr.arpa. +} + +atf_test_case ping4_nohost +ping4_nohost_head() +{ + atf_set "descr" "ping -4 a nonexistent host" +} +ping4_nohost_body() +{ + atf_check -s exit:68 -e match:"cannot resolve" \ + ping -4 nonexistent.in-addr.arpa. +} + +atf_test_case ping6_nohost +ping6_nohost_head() +{ + atf_set "descr" "ping -6 a nonexistent host" +} +ping6_nohost_body() +{ + atf_check -s exit:68 -e match:"cannot resolve" \ + ping -6 nonexistent.in-addr.arpa. } atf_test_case "inject_opts" "cleanup" @@ -212,7 +263,11 @@ atf_init_test_cases() atf_add_test_case ping_c1t6 atf_add_test_case ping6_c1t4 atf_add_test_case ping_46 - atf_add_test_case ping6_46 + atf_add_test_case ping_64 + atf_add_test_case ping6_4 + atf_add_test_case ping_nohost + atf_add_test_case ping4_nohost + atf_add_test_case ping6_nohost atf_add_test_case inject_opts atf_add_test_case inject_pip atf_add_test_case inject_reply From nobody Wed Dec 13 20:07:04 2023 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 4Sr62d0ncfz54FsV; Wed, 13 Dec 2023 20:07:05 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sr62c5nNbz4bqt; Wed, 13 Dec 2023 20:07:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702498024; 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=JsZdCTdzBiIAZ8fRWuNMgaB4jvx2TXcmCWjE2exkCoc=; b=kF87UnuHbMXfQSH6VGOdLJQnKg06Fb9/1tkWGZUtEt91xlPk5gQuGAhZlgx56NfHphDV67 HWLG46Yi/o9X7eb+uKy7FRKjgNczaLFrPCo3K/GAD3yxKaeAVJVhZB4JBgcqe1cfaq0ORI /gerAlRhhUQtoP8PIgprMDHYnj33pZOow9roEtEHDBmaWR2skZGxY5HZRbBCbbfgnqtdVR fBhFme9j8qK3ftZQJYYa3vn1Xcb1Nw65q1NrqqOOUteU2GL95i+RlnzB/uHTrJuCFeybKg 08pqFYj288qrf90FYqzdbQBJKF5a/GBnov7acD0GKg3v0iHmU9GM67tJGKOf7w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702498024; a=rsa-sha256; cv=none; b=i2F1d6sdLiT8ziCRbdsyrhv+VjIb5VVQArPA8KneuN7kXZdXgJHEoGxXWcCtyhzxOCixGg HehlzNuy6OHBlJTIt3xDtbmKRvo8g3lrP/UAMzZ1fm7aLRtO/XdtPuAYOr/85Mkk1XH5Ji Yya0OTl8KKIlxi/kCkMIZGJb6z3oId+R0mG9FVvoPSZ6Y3qjK7U9J/hmMPXgEPp/gftOom V3Isjf/VmaMlvAP6abKEszTCyUKSDo16jsf2xGXlbWwpJ7ovNcrbPwSBjf/Us1s2Zmhx/t 7U7q3eOswP94Wbi/5GkG/R/ujMCoR4zJHJKw0gepOgsh23ZvmBJuXrDCbO0++w== 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=1702498024; 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=JsZdCTdzBiIAZ8fRWuNMgaB4jvx2TXcmCWjE2exkCoc=; b=x44jbcDni4DN/pCpztvENK4xq8j9KkyLmo4sWh7eEt5nhNeFHDd1Yb05HBtvG2AhetW80H nm49ucUZotQJL/2F99hcGf7qJrJp2e4lBpxDAgMxwiZsiioH47Zgz8VIJ/oCz3aNLR9f6A MBaw+TfJfZIVSWtZ6oWqXjllWGNW6FyafzA7gIVxX74KwYGKGpx3NbHYwDTZL34ZrPycdO dZFanWCl8Stwc+4OGuDmQW98DZ91ytQKIweQ82xu8QwMNYDi7FcTcjj1h0AtEJY+Pv5GHR 1ai8kFTUHsjPSEdgWCvk+nz6Wsp9IZTY3rZOxV3HWAA/u7KzSnxHn3RPSwYr7g== 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 4Sr62c4vHzz1Bxg; Wed, 13 Dec 2023 20:07:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BDK747u088180; Wed, 13 Dec 2023 20:07:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BDK747m088177; Wed, 13 Dec 2023 20:07:04 GMT (envelope-from git) Date: Wed, 13 Dec 2023 20:07:04 GMT Message-Id: <202312132007.3BDK747m088177@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 6a2dd26311e3 - stable/14 - hesiod: Modernize. 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 6a2dd26311e3dc6bd33d7981f8ea6d08cfd5f88b Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=6a2dd26311e3dc6bd33d7981f8ea6d08cfd5f88b commit 6a2dd26311e3dc6bd33d7981f8ea6d08cfd5f88b Author: Dag-Erling Smørgrav AuthorDate: 2023-10-18 14:05:37 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-12-13 16:41:48 +0000 hesiod: Modernize. Reviewed by: zlei Differential Revision: https://reviews.freebsd.org/D42190 (cherry picked from commit 64fc8a936c868345a8f687fe2797474c5fcf35cb) --- lib/libc/net/hesiod.c | 42 +++++++++++++----------------------------- 1 file changed, 13 insertions(+), 29 deletions(-) diff --git a/lib/libc/net/hesiod.c b/lib/libc/net/hesiod.c index 879f7ecf765e..edced0707fe0 100644 --- a/lib/libc/net/hesiod.c +++ b/lib/libc/net/hesiod.c @@ -79,8 +79,7 @@ static void translate_errors(void); * initialize a hesiod_p. */ int -hesiod_init(context) - void **context; +hesiod_init(void **context) { struct hesiod_p *ctx; const char *p, *configname; @@ -128,8 +127,7 @@ hesiod_init(context) * Deallocates the hesiod_p. */ void -hesiod_end(context) - void *context; +hesiod_end(void *context) { struct hesiod_p *ctx = (struct hesiod_p *) context; @@ -219,10 +217,7 @@ hesiod_to_bind(void *context, const char *name, const char *type) * by the resolver. */ char ** -hesiod_resolve(context, name, type) - void *context; - const char *name; - const char *type; +hesiod_resolve(void *context, const char *name, const char *type) { struct hesiod_p *ctx = (struct hesiod_p *) context; char *bindname, **retvec; @@ -241,9 +236,7 @@ hesiod_resolve(context, name, type) /*ARGSUSED*/ void -hesiod_free_list(context, list) - void *context; - char **list; +hesiod_free_list(void *context, char **list) { char **p; @@ -261,9 +254,7 @@ hesiod_free_list(context, list) * or ctx->rhs which need to be freed by the caller. */ static int -read_config_file(ctx, filename) - struct hesiod_p *ctx; - const char *filename; +read_config_file(struct hesiod_p *ctx, const char *filename) { char *key, *data, *p, **which; char buf[MAXDNAME + 7]; @@ -355,9 +346,7 @@ read_config_file(ctx, filename) * return a list of them. */ static char ** -get_txt_records(qclass, name) - int qclass; - const char *name; +get_txt_records(int qclass, const char *name) { HEADER *hp; unsigned char qbuf[PACKETSZ], abuf[MAX_HESRESP], *p, *eom, *eor; @@ -481,16 +470,14 @@ static void *context; static int errval = HES_ER_UNINIT; int -hes_init() +hes_init(void) { init_context(); return errval; } char * -hes_to_bind(name, type) - const char *name; - const char *type; +hes_to_bind(const char *name, const char *type) { static char *bindname; if (init_context() < 0) @@ -504,9 +491,7 @@ hes_to_bind(name, type) } char ** -hes_resolve(name, type) - const char *name; - const char *type; +hes_resolve(const char *name, const char *type) { static char **list; @@ -527,20 +512,19 @@ hes_resolve(name, type) } int -hes_error() +hes_error(void) { return errval; } void -hes_free(hp) - char **hp; +hes_free(char **hp) { hesiod_free_list(context, hp); } static int -init_context() +init_context(void) { if (!inited) { inited = 1; @@ -554,7 +538,7 @@ init_context() } static void -translate_errors() +translate_errors(void) { switch (errno) { case ENOENT: From nobody Wed Dec 13 20:07:05 2023 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 4Sr62f1pfJz54FlF; Wed, 13 Dec 2023 20:07:06 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sr62d6sjRz4br3; Wed, 13 Dec 2023 20:07:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702498025; 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=jn07jiIYi89vjksZPDsGDU9RSoRxy1xgXUco2pHaeKQ=; b=xF6TxGa+prLmDdCPo0SA6q0FZBvRC7aGtrd1nv/U2F4oWQ933q0j+r7K1pI6AlIZ7YG9w2 Ujnby99B8L66fYkizqiyQNt2367O805EE8EHXKVgHfWGnE6BDVloc9QXXMNlq8k5zxWCda 7P8NAEm/KAH4JTXOMOdE2+acwO6KRKkc9Jnyeos2K+SJXOVgxPiBHgW4DneQwBUArCAGvN dJpeg8EpASUcVj4J9V/vgdQ/MxiSZHIfWCAUl8VoGEvi1wQcFIeQ35AVc+8ti/Bbgwz4vI eNSirtV3JRSYz9gtxXnWVfy3o3PdYTBTQlulEF2sXoavmKUg0XibAHbtkcq5HA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702498025; a=rsa-sha256; cv=none; b=datPh7IaBvJQbLh23M84xpGhcUVJuucrrVpSvO3U1Lf0rgrCbO9jrR4sZbfSGCHwplPx54 lDKAelVz68U9Thj87VrdmFIqpUfuYAQcAZwPEE1K8QvRU2ONDS2kyecP0YKgqBOfLMMMe2 xzqqJKldU8XESdApPhtrrFWCWfchSfqaK2REDt5dYax3o7fhdhA8B1Q4JfngZbocvfu9aP 3BED8rQHmSKcLiwqo3hF3yivSIK0u+VxWnsuymj3P1Ux9MCgVUHI6RSKhAtXAYtRsRKzPU go/SK01OPBBQ+eL9U1N8gwMC/fg+fhnKNOl6bcRBJWulndKurJp7/qdLZM9qDw== 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=1702498025; 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=jn07jiIYi89vjksZPDsGDU9RSoRxy1xgXUco2pHaeKQ=; b=Hbrq1gIinggmHt4sg9ZrJO66kTjCh09lofR2+jj1Fej/y2LEb9mzBSdD8ggd9qCUC6AT/W pk/pOXB23pUWu9pSs0UXs8VDm6eAMaod2bC6WZL+DiKQLa+yB2oDYgsK3vA2GoLeJXCx1r oAPvjNUeYRp5ReyBt5r5AjD1tY+LENWBrnNcKTuNMyh8eLi0XLdOeACK+NNa57d6kOuUIV JtBeB2yplJXdbZp7c0dDY3AHA2rRWlSEFBZvg+LFN6fIc6HfUjIvMvwGylsvGWtml9JiXQ wXiSJ05na68a3Bw99bBEaqzSg8eVz11DJiwpv9o9olT5W2rxDR3STkdh2uL/7g== 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 4Sr62d5s8nz1Blm; Wed, 13 Dec 2023 20:07:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BDK751X088227; Wed, 13 Dec 2023 20:07:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BDK75vY088224; Wed, 13 Dec 2023 20:07:05 GMT (envelope-from git) Date: Wed, 13 Dec 2023 20:07:05 GMT Message-Id: <202312132007.3BDK75vY088224@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 90b5ddeca0f5 - stable/14 - bitstring: Support large bit strings. 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 90b5ddeca0f502a9e1907f4e2a0219e7b29430c9 Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=90b5ddeca0f502a9e1907f4e2a0219e7b29430c9 commit 90b5ddeca0f502a9e1907f4e2a0219e7b29430c9 Author: Dag-Erling Smørgrav AuthorDate: 2023-11-22 22:30:03 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-12-13 16:41:48 +0000 bitstring: Support large bit strings. Replace int with either size_t or ssize_t (depending on context) in order to support bit strings up to SSIZE_MAX bits in length. Since some of the arguments that need to change type are pointers, we must resort to light preprocessor trickery to avoid breaking existing code. MFC after: 3 weeks Sponsored by: Klara, Inc. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D42698 (cherry picked from commit c56f45f2a9da7d989b79fd6c34b63100609ff9ae) --- share/man/man3/bitstring.3 | 50 ++++++------- sys/sys/bitstring.h | 158 +++++++++++++++++------------------------ tests/sys/sys/bitstring_test.c | 90 ++++++++++++++++++++++- 3 files changed, 181 insertions(+), 117 deletions(-) diff --git a/share/man/man3/bitstring.3 b/share/man/man3/bitstring.3 index ac87ac6d9124..808cd48f384b 100644 --- a/share/man/man3/bitstring.3 +++ b/share/man/man3/bitstring.3 @@ -57,7 +57,7 @@ .\" .\" @(#)bitstring.3 8.1 (Berkeley) 7/19/93 .\" -.Dd August 8, 2021 +.Dd November 21, 2023 .Dt BITSTRING 3 .Os .Sh NAME @@ -85,49 +85,49 @@ .Sh SYNOPSIS .In bitstring.h .Ft bitstr_t * -.Fn bit_alloc "int nbits" +.Fn bit_alloc "size_t nbits" .Ft void -.Fn bit_decl "bitstr_t *name" "int nbits" +.Fn bit_decl "bitstr_t *name" "size_t nbits" .Ft void -.Fn bit_clear "bitstr_t *name" "int bit" +.Fn bit_clear "bitstr_t *name" "size_t bit" .Ft void -.Fn bit_count "bitstr_t *name" "int count" "int nbits" "int *value" +.Fn bit_count "bitstr_t *name" "size_t count" "size_t nbits" "ssize_t *value" .Ft void -.Fn bit_ffc "bitstr_t *name" "int nbits" "int *value" +.Fn bit_ffc "bitstr_t *name" "size_t nbits" "ssize_t *value" .Ft void -.Fn bit_ffs "bitstr_t *name" "int nbits" "int *value" +.Fn bit_ffs "bitstr_t *name" "size_t nbits" "ssize_t *value" .Ft void -.Fn bit_ffc_at "bitstr_t *name" "int start" "int nbits" "int *value" +.Fn bit_ffc_at "bitstr_t *name" "size_t start" "size_t nbits" "ssize_t *value" .Ft void -.Fn bit_ffs_at "bitstr_t *name" "int start" "int nbits" "int *value" +.Fn bit_ffs_at "bitstr_t *name" "size_t start" "size_t nbits" "ssize_t *value" .Ft void -.Fn bit_ff_at "bitstr_t *name" "int start" "int nbits" "int match" "int *value" +.Fn bit_ff_at "bitstr_t *name" "size_t start" "size_t nbits" "int match" "ssize_t *value" .Ft void -.Fn bit_ffc_area "bitstr_t *name" "int nbits" "int size" "int *value" +.Fn bit_ffc_area "bitstr_t *name" "size_t nbits" "size_t size" "ssize_t *value" .Ft void -.Fn bit_ffs_area "bitstr_t *name" "int nbits" "int size" "int *value" +.Fn bit_ffs_area "bitstr_t *name" "size_t nbits" "size_t size" "ssize_t *value" .Ft void -.Fn bit_ffc_area_at "bitstr_t *name" "int start" "int nbits" "int size" "int *value" +.Fn bit_ffc_area_at "bitstr_t *name" "size_t start" "size_t nbits" "size_t size" "ssize_t *value" .Ft void -.Fn bit_ffs_area_at "bitstr_t *name" "int start" "int nbits" "int size" "int *value" +.Fn bit_ffs_area_at "bitstr_t *name" "size_t start" "size_t nbits" "size_t size" "ssize_t *value" .Ft void -.Fn bit_ff_area_at "bitstr_t *name" "int start" "int nbits" "int size" "int match" "int *value" -.Fn bit_foreach "bitstr_t *name" "int nbits" "int var" -.Fn bit_foreach_at "bitstr_t *name" "int start" "int nbits" "int var" -.Fn bit_foreach_unset "bitstr_t *name" "int nbits" "int var" -.Fn bit_foreach_unset_at "bitstr_t *name" "int start" "int nbits" "int var" +.Fn bit_ff_area_at "bitstr_t *name" "size_t start" "size_t nbits" "size_t size" "int match" "ssize_t *value" +.Fn bit_foreach "bitstr_t *name" "size_t nbits" "size_t var" +.Fn bit_foreach_at "bitstr_t *name" "size_t start" "size_t nbits" "size_t var" +.Fn bit_foreach_unset "bitstr_t *name" "size_t nbits" "size_t var" +.Fn bit_foreach_unset_at "bitstr_t *name" "size_t start" "size_t nbits" "size_t var" .Ft void -.Fn bit_nclear "bitstr_t *name" "int start" "int stop" +.Fn bit_nclear "bitstr_t *name" "size_t start" "size_t stop" .Ft void -.Fn bit_nset "bitstr_t *name" "int start" "int stop" +.Fn bit_nset "bitstr_t *name" "size_t start" "size_t stop" .Ft int -.Fn bit_ntest "bitstr_t *name" "int start" "int stop" "int match" +.Fn bit_ntest "bitstr_t *name" "size_t start" "size_t stop" "int match" .Ft void -.Fn bit_set "bitstr_t *name" "int bit" +.Fn bit_set "bitstr_t *name" "size_t bit" .Ft int -.Fn bitstr_size "int nbits" +.Fn bitstr_size "size_t nbits" .Ft int -.Fn bit_test "bitstr_t *name" "int bit" +.Fn bit_test "bitstr_t *name" "size_t bit" .Sh DESCRIPTION These macros operate on strings of bits. .Pp diff --git a/sys/sys/bitstring.h b/sys/sys/bitstring.h index 127de2ebc419..8a976962dd36 100644 --- a/sys/sys/bitstring.h +++ b/sys/sys/bitstring.h @@ -75,35 +75,33 @@ typedef unsigned long bitstr_t; #define _BITSTR_MASK (~0UL) #define _BITSTR_BITS (sizeof(bitstr_t) * 8) -#ifdef roundup2 -#define _bit_roundup2 roundup2 -#else -#define _bit_roundup2(x, y) (((x)+((y)-1))&(~((y)-1))) /* if y is powers of two */ -#endif +/* round up x to the next multiple of y if y is a power of two */ +#define _bit_roundup2(x, y) \ + (((size_t)(x) + (y) - 1) & ~((size_t)(y) - 1)) /* bitstr_t in bit string containing the bit. */ -static inline int -_bit_idx(int _bit) +static inline size_t +_bit_idx(size_t _bit) { return (_bit / _BITSTR_BITS); } /* bit number within bitstr_t at _bit_idx(_bit). */ -static inline int -_bit_offset(int _bit) +static inline size_t +_bit_offset(size_t _bit) { return (_bit % _BITSTR_BITS); } /* Mask for the bit within its long. */ static inline bitstr_t -_bit_mask(int _bit) +_bit_mask(size_t _bit) { return (1UL << _bit_offset(_bit)); } static inline bitstr_t -_bit_make_mask(int _start, int _stop) +_bit_make_mask(size_t _start, size_t _stop) { return ((_BITSTR_MASK << _bit_offset(_start)) & (_BITSTR_MASK >> (_BITSTR_BITS - _bit_offset(_stop) - 1))); @@ -111,18 +109,18 @@ _bit_make_mask(int _start, int _stop) /*----------------------------- Public Interface -----------------------------*/ /* Number of bytes allocated for a bit string of nbits bits */ -#define bitstr_size(_nbits) (_bit_roundup2(_nbits, _BITSTR_BITS) / 8) +#define bitstr_size(_nbits) (_bit_roundup2((_nbits), _BITSTR_BITS) / 8) /* Allocate a bit string initialized with no bits set. */ #ifdef _KERNEL static inline bitstr_t * -bit_alloc(int _nbits, struct malloc_type *type, int flags) +bit_alloc(size_t _nbits, struct malloc_type *type, int flags) { return ((bitstr_t *)malloc(bitstr_size(_nbits), type, flags | M_ZERO)); } #else static inline bitstr_t * -bit_alloc(int _nbits) +bit_alloc(size_t _nbits) { return ((bitstr_t *)calloc(bitstr_size(_nbits), 1)); } @@ -134,28 +132,28 @@ bit_alloc(int _nbits) /* Is bit N of bit string set? */ static inline int -bit_test(const bitstr_t *_bitstr, int _bit) +bit_test(const bitstr_t *_bitstr, size_t _bit) { return ((_bitstr[_bit_idx(_bit)] & _bit_mask(_bit)) != 0); } /* Set bit N of bit string. */ static inline void -bit_set(bitstr_t *_bitstr, int _bit) +bit_set(bitstr_t *_bitstr, size_t _bit) { _bitstr[_bit_idx(_bit)] |= _bit_mask(_bit); } /* clear bit N of bit string name */ static inline void -bit_clear(bitstr_t *_bitstr, int _bit) +bit_clear(bitstr_t *_bitstr, size_t _bit) { _bitstr[_bit_idx(_bit)] &= ~_bit_mask(_bit); } /* Are bits in [start ... stop] in bit string all 0 or all 1? */ static inline int -bit_ntest(const bitstr_t *_bitstr, int _start, int _stop, int _match) +bit_ntest(const bitstr_t *_bitstr, size_t _start, size_t _stop, int _match) { const bitstr_t *_stopbitstr; bitstr_t _mask; @@ -183,7 +181,7 @@ bit_ntest(const bitstr_t *_bitstr, int _start, int _stop, int _match) /* Set bits start ... stop inclusive in bit string. */ static inline void -bit_nset(bitstr_t *_bitstr, int _start, int _stop) +bit_nset(bitstr_t *_bitstr, size_t _start, size_t _stop) { bitstr_t *_stopbitstr; @@ -206,7 +204,7 @@ bit_nset(bitstr_t *_bitstr, int _start, int _stop) /* Clear bits start ... stop inclusive in bit string. */ static inline void -bit_nclear(bitstr_t *_bitstr, int _start, int _stop) +bit_nclear(bitstr_t *_bitstr, size_t _start, size_t _stop) { bitstr_t *_stopbitstr; @@ -228,20 +226,17 @@ bit_nclear(bitstr_t *_bitstr, int _start, int _stop) } /* Find the first '_match'-bit in bit string at or after bit start. */ -static inline void -bit_ff_at(bitstr_t *_bitstr, int _start, int _nbits, int _match, - int *_result) +static inline ssize_t +bit_ff_at_(bitstr_t *_bitstr, size_t _start, size_t _nbits, int _match) { bitstr_t *_curbitstr; bitstr_t *_stopbitstr; bitstr_t _mask; bitstr_t _test; - int _value; + ssize_t _value; - if (_start >= _nbits || _nbits <= 0) { - *_result = -1; - return; - } + if (_start >= _nbits || _nbits <= 0) + return (-1); _curbitstr = _bitstr + _bit_idx(_start); _stopbitstr = _bitstr + _bit_idx(_nbits - 1); @@ -255,51 +250,40 @@ bit_ff_at(bitstr_t *_bitstr, int _start, int _nbits, int _match, _value = ((_curbitstr - _bitstr) * _BITSTR_BITS) + ffsl(_test) - 1; if (_test == 0 || - (_bit_offset(_nbits) != 0 && _value >= _nbits)) + (_bit_offset(_nbits) != 0 && (size_t)_value >= _nbits)) _value = -1; - *_result = _value; + return (_value); } +#define bit_ff_at(_bitstr, _start, _nbits, _match, _resultp) \ + *(_resultp) = bit_ff_at_((_bitstr), (_start), (_nbits), (_match)) /* Find the first bit set in bit string at or after bit start. */ -static inline void -bit_ffs_at(bitstr_t *_bitstr, int _start, int _nbits, int *_result) -{ - bit_ff_at(_bitstr, _start, _nbits, 1, _result); -} +#define bit_ffs_at(_bitstr, _start, _nbits, _resultp) \ + *(_resultp) = bit_ff_at_((_bitstr), (_start), (_nbits), 1) /* Find the first bit clear in bit string at or after bit start. */ -static inline void -bit_ffc_at(bitstr_t *_bitstr, int _start, int _nbits, int *_result) -{ - bit_ff_at(_bitstr, _start, _nbits, 0, _result); -} +#define bit_ffc_at(_bitstr, _start, _nbits, _resultp) \ + *(_resultp) = bit_ff_at_((_bitstr), (_start), (_nbits), 0) /* Find the first bit set in bit string. */ -static inline void -bit_ffs(bitstr_t *_bitstr, int _nbits, int *_result) -{ - bit_ffs_at(_bitstr, /*start*/0, _nbits, _result); -} +#define bit_ffs(_bitstr, _nbits, _resultp) \ + *(_resultp) = bit_ff_at_((_bitstr), 0, (_nbits), 1) /* Find the first bit clear in bit string. */ -static inline void -bit_ffc(bitstr_t *_bitstr, int _nbits, int *_result) -{ - bit_ffc_at(_bitstr, /*start*/0, _nbits, _result); -} +#define bit_ffc(_bitstr, _nbits, _resultp) \ + *(_resultp) = bit_ff_at_((_bitstr), 0, (_nbits), 0) /* Find contiguous sequence of at least size '_match'-bits at or after start */ -static inline void -bit_ff_area_at(bitstr_t *_bitstr, int _start, int _nbits, int _size, - int _match, int *_result) +static inline ssize_t +bit_ff_area_at_(bitstr_t *_bitstr, size_t _start, size_t _nbits, size_t _size, + int _match) { bitstr_t *_curbitstr, _mask, _test; - int _value, _last, _shft, _maxshft; + size_t _last, _shft, _maxshft; + ssize_t _value; - if (_start + _size > _nbits || _nbits <= 0) { - *_result = -1; - return; - } + if (_start + _size > _nbits || _nbits <= 0) + return (-1); _mask = _match ? _BITSTR_MASK : 0; _maxshft = _bit_idx(_size - 1) == 0 ? _size : (int)_BITSTR_BITS; @@ -330,48 +314,37 @@ bit_ff_area_at(bitstr_t *_bitstr, int _start, int _nbits, int _size, break; /* A solution here needs bits from the next word. */ } - *_result = _value; + return (_value); } +#define bit_ff_area_at(_bitstr, _start, _nbits, _size, _match, _resultp) \ + *(_resultp) = bit_ff_area_at_(_bitstr, _start, _nbits, _size, _match); /* Find contiguous sequence of at least size set bits at or after start */ -static inline void -bit_ffs_area_at(bitstr_t *_bitstr, int _start, int _nbits, int _size, - int *_result) -{ - bit_ff_area_at(_bitstr, _start, _nbits, _size, 1, _result); -} +#define bit_ffs_area_at(_bitstr, _start, _nbits, _size, _resultp) \ + *(_resultp) = bit_ff_area_at_((_bitstr), (_start), (_nbits), (_size), 1) /* Find contiguous sequence of at least size cleared bits at or after start */ -static inline void -bit_ffc_area_at(bitstr_t *_bitstr, int _start, int _nbits, int _size, - int *_result) -{ - bit_ff_area_at(_bitstr, _start, _nbits, _size, 0, _result); -} +#define bit_ffc_area_at(_bitstr, _start, _nbits, _size, _resultp) \ + *(_resultp) = bit_ff_area_at_((_bitstr), (_start), (_nbits), (_size), 0) /* Find contiguous sequence of at least size set bits in bit string */ -static inline void -bit_ffs_area(bitstr_t *_bitstr, int _nbits, int _size, int *_result) -{ - bit_ffs_area_at(_bitstr, /*start*/0, _nbits, _size, _result); -} +#define bit_ffs_area(_bitstr, _nbits, _size, _resultp) \ + *(_resultp) = bit_ff_area_at_((_bitstr), 0, (_nbits), (_size), 1) /* Find contiguous sequence of at least size cleared bits in bit string */ -static inline void -bit_ffc_area(bitstr_t *_bitstr, int _nbits, int _size, int *_result) -{ - bit_ffc_area_at(_bitstr, /*start*/0, _nbits, _size, _result); -} +#define bit_ffc_area(_bitstr, _nbits, _size, _resultp) \ + *(_resultp) = bit_ff_area_at_((_bitstr), 0, (_nbits), (_size), 0) /* Count the number of bits set in a bitstr of size _nbits at or after _start */ -static inline void -bit_count(bitstr_t *_bitstr, int _start, int _nbits, int *_result) +static inline ssize_t +bit_count_(bitstr_t *_bitstr, size_t _start, size_t _nbits) { bitstr_t *_curbitstr, mask; - int _value = 0, curbitstr_len; + size_t curbitstr_len; + ssize_t _value = 0; if (_start >= _nbits) - goto out; + return (0); _curbitstr = _bitstr + _bit_idx(_start); _nbits -= _BITSTR_BITS * _bit_idx(_start); @@ -383,6 +356,8 @@ bit_count(bitstr_t *_bitstr, int _start, int _nbits, int *_result) mask = _bit_make_mask(_start, _bit_offset(curbitstr_len - 1)); _value += __bitcountl(*_curbitstr & mask); _curbitstr++; + if (_nbits < _BITSTR_BITS) + return (_value); _nbits -= _BITSTR_BITS; } while (_nbits >= (int)_BITSTR_BITS) { @@ -395,23 +370,24 @@ bit_count(bitstr_t *_bitstr, int _start, int _nbits, int *_result) _value += __bitcountl(*_curbitstr & mask); } -out: - *_result = _value; + return (_value); } +#define bit_count(_bitstr, _start, _nbits, _resultp) \ + *(_resultp) = bit_count_((_bitstr), (_start), (_nbits)) /* Traverse all set bits, assigning each location in turn to iter */ #define bit_foreach_at(_bitstr, _start, _nbits, _iter) \ - for (bit_ffs_at((_bitstr), (_start), (_nbits), &(_iter)); \ + for ((_iter) = bit_ff_at_((_bitstr), (_start), (_nbits), 1); \ (_iter) != -1; \ - bit_ffs_at((_bitstr), (_iter) + 1, (_nbits), &(_iter))) + (_iter) = bit_ff_at_((_bitstr), (_iter) + 1, (_nbits), 1)) #define bit_foreach(_bitstr, _nbits, _iter) \ bit_foreach_at(_bitstr, /*start*/0, _nbits, _iter) /* Traverse all unset bits, assigning each location in turn to iter */ #define bit_foreach_unset_at(_bitstr, _start, _nbits, _iter) \ - for (bit_ffc_at((_bitstr), (_start), (_nbits), &(_iter)); \ + for ((_iter) = bit_ff_at_((_bitstr), (_start), (_nbits), 0); \ (_iter) != -1; \ - bit_ffc_at((_bitstr), (_iter) + 1, (_nbits), &(_iter))) + (_iter) = bit_ff_at_((_bitstr), (_iter) + 1, (_nbits), 0)) #define bit_foreach_unset(_bitstr, _nbits, _iter) \ bit_foreach_unset_at(_bitstr, /*start*/0, _nbits, _iter) diff --git a/tests/sys/sys/bitstring_test.c b/tests/sys/sys/bitstring_test.c index 0c214b9e67a7..a48042a4a063 100644 --- a/tests/sys/sys/bitstring_test.c +++ b/tests/sys/sys/bitstring_test.c @@ -1,5 +1,6 @@ /*- * Copyright (c) 2014 Spectra Logic Corporation + * Copyright (c) 2023 Klara, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -31,7 +32,7 @@ #include #include -#include +#include #include @@ -51,6 +52,7 @@ bitstring_run_heap_test(testfunc_t *test, int nbits) bitstr_t *bitstr = bit_alloc(nbits); test(bitstr, nbits, "heap"); + free(bitstr); } static void @@ -862,6 +864,91 @@ BITSTRING_TC_DEFINE(bit_foreach_unset_at) } } +/* + * Perform various tests on large bit strings. We can't simply add larger + * sizes to bitstring_runner as most of the existing tests are exhaustive + * and would take forever to run for large values of nbits. + * + * On 32-bit platforms, we use nbits = SSIZE_MAX (2147483647) bits, which + * is the largest we can hope to support; on 64-bit platforms, we use + * nbits = INT_MAX + 30 (2147483677), which is small enough to be + * practicable yet large enough to reveal arithmetic overflow bugs. + */ +ATF_TC_WITHOUT_HEAD(bitstr_large); +ATF_TC_BODY(bitstr_large, tc) +{ + size_t nbits = INT_MAX < SSIZE_MAX ? (size_t)INT_MAX + 30 : SSIZE_MAX; + size_t early = 5, late = nbits - 5; + ssize_t fc, fs; + bitstr_t *b; + + /* Check for overflow in size calculation */ + ATF_REQUIRE(nbits >= (size_t)INT_MAX); + ATF_REQUIRE(bitstr_size(nbits) >= nbits / 8); + + /* Allocate the bit string */ + ATF_REQUIRE(b = bit_alloc(nbits)); + + /* Check that we allocated enough */ + ATF_REQUIRE(malloc_usable_size(b) >= bitstr_size(nbits)); + + /* Check ffc, ffs on all-zeroes string */ + bit_ffc(b, nbits, &fc); + ATF_CHECK_EQ(0L, fc); + bit_ffs(b, nbits, &fs); + ATF_CHECK_EQ(-1L, fs); + + /* Set, test, and clear an early bit */ + bit_set(b, early); + bit_ffs(b, nbits, &fs); + ATF_CHECK_EQ((ssize_t)early, fs); + ATF_CHECK_EQ(0, bit_test(b, early - 1)); + ATF_CHECK(bit_test(b, early) != 0); + ATF_CHECK_EQ(0, bit_test(b, early + 1)); + bit_clear(b, early); + ATF_CHECK_EQ(0, bit_test(b, early)); + + /* Set, test, and clear an early bit range */ + bit_nset(b, early - 1, early + 1); + bit_ffs(b, nbits, &fs); + ATF_CHECK_EQ((ssize_t)early - 1, fs); + ATF_CHECK_EQ(0, bit_test(b, early - 2)); + ATF_CHECK(bit_test(b, early - 1)); + ATF_CHECK(bit_test(b, early)); + ATF_CHECK(bit_test(b, early + 1)); + ATF_CHECK_EQ(0, bit_test(b, early + 2)); + bit_nclear(b, early - 1, early + 1); + ATF_CHECK_EQ(0, bit_test(b, early - 1)); + ATF_CHECK_EQ(0, bit_test(b, early)); + ATF_CHECK_EQ(0, bit_test(b, early + 1)); + + /* Set, test, and clear a late bit */ + bit_set(b, late); + bit_ffs(b, nbits, &fs); + ATF_CHECK_EQ((ssize_t)late, fs); + ATF_CHECK_EQ(0, bit_test(b, late - 1)); + ATF_CHECK(bit_test(b, late) != 0); + ATF_CHECK_EQ(0, bit_test(b, late + 1)); + bit_clear(b, late); + ATF_CHECK_EQ(0, bit_test(b, late)); + + /* Set, test, and clear a late bit range */ + bit_nset(b, late - 1, late + 1); + bit_ffs(b, nbits, &fs); + ATF_CHECK_EQ((ssize_t)late - 1, fs); + ATF_CHECK_EQ(0, bit_test(b, late - 2)); + ATF_CHECK(bit_test(b, late - 1)); + ATF_CHECK(bit_test(b, late)); + ATF_CHECK(bit_test(b, late + 1)); + ATF_CHECK_EQ(0, bit_test(b, late + 2)); + bit_nclear(b, late - 1, late + 1); + ATF_CHECK_EQ(0, bit_test(b, late - 1)); + ATF_CHECK_EQ(0, bit_test(b, late)); + ATF_CHECK_EQ(0, bit_test(b, late + 1)); + + free(b); +} + ATF_TP_ADD_TCS(tp) { @@ -884,6 +971,7 @@ ATF_TP_ADD_TCS(tp) BITSTRING_TC_ADD(tp, bit_foreach_at); BITSTRING_TC_ADD(tp, bit_foreach_unset); BITSTRING_TC_ADD(tp, bit_foreach_unset_at); + ATF_TP_ADD_TC(tp, bitstr_large); return (atf_no_error()); } From nobody Wed Dec 13 20:07:06 2023 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 4Sr62g1qjkz54FrH; Wed, 13 Dec 2023 20:07:07 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sr62g0mn5z4c8h; Wed, 13 Dec 2023 20:07:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702498027; 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=9YDBhRkcl1n08N4JKzsU26S9RRgpPhWTfM3GuiIw1dE=; b=MlFglTcRjaxXLr8caHmkPwLrohS1C985+flsNuazu8rH6RYEkLVFwbqt6+THetVf7yTa7P 9X1yUuitw6lMa7mO1mRTDnAH4bt6CXWhmQJCt4wSzocSyRBuiywHNZmd/tolPmWt+2HEmF MFc/BUyfsLMWBN9YKjSh1RdXOM6aGPaAutm7cWVovgl8HjzYWKzxJ9T1Jeav57fNF71SRV yHX53T7GMIjSPxQgzP6f+fmtU7rz6TsenUONmZGj39Qrw72QfeOci5ZXHipLYU2/oAhaVo mYRfXc72u0rNkyNkttPtnKAKm4ETBPRreH+hEzO9xg21hCiQnVH+J4a4aER04g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702498027; a=rsa-sha256; cv=none; b=Z6PZwLPGmGVzxrNkjGajFUEqrGukYfNFDwGtux6IJuDxWwD214hMFd0EZEbwIbHM/NBsyz DbTumEMF0PNmZYWoO1sEHb+l9qIEFHGPi0EY2X5xS0MzrW9/ZFOguDDZeZHxbxWPBypS9A lMBkLa/FHtxDxfna9Uc+k91pNaCcFz7oDeWdJKl8TB7U4gBbgYfRdIXl1D/eCHlD83Q08/ jHHz0bLU5SIZaNA8bEiUXQmVGfxWQig635AKj35C4jWDsKcThqJly4nFwT0BBaENYuTGPw WgW16dr2aULuWovyibr8AcrSsIcU8lnNsixUjQdbojl7IZXbRvGKDd5uKLzzxQ== 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=1702498027; 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=9YDBhRkcl1n08N4JKzsU26S9RRgpPhWTfM3GuiIw1dE=; b=vcyeH/JhA5T2OpMNZv3JfXlc63nq6AnCUx8X3ajrUdGlcIIfBpveUcwUZa0/gANFV5vtLC beUG75u1ODwO6Cwa1KlRiAuOOG6fNJvsXpe+3ogloTvY9QbMu2yBL3i6YJRO3QYu4l1346 roAssf8WfLWXXhv89vPk8K6vjV3FyN3M+4r+F6Yy/zeKLQtVyrKM/PskW+SeY1SZrkO+Pm iJDlhe4VvWTfA1A+4q4AQnc5YRbUoUdTgfdRDak9ewGbzCiE1/Y2AQNTpkCNpPckGn8EgD GubxHYAErKbbnK06lXpi1pKs6OwIY/JfXrMIyrUIMuDXaHeGSDDdNdhlsVA2zQ== 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 4Sr62f6lZLz1BXg; Wed, 13 Dec 2023 20:07:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BDK76ue088287; Wed, 13 Dec 2023 20:07:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BDK76lC088284; Wed, 13 Dec 2023 20:07:06 GMT (envelope-from git) Date: Wed, 13 Dec 2023 20:07:06 GMT Message-Id: <202312132007.3BDK76lC088284@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 7441705cae68 - stable/14 - tail: Fix heap overflow in -F case. 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7441705cae6887332b408c04c479e616403d3739 Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=7441705cae6887332b408c04c479e616403d3739 commit 7441705cae6887332b408c04c479e616403d3739 Author: Dag-Erling Smørgrav AuthorDate: 2023-11-29 21:48:50 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-12-13 16:41:48 +0000 tail: Fix heap overflow in -F case. The number of events we track can vary over time, but we only allocate enough space for the exact number of events we are tracking when we first begin, resulting in a trivially reproducable heap overflow. Fix this by allocating enough space for the greatest possible number of events (two per file) and clean up the code a bit. Also add a test case which triggers the aforementioned heap overflow, although we don't currently have a way to detect it. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: allanjude, markj Differential Revision: https://reviews.freebsd.org/D42839 (cherry picked from commit 621f45532c5887c96b708ce232c52878d0053325) tail: Clean up error messages. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D42842 (cherry picked from commit b70e57be2cfe83ec9f410e2f317ea38aaac61a98) --- usr.bin/tail/forward.c | 39 ++++++++++++++++++--------------------- usr.bin/tail/read.c | 8 ++++---- usr.bin/tail/reverse.c | 2 +- usr.bin/tail/tail.c | 6 +++--- usr.bin/tail/tests/tail_test.sh | 21 ++++++++++++++++++++- 5 files changed, 46 insertions(+), 30 deletions(-) diff --git a/usr.bin/tail/forward.c b/usr.bin/tail/forward.c index e2a3eb77aade..a0f66262608a 100644 --- a/usr.bin/tail/forward.c +++ b/usr.bin/tail/forward.c @@ -275,7 +275,7 @@ set_events(file_info_t *files) action = USE_KQUEUE; for (i = 0, file = files; i < no_files; i++, file++) { - if (! file->fp) + if (!file->fp) continue; if (fstatfs(fileno(file->fp), &sf) == 0 && @@ -307,27 +307,21 @@ set_events(file_info_t *files) void follow(file_info_t *files, enum STYLE style, off_t off) { - int active, ev_change, i, n = -1; + int active, ev_change, i, n; struct stat sb2; file_info_t *file; FILE *ftmp; struct timespec ts; /* Position each of the files */ - - file = files; active = 0; - n = 0; - for (i = 0; i < no_files; i++, file++) { - if (file->fp) { - active = 1; - n++; - if (vflag || (qflag == 0 && no_files > 1)) - printfn(file->file_name, 1); - forward(file->fp, file->file_name, style, off, &file->st); - if (Fflag && fileno(file->fp) != STDIN_FILENO) - n++; - } + for (i = 0, file = files; i < no_files; i++, file++) { + if (!file->fp) + continue; + active = 1; + if (vflag || (qflag == 0 && no_files > 1)) + printfn(file->file_name, 1); + forward(file->fp, file->file_name, style, off, &file->st); } if (!Fflag && !active) return; @@ -337,9 +331,14 @@ follow(file_info_t *files, enum STYLE style, off_t off) kq = kqueue(); if (kq < 0) err(1, "kqueue"); - ev = malloc(n * sizeof(struct kevent)); - if (! ev) - err(1, "Couldn't allocate memory for kevents."); + /* + * The number of kqueue events we track may vary over time and may + * even grow past its initial value in the -F case, but it will + * never exceed two per file, so just preallocate that. + */ + ev = malloc(no_files * 2 * sizeof(struct kevent)); + if (ev == NULL) + err(1, "failed to allocate memory for kevents"); set_events(files); for (;;) { @@ -413,9 +412,7 @@ follow(file_info_t *files, enum STYLE style, off_t off) */ do { n = kevent(kq, NULL, 0, ev, 1, Fflag ? &ts : NULL); - if (n < 0 && errno == EINTR) - continue; - if (n < 0) + if (n < 0 && errno != EINTR) err(1, "kevent"); } while (n < 0); if (n == 0) { diff --git a/usr.bin/tail/read.c b/usr.bin/tail/read.c index ff025b31d64c..67bc5750cd0b 100644 --- a/usr.bin/tail/read.c +++ b/usr.bin/tail/read.c @@ -72,7 +72,7 @@ bytes(FILE *fp, const char *fn, off_t off) char *sp; if ((sp = p = malloc(off)) == NULL) - err(1, "malloc"); + err(1, "failed to allocate memory"); for (wrap = 0, ep = p + off; (ch = getc(fp)) != EOF;) { *p = ch; @@ -146,7 +146,7 @@ lines(FILE *fp, const char *fn, off_t off) int blen, cnt, recno, wrap; if ((llines = calloc(off, sizeof(*llines))) == NULL) - err(1, "calloc"); + err(1, "failed to allocate memory"); p = sp = NULL; blen = cnt = recno = wrap = 0; rc = 0; @@ -154,7 +154,7 @@ lines(FILE *fp, const char *fn, off_t off) while ((ch = getc(fp)) != EOF) { if (++cnt > blen) { if ((sp = realloc(sp, blen += 1024)) == NULL) - err(1, "realloc"); + err(1, "failed to allocate memory"); p = sp + cnt - 1; } *p++ = ch; @@ -163,7 +163,7 @@ lines(FILE *fp, const char *fn, off_t off) llines[recno].blen = cnt + 256; if ((llines[recno].l = realloc(llines[recno].l, llines[recno].blen)) == NULL) - err(1, "realloc"); + err(1, "failed to allocate memory"); } bcopy(sp, llines[recno].l, llines[recno].len = cnt); cnt = 0; diff --git a/usr.bin/tail/reverse.c b/usr.bin/tail/reverse.c index 12231530e679..67d27d487d1c 100644 --- a/usr.bin/tail/reverse.c +++ b/usr.bin/tail/reverse.c @@ -212,7 +212,7 @@ r_buf(FILE *fp, const char *fn) while ((tl = malloc(sizeof(bfelem_t))) == NULL) { first = TAILQ_FIRST(&head); if (TAILQ_EMPTY(&head)) - err(1, "malloc"); + err(1, "failed to allocate memory"); enomem += first->len; TAILQ_REMOVE(&head, first, entries); free(first); diff --git a/usr.bin/tail/tail.c b/usr.bin/tail/tail.c index 492a6494628d..c206b11863a5 100644 --- a/usr.bin/tail/tail.c +++ b/usr.bin/tail/tail.c @@ -173,7 +173,7 @@ main(int argc, char *argv[]) cap_rights_set(&rights, CAP_EVENT); if (caph_rights_limit(STDIN_FILENO, &rights) < 0 || caph_limit_stderr() < 0 || caph_limit_stdout() < 0) - err(1, "can't limit stdio rights"); + err(1, "unable to limit stdio rights"); fa = fileargs_init(argc, argv, O_RDONLY, 0, &rights, FA_OPEN); if (fa == NULL) @@ -213,7 +213,7 @@ main(int argc, char *argv[]) if (*argv && fflag) { files = malloc(no_files * sizeof(struct file_info)); if (files == NULL) - err(1, "Couldn't malloc space for file descriptors."); + err(1, "failed to allocate memory for file descriptors"); for (filep = files; (fn = *argv++); filep++) { filep->file_name = fn; @@ -308,7 +308,7 @@ obsolete(char *argv[]) /* Malloc space for dash, new option and argument. */ len = strlen(*argv); if ((start = p = malloc(len + 3)) == NULL) - err(1, "malloc"); + err(1, "failed to allocate memory"); *p++ = '-'; /* diff --git a/usr.bin/tail/tests/tail_test.sh b/usr.bin/tail/tests/tail_test.sh index 8123a310fe67..9c941f8a2c2f 100755 --- a/usr.bin/tail/tests/tail_test.sh +++ b/usr.bin/tail/tests/tail_test.sh @@ -329,10 +329,28 @@ follow_stdin_body() atf_check kill $pid } +atf_test_case follow_create +follow_create_head() +{ + atf_set "descr" "Verify that -F works when a file is created" +} +follow_create_body() +{ + local pid + + rm -f infile + tail -F infile > outfile & + pid=$! + seq 1 5 >infile + sleep 2 + atf_check cmp infile outfile + atf_check kill $pid +} + atf_test_case follow_rename follow_rename_head() { - atf_set "descr" "Verify that -F works" + atf_set "descr" "Verify that -F works when a file is replaced" } follow_rename_body() { @@ -424,6 +442,7 @@ atf_init_test_cases() atf_add_test_case stdin atf_add_test_case follow atf_add_test_case follow_stdin + atf_add_test_case follow_create atf_add_test_case follow_rename atf_add_test_case silent_header atf_add_test_case verbose_header From nobody Wed Dec 13 21:28:09 2023 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 4Sr7rV1CGSz54Ljg; Wed, 13 Dec 2023 21:28:26 +0000 (UTC) (envelope-from delphij@gmail.com) Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sr7rT4TVDz3L32; Wed, 13 Dec 2023 21:28:25 +0000 (UTC) (envelope-from delphij@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ed1-x529.google.com with SMTP id 4fb4d7f45d1cf-54c70c70952so10147237a12.3; Wed, 13 Dec 2023 13:28:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702502901; x=1703107701; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=X4A9AkotZeo4qJTD4+aownJZbJch3erdFYJXOROFyOs=; b=XSL5MQ5GreRwNKLxkQBV6Ot3HpzqlVnDoH/0PtBYh1DicFSK30pkPFqmWkl3L60JqK LFtgppQ1MaEXTRsElKnG0RGeclw/IVTwBIVxBW5Yjd21CjS2c2KAtFMhIh+oNNVrdTcP lFnypqmV0QREnu1FCLaYvX3DpXVwVV5+uU6U7hQz345Y3vypIjtmNlt1qZ4q67uiiH0j aOL4BulGaVKXbY6agly7IgdagrLkx1yvmv8HehdWzowUulLNeg71A55WEw3SMyutEFeB zqOaNeUvSJjAGBw+R3QUMaOqzUrtTiLI1cYy2QxIiiVictzAHNfDToWAb9Rb4KmeVcii p52Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702502901; x=1703107701; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=X4A9AkotZeo4qJTD4+aownJZbJch3erdFYJXOROFyOs=; b=G4lctsdsdVMPkE6Chch1yoA+d9NNCvhfNmnYjHUc28cBxz62FTZQXhptEdh6DNzgNA LnwjE1dpYdxo7PBkqlnN9Eo+j4hwv3uCoE2Qtk8Meq1+SmSyp+5llaCKLBo+i8xHMunY ppMyWBaLMGe4iaS9rXNYV/WfzJudYlO8xCz3jcre/ZyHcVUjf3yDkW1dBMacJtzZHoL/ qgwUb7StXTmBtJDesKeCefsca6gSCODabiw6Q8+1UIZHEiK/uBr0UA2fVu7blvdqAB2M FNh22xRxBSGux28ZMpXl1sXwmtvtaUKOXc57SwBvtBV1kFk582jFqlUT15B6qDsGfezI r/vg== X-Gm-Message-State: AOJu0YwYYyjX7i2eDel1hKwPH5Utq0CM4lXfP0bxxon/KCU5jjSHSxhq ZY4J+alKbfsFpHa2itjoYF403caMz2R085Lwa1B4ShKBsyc= X-Google-Smtp-Source: AGHT+IHQuZYVZfteAjGB7xsyXuNa9RJKTSUplikWsENxJTnwG/ooghxCTghCY2V7GQkVuq4mBoOWjdXQeD0EBlvrmLA= X-Received: by 2002:a05:6402:2157:b0:54c:5d46:43ba with SMTP id bq23-20020a056402215700b0054c5d4643bamr3167223edb.5.1702502901187; Wed, 13 Dec 2023 13:28:21 -0800 (PST) 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 References: <202312132006.3BDK6VLv087438@gitrepo.freebsd.org> In-Reply-To: <202312132006.3BDK6VLv087438@gitrepo.freebsd.org> From: Xin LI Date: Wed, 13 Dec 2023 13:28:09 -0800 Message-ID: Subject: Re: git: 585762c3733f - stable/13 - Improve usability of head(1) and tail(1): To: =?UTF-8?Q?Dag=2DErling_Sm=C3=B8rgrav?= Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-branches@freebsd.org Content-Type: multipart/alternative; boundary="000000000000a7890d060c6ad803" X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] X-Spamd-Bar: ---- X-Rspamd-Queue-Id: 4Sr7rT4TVDz3L32 --000000000000a7890d060c6ad803 Content-Type: text/plain; charset="UTF-8" Thanks! (Somehow I missed the MFC notification...) --000000000000a7890d060c6ad803 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thanks!=C2=A0 (Somehow I missed the MFC notification...)
=
--000000000000a7890d060c6ad803-- From nobody Wed Dec 13 21:46:08 2023 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 4Sr8Dw5xrGz54MwG; Wed, 13 Dec 2023 21:46: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sr8Dw5FPcz3Npf; Wed, 13 Dec 2023 21:46:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702503968; 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=3BZ+0sR5NFTc9Hv7ixfRHpqj5vZQikmSBvzG6mnTiOE=; b=kax7k7+toLggYUzMvVslTgHfORFYB7NgbH13TUWICf/vK1gZ0eF9nllWIoRFFqHC9JWWTj uZExBnGjEdzGurgkzJjWjPRnr9Ebdei0BUX/3b7acGa3aUu6vnFKD3CwewlVtBYOvUylXP dgbVyY3ubkhTm44WYZ2LC3LkV7uynqBWD+8cW3meNWRcYcjsVo9U//7/FOax0Sb+Tnt5lL sFJzw8D0F92aPHhZscGpom2bB+LOuTHdpnKm+dtkwDQqcXf2ualtUIWvaj+71U5iMCuKM5 /Gl4Nudh4JiCp3RFzYuOBJEC8Bo4bkfUZreFZULvJ3ZZjR1jRCgCFl97Zn5fug== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702503968; a=rsa-sha256; cv=none; b=i1YfF1wOEVV2XiOqsP6Hh8JNX79ihoxSMN3BlAwdvicPF8mUnsXPuhso7pw28DI8LF11Jf +cxeoAEkNVzuk5FuxwAqOaO0Fxr2Y4GEdxjOnDpA+gpaNnLT4PbeP9+etHqphEsOUrQJFI 6f6ndbcq7W2+fk0d1xPZq502c86to5Ovv807ijKwy5UTtSFGH5sA4502K2jjf3miEq8xHM 9bH6lbOa3VfPqkCCvF4VEPShWkDmrJVcgIXbuBOCVl31uIF0fRJZmiBFX4ujb9NFZisHXy +C+qtn0AGQA0s6QQMP66+BTbyvhaWK+OieunB1TvG67cSUcdueUzrx4/O7N5Ew== 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=1702503968; 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=3BZ+0sR5NFTc9Hv7ixfRHpqj5vZQikmSBvzG6mnTiOE=; b=XUe3Z76/Eu0cdlnewDJ96TLmsFDmrTTlSZdi0hRHF73JcApceXcMM1uc5qPTBVUwlW55SX i7SDPpjvq8iMoDjLSYFXpTRWwnc1k/wFgkqbB1GUO0E6+P0MdVwkKvw/mNYdPuChJx4hNy chyY0Y9Pw8Dhc2ikEBIqfIE4zfqB0P+eV3tg05/pA5b1t+I82CZrRyvaAaksGohN8OcpLu yi7eqGoyj598x6mSuh2n7vAHkW3M/gbb1OmD5qCdX7nYPgbetep1cIuCynhRJDOgnvRc2p 8Pg5RABN+T3R1NcOSsJ6oW6copGDJ7QSEj+5YgV49PsHkQXo1Pi0Rn2ILwNLoA== 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 4Sr8Dw4B8Wz1Ff5; Wed, 13 Dec 2023 21:46:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BDLk873056468; Wed, 13 Dec 2023 21:46:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BDLk8qs056465; Wed, 13 Dec 2023 21:46:08 GMT (envelope-from git) Date: Wed, 13 Dec 2023 21:46:08 GMT Message-Id: <202312132146.3BDLk8qs056465@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: 019e6ffcc479 - stable/14 - bsdinstall: Encode dists to valid variable names in checksum script 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 019e6ffcc47913281bc6fa7e1b7e13f9ec1a2b99 Auto-Submitted: auto-generated The branch stable/14 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=019e6ffcc47913281bc6fa7e1b7e13f9ec1a2b99 commit 019e6ffcc47913281bc6fa7e1b7e13f9ec1a2b99 Author: Jessica Clarke AuthorDate: 2023-12-06 21:37:32 +0000 Commit: Jessica Clarke CommitDate: 2023-12-13 21:45:45 +0000 bsdinstall: Encode dists to valid variable names in checksum script Currently we just strip the .txz of the dist name (and add a status_ prefix) to get the shell variable name for its status, but this doesn't give a valid result for dists like base-dbg, kernel-dbg and lib32-dbg, or even kernel.KERNCONF (or, combining the two, kernel.KERNCONF-dbg). As a result, four things go wrong for such dists: 1. If there is a dot and/or a dash in the name, writing to the variable fails and spits an error out on stderr to the log 3. If there is a dot in the name before any dash, the syntax is always invalid, reading the variable fails, spits an error out on stderr to the log, the result is the empty string and that is interpreted as being 0% 2. If there is a dash in the name before any dot, and there is a dist whose name is the substring up to that first dash, and it has already had its status written to, reading the variable instead reads that dist's variable and so the status of that dist is displayed instead 3. If there is a dash in the name before any dot, and either there is not a dist whose name is the substring up to that first dash or there is such a dist but it has not already had its status written to, reading the varaible instead results in the substring after the first dash, including any additional string expansion syntax that follows (i.e. ${status_kernel-dbg:--11}, the expression used to read the variable, is interpreted as reading status_kernel with a default value of "dbg:--11") For example, in a default install with base, kernel, kernel-dbg and lib32, the following sequence of displays happens: 1. base is In Progress, kernel is Pending, kernel-dbg is 0% (what shows for the garbage input "dbg:--11") and lib32 is Pending 2. base is Passed, kernel is In Progress, kernel-dbg is In Progress (since kernel has now had its status written to) and lib32 is Pending 3. base is Passed, kernel is Passed, kernel-dbg is Passed (again, since that is the status of kernel, despite that kernel-dbg is being verified at this point) and lib32 is Pending 4. base is Passed, kernel is Passed, kernel-dbg is Passed and lib32 is In Progress Fix this with a crude encoding scheme. More special characters can easily be added if needed in future. Note that, prior to bsddialog being used (and thus for branches this is MFC'ed to where dialog is still used), the same problem existed but displayed slightly differently due to a combination of different default values and different behaviour for unintended inputs. Fixes: b70047d41362 ("Add generation of an installation manifest containing SHA256 checksums as ...") MFC after: 1 week (cherry picked from commit 47d669f10ea3eb92a3783376549728b42c9e22b9) --- usr.sbin/bsdinstall/scripts/checksum | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/usr.sbin/bsdinstall/scripts/checksum b/usr.sbin/bsdinstall/scripts/checksum index 376ba4261496..ee93cb342f25 100755 --- a/usr.sbin/bsdinstall/scripts/checksum +++ b/usr.sbin/bsdinstall/scripts/checksum @@ -30,14 +30,20 @@ test -f $BSDINSTALL_DISTDIR/MANIFEST || exit 0 BSDCFG_SHARE="/usr/share/bsdconfig" . $BSDCFG_SHARE/common.subr || exit 1 +dist_to_statusvar() +{ + printf 'status_' + echo "$1" | sed 's/_/__/g;s/\./_dot_/g;s/-/_dash_/g' +} + percentage=0 for dist in $DISTRIBUTIONS; do - distname=$(basename $dist .txz) - eval "status_$distname=-8" + statusvar=$(dist_to_statusvar $dist) + eval "$statusvar=-8" items="" for i in $DISTRIBUTIONS; do - items="$items $i `eval echo \\\${status_$(basename $i .txz):--11}`" + items="$items $i `eval echo \\\${$(dist_to_statusvar $i):--11}`" done bsddialog --backtitle "$OSNAME Installer" --title "Checksum Verification" \ --mixedgauge "\nVerifying checksums of selected distributions.\n" \ @@ -57,13 +63,13 @@ for dist in $DISTRIBUTIONS; do CK_VALID=$? if [ $CK_VALID -le 1 ]; then if [ $CK_VALID -eq 0 ]; then - eval "status_$distname=-3" + eval "$statusvar=-3" else - eval "status_$distname=-7" + eval "$statusvar=-7" fi percentage=$(echo $percentage + 100/`echo $DISTRIBUTIONS | wc -w` | bc) else - eval "status_$distname=-2" + eval "$statusvar=-2" case $(/bin/freebsd-version -u) in *-ALPHA*|*-CURRENT|*-STABLE|*-PRERELEASE) bsddialog --backtitle "$OSNAME Installer" --title "Error" \ From nobody Wed Dec 13 21:53:26 2023 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 4Sr8PL5cx3z54N5X; Wed, 13 Dec 2023 21:53:26 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sr8PL520wz3Q53; Wed, 13 Dec 2023 21:53:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702504406; 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=vzJ8YNbSVHSelxAEP0ET1Y/Rlhe6AYT3YxA5f87cyyg=; b=N60c+8JIiH0JwXI+GDZlKmKtPb4WnNfwtleS3QoKX6oCoHvGBRuZfHxUmX/VYeBFovsBzk y6f38XXJ6YDMBj6NWaV4YDu4+PpCAIKevmk7QWdY0Doup5aOiMo5EMSdiWdZFhHltYpfmL W+8aGNqy+kkwUGNKiEAAEnNiQy+AzJBcMpmyyPguRXhUKmR0tEZ6Jrg4X2v+rVamOeuZ7W UHPqiPNLv9ZRMWQvqb35SAWSJjMlf+BdCbg3KzkkJbOuhdbVL/V6zGZ5NTGy8LJjZTH8GL 7hflyX9vDc05pNfZCQh3Mqfl/jfdHnN75MJuKUuj2ir+IYxx4dF3KEsYWlg5KA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702504406; a=rsa-sha256; cv=none; b=mIoGDG5JyT6qu2nCxDAE7glyTrcXWJ2w4VfHeNEB8UWjmcZGls0uMcCeU+TXVFW65iENRY bBmmaSujyDGsA0ypj7xULDrgQSF2TGzj0vCiWXZCKZDPeuM5zBEnD8qad/iPLb0nPtGVEf JBItPTS8KL+IVM6CX9k4yqu+CWsLKiRHr4AjH7UVFaV/M5+ka05sPKQaiJFtCFMJlGNTFe IMc7dPK3HsUDryeGMjXVoPqofT5dVVu60mP6eIT/6WTBuFL2ecjRtedaYkZo6U2SdL6ais vYmSEebD8lIDwQdMk1EscsQmZlxdquQgV+QFAOGsEGdKbvpkj1mTToZRGdfsZg== 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=1702504406; 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=vzJ8YNbSVHSelxAEP0ET1Y/Rlhe6AYT3YxA5f87cyyg=; b=KNrruaGtWiA3GYQVbd8ffPQxvUyX2W+x5lgvrwsEdfjZ41FeRZ/6ugnDr500huW2tUVWHj 2Ij72rFNyMz/605jB1bu3BdFPIlVG8xwiI03i1+fIpYnvEOtbtFx0Y9053+82jYsPqNJ4e lPtMQ1pl5BZ30ZsznL26D9AjEvrZcNGt1NTH1mUUDYUyJW0a4EXvBEjwenc2DlFXpUWNJC NpcESK00oKI46cahkka8kWJp2DLgwL/5lwp6mWI83w28QhEmsbySEVEfSm2Esgkk8lGhDL D20ssCivfuHTTn3psl7/H6hTfy7HdiXlVcb9yEPnO9tq6uBQv5MMGSqBrNBOhw== 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 4Sr8PL43YZz1Fsf; Wed, 13 Dec 2023 21:53:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BDLrQ5E073074; Wed, 13 Dec 2023 21:53:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BDLrQFn073071; Wed, 13 Dec 2023 21:53:26 GMT (envelope-from git) Date: Wed, 13 Dec 2023 21:53:26 GMT Message-Id: <202312132153.3BDLrQFn073071@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: 7c9a6ac58cbb - stable/13 - bsdinstall: Encode dists to valid variable names in checksum script 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7c9a6ac58cbb5e86a1dda94b346c164f572654d9 Auto-Submitted: auto-generated The branch stable/13 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=7c9a6ac58cbb5e86a1dda94b346c164f572654d9 commit 7c9a6ac58cbb5e86a1dda94b346c164f572654d9 Author: Jessica Clarke AuthorDate: 2023-12-06 21:37:32 +0000 Commit: Jessica Clarke CommitDate: 2023-12-13 21:52:48 +0000 bsdinstall: Encode dists to valid variable names in checksum script Currently we just strip the .txz of the dist name (and add a status_ prefix) to get the shell variable name for its status, but this doesn't give a valid result for dists like base-dbg, kernel-dbg and lib32-dbg, or even kernel.KERNCONF (or, combining the two, kernel.KERNCONF-dbg). As a result, four things go wrong for such dists: 1. If there is a dot and/or a dash in the name, writing to the variable fails and spits an error out on stderr to the log 3. If there is a dot in the name before any dash, the syntax is always invalid, reading the variable fails, spits an error out on stderr to the log, the result is the empty string and that is interpreted as being 0% 2. If there is a dash in the name before any dot, and there is a dist whose name is the substring up to that first dash, and it has already had its status written to, reading the variable instead reads that dist's variable and so the status of that dist is displayed instead 3. If there is a dash in the name before any dot, and either there is not a dist whose name is the substring up to that first dash or there is such a dist but it has not already had its status written to, reading the varaible instead results in the substring after the first dash, including any additional string expansion syntax that follows (i.e. ${status_kernel-dbg:--11}, the expression used to read the variable, is interpreted as reading status_kernel with a default value of "dbg:--11") For example, in a default install with base, kernel, kernel-dbg and lib32, the following sequence of displays happens: 1. base is In Progress, kernel is Pending, kernel-dbg is 0% (what shows for the garbage input "dbg:--11") and lib32 is Pending 2. base is Passed, kernel is In Progress, kernel-dbg is In Progress (since kernel has now had its status written to) and lib32 is Pending 3. base is Passed, kernel is Passed, kernel-dbg is Passed (again, since that is the status of kernel, despite that kernel-dbg is being verified at this point) and lib32 is Pending 4. base is Passed, kernel is Passed, kernel-dbg is Passed and lib32 is In Progress Fix this with a crude encoding scheme. More special characters can easily be added if needed in future. Note that, prior to bsddialog being used (and thus for branches this is MFC'ed to where dialog is still used), the same problem existed but displayed slightly differently due to a combination of different default values and different behaviour for unintended inputs. Fixes: b70047d41362 ("Add generation of an installation manifest containing SHA256 checksums as ...") MFC after: 1 week (cherry picked from commit 47d669f10ea3eb92a3783376549728b42c9e22b9) --- usr.sbin/bsdinstall/scripts/checksum | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/usr.sbin/bsdinstall/scripts/checksum b/usr.sbin/bsdinstall/scripts/checksum index 3c85d9594346..99c2346280b1 100755 --- a/usr.sbin/bsdinstall/scripts/checksum +++ b/usr.sbin/bsdinstall/scripts/checksum @@ -27,14 +27,20 @@ test -f $BSDINSTALL_DISTDIR/MANIFEST || exit 0 +dist_to_statusvar() +{ + printf 'status_' + echo "$1" | sed 's/_/__/g;s/\./_dot_/g;s/-/_dash_/g' +} + percentage=0 for dist in $DISTRIBUTIONS; do - distname=$(basename $dist .txz) - eval "status_$distname=7" + statusvar=$(dist_to_statusvar $dist) + eval "$statusvar=7" items="" for i in $DISTRIBUTIONS; do - items="$items $i `eval echo \\\${status_$(basename $i .txz):-Pending}`" + items="$items $i `eval echo \\\${$(dist_to_statusvar $i):-Pending}`" done dialog --backtitle "FreeBSD Installer" --title "Checksum Verification" \ --mixedgauge "Verifying checksums of selected distributions." \ @@ -54,13 +60,13 @@ for dist in $DISTRIBUTIONS; do CK_VALID=$? if [ $CK_VALID -le 1 ]; then if [ $CK_VALID -eq 0 ]; then - eval "status_$distname=2" + eval "$statusvar=2" else - eval "status_$distname=6" + eval "$statusvar=6" fi percentage=$(echo $percentage + 100/`echo $DISTRIBUTIONS | wc -w` | bc) else - eval "status_$distname=1" + eval "$statusvar=1" case $(/bin/freebsd-version -u) in *-ALPHA*|*-CURRENT|*-STABLE|*-PRERELEASE) dialog --backtitle "FreeBSD Installer" --title "Error" \ From nobody Wed Dec 13 22:29:02 2023 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 4Sr9BT0Fqjz54Q2c; Wed, 13 Dec 2023 22:29:05 +0000 (UTC) (envelope-from des@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sr9BS6rBGz3RyQ; Wed, 13 Dec 2023 22:29:04 +0000 (UTC) (envelope-from des@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702506545; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZrxwzH3uWTHWs9UAeuVZG7VP7qXPZ0QmLG6pJtdxS4I=; b=LIyWQaTe/kh9AFxn6lK0BD9iuIURydcoKMPlHYE8azKD2o7ThBidaaSHkxz0E/T23t2D5U CiaGs+X8EboFiYcWAHuMkP5DOhkPPn99vnFv+RY7cYEYNEYbleH/WgTnNDvn8JK5/92KMb hnkYZ19khDJzHj7dbpNiONbAFirZLkqEeMYW474l9CJLx1P8npnZlEQV5M5F1Xh/nHPIO0 zPXEb6UC9O5zTZMCp8+VLhiUuo/ZdW0aDpR7NABbEdkcYAmXLZ6q90cHjC01boGuMotOMj QmV3AvRCKopI+KvAsqIdKAcXMbsLmmJUXDmeUEGsgkWDDkrX0l/AIIn3sumsnQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702506545; a=rsa-sha256; cv=none; b=FPILBcyeQoHsgrw4Kd12SarQdwBmrlW2j84qOe+hzUr1eCLicZggsmwIc+gbROUeN5yoS8 hTqjh812QD8aRUK5uMjvvFyQ+pUPp2zCojnGEY7Fm5QAvKWgJLR27nskWwLwO4tliiXLdO 5Qy9usVyi6aoyuIf1xQFP5lDJqdDGrD/tDk20mnmAuPYChiQ68v0Rzsw7htBXXzsQvvW2J xeC5CYInp6Vt2TvyGOsES6IjWZZRrnY6FwnuES8vGVXjrO2Ky1vWnV9T/87GjyNgp2WVFD R0dTEZ2m7vowC5BmMRKEi++y3HlDRQTKyhgsmZt5EuYXtewaM7+bE9oViLXp3Q== 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=1702506545; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZrxwzH3uWTHWs9UAeuVZG7VP7qXPZ0QmLG6pJtdxS4I=; b=KovC8dH88JdPALleT9oTikkFWq0pSktCgUXXUYv/8JGfHdVaVnDQToTRpOZvjnap3XmDZq sMXjcVoKzg8WdkROeBkM4lsvkoUUn2zxDt1grD6g06ERLjmRXQjdEJNd2nuwVSPmLl0m4t ugIaFtxcDhemWCZ9gJl4j9a4fE57cNbkJxtZOMx8exeDPq3OBAF5lYIUTZ7UwrnffrGRL0 KWytQH7MTOsboWBEozHAHFPSWTSk0ESkxPyVFrl4XbPHRRUBwxGHPV2UD5O+OOTT3vwtZf +X3TqtuPg7iriK11+Ug4RCfzj1VAbvmS3e1tryp3RTkncnaOuAXVsg0HVX6G5A== Received: from ltc.des.no (48.115.65.81.rev.sfr.net [81.65.115.48]) (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) (Authenticated sender: des) by smtp.freebsd.org (Postfix) with ESMTPSA id 4Sr9BS56mLz1QTq; Wed, 13 Dec 2023 22:29:04 +0000 (UTC) (envelope-from des@freebsd.org) Received: by ltc.des.no (Postfix, from userid 1001) id 3F1023374B; Wed, 13 Dec 2023 23:29:02 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Xin LI Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-branches@freebsd.org Subject: Re: git: 585762c3733f - stable/13 - Improve usability of head(1) and tail(1): In-Reply-To: (Xin LI's message of "Wed, 13 Dec 2023 13:28:09 -0800") References: <202312132006.3BDK6VLv087438@gitrepo.freebsd.org> User-Agent: Gnus/5.13 (Gnus v5.13) Date: Wed, 13 Dec 2023 23:29:02 +0100 Message-ID: <86cyv9ybwx.fsf@ltc.des.no> 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Xin LI writes: > Thanks! (Somehow I missed the MFC notification...) MFC notifications have been broken for ages. I got a few in April but before that I haven't gotten one since 2019. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@FreeBSD.org From nobody Wed Dec 13 22:29:45 2023 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 4Sr9CG2DmXz54Q56; Wed, 13 Dec 2023 22:29:46 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sr9CG1Pbwz3SKJ; Wed, 13 Dec 2023 22:29:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702506586; 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=C1MuSrcdMo1GTe3+aYyrZc7cQcILEdpPGsvk4yWgaP8=; b=dTpgzTJaNXyT/bqoaJOz0STo7QkEkb9pvQedhvAwGkPBCRj7HRqCs7clesnhkTIPKhTwsp 09DyyPnq5UBhjhXnLb+BGD10OBSWipgozq1EYK7gdxKMD5saUO3It+TZZRyYP3/M9IaylR 0enOTttjL3avucO4Slvf4jBtM7cp81OrlIMl1G9LzQXBeBhKLI3v/5rXiJLrKlhCgwcSce NkvjJulHedGAkSowj0Ig7eke169UohlaRplBS09WY4FgMrS8r6mXOc/q0ePo3gKJrykbXZ VA6DJ8vS9ZbBWh7MjtGsfqjF+K5gLXDk1ly4Vb0eIOtb4zG7JxnNHju49VCL7w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702506586; a=rsa-sha256; cv=none; b=yz9YH+4jBtE4K6Wzp8TzTb96XaT1imv7oQMGFmKhRertt7Kv9e+ZjNESfVt2Teo+JyZOzm SatN461see0qQqdi4v4b82dIFGXrfDH1Cy43yPHZbh/qpRtlzQxZsu0cjt+2OHlbXeIzIu SogzHIIgOA4bk8BUuzIBt+gcvkCJw6obPYtICYUzNlniyi3A/8WWF25hQ5GJ/X7hhyJx5e i3h1ricPwgvxHlQOAbkfGSdrqPXSMvnqyriNvoLqzYkMhCA3QNk9BS5a1Tx6/Wt5Fx08u+ 2Ln1vlt6gjXsnyUGgJIfg4L6l+5LoZr3zoMaer1wsHf7YDdCuBS5hFXM5uRGoA== 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=1702506586; 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=C1MuSrcdMo1GTe3+aYyrZc7cQcILEdpPGsvk4yWgaP8=; b=sBbnrx5DwpCXjkj3TuMLKbUTOLLhp+BhSXnvKOWmIjLDKnS8QFaXX8K/2+JXzuQtGP2rWo ElYRVRZagv6+XH6kAXDISm9Rps/oIBo51m9btKGwKpel5fYEtimmNozRG6LnvR3JWxURGS nuM0QxPWfgW34JBDp016p7ty4fBW91DaF2KPPAPO4qQMXOVOYgYPo/hB1wEpuWToN2Xht1 6uWWss9kSVd83m5SIqOOYuleo3htqxbkFg/B4NjHA5CWqP7HDxP+EEpKec7VW+ybVxK8QM XxHRZN1uwE7l/M5onNpx8/L0pJcqZVpM+dyHXHgegNM0KhyGi9yygIvdBip8WQ== 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 4Sr9CG0GK9z1GGJ; Wed, 13 Dec 2023 22:29:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BDMTjFb024387; Wed, 13 Dec 2023 22:29:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BDMTjIL024384; Wed, 13 Dec 2023 22:29:45 GMT (envelope-from git) Date: Wed, 13 Dec 2023 22:29:45 GMT Message-Id: <202312132229.3BDMTjIL024384@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Brooks Davis Subject: git: 9a2bee998b38 - stable/14 - libc//sys/Makefile.inc: remove cruft 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9a2bee998b38b6cc2fc540ee50bb66d111904309 Auto-Submitted: auto-generated The branch stable/14 has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=9a2bee998b38b6cc2fc540ee50bb66d111904309 commit 9a2bee998b38b6cc2fc540ee50bb66d111904309 Author: Brooks Davis AuthorDate: 2023-11-15 17:50:53 +0000 Commit: Brooks Davis CommitDate: 2023-12-13 22:08:13 +0000 libc//sys/Makefile.inc: remove cruft Remove stray blank lines left over from $FreeBSD$ removal as well as some CVS-era (perhaps pre-repocopy) version comments. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D42611 (cherry picked from commit b73eace889f1db518a7b0b3372351e0cbf550085) --- lib/libc/aarch64/sys/Makefile.inc | 1 - lib/libc/amd64/sys/Makefile.inc | 2 -- lib/libc/arm/sys/Makefile.inc | 1 - lib/libc/i386/sys/Makefile.inc | 2 -- lib/libc/powerpc/sys/Makefile.inc | 1 - lib/libc/powerpc64/sys/Makefile.inc | 1 - lib/libc/powerpcspe/sys/Makefile.inc | 1 - lib/libc/riscv/sys/Makefile.inc | 1 - lib/libc/x86/sys/Makefile.inc | 1 - 9 files changed, 11 deletions(-) diff --git a/lib/libc/aarch64/sys/Makefile.inc b/lib/libc/aarch64/sys/Makefile.inc index eb8b600208b7..7cb0544a2997 100644 --- a/lib/libc/aarch64/sys/Makefile.inc +++ b/lib/libc/aarch64/sys/Makefile.inc @@ -1,4 +1,3 @@ - MIASM:= ${MIASM:Nfreebsd[467]_*} SRCS+= __vdso_gettc.c \ diff --git a/lib/libc/amd64/sys/Makefile.inc b/lib/libc/amd64/sys/Makefile.inc index 43af1d2a85a2..32c03ccf2963 100644 --- a/lib/libc/amd64/sys/Makefile.inc +++ b/lib/libc/amd64/sys/Makefile.inc @@ -1,5 +1,3 @@ -# from: Makefile.inc,v 1.1 1993/09/03 19:04:23 jtc Exp - SRCS+= \ amd64_get_fsbase.c \ amd64_get_gsbase.c \ diff --git a/lib/libc/arm/sys/Makefile.inc b/lib/libc/arm/sys/Makefile.inc index dcc1bdb3ea03..398ac494f2bc 100644 --- a/lib/libc/arm/sys/Makefile.inc +++ b/lib/libc/arm/sys/Makefile.inc @@ -1,4 +1,3 @@ - SRCS+= __vdso_gettc.c \ sched_getcpu_gen.c diff --git a/lib/libc/i386/sys/Makefile.inc b/lib/libc/i386/sys/Makefile.inc index f89099385dc9..accdc3367ac8 100644 --- a/lib/libc/i386/sys/Makefile.inc +++ b/lib/libc/i386/sys/Makefile.inc @@ -1,5 +1,3 @@ -# from: Makefile.inc,v 1.1 1993/09/03 19:04:23 jtc Exp - SRCS+= i386_get_fsbase.c i386_get_gsbase.c i386_get_ioperm.c i386_get_ldt.c \ i386_set_fsbase.c i386_set_gsbase.c i386_set_ioperm.c i386_set_ldt.c \ i386_clr_watch.c i386_set_watch.c i386_vm86.c diff --git a/lib/libc/powerpc/sys/Makefile.inc b/lib/libc/powerpc/sys/Makefile.inc index 17b7b3b26111..9979d5179f51 100644 --- a/lib/libc/powerpc/sys/Makefile.inc +++ b/lib/libc/powerpc/sys/Makefile.inc @@ -1,4 +1,3 @@ - SRCS+= __vdso_gettc.c \ sched_getcpu_gen.c diff --git a/lib/libc/powerpc64/sys/Makefile.inc b/lib/libc/powerpc64/sys/Makefile.inc index 17b7b3b26111..9979d5179f51 100644 --- a/lib/libc/powerpc64/sys/Makefile.inc +++ b/lib/libc/powerpc64/sys/Makefile.inc @@ -1,4 +1,3 @@ - SRCS+= __vdso_gettc.c \ sched_getcpu_gen.c diff --git a/lib/libc/powerpcspe/sys/Makefile.inc b/lib/libc/powerpcspe/sys/Makefile.inc index 8f48df0d6021..328c43d2b1ca 100644 --- a/lib/libc/powerpcspe/sys/Makefile.inc +++ b/lib/libc/powerpcspe/sys/Makefile.inc @@ -1,3 +1,2 @@ - .PATH: ${LIBC_SRCTOP}/powerpc/sys .sinclude "${LIBC_SRCTOP}/powerpc/sys/Makefile.inc" diff --git a/lib/libc/riscv/sys/Makefile.inc b/lib/libc/riscv/sys/Makefile.inc index e98d2ceeccad..f1cc8d489553 100644 --- a/lib/libc/riscv/sys/Makefile.inc +++ b/lib/libc/riscv/sys/Makefile.inc @@ -1,4 +1,3 @@ - SRCS+= __vdso_gettc.c \ sched_getcpu_gen.c diff --git a/lib/libc/x86/sys/Makefile.inc b/lib/libc/x86/sys/Makefile.inc index c06d18b06e3d..cbc28773ab79 100644 --- a/lib/libc/x86/sys/Makefile.inc +++ b/lib/libc/x86/sys/Makefile.inc @@ -1,4 +1,3 @@ - .PATH: ${LIBC_SRCTOP}/x86/sys SRCS+= \ From nobody Wed Dec 13 22:29:47 2023 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 4Sr9CH2VFYz54Q2k; Wed, 13 Dec 2023 22:29:47 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sr9CH1jm6z3SXP; Wed, 13 Dec 2023 22:29:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702506587; 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=R7WmLwN1rkvMY70gkAAfkcY9T86cNuzaKi8wup0Jr2Y=; b=adIETyyoYtnAMc47m0pSdFNLI8H9skNabgQI1LQkFT9+WUy4TweI8NDW3sazlGP+yjzViB 8CVKnFeZnrW7ApvwERHY9rnEv2Ygvp4O6iphaVOhAFJ+9Dnm75KklSNTgKCUfPDJgpPtg/ vuJhUkVzqSAe9GZ91YqqQDLA84g6QRQg/vD+efUZUiltG7Akl2iFDxyevhwEJp+mqcm78W d73Tl4QObXNb+Y6yi2LBdYlnLw2Fj9ae5ebU2KHRfketuUCI12xqAPJu71H+Kf+lOUYqso nExVlpe4wF4L8tdOMSn9MGNCzHqfxsqEkxYeKkKZULU0OQaCPYj8GN42fbhEzg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702506587; a=rsa-sha256; cv=none; b=oIHD+7A48jV0vcdz+vXS81otYbXL3kfa+jgc3mf3n5kiHRVnHD831CE6c37o5lGglHKf7q kAv1myrW9hqIQ8ZDhrq7nbjkcs9UwUVCjOPfDcnatxIN2uFZVpMhLYDfwrHc+3+LExIp9y 8gAdk9bDMXoSANgrZLQz5a0zfyP3enHOGZsJpxbFcuyvB/Ic8OiSiwss/sPqF1F0KRHj5E +mKim1FBnMLKNgQKN0+dDezhR7HDPpe+3xVLkq9w9xv7POlKHQnEHH4DVcTQg05ip26kZm mg4GhfLSjBgjqJY6WcmSr6Qy8mfkUiAWw+g0GAOjp/96MSxIEsun8YMXvUgnqw== 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=1702506587; 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=R7WmLwN1rkvMY70gkAAfkcY9T86cNuzaKi8wup0Jr2Y=; b=QFh/7vmyVxAVoa1CiYXvj1ASa6PPbgk2NLqWSGgYHvqJtsrQtPR5RmjZae81kNpF+MPn01 7Gr63wrpHFMRyVWduz+OlggtHCrMkH4VYiNn0x1MrXgg3Jkb3NAmp0R1F0VorJUAHXE4j6 hrf05P3NNypMjbBsXwwir1c8ERBZDhyr0cXukx8erlCq0B4IUZF+cbqF69/KRRR4XG9U/f RWBZ165TO+R1RgUMjIai+RTzpQ1nQSUUQEPRKxlvO8sT25EU5o27Mi7cErTcQcJp8m3pV2 TQa9miW6N1WdAN8XxAONNPZu2m1NEvwdFxYG2DGD8teZu+O0/mj6sBqyvF4FiQ== 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 4Sr9CH0jnnz1GD2; Wed, 13 Dec 2023 22:29:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BDMTlD7024432; Wed, 13 Dec 2023 22:29:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BDMTlx7024429; Wed, 13 Dec 2023 22:29:47 GMT (envelope-from git) Date: Wed, 13 Dec 2023 22:29:47 GMT Message-Id: <202312132229.3BDMTlx7024429@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Brooks Davis Subject: git: 695639d2f4e1 - stable/14 - libc: Remove empty comments in Symbol.map 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 695639d2f4e1d618ffa10cf44a91db6dddf0709f Auto-Submitted: auto-generated The branch stable/14 has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=695639d2f4e1d618ffa10cf44a91db6dddf0709f commit 695639d2f4e1d618ffa10cf44a91db6dddf0709f Author: Brooks Davis AuthorDate: 2023-11-15 17:51:03 +0000 Commit: Brooks Davis CommitDate: 2023-12-13 22:08:13 +0000 libc: Remove empty comments in Symbol.map These were left over from $FreeBSD$ removal. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D42612 (cherry picked from commit 1ca63a8219b88b752b064d19bd3428c61dbcf1f9) --- lib/libc/aarch64/Symbol.map | 3 --- lib/libc/amd64/Symbol.map | 3 --- lib/libc/arm/Symbol.map | 3 --- lib/libc/arm/aeabi/Symbol.map | 3 --- lib/libc/capability/Symbol.map | 3 --- lib/libc/compat-43/Symbol.map | 3 --- lib/libc/db/Symbol.map | 3 --- lib/libc/gdtoa/Symbol.map | 3 --- lib/libc/gen/Symbol.map | 3 --- lib/libc/gmon/Symbol.map | 3 --- lib/libc/i386/Symbol.map | 3 --- lib/libc/iconv/Symbol.map | 3 --- lib/libc/inet/Symbol.map | 3 --- lib/libc/locale/Symbol.map | 3 --- lib/libc/nameser/Symbol.map | 3 --- lib/libc/net/Symbol.map | 3 --- lib/libc/nls/Symbol.map | 3 --- lib/libc/posix1e/Symbol.map | 3 --- lib/libc/powerpc/Symbol.map | 3 --- lib/libc/powerpc64/Symbol.map | 3 --- lib/libc/quad/Symbol.map | 3 --- lib/libc/regex/Symbol.map | 3 --- lib/libc/resolv/Symbol.map | 3 --- lib/libc/riscv/Symbol.map | 3 --- lib/libc/rpc/Symbol.map | 3 --- lib/libc/secure/Symbol.map | 3 --- lib/libc/softfloat/Symbol.map | 3 --- lib/libc/stdio/Symbol.map | 3 --- lib/libc/stdlib/Symbol.map | 3 --- lib/libc/stdlib/malloc/Symbol.map | 3 --- lib/libc/stdtime/Symbol.map | 3 --- lib/libc/string/Symbol.map | 3 --- lib/libc/sys/Symbol.map | 3 --- lib/libc/uuid/Symbol.map | 3 --- lib/libc/xdr/Symbol.map | 3 --- lib/libc/yp/Symbol.map | 3 --- 36 files changed, 108 deletions(-) diff --git a/lib/libc/aarch64/Symbol.map b/lib/libc/aarch64/Symbol.map index 7f5b9ee9b56c..574b5e49d106 100644 --- a/lib/libc/aarch64/Symbol.map +++ b/lib/libc/aarch64/Symbol.map @@ -1,6 +1,3 @@ -/* - */ - /* * This only needs to contain symbols that are not listed in * symbol maps from other parts of libc (i.e., not found in diff --git a/lib/libc/amd64/Symbol.map b/lib/libc/amd64/Symbol.map index 39a913bd5e84..0bd3dabdb19e 100644 --- a/lib/libc/amd64/Symbol.map +++ b/lib/libc/amd64/Symbol.map @@ -1,6 +1,3 @@ -/* - */ - /* * This only needs to contain symbols that are not listed in * symbol maps from other parts of libc (i.e., not found in diff --git a/lib/libc/arm/Symbol.map b/lib/libc/arm/Symbol.map index 7b3d173d72ed..d91e681f4478 100644 --- a/lib/libc/arm/Symbol.map +++ b/lib/libc/arm/Symbol.map @@ -1,6 +1,3 @@ -/* - */ - /* * This only needs to contain symbols that are not listed in * symbol maps from other parts of libc (i.e., not found in diff --git a/lib/libc/arm/aeabi/Symbol.map b/lib/libc/arm/aeabi/Symbol.map index 823e4ad0d79d..175884c82881 100644 --- a/lib/libc/arm/aeabi/Symbol.map +++ b/lib/libc/arm/aeabi/Symbol.map @@ -1,6 +1,3 @@ -/* - */ - /* * This only needs to contain AEABI symbols that are not listed in * symbol maps from other parts of libc (i.e., not found in diff --git a/lib/libc/capability/Symbol.map b/lib/libc/capability/Symbol.map index 65e112348012..0deff024a046 100644 --- a/lib/libc/capability/Symbol.map +++ b/lib/libc/capability/Symbol.map @@ -1,6 +1,3 @@ -/* - */ - FBSD_1.3 { __cap_rights_clear; cap_rights_contains; diff --git a/lib/libc/compat-43/Symbol.map b/lib/libc/compat-43/Symbol.map index 588a693dabb7..b0ce99f4e416 100644 --- a/lib/libc/compat-43/Symbol.map +++ b/lib/libc/compat-43/Symbol.map @@ -1,6 +1,3 @@ -/* - */ - FBSD_1.0 { creat; gethostid; diff --git a/lib/libc/db/Symbol.map b/lib/libc/db/Symbol.map index cb00d6bd1290..2cca589af9f0 100644 --- a/lib/libc/db/Symbol.map +++ b/lib/libc/db/Symbol.map @@ -1,6 +1,3 @@ -/* - */ - FBSD_1.0 { dbopen; dbm_open; diff --git a/lib/libc/gdtoa/Symbol.map b/lib/libc/gdtoa/Symbol.map index a3cfd8df6819..55fe12e87c57 100644 --- a/lib/libc/gdtoa/Symbol.map +++ b/lib/libc/gdtoa/Symbol.map @@ -1,6 +1,3 @@ -/* - */ - FBSD_1.0 { /* * Standard functions from contrib/gdtoa diff --git a/lib/libc/gen/Symbol.map b/lib/libc/gen/Symbol.map index bdd659197644..1fa5478b7918 100644 --- a/lib/libc/gen/Symbol.map +++ b/lib/libc/gen/Symbol.map @@ -1,6 +1,3 @@ -/* - */ - FBSD_1.0 { __xuname; pthread_atfork; diff --git a/lib/libc/gmon/Symbol.map b/lib/libc/gmon/Symbol.map index 9d880afd8841..7fd880a1b898 100644 --- a/lib/libc/gmon/Symbol.map +++ b/lib/libc/gmon/Symbol.map @@ -1,6 +1,3 @@ -/* - */ - FBSD_1.0 { _mcleanup; monstartup; diff --git a/lib/libc/i386/Symbol.map b/lib/libc/i386/Symbol.map index 9d6ea7fff9f3..d09c98487f64 100644 --- a/lib/libc/i386/Symbol.map +++ b/lib/libc/i386/Symbol.map @@ -1,6 +1,3 @@ -/* - */ - /* * This only needs to contain symbols that are not listed in * symbol maps from other parts of libc (i.e., not found in diff --git a/lib/libc/iconv/Symbol.map b/lib/libc/iconv/Symbol.map index f883fe0d3e87..49dd63aca9da 100644 --- a/lib/libc/iconv/Symbol.map +++ b/lib/libc/iconv/Symbol.map @@ -1,6 +1,3 @@ -/* - */ - FBSD_1.3 { __bsd___iconv; __bsd___iconv_free_list; diff --git a/lib/libc/inet/Symbol.map b/lib/libc/inet/Symbol.map index e26556cd5fe4..11e22a1f6945 100644 --- a/lib/libc/inet/Symbol.map +++ b/lib/libc/inet/Symbol.map @@ -1,6 +1,3 @@ -/* - */ - FBSD_1.0 { __inet_addr; __inet_aton; diff --git a/lib/libc/locale/Symbol.map b/lib/libc/locale/Symbol.map index f29e6226855b..a38771e9c3fc 100644 --- a/lib/libc/locale/Symbol.map +++ b/lib/libc/locale/Symbol.map @@ -1,6 +1,3 @@ -/* - */ - FBSD_1.0 { btowc; digittoint; diff --git a/lib/libc/nameser/Symbol.map b/lib/libc/nameser/Symbol.map index db66ed0951ec..0d328cb0f23c 100644 --- a/lib/libc/nameser/Symbol.map +++ b/lib/libc/nameser/Symbol.map @@ -1,6 +1,3 @@ -/* - */ - FBSD_1.0 { __ns_makecanon; __ns_msg_getflag; diff --git a/lib/libc/net/Symbol.map b/lib/libc/net/Symbol.map index b2ecd4f08735..fa76adce06a1 100644 --- a/lib/libc/net/Symbol.map +++ b/lib/libc/net/Symbol.map @@ -1,6 +1,3 @@ -/* - */ - FBSD_1.0 { __b64_ntop; __b64_pton; diff --git a/lib/libc/nls/Symbol.map b/lib/libc/nls/Symbol.map index d8ee248d60f0..0703131b8415 100644 --- a/lib/libc/nls/Symbol.map +++ b/lib/libc/nls/Symbol.map @@ -1,6 +1,3 @@ -/* - */ - FBSD_1.0 { catopen; catgets; diff --git a/lib/libc/posix1e/Symbol.map b/lib/libc/posix1e/Symbol.map index 87e18493d1ec..92a0bf85cfa2 100644 --- a/lib/libc/posix1e/Symbol.map +++ b/lib/libc/posix1e/Symbol.map @@ -1,6 +1,3 @@ -/* - */ - FBSD_1.0 { acl_calc_mask; acl_copy_entry; diff --git a/lib/libc/powerpc/Symbol.map b/lib/libc/powerpc/Symbol.map index fb82bcdb27f0..ff99e09028db 100644 --- a/lib/libc/powerpc/Symbol.map +++ b/lib/libc/powerpc/Symbol.map @@ -1,6 +1,3 @@ -/* - */ - /* * This only needs to contain symbols that are not listed in * symbol maps from other parts of libc (i.e., not found in diff --git a/lib/libc/powerpc64/Symbol.map b/lib/libc/powerpc64/Symbol.map index 7d010fda6693..bad72c5a6efc 100644 --- a/lib/libc/powerpc64/Symbol.map +++ b/lib/libc/powerpc64/Symbol.map @@ -1,6 +1,3 @@ -/* - */ - /* * This only needs to contain symbols that are not listed in * symbol maps from other parts of libc (i.e., not found in diff --git a/lib/libc/quad/Symbol.map b/lib/libc/quad/Symbol.map index 2752be26abb4..86fc2ee9c334 100644 --- a/lib/libc/quad/Symbol.map +++ b/lib/libc/quad/Symbol.map @@ -1,6 +1,3 @@ -/* - */ - FBSD_1.0 { /* * These symbols really shouldn't be exported since they should diff --git a/lib/libc/regex/Symbol.map b/lib/libc/regex/Symbol.map index 3b9072571740..436398f639c7 100644 --- a/lib/libc/regex/Symbol.map +++ b/lib/libc/regex/Symbol.map @@ -1,6 +1,3 @@ -/* - */ - FBSD_1.0 { regerror; regexec; diff --git a/lib/libc/resolv/Symbol.map b/lib/libc/resolv/Symbol.map index c93d8bea6f15..6b9c43298fb5 100644 --- a/lib/libc/resolv/Symbol.map +++ b/lib/libc/resolv/Symbol.map @@ -1,6 +1,3 @@ -/* - */ - FBSD_1.0 { /* h_nerr; */ /* Why is this not staticized in net/herror.c? */ h_errlist; diff --git a/lib/libc/riscv/Symbol.map b/lib/libc/riscv/Symbol.map index c19f7ddf631e..6726863e9b97 100644 --- a/lib/libc/riscv/Symbol.map +++ b/lib/libc/riscv/Symbol.map @@ -1,6 +1,3 @@ -/* - */ - /* * This only needs to contain symbols that are not listed in * symbol maps from other parts of libc (i.e., not found in diff --git a/lib/libc/rpc/Symbol.map b/lib/libc/rpc/Symbol.map index 89b434ce67db..5bf364f28d81 100644 --- a/lib/libc/rpc/Symbol.map +++ b/lib/libc/rpc/Symbol.map @@ -1,6 +1,3 @@ -/* - */ - FBSD_1.0 { /* From crypt_clnt.c (generated by rpcgen - include/rpcsvc/crypt.x) */ des_crypt_1; diff --git a/lib/libc/secure/Symbol.map b/lib/libc/secure/Symbol.map index 4f9f34844131..641f451b5421 100644 --- a/lib/libc/secure/Symbol.map +++ b/lib/libc/secure/Symbol.map @@ -1,6 +1,3 @@ -/* - */ - FBSD_1.0 { __chk_fail; __stack_chk_fail; diff --git a/lib/libc/softfloat/Symbol.map b/lib/libc/softfloat/Symbol.map index ee6d1b0eac52..9c5229a18066 100644 --- a/lib/libc/softfloat/Symbol.map +++ b/lib/libc/softfloat/Symbol.map @@ -1,6 +1,3 @@ -/* - */ - FBSD_1.0 { _fpgetmask; fpgetmask; diff --git a/lib/libc/stdio/Symbol.map b/lib/libc/stdio/Symbol.map index 575dc3cd923c..f5e74eeddfd4 100644 --- a/lib/libc/stdio/Symbol.map +++ b/lib/libc/stdio/Symbol.map @@ -1,6 +1,3 @@ -/* - */ - FBSD_1.0 { flockfile; ftrylockfile; diff --git a/lib/libc/stdlib/Symbol.map b/lib/libc/stdlib/Symbol.map index e10789ceab1a..d74df869cf54 100644 --- a/lib/libc/stdlib/Symbol.map +++ b/lib/libc/stdlib/Symbol.map @@ -1,6 +1,3 @@ -/* - */ - FBSD_1.0 { _Exit; a64l; diff --git a/lib/libc/stdlib/malloc/Symbol.map b/lib/libc/stdlib/malloc/Symbol.map index 4356337d1c37..15e4f9e6c69c 100644 --- a/lib/libc/stdlib/malloc/Symbol.map +++ b/lib/libc/stdlib/malloc/Symbol.map @@ -1,6 +1,3 @@ -/* - */ - FBSD_1.0 { _malloc_options; _malloc_message; diff --git a/lib/libc/stdtime/Symbol.map b/lib/libc/stdtime/Symbol.map index acdd3bbb89b4..0dca02903a1a 100644 --- a/lib/libc/stdtime/Symbol.map +++ b/lib/libc/stdtime/Symbol.map @@ -1,6 +1,3 @@ -/* - */ - FBSD_1.0 { _time32_to_time; _time_to_time32; diff --git a/lib/libc/string/Symbol.map b/lib/libc/string/Symbol.map index ec4778ff3c24..fd854d1f9479 100644 --- a/lib/libc/string/Symbol.map +++ b/lib/libc/string/Symbol.map @@ -1,6 +1,3 @@ -/* - */ - FBSD_1.0 { bcmp; bcopy; diff --git a/lib/libc/sys/Symbol.map b/lib/libc/sys/Symbol.map index 7937661e3787..05a2f21d554e 100644 --- a/lib/libc/sys/Symbol.map +++ b/lib/libc/sys/Symbol.map @@ -1,6 +1,3 @@ -/* - */ - /* * It'd be nice to automatically generate the syscall symbols, but we * don't know to what version they will eventually belong to, so for now diff --git a/lib/libc/uuid/Symbol.map b/lib/libc/uuid/Symbol.map index 49fb239913d2..e1e587199a92 100644 --- a/lib/libc/uuid/Symbol.map +++ b/lib/libc/uuid/Symbol.map @@ -1,6 +1,3 @@ -/* - */ - FBSD_1.0 { uuid_to_string; uuid_is_nil; diff --git a/lib/libc/xdr/Symbol.map b/lib/libc/xdr/Symbol.map index 1ee5afda2425..0a964fecdbdb 100644 --- a/lib/libc/xdr/Symbol.map +++ b/lib/libc/xdr/Symbol.map @@ -1,6 +1,3 @@ -/* - */ - FBSD_1.0 { xdr_free; xdr_void; diff --git a/lib/libc/yp/Symbol.map b/lib/libc/yp/Symbol.map index ecd17af4a29a..fff2b2e60e39 100644 --- a/lib/libc/yp/Symbol.map +++ b/lib/libc/yp/Symbol.map @@ -1,6 +1,3 @@ -/* - */ - FBSD_1.0 { xdr_datum; xdr_ypresp_all_seq; From nobody Wed Dec 13 22:29:48 2023 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 4Sr9CJ3pV8z54Q7W; Wed, 13 Dec 2023 22:29:48 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sr9CJ2wNlz3SQs; Wed, 13 Dec 2023 22:29:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702506588; 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=kxgieUQAWasFS/cl2Lf2aDQ0Y5l18wJlUpKfBa2UibI=; b=h0CqffmaCZHvHZD9vvUcg6N6qZ3jOXDuS/3b5ZU/SDMWMc+2IUwym3k6w+PGWMPO4YsGZi 4uIBZZy1Ask9n/1LcraJ1H0Wj7/SDDlzqSOJY9a4wrYl78EZYst75kt/bzKRXfNYeZ6Ze6 UZpnsUltu4Gz5SiLaQZVYYNF8c2W/U0o4w/dpIYiCwzrikjiFdF64Frw+pYHdYC9pSozhF H0TMn2Fa8n6V6s1a1dXIZKJ05QgKbayXf+ZhRhCFrjP/MBIAmqUwTxrGBKHIMviyfjb3rN l71EJxqu8FAy/YNZ/CyCiX+94ryKy7vi+cDwglh4C6MOEseD9mkJZnpNGOVvug== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702506588; a=rsa-sha256; cv=none; b=VzTHHJKlXNyUyHBlU3T8C+96Lq+baglatCeYDzbTlblN8mbCDs77dINwahmYuvSfvSydMs 7sreniQ3076n+/fzXYBXoWTlM7hI6GGbgBEML7IbdNawllzhqRPSzpyTTQWOWcBLa8KVfp jEshQoKsrq9efCfuS84j0V88Yy/Twdy8UEIpL9hitRPCws1xTMXMdZxFM3AGCKXwkW0c8e ds2ikgEQoZVSDedXo8zGts7RBj/k22HA1YXn9TQdBxR5RBWHs7tXQZRtNcyisQ3KotqHHv xxJ3rnvXDfqSi7Afr8rCLYIl094aWguqB35+pUGkmVJ5b+fzrsD4OwWU46LVVA== 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=1702506588; 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=kxgieUQAWasFS/cl2Lf2aDQ0Y5l18wJlUpKfBa2UibI=; b=pe5Vb2qGzUT+DT1Zeu9paz1PSXIRaYzn/G+GhouW/lxIiUfko/33Qut7Ia+tWSwT2PG6Hr Sv5T+f6utoy5ohbyBu+Wgze1pIjWIIVwDd1+q0f7IwI1CcPyPqpW75fScHRrYCvt1o9o/S eSfEU5MBQyJ7m7QjWv+sKr6PMlIF9sKtLxSmm/kQMbBFc+PHIcO+Jk7e1i5j2yqYz84bVk E0CJztlZhnrHpEnpgJvI9rgzZjr0qN+iGB091JPDW8cjTw0ku1Zqkev3xSNpbI99eFBI24 l2ck0Wj38V6o88RoaFlqtArAdQUtJaPG/QLI2xYwQLWVn29bEVoi3KvDnNLq/Q== 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 4Sr9CJ1l0pz1Fvs; Wed, 13 Dec 2023 22:29:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BDMTmsX024480; Wed, 13 Dec 2023 22:29:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BDMTmYi024477; Wed, 13 Dec 2023 22:29:48 GMT (envelope-from git) Date: Wed, 13 Dec 2023 22:29:48 GMT Message-Id: <202312132229.3BDMTmYi024477@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Brooks Davis Subject: git: e0f6b29f6a6c - stable/14 - lib{c,lzma,z}: remove -DSYMBOL_VERSIONING from CFLAGS 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e0f6b29f6a6cb38b46318818db60ff5e7bfbb2c1 Auto-Submitted: auto-generated The branch stable/14 has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=e0f6b29f6a6cb38b46318818db60ff5e7bfbb2c1 commit e0f6b29f6a6cb38b46318818db60ff5e7bfbb2c1 Author: Brooks Davis AuthorDate: 2023-11-15 23:39:46 +0000 Commit: Brooks Davis CommitDate: 2023-12-13 22:08:13 +0000 lib{c,lzma,z}: remove -DSYMBOL_VERSIONING from CFLAGS This was part of a libkse and libpthread transition aide when libc gained symbol versions in e62165c8b0f7d6452c0033127a0fd8ad1d9e34d3 (March 2006). The code that cared about this macro was removed in commit 00fb440c1a145b56b6c75fd405d80071aef2aab1 (May 2007) when symbol versioning was enabled by default and libthr became the default threading library. For unknown reasons, it stayed in libc (which seemingly never used it) and seems to have been copied to liblzma and libz. Reviewed by: imp, kib, emaste Differential Revision: https://reviews.freebsd.org/D42613 (cherry picked from commit e3e9c205ff54aac287309e03a808d9e9ec5c49eb) --- lib/libc/Makefile | 1 - lib/liblzma/Makefile | 1 - lib/libz/Makefile | 1 - 3 files changed, 3 deletions(-) diff --git a/lib/libc/Makefile b/lib/libc/Makefile index 7540eb8c21ad..fbfd6619784d 100644 --- a/lib/libc/Makefile +++ b/lib/libc/Makefile @@ -151,7 +151,6 @@ STATICOBJS+=${LIBC_NONSHARED_SRCS:S/.c$/.o/} VERSION_DEF=${LIBC_SRCTOP}/Versions.def SYMBOL_MAPS=${SYM_MAPS} -CFLAGS+= -DSYMBOL_VERSIONING # If there are no machine dependent sources, append all the # machine-independent sources: diff --git a/lib/liblzma/Makefile b/lib/liblzma/Makefile index 9e228d277896..85e7b87bbbf0 100644 --- a/lib/liblzma/Makefile +++ b/lib/liblzma/Makefile @@ -156,7 +156,6 @@ LIBADD+= md pthread VERSION_DEF= ${.CURDIR}/Versions.def SYMBOL_MAPS= ${.CURDIR}/Symbol.map -CFLAGS+= -DSYMBOL_VERSIONING CLEANFILES+= liblzma.pc diff --git a/lib/libz/Makefile b/lib/libz/Makefile index 7dd1204c5435..6a135158e134 100644 --- a/lib/libz/Makefile +++ b/lib/libz/Makefile @@ -51,7 +51,6 @@ CFLAGS+= -DUNALIGNED_OK VERSION_DEF= ${.CURDIR}/Versions.def SYMBOL_MAPS= ${.CURDIR}/Symbol.map -CFLAGS+= -DSYMBOL_VERSIONING INCS= zconf.h zlib.h From nobody Wed Dec 13 22:29:49 2023 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 4Sr9CK4030z54PrZ; Wed, 13 Dec 2023 22:29:49 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sr9CK3VM9z3ST9; Wed, 13 Dec 2023 22:29:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702506589; 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=U4G5i+9MP722Y0fh+XnFzGk/pJBquICdhIg5DYlPJ5g=; b=WBMUybONabzRC70N5QE7gG9t/DNKmuyKsuLMRZrWYAZzjS54yoGvnam3n5EtPxTQrH0UIx 4Ak3mK3hsdO0M8gpJkETrziRAfMUFbhiZZ/5Lgf5gImbk17u2A/oaAagEssNdSse0WWfJI cinZB9r/TqjJAQ75WxSvCGty3f38i/iQ2xc8tm9T3h8tBIy0XOPWhKEGk3NNus0/x8qMvU E2B+sEuK+xxg/kmrBi36VXPLclT8TgHa7pEjlLSHlGmYRVbAv27Z1mhzOzsxRf7sZkT0Pc xLKlD66C6/v0SjvS+/pCzofdhJrrxhf2LkirRj0OSnehv8XLFjUVYVdt0L5SjA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702506589; a=rsa-sha256; cv=none; b=H7UPrp9ZtZB1lMVaceEiHhfbOH7xpIhlFt8jQdhmoAQBm+CKayEVF3RXCmhHYWBOSlgNRr yAUL9SRgF9pxcA9fX+vdLMt6PxxN4vifiDfC+Yd+EKCGi+XCBagXP5UZnPMEAGY0iZigpp J/ucag4Ol3a/qJi4VjqMYKMYHAmw2k/OlrCH5OjAP1w803c/TuYzxNxVpivDrYpZPLmOdy EJd4o8/+NfuWzhhWgK0vKoh3W0opoFd8rqxT/lO+ns2As6tUV7OR9FJndFCYSE+sRqFByP e2/Uer2LQBW49uuIgdPmLqndG/rqEvoBfV1b7PCJGqITshf+cdRyC3piIEB6tw== 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=1702506589; 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=U4G5i+9MP722Y0fh+XnFzGk/pJBquICdhIg5DYlPJ5g=; b=ulRHpW7JYynvxCh+hR70XqiBZpGOvsXLu/Moo8N6UStdhb9uJ14XpMgo8S0yMMHNkjNNNv CITIZJbJvQRnmbuMkk+VUJLT3b2OZgZHq76ADBTNq2lBtS9mKoiohoh6QxHlRVrqY2UQTB /+DU3ZhVbN02F0lmh2kwwoCL2mjegbhc1pA7Wf3mZdlp6KVLh17YaFOSbqtYwxhAsxDbkv Dgsu7JC3rCgCKcPydAtmzqRPjHCcevXR8Lt+TGyUBhrbkT7r25SFziFodCkZ5d9dhnVjH1 ZQfos+3FVbwMPSO8e8/IzqVGpFRtmQJrh0jQuHGJzPos4h6Qjjdhy9k84v4UmA== 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 4Sr9CK2VzQz1Gd6; Wed, 13 Dec 2023 22:29:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BDMTnLx024524; Wed, 13 Dec 2023 22:29:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BDMTnN6024521; Wed, 13 Dec 2023 22:29:49 GMT (envelope-from git) Date: Wed, 13 Dec 2023 22:29:49 GMT Message-Id: <202312132229.3BDMTnN6024521@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Brooks Davis Subject: git: e1508337641a - stable/14 - libc: further centralize syscall symbols 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e1508337641ac21ac71e92681edf4f156039c769 Auto-Submitted: auto-generated The branch stable/14 has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=e1508337641ac21ac71e92681edf4f156039c769 commit e1508337641ac21ac71e92681edf4f156039c769 Author: Brooks Davis AuthorDate: 2023-11-15 23:40:33 +0000 Commit: Brooks Davis CommitDate: 2023-12-13 22:08:13 +0000 libc: further centralize syscall symbols All architectures necessarily implement _exit(2) and vfork(2) so declare them in sys/Symbol.map. Reviewed by: imp, kib, emaste Differential Revision: https://reviews.freebsd.org/D42614 (cherry picked from commit e4a1800f06884dc00931f55d0fa8cd9ce473a83e) --- lib/libc/aarch64/Symbol.map | 4 ---- lib/libc/amd64/Symbol.map | 4 ---- lib/libc/arm/Symbol.map | 4 ---- lib/libc/i386/Symbol.map | 4 ---- lib/libc/powerpc/Symbol.map | 4 ---- lib/libc/powerpc64/Symbol.map | 4 ---- lib/libc/riscv/Symbol.map | 4 ---- lib/libc/sys/Symbol.map | 2 ++ 8 files changed, 2 insertions(+), 28 deletions(-) diff --git a/lib/libc/aarch64/Symbol.map b/lib/libc/aarch64/Symbol.map index 574b5e49d106..5e71a32786b4 100644 --- a/lib/libc/aarch64/Symbol.map +++ b/lib/libc/aarch64/Symbol.map @@ -4,9 +4,6 @@ * stdlib/Symbol.map, string/Symbol.map, sys/Symbol.map, ...). */ FBSD_1.0 { - /* PSEUDO syscalls */ - _exit; - .mcount; _setjmp; _longjmp; @@ -24,7 +21,6 @@ FBSD_1.0 { htons; ntohl; ntohs; - vfork; makecontext; }; diff --git a/lib/libc/amd64/Symbol.map b/lib/libc/amd64/Symbol.map index 0bd3dabdb19e..445220db11b7 100644 --- a/lib/libc/amd64/Symbol.map +++ b/lib/libc/amd64/Symbol.map @@ -4,9 +4,6 @@ * stdlib/Symbol.map, string/Symbol.map, sys/Symbol.map, ...). */ FBSD_1.0 { - /* PSEUDO syscalls */ - _exit; - .mcount; _setjmp; _longjmp; @@ -37,7 +34,6 @@ FBSD_1.0 { amd64_set_gsbase; brk; sbrk; - vfork; }; FBSD_1.6 { diff --git a/lib/libc/arm/Symbol.map b/lib/libc/arm/Symbol.map index d91e681f4478..8cb5cbe232d8 100644 --- a/lib/libc/arm/Symbol.map +++ b/lib/libc/arm/Symbol.map @@ -4,9 +4,6 @@ * stdlib/Symbol.map, string/Symbol.map, sys/Symbol.map, ...). */ FBSD_1.0 { - /* PSEUDO syscalls */ - _exit; - __mcount; _setjmp; _longjmp; @@ -23,7 +20,6 @@ FBSD_1.0 { htons; ntohl; ntohs; - vfork; brk; sbrk; }; diff --git a/lib/libc/i386/Symbol.map b/lib/libc/i386/Symbol.map index d09c98487f64..1ecfb4ecda00 100644 --- a/lib/libc/i386/Symbol.map +++ b/lib/libc/i386/Symbol.map @@ -4,9 +4,6 @@ * stdlib/Symbol.map, string/Symbol.map, sys/Symbol.map, ...). */ FBSD_1.0 { - /* PSEUDO syscalls */ - _exit; - .mcount; _setjmp; _longjmp; @@ -25,7 +22,6 @@ FBSD_1.0 { htons; ntohl; ntohs; - vfork; brk; i386_clr_watch; i386_get_fsbase; diff --git a/lib/libc/powerpc/Symbol.map b/lib/libc/powerpc/Symbol.map index ff99e09028db..2d883a02eeb9 100644 --- a/lib/libc/powerpc/Symbol.map +++ b/lib/libc/powerpc/Symbol.map @@ -4,9 +4,6 @@ * stdlib/Symbol.map, string/Symbol.map, sys/Symbol.map, ...). */ FBSD_1.0 { - /* PSEUDO syscalls */ - _exit; - _mcount; _setjmp; _longjmp; @@ -30,7 +27,6 @@ FBSD_1.0 { ntohs; brk; sbrk; - vfork; }; FBSD_1.3 { diff --git a/lib/libc/powerpc64/Symbol.map b/lib/libc/powerpc64/Symbol.map index bad72c5a6efc..2de7ffb241e7 100644 --- a/lib/libc/powerpc64/Symbol.map +++ b/lib/libc/powerpc64/Symbol.map @@ -4,9 +4,6 @@ * stdlib/Symbol.map, string/Symbol.map, sys/Symbol.map, ...). */ FBSD_1.0 { - /* PSEUDO syscalls */ - _exit; - _mcount; _setjmp; _longjmp; @@ -30,7 +27,6 @@ FBSD_1.0 { ntohs; brk; sbrk; - vfork; }; FBSDprivate_1.0 { diff --git a/lib/libc/riscv/Symbol.map b/lib/libc/riscv/Symbol.map index 6726863e9b97..359a8238fb32 100644 --- a/lib/libc/riscv/Symbol.map +++ b/lib/libc/riscv/Symbol.map @@ -4,9 +4,6 @@ * stdlib/Symbol.map, string/Symbol.map, sys/Symbol.map, ...). */ FBSD_1.0 { - /* PSEUDO syscalls */ - _exit; - _setjmp; _longjmp; fabs; @@ -23,7 +20,6 @@ FBSD_1.0 { htons; ntohl; ntohs; - vfork; makecontext; }; diff --git a/lib/libc/sys/Symbol.map b/lib/libc/sys/Symbol.map index 05a2f21d554e..b59ec1858ffd 100644 --- a/lib/libc/sys/Symbol.map +++ b/lib/libc/sys/Symbol.map @@ -30,6 +30,7 @@ FBSD_1.0 { __setugid; __syscall; __sysctl; + _exit; _umtx_op; abort2; accept; @@ -283,6 +284,7 @@ FBSD_1.0 { utrace; uuidgen; vadvise; + vfork; wait4; write; writev; From nobody Wed Dec 13 22:29:50 2023 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 4Sr9CL6TJsz54QB1; Wed, 13 Dec 2023 22:29:50 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sr9CL4b0nz3Shm; Wed, 13 Dec 2023 22:29:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702506590; 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=og9o7Af6dexrmz2c9HzdFAEedjfDYP9RKqgbQaqeeiw=; b=SFJkS7gSOXZqOHQRTY0aRu9kMgyVwlGR/4kVXY/w3mPzm38+zlTWeWj7Vj2JkLiW7OLpAt X40cU4eo4fNjlW4aC8+dkQ1DSIKrG04FR8AfSpw1P1Tr55MsuRx00FtSRV2DgFVOxKyStx ZOQVe483j584vLq3rznTtnwSRlnfBLcylYNsEN3wgAPu3RdM+dHwFPPslYLkxhLjHanJtP g59pc3KU+EWtzgO4iF6yNmhjnssjNxjfRK0dmk4HIzwAEVNd+qOKVktz0QjY+TcKxhWkfa CptAulQZcEHKrpVv+NG0l2PisPT06GyyMCuceU8zosBbJccfpg7bmtpUYKJRhg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702506590; a=rsa-sha256; cv=none; b=GiVGJWPtX5BhWjDrDrY62gRYSTngZTbaRVUKpRSWN8PhB8aTLL0PuzVLgwfoV4eb35KWHS /cWQYBzGPoeJdj1GVYTzBrHq8AEFp02s8MxvqewbBlHu4fqxyeB6sKSAZbbTtHIr+gjnUP 2YpmKuXpM/G4hTW3Fn5TrRUp7kDEH0OcDUSfP9lnDJRFaw5SX8oc2tZ2wT3xW0ZDRODNq8 QUjkU5319oSWg0wOPZpmtoA4sjCOd+Fmi79FE0onfGM0gf5U0d6gZrdjwWAaB38Pc4o6UY IdCbW32sWnDm7LuXRu9edIVp7hSZk/+vA6qUL0huSpgVpUpAJ5VH7U47dC4dgw== 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=1702506590; 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=og9o7Af6dexrmz2c9HzdFAEedjfDYP9RKqgbQaqeeiw=; b=S4wBdy0MhdnoZ58whVVaApUrwclNqnCLHp4l4EMpNOaW06Z3I5J4Grv24wfrk4dmF4A21H ext4PmVdbVV3IdFEU7x9viDTVcwyFDYYaU+UJLqDiXIKEovcypd99UNCktkiv/nJd1oLAR 0Lh219bW9oW+eZ9xp+hqLPwC6zVRfKHfRFplAbzCV1u80F2Aq0b2375nie0PsGx2nF8Ha1 4Ak6lWV9jnf7MrwtrUlAHtSRDQPM2AuqrCQot8C+Ve6gk7TCi+7WeYRxR7oYxINXiACLVz F4Y/nr/sGUTC9SJ96dg8JngE2iYvz7jn3Uox2YYYJhrn5rlCPtNxsipzdtB5hw== 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 4Sr9CL3hnZz1G9C; Wed, 13 Dec 2023 22:29:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BDMToKh024563; Wed, 13 Dec 2023 22:29:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BDMTo58024560; Wed, 13 Dec 2023 22:29:50 GMT (envelope-from git) Date: Wed, 13 Dec 2023 22:29:50 GMT Message-Id: <202312132229.3BDMTo58024560@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Brooks Davis Subject: git: 9d67dced8385 - stable/14 - libc: centralize ntoh symbols 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9d67dced83851c6b509426ba6f3d9dde5583ce06 Auto-Submitted: auto-generated The branch stable/14 has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=9d67dced83851c6b509426ba6f3d9dde5583ce06 commit 9d67dced83851c6b509426ba6f3d9dde5583ce06 Author: Brooks Davis AuthorDate: 2023-11-15 23:40:54 +0000 Commit: Brooks Davis CommitDate: 2023-12-13 22:08:14 +0000 libc: centralize ntoh symbols These are implemented by net/ntoh.c via headers and compiler intrinsics so declare them in net/Symbol.map. Reviewed by: imp, kib, emaste Differential Revision: https://reviews.freebsd.org/D42615 (cherry picked from commit ff3a9d8e2909692c73ce9f9279cac2f15848b3f4) --- lib/libc/aarch64/Symbol.map | 4 ---- lib/libc/amd64/Symbol.map | 4 ---- lib/libc/arm/Symbol.map | 4 ---- lib/libc/i386/Symbol.map | 4 ---- lib/libc/net/Symbol.map | 4 ++++ lib/libc/powerpc/Symbol.map | 4 ---- lib/libc/powerpc64/Symbol.map | 4 ---- lib/libc/riscv/Symbol.map | 4 ---- 8 files changed, 4 insertions(+), 28 deletions(-) diff --git a/lib/libc/aarch64/Symbol.map b/lib/libc/aarch64/Symbol.map index 5e71a32786b4..691c77f345b9 100644 --- a/lib/libc/aarch64/Symbol.map +++ b/lib/libc/aarch64/Symbol.map @@ -17,10 +17,6 @@ FBSD_1.0 { longjmp; sigsetjmp; siglongjmp; - htonl; - htons; - ntohl; - ntohs; makecontext; }; diff --git a/lib/libc/amd64/Symbol.map b/lib/libc/amd64/Symbol.map index 445220db11b7..3ceb1cd9682a 100644 --- a/lib/libc/amd64/Symbol.map +++ b/lib/libc/amd64/Symbol.map @@ -24,10 +24,6 @@ FBSD_1.0 { longjmp; sigsetjmp; siglongjmp; - htonl; - htons; - ntohl; - ntohs; amd64_get_fsbase; amd64_get_gsbase; amd64_set_fsbase; diff --git a/lib/libc/arm/Symbol.map b/lib/libc/arm/Symbol.map index 8cb5cbe232d8..5a7aec7c4089 100644 --- a/lib/libc/arm/Symbol.map +++ b/lib/libc/arm/Symbol.map @@ -16,10 +16,6 @@ FBSD_1.0 { longjmp; sigsetjmp; siglongjmp; - htonl; - htons; - ntohl; - ntohs; brk; sbrk; }; diff --git a/lib/libc/i386/Symbol.map b/lib/libc/i386/Symbol.map index 1ecfb4ecda00..f2424a9b64c4 100644 --- a/lib/libc/i386/Symbol.map +++ b/lib/libc/i386/Symbol.map @@ -18,10 +18,6 @@ FBSD_1.0 { longjmp; sigsetjmp; siglongjmp; - htonl; - htons; - ntohl; - ntohs; brk; i386_clr_watch; i386_get_fsbase; diff --git a/lib/libc/net/Symbol.map b/lib/libc/net/Symbol.map index fa76adce06a1..4831868c0e55 100644 --- a/lib/libc/net/Symbol.map +++ b/lib/libc/net/Symbol.map @@ -64,6 +64,10 @@ FBSD_1.0 { hes_resolve; hes_error; hes_free; + htonl; + htons; + ntohl; + ntohs; if_indextoname; if_nameindex; if_freenameindex; diff --git a/lib/libc/powerpc/Symbol.map b/lib/libc/powerpc/Symbol.map index 2d883a02eeb9..ed5dd5884736 100644 --- a/lib/libc/powerpc/Symbol.map +++ b/lib/libc/powerpc/Symbol.map @@ -21,10 +21,6 @@ FBSD_1.0 { longjmp; sigsetjmp; siglongjmp; - htonl; - htons; - ntohl; - ntohs; brk; sbrk; }; diff --git a/lib/libc/powerpc64/Symbol.map b/lib/libc/powerpc64/Symbol.map index 2de7ffb241e7..dabf6f4434c5 100644 --- a/lib/libc/powerpc64/Symbol.map +++ b/lib/libc/powerpc64/Symbol.map @@ -21,10 +21,6 @@ FBSD_1.0 { longjmp; sigsetjmp; siglongjmp; - htonl; - htons; - ntohl; - ntohs; brk; sbrk; }; diff --git a/lib/libc/riscv/Symbol.map b/lib/libc/riscv/Symbol.map index 359a8238fb32..8067ddca10cd 100644 --- a/lib/libc/riscv/Symbol.map +++ b/lib/libc/riscv/Symbol.map @@ -16,10 +16,6 @@ FBSD_1.0 { longjmp; sigsetjmp; siglongjmp; - htonl; - htons; - ntohl; - ntohs; makecontext; }; From nobody Wed Dec 13 22:29:51 2023 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 4Sr9CN0Twyz54Q7f; Wed, 13 Dec 2023 22:29:52 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sr9CM5ny9z3SlW; Wed, 13 Dec 2023 22:29:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702506591; 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=7DjAkIATcE8BVxihd9OIUcJxoI7TOR+cNLSalnhF5Vo=; b=Cn9m64Jw+28wojkkoskJuaxwlFuFL2XuffStyYHtfEbmDO7kmVHPewSDa+QCJlbOhGlBii uv2M1DuFgslDr5kNtbWZuCvpDitDERM7zQAXbx4tfSVWiemddfwuH8Q1MFewifmoXB8buG VoQUCzg5dpL8s5JFgAYcpUvzOoZvrBZvhJm+5I9xXRogVyBHYTO2+KsmeA5du+wV0Cs+Bs 6vbZkwYvpgzgw2fp0K9eVdxenLW3uVU3udogE2wkv8aQJ1ccOobv9V7Al7AYa/19U6J797 l8eZfoe9fN7azBGNNzQz9yZCP1EbnsPIyChbe3geSnhaip6hGpC6azOc/M1Ztg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702506591; a=rsa-sha256; cv=none; b=De+/2mL8++aCzJuYbXorBOz3isHnUPIRQTATQMfeBSJiqK1wYaCsTQwU6oMcCebGT6yyXB Lf7YrJZSrkB9afpFVHVaTCZoA0Jxw7RJEQEZPZLRLDRYlrlfMsPwqhjTZwBYQCfZLRCrtw /ccNeBu75l6XnUsTOAOzXYbBnsiOVQeuCUWDX1TuEMwu3KREp60h4l6rZul3z1bMRxpxTe qoat8ddR2KkX392ZdI5080P2BEs8xsEesYY5WXDRGdHrR4wjM+y8tyEtf9F/cmojwVO3DZ VE85XuxWeoFBd4RwtF/Cm4yGuEae8qZd8K9qDtRJBr/iEPFPzbATOix85V2X3A== 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=1702506591; 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=7DjAkIATcE8BVxihd9OIUcJxoI7TOR+cNLSalnhF5Vo=; b=e/WZuZ4mUtrJbfCEFMAhGseIvD8PRXWHTFa5ixPF17piusPsWYPl91FbYySXnfAwxy8cda AHButk2xZh0fPFb/flxJTUbHIjME52IgM9HyuYFNrHima5sZC3EYHXJP7K76RqXzVHLLku 2YfiJcVD1ywr1DnYKGs+ZbUBSdS1GmyWZnajgTZzsexUveSTfE3FQcjiRjtiBjGTNTvVmd iL2ZmVjNNGV5QTEeQz+xOva5BrI8nVzZ3/vhconbV52WIAzGqS6Wpp0qeEOYdQySmowP4v fF9rnxaimgRzu1V7inbLJ22LGhPp5WUYsuaeqV8vPMoQ3WLS2a3HalFfphvp/Q== 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 4Sr9CM4RqPz1GYx; Wed, 13 Dec 2023 22:29:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BDMTpeZ024603; Wed, 13 Dec 2023 22:29:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BDMTpS0024600; Wed, 13 Dec 2023 22:29:51 GMT (envelope-from git) Date: Wed, 13 Dec 2023 22:29:51 GMT Message-Id: <202312132229.3BDMTpS0024600@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Brooks Davis Subject: git: ba1279da0f6d - stable/14 - libc: centralize {_,sig,}{set,long}jmp symbols 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ba1279da0f6d2eda7ea5e748951b10af013144ef Auto-Submitted: auto-generated The branch stable/14 has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=ba1279da0f6d2eda7ea5e748951b10af013144ef commit ba1279da0f6d2eda7ea5e748951b10af013144ef Author: Brooks Davis AuthorDate: 2023-11-15 23:41:35 +0000 Commit: Brooks Davis CommitDate: 2023-12-13 22:08:14 +0000 libc: centralize {_,sig,}{set,long}jmp symbols These symbols are universally exposed and documented so declare them centrally. Double- and triple-underscore versions exist on some platforms, but leave those alone for now. Reviewed by: imp, kib Differential Revision: https://reviews.freebsd.org/D42616 (cherry picked from commit 1c656143be734de4b1e1bac27c0c48ef4d974510) --- lib/libc/aarch64/Symbol.map | 6 ------ lib/libc/amd64/Symbol.map | 6 ------ lib/libc/arm/Symbol.map | 6 ------ lib/libc/gen/Symbol.map | 6 ++++++ lib/libc/i386/Symbol.map | 6 ------ lib/libc/powerpc/Symbol.map | 6 ------ lib/libc/powerpc64/Symbol.map | 6 ------ lib/libc/riscv/Symbol.map | 6 ------ 8 files changed, 6 insertions(+), 42 deletions(-) diff --git a/lib/libc/aarch64/Symbol.map b/lib/libc/aarch64/Symbol.map index 691c77f345b9..a02c71c82b7d 100644 --- a/lib/libc/aarch64/Symbol.map +++ b/lib/libc/aarch64/Symbol.map @@ -5,18 +5,12 @@ */ FBSD_1.0 { .mcount; - _setjmp; - _longjmp; fabs; __flt_rounds; fpgetmask; fpsetmask; __infinity; __nan; - setjmp; - longjmp; - sigsetjmp; - siglongjmp; makecontext; }; diff --git a/lib/libc/amd64/Symbol.map b/lib/libc/amd64/Symbol.map index 3ceb1cd9682a..ea3b7866b718 100644 --- a/lib/libc/amd64/Symbol.map +++ b/lib/libc/amd64/Symbol.map @@ -5,8 +5,6 @@ */ FBSD_1.0 { .mcount; - _setjmp; - _longjmp; fabs; __flt_rounds; fpgetmask; @@ -20,10 +18,6 @@ FBSD_1.0 { __nan; makecontext; rfork_thread; - setjmp; - longjmp; - sigsetjmp; - siglongjmp; amd64_get_fsbase; amd64_get_gsbase; amd64_set_fsbase; diff --git a/lib/libc/arm/Symbol.map b/lib/libc/arm/Symbol.map index 5a7aec7c4089..4be0a7b02964 100644 --- a/lib/libc/arm/Symbol.map +++ b/lib/libc/arm/Symbol.map @@ -5,17 +5,11 @@ */ FBSD_1.0 { __mcount; - _setjmp; - _longjmp; alloca; fabs; __infinity; __nan; makecontext; - setjmp; - longjmp; - sigsetjmp; - siglongjmp; brk; sbrk; }; diff --git a/lib/libc/gen/Symbol.map b/lib/libc/gen/Symbol.map index 1fa5478b7918..2b8195244734 100644 --- a/lib/libc/gen/Symbol.map +++ b/lib/libc/gen/Symbol.map @@ -217,6 +217,12 @@ FBSD_1.0 { group_from_gid; setdomainname; sethostname; + _setjmp; + _longjmp; + setjmp; + longjmp; + sigsetjmp; + siglongjmp; longjmperror; getmode; setmode; diff --git a/lib/libc/i386/Symbol.map b/lib/libc/i386/Symbol.map index f2424a9b64c4..3b3df6b37202 100644 --- a/lib/libc/i386/Symbol.map +++ b/lib/libc/i386/Symbol.map @@ -5,8 +5,6 @@ */ FBSD_1.0 { .mcount; - _setjmp; - _longjmp; alloca; fabs; __flt_rounds; @@ -14,10 +12,6 @@ FBSD_1.0 { __infinity; makecontext; rfork_thread; - setjmp; - longjmp; - sigsetjmp; - siglongjmp; brk; i386_clr_watch; i386_get_fsbase; diff --git a/lib/libc/powerpc/Symbol.map b/lib/libc/powerpc/Symbol.map index ed5dd5884736..93e79fe96733 100644 --- a/lib/libc/powerpc/Symbol.map +++ b/lib/libc/powerpc/Symbol.map @@ -5,8 +5,6 @@ */ FBSD_1.0 { _mcount; - _setjmp; - _longjmp; fabs; __flt_rounds; fpgetmask; @@ -17,10 +15,6 @@ FBSD_1.0 { __infinity; __nan; makecontext; - setjmp; - longjmp; - sigsetjmp; - siglongjmp; brk; sbrk; }; diff --git a/lib/libc/powerpc64/Symbol.map b/lib/libc/powerpc64/Symbol.map index dabf6f4434c5..6af9a0103816 100644 --- a/lib/libc/powerpc64/Symbol.map +++ b/lib/libc/powerpc64/Symbol.map @@ -5,8 +5,6 @@ */ FBSD_1.0 { _mcount; - _setjmp; - _longjmp; fabs; __flt_rounds; fpgetmask; @@ -17,10 +15,6 @@ FBSD_1.0 { __infinity; __nan; makecontext; - setjmp; - longjmp; - sigsetjmp; - siglongjmp; brk; sbrk; }; diff --git a/lib/libc/riscv/Symbol.map b/lib/libc/riscv/Symbol.map index 8067ddca10cd..2e0467744778 100644 --- a/lib/libc/riscv/Symbol.map +++ b/lib/libc/riscv/Symbol.map @@ -4,18 +4,12 @@ * stdlib/Symbol.map, string/Symbol.map, sys/Symbol.map, ...). */ FBSD_1.0 { - _setjmp; - _longjmp; fabs; __flt_rounds; fpgetmask; fpsetmask; __infinity; __nan; - setjmp; - longjmp; - sigsetjmp; - siglongjmp; makecontext; }; From nobody Wed Dec 13 22:29:52 2023 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 4Sr9CP13s0z54QB4; Wed, 13 Dec 2023 22:29:53 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sr9CN75Yjz3SgF; Wed, 13 Dec 2023 22:29:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702506593; 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=+CMRIpY40jrrm930qt+yT34KtMLgOdOf437HYM88Sv0=; b=mT503OX1V+0onH5USkDC1ZyOCvkXqQrKQdYDT1L0mlELGnWhoyNvGJ3TAgAHrZvwe0V7Th E9Q0qtdsVcrH3vrHqN76/InVzvZp1GlYh30YlEKJwTzeziailHpDywsfxTTLGIWwH59zFS lKHN8i7UR/U+d5IXLCZENBF1yoGrZkvA8eE0Hz2SiOawnIIwq2CSH/j4yOBWLsb8I9S9K5 BPiOdrY9t1z0saofbdg8crIoFWIJY5zB7PJPmXC7LYgkP76UXO8ozgDdfPIgpiH5pFPVil UHeT3Tnyq7kvKRP/LbNDQmYmWCwOsb1GlQ8ybzi2bb8E4T8BFUo1nFyNxL2+DA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702506593; a=rsa-sha256; cv=none; b=LiwNsLcXR9nzf6VC2W3ENyRlbD1PD+fk/KCxG7WNjc7GYmMm8mnBpA9g/+eJh5EqcFwwOs aqX9mGDAqhK9PGLRGZji2wAT9S8E1jDBWNyk+Gs8ns8prrT9/qfh+9QWOwpqB0WdFxSiLQ stKj7PfGBL1jlkhLRCeg90WpuhZAm2H1J7Jh9Knguw8upDWrZxOEzNshOsJY+m/rAl+8bk wexOgDOwU/1Hjo+hx75rqsQGdC2gOQrfz81wFdeAq0Me3mlZFa2xPFfN/15N2/XwDSScYn iKaeZ4iqCI2jrYLtT5tfwdfyCKPCdHJTMhHu+vdjc+B5ur0Rlw/TPGt91Gylsw== 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=1702506593; 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=+CMRIpY40jrrm930qt+yT34KtMLgOdOf437HYM88Sv0=; b=kvxGLK5y5jQ/iHL5sJCXqP4wDHTiXMYeTch/6xShYwXz3AAX6gY10wOjrYS+dn2ydSv3Wk ikpsCzTNUeVcwNVq4HvrRTFFdoHVys583V88uwny+ajSO1d8Sh+s4ILsv/Z9Xh/rfOfcvM qa75+NIK8zC4jmtZzQtq46Tf+U+skhmulkrwxS2qqaW7susqXeBe5v/6IDEEA1YjjHfeZj DCuJzXR3xQp6cCBLaSLQtMALkNhxpYtD2y5LC3VbxRaEsghHvEIB0qMJZz00uVJmsSA4D8 C0PTgCTscKRkan4bIBAThOcerP83sGJSdUGtaCDOZ4DS8eYOR6mXVCF3j4Aa9A== 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 4Sr9CN5RtPz1Gb4; Wed, 13 Dec 2023 22:29:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BDMTqb5024642; Wed, 13 Dec 2023 22:29:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BDMTqLa024639; Wed, 13 Dec 2023 22:29:52 GMT (envelope-from git) Date: Wed, 13 Dec 2023 22:29:52 GMT Message-Id: <202312132229.3BDMTqLa024639@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Brooks Davis Subject: git: 01edb548c52e - stable/14 - libc: centralize makecontext symbols 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 01edb548c52ee7e3916f8f272d6b45e9e0f7fa6d Auto-Submitted: auto-generated The branch stable/14 has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=01edb548c52ee7e3916f8f272d6b45e9e0f7fa6d commit 01edb548c52ee7e3916f8f272d6b45e9e0f7fa6d Author: Brooks Davis AuthorDate: 2023-11-15 23:42:18 +0000 Commit: Brooks Davis CommitDate: 2023-12-13 22:08:14 +0000 libc: centralize makecontext symbols Declare makecontext() and __makecontext() symbols centrally as they are always implemented. Reviewed by: imp, kib Differential Revision: https://reviews.freebsd.org/D42617 (cherry picked from commit 5d79b5445e12873b316a04de352d12a02bfe2d53) --- lib/libc/aarch64/Symbol.map | 5 ----- lib/libc/amd64/Symbol.map | 2 -- lib/libc/arm/Symbol.map | 2 -- lib/libc/gen/Symbol.map | 2 ++ lib/libc/i386/Symbol.map | 2 -- lib/libc/powerpc/Symbol.map | 2 -- lib/libc/powerpc64/Symbol.map | 2 -- lib/libc/riscv/Symbol.map | 5 ----- 8 files changed, 2 insertions(+), 20 deletions(-) diff --git a/lib/libc/aarch64/Symbol.map b/lib/libc/aarch64/Symbol.map index a02c71c82b7d..39cc43d12c26 100644 --- a/lib/libc/aarch64/Symbol.map +++ b/lib/libc/aarch64/Symbol.map @@ -11,9 +11,4 @@ FBSD_1.0 { fpsetmask; __infinity; __nan; - makecontext; -}; - -FBSDprivate_1.0 { - __makecontext; }; diff --git a/lib/libc/amd64/Symbol.map b/lib/libc/amd64/Symbol.map index ea3b7866b718..6c514097dd0e 100644 --- a/lib/libc/amd64/Symbol.map +++ b/lib/libc/amd64/Symbol.map @@ -16,7 +16,6 @@ FBSD_1.0 { fpsetround; __infinity; __nan; - makecontext; rfork_thread; amd64_get_fsbase; amd64_get_gsbase; @@ -43,7 +42,6 @@ FBSDprivate_1.0 { _getlogin; ___longjmp; - __makecontext; __longjmp; __signalcontext; signalcontext; diff --git a/lib/libc/arm/Symbol.map b/lib/libc/arm/Symbol.map index 4be0a7b02964..5f6cc934410f 100644 --- a/lib/libc/arm/Symbol.map +++ b/lib/libc/arm/Symbol.map @@ -9,7 +9,6 @@ FBSD_1.0 { fabs; __infinity; __nan; - makecontext; brk; sbrk; }; @@ -34,7 +33,6 @@ FBSDprivate_1.0 { __aeabi_read_tp; ___longjmp; - __makecontext; __longjmp; signalcontext; _signalcontext; diff --git a/lib/libc/gen/Symbol.map b/lib/libc/gen/Symbol.map index 2b8195244734..a21bf2430846 100644 --- a/lib/libc/gen/Symbol.map +++ b/lib/libc/gen/Symbol.map @@ -196,6 +196,7 @@ FBSD_1.0 { ldexp; lockf; lrand48; + makecontext; modf; mrand48; nice; @@ -577,4 +578,5 @@ FBSDprivate_1.0 { __fillcontextx; __fillcontextx2; __getcontextx_size; + __makecontext; }; diff --git a/lib/libc/i386/Symbol.map b/lib/libc/i386/Symbol.map index 3b3df6b37202..ac2cb068d946 100644 --- a/lib/libc/i386/Symbol.map +++ b/lib/libc/i386/Symbol.map @@ -10,7 +10,6 @@ FBSD_1.0 { __flt_rounds; __nan; __infinity; - makecontext; rfork_thread; brk; i386_clr_watch; @@ -40,7 +39,6 @@ FBSDprivate_1.0 { _getlogin; ___longjmp; - __makecontext; __longjmp; __signalcontext; signalcontext; diff --git a/lib/libc/powerpc/Symbol.map b/lib/libc/powerpc/Symbol.map index 93e79fe96733..9f6f88048984 100644 --- a/lib/libc/powerpc/Symbol.map +++ b/lib/libc/powerpc/Symbol.map @@ -14,7 +14,6 @@ FBSD_1.0 { fpsetround; __infinity; __nan; - makecontext; brk; sbrk; }; @@ -28,7 +27,6 @@ FBSDprivate_1.0 { _getlogin; _fpgetsticky; - __makecontext; __longjmp; signalcontext; __signalcontext; diff --git a/lib/libc/powerpc64/Symbol.map b/lib/libc/powerpc64/Symbol.map index 6af9a0103816..63638bbb8908 100644 --- a/lib/libc/powerpc64/Symbol.map +++ b/lib/libc/powerpc64/Symbol.map @@ -14,7 +14,6 @@ FBSD_1.0 { fpsetround; __infinity; __nan; - makecontext; brk; sbrk; }; @@ -24,7 +23,6 @@ FBSDprivate_1.0 { _getlogin; _fpgetsticky; - __makecontext; __longjmp; signalcontext; __signalcontext; diff --git a/lib/libc/riscv/Symbol.map b/lib/libc/riscv/Symbol.map index 2e0467744778..79ee74e81a88 100644 --- a/lib/libc/riscv/Symbol.map +++ b/lib/libc/riscv/Symbol.map @@ -10,9 +10,4 @@ FBSD_1.0 { fpsetmask; __infinity; __nan; - makecontext; -}; - -FBSDprivate_1.0 { - __makecontext; }; From nobody Wed Dec 13 22:29:53 2023 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 4Sr9CQ12prz54Prh; Wed, 13 Dec 2023 22:29:54 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sr9CQ0W7Cz3T2T; Wed, 13 Dec 2023 22:29:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702506594; 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=QQv0fHUbznz+5xtpDQMYh32SJnek3jCvv+6+aOWvHLo=; b=Ola7ySnylgLhuLI2jhtjUiw8xwyjIQiuEOVZrNqGvsGpGoPurAzB8gdgdrjKkYkLOT5VHM xmuK+9h8HoRtTnIC7/gzOGV2Fn0+xDUVnxEa185IaSi01koUzQss2i0jy0htinYryvk8r3 txPYB+Dt6+zykRdnbJc4xPcTYjZuxHlowb6Xp1wqelMRNZy0eaJ/HsPkisejw5flMstMhd BsIPO+EvOZfuwrQxFUF+BYkd7XYkw+tANZnBCKthYwNtfDyIjdWGIF6//v1BrNqla2y72A ch+o6tpyD1y343IVif9w/vgHZIrNF7kzZjzJK8Y78N72in6YoopY/0Nu9Ie3EQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702506594; a=rsa-sha256; cv=none; b=bhCrgj1cYaa4+uNM7YHhhfs1G02tnC1dFBHw8w3UXdTpaE4lu8OAzV6YWule2wj5oPPZXo gbE6L5xy45LJwTtPE3bH3zb6TQjfCbBGACSr2dG+hNHJ4vkJ9V+S+zt3vyrzF5kaLm6bSA zc0v7bhbBWvYEeRaj7nqxrDpEHV1EqRp8EZlNheQ7HUms8lAbFlSDGIDGQ8/3awGnWXljF WI6uqRHhrR7MCbW0QvTpSJRdNYD6GCgG8dSNIb8ymKM2S1KQCXiIAHTdLlOiMoQbZIi3IV XmHcVHy3Mw4195yZSZD/UKCpxY3qEmbysqlHRkh7spA5Yw9XR3q2tBgoUx2LBQ== 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=1702506594; 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=QQv0fHUbznz+5xtpDQMYh32SJnek3jCvv+6+aOWvHLo=; b=PcGiynAMv9Zq2Bv+tcLj6R4iuDZHdryb/GI4dW4cE62W63n/iR3oOTfP0N2Gxs209qt/Xd l2rRlTM97dbcfsmymZDvefaGrJ3M912F57PVkqbAJkxHX5kJ0ehdNpappkXAPu5OMmz875 vSdJWM0O/sZEnjLfZTi8/AIDnvTfDUTFDMyTLUJp56M5hxp5Bdl7KueLosl4B8XYZkP4Up dbxlU4ecdFoBTpcAadCRFqu4sFc813O7yr993SKEP9uU7a6YkZUp2he0FH1owZKz0cM1wL S+VpeURzljtRAn1VaFFPNngQFTAib+dRFnrY20Uk3nDO0+fXw8a1ftOfALxG9A== 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 4Sr9CP6hp3z1GD3; Wed, 13 Dec 2023 22:29:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BDMTrbp024689; Wed, 13 Dec 2023 22:29:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BDMTrwc024686; Wed, 13 Dec 2023 22:29:53 GMT (envelope-from git) Date: Wed, 13 Dec 2023 22:29:53 GMT Message-Id: <202312132229.3BDMTrwc024686@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Brooks Davis Subject: git: f695db9fbae9 - stable/14 - libc: centralize a few numeric symbols 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f695db9fbae9786aac0e8b925bef6b78f745c13a Auto-Submitted: auto-generated The branch stable/14 has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=f695db9fbae9786aac0e8b925bef6b78f745c13a commit f695db9fbae9786aac0e8b925bef6b78f745c13a Author: Brooks Davis AuthorDate: 2023-11-15 23:42:37 +0000 Commit: Brooks Davis CommitDate: 2023-12-13 22:08:14 +0000 libc: centralize a few numeric symbols fabs, __infinity, and __nan are universally implemented so declare them in gen/Symbol.map. We would also include __flt_rounds, but it's under FBSD_1.3 on arm so until that's gone we're stuck with it. Likewise, everyone but i386 implements fp[gs]etmask. Reviewed by: imp, kib, emaste Differential Revision: https://reviews.freebsd.org/D42618 (cherry picked from commit c7045186819dbc64c3f005cb1138a1948868cf5a) --- lib/libc/aarch64/Symbol.map | 3 --- lib/libc/amd64/Symbol.map | 3 --- lib/libc/arm/Symbol.map | 3 --- lib/libc/gen/Symbol.map | 3 +++ lib/libc/i386/Symbol.map | 3 --- lib/libc/powerpc/Symbol.map | 3 --- lib/libc/powerpc64/Symbol.map | 3 --- lib/libc/riscv/Symbol.map | 3 --- 8 files changed, 3 insertions(+), 21 deletions(-) diff --git a/lib/libc/aarch64/Symbol.map b/lib/libc/aarch64/Symbol.map index 39cc43d12c26..cb4669039942 100644 --- a/lib/libc/aarch64/Symbol.map +++ b/lib/libc/aarch64/Symbol.map @@ -5,10 +5,7 @@ */ FBSD_1.0 { .mcount; - fabs; __flt_rounds; fpgetmask; fpsetmask; - __infinity; - __nan; }; diff --git a/lib/libc/amd64/Symbol.map b/lib/libc/amd64/Symbol.map index 6c514097dd0e..aa2744b15a74 100644 --- a/lib/libc/amd64/Symbol.map +++ b/lib/libc/amd64/Symbol.map @@ -5,7 +5,6 @@ */ FBSD_1.0 { .mcount; - fabs; __flt_rounds; fpgetmask; fpgetprec; @@ -14,8 +13,6 @@ FBSD_1.0 { fpsetmask; fpsetprec; fpsetround; - __infinity; - __nan; rfork_thread; amd64_get_fsbase; amd64_get_gsbase; diff --git a/lib/libc/arm/Symbol.map b/lib/libc/arm/Symbol.map index 5f6cc934410f..6fef9598e7ef 100644 --- a/lib/libc/arm/Symbol.map +++ b/lib/libc/arm/Symbol.map @@ -6,9 +6,6 @@ FBSD_1.0 { __mcount; alloca; - fabs; - __infinity; - __nan; brk; sbrk; }; diff --git a/lib/libc/gen/Symbol.map b/lib/libc/gen/Symbol.map index a21bf2430846..559c0252c338 100644 --- a/lib/libc/gen/Symbol.map +++ b/lib/libc/gen/Symbol.map @@ -107,6 +107,7 @@ FBSD_1.0 { execv; execvp; execvP; + fabs; fmtcheck; fmtmsg; fnmatch; @@ -181,10 +182,12 @@ FBSD_1.0 { endusershell; setusershell; getvfsbyname; + __nan; __isnan; isnan; __isnanf; isnanf; + __infinity; __isinf; isinf; __isinff; diff --git a/lib/libc/i386/Symbol.map b/lib/libc/i386/Symbol.map index ac2cb068d946..66939e2eb55d 100644 --- a/lib/libc/i386/Symbol.map +++ b/lib/libc/i386/Symbol.map @@ -6,10 +6,7 @@ FBSD_1.0 { .mcount; alloca; - fabs; __flt_rounds; - __nan; - __infinity; rfork_thread; brk; i386_clr_watch; diff --git a/lib/libc/powerpc/Symbol.map b/lib/libc/powerpc/Symbol.map index 9f6f88048984..5074596b3c09 100644 --- a/lib/libc/powerpc/Symbol.map +++ b/lib/libc/powerpc/Symbol.map @@ -5,15 +5,12 @@ */ FBSD_1.0 { _mcount; - fabs; __flt_rounds; fpgetmask; fpgetround; fpgetsticky; fpsetmask; fpsetround; - __infinity; - __nan; brk; sbrk; }; diff --git a/lib/libc/powerpc64/Symbol.map b/lib/libc/powerpc64/Symbol.map index 63638bbb8908..1bf990a52088 100644 --- a/lib/libc/powerpc64/Symbol.map +++ b/lib/libc/powerpc64/Symbol.map @@ -5,15 +5,12 @@ */ FBSD_1.0 { _mcount; - fabs; __flt_rounds; fpgetmask; fpgetround; fpgetsticky; fpsetmask; fpsetround; - __infinity; - __nan; brk; sbrk; }; diff --git a/lib/libc/riscv/Symbol.map b/lib/libc/riscv/Symbol.map index 79ee74e81a88..bebcecb879f4 100644 --- a/lib/libc/riscv/Symbol.map +++ b/lib/libc/riscv/Symbol.map @@ -4,10 +4,7 @@ * stdlib/Symbol.map, string/Symbol.map, sys/Symbol.map, ...). */ FBSD_1.0 { - fabs; __flt_rounds; fpgetmask; fpsetmask; - __infinity; - __nan; }; From nobody Wed Dec 13 22:29:54 2023 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 4Sr9CR23zGz54Q2x; Wed, 13 Dec 2023 22:29:55 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sr9CR1Kc4z3T14; Wed, 13 Dec 2023 22:29:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702506595; 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=G9s8fEEwTxas+uDm8PINk/XObSqajQ9dfPEVes1wutY=; b=Lfgy0Uw7oC/LV3LopqOlBTn2ap3hpjNQ85qQAHXH+n7e56n6Fc9DmhVtQemE0cs6f1g/kJ WNq4E4Lk0LN/YlvgqkEf57zQxmdAIO6U7ZWgM1Ed8oCzs+G6JsWi8rReFHKh8mSG98ht9O 6B5eFQ0iQzgYVLbQRaIP9QqwdXu0PchSjoodrDdt4JWHdu4egEEGD+HBPMAPwi1FYT8yJR miRocJqrgAMuNRvAYjTrcBVjt6T17sL26Fw1Ky+G64qyB72XSTLAOGjPdgmjCvMoSX+3Wb e2jMklZ9PMnDg1UHCDxQH/J7Eldk0ZWrf+RztLyee7Vs7GAtp1SLdM7lMKWp9A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702506595; a=rsa-sha256; cv=none; b=GbHvz4UjEHPW58gtk+Mc2Bef0VJJJikRyPQ+/MSdMnmUOh8s7tFFnjuaPHvWm6ySiuUkn5 m71Xd+QN25EkSyDX4igSwlZ2K0EKbzCNjF7reF7HcsaGNz+NVW9YqYWqg45A3bzp03vrhT QoKrRzzKy8EvL6oSwUODEr4K86yzIPbBIf1pGOW/6DGN3b30lzvPidCIFxikQn6pUbpTOI W+oMSrQdEmfI9WFSXpStG8iZBpJTjMMTk1sjfw+QZK2bzmQ+7/+Leq9SAfZFkObz8cn4ch R+IkL3WV/S2xKZMFj1mD6XSSGcFD89S/oxL89u1fREsBvjYsJmYMFsUzbpkJvA== 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=1702506595; 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=G9s8fEEwTxas+uDm8PINk/XObSqajQ9dfPEVes1wutY=; b=HPphVsB3KDD1KaleviOY79iD1ZeiupdYNrxWwGHvSlnRobU6N89VlOI0H2AC+1vciy8ooY u4RK8uwfCghpxr++A+oeN1Zi16cuktl3K4yKbH+54fykuPbdzkeeZos2D56oZSULsZjSZ5 0xr2Sd7dfgWINTXfW0mg2zTwvCc/A5Bar1EUH7rmws2dOC1R0hR+tvKDUhIQ5b+85EL1mT Atdh0RFS3De6E7Hp+ctQcPIU4HQSVo+s8TSit3dGswSURbV4Wfb+L4Sg7yM+1ntctzQ0mV 0v1Vt/ppdYMLZJl8gJXH4J+3KAnYi5qRGUnHJtrEmmQObC6AaU6pv8POahUbZw== 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 4Sr9CR0MM9z1Gd7; Wed, 13 Dec 2023 22:29:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BDMTs8D024741; Wed, 13 Dec 2023 22:29:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BDMTss4024738; Wed, 13 Dec 2023 22:29:54 GMT (envelope-from git) Date: Wed, 13 Dec 2023 22:29:54 GMT Message-Id: <202312132229.3BDMTss4024738@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Brooks Davis Subject: git: acf0f65f52f0 - stable/14 - libc: remove unused stub vdso timecounter implementations 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: acf0f65f52f0a4957ed09b0ceafdcc037a7dab90 Auto-Submitted: auto-generated The branch stable/14 has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=acf0f65f52f0a4957ed09b0ceafdcc037a7dab90 commit acf0f65f52f0a4957ed09b0ceafdcc037a7dab90 Author: Brooks Davis AuthorDate: 2023-11-15 23:43:56 +0000 Commit: Brooks Davis CommitDate: 2023-12-13 22:08:14 +0000 libc: remove unused stub vdso timecounter implementations All supported architectures have shared page support so remove this unused stub. Reviewed by: imp, kib Differential Revision: https://reviews.freebsd.org/D42619 (cherry picked from commit 500bf0592cf1de1d26369efe3877d812f724f5c0) --- lib/libc/sys/trivial-vdso_tc.c | 45 ------------------------------------------ 1 file changed, 45 deletions(-) diff --git a/lib/libc/sys/trivial-vdso_tc.c b/lib/libc/sys/trivial-vdso_tc.c deleted file mode 100644 index 4a626b7f6cae..000000000000 --- a/lib/libc/sys/trivial-vdso_tc.c +++ /dev/null @@ -1,45 +0,0 @@ -/*- - * Copyright (c) 2013 Konstantin Belousov - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include -#include -#include -#include - -#pragma weak __vdso_gettc -int -__vdso_gettc(const struct vdso_timehands *th, u_int *tc) -{ - - return (ENOSYS); -} - -#pragma weak __vdso_gettimekeep -int -__vdso_gettimekeep(struct vdso_timekeep **tk) -{ - - return (ENOSYS); -} From nobody Wed Dec 13 23:22:46 2023 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 4SrBNR0dHYz54TWZ; Wed, 13 Dec 2023 23:22:47 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SrBNQ6vmjz3bqv; Wed, 13 Dec 2023 23:22:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702509767; 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=+FLyqdq2b4yfMtUk0brXcDo4hLys1Q98VH3xjJM4a54=; b=eZFz0OPEZmEbsCr/l0uBdb41hj9GJvRYi1a8xr6MN2r7r+2I3o/Ur2f8keq6G9gkPNKu4H cN3rxLCNrJzWR/LBCPCafY/lurAd4jOX0du/FY8X0K5lISNDCTlKOBe1GYvAe76Kh0dOKK nF2nC1+JXfL8EZdC0SrHgQIcKQeWmj8C3zeoWy2eW9ljLvbqhPcttFVGe2u372eMa6VQ/B pEAeCOm+RVr1lg1ur6Yd0ZUgyaSqiEn8lH1D74rNrHENSl/i1OjgdamwG0hB6fLbTFQE/D s6aGbhYyUNYd9JeWmEQOTgartedTOnbh5CR5m1RwzCtjlL0K9g3UKJNdfuNxQQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702509767; a=rsa-sha256; cv=none; b=UGMmh0a5FsuuzfDol96d+vCK1RT1+vr5FYM6YuB0tkv6CwEsKQY7kQluzLUeaJeVbip3G+ sE2J0zQWc1tMu0j2uF+gS8f9cpLiXCa4J0PSrFMH7bqL4cAYf88xd+tWuwABGrwvdYq4XU w8UuRfSGc2gu+tbtlRwR9mbLHa+TnBeW67UgHfpZdhZ+6Est3+kbTGYG7xKm453Ti8tVJv kji8VqY0FVNSGMbJ6o05b4AfQiEr9Y+rQ3t04RxSWRJQGdFj9UH8kTLzjTL1huSJBFGlqf EovF3QAjPGW1xN65PQYfxYP4zo7ND5kB5xpQYMh/w3ocQ7udi6KUFsMzDLYXXA== 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=1702509767; 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=+FLyqdq2b4yfMtUk0brXcDo4hLys1Q98VH3xjJM4a54=; b=Mu7Drq3BSBskiyfJHazxmkmsgWwfBbkL/KQEPMeD74k9P42HPthLRgx+vBitk7Om1GyFh9 sKuZgBra36CPOxCtgfwumGV531YLqGLNv5k4npxC+QEQ4gMbwfUs6y4V/klacNn2nYbp/9 /1GH8a+w3aViXBCW90ggdRtHfzalrjXQziJncRgOHIJHjl2oD2NFU/UV3WcU9t0NFOwQNH O1iTy+IQ5GgonWEuEtk8CcMa8iCYPnI97p5BZZjiySsGOKL+qvQoqa1AkgyGLw/o6cd+0O qfGERMybmC621UPcXcelsj0eiYePh5FM+c3bcJZHMJ7L8UfdUV8TWlv2hXgufg== 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 4SrBNQ5y3jz1Hhc; Wed, 13 Dec 2023 23:22:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BDNMkj0024440; Wed, 13 Dec 2023 23:22:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BDNMkv6024437; Wed, 13 Dec 2023 23:22:46 GMT (envelope-from git) Date: Wed, 13 Dec 2023 23:22:46 GMT Message-Id: <202312132322.3BDNMkv6024437@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Brooks Davis Subject: git: 3ad2fd6fb11d - stable/14 - makesyscalls: don't make syscall.mk by default 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 3ad2fd6fb11d36566aa9322bbc360eaf5232634f Auto-Submitted: auto-generated The branch stable/14 has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=3ad2fd6fb11d36566aa9322bbc360eaf5232634f commit 3ad2fd6fb11d36566aa9322bbc360eaf5232634f Author: Brooks Davis AuthorDate: 2023-11-18 00:48:14 +0000 Commit: Brooks Davis CommitDate: 2023-12-13 23:07:06 +0000 makesyscalls: don't make syscall.mk by default We only want to produce syscall.mk for the main syscall table so default to not producing it (send it to /dev/null) and add a syscalls.conf to sys/kern to trigger the creation of sys/sys/syscall.mk. This eliminates the need for entries in other syscalls.conf files and is a cleaner pattern going forward. Reviewed by: kevans, imp Differential Revision: https://reviews.freebsd.org/D42663 (cherry picked from commit 54d487c4d01d68ef0ac03eae1fc574f7533d46f6) --- sys/amd64/linux/syscalls.conf | 1 - sys/amd64/linux32/syscalls.conf | 1 - sys/arm64/linux/syscalls.conf | 1 - sys/compat/freebsd32/syscalls.conf | 1 - sys/i386/linux/syscalls.conf | 1 - sys/kern/Makefile | 1 - sys/kern/syscalls.conf | 1 + sys/tools/makesyscalls.lua | 2 +- 8 files changed, 2 insertions(+), 7 deletions(-) diff --git a/sys/amd64/linux/syscalls.conf b/sys/amd64/linux/syscalls.conf index b46b9e500553..2c6c1e45f8d9 100644 --- a/sys/amd64/linux/syscalls.conf +++ b/sys/amd64/linux/syscalls.conf @@ -3,7 +3,6 @@ sysproto="linux_proto.h" sysproto_h=_LINUX_SYSPROTO_H_ syshdr="linux_syscall.h" syssw="linux_sysent.c" -sysmk="/dev/null" syscallprefix="LINUX_SYS_" switchname="linux_sysent" namesname="linux_syscallnames" diff --git a/sys/amd64/linux32/syscalls.conf b/sys/amd64/linux32/syscalls.conf index 82ffa49fdbb8..e1b92f011d21 100644 --- a/sys/amd64/linux32/syscalls.conf +++ b/sys/amd64/linux32/syscalls.conf @@ -3,7 +3,6 @@ sysproto="linux32_proto.h" sysproto_h=_LINUX32_SYSPROTO_H_ syshdr="linux32_syscall.h" syssw="linux32_sysent.c" -sysmk="/dev/null" syscallprefix="LINUX32_SYS_" switchname="linux32_sysent" namesname="linux32_syscallnames" diff --git a/sys/arm64/linux/syscalls.conf b/sys/arm64/linux/syscalls.conf index b46b9e500553..2c6c1e45f8d9 100644 --- a/sys/arm64/linux/syscalls.conf +++ b/sys/arm64/linux/syscalls.conf @@ -3,7 +3,6 @@ sysproto="linux_proto.h" sysproto_h=_LINUX_SYSPROTO_H_ syshdr="linux_syscall.h" syssw="linux_sysent.c" -sysmk="/dev/null" syscallprefix="LINUX_SYS_" switchname="linux_sysent" namesname="linux_syscallnames" diff --git a/sys/compat/freebsd32/syscalls.conf b/sys/compat/freebsd32/syscalls.conf index af0409d8b3f1..055a041cf72a 100644 --- a/sys/compat/freebsd32/syscalls.conf +++ b/sys/compat/freebsd32/syscalls.conf @@ -3,7 +3,6 @@ sysproto="freebsd32_proto.h" sysproto_h=_FREEBSD32_SYSPROTO_H_ syshdr="freebsd32_syscall.h" syssw="freebsd32_sysent.c" -sysmk="/dev/null" syscallprefix="FREEBSD32_SYS_" switchname="freebsd32_sysent" namesname="freebsd32_syscallnames" diff --git a/sys/i386/linux/syscalls.conf b/sys/i386/linux/syscalls.conf index b46b9e500553..2c6c1e45f8d9 100644 --- a/sys/i386/linux/syscalls.conf +++ b/sys/i386/linux/syscalls.conf @@ -3,7 +3,6 @@ sysproto="linux_proto.h" sysproto_h=_LINUX_SYSPROTO_H_ syshdr="linux_syscall.h" syssw="linux_sysent.c" -sysmk="/dev/null" syscallprefix="LINUX_SYS_" switchname="linux_sysent" namesname="linux_syscallnames" diff --git a/sys/kern/Makefile b/sys/kern/Makefile index 839ad83b02e4..505175412661 100644 --- a/sys/kern/Makefile +++ b/sys/kern/Makefile @@ -2,7 +2,6 @@ # # Makefile for init_sysent -SYSENT_CONF= GENERATED= init_sysent.c \ syscalls.c \ systrace_args.c \ diff --git a/sys/kern/syscalls.conf b/sys/kern/syscalls.conf new file mode 100644 index 000000000000..d328b992a45d --- /dev/null +++ b/sys/kern/syscalls.conf @@ -0,0 +1 @@ +sysmk="../sys/syscall.mk" diff --git a/sys/tools/makesyscalls.lua b/sys/tools/makesyscalls.lua index a800de26a282..8a56310f0068 100644 --- a/sys/tools/makesyscalls.lua +++ b/sys/tools/makesyscalls.lua @@ -46,7 +46,7 @@ local config = { sysproto = "../sys/sysproto.h", sysproto_h = "_SYS_SYSPROTO_H_", syshdr = "../sys/syscall.h", - sysmk = "../sys/syscall.mk", + sysmk = "/dev/null", syssw = "init_sysent.c", syscallprefix = "SYS_", switchname = "sysent", From nobody Wed Dec 13 23:22:47 2023 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 4SrBNS116Bz54TMq; Wed, 13 Dec 2023 23:22:48 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SrBNS0Tcnz3cGw; Wed, 13 Dec 2023 23:22:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702509768; 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=GuIkdIPhBYO2emBifqboiilhBpVA1Mvujfi2fZUH0TA=; b=Du1H+XvjvCUEsOUYs691Vlb8YjD5rVYPVUwc8gSvYHeCBgqmuFXvvH2sqlQQECzFJUhWQV rqZduZUofc6O8Ryx3WFv5pyQURaJ2BVuoaOwLgP7kxvD5sZxJOJEfa/Jy5htMPOM7eOeT5 wXp+aB9OxAZlNTfkJyYtMaRy1/OEfbrFceyKXZx96SgMBjfBzHCrIAqPg21HD6uc2uyWUq mV7RgalS4UK0V2QXDbPu4oRjR2YvIx7lyOR0GQZfXHZd9bXxG1d+oKS5Ew0DaGlWLuZUU2 XfnDROdSwhd9oeUibAsM2s1G/VUMaDib0iI7G7cEtz9xsah0TyBu2WTGG5hxCw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702509768; a=rsa-sha256; cv=none; b=KACyTNTDXRE47eo3o4TCdV3SAEQnUuj2BjzN81YnbaPzXJaKjTJSnUdX3KCmV5vXpJfweV IaRrbc/amK7k7nRCIrvHkTqFX1fBz6GG6A6/O6ZSyQtEAJz8wzu16o38Uc1iN/EH+ceAte QItovwLw60332MqrrhQOLphTuYvOPXltoRREpJNzStGULPLWNLGd1YH3FBQfJaz02pHbgQ sJORWjgO30/MQKAjoK5OKv9gZMZeGm3py98TbqC/h05Txf71/5jxNJiU0xVbfak892+rSb 2S6BvqatdOheFtMLYdcyeguvJ4VY/1ZdZpsxkbNxiLirIi7CwvqG+PsmyidpiA== 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=1702509768; 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=GuIkdIPhBYO2emBifqboiilhBpVA1Mvujfi2fZUH0TA=; b=BI2wQsCbKTIu2QfUiv5OGt4uTFBaXZloHyk7f2+X9ihi+tNAeMpwmPJcLJ510S4cX8JIlm V/DnZIIRRaXVP916aSrTZb+9w96mOeO+kyqbTlqWYOpkGiV0NeYKw3tgSWLTh0AlHLMM4C RTlY8BIdXxItyOU7PH17bOG0xGDnuCvcFI0epVV/EWNJD2bOLgvMJH4MH+XJRLiRuQXlVa TtPe/9LP0awSRBuwR1H3ghUKbe9YXmTZrdlVFwA1lsCWV9wIWx2wrzxIy5SoTXtSNLjbrY JTcV4SaoFpyhare/RYZ5RwSE0AEBiE5QMReYsr212njGquh2BXY0g+5ntfoSCQ== 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 4SrBNR6dWhz1Hhd; Wed, 13 Dec 2023 23:22:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BDNMlA2024479; Wed, 13 Dec 2023 23:22:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BDNMlOg024476; Wed, 13 Dec 2023 23:22:47 GMT (envelope-from git) Date: Wed, 13 Dec 2023 23:22:47 GMT Message-Id: <202312132322.3BDNMlOg024476@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Brooks Davis Subject: git: 0f6bc5ca95b7 - stable/14 - vis: relocate _DIAGASSERT() define 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0f6bc5ca95b73f42d70b8879daf969304c9c21b6 Auto-Submitted: auto-generated The branch stable/14 has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=0f6bc5ca95b73f42d70b8879daf969304c9c21b6 commit 0f6bc5ca95b73f42d70b8879daf969304c9c21b6 Author: Brooks Davis AuthorDate: 2023-11-21 00:21:11 +0000 Commit: Brooks Davis CommitDate: 2023-12-13 23:08:49 +0000 vis: relocate _DIAGASSERT() define Other similar files from NetBSD define it unconditionally as a local diff. Reviewed by: imp (as part of D42686) (cherry picked from commit db94e7c3f9a2344958667e756015393ad3124b3e) --- contrib/libc-vis/vis.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contrib/libc-vis/vis.c b/contrib/libc-vis/vis.c index fc3b50d6c7a5..2f9eab25b480 100644 --- a/contrib/libc-vis/vis.c +++ b/contrib/libc-vis/vis.c @@ -61,7 +61,6 @@ __RCSID("$NetBSD: vis.c,v 1.83 2023/08/12 12:48:52 riastradh Exp $"); #endif /* LIBC_SCCS and not lint */ #ifdef __FBSDID __FBSDID("$FreeBSD$"); -#define _DIAGASSERT(x) assert(x) #endif #include "namespace.h" @@ -86,6 +85,8 @@ __weak_alias(strvisx,_strvisx) #include #include +#define _DIAGASSERT(x) assert(x) + /* * The reason for going through the trouble to deal with character encodings * in vis(3), is that we use this to safe encode output of commands. This From nobody Wed Dec 13 23:22:49 2023 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 4SrBNT2q6Zz54TCC; Wed, 13 Dec 2023 23:22:49 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SrBNT1tCCz3cHY; Wed, 13 Dec 2023 23:22:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702509769; 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=lxYk4SgVRWWpzBVIIRRSeO6TvWs3oeZJCdsjKj2gdQc=; b=CjAfdSFPADba61nWq6CAg9MuJiUKpiJSmdAwQiC+22MsTvXqe2Kdq2ySYeO4/JHOxJ2ujc JUWTlPT0V39eXWDxOCl9p3yG8DTRRbKebwMPwEYLZcKbjmdQZB5T3JFB/VHgICj/RV3r55 ItuKr64TB/OAFWnyrOtYJiFN6QKFZEwQNrWzzWL+I5mbRiQbO3f0nLb4tK/+o4PkDB0VyE CWskVvLFizeHRwtmzWoutJfWCsNN3nW1/OnhZJ7PUni+zPDdYRTQtad7aawjEIG/4en3Np oTTOqKWMS1vsIdb35EKiXMAsv4E3sW8Qnl5TINRugxiZVdycbxBWGVCdDrAdXQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702509769; a=rsa-sha256; cv=none; b=IAQienWrm5Ihih93NHzW4AoS+hVeR/Iu7AT90Gk8+ZWm2XmesFW6VVMaOOtA0tg2KI2AnY PEjee2bIsUAAYeB3EekViSZxqnYLihPenZkE5TB+sbR3EzScDHkFS+2oSQKbLoY4nmRQnn o1LC6tpORTet4sWs4BF0Lbl2sDoS3HIfutMLpbNCKqLusiyE7V4jG71MORd3wk9Sm+iSqG +NaDos3gChqjC5YiyA5UsdoQjLoOn4iqhJCfENVB4htDHSAul4qPozGHO4ROKnvpCjQAet 3+tmRyZWZhVpYZmglGzI7+0+kEDTe+vhX5/3bWoPynR3ERpr5DDWywy0W76p0Q== 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=1702509769; 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=lxYk4SgVRWWpzBVIIRRSeO6TvWs3oeZJCdsjKj2gdQc=; b=xipU3kVMWUYV0r/jgOwZIMvXcCJDv1yfZmX0NpOEKpS42uYHDtPzv2SUh4eJyErtlHfc7d OKxO78RfqhXOTD92sylzl5vSG0t9aa5ugVq/HZalIsmoalonWDuJvWYC4FJg4NSz66DI8l gsIg2f/kYh1HyemzvsZimgF4/zX6THtJ4EqiN6ccTgfXOk/wY1tCygGosMQg4aggbRm45X mpp3hgrhqqqWvhXdeM/ANzXeXKPxAEFV34NMT2hyGZA4qRzZpLSqmtszGdwKcVjbKAcSZd gt29QkAykWIxznd2Qk7my6j0sNl1F9NxYYFei/hZMsiFGkg3TkoH0MKDf8EnMQ== 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 4SrBNT0p1sz1Hhf; Wed, 13 Dec 2023 23:22:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BDNMnHg024524; Wed, 13 Dec 2023 23:22:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BDNMnuj024521; Wed, 13 Dec 2023 23:22:49 GMT (envelope-from git) Date: Wed, 13 Dec 2023 23:22:49 GMT Message-Id: <202312132322.3BDNMnuj024521@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Brooks Davis Subject: git: 52b970f98df5 - stable/14 - Remove __FBSDID from netbsd libc sources 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 52b970f98df5eb85d4e363e4d3b9aeb9ff6106ed Auto-Submitted: auto-generated The branch stable/14 has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=52b970f98df5eb85d4e363e4d3b9aeb9ff6106ed commit 52b970f98df5eb85d4e363e4d3b9aeb9ff6106ed Author: Brooks Davis AuthorDate: 2023-11-21 00:21:11 +0000 Commit: Brooks Davis CommitDate: 2023-12-13 23:08:50 +0000 Remove __FBSDID from netbsd libc sources I added them per then-current practice when I imported them, but now they are just gratuious local diffs. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D42686 (cherry picked from commit ea2be8ed283597062853935a5a29dfd67973044b) --- contrib/libc-pwcache/pwcache.c | 1 - contrib/libc-vis/unvis.c | 1 - contrib/libc-vis/vis.c | 3 --- 3 files changed, 5 deletions(-) diff --git a/contrib/libc-pwcache/pwcache.c b/contrib/libc-pwcache/pwcache.c index 321e43900bd1..180935c75b42 100644 --- a/contrib/libc-pwcache/pwcache.c +++ b/contrib/libc-pwcache/pwcache.c @@ -77,7 +77,6 @@ static char sccsid[] = "@(#)cache.c 8.1 (Berkeley) 5/31/93"; __RCSID("$NetBSD: pwcache.c,v 1.31 2010/03/23 20:28:59 drochner Exp $"); #endif #endif /* LIBC_SCCS and not lint */ -__FBSDID("$FreeBSD$"); #include "namespace.h" diff --git a/contrib/libc-vis/unvis.c b/contrib/libc-vis/unvis.c index f290d8db271a..62a350bfa912 100644 --- a/contrib/libc-vis/unvis.c +++ b/contrib/libc-vis/unvis.c @@ -37,7 +37,6 @@ static char sccsid[] = "@(#)unvis.c 8.1 (Berkeley) 6/4/93"; __RCSID("$NetBSD: unvis.c,v 1.45 2022/04/19 20:32:15 rillig Exp $"); #endif #endif /* LIBC_SCCS and not lint */ -__FBSDID("$FreeBSD$"); #include "namespace.h" #include diff --git a/contrib/libc-vis/vis.c b/contrib/libc-vis/vis.c index 2f9eab25b480..623acfe92e1d 100644 --- a/contrib/libc-vis/vis.c +++ b/contrib/libc-vis/vis.c @@ -59,9 +59,6 @@ #if defined(LIBC_SCCS) && !defined(lint) __RCSID("$NetBSD: vis.c,v 1.83 2023/08/12 12:48:52 riastradh Exp $"); #endif /* LIBC_SCCS and not lint */ -#ifdef __FBSDID -__FBSDID("$FreeBSD$"); -#endif #include "namespace.h" #include From nobody Wed Dec 13 23:22:50 2023 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 4SrBNW0JzHz54TCG; Wed, 13 Dec 2023 23:22:51 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SrBNV4KzCz3cJ3; Wed, 13 Dec 2023 23:22:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702509770; 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=lprMWUfMTD7Yv8sJuK4q4ZHLoRJozbsGbVNJ1GHN5gE=; b=yqxZkNkyHEPi3yiy7gedxXDjUK32uz9aVcMNDtLKd4wJhdwxeFuA3h0ePgrLpEqDPUqB1b XXPrM5iaegEIFc0NYu4zDebAN6g4qmJx0r1zToQ3KLpAHletEr+jooCpKw2Hl5gzIN2ZXG bvSiOHi4TZSQ1gGVeEV5+ZX/g1kf2FQUyPomBTon7Y2YxXQKxb8wE7qkf78+LB0uDND6JG OCNwbUYPsQi5IUi3dCtTJI4Ihn7WikZMvufiuDV8ZE/tNl4C/z5zMBKK0jOP7cG7x3FpYP 9YicVLRAotPUivZ6Jxc1zWsljBDHbzqOwx21JSjccycNUw5GgCiKBI0ZEQqXwA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702509770; a=rsa-sha256; cv=none; b=H66RgGGspavPB4klioYXhhhnfap0QVjv6v43gvE5PPjpEW3MXFp5dHfMKeR/6MsFzElopd ErkK2LyisvMVR3d5fu66lpAjCPmjgDi5BVDQsndQLltqBDgP1jAYtXKK1x+OyiR0USzCYd yb/l3FXjc1Uk/fHuqUWTz3fC6E5KEPbBVw52oYttLjhEF/vvR19SOR/1ru6r3D5XpqV6hN 2BQ5uG7ywWyMg/iBSQSgyqTYZllPoYqLwhAieH1NNt/2PjoD/sYXgtBvyO1VJHpyJ3SKEo g4I4YuJ9bUltx7/oOjXYp8ZXJQlHno27IijzyA4+TT2uZhgAwZ/szb/QmJBCQw== 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=1702509770; 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=lprMWUfMTD7Yv8sJuK4q4ZHLoRJozbsGbVNJ1GHN5gE=; b=UsQim60P3JquQCWYoygS5bLkwBEf4cfkSu5tadrY2rUlalLelhgRW+csLbx2w67VLK7+4T CCHgwUWc8L7e8YSx1JVFKDIGbWtDHARmpfBxIdhXMBtAlIbZlad59A0RxtJ/n3AHN8kOSZ T3hVKQANaO1ibRE5ElOaB52QJPmAe7f/q6rM8aW6EQT/tlp8WsbcmhRwgkEXzKVdS2kocL CMO3uW8TRLbboLuy3z8SCWXlZhD8xOhyaMpZlRi63Q/ctBSdPkLxsk11wjExh81SeBcr4g CN2J8VneQ1YUzI4jrkFUVepMe3/nG9kg9+J7JoTTYv7oZ508Mu19c05IcXRvSw== 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 4SrBNV1pV9z1Hhg; Wed, 13 Dec 2023 23:22:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BDNMoMu024566; Wed, 13 Dec 2023 23:22:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BDNMoEQ024563; Wed, 13 Dec 2023 23:22:50 GMT (envelope-from git) Date: Wed, 13 Dec 2023 23:22:50 GMT Message-Id: <202312132322.3BDNMoEQ024563@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Brooks Davis Subject: git: cbbe7c135b9b - stable/14 - pf: Remove __FBSDID() macro use 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: cbbe7c135b9bf002729e53ca63c8e673c84fa70a Auto-Submitted: auto-generated The branch stable/14 has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=cbbe7c135b9bf002729e53ca63c8e673c84fa70a commit cbbe7c135b9bf002729e53ca63c8e673c84fa70a Author: Brooks Davis AuthorDate: 2023-11-21 00:21:11 +0000 Commit: Brooks Davis CommitDate: 2023-12-13 23:08:50 +0000 pf: Remove __FBSDID() macro use These are local additions that no longer make sense with the transition to git. This partially reverts a10f530f936b7b2e3a19c406ae199b91a48f34d3. Reviewed by: kp, imp Differential Revision: https://reviews.freebsd.org/D42687 (cherry picked from commit bbde5c0725a5b34c456b3818cc69d17f22cef9f8) --- contrib/pf/authpf/authpf.c | 3 --- contrib/pf/ftp-proxy/ftp-proxy.c | 3 --- contrib/pf/pflogd/pflogd.c | 3 --- contrib/pf/pflogd/privsep.c | 3 --- 4 files changed, 12 deletions(-) diff --git a/contrib/pf/authpf/authpf.c b/contrib/pf/authpf/authpf.c index 5ffa5b9cfe43..9858c1c50ced 100644 --- a/contrib/pf/authpf/authpf.c +++ b/contrib/pf/authpf/authpf.c @@ -16,9 +16,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include -__FBSDID("$FreeBSD$"); - #include #include #include diff --git a/contrib/pf/ftp-proxy/ftp-proxy.c b/contrib/pf/ftp-proxy/ftp-proxy.c index 04d749dd0fff..d8f8b8e67d1f 100644 --- a/contrib/pf/ftp-proxy/ftp-proxy.c +++ b/contrib/pf/ftp-proxy/ftp-proxy.c @@ -16,9 +16,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include -__FBSDID("$FreeBSD$"); - #include #include #include diff --git a/contrib/pf/pflogd/pflogd.c b/contrib/pf/pflogd/pflogd.c index 2b1b0df769a7..6df97f8b84f4 100644 --- a/contrib/pf/pflogd/pflogd.c +++ b/contrib/pf/pflogd/pflogd.c @@ -30,9 +30,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include -__FBSDID("$FreeBSD$"); - #include #include #include diff --git a/contrib/pf/pflogd/privsep.c b/contrib/pf/pflogd/privsep.c index 2e3895d2be77..326b4af6fe66 100644 --- a/contrib/pf/pflogd/privsep.c +++ b/contrib/pf/pflogd/privsep.c @@ -17,9 +17,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include -__FBSDID("$FreeBSD$"); - #include #include #include From nobody Wed Dec 13 23:22:51 2023 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 4SrBNW4Gkvz54T4b; Wed, 13 Dec 2023 23:22:51 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SrBNW3kJQz3cFq; Wed, 13 Dec 2023 23:22:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702509771; 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=w0EulyiqhWXUu3SqLKI9v5YtRyNIol2001gUCLekFHk=; b=dLxPNnvLasUZ/BK0qV9om13waD6JwZYr5BrCzA/xX1pWMSZbrDdbbp6prNU6Xk7xN8u8Xl PyBMKxzHEwGNqxn9uM/jg9oHjEPS6fUDdW8/04jjpBWjBuDDbAtTvSRGU0D8OBqW3q+5NM FMVbkGYuwBrqBK+w7ZtlfH4C+n6E0Ntbfph3fHr2H6Dj5i6l5zNcGppPLtcSnJr7sSYDOy U+MA6brkR5HeS6nJvxXx5SjRfxO/KJu9cbg1x8IB/zlmCbMbtlmAMLaXTQJ9zEPEUMj7Kl dHahl7HLrJDJTiPLRrg1l7qpY/epRXbeEYiuEXgrhaO0KkkQS49qCEjL8lxSAw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702509771; a=rsa-sha256; cv=none; b=w2tUPqke//5GY5KA+vCJrdVTgws6qfLyhEP5WY2Ar3ZuEbaycUiYdnI8e6ssB6DfJfPBZY MvMaqBop48r1m8hBnU7g0ZdeQhMdm6kEvssAdqN65ea/JwwI09inkRHsP0xwr1YbsudT0L yA7Y97WUyv9UcTb5s8OFO4TraV2I9p2dE9Dbvm92dioW9QWQfIsgUZ9pgtvJGSdfQNv6gS 6/QQPBHg5r9UmzJaYzDEGCMH6H/Cc0dCqDLugX/F9d8OJ335ygV96Ohhp0bN24/oQfKfc6 BAIBzk3QBrRES0IjWB+oPj+j1/52N1l6hvX9It9tI4Smfe43kFt5cgJNGOzV6Q== 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=1702509771; 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=w0EulyiqhWXUu3SqLKI9v5YtRyNIol2001gUCLekFHk=; b=eg0O/XcIbtLqHdmZNs/ogTIe52tBKXUdXmOTzhIYkkPniOw53VxOKgN5MPLHZvWqlebOgY QqQ0nZFx+WDjm1mS+fi//FLDfetbnW5sLDjfEujCp9unbb+btAovQ17bhASlG6RIgk5rBU upyIZKETzA/4aPtlzsIKk8vubhrCBM1fIwVrtm+fEpcj4TaSc9UlaAeZCYllGHFwB6Opo4 s5hgvEDKsCoIzI+nLRTYkC/gwAcI3371/I/wm65Qabr8Wq+56x4k8O9p599F5XsRo4XOnK TdNP4cFvwqTvW35BBVEAGd8WjCl1X5AzPlzHN3eNLyTDWR2LL/0Qq/CgaK8Pjg== 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 4SrBNW2qXbz1Hr4; Wed, 13 Dec 2023 23:22:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BDNMpIe024609; Wed, 13 Dec 2023 23:22:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BDNMpSe024606; Wed, 13 Dec 2023 23:22:51 GMT (envelope-from git) Date: Wed, 13 Dec 2023 23:22:51 GMT Message-Id: <202312132322.3BDNMpSe024606@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Brooks Davis Subject: git: 5136530bc481 - stable/14 - ps: s/kern.max_pid/kern.pid_max/ in a comment 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 5136530bc48106593baec841c093b551a1d3e67a Auto-Submitted: auto-generated The branch stable/14 has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=5136530bc48106593baec841c093b551a1d3e67a commit 5136530bc48106593baec841c093b551a1d3e67a Author: Brooks Davis AuthorDate: 2023-11-21 22:43:14 +0000 Commit: Brooks Davis CommitDate: 2023-12-13 23:08:50 +0000 ps: s/kern.max_pid/kern.pid_max/ in a comment Sponsored by: DARPA (cherry picked from commit 1818f3fda9c1a9a97f23b6dc6d0a63eb6f8d8b20) --- bin/ps/ps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/ps/ps.c b/bin/ps/ps.c index 3a7a0f54cca0..16d8a0a58d3c 100644 --- a/bin/ps/ps.c +++ b/bin/ps/ps.c @@ -112,7 +112,7 @@ static int needcomm; /* -o "command" */ static int needenv; /* -e */ static int needuser; /* -o "user" */ static int optfatal; /* Fatal error parsing some list-option. */ -static int pid_max; /* kern.max_pid */ +static int pid_max; /* kern.pid_max */ static enum sort { DEFAULT, SORTMEM, SORTCPU } sortby = DEFAULT; From nobody Wed Dec 13 23:22:52 2023 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 4SrBNX5Kx2z54TZC; Wed, 13 Dec 2023 23:22:52 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SrBNX4tBgz3cKp; Wed, 13 Dec 2023 23:22:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702509772; 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=Uit3hnPowJyqvoDN5GyUiN4qowBuK5W1XjFhd+2MFHg=; b=QRWVuqg4VDOHeIYO8w0xCv6JcNEpYEqXR32LYupCbLmPkw8Pm/q214Vfvn5JsKeEbDGOxZ xsUzCi9iHdoEWt9a5epQgOL8Lzt887raFDnVPBFM4q0UHM5Z2LhMHZ2Vvox3YUeAByODdX ahW/UJut1VLjEcXb94uxTBSsIdkKgMwyqV5nyHwNc/OzHwuho9Q2QgTi5DSTWJjYdDpbio kHi8GFwYyWcZpB76IreiutEreTpE4W05/MqUXTxKl1bAjiRmMUpnYskJ3yIxGwOF+qJ+i6 BFfbkBvEX4KnW67pYBN/5k3UIXgoLuJc/gWphGq/n+FpGt2EJ3A8xUE4zpsJwQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702509772; a=rsa-sha256; cv=none; b=RdhiXvG0LjIboyFTVlhqj8E8VMSEq0cKVmwVKwWze+E0u7bCNrfNQeK5NTOOEkq2P43GqJ uuemYcK8UNS1Pn/4NBVAq+PLtDuuTKYKiIHTU6nMoHaiiyGitn1buQVRLZC6V0h4E2jlMl UuS7kA66dTaH2sojZXCteomfffq1tdObIuOYtBXKQQJUMsBYPSO7k15fe7jb1d5CbjUZZt 3UC3TTnK5T9/CY1HbjIU3YdIk68BzUQfoULYAQ1wLWXLoB64WOIuZCGZgBCzqmaA9N34+m DgAHoaixw9Sv6dkPY9EBZ/NsBNwJK3zRRx70v26AeQ1D8mKbUh6CSDi4XO1HBg== 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=1702509772; 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=Uit3hnPowJyqvoDN5GyUiN4qowBuK5W1XjFhd+2MFHg=; b=Q4VHdHd2JqNYuVRJazZgY5+mTdXQZfrGGJXEQSVeptrkPH/vQzVEE9vUCuzMOVnxqJbr/G 85DSkgIc21/Pwkxc8Q8+y17/33KcZcTrHyC78jgmwG2mFOpsNpF+VQTdDM/UETzOOtIteR F+BkKJmcI5jzwnb8u5Z+dPQwBAnvD7dK5n+fjlhT4mbqpwjC9savCxW/XBxSg3x/Ih+yvv Q/xHSqzizkMwreyPlRzlUUIp3dLxzMZ21TKjpbF+rW0Z+yMv0Z75XcOqtFJSI0FWED+qpB 3WxLRMj4ctyoH2FKhU/BRtVmZf3UFnA9qkrudTB5YYMU9LItYlf6qKNp1WW4pA== 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 4SrBNX3hksz1HZn; Wed, 13 Dec 2023 23:22:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BDNMq4F024661; Wed, 13 Dec 2023 23:22:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BDNMqVd024658; Wed, 13 Dec 2023 23:22:52 GMT (envelope-from git) Date: Wed, 13 Dec 2023 23:22:52 GMT Message-Id: <202312132322.3BDNMqVd024658@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Brooks Davis Subject: git: 83c9481db962 - stable/14 - libc: remove some obsolete VCS data 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 83c9481db962fd8a9e37fcabcc5ef15d1baf1704 Auto-Submitted: auto-generated The branch stable/14 has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=83c9481db962fd8a9e37fcabcc5ef15d1baf1704 commit 83c9481db962fd8a9e37fcabcc5ef15d1baf1704 Author: Brooks Davis AuthorDate: 2023-11-21 22:46:43 +0000 Commit: Brooks Davis CommitDate: 2023-12-13 23:08:50 +0000 libc: remove some obsolete VCS data These wide char support files were copied from the previous versions with expanded $FreeBSD$ strings in #if 0 blocks. Remove them and the scssid definitions in the same #if 0 blocks. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D42688 (cherry picked from commit 9fc0ff9d85b1497b45a4c6d74e0bc7eea9dcf37b) --- lib/libc/locale/wcstoimax.c | 6 ------ lib/libc/locale/wcstoll.c | 6 ------ lib/libc/locale/wcstoull.c | 6 ------ lib/libc/locale/wcstoumax.c | 6 ------ lib/libc/stdio/vswprintf.c | 3 --- lib/libc/stdio/vswscanf.c | 6 ------ 6 files changed, 33 deletions(-) diff --git a/lib/libc/locale/wcstoimax.c b/lib/libc/locale/wcstoimax.c index 2c0997e7ea91..29e12f809812 100644 --- a/lib/libc/locale/wcstoimax.c +++ b/lib/libc/locale/wcstoimax.c @@ -34,12 +34,6 @@ * SUCH DAMAGE. */ -#if 0 -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "from @(#)strtol.c 8.1 (Berkeley) 6/4/93"; -#endif /* LIBC_SCCS and not lint */ -__FBSDID("FreeBSD: src/lib/libc/stdlib/strtoimax.c,v 1.8 2002/09/06 11:23:59 tjr Exp "); -#endif #include #include #include diff --git a/lib/libc/locale/wcstoll.c b/lib/libc/locale/wcstoll.c index 1712c6be3f56..01ee701af016 100644 --- a/lib/libc/locale/wcstoll.c +++ b/lib/libc/locale/wcstoll.c @@ -34,12 +34,6 @@ * SUCH DAMAGE. */ -#if 0 -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)strtoq.c 8.1 (Berkeley) 6/4/93"; -#endif /* LIBC_SCCS and not lint */ -__FBSDID("FreeBSD: src/lib/libc/stdlib/strtoll.c,v 1.19 2002/09/06 11:23:59 tjr Exp "); -#endif #include #include #include diff --git a/lib/libc/locale/wcstoull.c b/lib/libc/locale/wcstoull.c index b2edd3d9cea1..db77acd2a55d 100644 --- a/lib/libc/locale/wcstoull.c +++ b/lib/libc/locale/wcstoull.c @@ -34,12 +34,6 @@ * SUCH DAMAGE. */ -#if 0 -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)strtouq.c 8.1 (Berkeley) 6/4/93"; -#endif /* LIBC_SCCS and not lint */ -__FBSDID("FreeBSD: src/lib/libc/stdlib/strtoull.c,v 1.18 2002/09/06 11:23:59 tjr Exp "); -#endif #include #include #include diff --git a/lib/libc/locale/wcstoumax.c b/lib/libc/locale/wcstoumax.c index bf517965ba3e..6a3861618e3e 100644 --- a/lib/libc/locale/wcstoumax.c +++ b/lib/libc/locale/wcstoumax.c @@ -34,12 +34,6 @@ * SUCH DAMAGE. */ -#if 0 -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "from @(#)strtoul.c 8.1 (Berkeley) 6/4/93"; -#endif /* LIBC_SCCS and not lint */ -__FBSDID("FreeBSD: src/lib/libc/stdlib/strtoumax.c,v 1.8 2002/09/06 11:23:59 tjr Exp "); -#endif #include #include #include diff --git a/lib/libc/stdio/vswprintf.c b/lib/libc/stdio/vswprintf.c index d8c1d6720ebe..e90a05c4cc14 100644 --- a/lib/libc/stdio/vswprintf.c +++ b/lib/libc/stdio/vswprintf.c @@ -34,9 +34,6 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#if 0 -__FBSDID("FreeBSD: src/lib/libc/stdio/vasprintf.c,v 1.16 2002/08/21 16:19:57 mike Exp "); -#endif #include #include #include diff --git a/lib/libc/stdio/vswscanf.c b/lib/libc/stdio/vswscanf.c index 8fecb81f96bb..be21f4a53f7b 100644 --- a/lib/libc/stdio/vswscanf.c +++ b/lib/libc/stdio/vswscanf.c @@ -37,12 +37,6 @@ * SUCH DAMAGE. */ -#if 0 -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)vsscanf.c 8.1 (Berkeley) 6/4/93"; -#endif /* LIBC_SCCS and not lint */ -__FBSDID("FreeBSD: src/lib/libc/stdio/vsscanf.c,v 1.11 2002/08/21 16:19:57 mike Exp "); -#endif #include #include #include From nobody Wed Dec 13 23:22:53 2023 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 4SrBNY66BCz54TCN; Wed, 13 Dec 2023 23:22:53 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SrBNY5bR1z3cTc; Wed, 13 Dec 2023 23:22:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702509773; 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=pwr02h8BKrX+WXiYYpPPC8Bg7awG+VBqsLHj+LcrPJw=; b=f1A2mn6RI9G8Lc7t06EzziOZAhynXrkCJ3gI7TGD3AH8u615jAheXOitS7V/ITJ6jMulWp fAH8aGdRfNOsFUPfasalCYS3x7HAzQsbbo5R/woV01Fdmpk2Hq6aycczlORCt36Mzk8q3f GQAR/VnqFE/dZgIJ79HehOucwvv4nX6y1doJBl+WOVl+BtQ4Irw/ZuVboRY/BjPzPY8IkD 3ifH73gHGGP+/71MTLhZFP8ebhskRR8XBK6HEcLN4LsbKrUQ/TtIgD+nT14gwc07qnQ9PU +sxpCU1WTW0Ojp1WuBJvYqrRaWKYcf8EDrDnypvltUIy5AFkGIqLXBA7xf5iUg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702509773; a=rsa-sha256; cv=none; b=ulZjuqcZjjVGRlO7/MHTuUBF5eFw9QBluJ3V2OB9zOl3EPEd2CyAACuW2A6YSjfCMC22bd BnDgJeNisUhm4LDVtbJEK983APC0LnFTM2vDXYIsPa5CX8WxqVfXqyZgVEvtjA3/s9SD6L sfJFcX6LfgC+TyvTAEl5dbu3uBWcvo9c3qNpMG8aGBa0c5153/9yesYseg3AwuxmL4Bytq SV5P+5eRgME0FYtslChjo3v7SPtOpHI30Df1JWbvrLoDZufe9b0onlWHwqyE/I7Y3RP22W H8MVv5DolyikMtMmXoLWZmmZJud4kZav8H557XTUm25sM4DONYWGHni1287V0w== 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=1702509773; 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=pwr02h8BKrX+WXiYYpPPC8Bg7awG+VBqsLHj+LcrPJw=; b=ptlmGmMt0de76xNDRUWpwqaBsmCePV4ph0ikZfuvBaAwZ6KTuHVHZawY1EC/X/NQtqaco9 YmD8DILKqa5GTyDKDfnOwQs5i6pbLhbpGNDbte3rYdhBEeVtArCME45jVYe964A7ZA/9Ko Z9BVg07m1Kzy4D7SklJmC2jHBvoA1T+Wn9D2ypgvbbr6ndzz49D6r3uBUbcOkki5uxzFhK 6ONiBc7eHvAgoeP6FmS2Y2gyfBPJ4w3wSPiMPkUCIizavfgAMPQ79ZKuIoHrb7CX0MSPHz IXPAypIhIx5NhgboQYXX8CzoNyT4BD9+qs8dlSmh7KwORo67aujprmYFvlqi6w== 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 4SrBNY4SLRz1Hvm; Wed, 13 Dec 2023 23:22:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BDNMrvW024703; Wed, 13 Dec 2023 23:22:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BDNMr7t024700; Wed, 13 Dec 2023 23:22:53 GMT (envelope-from git) Date: Wed, 13 Dec 2023 23:22:53 GMT Message-Id: <202312132322.3BDNMr7t024700@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Brooks Davis Subject: git: 74b8927f82b9 - stable/14 - bzip2: remove locally added __FBSDID 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 74b8927f82b92fd2f1832c84df266a2218061de3 Auto-Submitted: auto-generated The branch stable/14 has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=74b8927f82b92fd2f1832c84df266a2218061de3 commit 74b8927f82b92fd2f1832c84df266a2218061de3 Author: Brooks Davis AuthorDate: 2023-11-27 16:47:22 +0000 Commit: Brooks Davis CommitDate: 2023-12-13 23:08:50 +0000 bzip2: remove locally added __FBSDID Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D42700 (cherry picked from commit ae477ca7da55f76d28859e1bd01cd1051e36f28f) --- contrib/bzip2/bzlib.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/contrib/bzip2/bzlib.c b/contrib/bzip2/bzlib.c index 9496d5abc951..2574a87b2932 100644 --- a/contrib/bzip2/bzlib.c +++ b/contrib/bzip2/bzlib.c @@ -28,9 +28,6 @@ bzBuffToBuffDecompress. Fixed. */ -#include -__FBSDID("$FreeBSD$"); - #include "bzlib_private.h" #ifndef BZ_NO_COMPRESS From nobody Wed Dec 13 23:22:54 2023 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 4SrBNb1ct9z54TWg; Wed, 13 Dec 2023 23:22:55 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SrBNZ6HkBz3cSD; Wed, 13 Dec 2023 23:22:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702509774; 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=8+grV/hJABjZguOOcSml9XYnDIS/P094pFUMay8cXiQ=; b=dWaBBB2nGi8esqvY9J16FULQuIosJcKiNJ8xF6tYqHy8qUQo2STvnTHaN2mijxFrh+W9r4 6Irp6+Mo8evxMa00hzgo2UQIUL+Zez1bWwNc7UwWFQCXXdl3KafPXrYX55YONYHQNKSJIo OvyZKlrYpMLER6GEesUUwC+ogl8hc56c1qge+F7lVnbELF8g/izEE6GJE5u9tIHMpHCohL SlW8Y8G4G4kNkCfw6Nu4b2Q/FRfclNZoJi7tdHpPkCinaBcR2cp5dMuUg1ZXenFa1qgszk d+mmPGRCZrHFBXMEs08pUYVdeaSDUG2xjW7YxQrYew5v/VSJwJ4Ie0ppKEj6tg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702509774; a=rsa-sha256; cv=none; b=kEK0qkoNAb9x/J3AlCHP9sZjifk0uYj3ScT4yOjAmwQ8/Tkp6Gs+xEHzn0NdSCG9yk3iz+ +V1Nqt0dM2Rwk2/j8P+PI/SY1MJ2vc0OoysugFHdLDQhTeLSmbPGPD0zbkUwEK6katim0P 9u83Shi4EVvsPxuSJT9oinG7Da9QqLTE21Se2yb4mdmSIBKLewSuS9KIESkRAGjudBYH6t lyDQfpb5DFus9pZYqyR+lEZJhE3mtqFdZ4Uy6ztbh2H4v27AVHeFmqkqzX0xlSNyxHXT67 u+4njwhnimFZkLOtaElZZEfTZo3s8PemFzJk9uxH5TOjfdb3Qy4T4jqdjExOPw== 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=1702509774; 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=8+grV/hJABjZguOOcSml9XYnDIS/P094pFUMay8cXiQ=; b=jdiN+WAPD8VPNd5pGffGCBJnTarpN1hNlkA1ATOx/upWobG4/5f3yNgvC5yTn29iXzK4dm E3A2D2FQGQMgHKKhEGiG12+kbTcPTvhSej2IOiCyg+ChIRJxsKM9NI6A3ErfHO3tNiyaJy w/EZ0R+Lxe3Nsvru5mlXmdfTDtZtoyXRM3pwJN5SpBfBF6aesg9OUDMhxtgvaTAGqYhWZU VTMpkm8Gg0rjIIaUlXI2nMzkGxt/4Wdb9Yg7hKeh/UZCmOUcNOyoK908Izd801ZKgM6z2B Ze/YIhhh9UC1VExNrwLX4iAE6qvDFXyhvMSoajm0kg7KkQgXSt+u9h0BP43h/Q== 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 4SrBNZ5NRTz1HLk; Wed, 13 Dec 2023 23:22:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BDNMsPh024748; Wed, 13 Dec 2023 23:22:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BDNMsIg024745; Wed, 13 Dec 2023 23:22:54 GMT (envelope-from git) Date: Wed, 13 Dec 2023 23:22:54 GMT Message-Id: <202312132322.3BDNMsIg024745@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Brooks Davis Subject: git: 4fe486b8c82a - stable/14 - ee: remove locally added __FBSDID 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4fe486b8c82a3f38b8162b5a3bace6e7b4e97659 Auto-Submitted: auto-generated The branch stable/14 has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=4fe486b8c82a3f38b8162b5a3bace6e7b4e97659 commit 4fe486b8c82a3f38b8162b5a3bace6e7b4e97659 Author: Brooks Davis AuthorDate: 2023-11-27 16:47:26 +0000 Commit: Brooks Davis CommitDate: 2023-12-13 23:08:50 +0000 ee: remove locally added __FBSDID Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D42701 (cherry picked from commit 3f944f3bb75fe6eae6000511ad19799d90da54ba) --- contrib/ee/ee.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/contrib/ee/ee.c b/contrib/ee/ee.c index 21523ece9c70..072d26519f4c 100644 --- a/contrib/ee/ee.c +++ b/contrib/ee/ee.c @@ -54,9 +54,6 @@ | */ -#include -__FBSDID("$FreeBSD$"); - char *ee_copyright_message = "Copyright (c) 1986, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 2009 Hugh Mahon "; From nobody Wed Dec 13 23:22:55 2023 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 4SrBNc1fV0z54TCP; Wed, 13 Dec 2023 23:22:56 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SrBNc0343z3cM7; Wed, 13 Dec 2023 23:22:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702509776; 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=dmlNIBTpYXzikjY5knP8pKuC6MBtMYl4mLOaqZH+Zwc=; b=F+uN6wFVyTyTytB+GlbCYbKEswuBVao50Ywdo/4PyGiFP76uk0fLNaOnhQCb6tgLeK4yDi tlRMHokcMizWO78gipMsQY83aOK6fDlEDQByKkkCDF13kh/gFClj1IXdzAtnleeczzjpKj pPsP7A4DXb3gZ5F0mnXVO78VGmu4OJDkLzLuYguM1yv/K6RZgmX8QY+HTcrjYoZ4KBegOf fDTonfSdxASXYO1RdDDiIuJZ79rVSMT19GeODqOiERXGbMQwlfp9l+RyIoiTvH3NT6H7r9 FrqCWcOgfmM1B67jopqGnj++0QtXDFsRzCfHM0hgcgEUyMAgJstfLSyRpWt4jw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702509776; a=rsa-sha256; cv=none; b=DFYyZ12sB0j2MkW0vAcUlNBEpOkfCL1cdieNgQWDGkFwq9w2UXVzBxkyrnRgXtcDySpvcv rAZBJDHfZ7IHNf4NMuUoZNptXrTsAfUaWrzWLqBbMPA1OscTgLDJoibfi+qWQzY7pqiF0N J7mYLLuuO8prw9uQVD6HU57cH05l1+AeHtQ12XtfT45o1BgY4YIXjxXud4N3JJLcQr+4Zd H0Hskel9FO6+4BxtYok43V7JMDdgOma5NbIp6v7Rn3gDpCmGlrqFxNvgRavoMfX4t6N5dp zzN7t1Zx+K9P7f7aEuY1+byo6hONfLXYXZ/rQVmnKOOwWUuDgkfhtNl5cf9xXw== 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=1702509776; 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=dmlNIBTpYXzikjY5knP8pKuC6MBtMYl4mLOaqZH+Zwc=; b=RfFIx3zRxLnMAZfgdCk5ywlfjwfDOWH8rCHb6DUSchne4jI8xyQEf7skdrKDc+RzUGLbtq lamz5a1A0AehpFIRreVv59lQdvpY8IMtxkOIsTbl4br2BmIZm+s5CiBpBYEIb8YTJY85rJ jSn3KpMmperJbwnpndFct2UYhdL1UGDikihKTqmkLc5hhywywzt8lBU8P86Ik6/U9fC+zD FT9SnNMnhCm4W6fD7+SqkUIL+BpkW/tQwSuXHOiQY33ZBUGtvv5BjE1tOgI6iiKsU5bPjr Q9+ZNYfGmz1K79E31YA2hWEd7dqqPCI/Lri89who2erGSb+9nmZ9csf54IdjIw== 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 4SrBNb6GWJz1HLl; Wed, 13 Dec 2023 23:22:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BDNMtoY024790; Wed, 13 Dec 2023 23:22:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BDNMt5k024787; Wed, 13 Dec 2023 23:22:55 GMT (envelope-from git) Date: Wed, 13 Dec 2023 23:22:55 GMT Message-Id: <202312132322.3BDNMt5k024787@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Brooks Davis Subject: git: a9bc0a5a0885 - stable/14 - pnpinfo: remove locally added __FBSDID 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a9bc0a5a08852a9572ea90ef6ab294b246705b5c Auto-Submitted: auto-generated The branch stable/14 has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=a9bc0a5a08852a9572ea90ef6ab294b246705b5c commit a9bc0a5a08852a9572ea90ef6ab294b246705b5c Author: Brooks Davis AuthorDate: 2023-11-27 16:47:30 +0000 Commit: Brooks Davis CommitDate: 2023-12-13 23:08:50 +0000 pnpinfo: remove locally added __FBSDID Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D42702 (cherry picked from commit 78e6a1bd063884ae2c42256bcaee6824efbcfbc8) --- contrib/pnpinfo/pnpinfo.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/contrib/pnpinfo/pnpinfo.c b/contrib/pnpinfo/pnpinfo.c index e13ea0d99f57..29f4eb79cbc3 100644 --- a/contrib/pnpinfo/pnpinfo.c +++ b/contrib/pnpinfo/pnpinfo.c @@ -24,9 +24,6 @@ * SUCH DAMAGE. */ -#include -__FBSDID("$FreeBSD$"); - #include #include From nobody Wed Dec 13 23:22:56 2023 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 4SrBNd1mb8z54TRD; Wed, 13 Dec 2023 23:22:57 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SrBNd1DbFz3cdM; Wed, 13 Dec 2023 23:22:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702509777; 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=kjqw3i6TP73Cal5Vign0EXypTXnIcCuZlArY1/LIx1s=; b=cEsdI/5Jf2AJf+3oFs22H1NRwx0B6nhW+jhyfmFRiMAcPAmmugYry4ENt1A1tAgM1PRa8B 417IvEQA5E5id9MIi5HsG1Tx0hg0eexEnJ/AT3P09Lnc7hnpvrMQaHvn6bDwPSMXUwQXIa iIiKSnhvEWEaqV0JWb+wYLP+0yHBtpTNwQMrKf8cpD67yt+uW7e6xGA1lH7LdsmgyOmU/1 dsDX4/xZYC8BVo2ow7rsRg3REDOpz/U/jVk+OLnSsDnU/wqQN0WAwRXxQccEsVYUZ24sV5 0D8PlJOg1Cj+8R2WRS03HKd9DgpTPE9cDnGoS3SjSw1pIaAxNF/qcJqfyUUqjg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702509777; a=rsa-sha256; cv=none; b=YDNG4/J0ATLRqg/04fOJ14+9p0wzNcmMU8BLrBqOCzJ2/M708HGQ4XnkjsPzs8ADdW7gOa QJgY5rbyUqLKddx/Y5SC38LG8eQtWouRYYCUv7N/nohvq2Ghuy1apAcWzMZdXHBkTEDnTm 5YXFfyR3h7hjIsko9sfkjpALhuaSlZkSCYbIVzz7R/o5lUsQwz3pp4sWtRRGPBCdN+Ci4w 2CaVOelWArPt0ydQ14CudEqSGohNmNRSL33j4Ibdl78+XkSbALgickFF2kkBtwRtK5RiJC bjocS9BRx+AZaGZYwzXRga7VWRuhrycEBQuYP+Sz9NcU1l+7AwR2pARBZiOmyA== 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=1702509777; 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=kjqw3i6TP73Cal5Vign0EXypTXnIcCuZlArY1/LIx1s=; b=IK5j/Dor0VSoKWqcZ/9tFRdgOUD3iD2s+YIVpGdJevpZskoYyQIzdWaIHB2k9TUOPHHTMm +BIVRBf0x7UmqN5sxBKjAlhysEDTibtvHnX3xwb1S19C6ejV1zJfJpr2RP35fOBbLMAXN/ JKYWMvPZ67whg6MyE2UT2xFdNn0cvZ3EwElHpHmKTnpRZRPdNHIN566Sfu31wnyrqxLSFR u+BHYq7TgIPeTHg+V35GYm1jAaMPqdqwkLD0OktTVmHcflOiBY2rgJGFYMTdBb3HNr2ADO PUKP0kdBrC7Oc4XpY1iRzdrPTcJ8E5YGCLlqV0rmdMt+VIRrNSAbP2s6taz3LQ== 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 4SrBNd0LQ1z1HZp; Wed, 13 Dec 2023 23:22:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BDNMu2g024832; Wed, 13 Dec 2023 23:22:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BDNMul7024829; Wed, 13 Dec 2023 23:22:56 GMT (envelope-from git) Date: Wed, 13 Dec 2023 23:22:56 GMT Message-Id: <202312132322.3BDNMul7024829@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Brooks Davis Subject: git: 80e123a3c366 - stable/14 - smbfs: remove locally added __FBSDID 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 80e123a3c36654972d142fa4f81854aee14ae8c7 Auto-Submitted: auto-generated The branch stable/14 has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=80e123a3c36654972d142fa4f81854aee14ae8c7 commit 80e123a3c36654972d142fa4f81854aee14ae8c7 Author: Brooks Davis AuthorDate: 2023-11-27 16:47:33 +0000 Commit: Brooks Davis CommitDate: 2023-12-13 23:08:51 +0000 smbfs: remove locally added __FBSDID Differential Revision: https://reviews.freebsd.org/D42703 (cherry picked from commit a159b74a5d86e89eb86dcb5df3ec402e662012a6) --- contrib/smbfs/lib/smb/mbuf.c | 3 --- contrib/smbfs/lib/smb/nb_name.c | 3 --- contrib/smbfs/lib/smb/nls.c | 3 --- contrib/smbfs/lib/smb/rcfile.c | 3 --- 4 files changed, 12 deletions(-) diff --git a/contrib/smbfs/lib/smb/mbuf.c b/contrib/smbfs/lib/smb/mbuf.c index 729b5c53d11e..ac3b94524683 100644 --- a/contrib/smbfs/lib/smb/mbuf.c +++ b/contrib/smbfs/lib/smb/mbuf.c @@ -32,9 +32,6 @@ * $Id: mbuf.c,v 1.6 2001/02/24 15:56:04 bp Exp $ */ -#include -__FBSDID("$FreeBSD$"); - #include #include #include diff --git a/contrib/smbfs/lib/smb/nb_name.c b/contrib/smbfs/lib/smb/nb_name.c index a953ce0a0a9c..319d3c353b01 100644 --- a/contrib/smbfs/lib/smb/nb_name.c +++ b/contrib/smbfs/lib/smb/nb_name.c @@ -32,9 +32,6 @@ * $Id: nb_name.c,v 1.2 2001/08/22 03:31:36 bp Exp $ */ -#include -__FBSDID("$FreeBSD$"); - #include #include #include diff --git a/contrib/smbfs/lib/smb/nls.c b/contrib/smbfs/lib/smb/nls.c index b79d49c29c58..99693f3aba84 100644 --- a/contrib/smbfs/lib/smb/nls.c +++ b/contrib/smbfs/lib/smb/nls.c @@ -32,9 +32,6 @@ * $Id: nls.c,v 1.10 2002/07/22 08:33:59 bp Exp $ */ -#include -__FBSDID("$FreeBSD$"); - #include #include #include diff --git a/contrib/smbfs/lib/smb/rcfile.c b/contrib/smbfs/lib/smb/rcfile.c index 26a31d6f37ee..f97cb5abbf35 100644 --- a/contrib/smbfs/lib/smb/rcfile.c +++ b/contrib/smbfs/lib/smb/rcfile.c @@ -32,9 +32,6 @@ * $Id: rcfile.c,v 1.5 2001/04/16 12:46:46 bp Exp $ */ -#include -__FBSDID("$FreeBSD$"); - #include #include #include From nobody Wed Dec 13 23:22:58 2023 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 4SrBNf3lwZz54TCW; Wed, 13 Dec 2023 23:22:58 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SrBNf2w60z3chg; Wed, 13 Dec 2023 23:22:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702509778; 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=1gcSNonaTaYnEp5X0EhqVrNCe+UDMWBiXuY2FSIPuXI=; b=KKFpgcBbZigRvOduGrW/kAtc/aVk869By+WaHuCb44gMFUnZR08tS+bioGW+AsSyYr31xt TlEZNMzbS6v/7sQCzJqXtWpTtTYYBJl8tuF1O+XWlI4bq/BlAVnSIGfGevSvXJ99sNAL5H ++O5igrDFvM0eQTidiczDf4rd8wJ37qvOXIdqWxHbIsSutJl5v3z5+DZScrvA7yPskttod AdM0DXc1AynVz6oJWw5Q2egWm0WPsuqHa+H3KCmEYIkc6da3IHKOrSvW2bTIgzN/q8Y/O+ U3rkh0iKN0yloSkNbmjDi4jB7qdB5/wyrpNnWP9t1nusmhRDDl4IPjg/KKmb0w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702509778; a=rsa-sha256; cv=none; b=yY7olAYY3FAyzSz8jGWoLCilaOn/4LkBWTpFU0WMCDjRvf6ggwMSm/cwrMfXUxBQuNfV+3 uvfpjMvAbEpeMGdg10lFx/oay3uequgdXxnFulfgsgw+CIP3tAX/P0NNHQLsPQC10wVYiE 8u51Wg9hR7P5hD8M2otSh/BCAyeItYJBFj51XfrPxBMAmzlzLzKqQ5VE1fnv3+6m8pUyIs Uu4MDDOiIZ2s86p+wL0SqJvBBP/9JI3QaFiYNMikw35mVx/4rpzSeeKNpk+b04h/Bmoc6e sMpLmYls10DRnO3Mbv35c22f+LY7115Pog2GQ7S/1MdY19o+Iz4qikC0G5hOyA== 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=1702509778; 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=1gcSNonaTaYnEp5X0EhqVrNCe+UDMWBiXuY2FSIPuXI=; b=rvhxTfNMzW6wPEs1sI12U2SLa8ke1ADTDlZ5XX8rLYMnmN9CiN1zMQ1zvbzE5jGIogbACi xncWDXhFcW36R1E+LN/7+R+WINSKp0+StQsTRAA5ondcmK7pz2/WsNCqHEG4fFEQi370io byBJWPUhVH01rt5DobHf8bx1ZiLNQQJ6bANpYzclHBSsGHo+VXrrnqCrlnxmUAfH3Y4lMo mTTva1x8ql15ZrGwdbnh+p3eEBWLMEIEUyxCvP4quGKtcj5RCQpQxVgB3Q4XTb7NnZk3pX PuZohdTHZVSsiYsoOqyqUVWQIbsTkKoCvyVKvZW0lfKIC62hE+FwtuKbTQsr7A== 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 4SrBNf1sMsz1Hhh; Wed, 13 Dec 2023 23:22:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BDNMwUv024880; Wed, 13 Dec 2023 23:22:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BDNMwdV024876; Wed, 13 Dec 2023 23:22:58 GMT (envelope-from git) Date: Wed, 13 Dec 2023 23:22:58 GMT Message-Id: <202312132322.3BDNMwdV024876@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Brooks Davis Subject: git: 9d39900498eb - stable/14 - telnet: remove locally added __FBSDID 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9d39900498eb815570c8ffdc760c222d52041f48 Auto-Submitted: auto-generated The branch stable/14 has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=9d39900498eb815570c8ffdc760c222d52041f48 commit 9d39900498eb815570c8ffdc760c222d52041f48 Author: Brooks Davis AuthorDate: 2023-11-27 16:47:37 +0000 Commit: Brooks Davis CommitDate: 2023-12-13 23:08:51 +0000 telnet: remove locally added __FBSDID This partially reverts 77b7cdf1999ee965ad494fddd184b18f532ac91a. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D42704 (cherry picked from commit a3c858005cae175e277f6f6735ca9eaea7eaf3c3) --- contrib/telnet/libtelnet/auth.c | 3 --- contrib/telnet/libtelnet/enc_des.c | 2 -- contrib/telnet/libtelnet/encrypt.c | 4 ---- contrib/telnet/libtelnet/genget.c | 4 ---- contrib/telnet/libtelnet/getent.c | 4 ---- contrib/telnet/libtelnet/kerberos.c | 4 ---- contrib/telnet/libtelnet/kerberos5.c | 4 ---- contrib/telnet/libtelnet/krb4encpwd.c | 4 ---- contrib/telnet/libtelnet/misc.c | 4 ---- contrib/telnet/libtelnet/pk.c | 4 ---- contrib/telnet/libtelnet/read_password.c | 4 ---- contrib/telnet/libtelnet/rsaencpwd.c | 4 ---- contrib/telnet/libtelnet/sra.c | 4 ---- contrib/telnet/telnet/authenc.c | 2 -- contrib/telnet/telnet/commands.c | 2 -- contrib/telnet/telnet/main.c | 2 -- contrib/telnet/telnet/network.c | 2 -- contrib/telnet/telnet/ring.c | 2 -- contrib/telnet/telnet/sys_bsd.c | 2 -- contrib/telnet/telnet/telnet.c | 2 -- contrib/telnet/telnet/terminal.c | 2 -- contrib/telnet/telnet/utilities.c | 2 -- 22 files changed, 67 deletions(-) diff --git a/contrib/telnet/libtelnet/auth.c b/contrib/telnet/libtelnet/auth.c index 3488edd84b1c..fa1cfdc52869 100644 --- a/contrib/telnet/libtelnet/auth.c +++ b/contrib/telnet/libtelnet/auth.c @@ -33,9 +33,6 @@ static const char sccsid[] = "@(#)auth.c 8.3 (Berkeley) 5/30/95"; #endif /* not lint */ #endif -#include -__FBSDID("$FreeBSD$"); - /* * Copyright (C) 1990 by the Massachusetts Institute of Technology diff --git a/contrib/telnet/libtelnet/enc_des.c b/contrib/telnet/libtelnet/enc_des.c index 2c12ad5e0cf2..0cd9cb44ce05 100644 --- a/contrib/telnet/libtelnet/enc_des.c +++ b/contrib/telnet/libtelnet/enc_des.c @@ -32,8 +32,6 @@ static const char sccsid[] = "@(#)enc_des.c 8.3 (Berkeley) 5/30/95"; #endif /* not lint */ #endif -#include -__FBSDID("$FreeBSD$"); #ifdef ENCRYPTION # ifdef AUTHENTICATION diff --git a/contrib/telnet/libtelnet/encrypt.c b/contrib/telnet/libtelnet/encrypt.c index 398c7321510c..3c4a2ab1abc1 100644 --- a/contrib/telnet/libtelnet/encrypt.c +++ b/contrib/telnet/libtelnet/encrypt.c @@ -27,10 +27,6 @@ * SUCH DAMAGE. */ -#include - -__FBSDID("$FreeBSD$"); - #ifndef lint #if 0 static const char sccsid[] = "@(#)encrypt.c 8.2 (Berkeley) 5/30/95"; diff --git a/contrib/telnet/libtelnet/genget.c b/contrib/telnet/libtelnet/genget.c index e7b48f6b2af0..4bb119315746 100644 --- a/contrib/telnet/libtelnet/genget.c +++ b/contrib/telnet/libtelnet/genget.c @@ -27,10 +27,6 @@ * SUCH DAMAGE. */ -#include - -__FBSDID("$FreeBSD$"); - #ifndef lint #if 0 static const char sccsid[] = "@(#)genget.c 8.2 (Berkeley) 5/30/95"; diff --git a/contrib/telnet/libtelnet/getent.c b/contrib/telnet/libtelnet/getent.c index 3df81409a7d8..3be745e96c0b 100644 --- a/contrib/telnet/libtelnet/getent.c +++ b/contrib/telnet/libtelnet/getent.c @@ -27,10 +27,6 @@ * SUCH DAMAGE. */ -#include - -__FBSDID("$FreeBSD$"); - #ifndef lint #if 0 static char sccsid[] = "@(#)getent.c 8.2 (Berkeley) 12/15/93"; diff --git a/contrib/telnet/libtelnet/kerberos.c b/contrib/telnet/libtelnet/kerberos.c index 5f00fd40187f..a5dc774d54ca 100644 --- a/contrib/telnet/libtelnet/kerberos.c +++ b/contrib/telnet/libtelnet/kerberos.c @@ -27,10 +27,6 @@ * SUCH DAMAGE. */ -#include - -__FBSDID("$FreeBSD$"); - #ifndef lint static const char sccsid[] = "@(#)kerberos.c 8.3 (Berkeley) 5/30/95"; #endif /* not lint */ diff --git a/contrib/telnet/libtelnet/kerberos5.c b/contrib/telnet/libtelnet/kerberos5.c index 63f515310f9b..bc90ec9cfa6a 100644 --- a/contrib/telnet/libtelnet/kerberos5.c +++ b/contrib/telnet/libtelnet/kerberos5.c @@ -47,10 +47,6 @@ * or implied warranty. */ -#include - -__FBSDID("$FreeBSD$"); - #ifdef KRB5 #include diff --git a/contrib/telnet/libtelnet/krb4encpwd.c b/contrib/telnet/libtelnet/krb4encpwd.c index e87b5c41272e..345e24317228 100644 --- a/contrib/telnet/libtelnet/krb4encpwd.c +++ b/contrib/telnet/libtelnet/krb4encpwd.c @@ -27,10 +27,6 @@ * SUCH DAMAGE. */ -#include - -__FBSDID("$FreeBSD$"); - #ifndef lint static char sccsid[] = "@(#)krb4encpwd.c 8.3 (Berkeley) 5/30/95"; #endif /* not lint */ diff --git a/contrib/telnet/libtelnet/misc.c b/contrib/telnet/libtelnet/misc.c index ef5de4ee45e7..a514376e2b69 100644 --- a/contrib/telnet/libtelnet/misc.c +++ b/contrib/telnet/libtelnet/misc.c @@ -27,10 +27,6 @@ * SUCH DAMAGE. */ -#include - -__FBSDID("$FreeBSD$"); - #ifndef lint #if 0 static const char sccsid[] = "@(#)misc.c 8.1 (Berkeley) 6/4/93"; diff --git a/contrib/telnet/libtelnet/pk.c b/contrib/telnet/libtelnet/pk.c index a3d17f396c64..a36733c4e73d 100644 --- a/contrib/telnet/libtelnet/pk.c +++ b/contrib/telnet/libtelnet/pk.c @@ -28,10 +28,6 @@ * */ -#include - -__FBSDID("$FreeBSD$"); - /* public key routines */ /* functions: genkeys(char *public, char *secret) diff --git a/contrib/telnet/libtelnet/read_password.c b/contrib/telnet/libtelnet/read_password.c index 0faaa09c57d5..37baf92e288d 100644 --- a/contrib/telnet/libtelnet/read_password.c +++ b/contrib/telnet/libtelnet/read_password.c @@ -27,10 +27,6 @@ * SUCH DAMAGE. */ -#include - -__FBSDID("$FreeBSD$"); - #ifndef lint #if 0 static char sccsid[] = "@(#)read_password.c 8.3 (Berkeley) 5/30/95"; diff --git a/contrib/telnet/libtelnet/rsaencpwd.c b/contrib/telnet/libtelnet/rsaencpwd.c index 9dcf4a658cf6..10225ac0070b 100644 --- a/contrib/telnet/libtelnet/rsaencpwd.c +++ b/contrib/telnet/libtelnet/rsaencpwd.c @@ -27,10 +27,6 @@ * SUCH DAMAGE. */ -#include - -__FBSDID("$FreeBSD$"); - #ifndef lint static char sccsid[] = "@(#)rsaencpwd.c 8.3 (Berkeley) 5/30/95"; #endif /* not lint */ diff --git a/contrib/telnet/libtelnet/sra.c b/contrib/telnet/libtelnet/sra.c index 4a759685ca42..abacda12b495 100644 --- a/contrib/telnet/libtelnet/sra.c +++ b/contrib/telnet/libtelnet/sra.c @@ -28,10 +28,6 @@ * */ -#include - -__FBSDID("$FreeBSD$"); - #ifdef SRA #ifdef ENCRYPTION #include diff --git a/contrib/telnet/telnet/authenc.c b/contrib/telnet/telnet/authenc.c index 593d061d125d..6fd4b9f4dd85 100644 --- a/contrib/telnet/telnet/authenc.c +++ b/contrib/telnet/telnet/authenc.c @@ -32,8 +32,6 @@ static const char sccsid[] = "@(#)authenc.c 8.1 (Berkeley) 6/6/93"; #endif #endif -#include -__FBSDID("$FreeBSD$"); #ifdef AUTHENTICATION #ifdef ENCRYPTION diff --git a/contrib/telnet/telnet/commands.c b/contrib/telnet/telnet/commands.c index dbc06a10b9c6..ca3460e455ad 100644 --- a/contrib/telnet/telnet/commands.c +++ b/contrib/telnet/telnet/commands.c @@ -32,8 +32,6 @@ static const char sccsid[] = "@(#)commands.c 8.4 (Berkeley) 5/30/95"; #endif #endif -#include -__FBSDID("$FreeBSD$"); #include #include diff --git a/contrib/telnet/telnet/main.c b/contrib/telnet/telnet/main.c index 8ebcc0a86259..973e2b09a58f 100644 --- a/contrib/telnet/telnet/main.c +++ b/contrib/telnet/telnet/main.c @@ -32,8 +32,6 @@ static const char sccsid[] = "@(#)main.c 8.3 (Berkeley) 5/30/95"; #endif #endif -#include -__FBSDID("$FreeBSD$"); #include #include diff --git a/contrib/telnet/telnet/network.c b/contrib/telnet/telnet/network.c index 9a62e8a94fab..438673ce3e0e 100644 --- a/contrib/telnet/telnet/network.c +++ b/contrib/telnet/telnet/network.c @@ -32,8 +32,6 @@ static const char sccsid[] = "@(#)network.c 8.2 (Berkeley) 12/15/93"; #endif #endif -#include -__FBSDID("$FreeBSD$"); #include #include diff --git a/contrib/telnet/telnet/ring.c b/contrib/telnet/telnet/ring.c index 138e3c661045..d0e194c7d413 100644 --- a/contrib/telnet/telnet/ring.c +++ b/contrib/telnet/telnet/ring.c @@ -32,8 +32,6 @@ static const char sccsid[] = "@(#)ring.c 8.2 (Berkeley) 5/30/95"; #endif #endif -#include -__FBSDID("$FreeBSD$"); /* * This defines a structure for a ring buffer. diff --git a/contrib/telnet/telnet/sys_bsd.c b/contrib/telnet/telnet/sys_bsd.c index fd57df7a88a3..01209782cdbb 100644 --- a/contrib/telnet/telnet/sys_bsd.c +++ b/contrib/telnet/telnet/sys_bsd.c @@ -32,8 +32,6 @@ static const char sccsid[] = "@(#)sys_bsd.c 8.4 (Berkeley) 5/30/95"; #endif #endif -#include -__FBSDID("$FreeBSD$"); /* * The following routines try to encapsulate what is system dependent diff --git a/contrib/telnet/telnet/telnet.c b/contrib/telnet/telnet/telnet.c index b6b2432ef3ec..a35ea40c4cd8 100644 --- a/contrib/telnet/telnet/telnet.c +++ b/contrib/telnet/telnet/telnet.c @@ -32,8 +32,6 @@ static const char sccsid[] = "@(#)telnet.c 8.4 (Berkeley) 5/30/95"; #endif #endif -#include -__FBSDID("$FreeBSD$"); #include diff --git a/contrib/telnet/telnet/terminal.c b/contrib/telnet/telnet/terminal.c index b42f861c6f30..dccfab410998 100644 --- a/contrib/telnet/telnet/terminal.c +++ b/contrib/telnet/telnet/terminal.c @@ -32,8 +32,6 @@ static const char sccsid[] = "@(#)terminal.c 8.2 (Berkeley) 2/16/95"; #endif #endif -#include -__FBSDID("$FreeBSD$"); #include #include diff --git a/contrib/telnet/telnet/utilities.c b/contrib/telnet/telnet/utilities.c index 36432e6a32f0..516c1e5e538a 100644 --- a/contrib/telnet/telnet/utilities.c +++ b/contrib/telnet/telnet/utilities.c @@ -32,8 +32,6 @@ static const char sccsid[] = "@(#)utilities.c 8.3 (Berkeley) 5/30/95"; #endif #endif -#include -__FBSDID("$FreeBSD$"); #define TELOPTS #define TELCMDS From nobody Wed Dec 13 23:22:59 2023 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 4SrBNh1LNWz54TTY; Wed, 13 Dec 2023 23:23:00 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SrBNg3wYZz3d1V; Wed, 13 Dec 2023 23:22:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702509779; 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=Dm/BeSmkh8KZjktortXD36HKCDHTexb6ewYXbtNgVeM=; b=sOvfAtTBpL9SXaXa0zqVMbrTUQ2CXSXKXJo/WAJ9kVCbAP0plJIOajSywSjLc1xXiPMvaM 0DBXQGqoi/733LtJv2sJE+C/LKNk/YwCXuQAFlwq4P4sbfj5p8pXq0uOZK7fCzUJ4fJkOX tSMTOcM7K0y1IKU1wsmhfr1pj7wIK5EGehrytC0lmt+SyV3xwEvOoi0/khwHr7X/rXtK8T EhjH5QzCQJSdXy40uL56ZlyV6y3DCcZxl+QVH33KqGr1GZ88x6nUp1PW+kaEsk/upzG0+i 4OFup80+ZNuQgJPOO+PgLostmSTkjeUMhXxjq8q3BMyIjZWHwycVTBSu6Ggecw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702509779; a=rsa-sha256; cv=none; b=pJwuz8tlPEIzLB8vMROnbw7JFbfpmBfrK8szSyGByxMQ8nCu7pBnoe7fgAgOhyb2YZbNmH p6TnHPrl9drTj01ZusLV1c9NkSGdQJOnI4Zw4tHcDP/VBLLl6ITju2FCpgYE/26K4WnBXC FWiQOucHnlLI4obtVTdZGKm6mOzwrBnuLL3s3AScN0Fm/eCMoQg2a+GbFemKXQzpdRSiVC mUuddPXft1Ivm/fY4FHTtPvQ/5wCvA9fGy/m4VEAvi7O5Rz02PWd+JdEXj9dY72Wh4ytgx CllA+hogLNLH3N3bo0l4uhnknFvs0cYFp5oxvQ74prrb3QsebyG1BwQqw5g7mw== 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=1702509779; 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=Dm/BeSmkh8KZjktortXD36HKCDHTexb6ewYXbtNgVeM=; b=UcgKhVvhJQT7lp310w72CdSpDylyjHaf4hwwLxa5rU2np/Qt+FZAQeYhSaXqFuLUnaZS4q KWJLNf53D3NgxEpYtoqJtGG7muppJ6rlwp3YfoHBWacUj8lQr3HXKIxLD2BORVfEoCTyrV iZAHr6tqb0OLZWtdbaEiv6KPIhnJqZr3Vb6CzFgRUsgOdTkBj/T6ra5nD8NMYPLPjwmKuz ntF4OinKc7nTpRfhc0UEz+nw+ChsnyY0oKsK+sD8Yrsxv3tRuAZwON3SGn7JBT0oxOI9+U IcVSVYruF7KCnByC4WOVLnicf3H9J8++HyVABPl+Dj558fhI+Ma72UhZ88Pp/g== 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 4SrBNg30MYz1J97; Wed, 13 Dec 2023 23:22:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BDNMxQq024923; Wed, 13 Dec 2023 23:22:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BDNMxIB024921; Wed, 13 Dec 2023 23:22:59 GMT (envelope-from git) Date: Wed, 13 Dec 2023 23:22:59 GMT Message-Id: <202312132322.3BDNMxIB024921@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Brooks Davis Subject: git: edcdfc5b681b - stable/14 - x86emu: remove localy added __FBSDID 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: edcdfc5b681be089fcb42fef0ed609ec96e2faf6 Auto-Submitted: auto-generated The branch stable/14 has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=edcdfc5b681be089fcb42fef0ed609ec96e2faf6 commit edcdfc5b681be089fcb42fef0ed609ec96e2faf6 Author: Brooks Davis AuthorDate: 2023-11-27 16:47:41 +0000 Commit: Brooks Davis CommitDate: 2023-12-13 23:08:51 +0000 x86emu: remove localy added __FBSDID This partially reverts 0a2e9846fdf3f3d42a9ee65d0d8669f6be11c879. Reviewed by: imp, delphij Differential Revision: https://reviews.freebsd.org/D42705 (cherry picked from commit 3faba3002f466e1bdad4767c55257e04433ee96b) --- sys/contrib/x86emu/x86emu.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/sys/contrib/x86emu/x86emu.c b/sys/contrib/x86emu/x86emu.c index 60a154952f27..44c322849754 100644 --- a/sys/contrib/x86emu/x86emu.c +++ b/sys/contrib/x86emu/x86emu.c @@ -32,9 +32,6 @@ * */ -#include -__FBSDID("$FreeBSD$"); - #include #include From nobody Wed Dec 13 23:23:00 2023 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 4SrBNj0Fnsz54TRG; Wed, 13 Dec 2023 23:23:01 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SrBNh55xBz3d3d; Wed, 13 Dec 2023 23:23:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702509780; 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=+EHxpfQ3l7hji1hi43GWdX6O1K6iKzNC08B+IAMutTA=; b=WhArmJ867fz/vImqRgdVXFmVcgfyzuHOUG0H5+DwzuGbthaKgV6Io8QAcC6f1v/Y0Xqlkp O7wdAdaW/CaYwJFsrePxDhht6zkWOq2C4i8OTY/TJTa4wcQoOc12rgTNhKYaXTIxL2+UJC TE7ckOyv3lfH7eONi1F42/LvD+REDHYFoBaYqTdCRtwji3O4lc/KWwJg5G2h3U6rQtEm3f ri/5PJdqj93lyeV00B9jZTukANAgucf/9+209SglrlVKp+6RWie7aCdkkfs6JxIJ/s223m +ZX69KnsIVEqqmhhel5LH/Q1pZP9DCQhaA+dboVp+u+RvkBr3pA2haNYnHDE7Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702509780; a=rsa-sha256; cv=none; b=dhWmeCDh3z3cE4XxcEyv1djAIYFzDKp0ZpF//TGTzLp5Q4gDr1E2Pm3bHmuMNiwuy3NFku lpYB7uRbj5xiq2wSJKTatlF0amuk9z6oonvx8hkEDf8WnsN6lKZRfaofWfsZzcYeeeqz6S GB+4eDfF8Zn5nwVzwTfFK9t10ESSFA57ac0iU0tx10xug/1OoTeq+V5zQ7zH8MwUrQHTVH 7mCiS1TxDu/O4KTMqG2jr2Pt+wuZ8fu2czK+9R2cUQkd3XzU3zBhXqkcbyR8EJbn1OguOV mDmn1PYIiHccLBx0XG+VbL4uxX+BuTiURold+pMoe3JI18y5Vs5MEq7saGHtHA== 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=1702509780; 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=+EHxpfQ3l7hji1hi43GWdX6O1K6iKzNC08B+IAMutTA=; b=pLEnDmXTdJ5AU9PzNHhbMDTZ5hW9OeP8RjGZN6XHpieSiywp2a0r0WAgrB1PR3hGkIbHRq 6HEVhnqKdzPC5w1Ol+ZLD06g8d482VEmjayqb8K7U9zoXBEyBa/6xFzNhAxZ8TofI2U3N/ Z3Lk0AFWsf/tJ3sb6rmWdKggSzRqqV+gJN7tFhZnMADbnGksr1aE20OTfjQOS5p7vbezaS bjd5aLRijQdbUOM9vfs1RXIQQH60u3m4QVLPeNPDizOJXcQd8QCfCAc+u7mu+NhsWvaw2m 3oRo679ANVkHLpVvklxEZbVEzXmWNo7s+wFbftqPxT6zWqUuiu+bMqTis8L7hg== 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 4SrBNh4CM4z1HyM; Wed, 13 Dec 2023 23:23:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BDNN0CD024974; Wed, 13 Dec 2023 23:23:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BDNN0qA024971; Wed, 13 Dec 2023 23:23:00 GMT (envelope-from git) Date: Wed, 13 Dec 2023 23:23:00 GMT Message-Id: <202312132323.3BDNN0qA024971@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Brooks Davis Subject: git: cc77811bf02c - stable/14 - sysvipc: Fix 32-bit compat on !i386 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: cc77811bf02c4a32c5303fc9de1e4596bbbc94e1 Auto-Submitted: auto-generated The branch stable/14 has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=cc77811bf02c4a32c5303fc9de1e4596bbbc94e1 commit cc77811bf02c4a32c5303fc9de1e4596bbbc94e1 Author: Brooks Davis AuthorDate: 2023-12-01 20:48:29 +0000 Commit: Brooks Davis CommitDate: 2023-12-13 23:10:53 +0000 sysvipc: Fix 32-bit compat on !i386 The various time fields are time_t's which are only 32-bit on i386. Fixing the old versions is probably of little use, but it's more correct and in theory there could be powerpc binaries from 6.x. PR: 240035 Fixes: fbb273bc05bef Properly support for FreeBSD 4 32bit System V shared memory. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D42870 (cherry picked from commit 957f014dc076a7f74ed0c8c8699e6f39b55785e7) --- sys/compat/freebsd32/freebsd32_ipc.h | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/sys/compat/freebsd32/freebsd32_ipc.h b/sys/compat/freebsd32/freebsd32_ipc.h index e74f4659247f..4ff8af359428 100644 --- a/sys/compat/freebsd32/freebsd32_ipc.h +++ b/sys/compat/freebsd32/freebsd32_ipc.h @@ -43,8 +43,8 @@ struct semid_ds32 { struct ipc_perm32 sem_perm; uint32_t __sem_base; unsigned short sem_nsems; - int32_t sem_otime; - int32_t sem_ctime; + time32_t sem_otime; + time32_t sem_ctime; }; #ifdef _KERNEL @@ -73,9 +73,9 @@ struct msqid_ds32 { uint32_t msg_qbytes; pid_t msg_lspid; pid_t msg_lrpid; - int32_t msg_stime; - int32_t msg_rtime; - int32_t msg_ctime; + time32_t msg_stime; + time32_t msg_rtime; + time32_t msg_ctime; }; #ifdef _KERNEL @@ -95,9 +95,9 @@ struct shmid_ds32 { pid_t shm_lpid; pid_t shm_cpid; unsigned int shm_nattch; - int32_t shm_atime; - int32_t shm_dtime; - int32_t shm_ctime; + time32_t shm_atime; + time32_t shm_dtime; + time32_t shm_ctime; }; #ifdef _KERNEL @@ -142,9 +142,9 @@ struct semid_ds_old32 { struct ipc_perm_old32 sem_perm; uint32_t __sem_base; unsigned short sem_nsems; - int32_t sem_otime; + time32_t sem_otime; int32_t sem_pad1; - int32_t sem_ctime; + time32_t sem_ctime; int32_t sem_pad2; int32_t sem_pad3[4]; }; @@ -158,11 +158,11 @@ struct msqid_ds_old32 { uint32_t msg_qbytes; pid_t msg_lspid; pid_t msg_lrpid; - int32_t msg_stime; + time32_t msg_stime; int32_t msg_pad1; - int32_t msg_rtime; + time32_t msg_rtime; int32_t msg_pad2; - int32_t msg_ctime; + time32_t msg_ctime; int32_t msg_pad3; int32_t msg_pad4[4]; }; @@ -173,9 +173,9 @@ struct shmid_ds_old32 { pid_t shm_lpid; pid_t shm_cpid; int16_t shm_nattch; - int32_t shm_atime; - int32_t shm_dtime; - int32_t shm_ctime; + time32_t shm_atime; + time32_t shm_dtime; + time32_t shm_ctime; uint32_t shm_internal; }; From nobody Thu Dec 14 11:05:19 2023 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 4SrTz33F75z53prq; Thu, 14 Dec 2023 11:05:19 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SrTz32q3Yz4TCV; Thu, 14 Dec 2023 11:05:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702551919; 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=T9xuGeagLnBESg+jDIy9vJDAQJwiQLMo0IGfxz95FLA=; b=B9verkWg7iEhIBIAfsy8cJkbXNM/hx9CC7cAGQ8sNVlG/bqFUfA+0BsSVUzqpQcCQmMBwK YU2Wad90YWJdsLqrkkTfZCqSnz+b6OeyAfew/uarjCkuEeA/GqkHMgt4gpTJBOshIlhUBM AMnN1tBhYtL/VElMgTNjoY1TFl6fEGlMCc94W++4bMdXnHIXU1Zqivmn/tEBc1J9Yz3bJ5 tmBqskLvw3HpVT8hADkd/PEDS6nkMQne77PAqzRSRnbKXdzHk+/9MjDtgto49sSQll1kQq YFNF1ELBfDq2QMdyl+1w3XTWE56J0K2dCIWv7BUSKjnH50gZlbJrXWqkWB7jUg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702551919; a=rsa-sha256; cv=none; b=LFzM3fkzhbHGn48hcr/I9p1W/5Vob2PVExOvHdh0F9H0LeUwATb3DgAj1sPkAPTCcLvDnQ UvGTb2r4z8ev7GJBZvMBAyG6H1lO4k0pcKA6d2Lu0OD7FSQmRBINdz9B9/xcqBpSc5+JMf 4Bc82lF3a2sa8ax/6cacNQIA2rzxEc03JaC7NLp0EXzFuA/5bAHCugsRfsVokF7x/L2XY/ rwGWBApqxy+fumN37Kr7BHml4gCHlL0khf3LN1bDMJOXM4Chrs/GJf9+TveYR/b0yO8Ss8 veBestljy/nckSA+/aQ3XLi6qriCBvGp6sktGjzvNx8owmFjSmDOaoIah3dWLA== 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=1702551919; 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=T9xuGeagLnBESg+jDIy9vJDAQJwiQLMo0IGfxz95FLA=; b=lFvtkZIHNGhyKrysj/uAqrq2nboQrU3atfSd+ujuWAEPzzFk6xP+tJUZmgWTQdwcb3ej95 KClUG/bdNkwYT3WlmvLiMHoEr+2JPoXg4VxqSEUaM81b4vonatziG1Jw9VOGZW/VlCWJy9 +le1WAiiBJqo7sHZKlWjW3+nbzTcxebdCSPRp/oMpuvPIL1XMthM7ZxcDAZz6wHI+48Ntp gf/RQ5ruSqaCduR57QJw2oYtfqPBvvFohak7XuJ0nwJnCIyH9hzdsdijCVamAt/4U2sRFW 7F7hIBT/UL41BuTHUTfkMO7q9U9QNijUHLxRd5OqXWfy7tMxccjKQEABw/UbJQ== 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 4SrTz31mFyz994; Thu, 14 Dec 2023 11:05:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BEB5JnL010709; Thu, 14 Dec 2023 11:05:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BEB5Jgs010706; Thu, 14 Dec 2023 11:05:19 GMT (envelope-from git) Date: Thu, 14 Dec 2023 11:05:19 GMT Message-Id: <202312141105.3BEB5Jgs010706@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Richard Scheffenegger Subject: git: 35707083c6fb - stable/14 - tcp: shift PRR sending cadence slightly left 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rscheff X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 35707083c6fb47d28aea5e421ea99b3f0daea0a6 Auto-Submitted: auto-generated The branch stable/14 has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=35707083c6fb47d28aea5e421ea99b3f0daea0a6 commit 35707083c6fb47d28aea5e421ea99b3f0daea0a6 Author: Richard Scheffenegger AuthorDate: 2023-12-07 14:13:05 +0000 Commit: Richard Scheffenegger CommitDate: 2023-12-14 10:13:09 +0000 tcp: shift PRR sending cadence slightly left Don't let PRR pass up on the opportunity of clocking out packets on arrival of ACKs - by pulling sends forward by about half a packet. Prevents unexpectedly long runs of incoming ACKs without eliciting a packet transmission. MFC after: 1 week Reviewed By: #transport, tuexen Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D42918 (cherry picked from commit 9276ad23b872eddc42e05304acb10bf5421b043c) --- sys/netinet/tcp_input.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 11ec7d2d74d2..15b7311f4605 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -3972,7 +3972,7 @@ tcp_do_prr_ack(struct tcpcb *tp, struct tcphdr *th, struct tcpopt *to) imax(1, tp->snd_nxt - tp->snd_una); snd_cnt = howmany((long)tp->sackhint.prr_delivered * tp->snd_ssthresh, tp->sackhint.recover_fs) - - tp->sackhint.prr_out; + tp->sackhint.prr_out + maxseg - 1; } else { if (V_tcp_do_prr_conservative || (del_data == 0)) limit = tp->sackhint.prr_delivered - From nobody Thu Dec 14 11:20:40 2023 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 4SrVJm51lyz53qZf; Thu, 14 Dec 2023 11:20:40 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SrVJm30dGz4Vgt; Thu, 14 Dec 2023 11:20:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702552840; 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=n1pkKDeauOgbxq59fadfEmIic7baAiNq4RZdxMuIOSE=; b=xqORuhg5dpN50VvwyPJg37V3QySWAGXYRtjK741uXnETsgCS8mC/drGtmAVe+bUTZxHZZA wIIv71Qzx0NjbcY+uaPGAID0kAoIfO+MFUmSdXmugiS9hkU4Xr0amvhfcZ9Kr7mnvEWIYi R9Gxlso5sOH9LjEe8EINtpkqtZLOHus1uMtx6pHllq6y7d8uSxZm6LvlW7gEgSEYHeu0nK 2VX2S4VkfGKZcKcu4CqktzXK0BBiHdoKEZNH5mqu+EvBaiJ1+olr2rIhC/P1lOIkt4THDi w9SlSfkU35QoJRKGL/dt1wI2392dfPnuyYfgApMUiPvWI/e8QOn0gMkCvvxYHQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702552840; a=rsa-sha256; cv=none; b=MvsqgaeIhSrYhOPN7aBl3emwa9XIxepRHNDyrvCUD5fRo8rK4TSoCLQwrLKt33zN0V7z8m QAQidbaydpfJMip0f/a7P32YyyQcn7CMb6pF2P91OVwciPTwjCq4YpXOMNwaeRm15yV0Bj imM2QZMSIx07j+i50GcYR+Rojn9ohAY7+i9J+GQAHlyn2ZjjHD82ZEkfZ9XczjLEIdWzn8 NsZPMUGA4BQacAfQ+K2fGo7n1T0tq8eU11NRrztTL+LSdhhqqJpNex09Z9AqTqfUJVZcr2 KYjLA4gWVMDWs0JlfNX+I8lV+Rj7BAMkxJy5GwzCeh0g7gRQ2oQyMnl+lm7aeg== 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=1702552840; 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=n1pkKDeauOgbxq59fadfEmIic7baAiNq4RZdxMuIOSE=; b=tXfYQOlLd2aaur/ewJpzY3tKU4UqUCEV2/UTS2UCj78eK0ovFEXSuMAgwqnkkAJxuc8dDn MsBK5pZ9GNVsCBJ5mzfchJjfr/x3s49nRIU72leIjXvHvq+qaQVMmYKGj8AgUwHOIqYjzG 9cldr6IjCjuZuVYxy6Iy1KHAQgxr3BCvFwRCVu+tXn4OfQ360HCYFZF6ieYHn/lQBZRxUG tKZknO2QJIN8+BkRPkLZZuzZ8qbT9LdgA6qZOLhg59qD0TUD3ysIIfOsJq5E19zZa7v3G4 npilCv2u+YDse8O+wenRqMR33MTReTSktfojY5UYlY3Wh1im5xYRLbyQhaefPg== 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 4SrVJm234bz9Sg; Thu, 14 Dec 2023 11:20:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BEBKeIB036762; Thu, 14 Dec 2023 11:20:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BEBKeX3036759; Thu, 14 Dec 2023 11:20:40 GMT (envelope-from git) Date: Thu, 14 Dec 2023 11:20:40 GMT Message-Id: <202312141120.3BEBKeX3036759@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 4102ee128b9f - stable/13 - vnet: (read) lock the vnet list while iterating it 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4102ee128b9f0159f00e48c2f00f1b3b80cd0f1a Auto-Submitted: auto-generated The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=4102ee128b9f0159f00e48c2f00f1b3b80cd0f1a commit 4102ee128b9f0159f00e48c2f00f1b3b80cd0f1a Author: Kristof Provost AuthorDate: 2023-12-05 19:08:11 +0000 Commit: Kristof Provost CommitDate: 2023-12-14 08:34:32 +0000 vnet: (read) lock the vnet list while iterating it Ensure that the vnet list cannot be modified while we're running through it. Reviewed by: mjg (previous version), zlei (previous version) MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D42927 (cherry picked from commit bd7b2f95019e9715150c34736279805de0818d09) --- sys/net/vnet.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/net/vnet.c b/sys/net/vnet.c index 4f61061853da..9bcc0a779d59 100644 --- a/sys/net/vnet.c +++ b/sys/net/vnet.c @@ -503,11 +503,13 @@ vnet_register_sysinit(void *arg) * Invoke the constructor on all the existing vnets when it is * registered. */ + VNET_LIST_RLOCK(); VNET_FOREACH(vnet) { CURVNET_SET_QUIET(vnet); vs->func(vs->arg); CURVNET_RESTORE(); } + VNET_LIST_RUNLOCK(); VNET_SYSINIT_WUNLOCK(); } @@ -559,6 +561,7 @@ vnet_deregister_sysuninit(void *arg) * deregistered. */ VNET_SYSINIT_WLOCK(); + VNET_LIST_RLOCK(); VNET_FOREACH(vnet) { CURVNET_SET_QUIET(vnet); vs->func(vs->arg); @@ -568,6 +571,7 @@ vnet_deregister_sysuninit(void *arg) /* Remove the destructor from the global list of vnet destructors. */ TAILQ_REMOVE(&vnet_destructors, vs, link); VNET_SYSINIT_WUNLOCK(); + VNET_LIST_RUNLOCK(); } /* From nobody Thu Dec 14 11:20:44 2023 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 4SrVJr6Jzzz53qX5; Thu, 14 Dec 2023 11:20:44 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SrVJr5vnnz4WSH; Thu, 14 Dec 2023 11:20:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702552844; 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=UviZVb5Pz1j/3GoUHf3gvNKx5Q2bMM9mXEKRLCD/G2o=; b=UCK9eiAbz02Nd7Mr0xk81Hsz4TtAmZm87lFsqqW05NTN1O0LExR1Dm7qnUGTcovAwnDCSh VESmjKjAOIE8jZ33uV2Qih4+VqOoZCnWQvsloSc3Kh6gIaasx9d9yGboljubchjybKaK7S fZCZZXmK2WXoekL+J/1oJM8IbJV0qGDukggMBUMopsDBhcgt6Ch2TaL2ZpxfCFfWr0O0du OnYyqjIlylVO+/4SoH0QJ7MiQlv5sFObItrxZO53q6m6xbjflVi8e2mEJumpq1S03wDI8A VPU7trqHpDH6Ci4GFthZtW1jHA6Sc3Gz9mqD3Q8eBDnxJ433duPup7AN3Y2Hjg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702552844; a=rsa-sha256; cv=none; b=W9//95YJD12U7WbgcmgT7U3gzZZLYQ6CuzDZ/uHiwd3DHvegqF2aQLGctOgzMsdNEnSk3X 3Hv2xfG2b5+phq8LS291SPFydHGP7D06xFJO4EmyNinALEr2cbzDszq4gjx/+K8/DYJtzL u6XWnwb7zc9TAOn5Q04+uhTRnKknAosRuRktjkRwP45E3dm3MFqT9Gzd7pp3+cMowxaNB5 Ld/7hrDy3WLQTQDSEffmv4dPnzEK7+QmOhYS72omZtVTm7w7+n2kMupD8sgXjbOsoRe/Kb wvhLqmwO8ZW0sewEjZBsGcFD8oyNETQ6kNKbQhY5r1UxyEf488GuargVwHtkzA== 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=1702552844; 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=UviZVb5Pz1j/3GoUHf3gvNKx5Q2bMM9mXEKRLCD/G2o=; b=vtfJPAkfQOKKHZpPpx/WzmeXqI6MvNleH1icRNxkSyPr3gA9+Jo66T9rJ1VAbMNQKSukOZ KKHOnIhSI19kW3fgNHjSF52iNhTJ4k+sNKmfayFPTKLjIujL82mL1/uwIut1s04UilNcIe ib7Cu1ROOLivQ1KPsfeJHQBO7FUNsUL4hF+ZhRFzQTkbYYH0WtMntJHZyMiGVNz0c8pmIO Tz6wEvFPHSYILpfVwourZCDLj6uW+Um29+8BMKaWs7Gl5557wn488xTZ/pg+WN7ELPU76X JhF4GwDJgtIwnNornENfLj2DqfsJwN214mJSdVRDPphLcV/vwjruBXIf60inSQ== 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 4SrVJr51LYz9gX; Thu, 14 Dec 2023 11:20:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BEBKibW036905; Thu, 14 Dec 2023 11:20:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BEBKiX8036902; Thu, 14 Dec 2023 11:20:44 GMT (envelope-from git) Date: Thu, 14 Dec 2023 11:20:44 GMT Message-Id: <202312141120.3BEBKiX8036902@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: daaaeb3051bf - stable/14 - vnet: (read) lock the vnet list while iterating it 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: daaaeb3051bfb9b1a030b7623778c3ec251b2b2b Auto-Submitted: auto-generated The branch stable/14 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=daaaeb3051bfb9b1a030b7623778c3ec251b2b2b commit daaaeb3051bfb9b1a030b7623778c3ec251b2b2b Author: Kristof Provost AuthorDate: 2023-12-05 19:08:11 +0000 Commit: Kristof Provost CommitDate: 2023-12-14 11:20:25 +0000 vnet: (read) lock the vnet list while iterating it Ensure that the vnet list cannot be modified while we're running through it. Reviewed by: mjg (previous version), zlei (previous version) MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D42927 (cherry picked from commit bd7b2f95019e9715150c34736279805de0818d09) --- sys/net/vnet.c | 4 ++++ sys/netinet/ip_reass.c | 2 ++ 2 files changed, 6 insertions(+) diff --git a/sys/net/vnet.c b/sys/net/vnet.c index c4a623698341..5dec0433d31a 100644 --- a/sys/net/vnet.c +++ b/sys/net/vnet.c @@ -503,11 +503,13 @@ vnet_register_sysinit(void *arg) * Invoke the constructor on all the existing vnets when it is * registered. */ + VNET_LIST_RLOCK(); VNET_FOREACH(vnet) { CURVNET_SET_QUIET(vnet); vs->func(vs->arg); CURVNET_RESTORE(); } + VNET_LIST_RUNLOCK(); VNET_SYSINIT_WUNLOCK(); } @@ -559,6 +561,7 @@ vnet_deregister_sysuninit(void *arg) * deregistered. */ VNET_SYSINIT_WLOCK(); + VNET_LIST_RLOCK(); VNET_FOREACH(vnet) { CURVNET_SET_QUIET(vnet); vs->func(vs->arg); @@ -568,6 +571,7 @@ vnet_deregister_sysuninit(void *arg) /* Remove the destructor from the global list of vnet destructors. */ TAILQ_REMOVE(&vnet_destructors, vs, link); VNET_SYSINIT_WUNLOCK(); + VNET_LIST_RUNLOCK(); } /* diff --git a/sys/netinet/ip_reass.c b/sys/netinet/ip_reass.c index 6f33c7a8a54b..2876e5bfdcdc 100644 --- a/sys/netinet/ip_reass.c +++ b/sys/netinet/ip_reass.c @@ -663,11 +663,13 @@ ipreass_drain(void) { VNET_ITERATOR_DECL(vnet_iter); + VNET_LIST_RLOCK(); VNET_FOREACH(vnet_iter) { CURVNET_SET(vnet_iter); ipreass_drain_vnet(); CURVNET_RESTORE(); } + VNET_LIST_RUNLOCK(); } From nobody Thu Dec 14 14:29:23 2023 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 4SrZVW58dkz542Ts; Thu, 14 Dec 2023 14:29:23 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SrZVW40Wyz3J38; Thu, 14 Dec 2023 14:29:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702564163; 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=FqyHi3xOPTf+tKeog0PVleVMUJ+9QLMTizGeYRrFAqk=; b=sXTIDlnwewvJ+hW0tmf40heEbwe2FvHDApuPzM6b408OGULO/JwcBDIpqUTPiPYQ0SdDTh 8HGApuTy0TSwJ7j32J86AWu4lEQ96Wb0WRRrXYGxrZJLbAzFqhYTEYn3G09g4V+VubGkU3 xnkUklKgYy4Y23hdrM2vDCblXnsiCw3mpPXTJJ7XOTy2kQowsZCFSWElkVDFGt+DM1MQVJ yIbWLyJMU8GkYiX728EJ7eMufNLkFWb6N7xN0cfUpWLqZvmi7UcdwEzFJB0lNfrYh34F61 B7rL1njIBDw51YjS8luC+TDxMceJFDcDC1O/cUQtkODgn/VvjHrpfLws8EOLXg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702564163; a=rsa-sha256; cv=none; b=QVIMUa45eTWzwaXyrhEFZk4fRjJ+jpB+UhINQdcLCyqVjypjB8ibl5o/qGKt3HGUc8TJPx 95tcTNVc+uKBNmPL78eiMZ/p0ym+8qvTueND4WXKAhBTf0/JcyoqN1GIydyXIB+SJMFb7c mOhn0/mWwoqoCnkJ6Iy1G8yacWmDQA9webBybMWPA/hOt04bWt/qLvoNeWyPAPVrztwDPp keR0YcsnHZv4YDwhiqBxLWvgtz+CcqDIjrjK/5X+o175koVNkgeR87lvExV/PIBEfQqr+d UbGcFf5NweV3JA3XWXDRwrNAZUAoo+bGI3zW2ElabWzEBO7RLwRpGg2kAs1P+g== 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=1702564163; 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=FqyHi3xOPTf+tKeog0PVleVMUJ+9QLMTizGeYRrFAqk=; b=dKxAM5qikiMgyzmP5f6JyRFg40a3kjheUb7xaLkdS0IknjZhVILZlhk2L2TA+b4BEYJweh FCbQmSTMB7qqAMq4UZ8MRcnFSMQfpipA+UVX4pBLkbDh68Rtp4SrilPQtRNjYcIwhzqYCp LNjiAqRkeN6kOGZR4JyQA1bcc9irtMsTUThv4yeLd0+G1nNza8tcDcj0/m83TYDGMm1Iki xRfLxiKGdQ+135AsfSRJgxbcBmURGAr/HR0BuSf0sIWSrWIxKrOfXsqqWBDUy0jJRIPWuP JnVklbKgNeajjys7+3BAcRkSFzXrfBie9ms9oOHwx99+59Z1XhNIzgSg4fEDcA== 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 4SrZVW33jpzVsw; Thu, 14 Dec 2023 14:29:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BEETN6k046927; Thu, 14 Dec 2023 14:29:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BEETN3a046925; Thu, 14 Dec 2023 14:29:23 GMT (envelope-from git) Date: Thu, 14 Dec 2023 14:29:23 GMT Message-Id: <202312141429.3BEETN3a046925@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: df81b1511854 - stable/14 - tty: Avoid a kernel memory discloure via kern.ttys 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: df81b15118542f0d2426490bd2605b7abd3c4d71 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=df81b15118542f0d2426490bd2605b7abd3c4d71 commit df81b15118542f0d2426490bd2605b7abd3c4d71 Author: Mark Johnston AuthorDate: 2023-12-11 14:19:09 +0000 Commit: Mark Johnston CommitDate: 2023-12-14 14:29:15 +0000 tty: Avoid a kernel memory discloure via kern.ttys Four pad bytes at the end of each xtty structure were not being cleared before being copied out. Fix this by clearing the whole structure before populating fields. MFC after: 3 days Reported by: KMSAN (cherry picked from commit 3c0fb026b2fc998fa9bea8aed76e96c58671aee3) --- sys/kern/tty.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/kern/tty.c b/sys/kern/tty.c index 620233947410..e051c66ab0c9 100644 --- a/sys/kern/tty.c +++ b/sys/kern/tty.c @@ -1288,6 +1288,7 @@ tty_to_xtty(struct tty *tp, struct xtty *xt) tty_assert_locked(tp); + memset(xt, 0, sizeof(*xt)); xt->xt_size = sizeof(struct xtty); xt->xt_insize = ttyinq_getsize(&tp->t_inq); xt->xt_incc = ttyinq_bytescanonicalized(&tp->t_inq); From nobody Thu Dec 14 14:29:37 2023 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 4SrZVn3N97z542f9; Thu, 14 Dec 2023 14:29:37 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SrZVn2pmbz3JJX; Thu, 14 Dec 2023 14:29:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702564177; 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=JqzxwYQH2LaGW+UGZluR8rb9zWGxvKm7Qt9J5zTFXcs=; b=Wt/Ru/k+sxODx39UI4UF3z84E8kEDVEwWVji5PDH768N5+fxy2YS4FzVFBWZA+7XX6f25R EU7iDI2FdzOY++nqSJqFvH7BBhRJJ7yPgEHQ65YJWEMGFJUKcZ06f9ubM5RRbMvFS8EUYU 08PcRfY0YdxGQPPC51gfxhTgDYoFRc0znH91T2n7/JrDZ65fKG1qRI0TK8pXpw7oCL3RwX WlfJNNEdP+0rU/sg3JcclYJfu4TdTHEDZQy/WQRtEJA1OrA3GlHd7Bqjj+Icf/Bms29jSb OS/vjGxTWNydZVqDlsNTjNFMIqDPexFtyowSa3gHlkHSbK/pNRJrso+4Fm0T5Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702564177; a=rsa-sha256; cv=none; b=sfKBTAnaotNdBPDlHXsl7tSvJzEx2LcrzQYjaIkKLrNSy711m8uOpAE+SSUPpihZqFav4o CCKItHIgBQNlNOyygcpz8ySLc7TAFFj2GX+U03sR3JH5NpZXZXseQtGGcjhVxVvxGMb1RM gxesn/5bomQymZISOtt9VbmCHG+QXNnn/Y9UbHbhTgN/t2Vgtm5RX2YHSsSQpI3JNxnjwz LcdeEmtA64PUSouZf6bEseBE0DZ9rD63GX+WTCVrvsx0pvcT6vtmkUTMHvGI2Vz32DZ5yg Eyo3GBEx53A2KyZY0woXYd8eGz/a4Aiv8oergRiFbTFoQ8QNv6r+P4t39g3Phg== 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=1702564177; 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=JqzxwYQH2LaGW+UGZluR8rb9zWGxvKm7Qt9J5zTFXcs=; b=xSgjvopDBr8HGSTPBCJ6fgPuCAJI5PySv+V4H2E6jEy+LA6wJH2oF/5q5P7Sh3BVazQoPq etJuoV1DA5hG41ubCPG69r735td108xpbl/80mjJkuhekazLwV1VVmWhAtd6ybki8TLUz5 QTLGSDfcb+ZiCAWnnsXC/xGdIQi7EwTDk0ebv8vVAU9JcfhRNNA2ESZTtgHwuzMwqNLcom sEsG6G8WXT8g77jO8+cuixTSbbKzgKEjR0Nf6dyVsAiaP20e3WOWAaizzEN/AajjkUrqvE 45Sx1Fe1bG3iVjs8IwZ73KR40j49ytgcVwfOiItFlcv7mUkQPLlyddbh8V7Veg== 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 4SrZVn1sqHzWhW; Thu, 14 Dec 2023 14:29:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BEETb3t047093; Thu, 14 Dec 2023 14:29:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BEETb6e047090; Thu, 14 Dec 2023 14:29:37 GMT (envelope-from git) Date: Thu, 14 Dec 2023 14:29:37 GMT Message-Id: <202312141429.3BEETb6e047090@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 89951a4a11ee - stable/13 - tty: Avoid a kernel memory discloure via kern.ttys 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 89951a4a11ee79d13ad472fe003cdf00b4fbe18b Auto-Submitted: auto-generated The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=89951a4a11ee79d13ad472fe003cdf00b4fbe18b commit 89951a4a11ee79d13ad472fe003cdf00b4fbe18b Author: Mark Johnston AuthorDate: 2023-12-11 14:19:09 +0000 Commit: Mark Johnston CommitDate: 2023-12-14 14:29:28 +0000 tty: Avoid a kernel memory discloure via kern.ttys Four pad bytes at the end of each xtty structure were not being cleared before being copied out. Fix this by clearing the whole structure before populating fields. MFC after: 3 days Reported by: KMSAN (cherry picked from commit 3c0fb026b2fc998fa9bea8aed76e96c58671aee3) --- sys/kern/tty.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/kern/tty.c b/sys/kern/tty.c index 00a5670d84cf..eaf69446afa2 100644 --- a/sys/kern/tty.c +++ b/sys/kern/tty.c @@ -1288,6 +1288,7 @@ tty_to_xtty(struct tty *tp, struct xtty *xt) tty_assert_locked(tp); + memset(xt, 0, sizeof(*xt)); xt->xt_size = sizeof(struct xtty); xt->xt_insize = ttyinq_getsize(&tp->t_inq); xt->xt_incc = ttyinq_bytescanonicalized(&tp->t_inq); From nobody Thu Dec 14 14:29:51 2023 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 4SrZW428Ykz54310; Thu, 14 Dec 2023 14:29:52 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SrZW41Fdqz3JpP; Thu, 14 Dec 2023 14:29:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702564192; 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=ichz8a9cL2doAUHvrKCRORhTX1DX1dZJvjrnsu0IVks=; b=tonTblt/9cUvcpcTL1u+vt9Ql+e7QOo5qFeyFhDljKol8KqEc/5XEHsphflHGRPkpB0EvM tYbChh44xLDIKW9L9ocPU5iv/OWBAOUGeUMHMk1uopERZbry1ysT4f4v1+VtTZwbk0eSGO 6jJpnhw98nrcw4Q7sOo1rkVhLgz6/fBZ07X6iBB3eW/xKW3udaufLgSmZcwfyKE0yITQl9 ux/8BzRvQj5kFCxBBD+ynci3WoEKokYlSPlSmI9hYULlWA4lipTYm2o3bmklIacjV6C/hv WHE+28Zoh1Im1RVBGBMz6AMiN1yrUcEkSRZzWVbqRaslZocJNu4vg8LnwhqxEg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702564192; a=rsa-sha256; cv=none; b=QsKWjvNX/j+WQEHW60tf9SwLaOtzw840SaLwWePG1hfOLIckPsU/LHAhDrE42JQ/hWG6cO jro2STuQ7gCXCz1Ae1x51O3LtJCpF3B1GggBlFFbvQRdHmrP7HTTQx/2j0gkT+J3/SXBH/ goCIskqTbpQHgsWKP5kaKJgWv0YeWRFo+ng2FwG4RgsoUOwtBUZNvclBiAIvLFYDE03xec r2r3Lypo7NHPR6VKA+NL75H1PWsoTyJMEPILAt/2Uzy7cignROYXQz+6U/nK3N+gMglyBF cjcc1Nx6A6RTOKFkcEpgKC+0zX850SxKW3lDnn1sQCTyfnoX1yYZj5iOU/nVNg== 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=1702564192; 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=ichz8a9cL2doAUHvrKCRORhTX1DX1dZJvjrnsu0IVks=; b=byy0v+hSbbuNbxa7MplV4fXvrY1ykbEWKJSTOBgq7b1cShAZvujIOUs+YDa7JDX5KDx8m1 0Pj2IbkBQZlndRr2+nJRaAeUH0gFfyCuAAh0DWgCyPvtEdVHZzGjraksjr3hNOiwWrSkv2 wqZzINKHy4k6HW7n1tFC5gT22hvSCI9SiIPtLhhPQUd8zkZRFNJS4gxSIQ6A6ShEK7jjyM WrV4IVx4C5RY0C5p9zOfE/JA2fjUZcT5b5QNTxn6isO+qsvkpX7DeBPepF/aFnfkd2ULf5 bBn3Wde7ReH75gA/LVL4kECbXK3HkW8aKso+fKQZyi3QwtXfGctY45ljbr3ThQ== 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 4SrZW40K4NzWhX; Thu, 14 Dec 2023 14:29:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BEETp1Y047274; Thu, 14 Dec 2023 14:29:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BEETpRJ047271; Thu, 14 Dec 2023 14:29:51 GMT (envelope-from git) Date: Thu, 14 Dec 2023 14:29:51 GMT Message-Id: <202312141429.3BEETpRJ047271@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: d76303c9d326 - stable/12 - tty: Avoid a kernel memory discloure via kern.ttys 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: d76303c9d326f1543fbe64f98b8a875228020910 Auto-Submitted: auto-generated The branch stable/12 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=d76303c9d326f1543fbe64f98b8a875228020910 commit d76303c9d326f1543fbe64f98b8a875228020910 Author: Mark Johnston AuthorDate: 2023-12-11 14:19:09 +0000 Commit: Mark Johnston CommitDate: 2023-12-14 14:29:42 +0000 tty: Avoid a kernel memory discloure via kern.ttys Four pad bytes at the end of each xtty structure were not being cleared before being copied out. Fix this by clearing the whole structure before populating fields. MFC after: 3 days Reported by: KMSAN (cherry picked from commit 3c0fb026b2fc998fa9bea8aed76e96c58671aee3) --- sys/kern/tty.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/kern/tty.c b/sys/kern/tty.c index f80ffd4921e6..c63a03183f1b 100644 --- a/sys/kern/tty.c +++ b/sys/kern/tty.c @@ -1279,6 +1279,7 @@ tty_to_xtty(struct tty *tp, struct xtty *xt) tty_assert_locked(tp); + memset(xt, 0, sizeof(*xt)); xt->xt_size = sizeof(struct xtty); xt->xt_insize = ttyinq_getsize(&tp->t_inq); xt->xt_incc = ttyinq_bytescanonicalized(&tp->t_inq); From nobody Thu Dec 14 14:43:29 2023 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 4SrZpp1WWZz543bC; Thu, 14 Dec 2023 14:43:30 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SrZpp197Mz3Kpr; Thu, 14 Dec 2023 14:43:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702565010; 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=qCStRFUtVtKgq7ku8PLqaYLRJxU0j2/A7UJLM/QNork=; b=uLgqPI7BM5wZgp0tv8T559BedGLv/sQxN5CZsqyiQDFfjVcBFPGTzdC48uZ6jG8+k4iY29 JokKYREJyhFuHufEH7jYietrueuJwIWyliG+OS2EJypkv5WDxtnyKuPCNOpx4PwBRR1o0/ e2o+ewhSbN6UgIz8G0MKzvZBvKj3w8Dt+EFez0xDpdPNNarFyMfqAsoPYiP0BOjsS2XxXR dq504GA+x650OpaZRgWn/+2jD4t111vQw4vUXA/NgyB7mSEFKJe6gboFNLI1JVIX/t84Rd NxVBAQz0i/LTZZYKNkVAXWSJzmVxErFtycebYRVnVaFDvuR1FCOsPCpk+SASVw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702565010; a=rsa-sha256; cv=none; b=R0HeYf0aGDhA6dGGaCOQWCgu4Cc5ECHA1qQ9itdw1f7Ubt6sdQKsB9BCT7NAgqZ1GcQJ2S fcvNxtfXA2TUon785zOOdv0VtXDiKI7NVUNE70A7uz6GPl/jQYoGzqvU/C/BXcV/bNj6GK Io3f/T1ySI6/TG2qb9Gj+2QB9skR6HSdiVS3+us2/l3d0Wmj3V0Vk3W/OfoVc6/RE8e49H V7HiVZ5jjrNWXDCKUDoEQtcjg3BViEmiCRFnzB72UY+C5w7q2yH+rjG+J3dGQPVUeYJ8xq 38Ji8kjzRW1MJ3UG9NISpw5Lw+0RKnUuGlhBqs8y1WK5k5ydq342qbn8bYD0pw== 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=1702565010; 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=qCStRFUtVtKgq7ku8PLqaYLRJxU0j2/A7UJLM/QNork=; b=lsdf0oJF3CkZQd8NB6a0lWdjRJPsI0BLW+pPlv1gvby5xkEPQSbVTY5zGpjsmYGJWE/7qx WPwIOdCzy8T8P6o0poT8UMcasJ6cYYnl4sO/1v4f7/uwYBE+Mw8hb3aUi1ZTwVayE7gled tWegpJC82We4a238qPGTIRRcZ8Evik0YDicDIG8wF/ZAbRLdr4ZykPBOQbolXoCiH868wz RuGJU7t/kmBbSxgaLITXqdHndXEji1CSCX1C6DKcxlJInH3pxd3zOmPwMeFaiQsjM1odxj iikKSfceI/jEFlp/WYWTFQxH//1wQfLc5Ldlx8VmWU8dYlMlnQkfLyOrex0tXA== 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 4SrZpp0BZMzXKd; Thu, 14 Dec 2023 14:43:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BEEhTZ3079666; Thu, 14 Dec 2023 14:43:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BEEhTxK079663; Thu, 14 Dec 2023 14:43:29 GMT (envelope-from git) Date: Thu, 14 Dec 2023 14:43:29 GMT Message-Id: <202312141443.3BEEhTxK079663@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 40993deee7d6 - stable/14 - bhyve: Split backends into separate files 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 40993deee7d624ccea318881b60c779ee4306c2d Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=40993deee7d624ccea318881b60c779ee4306c2d commit 40993deee7d624ccea318881b60c779ee4306c2d Author: Mark Johnston AuthorDate: 2023-11-22 19:10:27 +0000 Commit: Mark Johnston CommitDate: 2023-12-14 14:43:02 +0000 bhyve: Split backends into separate files Currently the net_backend structure definition is private to net_backends.c, so all of the backend definitions are there. While adding a new backend to use libslirp, it was noted that this file is somewhat cluttered. Move the netmap and netgraph backends to their own files and clean up includes a bit. No functional change intended. Reviewed by: corvink, jhb MFC after: 3 weeks Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D42689 (cherry picked from commit be74aede49fb480792448bf563c5079998de7cbd) --- usr.sbin/bhyve/Makefile | 5 +- usr.sbin/bhyve/net_backend_netgraph.c | 191 ++++++++++ usr.sbin/bhyve/net_backend_netmap.c | 384 ++++++++++++++++++++ usr.sbin/bhyve/net_backends.c | 661 +--------------------------------- usr.sbin/bhyve/net_backends.h | 7 +- usr.sbin/bhyve/net_backends_priv.h | 152 ++++++++ 6 files changed, 756 insertions(+), 644 deletions(-) diff --git a/usr.sbin/bhyve/Makefile b/usr.sbin/bhyve/Makefile index de8e87d2ad49..6ce7f6c7ba62 100644 --- a/usr.sbin/bhyve/Makefile +++ b/usr.sbin/bhyve/Makefile @@ -33,6 +33,7 @@ SRCS= \ iov.c \ mem.c \ mevent.c \ + net_backend_netmap.c \ net_backends.c \ net_utils.c \ pci_emul.c \ @@ -92,8 +93,8 @@ CFLAGS+=-DINET CFLAGS+=-DINET6 .endif .if ${MK_NETGRAPH_SUPPORT} != "no" -CFLAGS+=-DNETGRAPH -LIBADD+= netgraph +SRCS+= net_backend_netgraph.c +LIBADD+= netgraph .endif .if ${MK_OPENSSL} == "no" CFLAGS+=-DNO_OPENSSL diff --git a/usr.sbin/bhyve/net_backend_netgraph.c b/usr.sbin/bhyve/net_backend_netgraph.c new file mode 100644 index 000000000000..7d1659d611e3 --- /dev/null +++ b/usr.sbin/bhyve/net_backend_netgraph.c @@ -0,0 +1,191 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2019 Vincenzo Maffione + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef WITHOUT_CAPSICUM +#include +#endif +#include +#include + +#ifndef WITHOUT_CAPSICUM +#include +#endif +#include +#include +#include +#include +#include + +#include "config.h" +#include "debug.h" +#include "net_backends.h" +#include "net_backends_priv.h" + +#define NG_SBUF_MAX_SIZE (4 * 1024 * 1024) + +static int +ng_init(struct net_backend *be, const char *devname __unused, + nvlist_t *nvl, net_be_rxeof_t cb, void *param) +{ + struct tap_priv *p = NET_BE_PRIV(be); + struct ngm_connect ngc; + const char *value, *nodename; + int sbsz; + int ctrl_sock; + int flags; + unsigned long maxsbsz; + size_t msbsz; +#ifndef WITHOUT_CAPSICUM + cap_rights_t rights; +#endif + + if (cb == NULL) { + EPRINTLN("Netgraph backend requires non-NULL callback"); + return (-1); + } + + be->fd = -1; + + memset(&ngc, 0, sizeof(ngc)); + + value = get_config_value_node(nvl, "path"); + if (value == NULL) { + EPRINTLN("path must be provided"); + return (-1); + } + strncpy(ngc.path, value, NG_PATHSIZ - 1); + + value = get_config_value_node(nvl, "hook"); + if (value == NULL) + value = "vmlink"; + strncpy(ngc.ourhook, value, NG_HOOKSIZ - 1); + + value = get_config_value_node(nvl, "peerhook"); + if (value == NULL) { + EPRINTLN("peer hook must be provided"); + return (-1); + } + strncpy(ngc.peerhook, value, NG_HOOKSIZ - 1); + + nodename = get_config_value_node(nvl, "socket"); + if (NgMkSockNode(nodename, + &ctrl_sock, &be->fd) < 0) { + EPRINTLN("can't get Netgraph sockets"); + return (-1); + } + + if (NgSendMsg(ctrl_sock, ".", + NGM_GENERIC_COOKIE, + NGM_CONNECT, &ngc, sizeof(ngc)) < 0) { + EPRINTLN("can't connect to node"); + close(ctrl_sock); + goto error; + } + + close(ctrl_sock); + + flags = fcntl(be->fd, F_GETFL); + + if (flags < 0) { + EPRINTLN("can't get socket flags"); + goto error; + } + + if (fcntl(be->fd, F_SETFL, flags | O_NONBLOCK) < 0) { + EPRINTLN("can't set O_NONBLOCK flag"); + goto error; + } + + /* + * The default ng_socket(4) buffer's size is too low. + * Calculate the minimum value between NG_SBUF_MAX_SIZE + * and kern.ipc.maxsockbuf. + */ + msbsz = sizeof(maxsbsz); + if (sysctlbyname("kern.ipc.maxsockbuf", &maxsbsz, &msbsz, + NULL, 0) < 0) { + EPRINTLN("can't get 'kern.ipc.maxsockbuf' value"); + goto error; + } + + /* + * We can't set the socket buffer size to kern.ipc.maxsockbuf value, + * as it takes into account the mbuf(9) overhead. + */ + maxsbsz = maxsbsz * MCLBYTES / (MSIZE + MCLBYTES); + + sbsz = MIN(NG_SBUF_MAX_SIZE, maxsbsz); + + if (setsockopt(be->fd, SOL_SOCKET, SO_SNDBUF, &sbsz, + sizeof(sbsz)) < 0) { + EPRINTLN("can't set TX buffer size"); + goto error; + } + + if (setsockopt(be->fd, SOL_SOCKET, SO_RCVBUF, &sbsz, + sizeof(sbsz)) < 0) { + EPRINTLN("can't set RX buffer size"); + goto error; + } + +#ifndef WITHOUT_CAPSICUM + cap_rights_init(&rights, CAP_EVENT, CAP_READ, CAP_WRITE); + if (caph_rights_limit(be->fd, &rights) == -1) + errx(EX_OSERR, "Unable to apply rights for sandbox"); +#endif + + memset(p->bbuf, 0, sizeof(p->bbuf)); + p->bbuflen = 0; + + p->mevp = mevent_add_disabled(be->fd, EVF_READ, cb, param); + if (p->mevp == NULL) { + EPRINTLN("Could not register event"); + goto error; + } + + return (0); + +error: + tap_cleanup(be); + return (-1); +} + +static struct net_backend ng_backend = { + .prefix = "netgraph", + .priv_size = sizeof(struct tap_priv), + .init = ng_init, + .cleanup = tap_cleanup, + .send = tap_send, + .peek_recvlen = tap_peek_recvlen, + .recv = tap_recv, + .recv_enable = tap_recv_enable, + .recv_disable = tap_recv_disable, + .get_cap = tap_get_cap, + .set_cap = tap_set_cap, +}; + +DATA_SET(net_backend_set, ng_backend); diff --git a/usr.sbin/bhyve/net_backend_netmap.c b/usr.sbin/bhyve/net_backend_netmap.c new file mode 100644 index 000000000000..5ba11b96797c --- /dev/null +++ b/usr.sbin/bhyve/net_backend_netmap.c @@ -0,0 +1,384 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2019 Vincenzo Maffione + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include +#include +#define NETMAP_WITH_LIBS +#include + +#include + +#include "debug.h" +#include "iov.h" +#include "mevent.h" +#include "net_backends.h" +#include "net_backends_priv.h" + +/* The virtio-net features supported by netmap. */ +#define NETMAP_FEATURES (VIRTIO_NET_F_CSUM | VIRTIO_NET_F_HOST_TSO4 | \ + VIRTIO_NET_F_HOST_TSO6 | VIRTIO_NET_F_HOST_UFO | \ + VIRTIO_NET_F_GUEST_CSUM | VIRTIO_NET_F_GUEST_TSO4 | \ + VIRTIO_NET_F_GUEST_TSO6 | VIRTIO_NET_F_GUEST_UFO) + +struct netmap_priv { + char ifname[IFNAMSIZ]; + struct nm_desc *nmd; + uint16_t memid; + struct netmap_ring *rx; + struct netmap_ring *tx; + struct mevent *mevp; + net_be_rxeof_t cb; + void *cb_param; +}; + +static void +nmreq_init(struct nmreq *req, char *ifname) +{ + + memset(req, 0, sizeof(*req)); + strlcpy(req->nr_name, ifname, sizeof(req->nr_name)); + req->nr_version = NETMAP_API; +} + +static int +netmap_set_vnet_hdr_len(struct net_backend *be, int vnet_hdr_len) +{ + int err; + struct nmreq req; + struct netmap_priv *priv = NET_BE_PRIV(be); + + nmreq_init(&req, priv->ifname); + req.nr_cmd = NETMAP_BDG_VNET_HDR; + req.nr_arg1 = vnet_hdr_len; + err = ioctl(be->fd, NIOCREGIF, &req); + if (err) { + EPRINTLN("Unable to set vnet header length %d", vnet_hdr_len); + return (err); + } + + be->be_vnet_hdr_len = vnet_hdr_len; + + return (0); +} + +static int +netmap_has_vnet_hdr_len(struct net_backend *be, unsigned vnet_hdr_len) +{ + unsigned prev_hdr_len = be->be_vnet_hdr_len; + int ret; + + if (vnet_hdr_len == prev_hdr_len) { + return (1); + } + + ret = netmap_set_vnet_hdr_len(be, vnet_hdr_len); + if (ret) { + return (0); + } + + netmap_set_vnet_hdr_len(be, prev_hdr_len); + + return (1); +} + +static uint64_t +netmap_get_cap(struct net_backend *be) +{ + + return (netmap_has_vnet_hdr_len(be, VNET_HDR_LEN) ? + NETMAP_FEATURES : 0); +} + +static int +netmap_set_cap(struct net_backend *be, uint64_t features __unused, + unsigned vnet_hdr_len) +{ + + return (netmap_set_vnet_hdr_len(be, vnet_hdr_len)); +} + +static int +netmap_init(struct net_backend *be, const char *devname, + nvlist_t *nvl __unused, net_be_rxeof_t cb, void *param) +{ + struct netmap_priv *priv = NET_BE_PRIV(be); + + strlcpy(priv->ifname, devname, sizeof(priv->ifname)); + priv->ifname[sizeof(priv->ifname) - 1] = '\0'; + + priv->nmd = nm_open(priv->ifname, NULL, NETMAP_NO_TX_POLL, NULL); + if (priv->nmd == NULL) { + EPRINTLN("Unable to nm_open(): interface '%s', errno (%s)", + devname, strerror(errno)); + return (-1); + } + + priv->memid = priv->nmd->req.nr_arg2; + priv->tx = NETMAP_TXRING(priv->nmd->nifp, 0); + priv->rx = NETMAP_RXRING(priv->nmd->nifp, 0); + priv->cb = cb; + priv->cb_param = param; + be->fd = priv->nmd->fd; + + priv->mevp = mevent_add_disabled(be->fd, EVF_READ, cb, param); + if (priv->mevp == NULL) { + EPRINTLN("Could not register event"); + return (-1); + } + + return (0); +} + +static void +netmap_cleanup(struct net_backend *be) +{ + struct netmap_priv *priv = NET_BE_PRIV(be); + + if (priv->mevp) { + mevent_delete(priv->mevp); + } + if (priv->nmd) { + nm_close(priv->nmd); + } + be->fd = -1; +} + +static ssize_t +netmap_send(struct net_backend *be, const struct iovec *iov, + int iovcnt) +{ + struct netmap_priv *priv = NET_BE_PRIV(be); + struct netmap_ring *ring; + ssize_t totlen = 0; + int nm_buf_size; + int nm_buf_len; + uint32_t head; + uint8_t *nm_buf; + int j; + + ring = priv->tx; + head = ring->head; + if (head == ring->tail) { + EPRINTLN("No space, drop %zu bytes", count_iov(iov, iovcnt)); + goto txsync; + } + nm_buf = NETMAP_BUF(ring, ring->slot[head].buf_idx); + nm_buf_size = ring->nr_buf_size; + nm_buf_len = 0; + + for (j = 0; j < iovcnt; j++) { + uint8_t *iov_frag_buf = iov[j].iov_base; + int iov_frag_size = iov[j].iov_len; + + totlen += iov_frag_size; + + /* + * Split each iovec fragment over more netmap slots, if + * necessary. + */ + for (;;) { + int copylen; + + copylen = iov_frag_size < nm_buf_size ? iov_frag_size : nm_buf_size; + memcpy(nm_buf, iov_frag_buf, copylen); + + iov_frag_buf += copylen; + iov_frag_size -= copylen; + nm_buf += copylen; + nm_buf_size -= copylen; + nm_buf_len += copylen; + + if (iov_frag_size == 0) { + break; + } + + ring->slot[head].len = nm_buf_len; + ring->slot[head].flags = NS_MOREFRAG; + head = nm_ring_next(ring, head); + if (head == ring->tail) { + /* + * We ran out of netmap slots while + * splitting the iovec fragments. + */ + EPRINTLN("No space, drop %zu bytes", + count_iov(iov, iovcnt)); + goto txsync; + } + nm_buf = NETMAP_BUF(ring, ring->slot[head].buf_idx); + nm_buf_size = ring->nr_buf_size; + nm_buf_len = 0; + } + } + + /* Complete the last slot, which must not have NS_MOREFRAG set. */ + ring->slot[head].len = nm_buf_len; + ring->slot[head].flags = 0; + head = nm_ring_next(ring, head); + + /* Now update ring->head and ring->cur. */ + ring->head = ring->cur = head; +txsync: + ioctl(be->fd, NIOCTXSYNC, NULL); + + return (totlen); +} + +static ssize_t +netmap_peek_recvlen(struct net_backend *be) +{ + struct netmap_priv *priv = NET_BE_PRIV(be); + struct netmap_ring *ring = priv->rx; + uint32_t head = ring->head; + ssize_t totlen = 0; + + while (head != ring->tail) { + struct netmap_slot *slot = ring->slot + head; + + totlen += slot->len; + if ((slot->flags & NS_MOREFRAG) == 0) + break; + head = nm_ring_next(ring, head); + } + + return (totlen); +} + +static ssize_t +netmap_recv(struct net_backend *be, const struct iovec *iov, int iovcnt) +{ + struct netmap_priv *priv = NET_BE_PRIV(be); + struct netmap_slot *slot = NULL; + struct netmap_ring *ring; + uint8_t *iov_frag_buf; + int iov_frag_size; + ssize_t totlen = 0; + uint32_t head; + + assert(iovcnt); + + ring = priv->rx; + head = ring->head; + iov_frag_buf = iov->iov_base; + iov_frag_size = iov->iov_len; + + do { + uint8_t *nm_buf; + int nm_buf_len; + + if (head == ring->tail) { + return (0); + } + + slot = ring->slot + head; + nm_buf = NETMAP_BUF(ring, slot->buf_idx); + nm_buf_len = slot->len; + + for (;;) { + int copylen = nm_buf_len < iov_frag_size ? + nm_buf_len : iov_frag_size; + + memcpy(iov_frag_buf, nm_buf, copylen); + nm_buf += copylen; + nm_buf_len -= copylen; + iov_frag_buf += copylen; + iov_frag_size -= copylen; + totlen += copylen; + + if (nm_buf_len == 0) { + break; + } + + iov++; + iovcnt--; + if (iovcnt == 0) { + /* No space to receive. */ + EPRINTLN("Short iov, drop %zd bytes", + totlen); + return (-ENOSPC); + } + iov_frag_buf = iov->iov_base; + iov_frag_size = iov->iov_len; + } + + head = nm_ring_next(ring, head); + + } while (slot->flags & NS_MOREFRAG); + + /* Release slots to netmap. */ + ring->head = ring->cur = head; + + return (totlen); +} + +static void +netmap_recv_enable(struct net_backend *be) +{ + struct netmap_priv *priv = NET_BE_PRIV(be); + + mevent_enable(priv->mevp); +} + +static void +netmap_recv_disable(struct net_backend *be) +{ + struct netmap_priv *priv = NET_BE_PRIV(be); + + mevent_disable(priv->mevp); +} + +static struct net_backend netmap_backend = { + .prefix = "netmap", + .priv_size = sizeof(struct netmap_priv), + .init = netmap_init, + .cleanup = netmap_cleanup, + .send = netmap_send, + .peek_recvlen = netmap_peek_recvlen, + .recv = netmap_recv, + .recv_enable = netmap_recv_enable, + .recv_disable = netmap_recv_disable, + .get_cap = netmap_get_cap, + .set_cap = netmap_set_cap, +}; + +/* A clone of the netmap backend, with a different prefix. */ +static struct net_backend vale_backend = { + .prefix = "vale", + .priv_size = sizeof(struct netmap_priv), + .init = netmap_init, + .cleanup = netmap_cleanup, + .send = netmap_send, + .peek_recvlen = netmap_peek_recvlen, + .recv = netmap_recv, + .recv_enable = netmap_recv_enable, + .recv_disable = netmap_recv_disable, + .get_cap = netmap_get_cap, + .set_cap = netmap_set_cap, +}; + +DATA_SET(net_backend_set, netmap_backend); +DATA_SET(net_backend_set, vale_backend); diff --git a/usr.sbin/bhyve/net_backends.c b/usr.sbin/bhyve/net_backends.c index de6afab53854..2d11c45f217a 100644 --- a/usr.sbin/bhyve/net_backends.c +++ b/usr.sbin/bhyve/net_backends.c @@ -32,8 +32,7 @@ * features) is exported by net_backends.h. */ -#include -#include /* u_short etc */ +#include #ifndef WITHOUT_CAPSICUM #include #endif @@ -43,153 +42,35 @@ #include #include -#include -#include -#define NETMAP_WITH_LIBS -#include +#include #ifndef WITHOUT_CAPSICUM #include #endif #include #include #include +#include +#include +#include #include #include #include #include -#include #include -#include -#include -#include -#include -#include - -#ifdef NETGRAPH -#include -#include -#include -#endif +#include #include "config.h" #include "debug.h" #include "iov.h" #include "mevent.h" #include "net_backends.h" +#include "net_backends_priv.h" #include "pci_emul.h" -#include - -/* - * Each network backend registers a set of function pointers that are - * used to implement the net backends API. - * This might need to be exposed if we implement backends in separate files. - */ -struct net_backend { - const char *prefix; /* prefix matching this backend */ - - /* - * Routines used to initialize and cleanup the resources needed - * by a backend. The cleanup function is used internally, - * and should not be called by the frontend. - */ - int (*init)(struct net_backend *be, const char *devname, - nvlist_t *nvl, net_be_rxeof_t cb, void *param); - void (*cleanup)(struct net_backend *be); - - /* - * Called to serve a guest transmit request. The scatter-gather - * vector provided by the caller has 'iovcnt' elements and contains - * the packet to send. - */ - ssize_t (*send)(struct net_backend *be, const struct iovec *iov, - int iovcnt); - - /* - * Get the length of the next packet that can be received from - * the backend. If no packets are currently available, this - * function returns 0. - */ - ssize_t (*peek_recvlen)(struct net_backend *be); - - /* - * Called to receive a packet from the backend. When the function - * returns a positive value 'len', the scatter-gather vector - * provided by the caller contains a packet with such length. - * The function returns 0 if the backend doesn't have a new packet to - * receive. - */ - ssize_t (*recv)(struct net_backend *be, const struct iovec *iov, - int iovcnt); - - /* - * Ask the backend to enable or disable receive operation in the - * backend. On return from a disable operation, it is guaranteed - * that the receive callback won't be called until receive is - * enabled again. Note however that it is up to the caller to make - * sure that netbe_recv() is not currently being executed by another - * thread. - */ - void (*recv_enable)(struct net_backend *be); - void (*recv_disable)(struct net_backend *be); - - /* - * Ask the backend for the virtio-net features it is able to - * support. Possible features are TSO, UFO and checksum offloading - * in both rx and tx direction and for both IPv4 and IPv6. - */ - uint64_t (*get_cap)(struct net_backend *be); - - /* - * Tell the backend to enable/disable the specified virtio-net - * features (capabilities). - */ - int (*set_cap)(struct net_backend *be, uint64_t features, - unsigned int vnet_hdr_len); - - struct pci_vtnet_softc *sc; - int fd; - - /* - * Length of the virtio-net header used by the backend and the - * frontend, respectively. A zero value means that the header - * is not used. - */ - unsigned int be_vnet_hdr_len; - unsigned int fe_vnet_hdr_len; - - /* Size of backend-specific private data. */ - size_t priv_size; - - /* Backend-specific private data follows. */ -}; - -#define NET_BE_PRIV(be) ((void *)((be) + 1)) #define NET_BE_SIZE(be) (sizeof(*be) + (be)->priv_size) -SET_DECLARE(net_backend_set, struct net_backend); - -#define VNET_HDR_LEN sizeof(struct virtio_net_rxhdr) - -#define WPRINTF(params) PRINTLN params - -/* - * The tap backend - */ - -struct tap_priv { - struct mevent *mevp; - /* - * A bounce buffer that allows us to implement the peek_recvlen - * callback. In the future we may get the same information from - * the kevent data. - */ - char bbuf[1 << 16]; - ssize_t bbuflen; -}; - -static void +void tap_cleanup(struct net_backend *be) { struct tap_priv *priv = NET_BE_PRIV(be); @@ -216,7 +97,7 @@ tap_init(struct net_backend *be, const char *devname, #endif if (cb == NULL) { - WPRINTF(("TAP backend requires non-NULL callback")); + EPRINTLN("TAP backend requires non-NULL callback"); return (-1); } @@ -225,7 +106,7 @@ tap_init(struct net_backend *be, const char *devname, be->fd = open(tbuf, O_RDWR); if (be->fd == -1) { - WPRINTF(("open of tap device %s failed", tbuf)); + EPRINTLN("open of tap device %s failed", tbuf); goto error; } @@ -234,12 +115,12 @@ tap_init(struct net_backend *be, const char *devname, * notifications with the event loop */ if (ioctl(be->fd, FIONBIO, &opt) < 0) { - WPRINTF(("tap device O_NONBLOCK failed")); + EPRINTLN("tap device O_NONBLOCK failed"); goto error; } if (ioctl(be->fd, VMIO_SIOCSIFFLAGS, up)) { - WPRINTF(("tap device link up failed")); + EPRINTLN("tap device link up failed"); goto error; } @@ -254,7 +135,7 @@ tap_init(struct net_backend *be, const char *devname, priv->mevp = mevent_add_disabled(be->fd, EVF_READ, cb, param); if (priv->mevp == NULL) { - WPRINTF(("Could not register event")); + EPRINTLN("Could not register event"); goto error; } @@ -268,13 +149,13 @@ error: /* * Called to send a buffer chain out to the tap device */ -static ssize_t +ssize_t tap_send(struct net_backend *be, const struct iovec *iov, int iovcnt) { return (writev(be->fd, iov, iovcnt)); } -static ssize_t +ssize_t tap_peek_recvlen(struct net_backend *be) { struct tap_priv *priv = NET_BE_PRIV(be); @@ -304,7 +185,7 @@ tap_peek_recvlen(struct net_backend *be) return (ret); } -static ssize_t +ssize_t tap_recv(struct net_backend *be, const struct iovec *iov, int iovcnt) { struct tap_priv *priv = NET_BE_PRIV(be); @@ -332,7 +213,7 @@ tap_recv(struct net_backend *be, const struct iovec *iov, int iovcnt) return (ret); } -static void +void tap_recv_enable(struct net_backend *be) { struct tap_priv *priv = NET_BE_PRIV(be); @@ -340,7 +221,7 @@ tap_recv_enable(struct net_backend *be) mevent_enable(priv->mevp); } -static void +void tap_recv_disable(struct net_backend *be) { struct tap_priv *priv = NET_BE_PRIV(be); @@ -348,14 +229,14 @@ tap_recv_disable(struct net_backend *be) mevent_disable(priv->mevp); } -static uint64_t +uint64_t tap_get_cap(struct net_backend *be __unused) { return (0); /* no capabilities for now */ } -static int +int tap_set_cap(struct net_backend *be __unused, uint64_t features, unsigned vnet_hdr_len) { @@ -395,508 +276,6 @@ static struct net_backend vmnet_backend = { DATA_SET(net_backend_set, tap_backend); DATA_SET(net_backend_set, vmnet_backend); -#ifdef NETGRAPH - -/* - * Netgraph backend - */ - -#define NG_SBUF_MAX_SIZE (4 * 1024 * 1024) - -static int -ng_init(struct net_backend *be, const char *devname __unused, - nvlist_t *nvl, net_be_rxeof_t cb, void *param) -{ - struct tap_priv *p = NET_BE_PRIV(be); - struct ngm_connect ngc; - const char *value, *nodename; - int sbsz; - int ctrl_sock; - int flags; - unsigned long maxsbsz; - size_t msbsz; -#ifndef WITHOUT_CAPSICUM - cap_rights_t rights; -#endif - - if (cb == NULL) { - WPRINTF(("Netgraph backend requires non-NULL callback")); - return (-1); - } - - be->fd = -1; - - memset(&ngc, 0, sizeof(ngc)); - - value = get_config_value_node(nvl, "path"); - if (value == NULL) { - WPRINTF(("path must be provided")); - return (-1); - } - strncpy(ngc.path, value, NG_PATHSIZ - 1); - - value = get_config_value_node(nvl, "hook"); - if (value == NULL) - value = "vmlink"; - strncpy(ngc.ourhook, value, NG_HOOKSIZ - 1); - - value = get_config_value_node(nvl, "peerhook"); - if (value == NULL) { - WPRINTF(("peer hook must be provided")); - return (-1); - } - strncpy(ngc.peerhook, value, NG_HOOKSIZ - 1); - - nodename = get_config_value_node(nvl, "socket"); - if (NgMkSockNode(nodename, - &ctrl_sock, &be->fd) < 0) { - WPRINTF(("can't get Netgraph sockets")); - return (-1); - } - - if (NgSendMsg(ctrl_sock, ".", - NGM_GENERIC_COOKIE, - NGM_CONNECT, &ngc, sizeof(ngc)) < 0) { *** 625 LINES SKIPPED *** From nobody Thu Dec 14 14:44:46 2023 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 4SrZrG2fj8z54421; Thu, 14 Dec 2023 14:44:46 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SrZrG254Jz3LLB; Thu, 14 Dec 2023 14:44:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702565086; 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=njNz3A7LsNh84rfHYv/cepWKOvRj+mzZ2CCdkkRHAeo=; b=vIcGkTs4prHggR2BfaNAfDowh2qpdOYxaHGRPmGyZR9GXQRVw9PL9SS2h2/5AjH4YBhben kw834hCh23KG4FM/7/bMT5JJ8qAjhI2YzLTzAhVhLtlZGnHE0S0lOBLKYpZIyGhE+8ag2F yerN48mEYbjQ+a9jhrgIwCLgjzGMRPBhJkOzbJu1OVJud+NJExdf0rwj1sdT1oV5cjkCxF TQiq2Lev90mNzWjpePawDKDYfEs8MdszbtsRDxGT6YS+d2yx5Lt1EmcBZRg93YvVLlOaSa G3GxpdDpjuBlm4p5A24yijTUTZJrmKv2undJN/YUC6W4mlnqiwrV4IAjoMCOQw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702565086; a=rsa-sha256; cv=none; b=jD4D3AKqQSjMsBi2p7evUmSMeG2ZOVnLTIEb+QfB6qCPQw9pQxbr5gztGkYQ6eI1mjcUpe VhtG0iWjxcBXVZAVOXwlEPvyU3MmPHdXuYwQIWgSEZHzEEqBB5XyiHEojERnGvpeyomaGm pECrp4NYycOFCCdWpO3CK0xlG9BSOq5MiWaD79gtWDUZDP2/p6RaB+sM/xfkDZGNCOVL7T IJoOoVUirSZ+5iAKZVrbBT8zrv5eMY0cMvcsTahxI3VwuAb/h78S9jPkyKlFcZlAAlO18j j1CYJD2LlNKb7hQ2mXfGN3tnueMPZ+4Eayqj720uut9yUQeuuBAD+v3w8UPvWQ== 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=1702565086; 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=njNz3A7LsNh84rfHYv/cepWKOvRj+mzZ2CCdkkRHAeo=; b=BX59UFS++/oqea3NZE3h2+e5nDZ0mOoy2Iow0C1Wxip490jxEn+W3YSqArdmlUM8CI22Un F+O+XpwYeU0iddt0EKTliMv4A8jYAFo5OMxer1Qd1PiXh37+syIRkEP0gj0qxQon/V/YNY mv6400m6jnpEzL6V83HwZOptp3mRoD8ntdI9upYthfrUvd6BK6oISHarlSLnzpPZXuTYRX 9vvCnKKiUtYj1CSVhSWlJvP6CaYy9XRq0wuRyu/W9HuDzcBrfXQf0a5TxgbVqctN2FO2UK mc6iDM3ORhcAMr1E+EuapXJ0mQYy+r3iiWDvG0ma3OA3e7XH9jp9lSTk+SXMnQ== 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 4SrZrG17GJzXJd; Thu, 14 Dec 2023 14:44:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BEEikAc079971; Thu, 14 Dec 2023 14:44:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BEEikVU079968; Thu, 14 Dec 2023 14:44:46 GMT (envelope-from git) Date: Thu, 14 Dec 2023 14:44:46 GMT Message-Id: <202312141444.3BEEikVU079968@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: c07ebf5becae - stable/14 - kmsan: Add kmsan_check_uio() 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c07ebf5becae76dd9843b8a835df9f7ccd65e897 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=c07ebf5becae76dd9843b8a835df9f7ccd65e897 commit c07ebf5becae76dd9843b8a835df9f7ccd65e897 Author: Mark Johnston AuthorDate: 2023-12-06 16:31:15 +0000 Commit: Mark Johnston CommitDate: 2023-12-14 14:44:38 +0000 kmsan: Add kmsan_check_uio() This was handy for some ad-hoc debugging and fits in with other kmsan_check_*() routines which operate on some kind of data container. MFC after: 1 week Sponsored by: The FreeBSD Foundation (cherry picked from commit be5464ae233ada46a778cc82f7107a10a7d5343b) --- share/man/man9/Makefile | 1 + share/man/man9/kmsan.9 | 5 ++++- sys/kern/subr_msan.c | 9 +++++++++ sys/sys/msan.h | 3 +++ 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index c82ce254f681..99ec5219d8e0 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -1369,6 +1369,7 @@ MLINKS+=kmsan.9 KMSAN.9 \ kmsan.9 kmsan_check_bio.9 \ kmsan.9 kmsan_check_ccb.9 \ kmsan.9 kmsan_check_mbuf.9 \ + kmsan.9 kmsan_check_uio.9 \ kmsan.9 kmsan_mark.9 \ kmsan.9 kmsan_oirg.9 MLINKS+=kobj.9 DEFINE_CLASS.9 \ diff --git a/share/man/man9/kmsan.9 b/share/man/man9/kmsan.9 index 714442e4d9fe..90faf8f82e5e 100644 --- a/share/man/man9/kmsan.9 +++ b/share/man/man9/kmsan.9 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd October 13, 2023 +.Dd December 6, 2023 .Dt KMSAN 9 .Os .Sh NAME @@ -56,6 +56,8 @@ kernel configuration file: .Fn kmsan_check_ccb "const union ccb *" "const char *descr" .Ft void .Fn kmsan_check_mbuf "const struct mbuf *" "const char *descr" +.Ft void +.Fn kmsan_check_uio "const struct uio *" "const char *descr" .Sh DESCRIPTION .Nm is a subsystem which leverages compiler instrumentation to detect uses of @@ -306,6 +308,7 @@ f(size_t osz) .Xr busdma 9 , .Xr copyout 9 , .Xr KASAN 9 , +.Xr uio 9 , .Xr uma 9 .Rs .%A Evgeniy Stepanov diff --git a/sys/kern/subr_msan.c b/sys/kern/subr_msan.c index abac71da6d64..ef3c6c10b0ba 100644 --- a/sys/kern/subr_msan.c +++ b/sys/kern/subr_msan.c @@ -587,6 +587,15 @@ kmsan_check_mbuf(const struct mbuf *m, const char *descr) } while ((m = m->m_next) != NULL); } +void +kmsan_check_uio(const struct uio *uio, const char *descr) +{ + for (int i = 0; i < uio->uio_iovcnt; i++) { + kmsan_check(uio->uio_iov[i].iov_base, uio->uio_iov[i].iov_len, + descr); + } +} + void kmsan_init(void) { diff --git a/sys/sys/msan.h b/sys/sys/msan.h index 4baa71ec8113..58110d7306e6 100644 --- a/sys/sys/msan.h +++ b/sys/sys/msan.h @@ -50,6 +50,7 @@ union ccb; struct bio; struct mbuf; struct memdesc; +struct uio; void kmsan_init(void); @@ -69,6 +70,7 @@ void kmsan_check(const void *, size_t, const char *); void kmsan_check_bio(const struct bio *, const char *); void kmsan_check_ccb(const union ccb *, const char *); void kmsan_check_mbuf(const struct mbuf *, const char *); +void kmsan_check_uio(const struct uio *, const char *); #else #define kmsan_init(u) @@ -85,6 +87,7 @@ void kmsan_check_mbuf(const struct mbuf *, const char *); #define kmsan_check_bio(b, d) #define kmsan_check_ccb(c, d) #define kmsan_check_mbuf(m, d) +#define kmsan_check_uio(u, d) #define kmsan_bus_dmamap_sync(d, op) #endif From nobody Thu Dec 14 20:25:43 2023 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 4SrkPg29M4z53jWb; Thu, 14 Dec 2023 20:25:43 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SrkPg1l2Zz4TqB; Thu, 14 Dec 2023 20:25:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702585543; 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=NiAI/oJM0obWa/a4Dc3L41DtpBV+cD8dr3x05m/4Is0=; b=uzIOqgEt+e/n8JjUKYYvtVcNDe5X5VgElLUg3BkDBdUZMOQcxa4YKqHi7JQeM/JsPzXktu BbUazZLHdQI1qURjbcn4B2zzULXsiABwzQZZqtAmOTXFCBQbx6lWBkmG8hOSSyv9mbBdS9 HrixzwiKst/HvXyxuSqQFtPkgAZ1zn1vcN/XzJlg7o8frfrpuTl4f+HcMQdwCdzAVii+dG zAlF0f3fJt7690NnEr8OhPFaVDcWYcevAlfydb3P+Gn7+7eYZGLILFuKPlcUl5bxI7k6QL 6gslP2glR33znUJoThrrZVKvD7SPIfyFmsK9AceWeLLk7uVkdlmfPTUNAN9D9Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702585543; a=rsa-sha256; cv=none; b=T4lEfhVylpYAin+kipVbWyge33awB6dGXhYL3c3ry5IvQ5WXTPEvXjEy8K+Z6bEo5Hpgof oOomiLu8UByGbvaL6inkgus96SJyVbJNNxkVKtTNZO4yO4LWQsonfuEKSy3gQBGOHJ+Fu2 +7vPaGXLnxvw2wIeo2sBX8BtXGEWzb203AQ2q7UyP2NwWM0XVkC7WvORgtPO70/9Qs+iYX zlXVe7Z/9D+lESd0WUpimeHWtvHk63hvxRQpUN3DQbUEUY6xPLt9JHDVHHL/blnX0ya++h XckvaZjzZgn6jLqn1pRbFsa8qqM7yYm+b3QkpHt/ja97uBEBGyFBWvuzZaLYbw== 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=1702585543; 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=NiAI/oJM0obWa/a4Dc3L41DtpBV+cD8dr3x05m/4Is0=; b=GlbWaOTdyASP/vC4f1iU5yjZWsW2Yszmx4ic03qUvQ52WmHRxRwDFcBBA611YDtxKDLsH/ Q4KnWOdFgH2eNYcNsFwGPjWxbtQz80N+SWNvN5yuFlGHxclj3l0MZSYpeflFh5oZBpXTdR HDqQcTNglcnx74C2V3N06iNbAy1pO+iHPd+e41NzJZ0MfmK34vUnV18gktn8OhR+TkO+y2 Qjy7RttRdttAoZ9wQBmQLAhAdLDX/OUxbau+Ydab/XhkWuR0AVYEtaDdK5/AtSLbqf8KN8 fJDfaGoBMx83V7RBuNPMpugLyyqSrLEL2vRoGMY+ePOtzkLt66yF5mfhByjsmw== 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 4SrkPg0pkLzj0l; Thu, 14 Dec 2023 20:25:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BEKPhR5052062; Thu, 14 Dec 2023 20:25:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BEKPh9t052059; Thu, 14 Dec 2023 20:25:43 GMT (envelope-from git) Date: Thu, 14 Dec 2023 20:25:43 GMT Message-Id: <202312142025.3BEKPh9t052059@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Brooks Davis Subject: git: 9ba8c825a392 - stable/13 - sysvipc: Fix 32-bit compat on !i386 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 9ba8c825a392e141bc05efb71595f949b00a3719 Auto-Submitted: auto-generated The branch stable/13 has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=9ba8c825a392e141bc05efb71595f949b00a3719 commit 9ba8c825a392e141bc05efb71595f949b00a3719 Author: Brooks Davis AuthorDate: 2023-12-01 20:48:29 +0000 Commit: Brooks Davis CommitDate: 2023-12-14 20:25:27 +0000 sysvipc: Fix 32-bit compat on !i386 The various time fields are time_t's which are only 32-bit on i386. Fixing the old versions is probably of little use, but it's more correct and in theory there could be powerpc binaries from 6.x. PR: 240035 Fixes: fbb273bc05bef Properly support for FreeBSD 4 32bit System V shared memory. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D42870 (cherry picked from commit 957f014dc076a7f74ed0c8c8699e6f39b55785e7) --- sys/compat/freebsd32/freebsd32_ipc.h | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/sys/compat/freebsd32/freebsd32_ipc.h b/sys/compat/freebsd32/freebsd32_ipc.h index e31fef9a38fe..5ded02045875 100644 --- a/sys/compat/freebsd32/freebsd32_ipc.h +++ b/sys/compat/freebsd32/freebsd32_ipc.h @@ -43,8 +43,8 @@ struct semid_ds32 { struct ipc_perm32 sem_perm; uint32_t __sem_base; unsigned short sem_nsems; - int32_t sem_otime; - int32_t sem_ctime; + time32_t sem_otime; + time32_t sem_ctime; }; #ifdef _KERNEL @@ -73,9 +73,9 @@ struct msqid_ds32 { uint32_t msg_qbytes; pid_t msg_lspid; pid_t msg_lrpid; - int32_t msg_stime; - int32_t msg_rtime; - int32_t msg_ctime; + time32_t msg_stime; + time32_t msg_rtime; + time32_t msg_ctime; }; #ifdef _KERNEL @@ -95,9 +95,9 @@ struct shmid_ds32 { pid_t shm_lpid; pid_t shm_cpid; unsigned int shm_nattch; - int32_t shm_atime; - int32_t shm_dtime; - int32_t shm_ctime; + time32_t shm_atime; + time32_t shm_dtime; + time32_t shm_ctime; }; #ifdef _KERNEL @@ -142,9 +142,9 @@ struct semid_ds32_old { struct ipc_perm32_old sem_perm; uint32_t __sem_base; unsigned short sem_nsems; - int32_t sem_otime; + time32_t sem_otime; int32_t sem_pad1; - int32_t sem_ctime; + time32_t sem_ctime; int32_t sem_pad2; int32_t sem_pad3[4]; }; @@ -158,11 +158,11 @@ struct msqid_ds32_old { uint32_t msg_qbytes; pid_t msg_lspid; pid_t msg_lrpid; - int32_t msg_stime; + time32_t msg_stime; int32_t msg_pad1; - int32_t msg_rtime; + time32_t msg_rtime; int32_t msg_pad2; - int32_t msg_ctime; + time32_t msg_ctime; int32_t msg_pad3; int32_t msg_pad4[4]; }; @@ -173,9 +173,9 @@ struct shmid_ds32_old { pid_t shm_lpid; pid_t shm_cpid; int16_t shm_nattch; - int32_t shm_atime; - int32_t shm_dtime; - int32_t shm_ctime; + time32_t shm_atime; + time32_t shm_dtime; + time32_t shm_ctime; uint32_t shm_internal; }; From nobody Thu Dec 14 20:59:27 2023 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 4Srl8b3cbqz53mCh; Thu, 14 Dec 2023 20:59:27 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Srl8b33FJz4lNh; Thu, 14 Dec 2023 20:59:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702587567; 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=5PixW+iUQHNpqSR4KHs/XNKGqKFE07Iw+I+7D97xZoA=; b=MY+n+iz0R51TnQdl35Xv9H2bEnzQhzcaIgEgM8+sZx71xKczrBlyVFfnS6nA8GSeIMlNkT rXQXPzFsBXkTIpi8ZsI5fvKEUZNIpGkxsDzAXWnsOGxQvqNwN/+XmSTncyJqG0U8/po6pf StSxzaislSe8hZpEhulVHuoajfx1xQ5oLhKYdra5iGkflBzt66+hkAhRg/HUn/I+YhDWKd BheNMb7QyLL0IcH7aYmPjIMUaOeXqlS9Qg+3Z5+lw7vgJfg2bGYjQ4+iNATXTcH5ZMKxCw zoWI74vC1NFSzU1gQF7PmBm2+8xnGqTJn84/BMlHSkHDG8+MecJ6oO5xEpiLnA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702587567; a=rsa-sha256; cv=none; b=tKRLAya1uJQWvwJATDUq1KRxJFIWox3QHINaJS+wBoSye2JBZgI5gA0qQIZDG9w0zh8TN9 MaScMsEuOM82Zrn9mq62d06GiVryFctQeGmRQPJcTPneE+vdsottsi/SuCuiG8qnsqUP2h 8m4jSYtp/kD0xYyl+1cyxZ2XPOf6rzFZ9aP4awktD00a5rYC1/CfpkQAeOfxNYhZaxpr99 mPD6wYDpDZ9SEOQEm+Gr2RYsluVjqVDcveeUKQ63tj94YhMxZRuK81xCAxtN/v1Xq4l5Vq TKYFVw27MyHc5Ni1kXfoIWbLV+i9B2he1nqAq5VoxzWUcWh1G59N2+GxfU2xdw== 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=1702587567; 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=5PixW+iUQHNpqSR4KHs/XNKGqKFE07Iw+I+7D97xZoA=; b=vH3lkJpB1xrj3AyenG2bKQLPE+JH5LIBQndClodELVkqAC5QV/W4L40o9Dz9YArfQZk0u9 j5mG/0V1mmBukTz0b0TSLd8cYeED6niebEJs9CP1+lLxxMjXV5/CrOAoiyeGSI5EsyK0MU bZKE+ruGxzM0dtBDw+vn6M1cfZKRZQk0oOaxoSIIdomKa5O+ondscjEPYbefj1FXTre5ek QYaVufrvhbDz8uOdeFrL79Irz7h8KY+eo7R25RklduG7ogZxNi/w/4bPzYDOmKaVWOlJ6b tbaMpJKTpWSVhmCTqxTIXBKb+Okc+1BYYcYXIlqJK7n/7BSFZc4rDTFDWn91Rw== 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 4Srl8b26knzjb3; Thu, 14 Dec 2023 20:59:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BEKxR3P009385; Thu, 14 Dec 2023 20:59:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BEKxRTG009382; Thu, 14 Dec 2023 20:59:27 GMT (envelope-from git) Date: Thu, 14 Dec 2023 20:59:27 GMT Message-Id: <202312142059.3BEKxRTG009382@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Kenneth D. Merry" Subject: git: a9262d053b63 - stable/14 - Add IBM TS1170 density codes and specs. 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ken X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a9262d053b6322155fe844e798cab35cc8ed0c2e Auto-Submitted: auto-generated The branch stable/14 has been updated by ken: URL: https://cgit.FreeBSD.org/src/commit/?id=a9262d053b6322155fe844e798cab35cc8ed0c2e commit a9262d053b6322155fe844e798cab35cc8ed0c2e Author: Kenneth D. Merry AuthorDate: 2023-10-31 19:20:36 +0000 Commit: Kenneth D. Merry CommitDate: 2023-12-14 20:55:24 +0000 Add IBM TS1170 density codes and specs. These were obtained from a drive, but they agree with the IBM documentation. The bpi/bpmm values are the same as TS1160, but the number of tracks is much larger (18944 tracks vs 8704 for TS1160). The tapes are also longer, 1337m total. (According to the MAM on a sample JF tape. I don't have a JE tape handy to compare.) The end result is a 50TB raw capacity (150TB compressed) for TS1170 with a JF cartridge vs 20TB raw capacity (60TB compressed) for TS1160 with a JE cartridge. lib/libmt/mtlib.c: Add the TS1170 density codes to the denstiy table in libmt. usr.bin/mt/mt.1: Add the TS1170 density codes and specs to the density table in the mt(1) man page. As usual for TS drives, there is an encrypted and non-encrypted density code (0x79 and 0x59 respectively). Sponsored by: Spectra Logic (cherry picked from commit 83823d063ab57db8d3954c1530d036f1ccdceb41) --- lib/libmt/mtlib.c | 2 ++ usr.bin/mt/mt.1 | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/libmt/mtlib.c b/lib/libmt/mtlib.c index edcf747bd808..43f9c95bb797 100644 --- a/lib/libmt/mtlib.c +++ b/lib/libmt/mtlib.c @@ -642,6 +642,7 @@ static struct densities { { 0x56, 20670, 525018, "3592B5 (unencrypted)" }, { 0x57, 21850, 554990, "3592A6 (unencrypted)" }, { 0x58, 15142, 384607, "LTO-5" }, + { 0x59, 21850, 554990, "3592A7 (unencrypted)" }, { 0x5A, 15142, 384607, "LTO-6" }, { 0x5C, 19107, 485318, "LTO-7" }, { 0x5D, 19107, 485318, "LTO-M8" }, @@ -654,6 +655,7 @@ static struct densities { { 0x75, 20670, 525018, "3592A5 (encrypted)" }, { 0x76, 20670, 525018, "3592B5 (encrypted)" }, { 0x77, 21850, 554990, "3592A6 (encrypted)" }, + { 0x79, 21850, 554990, "3592A7 (encrypted)" }, { 0x8c, 1789, 45434, "EXB-8500c" }, { 0x90, 1703, 43245, "EXB-8200c" }, { 0, 0, 0, NULL } diff --git a/usr.bin/mt/mt.1 b/usr.bin/mt/mt.1 index 2cc649c43f13..5eb584336b2a 100644 --- a/usr.bin/mt/mt.1 +++ b/usr.bin/mt/mt.1 @@ -28,7 +28,7 @@ .\" .\" @(#)mt.1 8.1 (Berkeley) 6/6/93 .\" -.Dd December 10, 2020 +.Dd October 31, 2023 .Dt MT 1 .Os .Sh NAME @@ -520,6 +520,7 @@ Value Width Tracks Density Code Type Reference Note 0x56 12.7 (0.5) 7680 20,670 (525,018) C 3592B5 (unencrypted) 0x57 12.7 (0.5) 8704 21,850 (554,990) C 3592A6 (unencrypted) 0x58 12.7 (0.5) 1280 15,142 (384,607) C LTO-5 +0x59 12.7 (0.5)18944 21,850 (554,990) C 3592A7 (unencrypted) 0x5A 12.7 (0.5) 2176 15,142 (384,607) C LTO-6 0x5C 12.7 (0.5) 3584 19,107 (485,318) C LTO-7 0x5D 12.7 (0.5) 5376 19,107 (485,318) C LTO-M8 14 @@ -532,6 +533,7 @@ Value Width Tracks Density Code Type Reference Note 0x75 12.7 (0.5) 5120 20,670 (525,018) C 3592A5 (encrypted) 0x76 12.7 (0.5) 7680 20,670 (525,018) C 3592B5 (encrypted) 0x77 12.7 (0.5) 8704 21,850 (554,990) C 3592A6 (encrypted) +0x79 12.7 (0.5)18944 21,850 (554,990) C 3592A7 (encrypted) 0x8c 8.0 (0.315) 1 1,789 (45,434) RLL CS EXB-8500c 5,9 0x90 8.0 (0.315) 1 1,703 (43,245) RLL CS EXB-8200c 5,9 .Ed From nobody Thu Dec 14 21:01:22 2023 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 4SrlBq0WLdz53lx7; Thu, 14 Dec 2023 21:01:23 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SrlBq00JKz4lMn; Thu, 14 Dec 2023 21:01:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702587683; 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=Ofl/xZCfxwswDtUFvr8JGJf8yNEkFNqZEgfekKeTdx0=; b=LHwId5b4p/Jiy1RrRg1pKMjoiG6u1AUt/kwOSFVoapAkK1Hq05OmD/08J8w6B+JIcE55mf FCEPLgc+WnDXdHLWE4DseWgNLvuVOtcIb86Ufe+9DSWWkCtfNa/jtGLrvHpjqdmZn5qmQb FeGkFAe7TG8/k5EulHfEipvcgIQyQNZF+4N9HBnD9Qi1S7bWPXkXbuwxZ4BQBZSH+5I7l6 04+/VZb9/EcKXNh5mUlu4Z0JKWlJtzc1JwCfoeTvVTluqiZoDQeaUbDLxxX3oQQlToJD3C 1SnCcWg6vZeOH2PQJkcMW6pIJnV9cOgIU4DF4xVH8RZ7uOHK9wIIq3XHzvNIsA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702587683; a=rsa-sha256; cv=none; b=VSW7pwwzkXxIu9p4cVL7OhXCgm+im6x3dW+F0X6TeVEdQZWkFphwOBr66eXD0v+yUMl+gp dXZsq8ySsWaM26fYAhI6k8kgVnipdXo1h+tBpzTIvVVG0TS69DsJEOFX1I3wnw/wdRvkg2 lXinqfKAa0lfsSpC7rKGOfnihB8LbFrMb+PveDpXtq30fAu7S1SJ2kd9n5pZpQy9g4S4um sri4tC3aw7U9zB6mADFiaCAA3I47fWqPwXK9DkV2XUpJs1SBgyR3bYROnc26ew6YVCez/0 PW6Gnasm6wWhGMNJAgEfBQia47IOVOVGQiyBqMo2UOfPPpPFxVhPfHWLSRw3dg== 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=1702587683; 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=Ofl/xZCfxwswDtUFvr8JGJf8yNEkFNqZEgfekKeTdx0=; b=jP9ACtI0ejLfeMj4hdYepYWBZCerg/RS+JXL9hgiNx2GlRT49Z/YZvMkeaIgpbfsUjNB4V G1xDA1vr9rpfYTw09JNTmM3qvwdC8fqK6MMOWsfjSF+yOP0xOqqWdcoGBvcWpGxkJOSVC8 BJQt0EZ+ue09WTMJUugGV+YoqJUUDXLZ42ofnGS2FZx3ySIwHt30MEoaF/2T71xW9jNntw bgpStgPxR67EsM+RhZNtdcB3DntK40ckZtiHNy/flwgzW09Q94dwFltTa5/4drfa0d0xi1 obeZyJRcTmpG78TbYjNdmdmBeb43bipzctS5/ohvVVdYutN4utMUnkrQQCLI2g== 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 4SrlBp69gqzjYN; Thu, 14 Dec 2023 21:01:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BEL1M26022063; Thu, 14 Dec 2023 21:01:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BEL1MAY022060; Thu, 14 Dec 2023 21:01:22 GMT (envelope-from git) Date: Thu, 14 Dec 2023 21:01:22 GMT Message-Id: <202312142101.3BEL1MAY022060@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Kenneth D. Merry" Subject: git: 9e6e28bb8ea8 - stable/13 - Add IBM TS1170 density codes and specs. 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ken X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 9e6e28bb8ea80a87c915ac9a107212b87cf7cab7 Auto-Submitted: auto-generated The branch stable/13 has been updated by ken: URL: https://cgit.FreeBSD.org/src/commit/?id=9e6e28bb8ea80a87c915ac9a107212b87cf7cab7 commit 9e6e28bb8ea80a87c915ac9a107212b87cf7cab7 Author: Kenneth D. Merry AuthorDate: 2023-10-31 19:20:36 +0000 Commit: Kenneth D. Merry CommitDate: 2023-12-14 21:00:54 +0000 Add IBM TS1170 density codes and specs. These were obtained from a drive, but they agree with the IBM documentation. The bpi/bpmm values are the same as TS1160, but the number of tracks is much larger (18944 tracks vs 8704 for TS1160). The tapes are also longer, 1337m total. (According to the MAM on a sample JF tape. I don't have a JE tape handy to compare.) The end result is a 50TB raw capacity (150TB compressed) for TS1170 with a JF cartridge vs 20TB raw capacity (60TB compressed) for TS1160 with a JE cartridge. lib/libmt/mtlib.c: Add the TS1170 density codes to the denstiy table in libmt. usr.bin/mt/mt.1: Add the TS1170 density codes and specs to the density table in the mt(1) man page. As usual for TS drives, there is an encrypted and non-encrypted density code (0x79 and 0x59 respectively). Sponsored by: Spectra Logic (cherry picked from commit 83823d063ab57db8d3954c1530d036f1ccdceb41) --- lib/libmt/mtlib.c | 2 ++ usr.bin/mt/mt.1 | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/libmt/mtlib.c b/lib/libmt/mtlib.c index edcf747bd808..43f9c95bb797 100644 --- a/lib/libmt/mtlib.c +++ b/lib/libmt/mtlib.c @@ -642,6 +642,7 @@ static struct densities { { 0x56, 20670, 525018, "3592B5 (unencrypted)" }, { 0x57, 21850, 554990, "3592A6 (unencrypted)" }, { 0x58, 15142, 384607, "LTO-5" }, + { 0x59, 21850, 554990, "3592A7 (unencrypted)" }, { 0x5A, 15142, 384607, "LTO-6" }, { 0x5C, 19107, 485318, "LTO-7" }, { 0x5D, 19107, 485318, "LTO-M8" }, @@ -654,6 +655,7 @@ static struct densities { { 0x75, 20670, 525018, "3592A5 (encrypted)" }, { 0x76, 20670, 525018, "3592B5 (encrypted)" }, { 0x77, 21850, 554990, "3592A6 (encrypted)" }, + { 0x79, 21850, 554990, "3592A7 (encrypted)" }, { 0x8c, 1789, 45434, "EXB-8500c" }, { 0x90, 1703, 43245, "EXB-8200c" }, { 0, 0, 0, NULL } diff --git a/usr.bin/mt/mt.1 b/usr.bin/mt/mt.1 index 2cc649c43f13..5eb584336b2a 100644 --- a/usr.bin/mt/mt.1 +++ b/usr.bin/mt/mt.1 @@ -28,7 +28,7 @@ .\" .\" @(#)mt.1 8.1 (Berkeley) 6/6/93 .\" -.Dd December 10, 2020 +.Dd October 31, 2023 .Dt MT 1 .Os .Sh NAME @@ -520,6 +520,7 @@ Value Width Tracks Density Code Type Reference Note 0x56 12.7 (0.5) 7680 20,670 (525,018) C 3592B5 (unencrypted) 0x57 12.7 (0.5) 8704 21,850 (554,990) C 3592A6 (unencrypted) 0x58 12.7 (0.5) 1280 15,142 (384,607) C LTO-5 +0x59 12.7 (0.5)18944 21,850 (554,990) C 3592A7 (unencrypted) 0x5A 12.7 (0.5) 2176 15,142 (384,607) C LTO-6 0x5C 12.7 (0.5) 3584 19,107 (485,318) C LTO-7 0x5D 12.7 (0.5) 5376 19,107 (485,318) C LTO-M8 14 @@ -532,6 +533,7 @@ Value Width Tracks Density Code Type Reference Note 0x75 12.7 (0.5) 5120 20,670 (525,018) C 3592A5 (encrypted) 0x76 12.7 (0.5) 7680 20,670 (525,018) C 3592B5 (encrypted) 0x77 12.7 (0.5) 8704 21,850 (554,990) C 3592A6 (encrypted) +0x79 12.7 (0.5)18944 21,850 (554,990) C 3592A7 (encrypted) 0x8c 8.0 (0.315) 1 1,789 (45,434) RLL CS EXB-8500c 5,9 0x90 8.0 (0.315) 1 1,703 (43,245) RLL CS EXB-8200c 5,9 .Ed From nobody Fri Dec 15 00:41:40 2023 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 4Srr503zrlz5416f; Fri, 15 Dec 2023 00:41:40 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Srr503Xzkz3XNf; Fri, 15 Dec 2023 00:41:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702600900; 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=/1iekZ2xPcLBxm0wHgetgosNg4ch7U2Cz6V/zbQFC9k=; b=Dpza0fP+duPfUSFsh/vJUYjocShlK3XM9pgaO48/TEX80lOiImtrBjcsHti/yBPxXkqI0E 59cy7PUQfnZYM+XvFb/3fVHRyxJwgscu+81gyeKqOVIm1vfOlOz5ihiwvPlD1+VPWH2Iy0 xFpkZ12ZurTiXOWNUNSwqX1C2Pj0ny/sISNBHksC45mGCDdh7Yxg+EEEAPbHXz2Gi9amiw yfLTMdYWkVtAlr9dtH+8mHHJ6eAc+FQqo4qRuDdDLe9Gw2ewmHL6Uk9uqEL8Ccy80g5Dim gGV6d0O4qEN/X/Tjd6H9v+0NFdahoccTIcaSKZ7G5qC99MLw74NWS/wcgHHcbA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702600900; a=rsa-sha256; cv=none; b=WXVjzLkt4Aqa9y9GUj2YaKhksRz/8nrGZLykIwI2iI6XJL5UMlk7w45lBwtdVUfLnD3QD5 vOzj3jW08LeTMXBKQYRw16hrEZYUaxX7/Jb3POeV51Pjhl4UiF2Sjd/eC8DDHp6xIMWiV7 DgAUK+JImx9XH/w2+G1OCByqGsP533XJcOVsnYhDm4OOLVPG94niqpFfC3Dybq4qKbTngu JgKYHKxkGnxQjo8I1/05aa9WKb1VUccpVs09L32EGsRdHwCX6hgHxEiTJA9reTZd3pFTw+ sSnSx4l99TOyvS5o6Nx5gfdygc4onvpKRNdTkuFxAginropnmolIiwGtk7e3Zg== 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=1702600900; 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=/1iekZ2xPcLBxm0wHgetgosNg4ch7U2Cz6V/zbQFC9k=; b=WxElMI8hE5bX2bdnPGeiyuAnb35jaRRxLmo15hR+BTDwZnYUDtZ4GkuYbinOvOWcSFx8Zw S98Q8NxVP5m4NHxPCxL8En9eReBxHuEPGXDYIcuY04YFQ3VOagab+JXhYcpi0ilw8SwSqt CjgJLtM7bu0x0CC0eXCrkQqWvK/Ry9mm4la8M+0jvAjZ+lCY4WzWjSwx8rCMRuUvDsHG1q 5h2wsV1JnPOTmdxnp4QuJCMsjXtehRZiU6+suyNd9HOflsxe738OQvxlF/DqNXenpCPG/c 091s68kuVXH93FEyPoLpj/XfQ/vlAgYxuaYq95MoS2pnhGrS+ruPr+rej2Y1GA== 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 4Srr502KLHzq6r; Fri, 15 Dec 2023 00:41:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BF0feNv089965; Fri, 15 Dec 2023 00:41:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BF0fekx089962; Fri, 15 Dec 2023 00:41:40 GMT (envelope-from git) Date: Fri, 15 Dec 2023 00:41:40 GMT Message-Id: <202312150041.3BF0fekx089962@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: e1028df36d14 - stable/13 - sort: test against all month formats in month-sort 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e1028df36d14920f18bbdd8e89f248bb08083ffe Auto-Submitted: auto-generated The branch stable/13 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=e1028df36d14920f18bbdd8e89f248bb08083ffe commit e1028df36d14920f18bbdd8e89f248bb08083ffe Author: Christos Margiolis AuthorDate: 2023-12-01 00:30:10 +0000 Commit: Christos Margiolis CommitDate: 2023-12-15 00:40:14 +0000 sort: test against all month formats in month-sort The CLDR specification [1] defines three possible month formats: - Abbreviation (e.g Jan, Ιαν) - Full (e.g January, Ιανουαρίου) - Standalone (e.g January, Ιανουάριος) Many languages use different case endings depending on whether the month is referenced as a standalone word (nominative case), or in date context (genitive, partitive, etc.). sort(1)'s -M option currently sorts months by testing input against only the abbrevation format, which is essentially a substring of the full format. While this works fine for languages like English, where there are no cases, for languages where there is a different case ending between the abbreviation/full and standalone formats, it is not sufficient. For example, in Greek, "May" can take the following forms: Abbreviation: Μαΐ (genitive case) Full: Μαΐου (genitive case) Standalone: Μάιος (nominative case) If we use the standalone format in Greek, sort(1) will not able to match "Μαΐ" to "Μάιος" and the sort will fail. This change makes sort(1) test against all three formats. It also works when the input contains mixed formats. [1] https://cldr.unicode.org/translation/date-time/date-time-patterns Reviewed by: markj MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D42847 (cherry picked from commit 3d44dce90a6946e2ef2ab30ffbf8e2930acf888b) --- usr.bin/sort/bwstring.c | 144 +++++++++++++++++++-------- usr.bin/sort/sort.1.in | 6 +- usr.bin/sort/tests/Makefile | 1 + usr.bin/sort/tests/sort_monthsort_test.sh | 159 ++++++++++++++++++++++++++++++ 4 files changed, 263 insertions(+), 47 deletions(-) diff --git a/usr.bin/sort/bwstring.c b/usr.bin/sort/bwstring.c index fc1b50cb78ac..b0c14e996b23 100644 --- a/usr.bin/sort/bwstring.c +++ b/usr.bin/sort/bwstring.c @@ -43,63 +43,114 @@ bool byte_sort; -static wchar_t **wmonths; -static char **cmonths; +struct wmonth { + wchar_t *mon; + wchar_t *ab; + wchar_t *alt; +}; -/* initialise months */ +struct cmonth { + char *mon; + char *ab; + char *alt; +}; + +static struct wmonth *wmonths; +static struct cmonth *cmonths; + +static int +populate_cmonth(char **field, const nl_item item, int idx) +{ + char *tmp, *m; + size_t i, len; + + tmp = nl_langinfo(item); + if (debug_sort) + printf("month[%d]=%s\n", idx, tmp); + if (*tmp == '\0') + return (0); + m = sort_strdup(tmp); + len = strlen(tmp); + for (i = 0; i < len; i++) + m[i] = toupper(m[i]); + *field = m; + + return (1); +} + +static int +populate_wmonth(wchar_t **field, const nl_item item, int idx) +{ + wchar_t *m; + char *tmp; + size_t i, len; + + tmp = nl_langinfo(item); + if (debug_sort) + printf("month[%d]=%s\n", idx, tmp); + if (*tmp == '\0') + return (0); + len = strlen(tmp); + m = sort_malloc(SIZEOF_WCHAR_STRING(len + 1)); + if (mbstowcs(m, tmp, len) == ((size_t) - 1)) { + sort_free(m); + return (0); + } + m[len] = L'\0'; + for (i = 0; i < len; i++) + m[i] = towupper(m[i]); + *field = m; + + return (1); +} void initialise_months(void) { - const nl_item item[12] = { ABMON_1, ABMON_2, ABMON_3, ABMON_4, + const nl_item mon_item[12] = { MON_1, MON_2, MON_3, MON_4, + MON_5, MON_6, MON_7, MON_8, MON_9, MON_10, + MON_11, MON_12 }; + const nl_item ab_item[12] = { ABMON_1, ABMON_2, ABMON_3, ABMON_4, ABMON_5, ABMON_6, ABMON_7, ABMON_8, ABMON_9, ABMON_10, ABMON_11, ABMON_12 }; - char *tmp; - size_t len; - + const nl_item alt_item[12] = { ALTMON_1, ALTMON_2, ALTMON_3, ALTMON_4, + ALTMON_5, ALTMON_6, ALTMON_7, ALTMON_8, ALTMON_9, ALTMON_10, + ALTMON_11, ALTMON_12 }; + int i; + + /* + * Handle all possible month formats: abbrevation, full name, + * standalone name (without case ending). + */ if (mb_cur_max == 1) { if (cmonths == NULL) { - char *m; - - cmonths = sort_malloc(sizeof(char*) * 12); - for (int i = 0; i < 12; i++) { - cmonths[i] = NULL; - tmp = nl_langinfo(item[i]); - if (debug_sort) - printf("month[%d]=%s\n", i, tmp); - if (*tmp == '\0') + cmonths = sort_malloc(sizeof(struct cmonth) * 12); + for (i = 0; i < 12; i++) { + if (!populate_cmonth(&cmonths[i].mon, + mon_item[i], i)) + continue; + if (!populate_cmonth(&cmonths[i].ab, + ab_item[i], i)) + continue; + if (!populate_cmonth(&cmonths[i].alt, + alt_item[i], i)) continue; - m = sort_strdup(tmp); - len = strlen(tmp); - for (unsigned int j = 0; j < len; j++) - m[j] = toupper(m[j]); - cmonths[i] = m; } } } else { if (wmonths == NULL) { - wchar_t *m; - - wmonths = sort_malloc(sizeof(wchar_t *) * 12); - for (int i = 0; i < 12; i++) { - wmonths[i] = NULL; - tmp = nl_langinfo(item[i]); - if (debug_sort) - printf("month[%d]=%s\n", i, tmp); - if (*tmp == '\0') + wmonths = sort_malloc(sizeof(struct wmonth) * 12); + for (i = 0; i < 12; i++) { + if (!populate_wmonth(&wmonths[i].mon, + mon_item[i], i)) continue; - len = strlen(tmp); - m = sort_malloc(SIZEOF_WCHAR_STRING(len + 1)); - if (mbstowcs(m, tmp, len) == - ((size_t) - 1)) { - sort_free(m); + if (!populate_wmonth(&wmonths[i].ab, + ab_item[i], i)) + continue; + if (!populate_wmonth(&wmonths[i].alt, + alt_item[i], i)) continue; - } - m[len] = L'\0'; - for (unsigned int j = 0; j < len; j++) - m[j] = towupper(m[j]); - wmonths[i] = m; } } } @@ -754,8 +805,11 @@ bws_month_score(const struct bwstring *s0) ++s; for (int i = 11; i >= 0; --i) { - if (cmonths[i] && - (s == strstr(s, cmonths[i]))) + if (cmonths[i].mon && (s == strstr(s, cmonths[i].mon))) + return (i); + if (cmonths[i].ab && (s == strstr(s, cmonths[i].ab))) + return (i); + if (cmonths[i].alt && (s == strstr(s, cmonths[i].alt))) return (i); } @@ -769,7 +823,11 @@ bws_month_score(const struct bwstring *s0) ++s; for (int i = 11; i >= 0; --i) { - if (wmonths[i] && (s == wcsstr(s, wmonths[i]))) + if (wmonths[i].ab && (s == wcsstr(s, wmonths[i].ab))) + return (i); + if (wmonths[i].mon && (s == wcsstr(s, wmonths[i].mon))) + return (i); + if (wmonths[i].alt && (s == wcsstr(s, wmonths[i].alt))) return (i); } } diff --git a/usr.bin/sort/sort.1.in b/usr.bin/sort/sort.1.in index d509c7780f81..ec23ae2d8b70 100644 --- a/usr.bin/sort/sort.1.in +++ b/usr.bin/sort/sort.1.in @@ -30,9 +30,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" @(#)sort.1 8.1 (Berkeley) 6/6/93 -.\" -.Dd September 4, 2019 +.Dd November 30, 2023 .Dt SORT 1 .Os .Sh NAME @@ -181,7 +179,7 @@ options (human-readable). .It Fl i , Fl Fl ignore-nonprinting Ignore all non-printable characters. .It Fl M , Fl Fl month-sort , Fl Fl sort=month -Sort by month abbreviations. +Sort by month. Unknown strings are considered smaller than the month names. .It Fl n , Fl Fl numeric-sort , Fl Fl sort=numeric Sort fields numerically by arithmetic value. diff --git a/usr.bin/sort/tests/Makefile b/usr.bin/sort/tests/Makefile index 1982fd1cee0a..752dec06bbff 100644 --- a/usr.bin/sort/tests/Makefile +++ b/usr.bin/sort/tests/Makefile @@ -2,6 +2,7 @@ PACKAGE= tests NETBSD_ATF_TESTS_SH= sort_test +ATF_TESTS_SH= sort_monthsort_test ${PACKAGE}FILES+= d_any_char_dflag_out.txt ${PACKAGE}FILES+= d_any_char_fflag_out.txt diff --git a/usr.bin/sort/tests/sort_monthsort_test.sh b/usr.bin/sort/tests/sort_monthsort_test.sh new file mode 100755 index 000000000000..db42981fb107 --- /dev/null +++ b/usr.bin/sort/tests/sort_monthsort_test.sh @@ -0,0 +1,159 @@ +# +# SPDX-License-Identifier: BSD-2-Clause +# +# Copyright (c) 2023 Christos Margiolis +# + +get_months_fmt() +{ + rm -f in + for i in $(seq 12 1); do + printf "2000-%02d-01\n" ${i} | xargs -I{} \ + date -jf "%Y-%m-%d" {} "${1}" >>in + done +} + +atf_test_case monthsort_english +monthsort_english_head() +{ + atf_set "descr" "Test the -M flag with English months" +} +monthsort_english_body() +{ + export LC_TIME="en_US.UTF-8" + + cat >expout <expout <expout <expout <in <expout < To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 4c45ab6ac8c8 - stable/13 - sort: Only build FreeBSD-specific ALTMON_x stuff when ATLMON_1 is defined 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4c45ab6ac8c875fc227a40e4c5304d604b6c2a96 Auto-Submitted: auto-generated The branch stable/13 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=4c45ab6ac8c875fc227a40e4c5304d604b6c2a96 commit 4c45ab6ac8c875fc227a40e4c5304d604b6c2a96 Author: Warner Losh AuthorDate: 2023-12-07 20:27:07 +0000 Commit: Christos Margiolis CommitDate: 2023-12-15 00:41:05 +0000 sort: Only build FreeBSD-specific ALTMON_x stuff when ATLMON_1 is defined On MacOS, we bootstrap sort. Since ALTMON_* are not defined there, the build blows up. Since we don't need this feature for the FreeBSD build process, and since we won't use it unless we actually install the NL files that have this data in it, just #ifdef it out for now. In the extremely unlikely event that the FreeBSD bootstrap/build process grows this dependency, we can evaluate the best solution then (which most likely is going to be not depend on the local's month names). Fixes: 3d44dce90a69 (MacOS builds and github CI) Sponsored by: Netflix Reviewed by: jrtc27, jlduran@gmail.com, markj Differential Revision: https://reviews.freebsd.org/D42868 (cherry picked from commit bd234c0d4c8256db7e5a1fdda9ef311c9e0080e4) --- usr.bin/sort/bwstring.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/usr.bin/sort/bwstring.c b/usr.bin/sort/bwstring.c index b0c14e996b23..10679fe631ba 100644 --- a/usr.bin/sort/bwstring.c +++ b/usr.bin/sort/bwstring.c @@ -113,9 +113,11 @@ initialise_months(void) const nl_item ab_item[12] = { ABMON_1, ABMON_2, ABMON_3, ABMON_4, ABMON_5, ABMON_6, ABMON_7, ABMON_8, ABMON_9, ABMON_10, ABMON_11, ABMON_12 }; +#ifdef ALTMON_1 const nl_item alt_item[12] = { ALTMON_1, ALTMON_2, ALTMON_3, ALTMON_4, ALTMON_5, ALTMON_6, ALTMON_7, ALTMON_8, ALTMON_9, ALTMON_10, ALTMON_11, ALTMON_12 }; +#endif int i; /* @@ -132,9 +134,13 @@ initialise_months(void) if (!populate_cmonth(&cmonths[i].ab, ab_item[i], i)) continue; +#ifdef ALTMON_1 if (!populate_cmonth(&cmonths[i].alt, alt_item[i], i)) continue; +#else + cmonths[i].alt = NULL; +#endif } } @@ -148,9 +154,13 @@ initialise_months(void) if (!populate_wmonth(&wmonths[i].ab, ab_item[i], i)) continue; +#ifdef ALTMON_1 if (!populate_wmonth(&wmonths[i].alt, alt_item[i], i)) continue; +#else + wmonths[i].alt = NULL; +#endif } } } From nobody Fri Dec 15 00:42:46 2023 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 4Srr6G3gM0z541Z7; Fri, 15 Dec 2023 00:42:46 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Srr6G36s1z3XtP; Fri, 15 Dec 2023 00:42:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702600966; 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=IRl4l9E9WAC4WQOQQ1ZRA3UwdfYJ18sjO1+KPdEK9HU=; b=iC2wgjA4G7u+QR05HkWQG5QrIHc+r/WVfWQtUKLuTISBqeP4xxd4FQ1QAelAzGCLU3HquN Gwqh58M3XPg09MdMC92+rfN0FXrCqipu22Dtdi6j5pO5r1PTGrlWziOMR3u/ytrHgm6RsS hDjDlLbWAXIyPPfiYVpOP8+9E/FaKF7cLSHg8s3GRdqJJUuUJGwf0BgeJyoiwPMbESDMs5 41qyFA+d5OGnNevv1KQgjgqu/a+34dRX4zFnKHtN58QtzznCp2zDm16J0m0HFvvlfKjIBO v2UkV1no9eDtWbqbYuKH/lLG53nUZ4pjtKkkM6wkqUR9uiRIxhRp74MU3MRi1g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702600966; a=rsa-sha256; cv=none; b=CPB5OWzOLfKOQb50YYMlAJtXWsqzcPQol9sDuX2m4c7uEucnn0PoOziG5zGIEdtXYe0VLo yWmGz/M0mkKOzk+aKLRE/GYYlInzN2mJ8Bdt0aaVl4AL5htQ3NN7y8pGhNxxZ4cVb2ranq S1K3aVF2VI8EVmNJS8kaqedwKNfS8YJglF6sNQ8DSdHO4brOR+/AMSpUd6eB1qAJaz/YHz HHV0zsK/qR0zxKyrg8TPXXbjqipjuAUxQ1DOdv4UPf/tbaau3wIf+taqBMAGFog675EfVb FYyKpyN1TGtipnOggEeM6tqaHAsdYtQdhBu3SMiaBknzeIoRE18EJrsSFvBlyw== 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=1702600966; 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=IRl4l9E9WAC4WQOQQ1ZRA3UwdfYJ18sjO1+KPdEK9HU=; b=xNrEY6+Y5eyQKlVANDm71s5qgU7w/jNmHevftSOAAb5iAh4CgMYEAytMxDH0oNXg8QRfiU loX5kvEVOR9TrWS9OrR/j39uFx4kyoiwFaWvRPJrIWz2hVErhV1vnvQu20yDLGobvRJ5yH P4TPTSH8/vuPocaUUVVWTcE2WdNOlcMo8FdC+k4aYLnwcxBGWZlwyrXbbyyBpg5AaLSsLp Yvs3ig0H1yeEP6cK6u8x0P1brzqg7neQQ44pEeq8/VSgYmZcPkJ0MPQ5QTh4GXnqeix/Ss oWYcv9PoxXNpwVfp9+OnO5Goby+FkiQJewhXYfXNwgtuieRfhQ3dQOdIVwwRBQ== 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 4Srr6G2BRgzq2K; Fri, 15 Dec 2023 00:42:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BF0gk4g093445; Fri, 15 Dec 2023 00:42:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BF0gk3Z093442; Fri, 15 Dec 2023 00:42:46 GMT (envelope-from git) Date: Fri, 15 Dec 2023 00:42:46 GMT Message-Id: <202312150042.3BF0gk3Z093442@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: bd1739a707ff - stable/14 - sort: test against all month formats in month-sort 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: bd1739a707ff0bda50dedb8aa58b2b26254bdda3 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=bd1739a707ff0bda50dedb8aa58b2b26254bdda3 commit bd1739a707ff0bda50dedb8aa58b2b26254bdda3 Author: Christos Margiolis AuthorDate: 2023-12-01 00:30:10 +0000 Commit: Christos Margiolis CommitDate: 2023-12-15 00:42:26 +0000 sort: test against all month formats in month-sort The CLDR specification [1] defines three possible month formats: - Abbreviation (e.g Jan, Ιαν) - Full (e.g January, Ιανουαρίου) - Standalone (e.g January, Ιανουάριος) Many languages use different case endings depending on whether the month is referenced as a standalone word (nominative case), or in date context (genitive, partitive, etc.). sort(1)'s -M option currently sorts months by testing input against only the abbrevation format, which is essentially a substring of the full format. While this works fine for languages like English, where there are no cases, for languages where there is a different case ending between the abbreviation/full and standalone formats, it is not sufficient. For example, in Greek, "May" can take the following forms: Abbreviation: Μαΐ (genitive case) Full: Μαΐου (genitive case) Standalone: Μάιος (nominative case) If we use the standalone format in Greek, sort(1) will not able to match "Μαΐ" to "Μάιος" and the sort will fail. This change makes sort(1) test against all three formats. It also works when the input contains mixed formats. [1] https://cldr.unicode.org/translation/date-time/date-time-patterns Reviewed by: markj MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D42847 (cherry picked from commit 3d44dce90a6946e2ef2ab30ffbf8e2930acf888b) --- usr.bin/sort/bwstring.c | 144 +++++++++++++++++++-------- usr.bin/sort/sort.1.in | 6 +- usr.bin/sort/tests/Makefile | 1 + usr.bin/sort/tests/sort_monthsort_test.sh | 159 ++++++++++++++++++++++++++++++ 4 files changed, 263 insertions(+), 47 deletions(-) diff --git a/usr.bin/sort/bwstring.c b/usr.bin/sort/bwstring.c index fc1b50cb78ac..b0c14e996b23 100644 --- a/usr.bin/sort/bwstring.c +++ b/usr.bin/sort/bwstring.c @@ -43,63 +43,114 @@ bool byte_sort; -static wchar_t **wmonths; -static char **cmonths; +struct wmonth { + wchar_t *mon; + wchar_t *ab; + wchar_t *alt; +}; -/* initialise months */ +struct cmonth { + char *mon; + char *ab; + char *alt; +}; + +static struct wmonth *wmonths; +static struct cmonth *cmonths; + +static int +populate_cmonth(char **field, const nl_item item, int idx) +{ + char *tmp, *m; + size_t i, len; + + tmp = nl_langinfo(item); + if (debug_sort) + printf("month[%d]=%s\n", idx, tmp); + if (*tmp == '\0') + return (0); + m = sort_strdup(tmp); + len = strlen(tmp); + for (i = 0; i < len; i++) + m[i] = toupper(m[i]); + *field = m; + + return (1); +} + +static int +populate_wmonth(wchar_t **field, const nl_item item, int idx) +{ + wchar_t *m; + char *tmp; + size_t i, len; + + tmp = nl_langinfo(item); + if (debug_sort) + printf("month[%d]=%s\n", idx, tmp); + if (*tmp == '\0') + return (0); + len = strlen(tmp); + m = sort_malloc(SIZEOF_WCHAR_STRING(len + 1)); + if (mbstowcs(m, tmp, len) == ((size_t) - 1)) { + sort_free(m); + return (0); + } + m[len] = L'\0'; + for (i = 0; i < len; i++) + m[i] = towupper(m[i]); + *field = m; + + return (1); +} void initialise_months(void) { - const nl_item item[12] = { ABMON_1, ABMON_2, ABMON_3, ABMON_4, + const nl_item mon_item[12] = { MON_1, MON_2, MON_3, MON_4, + MON_5, MON_6, MON_7, MON_8, MON_9, MON_10, + MON_11, MON_12 }; + const nl_item ab_item[12] = { ABMON_1, ABMON_2, ABMON_3, ABMON_4, ABMON_5, ABMON_6, ABMON_7, ABMON_8, ABMON_9, ABMON_10, ABMON_11, ABMON_12 }; - char *tmp; - size_t len; - + const nl_item alt_item[12] = { ALTMON_1, ALTMON_2, ALTMON_3, ALTMON_4, + ALTMON_5, ALTMON_6, ALTMON_7, ALTMON_8, ALTMON_9, ALTMON_10, + ALTMON_11, ALTMON_12 }; + int i; + + /* + * Handle all possible month formats: abbrevation, full name, + * standalone name (without case ending). + */ if (mb_cur_max == 1) { if (cmonths == NULL) { - char *m; - - cmonths = sort_malloc(sizeof(char*) * 12); - for (int i = 0; i < 12; i++) { - cmonths[i] = NULL; - tmp = nl_langinfo(item[i]); - if (debug_sort) - printf("month[%d]=%s\n", i, tmp); - if (*tmp == '\0') + cmonths = sort_malloc(sizeof(struct cmonth) * 12); + for (i = 0; i < 12; i++) { + if (!populate_cmonth(&cmonths[i].mon, + mon_item[i], i)) + continue; + if (!populate_cmonth(&cmonths[i].ab, + ab_item[i], i)) + continue; + if (!populate_cmonth(&cmonths[i].alt, + alt_item[i], i)) continue; - m = sort_strdup(tmp); - len = strlen(tmp); - for (unsigned int j = 0; j < len; j++) - m[j] = toupper(m[j]); - cmonths[i] = m; } } } else { if (wmonths == NULL) { - wchar_t *m; - - wmonths = sort_malloc(sizeof(wchar_t *) * 12); - for (int i = 0; i < 12; i++) { - wmonths[i] = NULL; - tmp = nl_langinfo(item[i]); - if (debug_sort) - printf("month[%d]=%s\n", i, tmp); - if (*tmp == '\0') + wmonths = sort_malloc(sizeof(struct wmonth) * 12); + for (i = 0; i < 12; i++) { + if (!populate_wmonth(&wmonths[i].mon, + mon_item[i], i)) continue; - len = strlen(tmp); - m = sort_malloc(SIZEOF_WCHAR_STRING(len + 1)); - if (mbstowcs(m, tmp, len) == - ((size_t) - 1)) { - sort_free(m); + if (!populate_wmonth(&wmonths[i].ab, + ab_item[i], i)) + continue; + if (!populate_wmonth(&wmonths[i].alt, + alt_item[i], i)) continue; - } - m[len] = L'\0'; - for (unsigned int j = 0; j < len; j++) - m[j] = towupper(m[j]); - wmonths[i] = m; } } } @@ -754,8 +805,11 @@ bws_month_score(const struct bwstring *s0) ++s; for (int i = 11; i >= 0; --i) { - if (cmonths[i] && - (s == strstr(s, cmonths[i]))) + if (cmonths[i].mon && (s == strstr(s, cmonths[i].mon))) + return (i); + if (cmonths[i].ab && (s == strstr(s, cmonths[i].ab))) + return (i); + if (cmonths[i].alt && (s == strstr(s, cmonths[i].alt))) return (i); } @@ -769,7 +823,11 @@ bws_month_score(const struct bwstring *s0) ++s; for (int i = 11; i >= 0; --i) { - if (wmonths[i] && (s == wcsstr(s, wmonths[i]))) + if (wmonths[i].ab && (s == wcsstr(s, wmonths[i].ab))) + return (i); + if (wmonths[i].mon && (s == wcsstr(s, wmonths[i].mon))) + return (i); + if (wmonths[i].alt && (s == wcsstr(s, wmonths[i].alt))) return (i); } } diff --git a/usr.bin/sort/sort.1.in b/usr.bin/sort/sort.1.in index 4e27838a9250..80cc1dcb0282 100644 --- a/usr.bin/sort/sort.1.in +++ b/usr.bin/sort/sort.1.in @@ -30,9 +30,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" @(#)sort.1 8.1 (Berkeley) 6/6/93 -.\" -.Dd September 4, 2019 +.Dd November 30, 2023 .Dt SORT 1 .Os .Sh NAME @@ -181,7 +179,7 @@ options (human-readable). .It Fl i , Fl Fl ignore-nonprinting Ignore all non-printable characters. .It Fl M , Fl Fl month-sort , Fl Fl sort=month -Sort by month abbreviations. +Sort by month. Unknown strings are considered smaller than the month names. .It Fl n , Fl Fl numeric-sort , Fl Fl sort=numeric Sort fields numerically by arithmetic value. diff --git a/usr.bin/sort/tests/Makefile b/usr.bin/sort/tests/Makefile index 1982fd1cee0a..752dec06bbff 100644 --- a/usr.bin/sort/tests/Makefile +++ b/usr.bin/sort/tests/Makefile @@ -2,6 +2,7 @@ PACKAGE= tests NETBSD_ATF_TESTS_SH= sort_test +ATF_TESTS_SH= sort_monthsort_test ${PACKAGE}FILES+= d_any_char_dflag_out.txt ${PACKAGE}FILES+= d_any_char_fflag_out.txt diff --git a/usr.bin/sort/tests/sort_monthsort_test.sh b/usr.bin/sort/tests/sort_monthsort_test.sh new file mode 100755 index 000000000000..db42981fb107 --- /dev/null +++ b/usr.bin/sort/tests/sort_monthsort_test.sh @@ -0,0 +1,159 @@ +# +# SPDX-License-Identifier: BSD-2-Clause +# +# Copyright (c) 2023 Christos Margiolis +# + +get_months_fmt() +{ + rm -f in + for i in $(seq 12 1); do + printf "2000-%02d-01\n" ${i} | xargs -I{} \ + date -jf "%Y-%m-%d" {} "${1}" >>in + done +} + +atf_test_case monthsort_english +monthsort_english_head() +{ + atf_set "descr" "Test the -M flag with English months" +} +monthsort_english_body() +{ + export LC_TIME="en_US.UTF-8" + + cat >expout <expout <expout <expout <in <expout < To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 431d8b78ed26 - stable/14 - sort: Only build FreeBSD-specific ALTMON_x stuff when ATLMON_1 is defined 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 431d8b78ed262af910656930d96088f5a1d90485 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=431d8b78ed262af910656930d96088f5a1d90485 commit 431d8b78ed262af910656930d96088f5a1d90485 Author: Warner Losh AuthorDate: 2023-12-07 20:27:07 +0000 Commit: Christos Margiolis CommitDate: 2023-12-15 00:42:35 +0000 sort: Only build FreeBSD-specific ALTMON_x stuff when ATLMON_1 is defined On MacOS, we bootstrap sort. Since ALTMON_* are not defined there, the build blows up. Since we don't need this feature for the FreeBSD build process, and since we won't use it unless we actually install the NL files that have this data in it, just #ifdef it out for now. In the extremely unlikely event that the FreeBSD bootstrap/build process grows this dependency, we can evaluate the best solution then (which most likely is going to be not depend on the local's month names). Fixes: 3d44dce90a69 (MacOS builds and github CI) Sponsored by: Netflix Reviewed by: jrtc27, jlduran@gmail.com, markj Differential Revision: https://reviews.freebsd.org/D42868 (cherry picked from commit bd234c0d4c8256db7e5a1fdda9ef311c9e0080e4) --- usr.bin/sort/bwstring.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/usr.bin/sort/bwstring.c b/usr.bin/sort/bwstring.c index b0c14e996b23..10679fe631ba 100644 --- a/usr.bin/sort/bwstring.c +++ b/usr.bin/sort/bwstring.c @@ -113,9 +113,11 @@ initialise_months(void) const nl_item ab_item[12] = { ABMON_1, ABMON_2, ABMON_3, ABMON_4, ABMON_5, ABMON_6, ABMON_7, ABMON_8, ABMON_9, ABMON_10, ABMON_11, ABMON_12 }; +#ifdef ALTMON_1 const nl_item alt_item[12] = { ALTMON_1, ALTMON_2, ALTMON_3, ALTMON_4, ALTMON_5, ALTMON_6, ALTMON_7, ALTMON_8, ALTMON_9, ALTMON_10, ALTMON_11, ALTMON_12 }; +#endif int i; /* @@ -132,9 +134,13 @@ initialise_months(void) if (!populate_cmonth(&cmonths[i].ab, ab_item[i], i)) continue; +#ifdef ALTMON_1 if (!populate_cmonth(&cmonths[i].alt, alt_item[i], i)) continue; +#else + cmonths[i].alt = NULL; +#endif } } @@ -148,9 +154,13 @@ initialise_months(void) if (!populate_wmonth(&wmonths[i].ab, ab_item[i], i)) continue; +#ifdef ALTMON_1 if (!populate_wmonth(&wmonths[i].alt, alt_item[i], i)) continue; +#else + wmonths[i].alt = NULL; +#endif } } } From nobody Fri Dec 15 16:50:53 2023 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 4SsFbK6SNCz53nY5; Fri, 15 Dec 2023 16:50:53 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SsFbK5Wpyz4ZyM; Fri, 15 Dec 2023 16:50:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702659053; 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=mlph7qDdh5XXUEcETgiFAvFzt+fzyH5U1/pzxm81vck=; b=l2kBr1OR1euvJhQTHsGRyHqCl6OrI51D3a2DchEKR10nTciieq/TBpEFWxj8T6OM9ntV3e IAp54tgPdDcoQzGNQmdrRXPnhXFadMjS7pasyvspVXh1xzHR+2Ed7eGl1sTzibWfIQfTFG MIuuNcsE1N1xSTM1tnZG4xv68fsb04tOsvFRVWITliV5l94GJpyufL5bYU0HGxD3IKJ6+R zr5aGvUiErBCzJDrNwyq3KAkFIQaqh0CYVmwYDLmOrhww1XzPpfu5Csvh57QlzsDpWUgk+ SoZ8LgID1tBHVNVXGaPn6xHBznIgrQo+uXQV0XpnT2vc002ej4mAtBaZZTdKZQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702659053; a=rsa-sha256; cv=none; b=ZRklpRIvj1Y0Ca8X3elQqr69FDn6FUsACe/SH5YQYE7jQ36X3AflJYL0vca3MCbniEISGH LlEe7gwY4niehDllLp2AGCW2LI4q166eRdaDUkTetotlzsPUKiq9SQlyFAqlr2Gxkamhy0 XK8GN+k6zmY19BEyQh4n5iyljyAvasalkd0t5ZUucnIFHyed5zGcQqsUL181ozukX/0T4G +P3c3CQKQfmd9Sqv88PdGYFR1Rw7EvVHmEZqYLy0OxUu2sJmKc5MYmGLm7PUiW4RRjfOyp KaOHr5yVE4VjeBYHlNGngsgM0OqC3UtIayHI2G8wqwdVbZfACw7EMhvQWGnHOg== 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=1702659053; 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=mlph7qDdh5XXUEcETgiFAvFzt+fzyH5U1/pzxm81vck=; b=oYNr4I0fkq8VL2NT/ha5sW6zfaY8aorkX8FDL3Z/C2S6llTgevuixfv05mblRUmlOO8xSB pWtg0QRiqS3qFQpbobFGSD3ussDr2JzTdFMupJZ7bxeYq12gW56bEE4J/yyujLK6FnWY8u 22XRMOj6uRAcuYxWd8HMhqR6/CrcRV43+xrQzky3XpwnDgmbw5e3g9JjwhzXE5qQz6Rnn6 hwUBr3h8JLvPCx0qYRwtF2zKSVlu8stBXENVNAbh3TaIJzMiOql+gZ176BcE2mHWNmlmBb pmWql+0Z2URVVK2t7yt2gF5PdoNkppdetEBJbYVM48LQ2ErhKRIWHT+gaytVKA== 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 4SsFbK4Zn5z3ys; Fri, 15 Dec 2023 16:50:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BFGorWl010706; Fri, 15 Dec 2023 16:50:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BFGorCv010703; Fri, 15 Dec 2023 16:50:53 GMT (envelope-from git) Date: Fri, 15 Dec 2023 16:50:53 GMT Message-Id: <202312151650.3BFGorCv010703@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: cdd2624a9759 - stable/14 - localedef: expand the default charmap 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: cdd2624a9759721ce7973635d079ab04704c8027 Auto-Submitted: auto-generated The branch stable/14 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=cdd2624a9759721ce7973635d079ab04704c8027 commit cdd2624a9759721ce7973635d079ab04704c8027 Author: Kyle Evans AuthorDate: 2023-09-02 06:13:02 +0000 Commit: Kyle Evans CommitDate: 2023-12-15 00:57:59 +0000 localedef: expand the default charmap POSIX defines a number of other control characters as well as alternative aliases for some that should be provided in the default set, so let's go ahead and add those. Reviewed by: bapt, yuripv Sponsored by: Klara, Inc. (cherry picked from commit 3a7ffe206ce7e4741fae26432f6d6e5159207f45) --- usr.bin/localedef/charmap.c | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/usr.bin/localedef/charmap.c b/usr.bin/localedef/charmap.c index 44b7e3292eae..1da4d8921ecb 100644 --- a/usr.bin/localedef/charmap.c +++ b/usr.bin/localedef/charmap.c @@ -70,13 +70,49 @@ static const struct { int ch; } portable_chars[] = { { "NUL", '\0' }, + { "SOH", '\x01' }, + { "STX", '\x02' }, + { "ETX", '\x03' }, + { "EOT", '\x04' }, + { "ENQ", '\x05' }, + { "ACK", '\x06' }, + { "BEL", '\a' }, { "alert", '\a' }, + { "BS", '\b' }, { "backspace", '\b' }, + { "HT", '\t' }, { "tab", '\t' }, - { "carriage-return", '\r' }, + { "LF", '\n' }, { "newline", '\n' }, + { "VT", '\v' }, { "vertical-tab", '\v' }, + { "FF", '\f' }, { "form-feed", '\f' }, + { "CR", '\r' }, + { "carriage-return", '\r' }, + { "SO", '\x0e' }, + { "SI", '\x0f' }, + { "DLE", '\x10' }, + { "DC1", '\x11' }, + { "DC2", '\x12' }, + { "DC3", '\x13' }, + { "DC4", '\x14' }, + { "NAK", '\x15' }, + { "SYN", '\x16' }, + { "ETB", '\x17' }, + { "CAN", '\x18' }, + { "EM", '\x19' }, + { "SUB", '\x1a' }, + { "ESC", '\x1b' }, + { "FS", '\x1c' }, + { "IS4", '\x1c' }, + { "GS", '\x1d' }, + { "IS3", '\x1d' }, + { "RS", '\x1e' }, + { "IS2", '\x1e' }, + { "US", '\x1f' }, + { "IS1", '\x1f' }, + { "DEL", '\x7f' }, { "space", ' ' }, { "exclamation-mark", '!' }, { "quotation-mark", '"' }, From nobody Fri Dec 15 16:50:54 2023 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 4SsFbM08B5z53nSm; Fri, 15 Dec 2023 16:50:55 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SsFbL6QJLz4Zwc; Fri, 15 Dec 2023 16:50:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702659054; 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=1AfelgyNgmqtV9XZZQeSzMe1M+YVPmZNEtZ2zHR0CI4=; b=joXWyMtBn/LZlrl2N8GmDndJSmVj4iap0UbryN0qEwM9TqokLVg37QBNHMEbgG9ZsJ6Pds AHcye80aNhLNZMtkCN7wWBXdziYUYX1Lp+d7JqjKiq26FMmxck4/lRTAK1JpThr4r4yb4I 7csHHTtM0K6qA8g6baCHZb0dM/8VFr21vl/s0fUOoYhdPwFTr1uRHeUCfrewOu/0KIFDbf XyrWedTvgCEHfUFIF5l0jwjLk/RcSOKXCrMXNd66LhEJyHCUAj7iExQbrSU+37fiWGDrPP yL8Jh9S9cZ26LjOwHaDVQgP2KqYb0I7K/RZW0RSijFADoxMML7l2UsJI4Ipqxw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702659054; a=rsa-sha256; cv=none; b=fp7+eQbp1qdpcmOEFdxTNRJH/B+mHOuvKYBVPOeUSaoziKtf+vTLV7456zp8m47n8Zuv0l inUuusgrBsfuNe15+o05X+bw6ttridDri5ceAYl5irjDWlNkzKQSDTu8GvQe4tLJZQ7ljE RES9lAD+ig3gAoudD5iQ/lpb7JG2DurUf9JHc+ORHHmCF23LmD2XY2mC6RXkLpLqTf2xvg fXzjdDRCzZdVz/dSzLzI6r/h7f48TONqWzfJZBwFBVAaQetdHkN/Lw+2jfPh3w5l1IbdYi pbM2M1lN2QNCEJD+2BwSZH6QNvRF0a/f9LXiKBIl32JPVjv/z9CexS5knvZ8iA== 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=1702659054; 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=1AfelgyNgmqtV9XZZQeSzMe1M+YVPmZNEtZ2zHR0CI4=; b=dFln+OO51qIByaNXOJtsnSeftwn88wFQ937Dybgk+ejmfolUg5ZYLks/yIMi3jFA2NrKIg idONXPXAohel8SPqikYMvl6jwTj4WTIO4hOgq1k9b7j1WjV2hKtQNfbLKoH+xC9BKl5T/K JjvePmM2gPcC9dpSHR8CIR+kSx1HqhoUd5r3SlB/5NuGCyS2mU80pD3d8VrkIsbdRfkVfV DSaMmYQ9Dk5LTRn0pgKO4go3GhNCdLHI8YEkxOEJtfJPUoVVQms9klJo4MJ22lvX+IvBKR oaX4K6Q5rbUKtRpFZDMPTqHnmrEOluyUpxlDgH6LzhKdMD/Cdbegy1FezBq15Q== 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 4SsFbL5Rm4z3wk; Fri, 15 Dec 2023 16:50:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BFGosKw010760; Fri, 15 Dec 2023 16:50:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BFGossR010757; Fri, 15 Dec 2023 16:50:54 GMT (envelope-from git) Date: Fri, 15 Dec 2023 16:50:54 GMT Message-Id: <202312151650.3BFGossR010757@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: 20baa89501c7 - stable/14 - ncurses: avoid hardcoded assumptions about the layout of .OBJDIR 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 20baa89501c7a7815b5ca4ada916393732af8d42 Auto-Submitted: auto-generated The branch stable/14 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=20baa89501c7a7815b5ca4ada916393732af8d42 commit 20baa89501c7a7815b5ca4ada916393732af8d42 Author: Kyle Evans AuthorDate: 2023-09-12 21:00:45 +0000 Commit: Kyle Evans CommitDate: 2023-12-15 00:58:04 +0000 ncurses: avoid hardcoded assumptions about the layout of .OBJDIR Abstract out the details of the FreeBSD build into a $TINFO_OBJDIR that external builds can override if they orchestrate the build a bit differently and have a different objdir layout as a result. This makes the ncurses build a little bit more flexible without requiring weird backflips. Reviewed by: bapt, sjg Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. (cherry picked from commit c086d1cbc3d13967c031e6420831349967dbcfa2) --- lib/ncurses/config.mk | 6 ++++-- lib/ncurses/ncurses/Makefile | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/ncurses/config.mk b/lib/ncurses/config.mk index 0016dc97a72f..8a3e7d0ffa59 100644 --- a/lib/ncurses/config.mk +++ b/lib/ncurses/config.mk @@ -6,6 +6,8 @@ NCURSES_MAJOR= 6 NCURSES_MINOR= 2 NCURSES_PATCH= 20210220 +TINFO_OBJDIR?= ${.OBJDIR:H}/tinfo + CFLAGS+= -D_XOPEN_SOURCE_EXTENDED NCURSES_CFG_H= ${.CURDIR}/ncurses_cfg.h @@ -17,7 +19,7 @@ CFLAGS+= -I${.CURDIR:H}/ncurses CFLAGS+= -I${NCURSES_DIR}/include CFLAGS+= -I${NCURSES_DIR}/ncurses -CFLAGS+= -I${.OBJDIR:H}/tinfo/ +CFLAGS+= -I${TINFO_OBJDIR} CFLAGS+= -Wall @@ -27,7 +29,7 @@ CFLAGS+= -DHAVE_CONFIG_H # everyone needs this .PATH: ${NCURSES_DIR}/include -.PATH: ${.OBJDIR:H}/tinfo/ +.PATH: ${TINFO_OBJDIR} # tools and directories AWK?= awk diff --git a/lib/ncurses/ncurses/Makefile b/lib/ncurses/ncurses/Makefile index b52085780952..e1a3dbf61e49 100644 --- a/lib/ncurses/ncurses/Makefile +++ b/lib/ncurses/ncurses/Makefile @@ -180,9 +180,9 @@ libncursesw.ald: ${.CURDIR}/${STATIC_LDSCRIPT} -e 's,@@STATICLIB_SUFFIX@@,${_STATICLIB_SUFFIX},g' \ ${.ALLSRC} > ${.TARGET} -lib_gen.c: MKlib_gen.sh ${.OBJDIR:H}/tinfo/curses.h ncurses_dll.h +lib_gen.c: MKlib_gen.sh ${TINFO_OBJDIR}/curses.h ncurses_dll.h LC_ALL=C sh ${NCURSES_DIR}/ncurses/base/MKlib_gen.sh "${CPP:N${CCACHE_BIN}} ${CFLAGS}" \ - "${AWK}" generated < ${.OBJDIR:H}/tinfo/curses.h >$@ + "${AWK}" generated < ${TINFO_OBJDIR}/curses.h >$@ expanded.c: MKexpanded.sh sh ${NCURSES_DIR}/ncurses/tty/MKexpanded.sh "${CC:N${CCACHE_BIN}} -E" ${CFLAGS} >expanded.c From nobody Fri Dec 15 16:50:55 2023 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 4SsFbN164Hz53nSp; Fri, 15 Dec 2023 16:50:56 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SsFbN0Zjcz4b6x; Fri, 15 Dec 2023 16:50:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702659056; 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=p5FcbcPU2JKkaHtRkEVkV5Bacj1fff/1Uqc0b2TI80o=; b=fQ+j/o8hkjQNFeJYYgLMuVFXDiCJyPSFAmAeYV1NqF5ksT8FBr4iadMlmkGbTsuBS/a7Jd UzinRRLg3UTxlc/i+hVCWtIdBwU6RMPO/n+WJW2gc/5Cmjitr1qsdYkMMPhWE87AIe3Ny5 +Dsov9YqN1vc6oithv97IcIvYCMerzIf/6obDHlsqvP+SyZ47jO/s7Jhc6UwUsg/lSlO8A 81ku7Xd/HUqRUpBqo+tbqlOrR00WcdP0jJVSz2TpEmCJh6fxj0Ta2I6q3pLNxqxZyr8rKt 8HNnucZ5DawZf6lJ74vgbXUNOGR83ftqTrxuXy56lzt+j9e2Q9reSNHUvTibfw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702659056; a=rsa-sha256; cv=none; b=Vxm++alXqU1HdPyKqpikmxMtvgYsQDUHjRiViK9WV05eHfl1yYDneSvrAkObOoGmvHjQU+ y3DSfhpQTFgRg3VDiCabkmIlJ4PLdNtK2z2IZlDnZ2Q69kR+zSxUfiU+5ynIqh8IXwMCdv m1YcW/P9qvMKR+c4frxap7P4I/Qzp5k8HxaXr5a2e4B/y3oT2NyaD5jhU66wXtZ/XLjN4F e3g63aclRGEZM1IwpHOEw8jHwpGFV2kwUnS1ppiEp1MRbvvCzTvpmb89vrfecHQNhzi4xI 8atTHa+skbUqR8iBsWOwUuBrrVu2/V1Uky3et73oROOnPVZnICWSKQUsxR5k/Q== 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=1702659056; 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=p5FcbcPU2JKkaHtRkEVkV5Bacj1fff/1Uqc0b2TI80o=; b=a5yBRVrvpKi1Ylf2IX/44g4rJiNC2df1YuzXvC5bP5acso9Dh17mFQcAZuCNwcM+S21sxm 6nNyX/QWw/MGhPMPDPhiIDTOjdEktK+gkoW2NFNQBncSz0O8edhowYV9NJ4idbDAjjQ+RN WUK0y0OV0b75+wVmYum5H4QeLtPMc5hoMTjhCtAgn3duS4+3FTmw1zAB+ou4CZ3VGbwdvH utFBhohvs6KWc6igexCLgOOTc+mjn+4nUXwWyyTbVqpKSV43bhBqviDFRsOKqhMiK0oevF Lz1FSb/5GCdii51e4DMZwWAZWV9t8s8cNRmTAqfH5+ejrUhjRlXIiT67NT+Hzw== 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 4SsFbM6hwwz3wm; Fri, 15 Dec 2023 16:50:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BFGotgW010820; Fri, 15 Dec 2023 16:50:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BFGotuu010817; Fri, 15 Dec 2023 16:50:55 GMT (envelope-from git) Date: Fri, 15 Dec 2023 16:50:55 GMT Message-Id: <202312151650.3BFGotuu010817@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: 9c2aaaa997d0 - stable/14 - arm64: lop off another 24MB of KVA for early device mappings 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9c2aaaa997d0ad19cee733a7ee78630d3e94dfb3 Auto-Submitted: auto-generated The branch stable/14 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=9c2aaaa997d0ad19cee733a7ee78630d3e94dfb3 commit 9c2aaaa997d0ad19cee733a7ee78630d3e94dfb3 Author: Kyle Evans AuthorDate: 2023-11-23 16:21:33 +0000 Commit: Kyle Evans CommitDate: 2023-12-15 00:58:08 +0000 arm64: lop off another 24MB of KVA for early device mappings This grows the block enough to fit a 4K 32-bit depth framebuffer; some firmware would present smaller GOP modes to be able to boot with a smaller framebuffer on these devices, but the Windows Devkit firmware is simply not that nice. Instead, it offers exactly one GOP mode that matches the current resolution of the attached display, so with limited control over resolution on most of my displays it'd be nice if we could Just Work(TM) at 4K. andrew notes that he has some ideas for removing PMAP_MAPDEV_EARLY_SIZE entirely, so this limitation could end up removed altogether in the future. Reviewed by: andrew, emaste (cherry picked from commit a3ceeef26bc880b86f4e181bddd9924a2b5e0691) --- sys/arm64/include/pte.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/arm64/include/pte.h b/sys/arm64/include/pte.h index aebe24cb82af..a868931604c9 100644 --- a/sys/arm64/include/pte.h +++ b/sys/arm64/include/pte.h @@ -163,7 +163,11 @@ typedef uint64_t pt_entry_t; /* page table entry */ /* 0x2 also marks an invalid address */ #define L3_PAGE 0x3 -#define PMAP_MAPDEV_EARLY_SIZE (L2_SIZE * 8) +/* + * A substantial portion of this is to make sure that we can cope with 4K + * framebuffers in early boot, assuming a common 4K resolution @ 32-bit depth. + */ +#define PMAP_MAPDEV_EARLY_SIZE (L2_SIZE * 20) #if PAGE_SIZE == PAGE_SIZE_4K #define L0_ENTRIES_SHIFT 9 From nobody Fri Dec 15 16:50:56 2023 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 4SsFbP4Dhkz53nDb; Fri, 15 Dec 2023 16:50:57 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SsFbP1W4cz4b7Z; Fri, 15 Dec 2023 16:50:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702659057; 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=en939RxkIDtm9Lxjtd9qtYNoWnmSHL9qsIcWDsqO/WA=; b=O/FTImLbjeTKJHIToENhHpLiDE2LiVgDi22JgfyGjynBVXMiMlDI7t/5GFquk0tfrmcoHX Is6pTE2rXhFpShc1LdaKwUnJ13NA4r12YlEhg7tsnhu/SpjhcChlI6DTD79M59g+2UZdLW 0BXx0C7LbZi7Fe+2PEak+Ln+/ASem/6RXOjOZsi19sG0fpR9nsbBMgQcWjZZEhJmaHJ4GU gj/2VQI21GKBBH6i+rixtpO4HGHdKLsCKam1k8bBzh9rBkJ9NJ7uPJE/cQVk5f+nctAeBD FPZ6JPtkHxphiJs9uIX9aD1Cz0iWHQmpwoCJjueOjHIFpcLLDFLhZ9WLy0DWdA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702659057; a=rsa-sha256; cv=none; b=THBzFWY/sbxlWczsBN41uC1m6qbLuLLFxkSwr+h7K1m4HZqzMdvLjc/E83QUGUAVfQn77s kl2JzAqZkRKViBwRWw5eugTeP/RItJFydOxGqL+k30gyGhWMlwN+jKrirircWLxtPUa4ap Tn3hqM8cqESl4kY9fnBfjEc/jKUeFo9UilbNXeOuzp58RM6juz+wHplXrsF38l43V0SEia XLgtBGWY8g4D3P2Gwp8YxMUOeZiYwG/6Xy5Nnkqhe1RhAu+RTFCjp8TTLb0BjIBdPHu2Sn Ey9TpkxyKtk18R+rez7mC7PPV2VRFefsLuTQcH+OV7Aowhbx+LyOos5/cHKzMg== 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=1702659057; 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=en939RxkIDtm9Lxjtd9qtYNoWnmSHL9qsIcWDsqO/WA=; b=lPQM2rMQkpZa6IkrO7B+F/DwoAzbPEm4tZgc09WdJQLOfbqvmTsK04DnMuFojnyFw8QSbo iOGZZxgPU4HdEMTtREyuTE83Djxml+0Uowc2DB/n4IgzgP9Kie51DatiMfXhspKNXUQro1 KzRFvz9M+GyKYPsljbLi6v1qSxFVv5mm4n2opn/dPhdA0vIoJoo+ro6eWnvrzjgAK5c95/ wJxK9YsbGEUWx6dWZFyARztTfjZNSJLOMeFmwstgIOcxKo9YuXdAuOxxmEDU7VvyoQ3CfT ZGultAUIvvBUiYsnto9zPzsdgHrzZO+kbAYIv9OySRnFZL0lukyb7hrveskUZg== 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 4SsFbP0cqfz3wn; Fri, 15 Dec 2023 16:50:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BFGoudf010868; Fri, 15 Dec 2023 16:50:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BFGouXd010865; Fri, 15 Dec 2023 16:50:56 GMT (envelope-from git) Date: Fri, 15 Dec 2023 16:50:56 GMT Message-Id: <202312151650.3BFGouXd010865@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: 8a152128dcc5 - stable/14 - lockf: correct omission in the usage statement 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8a152128dcc546745194ef671673b5a0762b6d26 Auto-Submitted: auto-generated The branch stable/14 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=8a152128dcc546745194ef671673b5a0762b6d26 commit 8a152128dcc546745194ef671673b5a0762b6d26 Author: Kyle Evans AuthorDate: 2023-11-22 04:45:42 +0000 Commit: Kyle Evans CommitDate: 2023-12-15 00:58:11 +0000 lockf: correct omission in the usage statement The -w flag was added without being noted in the usage statement; fix that now. While we're here, re-sort the getopt() string. Reviewed by: 0mp, allanjude, des Sponsored by: Klara, Inc. (cherry picked from commit 35095fd23f071d03633312b91a5b460eaf811efa) --- usr.bin/lockf/lockf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.bin/lockf/lockf.c b/usr.bin/lockf/lockf.c index c98c584bc6a9..4fbabea8c08f 100644 --- a/usr.bin/lockf/lockf.c +++ b/usr.bin/lockf/lockf.c @@ -62,7 +62,7 @@ main(int argc, char **argv) silent = keep = 0; flags = O_CREAT | O_RDONLY; waitsec = -1; /* Infinite. */ - while ((ch = getopt(argc, argv, "sknt:w")) != -1) { + while ((ch = getopt(argc, argv, "knst:w")) != -1) { switch (ch) { case 'k': keep = 1; @@ -224,7 +224,7 @@ usage(void) { fprintf(stderr, - "usage: lockf [-kns] [-t seconds] file command [arguments]\n"); + "usage: lockf [-knsw] [-t seconds] file command [arguments]\n"); exit(EX_USAGE); } From nobody Fri Dec 15 16:50:58 2023 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 4SsFbR1Hm2z53nWj; Fri, 15 Dec 2023 16:50:59 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SsFbQ2fgdz4bGb; Fri, 15 Dec 2023 16:50:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702659058; 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=33tm4KXhKaAsgi85fb4eXn99crIRqofmPjLRKKMn7BE=; b=w9yTbicxqRzxUmO8BzAZD6v1VX2ZROuu5bwdugphw75A8NJoL9J3z1KMI3824VK+/7yBF4 +QcBrgVOGvTDKeA2262KaTlq668BPALGz3Dqnbe14RRD+3QW9e140dv1V9B1J009LVOOa5 jPrmw/b7zFNRwodUZ4FmjQA9lIpbs667HTVEf+JShhFlKQAwYqVzwWuFNgEevWAgZ3fmZV wByIpZqlN5zq57FGAu+3OXVxs/8gbqOHJaXuYjYz39bRP4mJi76PERepOkjjcwswx9DPEK FS9SmhOqlzXHod5tzW/8UwcrQeXDfrFCDSkDsKul2WV+q1q490g6I4rlLy2WHw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702659058; a=rsa-sha256; cv=none; b=cru9GG4GJ3KSjcDMif3KAhxyLb7LWAXg5PeVA6u6B/MReabFz4TrftBKOXligImpI+kNUH RcigfEBb0tHhDWL79RYiud41+sP8SBy+pkY9fxeQC6+3i7DyS9MQvr5TxT8PO1NPvrORxk BrvV+8J3ZVsZCKqSk1po1MkCjHvfOW8QH78LWzejTE4pXVBpiEM9Xd9yGE8Fnm6xkxujUS e1/o8+X8tiiDT+KZj0pI0oY6iSYBuVLU24v1ivbU2P0A+82gDy8Zjpf0mhSM+Hbs+WgwNH 3cvel7CVzvUdzDXsc8ymuycFQDFYwaZGWcOcPK6ol4+dCGi27YhJ1Cy9z56fDg== 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=1702659058; 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=33tm4KXhKaAsgi85fb4eXn99crIRqofmPjLRKKMn7BE=; b=wntaTmSKMyfJonty/MuNcrPcgzcKhfv9M83p0l+hUwmBt5z0pUJ00MQHav31P+fER58w1g srcwdYJ1Q7jTMJLozI4BpCBKj74yl+5CRdcLM11WDWLLAE4ApAkF1F6erR0V1uj6ICtnSS ERg21hqigRTNy4hoqd3kIY1OzrijErAAFRzul7aQp2gWNx/P4+ArWftsMT0/X8VbNf8Nyz bKWkAtTf/kzTQu3c1Mkufr3J/uhz0pOjEf+t4eTwlN4STHUmGDvhmvqCcyJjBqplEfUAtG BiAr2A3Lm7gZnzT/vmuo544ROIY1/OixoONNz728cg0vlfbOgIpX4Z9y59ujgw== 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 4SsFbQ1dpYz3wp; Fri, 15 Dec 2023 16:50:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BFGowCv011603; Fri, 15 Dec 2023 16:50:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BFGowXk011590; Fri, 15 Dec 2023 16:50:58 GMT (envelope-from git) Date: Fri, 15 Dec 2023 16:50:58 GMT Message-Id: <202312151650.3BFGowXk011590@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: 6128f0c28db5 - stable/14 - lockf: hide unavailable error with -n -s 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 6128f0c28db5c77374e1898e16f44131ebebc861 Auto-Submitted: auto-generated The branch stable/14 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=6128f0c28db5c77374e1898e16f44131ebebc861 commit 6128f0c28db5c77374e1898e16f44131ebebc861 Author: Kyle Evans AuthorDate: 2023-11-22 04:41:36 +0000 Commit: Kyle Evans CommitDate: 2023-12-15 00:58:15 +0000 lockf: hide unavailable error with -n -s The error message is expected, allow -s to suppress just that one since it would loosely fall under the definition of "failure to acquire the lock" described in the manpage for the -s option. Reviewed by: 0mp, allanjude Feedback from: des Sponsored by: Klara, Inc. (cherry picked from commit 3041e6950d07f0d11c9f91fefbf3c273cbbe4407) --- usr.bin/lockf/lockf.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/usr.bin/lockf/lockf.c b/usr.bin/lockf/lockf.c index 4fbabea8c08f..ff1e7a6d6216 100644 --- a/usr.bin/lockf/lockf.c +++ b/usr.bin/lockf/lockf.c @@ -38,7 +38,7 @@ #include #include -static int acquire_lock(const char *name, int flags); +static int acquire_lock(const char *name, int flags, int silent); static void cleanup(void); static void killed(int sig); static void timeout(int sig); @@ -125,13 +125,14 @@ main(int argc, char **argv) * avoiding the separate step of waiting for the lock. This * yields fairness and improved performance. */ - lockfd = acquire_lock(lockname, flags | O_NONBLOCK); + lockfd = acquire_lock(lockname, flags | O_NONBLOCK, silent); while (lockfd == -1 && !timed_out && waitsec != 0) { if (keep) - lockfd = acquire_lock(lockname, flags); + lockfd = acquire_lock(lockname, flags, silent); else { wait_for_lock(lockname); - lockfd = acquire_lock(lockname, flags | O_NONBLOCK); + lockfd = acquire_lock(lockname, flags | O_NONBLOCK, + silent); } } if (waitsec > 0) @@ -168,15 +169,18 @@ main(int argc, char **argv) * on success, or -1 on failure. */ static int -acquire_lock(const char *name, int flags) +acquire_lock(const char *name, int flags, int silent) { int fd; if ((fd = open(name, O_EXLOCK|flags, 0666)) == -1) { if (errno == EAGAIN || errno == EINTR) return (-1); - else if (errno == ENOENT && (flags & O_CREAT) == 0) - err(EX_UNAVAILABLE, "%s", name); + else if (errno == ENOENT && (flags & O_CREAT) == 0) { + if (!silent) + warn("%s", name); + exit(EX_UNAVAILABLE); + } err(EX_CANTCREAT, "cannot open %s", name); } return (fd); From nobody Fri Dec 15 16:50:59 2023 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 4SsFbR4Wd3z53nWm; Fri, 15 Dec 2023 16:50:59 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SsFbR3cD5z4b3P; Fri, 15 Dec 2023 16:50:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702659059; 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=LPdv0KW/FZEJDADIRXhOGvlGVRtoJv/+bBICUjbvHKQ=; b=VZmT7JtWk4k6OQRkN1jWuZptabPDalhxG+DR6HDa2koTFKJrhu0iqbFKizLev098K7yBBs 5nINQ+K0bss4vjI73HzBW7nkCwaumV2po5qYyRx21TuRBJ6T1rGKCCVAQDuY4YtnmIxyCg WpXA920IxMgf2VK6b2Oyh1L/vnTQceS6gom2eCwoOnADJgXSzC7Mcsyq0EsYc/8BmQVYLA uEDIoR614gMs6WCPPAAI+qLmjVw+B3qs9ufc5XCTEy/XfFmKpUnqEL07VhNZNRd+uYED4u uwAO+STUS03kYFDxu9V0rdXEIWWPGDO2lDGdfj9nah3oN2raiE3hXDExz4UhlA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702659059; a=rsa-sha256; cv=none; b=Pcrozw7eHJUujIdmL0kKIpaZI7G1ZKT5RKB6hL8rK+z8jCDPdBfB2tlMrjAemWeRvtp8BX T1NTfNfNU8CpiPoE/1e/FMziJiaC7kKFB3t1YimGHuqBJhm5+++XiQQcIfli9vzQuQm7D8 BICq3egnL6Hckd/7Mw6GETCL0ebeD9AMx2jXDpzj8zg7LiCfpMVQRGoiT1/4X7Jbddg7f5 Hw4pmmA+ljWC6QOkzKxaUKR/XkM0qxVQfGAAdxkebTMHpcjGwbZBWc+6hffl615gV61Lz+ 8PSBLEWaApFCGdNDZ8B6yDr/ivUfJN1UFTIhvhGJCWDJ1+OnbB2b7K/cH9EIUg== 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=1702659059; 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=LPdv0KW/FZEJDADIRXhOGvlGVRtoJv/+bBICUjbvHKQ=; b=vz5Gy81qv2S6GmgXetUnaHLNZJfJJH36YnwieT/dCVqL9DgkrNXo0QU3RMJ9hRBnpW6oHd 9tUn5doyMOaF5iDKdpw20lyvyxLShe3gkMRTArPVO3MfkkaZ7rHGCWV2HtV5VDr48xEhXQ pxK1IyZcU+3awzrG5bxbF9ik+O+sMdjNMf8mgvKHJr6rQS5gKKJqlM0JXsE17yhnlR7rxx 6FSjmV2u3VwJ0ihODyyriwgudVz6wgTTtkLeWMOj+hXlGvhOzuwppeuYgfgFzDG2cOOjaj PcANexGB0O1Bf4t4ade+fppjzIiudhUcGb6uyFrmlT+8D3D69qiQT9z0KXl3ug== 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 4SsFbR2dwYz42S; Fri, 15 Dec 2023 16:50:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BFGoxN6011880; Fri, 15 Dec 2023 16:50:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BFGoxp9011877; Fri, 15 Dec 2023 16:50:59 GMT (envelope-from git) Date: Fri, 15 Dec 2023 16:50:59 GMT Message-Id: <202312151650.3BFGoxp9011877@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: 579c24898b89 - stable/14 - lockf: don't hold stdin/stdout/stderr open 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 579c24898b89b87dc86095c3e55c1b1f8fca5e1e Auto-Submitted: auto-generated The branch stable/14 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=579c24898b89b87dc86095c3e55c1b1f8fca5e1e commit 579c24898b89b87dc86095c3e55c1b1f8fca5e1e Author: Alexander Melkov AuthorDate: 2023-11-22 04:46:28 +0000 Commit: Kyle Evans CommitDate: 2023-12-15 00:58:20 +0000 lockf: don't hold stdin/stdout/stderr open None of these are essential in the lockf monitor (parent post-fork), so close them to maintain the illusion that lockf hasn't been inserted into the pipeline. This ensures that the correct effects happen on other programs in the pipeline if the locked command closes or redirects these elsewhere. The original patch used -s to close stdout/stderr rather than closing them unconditionally, but it's not clear that we really care that much. kevans dropped that part when taking the patch, patch is otherwise by listed author. PR: 112379 Reviewed by: 0mp, allanjude (both earlier version), kevans Feedback from: des Sponsored by: Klara, Inc. (cherry picked from commit 18425c19cae08cbe41801845457ed67285806688) --- usr.bin/lockf/lockf.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/usr.bin/lockf/lockf.c b/usr.bin/lockf/lockf.c index ff1e7a6d6216..620193cba1d7 100644 --- a/usr.bin/lockf/lockf.c +++ b/usr.bin/lockf/lockf.c @@ -157,8 +157,11 @@ main(int argc, char **argv) signal(SIGINT, SIG_IGN); signal(SIGQUIT, SIG_IGN); signal(SIGTERM, killed); + fclose(stdin); + fclose(stdout); + fclose(stderr); if (waitpid(child, &status, 0) == -1) - err(EX_OSERR, "waitpid failed"); + exit(EX_OSERR); return (WIFEXITED(status) ? WEXITSTATUS(status) : EX_SOFTWARE); } @@ -210,7 +213,7 @@ killed(int sig) cleanup(); signal(sig, SIG_DFL); if (kill(getpid(), sig) == -1) - err(EX_OSERR, "kill failed"); + _Exit(EX_OSERR); } /* From nobody Fri Dec 15 16:51:00 2023 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 4SsFbS4v0jz53nWp; Fri, 15 Dec 2023 16:51:00 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SsFbS4JVBz4b44; Fri, 15 Dec 2023 16:51:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702659060; 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=Q9Vp9VuJFEi1cneieOWhI3g1TM8jF84Tbwg32b2RLbw=; b=A+L+NK8cg4M6lOQjZbTIbkd89xM0v62If0LHCRcZMv+WGhvbXTsepLompjyIcxBGdQWl/c cmBPkBKq/MlO+U1TCMiav2/w9byqNHgeGe5YynUL1K8OlDRCAIfWaNWxA5cqXuarsIWAf1 wbcZIjTqazt0A+AUs/M+RDE4xBj7DwAoOSxYWnuCa3DFEWNeK+JGlUBRdlNLaQmDjaIBwP 00oM3ZUqmLo7u4KZzqm4kaUo/JC7PqvfUkwPHJWcRTBJ5TswEw+fwyyQOQMuxemFO6VZ+T UPG6ec17dLLtQy4qHLa2rm2v59PhCAcgzLPbHfFmhK+FGxSfFDlKuIkchzERgQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702659060; a=rsa-sha256; cv=none; b=qIa1WDoHJYrKC6KwwI8PqkZ1+zlP2KyAzpkKDbh98uQsELYIJchFBXTtHdg2Hi3nXl8Zc1 ICAkguPfbLb5Kk6KlWiSLkqLnoeVOv/0ml/zZLDxqw3b9nQXly9fy6p+VTqtqh8wsLFKZW 1Y2Toalodjq5iLqfAjtXr3a7jXIfYUE+hugCjLYlp1zUfQz8Y1FkUd/MbyPJqDeCifHQPX P00/dFomPqck6eiSHgmFTrhwqC1RwefubTVeykSOKQ+p9TkPnQxjPCRf0Y3JLcqfgGqjYi lul2IZEj+4/yQtkeEynlMEJmNTDiYj1HSI91tl2+U5pQVusoh2+EemiZiYwEjw== 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=1702659060; 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=Q9Vp9VuJFEi1cneieOWhI3g1TM8jF84Tbwg32b2RLbw=; b=qlMrUuROMxN+SefzcdTOKiANJLBp2b9UxSgvbwXMyFojQR62p5WxQE6ulmGty0AD59Zd+/ IdeM7QOJ3Usr9RXJ9cwZNucafmycJN53LZRKBHz1rn/76RErP+SfnK4EvgEvLrOh2L/6iZ 5vyuvyzHSZ2ZDtFMdu8LS3GzPEqp51lvKM+CZ/LnlBkseqglJdM1N6OmW6R7UUtZJN9dpf N2LE9iTcyishZMDtlV6cUIGYzL7cNJ8pQuxq2xPV4bq+K/4U1bFuS9bth7xJ8i/lLvZXYi iUL/JYSXGmXjRD4Xia8LkQ/0+yRIrsUvv/PB3rMgNivrw35oHOFCjR3CrphmJg== 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 4SsFbS3Prtz3yv; Fri, 15 Dec 2023 16:51:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BFGp0G3011925; Fri, 15 Dec 2023 16:51:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BFGp0vg011922; Fri, 15 Dec 2023 16:51:00 GMT (envelope-from git) Date: Fri, 15 Dec 2023 16:51:00 GMT Message-Id: <202312151651.3BFGp0vg011922@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: 40754cd21e70 - stable/14 - lockf: add some tests 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 40754cd21e70b35341f4f3f9a2d09008fe370f9d Auto-Submitted: auto-generated The branch stable/14 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=40754cd21e70b35341f4f3f9a2d09008fe370f9d commit 40754cd21e70b35341f4f3f9a2d09008fe370f9d Author: Kyle Evans AuthorDate: 2023-11-22 05:09:11 +0000 Commit: Kyle Evans CommitDate: 2023-12-15 00:58:25 +0000 lockf: add some tests Provide basic coverage for the existing options, nothing deeper (e.g., pipe closing behavior) is tested in this set. Reviewed by: allanjude Feedback from: des Sponsored by: Klara, Inc. (cherry picked from commit 296a5a4db1fc8203f5f6aa8f68321e6ab4652b56) --- etc/mtree/BSD.tests.dist | 2 + usr.bin/lockf/Makefile | 5 ++ usr.bin/lockf/tests/Makefile | 6 ++ usr.bin/lockf/tests/lockf_test.sh | 148 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 161 insertions(+) diff --git a/etc/mtree/BSD.tests.dist b/etc/mtree/BSD.tests.dist index 04dc24d772c8..613da00e277d 100644 --- a/etc/mtree/BSD.tests.dist +++ b/etc/mtree/BSD.tests.dist @@ -1081,6 +1081,8 @@ .. locale .. + lockf + .. m4 .. mkimg diff --git a/usr.bin/lockf/Makefile b/usr.bin/lockf/Makefile index d1905a4510ba..b7d916f20d13 100644 --- a/usr.bin/lockf/Makefile +++ b/usr.bin/lockf/Makefile @@ -1,4 +1,9 @@ +.include + PROG= lockf +HAS_TESTS= +SUBDIR.${MK_TESTS}+= tests + .include diff --git a/usr.bin/lockf/tests/Makefile b/usr.bin/lockf/tests/Makefile new file mode 100644 index 000000000000..88a936cc583d --- /dev/null +++ b/usr.bin/lockf/tests/Makefile @@ -0,0 +1,6 @@ + +PACKAGE= tests + +ATF_TESTS_SH+= lockf_test + +.include diff --git a/usr.bin/lockf/tests/lockf_test.sh b/usr.bin/lockf/tests/lockf_test.sh new file mode 100644 index 000000000000..8696ab82a996 --- /dev/null +++ b/usr.bin/lockf/tests/lockf_test.sh @@ -0,0 +1,148 @@ +# +# SPDX-License-Identifier: BSD-2-Clause +# +# Copyright (c) 2023 Klara, Inc. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# + +# sysexits(3) +: ${EX_USAGE:=64} +: ${EX_UNAVAILABLE:=69} +: ${EX_CANTCREAT:=73} +: ${EX_TEMPFAIL:=75} + +atf_test_case badargs +badargs_body() +{ + atf_check -s exit:${EX_USAGE} -e not-empty lockf + atf_check -s exit:${EX_USAGE} -e not-empty lockf "testlock" +} + +atf_test_case basic +basic_body() +{ + # Something innocent so that it does eventually go away without our + # intervention. + lockf "testlock" sleep 10 & + lpid=$! + + # Make sure that the lock exists... + atf_check test -e "testlock" + + # Attempt both verbose and silent re-lock + atf_check -s exit:${EX_TEMPFAIL} -e not-empty \ + lockf -t 0 "testlock" sleep 0 + atf_check -s exit:${EX_TEMPFAIL} -e empty \ + lockf -t 0 -s "testlock" sleep 0 + + # Make sure it cleans up after the initial sleep 10 is over. + wait "$lpid" + atf_check test ! -e "testlock" +} + +atf_test_case keep +keep_body() +{ + lockf -k "testlock" sleep 10 & + lpid=$! + + # Make sure that the lock exists now... + while ! test -e "testlock"; do + sleep 0.5 + done + + kill "$lpid" + wait "$lpid" + + # And it still exits after the lock has been relinquished. + atf_check test -e "testlock" +} + +atf_test_case needfile +needfile_body() +{ + # Hopefully the clock doesn't jump. + start=$(date +"%s") + + # Should fail if the lockfile does not yet exist. + atf_check -s exit:"${EX_UNAVAILABLE}" lockf -sn "testlock" sleep 30 + + # It's hard to guess how quickly we should have finished that; one would + # hope that it exits fast, but to be safe we specified a sleep 30 under + # lock so that we have a good margin below that duration that we can + # safely test to make sure we didn't actually execute the program, more + # or less. + now=$(date +"%s") + tpass=$((now - start)) + atf_check test "$tpass" -lt 10 +} + +atf_test_case timeout +timeout_body() +{ + lockf "testlock" sleep 30 & + lpid=$! + + while ! test -e "testlock"; do + sleep 0.5 + done + + start=$(date +"%s") + timeout=2 + atf_check -s exit:${EX_TEMPFAIL} lockf -st "$timeout" "testlock" sleep 0 + + # We should have taken no less than our timeout, at least. + now=$(date +"%s") + tpass=$((now - start)) + atf_check test "$tpass" -ge "$timeout" + + kill "$lpid" + wait "$lpid" || true +} + +atf_test_case wrlock +wrlock_head() +{ + atf_set "require.user" "unprivileged" +} +wrlock_body() +{ + touch "testlock" + chmod -w "testlock" + + # Demonstrate that we can lock the file normally, but -w fails if we + # can't write. + atf_check lockf -kt 0 "testlock" sleep 0 + atf_check -s exit:${EX_CANTCREAT} -e not-empty \ + lockf -wt 0 "testlock" sleep 0 +} + +atf_init_test_cases() +{ + atf_add_test_case badargs + atf_add_test_case basic + atf_add_test_case keep + atf_add_test_case needfile + atf_add_test_case timeout + atf_add_test_case wrlock +} From nobody Fri Dec 15 16:51:01 2023 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 4SsFbT6NCMz53nkG; Fri, 15 Dec 2023 16:51:01 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SsFbT5YsWz4bLr; Fri, 15 Dec 2023 16:51:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702659061; 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=hK/UppTGtDCUt4p6JFindeNhjjH2gh7ox1l1kBllNG8=; b=sVdyA65BfM5s20kqBJgdQI/pk/DlsiXEJsQYj9Uy6S4d6g+Ss51l/N3E0WWEEd4fbmQ86X jZHXdKUDPue+Dx+MgKbpz6yS/vHrKYmZ0mf5io6g8MCr0FCseV6OWJbptTA/Smq9EAKIYP ItGoggYbWaTYF9Z/tLMb7v46j6khCiegw/8/h124idrXAkxSf1BAn2TLJPDi+eENtuGp+f 98eCFTAQeibSlYpk8LDyC8G+MHsD3sOw3ds5z23S0c9C1W+WH4rZuoWM99BBGissv8Avlz uxtQvuKETe6KyOG7x5F6W/tapbJ99k14wq0dzALceQQyD9d8Uvx+SFT/n/rP2A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702659061; a=rsa-sha256; cv=none; b=nMxi9ZkwI7CipGakVJA/tQaTk2f7vsthUimIv+YU0KlF5Eg1XW6U1Pf1j/oa7H9hJNhXfB V+MY6/su6ao4ZKPuCqIQIicZ/esyyX8tTkZv+B/b/HruV8iza7gnQ2Ox7317MNW2gaehk9 tdUYb/t5qw5ysCJclvRHqvhoFeGuw41iggYfV3EGOF291PDwDFYh7eV5X0m+qYnuatrx3Q iWjUYFWkPXBJn2jqNpr/szYCsTd4FA+mTL/CbOGacnxONwm8b2uyQSykhfPOFPXcjHm/2E AnNLbu4RkG0FwNiWpdulhRXhauVBmw7U4u9PSv7chWusATtjG7HPLjkakcbP+g== 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=1702659061; 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=hK/UppTGtDCUt4p6JFindeNhjjH2gh7ox1l1kBllNG8=; b=Q1koQ7Av6NZ5acxlskHNbUAXyyIrEWaciICZF53xVns4CcLKzxoKMJgxJk6JKFkNTPQZh9 oARl6T+2F1evGnIiYr0A8C2a6bWKXE/GFxgUibKJb8f2loRN/fjKyM/0CPSIdvCfIeVYK+ QhYqhplxDqyFBiqceqojGFBFfLeuVy5UfJpVwc2fxBqRcNfw6UymdK14du4jxzu0dhoH+a Bq7jHbP9B5fhtRtaoUZODg8iY8wVCf1a4yF4S2KEd+6rWtIKfZ4Z9WIQeWxqU8o6XNeiE2 6Qiot7f6aFDXlfaajmgeSN4JLv3MyxMxFyFr+vCNMK4kiWH/DM+AlPt8tTXinw== 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 4SsFbT4gWXz3yw; Fri, 15 Dec 2023 16:51:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BFGp16C011968; Fri, 15 Dec 2023 16:51:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BFGp19D011965; Fri, 15 Dec 2023 16:51:01 GMT (envelope-from git) Date: Fri, 15 Dec 2023 16:51:01 GMT Message-Id: <202312151651.3BFGp19D011965@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: 63b86eb6fa93 - stable/14 - lockf: allow locking file descriptors 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 63b86eb6fa935ecf94b9a0f1842b56a223f151be Auto-Submitted: auto-generated The branch stable/14 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=63b86eb6fa935ecf94b9a0f1842b56a223f151be commit 63b86eb6fa935ecf94b9a0f1842b56a223f151be Author: Kyle Evans AuthorDate: 2023-11-22 07:46:14 +0000 Commit: Kyle Evans CommitDate: 2023-12-15 00:58:29 +0000 lockf: allow locking file descriptors This is most useful inside a shell script, allowing one to lock just portions of a script rather than having to wrap the entire script in a lock. PR: 262738 Reviewed by: 0mp, allanjude (both previous versions) Co-authored-by: Daniel O'Connor Sponsored by: Klara, Inc. (cherry picked from commit 09a7fe0a5523d53ff6c26ddef9a947f293e18c22) --- usr.bin/lockf/lockf.1 | 63 ++++++++++++++++++- usr.bin/lockf/lockf.c | 128 +++++++++++++++++++++++++++++++++----- usr.bin/lockf/tests/lockf_test.sh | 91 +++++++++++++++++++++++++++ 3 files changed, 266 insertions(+), 16 deletions(-) diff --git a/usr.bin/lockf/lockf.1 b/usr.bin/lockf/lockf.1 index 8120b2ed7630..d73033101632 100644 --- a/usr.bin/lockf/lockf.1 +++ b/usr.bin/lockf/lockf.1 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd August 26, 2020 +.Dd November 25, 2023 .Dt LOCKF 1 .Os .Sh NAME @@ -35,6 +35,10 @@ .Ar file .Ar command .Op Ar arguments +.Nm +.Op Fl s +.Op Fl t Ar seconds +.Ar fd .Sh DESCRIPTION The .Nm @@ -64,6 +68,27 @@ the mere existence of the .Ar file is not considered to constitute a lock. .Pp +.Nm +may also be used to operate on a file descriptor instead of a file. +If no +.Ar command +is supplied, then +.Ar fd +must be a file descriptor. +The version with a +.Ar command +may also be used with a file descriptor by supplying it as a path +.Pa /dev/fd/N , +where N is the desired file descriptor. +The +.Fl k +option is implied when a file descriptor is in use, and the +.Fl n +and +.Fl w +options are silently ignored. +This can be used to lock inside a shell script. +.Pp If the .Nm utility is being used to facilitate concurrency between a number @@ -186,6 +211,42 @@ $ lockf mylock sleep 1 & lockf -t 5 mylock echo "Success" Success [1]+ Done lockf mylock sleep 1 .Ed +Lock a file and run a script, return immediately if the lock is not +available. Do not delete the file afterward so lock order is +guaranteed. +.Pp +.Dl $ lockf -t 0 -k /tmp/my.lock myscript +.Pp +Protect a section of a shell script with a lock, wait up to 5 seconds +for it to become available. +Note that the shell script has opened the lock file +.Fa /tmp/my.lock , +and +.Nm +is performing the lock call exclusively via the passed in file descriptor (9). +In this case +.Fl k +is implied, and +.Fl w +has no effect because the file has already been opened by the shell. +This example assumes that +.Ql > +is implemented in the shell by opening and truncating +.Pa /tmp/my.lock , +rather than by replacing the lock file. +.Bd -literal -offset indent +( + lockf -s -t 5 9 + if [ $? -ne 0 ]; then + echo "Failed to obtain lock" + exit 1 + fi + + echo Start + # Do some stuff + echo End +) 9>/tmp/my.lock +.Ed .Sh SEE ALSO .Xr flock 2 , .Xr lockf 3 , diff --git a/usr.bin/lockf/lockf.c b/usr.bin/lockf/lockf.c index 620193cba1d7..db45f7a6b2e7 100644 --- a/usr.bin/lockf/lockf.c +++ b/usr.bin/lockf/lockf.c @@ -29,16 +29,26 @@ #include #include +#include #include #include #include +#include #include #include #include +#include #include #include -static int acquire_lock(const char *name, int flags, int silent); +#define FDLOCK_PREFIX "/dev/fd/" + +union lock_subject { + long subj_fd; + const char *subj_name; +}; + +static int acquire_lock(union lock_subject *subj, int flags, int silent); static void cleanup(void); static void killed(int sig); static void timeout(int sig); @@ -48,8 +58,34 @@ static void wait_for_lock(const char *name); static const char *lockname; static int lockfd = -1; static int keep; +static int fdlock; static volatile sig_atomic_t timed_out; +/* + * Check if fdlock is implied by the given `lockname`. We'll write the fd that + * is represented by it out to ofd, and the caller is expected to do any + * necessary validation on it. + */ +static int +fdlock_implied(const char *name, long *ofd) +{ + char *endp; + long fd; + + if (strncmp(name, FDLOCK_PREFIX, sizeof(FDLOCK_PREFIX) - 1) != 0) + return (0); + + /* Skip past the prefix. */ + name += sizeof(FDLOCK_PREFIX) - 1; + errno = 0; + fd = strtol(name, &endp, 10); + if (errno != 0 || *endp != '\0') + return (0); + + *ofd = fd; + return (1); +} + /* * Execute an arbitrary command while holding a file lock. */ @@ -58,6 +94,7 @@ main(int argc, char **argv) { int ch, flags, silent, status, waitsec; pid_t child; + union lock_subject subj; silent = keep = 0; flags = O_CREAT | O_RDONLY; @@ -89,11 +126,54 @@ main(int argc, char **argv) usage(); } } - if (argc - optind < 2) - usage(); - lockname = argv[optind++]; + argc -= optind; argv += optind; + + if (argc == 0) + usage(); + + lockname = argv[0]; + + argc--; + argv++; + + /* + * If there aren't any arguments left, then we must be in fdlock mode. + */ + if (argc == 0 && *lockname != '/') { + fdlock = 1; + subj.subj_fd = -1; + } else { + fdlock = fdlock_implied(lockname, &subj.subj_fd); + if (argc == 0 && !fdlock) { + fprintf(stderr, "Expected fd, got '%s'\n", lockname); + usage(); + } + } + + if (fdlock) { + if (subj.subj_fd < 0) { + char *endp; + + errno = 0; + subj.subj_fd = strtol(lockname, &endp, 10); + if (errno != 0 || *endp != '\0') { + fprintf(stderr, "Expected fd, got '%s'\n", + lockname); + usage(); + } + } + + if (subj.subj_fd < 0 || subj.subj_fd > INT_MAX) { + fprintf(stderr, "fd '%ld' out of range\n", + subj.subj_fd); + usage(); + } + } else { + subj.subj_name = lockname; + } + if (waitsec > 0) { /* Set up a timeout. */ struct sigaction act; @@ -125,13 +205,13 @@ main(int argc, char **argv) * avoiding the separate step of waiting for the lock. This * yields fairness and improved performance. */ - lockfd = acquire_lock(lockname, flags | O_NONBLOCK, silent); + lockfd = acquire_lock(&subj, flags | O_NONBLOCK, silent); while (lockfd == -1 && !timed_out && waitsec != 0) { - if (keep) - lockfd = acquire_lock(lockname, flags, silent); + if (keep || fdlock) + lockfd = acquire_lock(&subj, flags, silent); else { wait_for_lock(lockname); - lockfd = acquire_lock(lockname, flags | O_NONBLOCK, + lockfd = acquire_lock(&subj, flags | O_NONBLOCK, silent); } } @@ -142,7 +222,15 @@ main(int argc, char **argv) exit(EX_TEMPFAIL); errx(EX_TEMPFAIL, "%s: already locked", lockname); } + /* At this point, we own the lock. */ + + /* Nothing else to do for FD lock, just exit */ + if (argc == 0) { + assert(fdlock); + return 0; + } + if (atexit(cleanup) == -1) err(EX_OSERR, "atexit failed"); if ((child = fork()) == -1) @@ -166,25 +254,34 @@ main(int argc, char **argv) } /* - * Try to acquire a lock on the given file, creating the file if + * Try to acquire a lock on the given file/fd, creating the file if * necessary. The flags argument is O_NONBLOCK or 0, depending on * whether we should wait for the lock. Returns an open file descriptor * on success, or -1 on failure. */ static int -acquire_lock(const char *name, int flags, int silent) +acquire_lock(union lock_subject *subj, int flags, int silent) { int fd; - if ((fd = open(name, O_EXLOCK|flags, 0666)) == -1) { + if (fdlock) { + assert(subj->subj_fd >= 0 && subj->subj_fd <= INT_MAX); + fd = (int)subj->subj_fd; + + if (flock(fd, LOCK_EX | LOCK_NB) == -1) { + if (errno == EAGAIN || errno == EINTR) + return (-1); + err(EX_CANTCREAT, "cannot lock fd %d", fd); + } + } else if ((fd = open(subj->subj_name, O_EXLOCK|flags, 0666)) == -1) { if (errno == EAGAIN || errno == EINTR) return (-1); else if (errno == ENOENT && (flags & O_CREAT) == 0) { if (!silent) - warn("%s", name); + warn("%s", subj->subj_name); exit(EX_UNAVAILABLE); } - err(EX_CANTCREAT, "cannot open %s", name); + err(EX_CANTCREAT, "cannot open %s", subj->subj_name); } return (fd); } @@ -196,7 +293,7 @@ static void cleanup(void) { - if (keep) + if (keep || fdlock) flock(lockfd, LOCK_UN); else unlink(lockname); @@ -231,7 +328,8 @@ usage(void) { fprintf(stderr, - "usage: lockf [-knsw] [-t seconds] file command [arguments]\n"); + "usage: lockf [-knsw] [-t seconds] file command [arguments]\n" + " lockf [-s] [-t seconds] fd\n"); exit(EX_USAGE); } diff --git a/usr.bin/lockf/tests/lockf_test.sh b/usr.bin/lockf/tests/lockf_test.sh index 8696ab82a996..cc6938d2306e 100644 --- a/usr.bin/lockf/tests/lockf_test.sh +++ b/usr.bin/lockf/tests/lockf_test.sh @@ -60,6 +60,96 @@ basic_body() atf_check test ! -e "testlock" } +atf_test_case fdlock +fdlock_body() +{ + # First, make sure we don't get a false positive -- existing uses with + # numeric filenames shouldn't switch to being fdlocks automatically. + atf_check lockf -k "9" sleep 0 + atf_check test -e "9" + rm "9" + + subexit_lockfail=1 + subexit_created=2 + subexit_lockok=3 + subexit_concurrent=4 + ( + lockf -s -t 0 9 + if [ $? -ne 0 ]; then + exit "$subexit_lockfail" + fi + + if [ -e "9" ]; then + exit "$subexit_created" + fi + ) 9> "testlock1" + rc=$? + + atf_check test "$rc" -eq 0 + + sub_delay=5 + + # But is it actually locking? Child 1 will acquire the lock and then + # signal that it's ok for the second child to try. The second child + # will try to acquire the lock and fail immediately, signal that it + # tried, then try again with an indefinite timeout. On that one, we'll + # just check how long we ended up waiting -- it should be at least + # $sub_delay. + ( + lockf -s -t 0 /dev/fd/9 + if [ $? -ne 0 ]; then + exit "$subexit_lockfail" + fi + + # Signal + touch ".lock_acquired" + + while [ ! -e ".lock_attempted" ]; do + sleep 0.5 + done + + sleep "$sub_delay" + + if [ -e ".lock_acquired_again" ]; then + exit "$subexit_concurrent" + fi + ) 9> "testlock2" & + lpid1=$! + + ( + while [ ! -e ".lock_acquired" ]; do + sleep 0.5 + done + + # Got the signal, try + lockf -s -t 0 9 + if [ $? -ne "${EX_TEMPFAIL}" ]; then + exit "$subexit_lockok" + fi + + touch ".lock_attempted" + start=$(date +"%s") + lockf -s 9 + touch ".lock_acquired_again" + now=$(date +"%s") + elapsed=$((now - start)) + + if [ "$elapsed" -lt "$sub_delay" ]; then + exit "$subexit_concurrent" + fi + ) 9> "testlock2" & + lpid2=$! + + wait "$lpid1" + status1=$? + + wait "$lpid2" + status2=$? + + atf_check test "$status1" -eq 0 + atf_check test "$status2" -eq 0 +} + atf_test_case keep keep_body() { @@ -141,6 +231,7 @@ atf_init_test_cases() { atf_add_test_case badargs atf_add_test_case basic + atf_add_test_case fdlock atf_add_test_case keep atf_add_test_case needfile atf_add_test_case timeout From nobody Fri Dec 15 16:51:02 2023 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 4SsFbW1Krvz53ngw; Fri, 15 Dec 2023 16:51:03 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SsFbV6Td6z4bQb; Fri, 15 Dec 2023 16:51:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702659062; 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=uM5z6tyATejL+ZIjsR0uxSI5xmB4QrCYuVvN46+0k/U=; b=ffCjp2fSKsoE4jW1rHntxPZY7UvvnlZq56erBtlRM7txxTJ3dlCveSIcRMylYgRXF+2lW8 rPWY3PGe39jukQo5tPR432vBynn1XbgP54F7LMXthdVSAsQ9dmG44Zj7IdYlvQBDdVro4/ LYNEB0MQlM0u2+3gajlEmIYcDgwIAYvMYCMP8tms9kFv4q8VyKCYWTg768u17Hft3vD6Yn aVtEDb0Ow/BWdiO+kby+m9he6FcVvjfR8PI4IU+2doV2BVCqwFJ+GUukQvVo66tEzAGz5r LMWbntWFPhq45fTWHdfUfqXw2rYaIykByraUkb+y+o35rxsOrj0Ik/HlbyTL9A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702659062; a=rsa-sha256; cv=none; b=NpL6XDTdS6hwT/1DVtxqpIfEbLC/tY24aXoRAfg8d7rrNxNU7aBcGO/bJGg3R5bBDXrSKW G0pjaRA6PD/v2pUfI0ACtlUnBPNZLwSn7L4Vt5d/SuxKwFo8WkuUtY4mHHws0pTxPOatMX X5MdL2nSpMTQvSgdPKp9rXwyNFAqzzkWcdWyN5bw/8rI50J4AAoHtMjSuN9EjR36u9EWnU z/5xCEDXWx6gtMPmu0vIt2I02OWgDXEjylo9U66aIkGqal+m34T5wRnTf+rhxs6V25WQ1M +JRNS1RIYDDFK7wIug1yRXp+0Wq6iToMDCh5GkNKeYWJNTNyxOyB+4ELUtwVQw== 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=1702659062; 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=uM5z6tyATejL+ZIjsR0uxSI5xmB4QrCYuVvN46+0k/U=; b=e/7pObT6CWm1FAEenGhN0YaPGZ38MGC2zmNo36XI7XkitOzVdVLWeaEYdu6xwx8OyLAUh+ GKxEXsZLWgLvL3AJ4tibFWRVGTlK/tv0/iBpLtynmimFnDHLKXfE3716R1wI9K4II3c3q7 7kdYNaOsNj2pGzbs5GFRsrpSp4sYvtG8NTo4YuN8Vn07g2jSymVNjrfxI7vbaC3zJT8XfR qmDkOjKCqETK3kPDY1zWbVmPrYsllRtUf7t6kJzMtOtLpKfW2ay92Ucp/HDmYBcZndu+ZK 2AIlFElVQxoMdV6d2QIN45FVWck7cWbgzpb7qFyzqvPxJjUfE2IMJohfPQPiig== 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 4SsFbV5RPDz3by; Fri, 15 Dec 2023 16:51:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BFGp2u2012016; Fri, 15 Dec 2023 16:51:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BFGp2AU012013; Fri, 15 Dec 2023 16:51:02 GMT (envelope-from git) Date: Fri, 15 Dec 2023 16:51:02 GMT Message-Id: <202312151651.3BFGp2AU012013@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: 78e30818a06c - stable/14 - lockf: switch to strtonum() for parsing timeout 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 78e30818a06c0cb934637811c3339ea8da9ed16a Auto-Submitted: auto-generated The branch stable/14 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=78e30818a06c0cb934637811c3339ea8da9ed16a commit 78e30818a06c0cb934637811c3339ea8da9ed16a Author: Kyle Evans AuthorDate: 2023-11-26 04:27:11 +0000 Commit: Kyle Evans CommitDate: 2023-12-15 00:58:33 +0000 lockf: switch to strtonum() for parsing timeout Convert waitsec to a long long to be able to hold the full domain of alarm(3) timeout on all platforms, and let strtonum(3) handle the input validation. strtonum(3) also happens to provide a neater interface for error handling, and it already includes our pre-existing empty input check. Sponsored by: Klara, Inc. (cherry picked from commit e4967d4d48b0a7d873e4f778c0a6e560e09d4dc3) --- usr.bin/lockf/lockf.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/usr.bin/lockf/lockf.c b/usr.bin/lockf/lockf.c index db45f7a6b2e7..dd02bf2a5417 100644 --- a/usr.bin/lockf/lockf.c +++ b/usr.bin/lockf/lockf.c @@ -92,7 +92,8 @@ fdlock_implied(const char *name, long *ofd) int main(int argc, char **argv) { - int ch, flags, silent, status, waitsec; + int ch, flags, silent, status; + long long waitsec; pid_t child; union lock_subject subj; @@ -112,9 +113,10 @@ main(int argc, char **argv) break; case 't': { - char *endptr; - waitsec = strtol(optarg, &endptr, 0); - if (*optarg == '\0' || *endptr != '\0' || waitsec < 0) + const char *errstr; + + waitsec = strtonum(optarg, 0, UINT_MAX, &errstr); + if (errstr != NULL) errx(EX_USAGE, "invalid timeout \"%s\"", optarg); } @@ -181,7 +183,7 @@ main(int argc, char **argv) sigemptyset(&act.sa_mask); act.sa_flags = 0; /* Note that we do not set SA_RESTART. */ sigaction(SIGALRM, &act, NULL); - alarm(waitsec); + alarm((unsigned int)waitsec); } /* * If the "-k" option is not given, then we must not block when From nobody Fri Dec 15 16:51:03 2023 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 4SsFbX2Lm6z53ngy; Fri, 15 Dec 2023 16:51:04 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SsFbX0Dsmz4bTH; Fri, 15 Dec 2023 16:51:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702659064; 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=eqQ2jb1BzvCvS20pZXDyC7xl+wGuFSvtYoTHao7GPsk=; b=IBpR4j4B8ZoV4tAuyPy2YktaG36Y1S/+Digi0M2aIOX8JePIJxHGrvmROw3iO4ikS4v8gS CooyYb6RfQo24wVCGVMEgbgS+T5OAJ8M2Zsb6fAWESb/wXfF6WhPTzE5/YGHzEMIVbjZQK naWC+nTDpiBlvl1KVd0KyB/1vy4V5iDKwGtwWQTzHw59zG25luW2cgSX5TWNRPCCOgtSdv hkfb3u+4n0FcKfiFuRJWb4FZGeUgIUfXB/FQu2Kxeo/9O6u/dZichEKSy0UICP3837oSmk GwiwfSp/zRjnS2TImRXURFSpNMixfWbIpJHJbEbiurEHRY83SiT+AVwbBG9sqQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702659064; a=rsa-sha256; cv=none; b=FGcdE2NA0liqIV+Kt/1+3FU7s7os3rqbfleeRTpaGpsQ7EBIDebOsLzrNXiHD832OzpISr H0TrH3rS3ouAo+5FuUq1ZTvxBRAlK7y3g0MZFmcVkGNkwZz0ZMiPJb3nw0wRdJHwvD13rN 9RC5pOOyg84t1UwdbDg9gFR+V8imGxsZLcSf/Jiezf1uSzRsfZjpVIfu9VjMfGUpykz8qe R8ZXKh1UVE9OxA3A3Tcl6SrzdAYmOpEPLMcDb/g1Qx7NhYqzNpM1kwxXz+A/+Z2+n2Q9TJ 8SO5ndtwEDQuvSxQW8zNoIhQ5qI1og+R/ciNIsvRkNuza/h4Ehp73/0X2W5GLw== 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=1702659064; 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=eqQ2jb1BzvCvS20pZXDyC7xl+wGuFSvtYoTHao7GPsk=; b=cg4Pd/89bJM4Ahe8BSxZwHvtqLOR3vWu7pA1NQYaJAE/3EA4rjEoZQDTROBaEdVDNHcnQI FSwSk4aLNX+jDkqss3JNVdIFcyLRB5SC06aji/wUhZnx6KQxWTf9eK/QBWtq8qIavyy7CU rX5JbqL41pxmkYlZMdrZQjh3NdrkwKaPCBorOLGp/YgcpbLabs9ptFjJ5tGjtVt/sWno4p QxirESkO3HnzXYBwQxk9OdMAsvU7mv68jbvXeNtqaUYSWg5Ei0OOuxWtffgtTCHi47C3XQ 9opxZtxN1o3nuGQVq0aL6Z7vwrGvC5KIQ0gpSy4LDTTDhewsdNuocrA3LSv12Q== 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 4SsFbW6SXyz42W; Fri, 15 Dec 2023 16:51:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BFGp3Yx012069; Fri, 15 Dec 2023 16:51:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BFGp36x012066; Fri, 15 Dec 2023 16:51:03 GMT (envelope-from git) Date: Fri, 15 Dec 2023 16:51:03 GMT Message-Id: <202312151651.3BFGp36x012066@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: 2ef9079ece5a - stable/14 - rtld: add a test for RTLD_DEEPBIND 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 2ef9079ece5a97aba7a288040fea805d8599a6f4 Auto-Submitted: auto-generated The branch stable/14 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=2ef9079ece5a97aba7a288040fea805d8599a6f4 commit 2ef9079ece5a97aba7a288040fea805d8599a6f4 Author: Kyle Evans AuthorDate: 2023-12-01 01:26:09 +0000 Commit: Kyle Evans CommitDate: 2023-12-15 00:58:36 +0000 rtld: add a test for RTLD_DEEPBIND This tests that with RTLD_DEEPBIND, symbols are looked up in all of the object's needed objects before the global object. PR: 275393 Reviewed by: kib Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. (cherry picked from commit d9c543b6b0cabea6e6679d70b4e701018e7eab80) --- etc/mtree/BSD.tests.dist | 2 + libexec/rtld-elf/tests/Makefile | 5 +- libexec/rtld-elf/tests/Makefile.inc | 3 + libexec/rtld-elf/tests/libdeep/Makefile | 15 +++++ libexec/rtld-elf/tests/libdeep/libdeep.c | 28 ++++++++++ libexec/rtld-elf/tests/libval/Makefile | 10 ++++ libexec/rtld-elf/tests/libval/libval.c | 26 +++++++++ libexec/rtld-elf/tests/libval2/Makefile | 8 +++ libexec/rtld-elf/tests/rtld_deepbind/Makefile | 10 ++++ .../rtld-elf/tests/rtld_deepbind/rtld_deepbind.c | 65 ++++++++++++++++++++++ libexec/rtld-elf/tests/target/Makefile | 2 +- 11 files changed, 172 insertions(+), 2 deletions(-) diff --git a/etc/mtree/BSD.tests.dist b/etc/mtree/BSD.tests.dist index 613da00e277d..c7a8a4ee27dc 100644 --- a/etc/mtree/BSD.tests.dist +++ b/etc/mtree/BSD.tests.dist @@ -436,6 +436,8 @@ rc .. rtld-elf + rtld_deepbind + .. .. tftpd .. diff --git a/libexec/rtld-elf/tests/Makefile b/libexec/rtld-elf/tests/Makefile index 7eacfb899699..06e143a441a1 100644 --- a/libexec/rtld-elf/tests/Makefile +++ b/libexec/rtld-elf/tests/Makefile @@ -1,6 +1,9 @@ -SUBDIR+= libpythagoras target +SUBDIR+= libpythagoras libdeep libval libval2 target +TESTS_SUBDIRS+= rtld_deepbind +SUBDIR_DEPEND_libdeep= libval2 +SUBDIR_DEPEND_rtld_deepbind= libval SUBDIR_DEPEND_target= libpythagoras ATF_TESTS_C= ld_library_pathfds diff --git a/libexec/rtld-elf/tests/Makefile.inc b/libexec/rtld-elf/tests/Makefile.inc new file mode 100644 index 000000000000..dfba72a51ce7 --- /dev/null +++ b/libexec/rtld-elf/tests/Makefile.inc @@ -0,0 +1,3 @@ + +PACKAGE?= tests +TESTSDIR?= ${TESTSBASE}/libexec/rtld-elf diff --git a/libexec/rtld-elf/tests/libdeep/Makefile b/libexec/rtld-elf/tests/libdeep/Makefile new file mode 100644 index 000000000000..9324b6f25efe --- /dev/null +++ b/libexec/rtld-elf/tests/libdeep/Makefile @@ -0,0 +1,15 @@ + +SHLIB?= deep +SHLIB_MAJOR= 0 + +LIBDIR= ${TESTSBASE}/libexec/rtld-elf/rtld_deepbind +SHLIBDIR= ${TESTSBASE}/libexec/rtld-elf/rtld_deepbind + +SRCS= libdeep.c + +LIBVAL2= ${.OBJDIR}/../libval2 +LDFLAGS+= -L${LIBVAL2} -Wl,-rpath,'$$ORIGIN' +DPADD+= -lval2 +LDADD+= -lval2 + +.include diff --git a/libexec/rtld-elf/tests/libdeep/libdeep.c b/libexec/rtld-elf/tests/libdeep/libdeep.c new file mode 100644 index 000000000000..e570769300cf --- /dev/null +++ b/libexec/rtld-elf/tests/libdeep/libdeep.c @@ -0,0 +1,28 @@ +/*- + * + * Copyright (C) 2023 NetApp, Inc. + * + * SPDX-License-Identifier: BSD-2-Clause + * + */ + +#include + +int get_value(void); +int proxy_get_value(void); +void set_value(int); +void proxy_set_value(int); + +int +proxy_get_value(void) +{ + + return (get_value()); +} + +void +proxy_set_value(int val) +{ + + return (set_value(val)); +} diff --git a/libexec/rtld-elf/tests/libval/Makefile b/libexec/rtld-elf/tests/libval/Makefile new file mode 100644 index 000000000000..66728c01dc9b --- /dev/null +++ b/libexec/rtld-elf/tests/libval/Makefile @@ -0,0 +1,10 @@ + +SHLIB?= val +SHLIB_MAJOR= 0 + +LIBDIR= ${TESTSBASE}/libexec/rtld-elf/rtld_deepbind +SHLIBDIR= ${TESTSBASE}/libexec/rtld-elf/rtld_deepbind + +SRCS= libval.c + +.include diff --git a/libexec/rtld-elf/tests/libval/libval.c b/libexec/rtld-elf/tests/libval/libval.c new file mode 100644 index 000000000000..97c97a0310a7 --- /dev/null +++ b/libexec/rtld-elf/tests/libval/libval.c @@ -0,0 +1,26 @@ +/*- + * + * Copyright (C) 2023 NetApp, Inc. + * + * SPDX-License-Identifier: BSD-2-Clause + * + */ + +static int val; + +int get_value(void); +void set_value(int); + +int +get_value(void) +{ + + return (val); +} + +void +set_value(int nval) +{ + + val = nval; +} diff --git a/libexec/rtld-elf/tests/libval2/Makefile b/libexec/rtld-elf/tests/libval2/Makefile new file mode 100644 index 000000000000..2b5cf5342092 --- /dev/null +++ b/libexec/rtld-elf/tests/libval2/Makefile @@ -0,0 +1,8 @@ + +LIBVAL= ${.CURDIR}/../libval + +# Just rebuild libval +.PATH: ${LIBVAL:tA} +SHLIB?= val2 + +.include "${LIBVAL}/Makefile" diff --git a/libexec/rtld-elf/tests/rtld_deepbind/Makefile b/libexec/rtld-elf/tests/rtld_deepbind/Makefile new file mode 100644 index 000000000000..bcc55d945c7e --- /dev/null +++ b/libexec/rtld-elf/tests/rtld_deepbind/Makefile @@ -0,0 +1,10 @@ + +TESTSDIR?= ${TESTSBASE}/libexec/rtld-elf/rtld_deepbind +ATF_TESTS_C= rtld_deepbind + +LIBVAL= ${.OBJDIR}/../libval +LDFLAGS.rtld_deepbind+= -L${LIBVAL} -Wl,-rpath,'$$ORIGIN' +DPADD+= -lval +LDADD+= -lval + +.include diff --git a/libexec/rtld-elf/tests/rtld_deepbind/rtld_deepbind.c b/libexec/rtld-elf/tests/rtld_deepbind/rtld_deepbind.c new file mode 100644 index 000000000000..4fe3c185982a --- /dev/null +++ b/libexec/rtld-elf/tests/rtld_deepbind/rtld_deepbind.c @@ -0,0 +1,65 @@ +/*- + * + * Copyright (C) 2023 NetApp, Inc. + * + * SPDX-License-Identifier: BSD-2-Clause + * + */ + +#include + +#include + +int get_value(void); +void set_value(int); + +#define APP_VALUE 5 +#define LIB_VALUE 20 + +ATF_TC_WITHOUT_HEAD(deepbind_simple); +ATF_TC_BODY(deepbind_simple, tc) +{ + void *hdl; + void (*proxy_set_value)(int); + int (*proxy_get_value)(void); + int app_value, lib_value; + + set_value(APP_VALUE); + + /* + * libdeep has a dependency on libval2.so, which is a rebuild of + * libval.so that provides get_value() and set_value() for both us and + * the lib. The lib's get_value() and set_value() should bind to the + * versions in libval2 instead of libval with RTLD_DEEPBIND. + */ + hdl = dlopen("$ORIGIN/libdeep.so", RTLD_LAZY | RTLD_DEEPBIND); + ATF_REQUIRE(hdl != NULL); + + proxy_set_value = dlsym(hdl, "proxy_set_value"); + ATF_REQUIRE(proxy_set_value != NULL); + + proxy_get_value = dlsym(hdl, "proxy_get_value"); + ATF_REQUIRE(proxy_get_value != NULL); + + (*proxy_set_value)(LIB_VALUE); + + lib_value = (*proxy_get_value)(); + app_value = get_value(); + + /* + * In the initial implementation or if libdeep.so is *not* linked + * against its own libval2, then these both return the later set + * LIB_VALUE (20) as they bind to the symbol provided by libval and + * use its .bss val. + */ + ATF_REQUIRE_INTEQ(lib_value, LIB_VALUE); + ATF_REQUIRE_INTEQ(app_value, APP_VALUE); +} + +ATF_TP_ADD_TCS(tp) +{ + + ATF_TP_ADD_TC(tp, deepbind_simple); + + return atf_no_error(); +} diff --git a/libexec/rtld-elf/tests/target/Makefile b/libexec/rtld-elf/tests/target/Makefile index f63d8072ae3c..aa4875b6748d 100644 --- a/libexec/rtld-elf/tests/target/Makefile +++ b/libexec/rtld-elf/tests/target/Makefile @@ -2,7 +2,7 @@ .include PROG= target -BINDIR= ${TESTSBASE}/libexec/rtld-elf +BINDIR= ${TESTSDIR} WARNS?= 3 CFLAGS+= -I${.CURDIR}/../libpythagoras From nobody Fri Dec 15 18:57:23 2023 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 4SsJPH6KJ1z53wWL; Fri, 15 Dec 2023 18:57:23 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SsJPH5Y6pz3Lmm; Fri, 15 Dec 2023 18:57:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702666643; 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=rzMyw+VoOw7aD4/AdMHHE6sADUSynKDlQc4f2WmCvMk=; b=W5aVpheRA8RdOV0IwJG0amgAkEqmppXGwB5tMTOrpQufQFAiKOD+XRpav2GrBzv1+idqqQ QIptQBHR8+60oo+YuexaZcNzjsjZjcVlHd9UNT5SHFKCauO/WRw0HyBpSSMgUFj5Eze7bB 8aBP/vp2u+CuXP6+kv1mPMY0cfkD5DO3duxe4esio0RU+CpAZwocYUtjbABEeKs47rHeXo Ai2akRzZhrkqKRWa963ZK9JIKmXDLbwlNNFiim5OSxphoc46gtTp9IH9z3NavtHHiGxIFz /PgHFwhYKXNtIh5lhe+7IU34lxb9WdU1idruQMAEDX9E2+wi0X8k1odCa6FfXA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702666643; a=rsa-sha256; cv=none; b=CERxTDgyOvkUMA1iDOBI1CxI+WYHrtyOaQv2dQeG7J/P/z8pQfqKgy53oqi2Qpvmc8o8W8 YvHBcli3LI4usIZ47l9fXGES5aGNHeJOjD4xT3HzI8lj9TQJ6WS/Hx5Qwq5lHreRrAK8nG mg+uwnQukZY8ftmLuG5J23rNb9qIv+qKzbFlOzHMszVhYGiDHvxlgb/AX+Ll5uKscwWXe2 ZrBTtmObe4c3e+K1dVo3lrHlEajcYILWqLF+UrIGhp2tNApMtUG5zmemYkZDX8O+NVbsTM 1t1acXSQH2ZomYZQJ1xxAsXLNVGGjfxSgcWlesvprXHUbekQrApGjZduL1zqgQ== 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=1702666643; 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=rzMyw+VoOw7aD4/AdMHHE6sADUSynKDlQc4f2WmCvMk=; b=q+nHTfP0g/YUE+nAijcIFRxXkccRxULANUlKjUf0rlzn4+PH/tpli2HuIQcUwNtA63Mkag mdhT5Fyap/+NOw3S1y4PlP2AotW3kqsw/rW5u+smOIs7EtPvD7L6vv99+QlI0nKMkM0hSK RJk2YdPhmnTUjli2/vnGie4a2Mh+tXMwTLqf/a1R/cDxhrrl5HoXHNP+dAs2Lrl3bDSy2b Xv9Tc9S5joMgE+y39ErgF+1cH5z+ag4biuArNjx8O6AyYuslhIZMQLcMeNefixs7NU9puv GEYLwTRfDk6xM2g4SaKns1BdRD23AW3uHVyT1m/RJ8B+2e5A1vEum6TWPMh8LQ== 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 4SsJPH4bdnz7bf; Fri, 15 Dec 2023 18:57:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BFIvNc6018011; Fri, 15 Dec 2023 18:57:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BFIvNjg018008; Fri, 15 Dec 2023 18:57:23 GMT (envelope-from git) Date: Fri, 15 Dec 2023 18:57:23 GMT Message-Id: <202312151857.3BFIvNjg018008@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: 6bfba6097429 - stable/13 - localedef: correct definition of right-parenthesis in default charmap 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6bfba6097429c7d3b5048780b8c43d3989860b01 Auto-Submitted: auto-generated The branch stable/13 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=6bfba6097429c7d3b5048780b8c43d3989860b01 commit 6bfba6097429c7d3b5048780b8c43d3989860b01 Author: Kyle Evans AuthorDate: 2023-09-02 05:56:31 +0000 Commit: Kyle Evans CommitDate: 2023-12-15 00:58:54 +0000 localedef: correct definition of right-parenthesis in default charmap It turns out that right parentheses do exist and are different than left parentheses, so let's switch to that. Sponsored by: Klara, Inc. (cherry picked from commit 07bc20e4740d09f554c3787bb1940fc503300822) --- usr.bin/localedef/charmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/localedef/charmap.c b/usr.bin/localedef/charmap.c index bc302965de1a..44b7e3292eae 100644 --- a/usr.bin/localedef/charmap.c +++ b/usr.bin/localedef/charmap.c @@ -86,7 +86,7 @@ static const struct { { "ampersand", '&' }, { "apostrophe", '\'' }, { "left-parenthesis", '(' }, - { "right-parenthesis", '(' }, + { "right-parenthesis", ')' }, { "asterisk", '*' }, { "plus-sign", '+' }, { "comma", ','}, From nobody Fri Dec 15 18:57:24 2023 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 4SsJPJ6qcbz53wPl; Fri, 15 Dec 2023 18:57:24 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SsJPJ6JYGz3Lfp; Fri, 15 Dec 2023 18:57:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702666644; 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=i2njDVBY9JDsZPU03VLlWSHWD0urJRrnWuXvwsxZ3iw=; b=KGzdU8mvK9+o0JqWxwd6cUINx57KCVx4bcIEEZ6zVzBFGIikzqVPkKr6JDyF5wro299BT1 dHU4++X+l/iZKErsP1bSsbpUwZVkkla/KdZvGgYZvMWolpj7u47EsKUk94tHZSSi2wM8Kc GOIeRs/IxhS5x8pErsBRMMvnzWHhaYwm/bvapjDFPMz/NAVe0+JNln1wT5ws85qIiAmKf0 KyW83mxc3j/n0bjK4ijDxDlw+l8Zi9yn2s7X4qlEYVI912vqvkIWNrXc82DihVHpmyFPnJ ivgRTTLB2KVr4hZ8saFJMklwPYyXqAR9LtY9zBTsa2xz0bg9ZXggar0ccq2mmA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702666644; a=rsa-sha256; cv=none; b=MxRI11RC9duwffUyh/wBOouTNWBkued9o84o/Yu10GFAtk03ocJ8iOkwNsgyRzBd5n7Puc alQ7afn80L0n9PEvMUPxQjMcmyN6tMg870zQSKFG6bAODRBuSlw2XwRqWhhwKZcmn8pwSN GkpiZzRPOee9JFYcHC940VIHnBvDZ3TIr1irjshFf893RvQu467S9RTk8kisIiyln1tB8N oNWYcHgezHdZCkZee4tjp/MSJf9eEQtsqRIWXc0Ng9aEBs6ye9QHTPFMXLdx8KIocyiBeG yiaFeG/m5S1VH9ltF/Sgk6CXKCp0tmyGEX1Q2gSJ7unuHiAWeccdnvTV1Do4HA== 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=1702666644; 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=i2njDVBY9JDsZPU03VLlWSHWD0urJRrnWuXvwsxZ3iw=; b=H8MXyzBzxJqcXY3zYhFJKOX04Z82w4zSipKqoXry/7pVlWFGO7SnXz4yTqyjGgl0zApV1x 61OvuVqCMN81nDoEMZYNWk3cC+iQxD/UB6cjcDDK1+enVmqRJ+yL6JCPk+jEQqqdXs+uCr QswB3IQaLYVna33UPeagy4FHSR1bErT4/OX2JaxIvg5IOPjtJ3nGbR5Su/4vc7dDG+l//9 LRT8DyMBHputXeA0NM+AFWIkOq4e1OajsbWKcSZKvKCpQQN2fIO9on80qOr2ubtSyQ1Dc+ 2utavG7KiWAiXcVvbtp8zs58VI8JKXoAruZWVA/9yAonwh1B3s5ZOfgP9LHl8Q== 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 4SsJPJ5Npbz6rW; Fri, 15 Dec 2023 18:57:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BFIvOh1018058; Fri, 15 Dec 2023 18:57:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BFIvOtf018055; Fri, 15 Dec 2023 18:57:24 GMT (envelope-from git) Date: Fri, 15 Dec 2023 18:57:24 GMT Message-Id: <202312151857.3BFIvOtf018055@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: 03fe51fb88df - stable/13 - localedef: expand the default charmap 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 03fe51fb88df70d54cfb597888a75d05e578782b Auto-Submitted: auto-generated The branch stable/13 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=03fe51fb88df70d54cfb597888a75d05e578782b commit 03fe51fb88df70d54cfb597888a75d05e578782b Author: Kyle Evans AuthorDate: 2023-09-02 06:13:02 +0000 Commit: Kyle Evans CommitDate: 2023-12-15 00:59:01 +0000 localedef: expand the default charmap POSIX defines a number of other control characters as well as alternative aliases for some that should be provided in the default set, so let's go ahead and add those. Reviewed by: bapt, yuripv Sponsored by: Klara, Inc. (cherry picked from commit 3a7ffe206ce7e4741fae26432f6d6e5159207f45) --- usr.bin/localedef/charmap.c | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/usr.bin/localedef/charmap.c b/usr.bin/localedef/charmap.c index 44b7e3292eae..1da4d8921ecb 100644 --- a/usr.bin/localedef/charmap.c +++ b/usr.bin/localedef/charmap.c @@ -70,13 +70,49 @@ static const struct { int ch; } portable_chars[] = { { "NUL", '\0' }, + { "SOH", '\x01' }, + { "STX", '\x02' }, + { "ETX", '\x03' }, + { "EOT", '\x04' }, + { "ENQ", '\x05' }, + { "ACK", '\x06' }, + { "BEL", '\a' }, { "alert", '\a' }, + { "BS", '\b' }, { "backspace", '\b' }, + { "HT", '\t' }, { "tab", '\t' }, - { "carriage-return", '\r' }, + { "LF", '\n' }, { "newline", '\n' }, + { "VT", '\v' }, { "vertical-tab", '\v' }, + { "FF", '\f' }, { "form-feed", '\f' }, + { "CR", '\r' }, + { "carriage-return", '\r' }, + { "SO", '\x0e' }, + { "SI", '\x0f' }, + { "DLE", '\x10' }, + { "DC1", '\x11' }, + { "DC2", '\x12' }, + { "DC3", '\x13' }, + { "DC4", '\x14' }, + { "NAK", '\x15' }, + { "SYN", '\x16' }, + { "ETB", '\x17' }, + { "CAN", '\x18' }, + { "EM", '\x19' }, + { "SUB", '\x1a' }, + { "ESC", '\x1b' }, + { "FS", '\x1c' }, + { "IS4", '\x1c' }, + { "GS", '\x1d' }, + { "IS3", '\x1d' }, + { "RS", '\x1e' }, + { "IS2", '\x1e' }, + { "US", '\x1f' }, + { "IS1", '\x1f' }, + { "DEL", '\x7f' }, { "space", ' ' }, { "exclamation-mark", '!' }, { "quotation-mark", '"' }, From nobody Fri Dec 15 18:57:25 2023 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 4SsJPL0rJjz53wvZ; Fri, 15 Dec 2023 18:57:26 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SsJPK73Pvz3Lcw; Fri, 15 Dec 2023 18:57:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702666646; 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=oNG6lH9IN9ZS2BRVglFDADEEj7iH5anvomqXErWEcNk=; b=V5yqr/fSS7INGYBhl09gVkDVZhaTVUSvMRhM9XwtGmYfwJCosiCCqyFDglbWWqAeqohJZM WIPGS5XStbKTM0ZMn1jA7zg07pvfmdRe3Oz8azGQCV9A4rMLpbQ3xH6OMYjiILO6TReQZq kOFb+tpzpv/pbaOQij8DXPjJobxdNKkT73dSlgaGr87Nt3e14h7k6dj5qmlSF5a9NQIadh /upstGx2AvnuknhoRG7fePAKtj12kl/pDwnuwCQSHQesOt5giXsk5ED9BTE4G6y5crBdPk V48eX0U5Q/GK05R1tDgoqBhEGb9fb87TvVGxAZvIAkf9koX+LdGcHFJRfNkrxw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702666646; a=rsa-sha256; cv=none; b=YY9ieoVXxttg6NNSk6MfUzr6kGuE2wU2u714MH9Ep5zIQTOcTytxDyj4m1kDiE4L5Jt5gg svss6BzjW6WrFvqB3uGI7dFc83ifPobojhD1WH8tEwwiEUBNY7J2RXcHGx1buzZG08Bajg mKaiJQVvGzp/VKDR245Yq4QHGVFlbSh0ooWrOIOF38g2HdUrfMzJ5SONK/EGwfNi0tWRG5 AJi0vFqgzRDvusQ3R7uDdsYAJIkrliqTucjkKNd5V+Na/kR3FJ0R/zfS5xmKv7S1B91+mX IYqHZoHpotOH590kyrYGnaLfztoThGof5GsnsNuMAFrXL1iwp0HjIrE88MVxeg== 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=1702666646; 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=oNG6lH9IN9ZS2BRVglFDADEEj7iH5anvomqXErWEcNk=; b=huMJkl1HSHx8XFeRu39rXKKMPQfn2BAZYAYDaiY/jCyfRXxwOjXnV2c450zp8SM8XzBnFj bXmXiXcL1D89TvltLhDYkpOwurRv12V4sakVJNuwEYeO7rG6BUIb9PPE9Jhrhh9nf1zqGP gBGykDS6f+Oj6QampN1AC9hCd99L0+3GuzbPR+alLNZQ/r1OCLl3WgJvj0ZUh/XgCB6XYB nH6E12YBU+cEtTZQxiXo9WVhdxTR7KHgPg2qnWDuXklBUo3JQFjepzGppyS7FiPnGlguOQ XefF9joco9OXr1cmIfoEew3pNxdtZv9tMYZm6QZo0MQnmWoq/7DZPTrcHoVSTg== 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 4SsJPK68vpz6yM; Fri, 15 Dec 2023 18:57:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BFIvPcC018109; Fri, 15 Dec 2023 18:57:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BFIvPP5018106; Fri, 15 Dec 2023 18:57:25 GMT (envelope-from git) Date: Fri, 15 Dec 2023 18:57:25 GMT Message-Id: <202312151857.3BFIvPP5018106@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: 73f87b9725f8 - stable/13 - localedef: add newlines to error messages 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 73f87b9725f8f5f4ff226e60b42dbc8c3c5ea70d Auto-Submitted: auto-generated The branch stable/13 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=73f87b9725f8f5f4ff226e60b42dbc8c3c5ea70d commit 73f87b9725f8f5f4ff226e60b42dbc8c3c5ea70d Author: Kyle Evans AuthorDate: 2023-09-02 06:24:34 +0000 Commit: Kyle Evans CommitDate: 2023-12-15 00:59:05 +0000 localedef: add newlines to error messages These won't be added elsewhere, so add a little bit of room to make these messages a little easier to read. The existing set is a mixed bag, there are somewhere in the ballpark of 45, 46 printfs to stderr and 19 of those had newlines. Reviewed by: yuripv Sponsored by: Klara, Inc. (cherry picked from commit 3141e51d2e38fa7b9e6d81477dfa860d087c514d) --- usr.bin/localedef/collate.c | 34 +++++++++++++++++----------------- usr.bin/localedef/localedef.c | 4 ++-- usr.bin/localedef/localedef.h | 2 +- usr.bin/localedef/monetary.c | 4 ++-- usr.bin/localedef/numeric.c | 2 +- usr.bin/localedef/time.c | 8 ++++---- 6 files changed, 27 insertions(+), 27 deletions(-) diff --git a/usr.bin/localedef/collate.c b/usr.bin/localedef/collate.c index d76c2c2c08b2..2a080773a95e 100644 --- a/usr.bin/localedef/collate.c +++ b/usr.bin/localedef/collate.c @@ -272,7 +272,7 @@ new_pri(void) maxpri = maxpri ? maxpri * 2 : 1024; prilist = realloc(prilist, sizeof (collpri_t) * maxpri); if (prilist == NULL) { - fprintf(stderr,"out of memory"); + fprintf(stderr,"out of memory\n"); return (-1); } for (i = numpri; i < maxpri; i++) { @@ -333,7 +333,7 @@ resolve_pri(int32_t ref) if (pri->pass == pass) { /* report a line with the circular symbol */ lineno = pri->lineno; - fprintf(stderr,"circular reference in order list"); + fprintf(stderr,"circular reference in order list\n"); return (-1); } if ((pri->pri < 0) || (pri->pri >= numpri)) { @@ -494,7 +494,7 @@ define_collsym(char *name) collsym_t *sym; if ((sym = calloc(1, sizeof(*sym))) == NULL) { - fprintf(stderr,"out of memory"); + fprintf(stderr,"out of memory\n"); return; } sym->name = name; @@ -541,7 +541,7 @@ get_collundef(char *name) if ((ud = RB_FIND(collundefs, &collundefs, &srch)) == NULL) { if (((ud = calloc(1, sizeof(*ud))) == NULL) || ((ud->name = strdup(name)) == NULL)) { - fprintf(stderr,"out of memory"); + fprintf(stderr,"out of memory\n"); free(ud); return (NULL); } @@ -565,7 +565,7 @@ get_collchar(wchar_t wc, int create) cc = RB_FIND(collchars, &collchars, &srch); if ((cc == NULL) && create) { if ((cc = calloc(1, sizeof(*cc))) == NULL) { - fprintf(stderr, "out of memory"); + fprintf(stderr, "out of memory\n"); return (NULL); } for (i = 0; i < NUM_WT; i++) { @@ -687,7 +687,7 @@ start_order(int type) /* this is used to protect ELLIPSIS processing */ if ((lastorder == T_ELLIPSIS) && (type != T_CHAR)) { - fprintf(stderr, "character value expected"); + fprintf(stderr, "character value expected\n"); } for (i = 0; i < COLL_WEIGHTS_MAX; i++) { @@ -728,7 +728,7 @@ start_order_char(wchar_t wc) int i; if (wc < ellipsis_start) { - fprintf(stderr, "malformed range!"); + fprintf(stderr, "malformed range!\n"); return; } while (ellipsis_start < wc) { @@ -776,7 +776,7 @@ start_order_ellipsis(void) start_order(T_ELLIPSIS); if (lastorder != T_CHAR) { - fprintf(stderr, "illegal starting point for range"); + fprintf(stderr, "illegal starting point for range\n"); return; } @@ -792,12 +792,12 @@ define_collelem(char *name, wchar_t *wcs) int i; if (wcslen(wcs) >= COLLATE_STR_LEN) { - fprintf(stderr,"expanded collation element too long"); + fprintf(stderr,"expanded collation element too long\n"); return; } if ((e = calloc(1, sizeof(*e))) == NULL) { - fprintf(stderr, "out of memory"); + fprintf(stderr, "out of memory\n"); return; } e->expand = wcs; @@ -816,7 +816,7 @@ define_collelem(char *name, wchar_t *wcs) /* A character sequence can only reduce to one element. */ if ((RB_FIND(elem_by_symbol, &elem_by_symbol, e) != NULL) || (RB_FIND(elem_by_expand, &elem_by_expand, e) != NULL)) { - fprintf(stderr, "duplicate collating element definition"); + fprintf(stderr, "duplicate collating element definition\n"); free(e); return; } @@ -932,7 +932,7 @@ add_order_subst(void) if (s == NULL) { if ((s = calloc(1, sizeof(*s))) == NULL) { - fprintf(stderr,"out of memory"); + fprintf(stderr,"out of memory\n"); return; } s->key = new_pri(); @@ -976,7 +976,7 @@ static void add_subst_pri(int32_t ref) { if (curr_subst >= COLLATE_STR_LEN) { - fprintf(stderr,"substitution string is too long"); + fprintf(stderr,"substitution string is too long\n"); return; } subst_weights[curr_subst] = ref; @@ -1040,7 +1040,7 @@ add_weight(int32_t ref, int pass) return; if ((w = calloc(1, sizeof(*w))) == NULL) { - fprintf(stderr, "out of memory"); + fprintf(stderr, "out of memory\n"); return; } w->pri = srch.pri; @@ -1214,7 +1214,7 @@ dump_collate(void) RB_COUNT(temp, substs, &substs[i], n); subst_count[i] = n; if ((st = calloc(n, sizeof(collate_subst_t))) == NULL) { - fprintf(stderr, "out of memory"); + fprintf(stderr, "out of memory\n"); return; } n = 0; @@ -1245,7 +1245,7 @@ dump_collate(void) RB_NUMNODES(collelem_t, elem_by_expand, &elem_by_expand, chain_count); chain = calloc(chain_count, sizeof(collate_chain_t)); if (chain == NULL) { - fprintf(stderr, "out of memory"); + fprintf(stderr, "out of memory\n"); return; } n = 0; @@ -1265,7 +1265,7 @@ dump_collate(void) RB_NUMNODES(collchar_t, collchars, &collchars, n); large = calloc(n, sizeof(collate_large_t)); if (large == NULL) { - fprintf(stderr, "out of memory"); + fprintf(stderr, "out of memory\n"); return; } diff --git a/usr.bin/localedef/localedef.c b/usr.bin/localedef/localedef.c index ae0bd052b40c..5ff146d6f655 100644 --- a/usr.bin/localedef/localedef.c +++ b/usr.bin/localedef/localedef.c @@ -167,7 +167,7 @@ copy_category(char *src) } if (rv != 0) { - fprintf(stderr,"source locale data unavailable: %s", src); + fprintf(stderr,"source locale data unavailable: %s\n", src); return; } @@ -182,7 +182,7 @@ copy_category(char *src) (void) mkdir(dirname(category_file()), 0755); if (link(srcpath, category_file()) != 0) { - fprintf(stderr,"unable to copy locale data: %s", + fprintf(stderr,"unable to copy locale data: %s\n", strerror(errno)); return; } diff --git a/usr.bin/localedef/localedef.h b/usr.bin/localedef/localedef.h index 2aece1543d5b..4b141ac8dc09 100644 --- a/usr.bin/localedef/localedef.h +++ b/usr.bin/localedef/localedef.h @@ -174,4 +174,4 @@ const char *get_wide_encoding(void); int max_wide(void); //#define _(x) gettext(x) -#define INTERR fprintf(stderr,"internal fault (%s:%d)", __FILE__, __LINE__) +#define INTERR fprintf(stderr,"internal fault (%s:%d)\n", __FILE__, __LINE__) diff --git a/usr.bin/localedef/monetary.c b/usr.bin/localedef/monetary.c index 659c495a71fe..7a77ac7e256c 100644 --- a/usr.bin/localedef/monetary.c +++ b/usr.bin/localedef/monetary.c @@ -93,7 +93,7 @@ add_monetary_num(int n) (void) asprintf(&str, "%d", n); if (str == NULL) { - fprintf(stderr, "out of memory"); + fprintf(stderr, "out of memory\n"); return; } @@ -167,7 +167,7 @@ add_monetary_group(int n) (void) asprintf(&s, "%s;%d", mon.mon_grouping, n); } if (s == NULL) - fprintf(stderr, "out of memory"); + fprintf(stderr, "out of memory\n"); free((char *)mon.mon_grouping); mon.mon_grouping = s; diff --git a/usr.bin/localedef/numeric.c b/usr.bin/localedef/numeric.c index 358355fe96ae..5533b7c10e1a 100644 --- a/usr.bin/localedef/numeric.c +++ b/usr.bin/localedef/numeric.c @@ -93,7 +93,7 @@ add_numeric_group(int n) (void) asprintf(&s, "%s;%d", numeric.grouping, n); } if (s == NULL) - fprintf(stderr, "out of memory"); + fprintf(stderr, "out of memory\n"); free((char *)numeric.grouping); numeric.grouping = s; diff --git a/usr.bin/localedef/time.c b/usr.bin/localedef/time.c index 2de922a8eb12..7a56e244c921 100644 --- a/usr.bin/localedef/time.c +++ b/usr.bin/localedef/time.c @@ -104,7 +104,7 @@ add_list(const char *ptr[], char *str, int limit) return; } } - fprintf(stderr,"too many list elements"); + fprintf(stderr,"too many list elements\n"); } void @@ -137,7 +137,7 @@ add_time_list(wchar_t *wcs) } else if (tm.pm == NULL) { tm.pm = str; } else { - fprintf(stderr,"too many list elements"); + fprintf(stderr,"too many list elements\n"); free(str); } break; @@ -180,11 +180,11 @@ check_time_list(void) case T_ALT_DIGITS: return; default: - fprintf(stderr,"unknown list"); + fprintf(stderr,"unknown list\n"); break; } - fprintf(stderr,"too few items in list (%d)", last_kw); + fprintf(stderr,"too few items in list (%d)\n", last_kw); } void From nobody Fri Dec 15 18:57:26 2023 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 4SsJPM4PRRz53wqD; Fri, 15 Dec 2023 18:57:27 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SsJPM1Q7rz3Lvj; Fri, 15 Dec 2023 18:57:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702666647; 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=svWh8ZCe/q0xNXoZFRDDymKfJp46pQr3VrT38fnhRNU=; b=hcnDzXS/k+bGT/QKahNMLeQmjtTIYDcaJAxMxOkyty6JrS3G1iFg/+g29zMww6e/PpXL1N irPgOjOS05XbjLS+03eSMHOORRaPvQkOA3S6Q1gcM3pGO8k94t1uEqomeEDHRHV4pd2WLk NK78VkQWBup3FjfVF7xScrvhglqezlV6nRrMQkdEYx4P/b8dwt+QyZ3H4NSIYkz5XX3+/b fM5v8d93sMOfRuxrrqRsNKerE1imF2wAgsXMLJhvJCN4nNwcajFfIFEQQPvI2n9nio84jb vifVd+Dy/aFnt9DkuqXncUOUSbxAwekD0iKpGy5zeOtxlM2Evp60X9mHZMAJDQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702666647; a=rsa-sha256; cv=none; b=X+RmatDDOIDkPGVubTYcYWVomm8qXhhdtBDejPBp/Jwhz3tyO0UlVyZaV9fpRKvH366LX8 w5GFIa9wKdCizQOsJ9USDuqTD4bNyT+SKEBqYJdeOMv7XxWVuPbwdNUmwF17S0UaT9j5jh qN9FxcR2nVLeH6snM6WN/s1oDQ+crmhNXMioKV8+G4vZCCJ+iwOeIRnafGf4i9Gut3TnQj wFi1YhuZic6pxswbzub79gTBvNq531lIvISCZSCW6EFFv/R/uYmaVEYcT0YMWybme8cVD8 1SrXbOddQcBJX4bNDqJdzBw60ykP9iwsYaWnFbr4+GFEH9XjzdP9esStVpEK0w== 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=1702666647; 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=svWh8ZCe/q0xNXoZFRDDymKfJp46pQr3VrT38fnhRNU=; b=vzGPe4/y96MduNx+dVFSWhVVLZyl2EiUXZHICZ8o4eg7QsgqxJva7FbfHZXpY1lPxkm5HI yrq01+wg+pb4/TU6JkXLEJVHjNZ9OHFtxvyujnQpLR8ZTagrnKEflEV1Zpq/xXuhwILc6/ fxvBBGkcWaCjoNKvKoRXx+C2eoPMmiUuPMXIkAk2HTG4ECkL7V45j46EMzJPy9tIxAYHMR 5iq4oshu9aFOMBvRWav/AaJeHj78bS01nHz4NONnkDhc9Ru25IOGMhGbYC+27bQtj9+CQo g+vDcqpshZ3dzBRijRo2IsrJx8W4XbAJUByh9PyaGaqCAGn+rwPEvahauEdwKw== 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 4SsJPM0Rn9z7ck; Fri, 15 Dec 2023 18:57:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BFIvQUB018169; Fri, 15 Dec 2023 18:57:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BFIvQCt018166; Fri, 15 Dec 2023 18:57:26 GMT (envelope-from git) Date: Fri, 15 Dec 2023 18:57:26 GMT Message-Id: <202312151857.3BFIvQCt018166@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: 6a415720f54d - stable/13 - arm64: lop off another 24MB of KVA for early device mappings 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6a415720f54df09aff13fc991c9937cef986674f Auto-Submitted: auto-generated The branch stable/13 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=6a415720f54df09aff13fc991c9937cef986674f commit 6a415720f54df09aff13fc991c9937cef986674f Author: Kyle Evans AuthorDate: 2023-11-23 16:21:33 +0000 Commit: Kyle Evans CommitDate: 2023-12-15 00:59:09 +0000 arm64: lop off another 24MB of KVA for early device mappings This grows the block enough to fit a 4K 32-bit depth framebuffer; some firmware would present smaller GOP modes to be able to boot with a smaller framebuffer on these devices, but the Windows Devkit firmware is simply not that nice. Instead, it offers exactly one GOP mode that matches the current resolution of the attached display, so with limited control over resolution on most of my displays it'd be nice if we could Just Work(TM) at 4K. andrew notes that he has some ideas for removing PMAP_MAPDEV_EARLY_SIZE entirely, so this limitation could end up removed altogether in the future. Reviewed by: andrew, emaste (cherry picked from commit a3ceeef26bc880b86f4e181bddd9924a2b5e0691) --- sys/arm64/include/pte.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/arm64/include/pte.h b/sys/arm64/include/pte.h index f1b11c3a0189..478bd85aa2e2 100644 --- a/sys/arm64/include/pte.h +++ b/sys/arm64/include/pte.h @@ -143,7 +143,11 @@ typedef uint64_t pt_entry_t; /* page table entry */ /* 0x2 also marks an invalid address */ #define L3_PAGE 0x3 -#define PMAP_MAPDEV_EARLY_SIZE (L2_SIZE * 8) +/* + * A substantial portion of this is to make sure that we can cope with 4K + * framebuffers in early boot, assuming a common 4K resolution @ 32-bit depth. + */ +#define PMAP_MAPDEV_EARLY_SIZE (L2_SIZE * 20) #define L0_ENTRIES_SHIFT 9 #define L0_ENTRIES (1 << L0_ENTRIES_SHIFT) From nobody Fri Dec 15 18:57:28 2023 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 4SsJPN43Qxz53wqF; Fri, 15 Dec 2023 18:57:28 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SsJPN24f8z3Lw1; Fri, 15 Dec 2023 18:57:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702666648; 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=qFyLbwAdT8tRiAROaryEoh+U6s1+kntb7fQhPmPZZKc=; b=VXMUu+8r2XeCx70bnX0IF7s6ZydCYWEKqRvfaJlrX8CJhuOKuGyttOLd0oq6QXkpDT75g/ qzpFjwbXYmAzAHnrz5eYf/n9XFMsBM2JjV4SwXrnf1tv4PjWP6xKkZU8c0LSfntNKoQHqH Bc7U2DZNNDSs9hgTBHOJSXT6HjMhaaUAmX/Np5MeDrKBte6Dv7SwDDKDqDNd1fMyN0lBW6 LGwr2ljZifKFhVgGefeWs5vWtv2rDbRQQrFSrZ4RQMQE1u3Mou7bcJMHBhuH+V01mYDkE7 49BGaaVzkEdQcLKV6P7ElTQ/i2XZpNO9f7UeOl6uV74FQeUFss59OuK1X04gKQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702666648; a=rsa-sha256; cv=none; b=sjDlCe7KTeQ2v96T9YVpwgYPHg+m58PyEQ0vra5M91Jb/LJpTvnfccXuu4E5LEo8Hg9kN5 Imkhr4wILvJdNubzAB1JdYdBtO5/U4J5KnBfMtik6JLy/C95YqGVZkzSsi29/KDDH0SgYc 0/MhyV6y6UpDu0Qd3FNlNl2nTwkk/3I48/H674VU05L0V3SPUNT7HQlp67TC4ZzDc2bCEg GSB08pgJ6CBrPDrQiRAYtoeZ8mOfhyyR7LZAtxRburG4FPNn77cdhzsgEEBK24tVUqYa2k JCNYYkTv/+c6a7VQMbBiutpGaidHFyIbz3HjYKx2vhbTGhWI/Y44Xo7jXUpuJA== 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=1702666648; 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=qFyLbwAdT8tRiAROaryEoh+U6s1+kntb7fQhPmPZZKc=; b=txrUe3Kebd5OQOAq6pUKQ25veVYwB010d0tNsx8Yb2s1AHere8b1nmQDAHYr6RsgoBIMUO JVn155s3h/PuelgitmROOG/pnZ1mm9SJ3iINxrWLXkQ5FLNZTQBywH8RVuNFmRL9Jt6gOq LOuueeIuQzU2JPwFuw8pyXa23BluRLb5RTyIaesNv7iFUnHc9bLouRbZNRzqfk43f13pTu FL5qJuQAK6l9wZ6fhU4AVcoZVBJQJDOyIgCN9pj+sMjoqHAFWLiumjqDO5oKdWfz1SGfJk wjO5rwbDt6imatonYIE19xEh8Lh+KmROUPlo1N4EKm2QKF3FKb8J1kYjAPdSyQ== 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 4SsJPN19JNz7cl; Fri, 15 Dec 2023 18:57:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BFIvSd3018217; Fri, 15 Dec 2023 18:57:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BFIvSE5018214; Fri, 15 Dec 2023 18:57:28 GMT (envelope-from git) Date: Fri, 15 Dec 2023 18:57:28 GMT Message-Id: <202312151857.3BFIvSE5018214@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: aa9ad4d484ef - stable/13 - lockf: correct omission in the usage statement 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: aa9ad4d484eff42dfd7461fdfcc5d32a03922e8e Auto-Submitted: auto-generated The branch stable/13 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=aa9ad4d484eff42dfd7461fdfcc5d32a03922e8e commit aa9ad4d484eff42dfd7461fdfcc5d32a03922e8e Author: Kyle Evans AuthorDate: 2023-11-22 04:45:42 +0000 Commit: Kyle Evans CommitDate: 2023-12-15 00:59:12 +0000 lockf: correct omission in the usage statement The -w flag was added without being noted in the usage statement; fix that now. While we're here, re-sort the getopt() string. Reviewed by: 0mp, allanjude, des Sponsored by: Klara, Inc. (cherry picked from commit 35095fd23f071d03633312b91a5b460eaf811efa) --- usr.bin/lockf/lockf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.bin/lockf/lockf.c b/usr.bin/lockf/lockf.c index 3caf8941bdf6..6ca317887cb1 100644 --- a/usr.bin/lockf/lockf.c +++ b/usr.bin/lockf/lockf.c @@ -62,7 +62,7 @@ main(int argc, char **argv) silent = keep = 0; flags = O_CREAT | O_RDONLY; waitsec = -1; /* Infinite. */ - while ((ch = getopt(argc, argv, "sknt:w")) != -1) { + while ((ch = getopt(argc, argv, "knst:w")) != -1) { switch (ch) { case 'k': keep = 1; @@ -224,7 +224,7 @@ usage(void) { fprintf(stderr, - "usage: lockf [-kns] [-t seconds] file command [arguments]\n"); + "usage: lockf [-knsw] [-t seconds] file command [arguments]\n"); exit(EX_USAGE); } From nobody Fri Dec 15 18:57:29 2023 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 4SsJPP3t1Nz53wvd; Fri, 15 Dec 2023 18:57:29 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SsJPP3Sb7z3M5t; Fri, 15 Dec 2023 18:57:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702666649; 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=z+lmK3e9ktZGoxYl0zi8pe0m1k0aCptb5UtUQrsBNZQ=; b=hhXghuwcP+Rq/UR2p7quftHvPiqaD2O07rNNWe+eNR+h2gJNZndpgjKlPM4Aj0ib1ZvXFS ZMtymANLPaGuMenenpNBGBQ1HewAFKJXhkVpQXeVTg8q8VGH267hczrY5AVR8Pqyh4T0dv DQ7fSrvFjJdPtFIwcqpzbMU0f+XiPUa7QAfz2zlh6XECjzYBEqCJ2HhaSdCOlaKSpAEHlT iDoR8sz4KUTcSxFrgzTny2FJNpufl5KVZvnFSu9tI3JCzJ1YczEEAP7F7Ty0L/5mPcKXQ+ bwUzMlLR9l8bXuX1/cdSz2xwynCqP9h5O2i//dzyyvwuLf1/OjkLMvnb9uiWYg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702666649; a=rsa-sha256; cv=none; b=gnCtNLDfgcMQS8XjSF+mXVgqYAuPhvBxCPsq4oafCDYyxjniqhnFv5KPDbVJ5qbohyQ8NH wObGBHfQD+OaycaUf7/heQXXZO4Pb/Djjs3X/KTr5EDFA/yYdXYRjB15jzvJJVyAk1yTkV H6FJhhuErLo5VzMvSkZOpbRklltEKNnZf5QdwkACCD7cch1VQXHZWAquVpDTSsBTgwhKSQ 237Muzqtd4CLflN4kJhoUzeBy4P3iGXhmEAE8dQV3k4Rz4RJFK3e1rZWhYZ0D7j168AgIa 8wKQcbitdEIoY7knZ5/XLC++QSKWV/6XBXmi6O2dT3YVwDcoF08HYgF9CuhUDw== 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=1702666649; 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=z+lmK3e9ktZGoxYl0zi8pe0m1k0aCptb5UtUQrsBNZQ=; b=GS63NzJ5OaVqtNMu3DnSDYjzaaRpPbttwPVPQQSGE1FNp/vo/pJsBQpMAqs3i5KQHPbJpA JTI1NG/nZ4YaxA9rgC/xCl2Fn4wUYJT7GOXNmmnxXtB7ibkt6wI6Kk9WZosbYL9fdjuXct YKGgV/JC2wHOdJfFUgCrIxPkOO9Zxb3fJ0mh7F86ypFjmeIVCXUWxI62ZbyHtnE1ib64rZ LbCmDKSMY6DBlC0Z0PCbQc7/qIwZyNY0KUGOcicKTsY+CyQgGqn5EwsdPWlG80SNQuDI18 K9slwdHJpOlRN12OxQyZdN8T8h6N8LA9NoITA+o1OtoGxFy4pLcDjLZKkVYg2A== 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 4SsJPP2SQmz7Pr; Fri, 15 Dec 2023 18:57:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BFIvTx3018265; Fri, 15 Dec 2023 18:57:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BFIvTcG018262; Fri, 15 Dec 2023 18:57:29 GMT (envelope-from git) Date: Fri, 15 Dec 2023 18:57:29 GMT Message-Id: <202312151857.3BFIvTcG018262@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: 8f5c28046307 - stable/13 - lockf: hide unavailable error with -n -s 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8f5c280463078d10ed4da6fbdba11596e441cf09 Auto-Submitted: auto-generated The branch stable/13 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=8f5c280463078d10ed4da6fbdba11596e441cf09 commit 8f5c280463078d10ed4da6fbdba11596e441cf09 Author: Kyle Evans AuthorDate: 2023-11-22 04:41:36 +0000 Commit: Kyle Evans CommitDate: 2023-12-15 00:59:15 +0000 lockf: hide unavailable error with -n -s The error message is expected, allow -s to suppress just that one since it would loosely fall under the definition of "failure to acquire the lock" described in the manpage for the -s option. Reviewed by: 0mp, allanjude Feedback from: des Sponsored by: Klara, Inc. (cherry picked from commit 3041e6950d07f0d11c9f91fefbf3c273cbbe4407) --- usr.bin/lockf/lockf.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/usr.bin/lockf/lockf.c b/usr.bin/lockf/lockf.c index 6ca317887cb1..8b0a13e3ca0f 100644 --- a/usr.bin/lockf/lockf.c +++ b/usr.bin/lockf/lockf.c @@ -38,7 +38,7 @@ #include #include -static int acquire_lock(const char *name, int flags); +static int acquire_lock(const char *name, int flags, int silent); static void cleanup(void); static void killed(int sig); static void timeout(int sig); @@ -125,13 +125,14 @@ main(int argc, char **argv) * avoiding the separate step of waiting for the lock. This * yields fairness and improved performance. */ - lockfd = acquire_lock(lockname, flags | O_NONBLOCK); + lockfd = acquire_lock(lockname, flags | O_NONBLOCK, silent); while (lockfd == -1 && !timed_out && waitsec != 0) { if (keep) - lockfd = acquire_lock(lockname, flags); + lockfd = acquire_lock(lockname, flags, silent); else { wait_for_lock(lockname); - lockfd = acquire_lock(lockname, flags | O_NONBLOCK); + lockfd = acquire_lock(lockname, flags | O_NONBLOCK, + silent); } } if (waitsec > 0) @@ -168,15 +169,18 @@ main(int argc, char **argv) * on success, or -1 on failure. */ static int -acquire_lock(const char *name, int flags) +acquire_lock(const char *name, int flags, int silent) { int fd; if ((fd = open(name, O_EXLOCK|flags, 0666)) == -1) { if (errno == EAGAIN || errno == EINTR) return (-1); - else if (errno == ENOENT && (flags & O_CREAT) == 0) - err(EX_UNAVAILABLE, "%s", name); + else if (errno == ENOENT && (flags & O_CREAT) == 0) { + if (!silent) + warn("%s", name); + exit(EX_UNAVAILABLE); + } err(EX_CANTCREAT, "cannot open %s", name); } return (fd); From nobody Fri Dec 15 18:57:30 2023 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 4SsJPQ4sgqz53wqK; Fri, 15 Dec 2023 18:57:30 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SsJPQ4BCBz3MKW; Fri, 15 Dec 2023 18:57:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702666650; 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=pXGbr8N5tUbV1/HkYxDgeKHANPPKcdn8uq6U4e4jIWY=; b=c/AiH/eOKkNrm4DjsEaVOQXVYRg1SJ9Gtloig4c4d296MLO0efHIhdb5klYy+AZrAnIEyb pVWNfalumwNzV6f3Agz6TPJw0FY4zdVMozTjB/Zd5UaTQctDked/acws7zO6C8wLYuOsAv MYcJXA5cW9TiuzaUkeroV1R/3nBGL2ako51LY98vdIJz+SKkvDv1TSeZZWs4gcsPuuNzUR WoMSVCsYinWxcGH2llpEh5ZD//Vi/BMGI0lO49suvf9tsXd5wSqdr4PC8pKkW8K8ruDons DMcaNcV4rJCQ3fNTunqghIfJqbUARI+CPq0zRj1UHllsjIwyeuyZJj1YOugnjA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702666650; a=rsa-sha256; cv=none; b=kwLinlT/chMmS7Zb7fmRzIwE/rGMmr+5lC7ysIjkJnQS0Kt5XUPmGgyouF0xpLBAL5nBLn o3DASe1FULLYod6dGs3TjF0W912osjwi8dk+PnndWNUyI3+oWLr4ueYEAXI/Sk4tLHrx9b IR/A9xQEosC6QUoLQUIps6lobYlKIre/R56CQ4t15Y0HJKi+UTlyBbnlZXeyoxxT38eEcp IR/tJaYVx8PbrGIeQznZVwRfHN4gcjhEzsArRwSDv1zULaEuIuOGucrH7gPzq5eemV4l1M UFtaQb1nd/5KrsO1q70Uw7sG9lkmLUFn0euV6Wy1C1c/K/E5+SOSULM+m5JVOQ== 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=1702666650; 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=pXGbr8N5tUbV1/HkYxDgeKHANPPKcdn8uq6U4e4jIWY=; b=P/VNLpItBKaJu0bniUAN1otssH5eSjLtdS3W4QGK9xhJBPngcifwxK9G+bp6cjspVks/VT CYALW3ZH+AAT3KlI7/0KSe1dH1dEUMg+GxSKoSvvVhtoBYPS2mU0xS8qfnIOwuMenl2jHT 6EhwZeVP9rQqfkASA15lHYn86e07gSrEt4jtIpmaqelYR+CsBwFOdUe9x65lY3vywOb7Rd M5xhLI0EKdHmVMGpLL/+CdBHTDqXv3WbpQxfQDIazGXDzDe/GW0vrCFr1EC/QpY+yaLcT7 w/Oqq0DtEXZ3kFg6KSOe6P4XEgSRzWRLg26uUXBNj3kZBck++I23aXaBJMll2g== 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 4SsJPQ36Nyz7fW; Fri, 15 Dec 2023 18:57:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BFIvUEp018308; Fri, 15 Dec 2023 18:57:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BFIvUUo018305; Fri, 15 Dec 2023 18:57:30 GMT (envelope-from git) Date: Fri, 15 Dec 2023 18:57:30 GMT Message-Id: <202312151857.3BFIvUUo018305@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: 159d922f4ce9 - stable/13 - lockf: don't hold stdin/stdout/stderr open 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 159d922f4ce9405189b4f92bfe46858bfde75400 Auto-Submitted: auto-generated The branch stable/13 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=159d922f4ce9405189b4f92bfe46858bfde75400 commit 159d922f4ce9405189b4f92bfe46858bfde75400 Author: Alexander Melkov AuthorDate: 2023-11-22 04:46:28 +0000 Commit: Kyle Evans CommitDate: 2023-12-15 00:59:18 +0000 lockf: don't hold stdin/stdout/stderr open None of these are essential in the lockf monitor (parent post-fork), so close them to maintain the illusion that lockf hasn't been inserted into the pipeline. This ensures that the correct effects happen on other programs in the pipeline if the locked command closes or redirects these elsewhere. The original patch used -s to close stdout/stderr rather than closing them unconditionally, but it's not clear that we really care that much. kevans dropped that part when taking the patch, patch is otherwise by listed author. PR: 112379 Reviewed by: 0mp, allanjude (both earlier version), kevans Feedback from: des Sponsored by: Klara, Inc. (cherry picked from commit 18425c19cae08cbe41801845457ed67285806688) --- usr.bin/lockf/lockf.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/usr.bin/lockf/lockf.c b/usr.bin/lockf/lockf.c index 8b0a13e3ca0f..1149128021e6 100644 --- a/usr.bin/lockf/lockf.c +++ b/usr.bin/lockf/lockf.c @@ -157,8 +157,11 @@ main(int argc, char **argv) signal(SIGINT, SIG_IGN); signal(SIGQUIT, SIG_IGN); signal(SIGTERM, killed); + fclose(stdin); + fclose(stdout); + fclose(stderr); if (waitpid(child, &status, 0) == -1) - err(EX_OSERR, "waitpid failed"); + exit(EX_OSERR); return (WIFEXITED(status) ? WEXITSTATUS(status) : EX_SOFTWARE); } @@ -210,7 +213,7 @@ killed(int sig) cleanup(); signal(sig, SIG_DFL); if (kill(getpid(), sig) == -1) - err(EX_OSERR, "kill failed"); + _Exit(EX_OSERR); } /* From nobody Fri Dec 15 18:57:31 2023 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 4SsJPR6CvCz53wsW; Fri, 15 Dec 2023 18:57:31 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SsJPR55ztz3MCP; Fri, 15 Dec 2023 18:57:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702666651; 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=jB79hKzHVCXCAzNT5WaTVTJFtRdLVUyvl6RAvcL1zws=; b=Wccl5BQpiM91bSf/RBitzbHMdZpb9/YvOucp792SWTTkblJoQnoPV03Q9bzOf5oO86bLPc JVgSzDkJPeOtmqs88afRReBqvtYmYmMLJNFOI99Hz/myPZ9mZx9KE/x0t4RW8l8Ueq4cro 4Qba6WTmrrLi2OJNqmzmzCVhyF8vRik4pf4ck4nZJ4BGwibVrEsWDA9idUNze06P2qu/Qq sHRI9fL0vtFpT2eeVibGkOwDkgyE+stCq+BzLSAaSMwicrlFrgilITVFUNRaVFA7RyPR3d v/A2FU/rIIFIP3JR1UcFrYuObdE+1zXdovd9AmO61K3EWuIcb1I5xbaoxOZ5xw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702666651; a=rsa-sha256; cv=none; b=G/xkgbLwuJmX6wEQ+48HF3ql2OI+uwYheaU46SH010nkt0xu7urX1H4Ijn/XdkEHXwueVV pofdKsdy0r/E5I5U3vBpvhmjuQZdHiPwkplsmPLraoiXwn8gvAOT2Jj6xpXi+mv6FyVlCy lEuGa4mYgd+9p/ID1b/JRKhswpfLVVVUkc9A5dqMgJyzQzLXGno/hVHod7DFfNR22U/G/8 N8qnsuDYtY0toCtyaiee+GnT41KqVtjfUDHJ/Ig/zIxetsR+o/nV5V7eVilH0zX2SpsN+W Q0uilRQWIDyOugcysFOzhoqT4hBAqsQGwn+T60c248HYjhYDokt1TTW0hDd1Hw== 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=1702666651; 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=jB79hKzHVCXCAzNT5WaTVTJFtRdLVUyvl6RAvcL1zws=; b=Vy8wPOFzTHz5QckOZA5wKTTmnlbcmXc7rhPJYDoSV4NZ07mqK92JnR7vhxtQPESUSySNcK j3+9Wgu1NI76Rxwb+xPP6XgjisGCT6W0+zi0GJBZyrUq2wL0oNh43c84bcStRHTzIe6khw IXY4uhjbMlFTYPK0I1aN5g+vjUA1PXYIqcnM4u0eC9L4l7c0AeYZIF/3naw4L5BI5bw+0J 9J7IDkwk3b1JSurxY5oBdN7dpx0LzycGLFHUBRD8yYRb4XVIrNefdg2/9YJF0QnBt0gA3f /rwUZ4M7/X0TWcMyfwf5+mocy7XBcvZyCX8dFLXhU2acHhRVFJrkj0hTPEDRQA== 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 4SsJPR4CKXz7cm; Fri, 15 Dec 2023 18:57:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BFIvVVE018355; Fri, 15 Dec 2023 18:57:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BFIvVFV018352; Fri, 15 Dec 2023 18:57:31 GMT (envelope-from git) Date: Fri, 15 Dec 2023 18:57:31 GMT Message-Id: <202312151857.3BFIvVFV018352@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: fbd1d0bdff1d - stable/13 - lockf: add some tests 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: fbd1d0bdff1d97068c148e0a200ea786eb29fe69 Auto-Submitted: auto-generated The branch stable/13 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=fbd1d0bdff1d97068c148e0a200ea786eb29fe69 commit fbd1d0bdff1d97068c148e0a200ea786eb29fe69 Author: Kyle Evans AuthorDate: 2023-11-22 05:09:11 +0000 Commit: Kyle Evans CommitDate: 2023-12-15 00:59:21 +0000 lockf: add some tests Provide basic coverage for the existing options, nothing deeper (e.g., pipe closing behavior) is tested in this set. Reviewed by: allanjude Feedback from: des Sponsored by: Klara, Inc. (cherry picked from commit 296a5a4db1fc8203f5f6aa8f68321e6ab4652b56) --- etc/mtree/BSD.tests.dist | 2 + usr.bin/lockf/Makefile | 5 ++ usr.bin/lockf/tests/Makefile | 6 ++ usr.bin/lockf/tests/lockf_test.sh | 148 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 161 insertions(+) diff --git a/etc/mtree/BSD.tests.dist b/etc/mtree/BSD.tests.dist index 46a305aec62d..f9a551bbc39b 100644 --- a/etc/mtree/BSD.tests.dist +++ b/etc/mtree/BSD.tests.dist @@ -1055,6 +1055,8 @@ .. locale .. + lockf + .. m4 .. mkimg diff --git a/usr.bin/lockf/Makefile b/usr.bin/lockf/Makefile index d1905a4510ba..b7d916f20d13 100644 --- a/usr.bin/lockf/Makefile +++ b/usr.bin/lockf/Makefile @@ -1,4 +1,9 @@ +.include + PROG= lockf +HAS_TESTS= +SUBDIR.${MK_TESTS}+= tests + .include diff --git a/usr.bin/lockf/tests/Makefile b/usr.bin/lockf/tests/Makefile new file mode 100644 index 000000000000..88a936cc583d --- /dev/null +++ b/usr.bin/lockf/tests/Makefile @@ -0,0 +1,6 @@ + +PACKAGE= tests + +ATF_TESTS_SH+= lockf_test + +.include diff --git a/usr.bin/lockf/tests/lockf_test.sh b/usr.bin/lockf/tests/lockf_test.sh new file mode 100644 index 000000000000..8696ab82a996 --- /dev/null +++ b/usr.bin/lockf/tests/lockf_test.sh @@ -0,0 +1,148 @@ +# +# SPDX-License-Identifier: BSD-2-Clause +# +# Copyright (c) 2023 Klara, Inc. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# + +# sysexits(3) +: ${EX_USAGE:=64} +: ${EX_UNAVAILABLE:=69} +: ${EX_CANTCREAT:=73} +: ${EX_TEMPFAIL:=75} + +atf_test_case badargs +badargs_body() +{ + atf_check -s exit:${EX_USAGE} -e not-empty lockf + atf_check -s exit:${EX_USAGE} -e not-empty lockf "testlock" +} + +atf_test_case basic +basic_body() +{ + # Something innocent so that it does eventually go away without our + # intervention. + lockf "testlock" sleep 10 & + lpid=$! + + # Make sure that the lock exists... + atf_check test -e "testlock" + + # Attempt both verbose and silent re-lock + atf_check -s exit:${EX_TEMPFAIL} -e not-empty \ + lockf -t 0 "testlock" sleep 0 + atf_check -s exit:${EX_TEMPFAIL} -e empty \ + lockf -t 0 -s "testlock" sleep 0 + + # Make sure it cleans up after the initial sleep 10 is over. + wait "$lpid" + atf_check test ! -e "testlock" +} + +atf_test_case keep +keep_body() +{ + lockf -k "testlock" sleep 10 & + lpid=$! + + # Make sure that the lock exists now... + while ! test -e "testlock"; do + sleep 0.5 + done + + kill "$lpid" + wait "$lpid" + + # And it still exits after the lock has been relinquished. + atf_check test -e "testlock" +} + +atf_test_case needfile +needfile_body() +{ + # Hopefully the clock doesn't jump. + start=$(date +"%s") + + # Should fail if the lockfile does not yet exist. + atf_check -s exit:"${EX_UNAVAILABLE}" lockf -sn "testlock" sleep 30 + + # It's hard to guess how quickly we should have finished that; one would + # hope that it exits fast, but to be safe we specified a sleep 30 under + # lock so that we have a good margin below that duration that we can + # safely test to make sure we didn't actually execute the program, more + # or less. + now=$(date +"%s") + tpass=$((now - start)) + atf_check test "$tpass" -lt 10 +} + +atf_test_case timeout +timeout_body() +{ + lockf "testlock" sleep 30 & + lpid=$! + + while ! test -e "testlock"; do + sleep 0.5 + done + + start=$(date +"%s") + timeout=2 + atf_check -s exit:${EX_TEMPFAIL} lockf -st "$timeout" "testlock" sleep 0 + + # We should have taken no less than our timeout, at least. + now=$(date +"%s") + tpass=$((now - start)) + atf_check test "$tpass" -ge "$timeout" + + kill "$lpid" + wait "$lpid" || true +} + +atf_test_case wrlock +wrlock_head() +{ + atf_set "require.user" "unprivileged" +} +wrlock_body() +{ + touch "testlock" + chmod -w "testlock" + + # Demonstrate that we can lock the file normally, but -w fails if we + # can't write. + atf_check lockf -kt 0 "testlock" sleep 0 + atf_check -s exit:${EX_CANTCREAT} -e not-empty \ + lockf -wt 0 "testlock" sleep 0 +} + +atf_init_test_cases() +{ + atf_add_test_case badargs + atf_add_test_case basic + atf_add_test_case keep + atf_add_test_case needfile + atf_add_test_case timeout + atf_add_test_case wrlock +} From nobody Fri Dec 15 18:57:32 2023 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 4SsJPT11nYz53wsZ; Fri, 15 Dec 2023 18:57:33 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SsJPS6Y5Jz3MMw; Fri, 15 Dec 2023 18:57:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702666652; 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=r4QJxL0Dk4sYp0shFpOramRQ4DvUkWMFUyOR/Nyae/M=; b=lCbKza67Fs23VduBwWJUn/f/fluEBsF9kKRyQ+WMLMZt481zmFGrXUjxZyxAYru9x5QnHw Bi1GCu4dzbaWs39mB4LIbMXSs7jlAxKLFbzIWqcvlLWQxX/EhP+WEgIhmn897Hp93C1hMs mmKyEg8ReGYoC6cD2p+w+82tlP+w7wGTgAYIqRT8Ck6NXnm1+kRr+kQNeE3/VSVznd+Ozy Q8JMwdUhazFK27trbmF3QYJwkdtjPepydpvqczYwnxfCUXbjFpR/QSr0NWFvmRnk+KRO0V Q0M7+amRlSJfqMy+3z4/iOfaxESGfIXPq7OfAhMLX75wWuXnjvvgyoGRziuOzg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702666652; a=rsa-sha256; cv=none; b=BpTzZLp3F0V8Jm9kUrdiAkWwkHkuAsbMclBOA6Q1XBgoYlDI7CDb94LW6aI6HX/6hUH23p jTuCj4aToJl2Bl2fydf0xFOP8tB2f5vb1eC5HAD+e/KKpjC2JHPyOHizgCrk/WK7JsEj3n m2NFyWjCDwKNqv9AfHdfMxx4ZG/wvHJrm2HXwD4WszO5mzCu0LhI8ntYq6L2YM6shQySAG olkbt4INwODOD4TWANsWPZhwhK3MWRLUPfVQCO4Rz8z3rE/ZiVcv2j5IXzUopu8pkP8Ww8 KMt542Jj87eQjqIgqKX7p3cxdkJcBjBDGscocP9ig52p14CRUFQaKv9Rbe6GMQ== 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=1702666652; 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=r4QJxL0Dk4sYp0shFpOramRQ4DvUkWMFUyOR/Nyae/M=; b=aLsyuFznpleAo9sB/Ruh3pI/YEtUhwYxX+W5c/Fyv4kzDJhu4EoYPQuD1AXQWGWHrbY/eP MCc0PMTPhzgR+bKLcJZmC0UsfZLnJIzPn0vUbFBHGP9NALpRz0vUZNDCiNkx2M8s/F9wSw SwFj5mQcbfklNOwK1v3NbwBEimqbuRZ3Ppd03IGZ+DWTurqV4BFq491PV/SLahm26hAnPR DJahlT8QBBe0KEAnfcXCMKLqzFVhOV906kSoc2vFDGnIfigiTgL759wwquGSrFafSV2cEn a84Cd3zweDhSqUkulC7J5+ZKEm4Y2u3tvctMGYoRWIZGuzZbOjg3VBmTVIzKdw== 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 4SsJPS5GZxz7Ps; Fri, 15 Dec 2023 18:57:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BFIvWpB018398; Fri, 15 Dec 2023 18:57:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BFIvWMM018395; Fri, 15 Dec 2023 18:57:32 GMT (envelope-from git) Date: Fri, 15 Dec 2023 18:57:32 GMT Message-Id: <202312151857.3BFIvWMM018395@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: 663424957d80 - stable/13 - lockf: allow locking file descriptors 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 663424957d8079d514d127ac8c2fb65b247960be Auto-Submitted: auto-generated The branch stable/13 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=663424957d8079d514d127ac8c2fb65b247960be commit 663424957d8079d514d127ac8c2fb65b247960be Author: Kyle Evans AuthorDate: 2023-11-22 07:46:14 +0000 Commit: Kyle Evans CommitDate: 2023-12-15 00:59:25 +0000 lockf: allow locking file descriptors This is most useful inside a shell script, allowing one to lock just portions of a script rather than having to wrap the entire script in a lock. PR: 262738 Reviewed by: 0mp, allanjude (both previous versions) Co-authored-by: Daniel O'Connor Sponsored by: Klara, Inc. (cherry picked from commit 09a7fe0a5523d53ff6c26ddef9a947f293e18c22) --- usr.bin/lockf/lockf.1 | 63 ++++++++++++++++++- usr.bin/lockf/lockf.c | 128 +++++++++++++++++++++++++++++++++----- usr.bin/lockf/tests/lockf_test.sh | 91 +++++++++++++++++++++++++++ 3 files changed, 266 insertions(+), 16 deletions(-) diff --git a/usr.bin/lockf/lockf.1 b/usr.bin/lockf/lockf.1 index 8120b2ed7630..d73033101632 100644 --- a/usr.bin/lockf/lockf.1 +++ b/usr.bin/lockf/lockf.1 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd August 26, 2020 +.Dd November 25, 2023 .Dt LOCKF 1 .Os .Sh NAME @@ -35,6 +35,10 @@ .Ar file .Ar command .Op Ar arguments +.Nm +.Op Fl s +.Op Fl t Ar seconds +.Ar fd .Sh DESCRIPTION The .Nm @@ -64,6 +68,27 @@ the mere existence of the .Ar file is not considered to constitute a lock. .Pp +.Nm +may also be used to operate on a file descriptor instead of a file. +If no +.Ar command +is supplied, then +.Ar fd +must be a file descriptor. +The version with a +.Ar command +may also be used with a file descriptor by supplying it as a path +.Pa /dev/fd/N , +where N is the desired file descriptor. +The +.Fl k +option is implied when a file descriptor is in use, and the +.Fl n +and +.Fl w +options are silently ignored. +This can be used to lock inside a shell script. +.Pp If the .Nm utility is being used to facilitate concurrency between a number @@ -186,6 +211,42 @@ $ lockf mylock sleep 1 & lockf -t 5 mylock echo "Success" Success [1]+ Done lockf mylock sleep 1 .Ed +Lock a file and run a script, return immediately if the lock is not +available. Do not delete the file afterward so lock order is +guaranteed. +.Pp +.Dl $ lockf -t 0 -k /tmp/my.lock myscript +.Pp +Protect a section of a shell script with a lock, wait up to 5 seconds +for it to become available. +Note that the shell script has opened the lock file +.Fa /tmp/my.lock , +and +.Nm +is performing the lock call exclusively via the passed in file descriptor (9). +In this case +.Fl k +is implied, and +.Fl w +has no effect because the file has already been opened by the shell. +This example assumes that +.Ql > +is implemented in the shell by opening and truncating +.Pa /tmp/my.lock , +rather than by replacing the lock file. +.Bd -literal -offset indent +( + lockf -s -t 5 9 + if [ $? -ne 0 ]; then + echo "Failed to obtain lock" + exit 1 + fi + + echo Start + # Do some stuff + echo End +) 9>/tmp/my.lock +.Ed .Sh SEE ALSO .Xr flock 2 , .Xr lockf 3 , diff --git a/usr.bin/lockf/lockf.c b/usr.bin/lockf/lockf.c index 1149128021e6..49a4752a967d 100644 --- a/usr.bin/lockf/lockf.c +++ b/usr.bin/lockf/lockf.c @@ -29,16 +29,26 @@ #include #include +#include #include #include #include +#include #include #include #include +#include #include #include -static int acquire_lock(const char *name, int flags, int silent); +#define FDLOCK_PREFIX "/dev/fd/" + +union lock_subject { + long subj_fd; + const char *subj_name; +}; + +static int acquire_lock(union lock_subject *subj, int flags, int silent); static void cleanup(void); static void killed(int sig); static void timeout(int sig); @@ -48,8 +58,34 @@ static void wait_for_lock(const char *name); static const char *lockname; static int lockfd = -1; static int keep; +static int fdlock; static volatile sig_atomic_t timed_out; +/* + * Check if fdlock is implied by the given `lockname`. We'll write the fd that + * is represented by it out to ofd, and the caller is expected to do any + * necessary validation on it. + */ +static int +fdlock_implied(const char *name, long *ofd) +{ + char *endp; + long fd; + + if (strncmp(name, FDLOCK_PREFIX, sizeof(FDLOCK_PREFIX) - 1) != 0) + return (0); + + /* Skip past the prefix. */ + name += sizeof(FDLOCK_PREFIX) - 1; + errno = 0; + fd = strtol(name, &endp, 10); + if (errno != 0 || *endp != '\0') + return (0); + + *ofd = fd; + return (1); +} + /* * Execute an arbitrary command while holding a file lock. */ @@ -58,6 +94,7 @@ main(int argc, char **argv) { int ch, flags, silent, status, waitsec; pid_t child; + union lock_subject subj; silent = keep = 0; flags = O_CREAT | O_RDONLY; @@ -89,11 +126,54 @@ main(int argc, char **argv) usage(); } } - if (argc - optind < 2) - usage(); - lockname = argv[optind++]; + argc -= optind; argv += optind; + + if (argc == 0) + usage(); + + lockname = argv[0]; + + argc--; + argv++; + + /* + * If there aren't any arguments left, then we must be in fdlock mode. + */ + if (argc == 0 && *lockname != '/') { + fdlock = 1; + subj.subj_fd = -1; + } else { + fdlock = fdlock_implied(lockname, &subj.subj_fd); + if (argc == 0 && !fdlock) { + fprintf(stderr, "Expected fd, got '%s'\n", lockname); + usage(); + } + } + + if (fdlock) { + if (subj.subj_fd < 0) { + char *endp; + + errno = 0; + subj.subj_fd = strtol(lockname, &endp, 10); + if (errno != 0 || *endp != '\0') { + fprintf(stderr, "Expected fd, got '%s'\n", + lockname); + usage(); + } + } + + if (subj.subj_fd < 0 || subj.subj_fd > INT_MAX) { + fprintf(stderr, "fd '%ld' out of range\n", + subj.subj_fd); + usage(); + } + } else { + subj.subj_name = lockname; + } + if (waitsec > 0) { /* Set up a timeout. */ struct sigaction act; @@ -125,13 +205,13 @@ main(int argc, char **argv) * avoiding the separate step of waiting for the lock. This * yields fairness and improved performance. */ - lockfd = acquire_lock(lockname, flags | O_NONBLOCK, silent); + lockfd = acquire_lock(&subj, flags | O_NONBLOCK, silent); while (lockfd == -1 && !timed_out && waitsec != 0) { - if (keep) - lockfd = acquire_lock(lockname, flags, silent); + if (keep || fdlock) + lockfd = acquire_lock(&subj, flags, silent); else { wait_for_lock(lockname); - lockfd = acquire_lock(lockname, flags | O_NONBLOCK, + lockfd = acquire_lock(&subj, flags | O_NONBLOCK, silent); } } @@ -142,7 +222,15 @@ main(int argc, char **argv) exit(EX_TEMPFAIL); errx(EX_TEMPFAIL, "%s: already locked", lockname); } + /* At this point, we own the lock. */ + + /* Nothing else to do for FD lock, just exit */ + if (argc == 0) { + assert(fdlock); + return 0; + } + if (atexit(cleanup) == -1) err(EX_OSERR, "atexit failed"); if ((child = fork()) == -1) @@ -166,25 +254,34 @@ main(int argc, char **argv) } /* - * Try to acquire a lock on the given file, creating the file if + * Try to acquire a lock on the given file/fd, creating the file if * necessary. The flags argument is O_NONBLOCK or 0, depending on * whether we should wait for the lock. Returns an open file descriptor * on success, or -1 on failure. */ static int -acquire_lock(const char *name, int flags, int silent) +acquire_lock(union lock_subject *subj, int flags, int silent) { int fd; - if ((fd = open(name, O_EXLOCK|flags, 0666)) == -1) { + if (fdlock) { + assert(subj->subj_fd >= 0 && subj->subj_fd <= INT_MAX); + fd = (int)subj->subj_fd; + + if (flock(fd, LOCK_EX | LOCK_NB) == -1) { + if (errno == EAGAIN || errno == EINTR) + return (-1); + err(EX_CANTCREAT, "cannot lock fd %d", fd); + } + } else if ((fd = open(subj->subj_name, O_EXLOCK|flags, 0666)) == -1) { if (errno == EAGAIN || errno == EINTR) return (-1); else if (errno == ENOENT && (flags & O_CREAT) == 0) { if (!silent) - warn("%s", name); + warn("%s", subj->subj_name); exit(EX_UNAVAILABLE); } - err(EX_CANTCREAT, "cannot open %s", name); + err(EX_CANTCREAT, "cannot open %s", subj->subj_name); } return (fd); } @@ -196,7 +293,7 @@ static void cleanup(void) { - if (keep) + if (keep || fdlock) flock(lockfd, LOCK_UN); else unlink(lockname); @@ -231,7 +328,8 @@ usage(void) { fprintf(stderr, - "usage: lockf [-knsw] [-t seconds] file command [arguments]\n"); + "usage: lockf [-knsw] [-t seconds] file command [arguments]\n" + " lockf [-s] [-t seconds] fd\n"); exit(EX_USAGE); } diff --git a/usr.bin/lockf/tests/lockf_test.sh b/usr.bin/lockf/tests/lockf_test.sh index 8696ab82a996..cc6938d2306e 100644 --- a/usr.bin/lockf/tests/lockf_test.sh +++ b/usr.bin/lockf/tests/lockf_test.sh @@ -60,6 +60,96 @@ basic_body() atf_check test ! -e "testlock" } +atf_test_case fdlock +fdlock_body() +{ + # First, make sure we don't get a false positive -- existing uses with + # numeric filenames shouldn't switch to being fdlocks automatically. + atf_check lockf -k "9" sleep 0 + atf_check test -e "9" + rm "9" + + subexit_lockfail=1 + subexit_created=2 + subexit_lockok=3 + subexit_concurrent=4 + ( + lockf -s -t 0 9 + if [ $? -ne 0 ]; then + exit "$subexit_lockfail" + fi + + if [ -e "9" ]; then + exit "$subexit_created" + fi + ) 9> "testlock1" + rc=$? + + atf_check test "$rc" -eq 0 + + sub_delay=5 + + # But is it actually locking? Child 1 will acquire the lock and then + # signal that it's ok for the second child to try. The second child + # will try to acquire the lock and fail immediately, signal that it + # tried, then try again with an indefinite timeout. On that one, we'll + # just check how long we ended up waiting -- it should be at least + # $sub_delay. + ( + lockf -s -t 0 /dev/fd/9 + if [ $? -ne 0 ]; then + exit "$subexit_lockfail" + fi + + # Signal + touch ".lock_acquired" + + while [ ! -e ".lock_attempted" ]; do + sleep 0.5 + done + + sleep "$sub_delay" + + if [ -e ".lock_acquired_again" ]; then + exit "$subexit_concurrent" + fi + ) 9> "testlock2" & + lpid1=$! + + ( + while [ ! -e ".lock_acquired" ]; do + sleep 0.5 + done + + # Got the signal, try + lockf -s -t 0 9 + if [ $? -ne "${EX_TEMPFAIL}" ]; then + exit "$subexit_lockok" + fi + + touch ".lock_attempted" + start=$(date +"%s") + lockf -s 9 + touch ".lock_acquired_again" + now=$(date +"%s") + elapsed=$((now - start)) + + if [ "$elapsed" -lt "$sub_delay" ]; then + exit "$subexit_concurrent" + fi + ) 9> "testlock2" & + lpid2=$! + + wait "$lpid1" + status1=$? + + wait "$lpid2" + status2=$? + + atf_check test "$status1" -eq 0 + atf_check test "$status2" -eq 0 +} + atf_test_case keep keep_body() { @@ -141,6 +231,7 @@ atf_init_test_cases() { atf_add_test_case badargs atf_add_test_case basic + atf_add_test_case fdlock atf_add_test_case keep atf_add_test_case needfile atf_add_test_case timeout From nobody Fri Dec 15 18:57:33 2023 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 4SsJPV0rzmz53wnH; Fri, 15 Dec 2023 18:57:34 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SsJPV0Nq4z3MJP; Fri, 15 Dec 2023 18:57:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702666654; 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=zd/hM+fWjTE6/+AXplPIHUQnJ0oVS0fulgI88qWSELo=; b=mTq71kzQHY7YjohqFX8aKyx4B5fHqMVNKM2PMyNHpL2GptrUIERbDdeRRcJlgha7Qt+Dpu TokzUFQPiWg3qnh9vIE73IFs+OjExU+e5lNpiX1FfXxL8Bpyy2UwnYdktNAIwO7jl8kHLf PnL/v6y5KhLdS2afem9JbdmqBft5YTTA8Ig3n7EUXrMk8kw/m8cpiNP7BnEevCe9HWL9hb ljYiVcCrHkApo5kmr2fWHXWTNDcPX3xCEsmXrQ3vGiWjWTXaNZ5fnKtuPziWWXS4GaPxuq Oyn1nwq0m4JBSSXK2at59+dwtl/ACm3t91QRnZg1rQhUOqgZlz1OJt8Faz5QUQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702666654; a=rsa-sha256; cv=none; b=ZENW8weYnwfUgCafQlqJbLBUuBKPBSG0goI84KcsZsDRlbBZjOi4Sj288UoxOdCUbXmQTL Fwdgu+iRXQ8AJKuyp2SPq3CutgBcHfyGZvroK0r+tbult6cOoJPHiLpEfK/t7Jj4f9jdFL oeTbrScXVduThw8gipLkcEMKK/PPyywWhaJjpVcjP29MU+9ftDeZUgzYOwJi6CZ12+SKqP 5m5TDad2zbLdE8rrt88aZl6FtHJpqFMsWwgxe+vV1tGtjRbkrpS8S6zhIkgJEYKjyxhIXL hqC0u4RNZacwQMLTxw4lHPI7SxyQ7/60qWqTd5z+UMdN+au7fKSwXJfoIBkHBw== 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=1702666654; 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=zd/hM+fWjTE6/+AXplPIHUQnJ0oVS0fulgI88qWSELo=; b=tHnQoohCPwxD60VHbQylZ/ZI0MVS+X+BmKigCkYb+ls9Yi/WRIUFnoYideyaYWcwhnQMW2 sBv/eSAiBLInPceb2rNQwdMyX3wZCgrEYwX3WazMKb1LKlBs7NKfR/0KVe4W6b2yQD6Mlf zj9cPVkC44mO571bZtISu+axxR5vUsdxm4hXv0PL0dteUhsHch24LTad2Xkquyx5WNAQNl aR5sUbn8sfpdEvpgkN/LBleQVoAOcbyEBJ9VcR9BGAfJPkFpjOJJQ0zzZx+VXkyHp3UCso bGz5K5sTvNj+ld1/9d0N2rwg0UK7pfQIC+GbNe9Tf5uIDQWD9MLtJw2Ns+C07A== 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 4SsJPT6JFWz7JD; Fri, 15 Dec 2023 18:57:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BFIvXrc018449; Fri, 15 Dec 2023 18:57:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BFIvXA0018446; Fri, 15 Dec 2023 18:57:33 GMT (envelope-from git) Date: Fri, 15 Dec 2023 18:57:33 GMT Message-Id: <202312151857.3BFIvXA0018446@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: feafc7d0bc74 - stable/13 - lockf: switch to strtonum() for parsing timeout 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: feafc7d0bc74bdf8506e592590c2e7e48e543a96 Auto-Submitted: auto-generated The branch stable/13 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=feafc7d0bc74bdf8506e592590c2e7e48e543a96 commit feafc7d0bc74bdf8506e592590c2e7e48e543a96 Author: Kyle Evans AuthorDate: 2023-11-26 04:27:11 +0000 Commit: Kyle Evans CommitDate: 2023-12-15 00:59:27 +0000 lockf: switch to strtonum() for parsing timeout Convert waitsec to a long long to be able to hold the full domain of alarm(3) timeout on all platforms, and let strtonum(3) handle the input validation. strtonum(3) also happens to provide a neater interface for error handling, and it already includes our pre-existing empty input check. Sponsored by: Klara, Inc. (cherry picked from commit e4967d4d48b0a7d873e4f778c0a6e560e09d4dc3) --- usr.bin/lockf/lockf.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/usr.bin/lockf/lockf.c b/usr.bin/lockf/lockf.c index 49a4752a967d..f459b54060aa 100644 --- a/usr.bin/lockf/lockf.c +++ b/usr.bin/lockf/lockf.c @@ -92,7 +92,8 @@ fdlock_implied(const char *name, long *ofd) int main(int argc, char **argv) { - int ch, flags, silent, status, waitsec; + int ch, flags, silent, status; + long long waitsec; pid_t child; union lock_subject subj; @@ -112,9 +113,10 @@ main(int argc, char **argv) break; case 't': { - char *endptr; - waitsec = strtol(optarg, &endptr, 0); - if (*optarg == '\0' || *endptr != '\0' || waitsec < 0) + const char *errstr; + + waitsec = strtonum(optarg, 0, UINT_MAX, &errstr); + if (errstr != NULL) errx(EX_USAGE, "invalid timeout \"%s\"", optarg); } @@ -181,7 +183,7 @@ main(int argc, char **argv) sigemptyset(&act.sa_mask); act.sa_flags = 0; /* Note that we do not set SA_RESTART. */ sigaction(SIGALRM, &act, NULL); - alarm(waitsec); + alarm((unsigned int)waitsec); } /* * If the "-k" option is not given, then we must not block when From nobody Fri Dec 15 18:57:34 2023 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 4SsJPW1s9hz53wqS; Fri, 15 Dec 2023 18:57:35 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SsJPW0sDnz3MJl; Fri, 15 Dec 2023 18:57:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702666655; 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=GGi/F2vbxbX3+dEmCs99RvGQTMNWgk4ffT2HgWBdeWw=; b=TjMNPmO81zGZr+UJt5zi/1xhsYWClnJ2CB1clLe2tenCQY/mi5+M8oHDgisPbYE0elPTLj zY80Db122XhyrB+HDRAUKyb2Dz0ZodKHJGyeZ3M9gGzij0RNnrmNxCGrv1vXQvgZZHrLoz x8iWOnhuTff5lJftNnOCg6X22yqR78CTv/XtEj3rjmaYjXm8hk8VICHSodPwkTGc122UJb u/sXhh7IqSnk5v7CBCfmjo0Le5wjV6Z+/w2vNkoP5D63jI59nNyMCOPNHiCvgcYNx7ySui b+5BUiKUfRCgBX4qb/9vQF9l0g++l/FQ68xNLu1eiF/CZz8+8fUrUGPWhriQJg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702666655; a=rsa-sha256; cv=none; b=u/Vr3Zj1RsUsa00Iu9dB7a5n6nLsQm17e9QNKfMPMgs7Bwy98dyDrhTRxE/nLW4MV2NEFu CKJOl4tErrDlk2GCaSTokVfzrkViyzlA3e0NYE5z8Sdp28U996nec5exbCDRtEl5DQDSFU A+4fSe1UsrCSLuTqf6jypEoqoDWFp7t+vi02ZoWgb7HK/FKhC3jKbq0SOez2Tq7W5rSu0C nFvHE81Sa0YsaSXqg+9tAV4zUBfw83EYON3xpwPExkuM3bmpU9uPu6Tn28DZRYQhyHM3q4 hl49y5b/aZzqreWRA9UAi/VupyZJK2o93ANrReuZiNeWsvthWIM0ugLc8VeyMQ== 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=1702666655; 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=GGi/F2vbxbX3+dEmCs99RvGQTMNWgk4ffT2HgWBdeWw=; b=rHn9o1s8MNTLi3XAabuXUM/5r3hgzVpmjvDDCGHXxxisFfKzLYHAYpqEWK6GDPn8HyZjc+ MXIFI+Jkz04M00QMJcizAuJ5hIuUIjCkl1f257APMhp6xLXPrO6oN5l9yEMBMPYYK3e8Lo pnv3nVEyM8IN6lw/XqVd7U9Emb808IaM1StsqO9VI/eh1SLctJB0iSVyuKca/PIO2Z2GnO s7yuH79CrdxwaA/SSOSxHG5lKosF/nhOETaeYRj4JHsRlCFx++DvNykDH3oXGMGc4eLBkt oyEjT5vPYR6S15dNJDHMMSHLd251n2w3RpqVdeH1H2swI6qkrbCkcjezelwebA== 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 4SsJPV74Gnz7cn; Fri, 15 Dec 2023 18:57:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BFIvYOF018494; Fri, 15 Dec 2023 18:57:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BFIvYIM018491; Fri, 15 Dec 2023 18:57:34 GMT (envelope-from git) Date: Fri, 15 Dec 2023 18:57:34 GMT Message-Id: <202312151857.3BFIvYIM018491@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: 9986fd59d855 - stable/13 - rtld: add a test for RTLD_DEEPBIND 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 9986fd59d855234cbb999b2a4099ad3cd094aa49 Auto-Submitted: auto-generated The branch stable/13 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=9986fd59d855234cbb999b2a4099ad3cd094aa49 commit 9986fd59d855234cbb999b2a4099ad3cd094aa49 Author: Kyle Evans AuthorDate: 2023-12-01 01:26:09 +0000 Commit: Kyle Evans CommitDate: 2023-12-15 16:56:59 +0000 rtld: add a test for RTLD_DEEPBIND This tests that with RTLD_DEEPBIND, symbols are looked up in all of the object's needed objects before the global object. ATF_REQUIRE_INTEQ was added after stable/13 branched, so we shim it out here. PR: 275393 Reviewed by: kib Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. (cherry picked from commit d9c543b6b0cabea6e6679d70b4e701018e7eab80) --- etc/mtree/BSD.tests.dist | 2 + libexec/rtld-elf/tests/Makefile | 5 +- libexec/rtld-elf/tests/Makefile.inc | 3 + libexec/rtld-elf/tests/libdeep/Makefile | 15 +++++ libexec/rtld-elf/tests/libdeep/libdeep.c | 28 +++++++++ libexec/rtld-elf/tests/libval/Makefile | 10 +++ libexec/rtld-elf/tests/libval/libval.c | 26 ++++++++ libexec/rtld-elf/tests/libval2/Makefile | 8 +++ libexec/rtld-elf/tests/rtld_deepbind/Makefile | 10 +++ .../rtld-elf/tests/rtld_deepbind/rtld_deepbind.c | 72 ++++++++++++++++++++++ libexec/rtld-elf/tests/target/Makefile | 2 +- 11 files changed, 179 insertions(+), 2 deletions(-) diff --git a/etc/mtree/BSD.tests.dist b/etc/mtree/BSD.tests.dist index f9a551bbc39b..5714d873cb3b 100644 --- a/etc/mtree/BSD.tests.dist +++ b/etc/mtree/BSD.tests.dist @@ -432,6 +432,8 @@ rc .. rtld-elf + rtld_deepbind + .. .. tftpd .. diff --git a/libexec/rtld-elf/tests/Makefile b/libexec/rtld-elf/tests/Makefile index 7eacfb899699..06e143a441a1 100644 --- a/libexec/rtld-elf/tests/Makefile +++ b/libexec/rtld-elf/tests/Makefile @@ -1,6 +1,9 @@ -SUBDIR+= libpythagoras target +SUBDIR+= libpythagoras libdeep libval libval2 target +TESTS_SUBDIRS+= rtld_deepbind +SUBDIR_DEPEND_libdeep= libval2 +SUBDIR_DEPEND_rtld_deepbind= libval SUBDIR_DEPEND_target= libpythagoras ATF_TESTS_C= ld_library_pathfds diff --git a/libexec/rtld-elf/tests/Makefile.inc b/libexec/rtld-elf/tests/Makefile.inc new file mode 100644 index 000000000000..dfba72a51ce7 --- /dev/null +++ b/libexec/rtld-elf/tests/Makefile.inc @@ -0,0 +1,3 @@ + +PACKAGE?= tests +TESTSDIR?= ${TESTSBASE}/libexec/rtld-elf diff --git a/libexec/rtld-elf/tests/libdeep/Makefile b/libexec/rtld-elf/tests/libdeep/Makefile new file mode 100644 index 000000000000..9324b6f25efe --- /dev/null +++ b/libexec/rtld-elf/tests/libdeep/Makefile @@ -0,0 +1,15 @@ + +SHLIB?= deep +SHLIB_MAJOR= 0 + +LIBDIR= ${TESTSBASE}/libexec/rtld-elf/rtld_deepbind +SHLIBDIR= ${TESTSBASE}/libexec/rtld-elf/rtld_deepbind + +SRCS= libdeep.c + +LIBVAL2= ${.OBJDIR}/../libval2 +LDFLAGS+= -L${LIBVAL2} -Wl,-rpath,'$$ORIGIN' +DPADD+= -lval2 +LDADD+= -lval2 + +.include diff --git a/libexec/rtld-elf/tests/libdeep/libdeep.c b/libexec/rtld-elf/tests/libdeep/libdeep.c new file mode 100644 index 000000000000..e570769300cf --- /dev/null +++ b/libexec/rtld-elf/tests/libdeep/libdeep.c @@ -0,0 +1,28 @@ +/*- + * + * Copyright (C) 2023 NetApp, Inc. + * + * SPDX-License-Identifier: BSD-2-Clause + * + */ + +#include + +int get_value(void); +int proxy_get_value(void); +void set_value(int); +void proxy_set_value(int); + +int +proxy_get_value(void) +{ + + return (get_value()); +} + +void +proxy_set_value(int val) +{ + + return (set_value(val)); +} diff --git a/libexec/rtld-elf/tests/libval/Makefile b/libexec/rtld-elf/tests/libval/Makefile new file mode 100644 index 000000000000..66728c01dc9b --- /dev/null +++ b/libexec/rtld-elf/tests/libval/Makefile @@ -0,0 +1,10 @@ + +SHLIB?= val +SHLIB_MAJOR= 0 + +LIBDIR= ${TESTSBASE}/libexec/rtld-elf/rtld_deepbind +SHLIBDIR= ${TESTSBASE}/libexec/rtld-elf/rtld_deepbind + +SRCS= libval.c + +.include diff --git a/libexec/rtld-elf/tests/libval/libval.c b/libexec/rtld-elf/tests/libval/libval.c new file mode 100644 index 000000000000..97c97a0310a7 --- /dev/null +++ b/libexec/rtld-elf/tests/libval/libval.c @@ -0,0 +1,26 @@ +/*- + * + * Copyright (C) 2023 NetApp, Inc. + * + * SPDX-License-Identifier: BSD-2-Clause + * + */ + +static int val; + +int get_value(void); +void set_value(int); + +int +get_value(void) +{ + + return (val); +} + +void +set_value(int nval) +{ + + val = nval; +} diff --git a/libexec/rtld-elf/tests/libval2/Makefile b/libexec/rtld-elf/tests/libval2/Makefile new file mode 100644 index 000000000000..2b5cf5342092 --- /dev/null +++ b/libexec/rtld-elf/tests/libval2/Makefile @@ -0,0 +1,8 @@ + +LIBVAL= ${.CURDIR}/../libval + +# Just rebuild libval +.PATH: ${LIBVAL:tA} +SHLIB?= val2 + +.include "${LIBVAL}/Makefile" diff --git a/libexec/rtld-elf/tests/rtld_deepbind/Makefile b/libexec/rtld-elf/tests/rtld_deepbind/Makefile new file mode 100644 index 000000000000..bcc55d945c7e --- /dev/null +++ b/libexec/rtld-elf/tests/rtld_deepbind/Makefile @@ -0,0 +1,10 @@ + +TESTSDIR?= ${TESTSBASE}/libexec/rtld-elf/rtld_deepbind +ATF_TESTS_C= rtld_deepbind + +LIBVAL= ${.OBJDIR}/../libval +LDFLAGS.rtld_deepbind+= -L${LIBVAL} -Wl,-rpath,'$$ORIGIN' +DPADD+= -lval +LDADD+= -lval + +.include diff --git a/libexec/rtld-elf/tests/rtld_deepbind/rtld_deepbind.c b/libexec/rtld-elf/tests/rtld_deepbind/rtld_deepbind.c new file mode 100644 index 000000000000..30f71331bc62 --- /dev/null +++ b/libexec/rtld-elf/tests/rtld_deepbind/rtld_deepbind.c @@ -0,0 +1,72 @@ +/*- + * + * Copyright (C) 2023 NetApp, Inc. + * + * SPDX-License-Identifier: BSD-2-Clause + * + */ + +#include + +#include + +int get_value(void); +void set_value(int); + +#define APP_VALUE 5 +#define LIB_VALUE 20 + +#ifndef ATF_REQUIRE_INTEQ +/* atf-c/macros.h */ +#define ATF_REQUIRE_INTEQ(expected, actual) \ + ATF_REQUIRE_MSG((expected) == (actual), "%s != %s (%jd != %jd)", #expected, \ + #actual, (intmax_t)(expected), (intmax_t)(actual)) +#endif + +ATF_TC_WITHOUT_HEAD(deepbind_simple); +ATF_TC_BODY(deepbind_simple, tc) +{ + void *hdl; + void (*proxy_set_value)(int); + int (*proxy_get_value)(void); + int app_value, lib_value; + + set_value(APP_VALUE); + + /* + * libdeep has a dependency on libval2.so, which is a rebuild of + * libval.so that provides get_value() and set_value() for both us and + * the lib. The lib's get_value() and set_value() should bind to the + * versions in libval2 instead of libval with RTLD_DEEPBIND. + */ + hdl = dlopen("$ORIGIN/libdeep.so", RTLD_LAZY | RTLD_DEEPBIND); + ATF_REQUIRE(hdl != NULL); + + proxy_set_value = dlsym(hdl, "proxy_set_value"); + ATF_REQUIRE(proxy_set_value != NULL); + + proxy_get_value = dlsym(hdl, "proxy_get_value"); + ATF_REQUIRE(proxy_get_value != NULL); + + (*proxy_set_value)(LIB_VALUE); + + lib_value = (*proxy_get_value)(); + app_value = get_value(); + + /* + * In the initial implementation or if libdeep.so is *not* linked + * against its own libval2, then these both return the later set + * LIB_VALUE (20) as they bind to the symbol provided by libval and + * use its .bss val. + */ + ATF_REQUIRE_INTEQ(lib_value, LIB_VALUE); + ATF_REQUIRE_INTEQ(app_value, APP_VALUE); +} + +ATF_TP_ADD_TCS(tp) +{ + + ATF_TP_ADD_TC(tp, deepbind_simple); + + return atf_no_error(); +} diff --git a/libexec/rtld-elf/tests/target/Makefile b/libexec/rtld-elf/tests/target/Makefile index f63d8072ae3c..aa4875b6748d 100644 --- a/libexec/rtld-elf/tests/target/Makefile +++ b/libexec/rtld-elf/tests/target/Makefile @@ -2,7 +2,7 @@ .include PROG= target -BINDIR= ${TESTSBASE}/libexec/rtld-elf +BINDIR= ${TESTSDIR} WARNS?= 3 CFLAGS+= -I${.CURDIR}/../libpythagoras From nobody Sat Dec 16 01:00:45 2023 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 4SsSSZ0GB7z54LD8; Sat, 16 Dec 2023 01:00:46 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SsSSY6y14z4M3Q; Sat, 16 Dec 2023 01:00:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702688446; 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=h9eDRQ7NbyDM25lu86Xcq33Oqt23yYI2XPccvAmqndo=; b=j8ISOFkHizK04F8y2PxSRjAs2obinIQiVvyzZSzJamARY/mg67L7Z4nuhNc6AkKnvaNJXa ire7c5h3Nm34pWw1vgaskPdf5YRluwELNZ42yz4xpVD1IFHE5TE019oGEAu5qxSIfH66Lz jAJ6lt7QrH1kXBAhYl3TW/r4cQqWkEGTM3I4jXFhZT0iB9vi2rd1SSFh4WQeV85PrE7TWt lkiTk8za1+yxXVGyKW7AXF3/1qzYYLeQwesR1pqO0Qxlnss3U8LyIF1IfwefC+1r/7Vmv2 B0cVHwW9F4yz4ZTIDax9ISvjGPRN93zSob3oi1qHdM5GFjV1PU7LFWMpixUFrw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702688446; a=rsa-sha256; cv=none; b=iBRxGBruVjz0sLGHODGl+vcuUH/LKfUj7M+eodvf1re7AhWAX3OP/EIQ3eKi2pSFdbuZGL 0UaPTBG5bDBtdOsptgI8xjvxKxIKeuSny7QbELbIABqK47Iyj1o20s9npaWTgcAp+WOJQP CV60L93rTejEDzjxapK1lY2uyeoK4CT+5pp1lr7Z5O/fNX+jM8fVAhXALbIPHIrxKv60Yb WFw8m0gnx/nvSKq0lNLoxpCvDbfADFAAJYtRGvYrDroHwURxV+TtdxJQ3AozWSdVpU8Xxj ZvJmbuPT7a8cvb9TfncJ4FJ+n/oFQ1cI/e77AUJw4YbQ1JK1gg2HUcOB2KfDLg== 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=1702688446; 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=h9eDRQ7NbyDM25lu86Xcq33Oqt23yYI2XPccvAmqndo=; b=GulP/6bFy+7EiDDdvd0euLOE8tNlQ2g1WL8HHGesahrMMkv7jChwJqxL4WjRT2dmjZqL9i PTd68gl8WLcG6MSfz+i2sP04h8F75nUIzBHHTPdUvwe8UcDNHbDTHe/Ouwp7Z4fgJWgoof +eKfLr6Z7tdXrftpoOysZNZFzljlp2Wyfr9TTBg5cJHSG41DRXRe02J0lrrhHc9B65bRm1 kknmWvkPjIbwLy6QlypUhvXe9lkNCIkRhfnJSPGz8pdUh74Q4z0v2gWG5arHxo2DDZ4czR JrHQNzcmorMnxWSIwnqDwzKYfkX5zRjemnQkHKPOJZe6JSeJRFuX9RR7SDdZVw== 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 4SsSSY63jtzYZr; Sat, 16 Dec 2023 01:00:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BG10jlp031637; Sat, 16 Dec 2023 01:00:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BG10jTD031634; Sat, 16 Dec 2023 01:00:45 GMT (envelope-from git) Date: Sat, 16 Dec 2023 01:00:45 GMT Message-Id: <202312160100.3BG10jTD031634@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 9fc9a302178e - stable/13 - git hooks: add "Tested by" to commit message template 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 9fc9a302178ea3f60f18e963236ae31a82e001db Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=9fc9a302178ea3f60f18e963236ae31a82e001db commit 9fc9a302178ea3f60f18e963236ae31a82e001db Author: Ed Maste AuthorDate: 2021-02-02 18:36:45 +0000 Commit: Ed Maste CommitDate: 2023-12-16 01:00:26 +0000 git hooks: add "Tested by" to commit message template Reported by: mjg Reviewed by: imp Sponsored by: The FreeBSD Foundation (cherry picked from commit 9d0f1092cf90c8bf161cb946584f703a9998f8cd) --- tools/tools/git/hooks/prepare-commit-msg | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/tools/git/hooks/prepare-commit-msg b/tools/tools/git/hooks/prepare-commit-msg index 0ebec48fd9a5..6a8db33649f0 100755 --- a/tools/tools/git/hooks/prepare-commit-msg +++ b/tools/tools/git/hooks/prepare-commit-msg @@ -45,6 +45,7 @@ $(awk '1;/^#$/{exit}' $1) # PR: # Reported by: # Reviewed by: +# Tested by: # Approved by: # Obtained from: # MFC after: From nobody Sat Dec 16 01:00:46 2023 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 4SsSSb1pYcz54LNg; Sat, 16 Dec 2023 01:00:47 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SsSSb10Grz4MS1; Sat, 16 Dec 2023 01:00:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702688447; 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=mhG0Wegs7AhnUXNMe9ZadwWITOOaHjJ5PKHRGeVNGSg=; b=V0wQ3rdWNiVcpOD/7xhOghzRo6UhGDGv99vZbIFiVnsSBenwzLwPwb+QPq2jzgxPqMEgpE z/QoLHvW9LT5r/Kd4vqX2dgv62VdUh10dXGseiP3w3yQCAVpM7xt4djQEg25zZcpN41JIL fGExRkJdVMhlCqsK75MSm6i8AvD6EVvtWzCR6UBTwhM2EDvBWpIN7NyX2hWnzcWNmS5Fa2 vdJ5tACbhQyzw25ynVdc0CgH8xglW8zKxVGNQaTrfFX7BCIHrbjdPloizy/XIFUtOafI7g o1MljTwzI8NkL4lUyCE750NqCVU+iiUUU6wIVkdnYERfe8ykJpms4BIHpFeHFQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702688447; a=rsa-sha256; cv=none; b=Wj50QhjxGZRrv3upSEKfBbiJSnoOliuMf0JGMwWFtmd0ii7HSvVl6hrVG8JAVc3jITXkrC uBj6GriFiMeRzkbvHRY5yBUNcuG3gF/DtnZjqZH9fDWOxP7uHIHP7GSCHyc8GZepoPOQlt 0yRZ/cG/ZL5U1MU5ZZt/TcR1pF0ZNpeHLV46WDamu2eaauWLEdGAZcziXrsJ+jjTwJ8rBS llQmMs/1R/E/iOjXKMgKe97Il4y/tJEXbNjv+pJ3U5yo4+oiuFdsjm+DZSjYXYHbgae7AT lFUPbCBlaTvxu/Fb+hGxwW0mGJmXg1THlnwtrxOLL15Gx4uJuBLiA/ZxsV3JKw== 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=1702688447; 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=mhG0Wegs7AhnUXNMe9ZadwWITOOaHjJ5PKHRGeVNGSg=; b=U0lbHfrutQOEZ1Min8DJlTjUULNz2AuA+VToPxKsQvmq+Uq2xSZCrR3t7TRgKYZc/w1CE9 rdrfAwcsujWQA7o2wUdQFnjIezyO6dJAJxBulHRCAtEHJ9dPEQn7II5gDx9B/nG23UoeB4 NYAibp8Vw0eJmp5jZAgsw+jj+cus7Vhey5ouzrzCVIEONo6lbhjTGKdF2St5lj/Qf9ymVI ZlsGrHNkEmgeMtwJPh2Jj7FFgCq8b6tgMCas/5W769o0fVdiIHRO32yfBP5caz3mpScsrD 3aDfpgp5Bs8rgrRBw3tlx0HQS2/8yZLDJK5mFxSp/x4Q1ALJY2ijCCa4kcxeiA== 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 4SsSSZ704MzYRw; Sat, 16 Dec 2023 01:00:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BG10kCE031691; Sat, 16 Dec 2023 01:00:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BG10knl031688; Sat, 16 Dec 2023 01:00:46 GMT (envelope-from git) Date: Sat, 16 Dec 2023 01:00:46 GMT Message-Id: <202312160100.3BG10knl031688@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 19f7fb2ec731 - stable/13 - git hooks: add "Fixes" trailer to commit message template 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 19f7fb2ec7316d37478c0e2d5dd345f2879f4c3c Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=19f7fb2ec7316d37478c0e2d5dd345f2879f4c3c commit 19f7fb2ec7316d37478c0e2d5dd345f2879f4c3c Author: Ed Maste AuthorDate: 2021-02-20 18:49:31 +0000 Commit: Ed Maste CommitDate: 2023-12-16 01:00:26 +0000 git hooks: add "Fixes" trailer to commit message template A number of projects use "Fixes: " to identify a commit that is fixed by a given change. Adopt that convention. Differential Revision: https://reviews.freebsd.org/D28693 (cherry picked from commit aa8ae5fe17eb380b0f30f1641f17a0b3d83a68c3) --- tools/tools/git/hooks/prepare-commit-msg | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/tools/git/hooks/prepare-commit-msg b/tools/tools/git/hooks/prepare-commit-msg index 6a8db33649f0..9d85b205d968 100755 --- a/tools/tools/git/hooks/prepare-commit-msg +++ b/tools/tools/git/hooks/prepare-commit-msg @@ -48,6 +48,7 @@ $(awk '1;/^#$/{exit}' $1) # Tested by: # Approved by: # Obtained from: +# Fixes: # MFC after: # MFH: # Relnotes: From nobody Sat Dec 16 02:32:34 2023 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 4SsVVV5p3yz54Qkf; Sat, 16 Dec 2023 02:32:34 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SsVVV4yXHz4XHk; Sat, 16 Dec 2023 02:32:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702693954; 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=3O5ovnna72f8mFE55qKGkt1/By67X+iFwC7fHFpo9Uw=; b=CATgGIVKPv/x8XirAhs2mwzR+tcXCESNjAve5AusnK2ot3kJjUnAx9C4Obs7ooPMmwoDG9 rNp4VnZbYRjJ4T+cyYZzO1/4I1LLPybfcuY2oylv7wOKdIvtYSJcxpLvWu4Ii9yYtT68bV nbkAyZloBmVjhsFxTg7rPRrv+vDBUQ+QKF4L5JvRe6jEEt2d4fSSay+DITURJTJC2mbi4A hi/xr/nAa8+iTUHLrovvKmLnnuhOX9yig/Xp7qK0nN1FiK2kYLFFzikxP3MM/CHfe0o+t5 rRV5ykFQYkb5VxqgWjetul2yFZ9XJQRcePUKC9+1Y0GoQTLyj1sdBMf77K1MCg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702693954; a=rsa-sha256; cv=none; b=aQPR14l6DZqjnUJl13/Marf/HpXQE5IWUv7GFSewQjk1rL9J47a/GT32Sqwekhx2kGIrA8 O2/tI6WLuaM3SGJYQxMxd7Bdu/5BIbaRe6FT+J+y/yD2kaFFVno96bhRBKWqpLd+CWxhOR 7ngiDBZMgddhoKErTPkgA0AcCBeUgIsU/qth0VK03UFoJfhM0Uqh/hhXK80/PJy4cC+FSB XszQv3vKLKwsMh8km9F+4jiYjxZ17Hus1YJklqA7aCbCv0pL2xOVgLoLLYpLljzLbizaxA NNoyV7yGj4cvFEsyCU6gfnPgHP6nvQJ+b4jAwuxcE2YVHTs6R+Oe+P0oJ3Y2kg== 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=1702693954; 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=3O5ovnna72f8mFE55qKGkt1/By67X+iFwC7fHFpo9Uw=; b=RmbAvbWAYFGtb8+NJmQ9pngVGmZd+XG7px7crreprjYQfIBgb9g+7Ku1oipZVCqcuzTxJK K52YDMDSYMrqi/gq6+gbfVXuBE46crCqWN5zB9TBywxlCmZBwjiK3CKatPyUeTo4bowlvZ MN6Q9/VJ5ufHMEACY8i6DVDzL/38tHWRnxJCTZJ7+zyqY/23rbSG6XgbZgDIwXcrNmemam ePPxDw0ShespvS/G+NQNRcAHF2+NgdBfgcr2czX1WPK4Jon/BtX6tWtuI1nxTM1UktPQjj S67JhwhuXb00R24umoa+vh2dtYXIMs6wni+H8/v67gP8qjIRvuKr6YwS7eR8dQ== 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 4SsVVV41BLzc19; Sat, 16 Dec 2023 02:32:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BG2WYG7087868; Sat, 16 Dec 2023 02:32:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BG2WYDA087865; Sat, 16 Dec 2023 02:32:34 GMT (envelope-from git) Date: Sat, 16 Dec 2023 02:32:34 GMT Message-Id: <202312160232.3BG2WYDA087865@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Philip Paeps Subject: git: 163c43423815 - stable/14 - rc.conf: correct $ntp_leapfile_sources 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: philip X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 163c4342381530cfc5dc78a457cb1f9e355d687a Auto-Submitted: auto-generated The branch stable/14 has been updated by philip: URL: https://cgit.FreeBSD.org/src/commit/?id=163c4342381530cfc5dc78a457cb1f9e355d687a commit 163c4342381530cfc5dc78a457cb1f9e355d687a Author: Philip Paeps AuthorDate: 2023-12-07 05:48:13 +0000 Commit: Philip Paeps CommitDate: 2023-12-16 02:31:41 +0000 rc.conf: correct $ntp_leapfile_sources IETF is no longer serving leap-seconds.list. Point at IANA instead. This fixes "service ntpd fetch". (cherry picked from commit b1c95af45488bef649e9a84890e2414ff80b3a00) --- libexec/rc/rc.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libexec/rc/rc.conf b/libexec/rc/rc.conf index f5d0605c8436..c92bb0135f4d 100644 --- a/libexec/rc/rc.conf +++ b/libexec/rc/rc.conf @@ -422,7 +422,7 @@ ntp_src_leapfile="/etc/ntp/leap-seconds" # Initial source for ntpd leapfile ntp_db_leapfile="/var/db/ntpd.leap-seconds.list" # Working copy (updated weekly) leapfile -ntp_leapfile_sources="https://www.ietf.org/timezones/data/leap-seconds.list" +ntp_leapfile_sources="https://data.iana.org/time-zones/tzdb/leap-seconds.list" # Source from which to fetch leapfile ntp_leapfile_fetch_opts="-mq" # Options to use for ntp leapfile fetch, # e.g. --no-verify-peer From nobody Sat Dec 16 02:34:20 2023 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 4SsVXY20bvz54Qhc; Sat, 16 Dec 2023 02:34:21 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SsVXY1KtMz4XYt; Sat, 16 Dec 2023 02:34:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702694061; 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=SXCunpzRnjOwiJEdUB/FNsKbu7kl3F/9/BggAVpaxtk=; b=AtpBbLfkr4xMsZk7f9fA42OKbHJN6Un5rFwv8/KTb6kRzpitp1JFF/1kXulPNPLVmZ+5T/ oKLwviVQehCMXml+qBQe80cq0NQ4o2hFMs0d02HrI9jRzzl9YAnks3hACs1x/zvE33MaBc B21S5hEZFXLKLm21EeNgdpVNseD/nZCJED/4rGvJOlgGEIrR+6lQBCoJI81sAk7DKz7tnD ktwBrwKcfWdcWAEJy4hskqJdi0OstT86BWkyQyyJL3vUFgqabOJ7oSnXvvQ9el/xGu3zXx jyBhK2wdqwfX/lyiBaB/UrlBoH4LRAwDFQ0+fseAsxlxjD0ics1l8rFsVotNDQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702694061; a=rsa-sha256; cv=none; b=YLTp5S8dz+M3cYygO164ZYvw7SFqBp/J3vB6/y9bmuOYeszgZGJnJXbu2nF3P4B6Rn5c1j s2uyroUA/S1LPa0xku1ic3qSPxucpAb3Sxq0d3AzQdUd71eS93n5Bl2C3bEl2ARjiwZHOW eH4loG2NDnSqRb0rINFGxxrqtPf8+4XrmbCdYIMRs78xTcFk28AJFtw5kqSnX9Qf7rxoyJ IXYVYrYEsUWbXOH2LXyW9MaqiXfZDoWvmxtk+RwSXhLUmBD92+OCZIU2mtAx4bKkgVogVa NTQJBxLAvJ//aPci9BOKyu5kECmknWmm53IZukrvkK2jYFU36mvuMXCLQIKtlQ== 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=1702694061; 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=SXCunpzRnjOwiJEdUB/FNsKbu7kl3F/9/BggAVpaxtk=; b=IoqsieKkuKjB4Y8rWgHKL55loe86VdhbdvIDLtAnxXYqJpuUi3lfB4S4EGXbfDb2W8gJeA 4DGPRVX8qvwChpluBYEFgjPDHlxHOVvHpbYc05763/Gi0fMk+jGZ6pDnQfiA+nICWx/cRH JU9VOsKG8FJwBsFKTjKeFurH0jJevTZOTUejnGlAN2vmdHzSamUKyWp8/Kn8Gc7lYAJUY5 dp8LGxj8fcj6tOJcCXMIeaE0V4pQ0iKb1D42yzbToWDE5UYNyzq4Um3mmqxozvKFbi97up h6qmi0ZinOnrv7qPnJwPRgZ2s5DSkzx0nA4ZFrH1Qn6K78DtSLVl7cifInKNyg== 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 4SsVXY0NSrzbH4; Sat, 16 Dec 2023 02:34:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BG2YKL6088276; Sat, 16 Dec 2023 02:34:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BG2YKUD088274; Sat, 16 Dec 2023 02:34:20 GMT (envelope-from git) Date: Sat, 16 Dec 2023 02:34:20 GMT Message-Id: <202312160234.3BG2YKUD088274@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Philip Paeps Subject: git: 74a8c6da4f28 - stable/13 - rc.conf: correct $ntp_leapfile_sources 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: philip X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 74a8c6da4f28e691c169aa502713a5aaebc00584 Auto-Submitted: auto-generated The branch stable/13 has been updated by philip: URL: https://cgit.FreeBSD.org/src/commit/?id=74a8c6da4f28e691c169aa502713a5aaebc00584 commit 74a8c6da4f28e691c169aa502713a5aaebc00584 Author: Philip Paeps AuthorDate: 2023-12-07 05:48:13 +0000 Commit: Philip Paeps CommitDate: 2023-12-16 02:33:58 +0000 rc.conf: correct $ntp_leapfile_sources IETF is no longer serving leap-seconds.list. Point at IANA instead. This fixes "service ntpd fetch". (cherry picked from commit b1c95af45488bef649e9a84890e2414ff80b3a00) --- libexec/rc/rc.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libexec/rc/rc.conf b/libexec/rc/rc.conf index a8ea27eb3420..165f0a3ab562 100644 --- a/libexec/rc/rc.conf +++ b/libexec/rc/rc.conf @@ -419,7 +419,7 @@ ntp_src_leapfile="/etc/ntp/leap-seconds" # Initial source for ntpd leapfile ntp_db_leapfile="/var/db/ntpd.leap-seconds.list" # Working copy (updated weekly) leapfile -ntp_leapfile_sources="https://www.ietf.org/timezones/data/leap-seconds.list" +ntp_leapfile_sources="https://data.iana.org/time-zones/tzdb/leap-seconds.list" # Source from which to fetch leapfile ntp_leapfile_fetch_opts="-mq" # Options to use for ntp leapfile fetch, # e.g. --no-verify-peer From nobody Sat Dec 16 02:35:06 2023 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 4SsVYQ63HFz54R97; Sat, 16 Dec 2023 02:35:06 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SsVYQ5Xjdz4Xbf; Sat, 16 Dec 2023 02:35:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702694106; 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=XXRzJWCdqEQ67+igOYaz9zrGD+wKAxqksNq2g9dm7PI=; b=rUXE6Mfni1rq9yaMZ87unhGjc4nK8gCDZV3uQ9sI6D6yrjU3pZtKYVbe3nMc1Fcpm5q8GB ohRB0nvRq3Mip8ii4os94q0GxRDQUV5MFAB0tY++9/czoqScSVqQ6yX0XV4t2esx0WyC4c FwmlvcO/b9qCLEgZM0j1AlUtdJkssEB807XnWLrXLu1+UquCTYuTdto8KA3mnk6/PPYejx qPdyq7+eR00+mRVj86THJXzEwByiMPgsJZz/Q3RaQMRfCCCR2LNboOr6gMzrk3XrZd7kRL Zk7AZ4AabRish5QVTZwqI71kpmxP6s1ZxCmVf6KvOJG3BotOsmQFgyF1YrJvUw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702694106; a=rsa-sha256; cv=none; b=j4bahbDjjKQ23pz0aKJMY8mMpdaYY2vNrSy9Do5AHNTdxiObUbGqlkgMEWIddNaJKhjjRP clFrVZ4A7ijweqXQ34q3bjfqH179rv/cqi9KSiUS61dSRdYnl/MQKpXFlgV1AcZch6uWOs aeJeYlRcZsR+i+myWUqpKRt4Wi7Il6eS94sKqdxKABgVB1aPIecQO+fDl2plUryFr0nKei v/K+B467vm6357pAlcvchBTJWa5QCUxDdcK7KFJ6WfsN5J39v6gtBJx1vz88asGAnOyAoG n5lB/GD7bbtj9KboKxbxxBMKrjvBYadEvqJ/+cEKGrmLqe5R/PhciRScVDikiQ== 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=1702694106; 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=XXRzJWCdqEQ67+igOYaz9zrGD+wKAxqksNq2g9dm7PI=; b=QZs5gIXEX0s5r2gVvx/T3u5g66PRiqe0+h74FTDG4yESIHB2vh9+02H/B9i8EragEP1ktr 2WAwVCQJeCZ/E7rVhJCGujuHyfNvnt55hr2vxjBNu/nryQSYUEPXb/kKYJUmcYBq8rfiil rcyFUE+Ri43q9L3DeE50ohReaSoAsAauvLvheetV9Q7xXaJjctb4cA5yzEUyffNRvdOctW jwNiRyRILLuvRFYboY77KChVIfeq/sM54m6K9NQwNNgTAZX9ji0kccJppFk+mpmeSowi7X yhWqiAtrYX7pJZdKCr3IMH0/V4jiTi+SENWWvsyktkPAlAAm9AjMt/u1O51Tpg== 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 4SsVYQ4bBPzcJD; Sat, 16 Dec 2023 02:35:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BG2Z6EM088512; Sat, 16 Dec 2023 02:35:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BG2Z6iq088509; Sat, 16 Dec 2023 02:35:06 GMT (envelope-from git) Date: Sat, 16 Dec 2023 02:35:06 GMT Message-Id: <202312160235.3BG2Z6iq088509@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Philip Paeps Subject: git: 890afd892c13 - stable/12 - rc.conf: correct $ntp_leapfile_sources 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: philip X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 890afd892c13d3ab13622a6b9c17ea7236217cf3 Auto-Submitted: auto-generated The branch stable/12 has been updated by philip: URL: https://cgit.FreeBSD.org/src/commit/?id=890afd892c13d3ab13622a6b9c17ea7236217cf3 commit 890afd892c13d3ab13622a6b9c17ea7236217cf3 Author: Philip Paeps AuthorDate: 2023-12-07 05:48:13 +0000 Commit: Philip Paeps CommitDate: 2023-12-16 02:34:43 +0000 rc.conf: correct $ntp_leapfile_sources IETF is no longer serving leap-seconds.list. Point at IANA instead. This fixes "service ntpd fetch". (cherry picked from commit b1c95af45488bef649e9a84890e2414ff80b3a00) --- libexec/rc/rc.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libexec/rc/rc.conf b/libexec/rc/rc.conf index 122033d7fd88..37d8754ac908 100644 --- a/libexec/rc/rc.conf +++ b/libexec/rc/rc.conf @@ -404,7 +404,7 @@ ntp_src_leapfile="/etc/ntp/leap-seconds" # Initial source for ntpd leapfile ntp_db_leapfile="/var/db/ntpd.leap-seconds.list" # Working copy (updated weekly) leapfile -ntp_leapfile_sources="https://www.ietf.org/timezones/data/leap-seconds.list" +ntp_leapfile_sources="https://data.iana.org/time-zones/tzdb/leap-seconds.list" # Source from which to fetch leapfile ntp_leapfile_fetch_opts="-mq" # Options to use for ntp leapfile fetch, # e.g. --no-verify-peer From nobody Sat Dec 16 04:18:34 2023 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 4SsXrp6p1Nz54Wyp; Sat, 16 Dec 2023 04:18:34 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SsXrp614Fz4gF2; Sat, 16 Dec 2023 04:18:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702700314; 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=cnou5jyQI0rW2oB4kIsKku5gd2cH+4xA+YNPxqgL6o8=; b=rfF0kfXBxrAReddtVIJqqzpTW+Bpc1gV2K+dYS0l+aqJSKM3uRdtfqLfD9LL8Aki/sbu81 gUACGC+ZePQWlC911x6hVUjhlJ9FP1+ga8ZYnrjI4ew3lIXIQcjPRzX6AGt/X8WrB27hAv 6X4K2UYF4FBUPTIsLHaFNx4MX+Rt8HCDVwDpA8VcIuzP4lE4uccwlygfZUI9FJZSwdsc/F Mauqqs9sMw9Lv71VjozMI12zt0WLfD/t1IG9aoz9Sx3HpM/7+lOGQw3mTpdG3GDzUwrTaI 0U8t2ewMX+aL4P6IjevRiDDK/lyYS0RyFIUcfieNhfLEv8tOR46IYtrA5X45OA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702700314; a=rsa-sha256; cv=none; b=tX+w7OTrFQeGQx5q2x8OlhbWsBcyFab6t0xij6bmOmachpWbYME/H7myxeT7/6EBQFsovv F9/xlbNYDJKhfNIBF1o58RaGBW89IoXXHVv9PSIiDUzCX46JOAbxCRc2VsIPh6rvQgg023 zujI6FS9hQ9IVR45MvuvnnISUbSf9+5CQsUwiRsthzzdIg9e78e7nKOQuRwKeng4DOf2jX 4QkPl+A9zFxLjE6WQNtdVjV1tEXRw3VzWfYQJ235XhvplNlM5kCfOjW9Icf2Q07acFjUG9 NgBDZhqyq6a0Rs4eS6+o8y12QCO1wITe5+l/ii3hczUIrr53BRNxmWCdZAw9GQ== 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=1702700314; 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=cnou5jyQI0rW2oB4kIsKku5gd2cH+4xA+YNPxqgL6o8=; b=Dwwybg36fDHEB4LQvX3p7EF9+yMYLkjG12iliJrLBRkHxnc0hhzljP4Lo1nOjJO2AD40VS EoT/ONC5F9I9Zk5i61fRxI/+0bNK857zFDe/ALBKgKHlgib1obkVkfdkNtzojBVgyGuqCu fqnSctWR/+rNF6bXvR259aKTO6uUBUPtPQAC/5KczweCAuShQpCwWodREul2kC3N3dXQN2 w+s+X/sKkLHe1JqA9DOvGZN/oJQ1CnrQFzgtBummcfHBi6XiJYRIyCuO9GLjY3k5jndqiB 2PCVZM68B7ur8lIzwK81eELr0sP239U7vKIkoDotRnx5C8+VHPuYk7VZpKHuLQ== 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 4SsXrp4yrTzfhn; Sat, 16 Dec 2023 04:18:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BG4IYVI058997; Sat, 16 Dec 2023 04:18:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BG4IYmO058994; Sat, 16 Dec 2023 04:18:34 GMT (envelope-from git) Date: Sat, 16 Dec 2023 04:18:34 GMT Message-Id: <202312160418.3BG4IYmO058994@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 9f1c1cfe69d8 - stable/14 - strfmon.3: Cleanup example code 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9f1c1cfe69d80b5f17008d6963ac409ecbad817b Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=9f1c1cfe69d80b5f17008d6963ac409ecbad817b commit 9f1c1cfe69d80b5f17008d6963ac409ecbad817b Author: Jose Luis Duran AuthorDate: 2023-12-01 06:50:24 +0000 Commit: Konstantin Belousov CommitDate: 2023-12-16 04:17:51 +0000 strfmon.3: Cleanup example code (cherry picked from commit 2a163c3649e59dd616e057994ec02092362f0ae7) --- lib/libc/stdlib/strfmon.3 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/libc/stdlib/strfmon.3 b/lib/libc/stdlib/strfmon.3 index 7cd283573239..20cc560d401d 100644 --- a/lib/libc/stdlib/strfmon.3 +++ b/lib/libc/stdlib/strfmon.3 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd January 25, 2023 +.Dd December 6, 2023 .Dt STRFMON 3 .Os .Sh NAME @@ -154,10 +154,10 @@ to the string .Bd -literal -offset indent #include #include -#include +#include int -main() +main(void) { char string[100]; double money = 1234567.89; @@ -169,6 +169,8 @@ main() strfmon(string, sizeof(string) - 1, "%n", money); printf("%s\\n", string); + + return (0); } .Ed .Sh ERRORS From nobody Sat Dec 16 04:18:35 2023 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 4SsXrr0ssTz54XHb; Sat, 16 Dec 2023 04:18:36 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SsXrr00Wlz3BnK; Sat, 16 Dec 2023 04:18:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702700316; 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=l2w6PUZ01+oDXorKC5tDIaHSCWzcrB+eF93i1I3REP0=; b=P+JkAlNhGNL1I3jJUuVtca7q5VFWWkasgdKwx00PCBPPJvTtjxWqT9q9j11dwqmOsvTCVQ mXOAd7yyLSpA6UnGATi03QbCzNZilIQKmxxkIsT0scjeEETiNm8/RwFCxkorggVVYG5kK5 qCK7OA1QoWVU/3T9uiVesAv5om8OSkrUNDOl5pB/DK6vx5KQkmc4HSLAuUHF/Sk+VkdoE8 xbVmoXZ+SpvkMFQzIxLNzyCH7DiU7IBxlRaz7TO1vTfc1ftC99TBSknMzp52RritfyL1Ag Ylq4qGH60p7OEH0tQGu+ehX92wOOZJAGSFr6GfvGvaTm8/x4cos8pOw7Qi89Pg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702700316; a=rsa-sha256; cv=none; b=aCvkbXXSHeiWaQ8WqEJfFhiBGQqCWBH/ZGGi6MNrDH9QY+LkzJ43nsIGkoDsgRxQMQazHl vRL0A/mm8AMJUtw3FcO0xElm+gAA7lKkU7T9wD0UgfulOjHOxgOeIjiVoksfybngup2o6o Qsj2V79/FGnywjFh4Z5vAqztowtJgBvRW0pg8WrXmXRXbffJx1n1kdrlYVgLl0/IFlU6g3 sQHL45KEaZJ95E6AD1FtbllD99HnySpTgPYwQgvK5FHTJahFGQPsiHlZ9g1U05UNW677lv Uv/39v/gzETyiAj1UAUXpmM+WFSb2WKtvH2EfEv48qToLrzCwnVjnBP8ESHoEg== 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=1702700316; 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=l2w6PUZ01+oDXorKC5tDIaHSCWzcrB+eF93i1I3REP0=; b=cVfZD4K4ETgxtV1Qr24nJPm11L48ZxcNBkX3izR9Ga17o28dD7CmXynlFxq1uK3nsV7TBQ lbNIs1Is42stzfR0x/jsiNZyNeWfJTxxGwL26mJAl9g6CppVj/1FmnMwnu/s9Pa2B5wZJM UrZuoCLhHYFccarqB02X78iWmQNNG2Kbqeradbg76xomnY+GKEZ6wysjSbBpvBmNNtNyNy +LJyrbL+CWJ1WRarf0mt0cFBLQ6JZzU0BAgCnu1nmsc23EGytmv4OcrXxCWfQ9vNp9cEqy QrjvGdDlBsM8RyIHW3y0hlq77wQbyrxDLYyFrlediPHxC002F24LF39N5b8PIg== 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 4SsXrq5xn0zg4p; Sat, 16 Dec 2023 04:18:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BG4IZ4C059039; Sat, 16 Dec 2023 04:18:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BG4IZhR059036; Sat, 16 Dec 2023 04:18:35 GMT (envelope-from git) Date: Sat, 16 Dec 2023 04:18:35 GMT Message-Id: <202312160418.3BG4IZhR059036@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: ea99922484b7 - stable/14 - strfmon: Silence scan-build warning 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ea99922484b7435ac8001ebd13614006c734b924 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=ea99922484b7435ac8001ebd13614006c734b924 commit ea99922484b7435ac8001ebd13614006c734b924 Author: Jose Luis Duran AuthorDate: 2023-11-30 23:30:50 +0000 Commit: Konstantin Belousov CommitDate: 2023-12-16 04:17:51 +0000 strfmon: Silence scan-build warning (cherry picked from commit 6abee52e0d79f68fd725de748d7027ca8eef2294) --- lib/libc/stdlib/strfmon.c | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/libc/stdlib/strfmon.c b/lib/libc/stdlib/strfmon.c index b2d76fbed769..ade1deaffca9 100644 --- a/lib/libc/stdlib/strfmon.c +++ b/lib/libc/stdlib/strfmon.c @@ -156,7 +156,6 @@ vstrfmon_l(char * __restrict s, size_t maxsize, locale_t loc, left_prec = -1; /* no left precision specified */ right_prec = -1; /* no right precision specified */ width = -1; /* no width specified */ - value = 0; /* we have no value to print now */ /* Flags */ while (1) { From nobody Sat Dec 16 04:18:36 2023 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 4SsXrs2CDGz54Wvg; Sat, 16 Dec 2023 04:18:37 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SsXrs18mNz3Bnj; Sat, 16 Dec 2023 04:18:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702700317; 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=fCfcLbOhm+8yyye9oGriiSPLNP+zR9TOuAAOezSjUKo=; b=DWHYGC9ggDv+N9Tq+rDvIRYzxxGttUaLYDhpp47hbNUwrWc6pZeOtfFW/Yk+5Ow9GmolsL NaWF2ETD72HSEsbVOaoZgyrn0I2FgDUOaYlDah01gmm3SUAsM5zcQY5Kn/TQTjsQLP5xeF 9cC1C3WchIzzHXea4ILxLUWg48SQS+m2VdXg+mDim2JyIvNTOh7efkU48zcjBCVNo/HPmM rOTk0mbh3kBsdahdToPcz1lTyQSIlLl6Jl64mLpta7Bma/4aC+ojkAprgeQDGbdM0m47mx 7K8smivbW7hZX0Xkyf8tnOlcDjtV3EhKF/lrO7Lo0V9M0XCq1kTg3FveqXBfJA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702700317; a=rsa-sha256; cv=none; b=mo6WK3GdKq9pyT+9D2XFh0S+5Zkiyuszb4vfo2zlmeJAwy4RLqsHLKlTUfsm/ERASxYbpO AjgidQMXx+CUdVsXPREzlDjmnRuvFsYLAQMwxPhD067ryYWE3ddjCfSNkPouNjb++pabZD 5YZ6pnTy/7lZ/p1vLf9Eazin16Cx7PPTHHrzj0TZDPhly2WTyZ1nexJsvPM/wwfLv4bJ1K hTaNrF9YSr+B0rubeU2XodCVam7BNg3xPeyj+9DpDpPvhhrcstzJ3S779X+nHw09OVukQl 38hX/sB55dKQZ2zRJJTZbIuaHmlDICNud8pbWV060biygwL5z8mviEyL7UjqjQ== 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=1702700317; 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=fCfcLbOhm+8yyye9oGriiSPLNP+zR9TOuAAOezSjUKo=; b=lhuV6Xbn0dAVp4+V7OdF5PF8ZN0Xbcpl1DoLCIqD85O93FtyablAZcmlKR5QkxRmcoFpO2 RKhy8bc3LyX2X2t8+UkaAgXb35w3v1KUXZGJmnjKqMMrvJdud71MmHBfjq1H5Twoxr1Pas Yt1JE6yibwDSV4pqbx/ow+kVtSU/iL3WCoxV5uu74FNrafcZWZisucRrNcBGq2LvMXrCB8 PerJZSVyj/hAyz8b1WnHhRpSJQN2jon2wXWzNnM88mVchJX0nrssulxinDXGhhAna8ROyx R8upeXgEMybUsWDM3poBj/nK25EokmXQqUG7GEVfR6TBn2qeyFjscmP20DWIyw== 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 4SsXrr6wyvzfr5; Sat, 16 Dec 2023 04:18:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BG4Ia8t059084; Sat, 16 Dec 2023 04:18:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BG4Ia7J059081; Sat, 16 Dec 2023 04:18:36 GMT (envelope-from git) Date: Sat, 16 Dec 2023 04:18:36 GMT Message-Id: <202312160418.3BG4Ia7J059081@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 2f427cbb3557 - stable/14 - strfmon: style fixes 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 2f427cbb3557fbcf19da6ecf0f5dfd14105eff2e Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=2f427cbb3557fbcf19da6ecf0f5dfd14105eff2e commit 2f427cbb3557fbcf19da6ecf0f5dfd14105eff2e Author: Jose Luis Duran AuthorDate: 2023-11-30 23:28:21 +0000 Commit: Konstantin Belousov CommitDate: 2023-12-16 04:17:51 +0000 strfmon: style fixes (cherry picked from commit 56a0d5444d6f39302f3476b61c1b81ed39abe589) --- lib/libc/stdlib/strfmon.c | 197 +++++++++++++++++++++++----------------------- 1 file changed, 99 insertions(+), 98 deletions(-) diff --git a/lib/libc/stdlib/strfmon.c b/lib/libc/stdlib/strfmon.c index ade1deaffca9..4b0389345eb6 100644 --- a/lib/libc/stdlib/strfmon.c +++ b/lib/libc/stdlib/strfmon.c @@ -33,6 +33,7 @@ */ #include + #include #include #include @@ -57,7 +58,7 @@ /* internal macros */ #define PRINT(CH) do { \ - if (dst >= s + maxsize) \ + if (dst >= s + maxsize) \ goto e2big_error; \ *dst++ = CH; \ } while (0) @@ -68,9 +69,9 @@ PRINT(*tmps++); \ } while (0) -#define GET_NUMBER(VAR, LOC) do { \ +#define GET_NUMBER(VAR, LOC) do { \ VAR = 0; \ - while (isdigit_l((unsigned char)*fmt, LOC)) { \ + while (isdigit_l((unsigned char)*fmt, LOC)) { \ if (VAR > INT_MAX / 10) \ goto e2big_error; \ VAR *= 10; \ @@ -101,22 +102,22 @@ static char *__format_grouped_double(double, int *, int, int, int, struct lconv *, locale_t); static ssize_t -vstrfmon_l(char * __restrict s, size_t maxsize, locale_t loc, - const char * __restrict format, va_list ap) +vstrfmon_l(char *__restrict s, size_t maxsize, locale_t loc, + const char *__restrict format, va_list ap) { char *dst; /* output destination pointer */ const char *fmt; /* current format poistion pointer */ struct lconv *lc; /* pointer to lconv structure */ char *asciivalue; /* formatted double pointer */ - int flags; /* formatting options */ - int pad_char; /* padding character */ - int pad_size; /* pad size */ - int width; /* field width */ - int left_prec; /* left precision */ - int right_prec; /* right precision */ - double value; /* just value */ - char space_char = ' '; /* space after currency */ + int flags; /* formatting options */ + int pad_char; /* padding character */ + int pad_size; /* pad size */ + int width; /* field width */ + int left_prec; /* left precision */ + int right_prec; /* right precision */ + double value; /* just value */ + char space_char = ' '; /* space after currency */ char cs_precedes, /* values gathered from struct lconv */ sep_by_space, @@ -126,6 +127,7 @@ vstrfmon_l(char * __restrict s, size_t maxsize, locale_t loc, char *tmpptr; /* temporary vars */ int sverrno; + FIX_LOCALE(loc); lc = localeconv_l(loc); @@ -134,7 +136,7 @@ vstrfmon_l(char * __restrict s, size_t maxsize, locale_t loc, asciivalue = NULL; currency_symbol = NULL; - while (*fmt) { + while (*fmt != 0) { /* pass nonformating characters AS IS */ if (*fmt != '%') goto literal; @@ -144,13 +146,13 @@ vstrfmon_l(char * __restrict s, size_t maxsize, locale_t loc, /* "%%" mean just '%' */ if (*(fmt + 1) == '%') { fmt++; - literal: +literal: PRINT(*fmt++); continue; } /* set up initial values */ - flags = (NEED_GROUPING|LOCALE_POSN); + flags = NEED_GROUPING | LOCALE_POSN; pad_char = ' '; /* padding character is "space" */ pad_size = 0; /* no padding initially */ left_prec = -1; /* no left precision specified */ @@ -160,32 +162,32 @@ vstrfmon_l(char * __restrict s, size_t maxsize, locale_t loc, /* Flags */ while (1) { switch (*++fmt) { - case '=': /* fill character */ - pad_char = *++fmt; - if (pad_char == '\0') - goto format_error; - continue; - case '^': /* not group currency */ - flags &= ~(NEED_GROUPING); - continue; - case '+': /* use locale defined signs */ - if (flags & SIGN_POSN_USED) - goto format_error; - flags |= (SIGN_POSN_USED|LOCALE_POSN); - continue; - case '(': /* enclose negatives with () */ - if (flags & SIGN_POSN_USED) - goto format_error; - flags |= (SIGN_POSN_USED|PARENTH_POSN); - continue; - case '!': /* suppress currency symbol */ - flags |= SUPPRESS_CURR_SYMBOL; - continue; - case '-': /* alignment (left) */ - flags |= LEFT_JUSTIFY; - continue; - default: - break; + case '=': /* fill character */ + pad_char = *++fmt; + if (pad_char == '\0') + goto format_error; + continue; + case '^': /* not group currency */ + flags &= ~(NEED_GROUPING); + continue; + case '+': /* use locale defined signs */ + if (flags & SIGN_POSN_USED) + goto format_error; + flags |= (SIGN_POSN_USED | LOCALE_POSN); + continue; + case '(': /* enclose negatives with () */ + if (flags & SIGN_POSN_USED) + goto format_error; + flags |= (SIGN_POSN_USED | PARENTH_POSN); + continue; + case '!': /* suppress currency symbol */ + flags |= SUPPRESS_CURR_SYMBOL; + continue; + case '-': /* alignment (left) */ + flags |= LEFT_JUSTIFY; + continue; + default: + break; } break; } @@ -193,7 +195,8 @@ vstrfmon_l(char * __restrict s, size_t maxsize, locale_t loc, /* field Width */ if (isdigit_l((unsigned char)*fmt, loc)) { GET_NUMBER(width, loc); - /* Do we have enough space to put number with + /* + * Do we have enough space to put number with * required width ? */ if ((unsigned int)width >= maxsize - (dst - s)) @@ -214,22 +217,24 @@ vstrfmon_l(char * __restrict s, size_t maxsize, locale_t loc, if (!isdigit_l((unsigned char)*++fmt, loc)) goto format_error; GET_NUMBER(right_prec, loc); - if ((unsigned int)right_prec >= maxsize - (dst - s) - - left_prec) + if ((unsigned int)right_prec >= + maxsize - (dst - s) - left_prec) goto e2big_error; } /* Conversion Characters */ switch (*fmt++) { - case 'i': /* use international currency format */ - flags |= USE_INTL_CURRENCY; - break; - case 'n': /* use national currency format */ - flags &= ~(USE_INTL_CURRENCY); - break; - default: /* required character is missing or - premature EOS */ - goto format_error; + case 'i': /* use international currency format */ + flags |= USE_INTL_CURRENCY; + break; + case 'n': /* use national currency format */ + flags &= ~(USE_INTL_CURRENCY); + break; + default: /* + * required character is missing or + * premature EOS + */ + goto format_error; } if (currency_symbol != NULL) @@ -245,7 +250,7 @@ vstrfmon_l(char * __restrict s, size_t maxsize, locale_t loc, currency_symbol = strdup(lc->currency_symbol); if (currency_symbol == NULL) - goto end_error; /* ENOMEM. */ + goto end_error; /* ENOMEM. */ /* value itself */ value = va_arg(ap, double); @@ -267,15 +272,17 @@ vstrfmon_l(char * __restrict s, size_t maxsize, locale_t loc, if (asciivalue != NULL) free(asciivalue); - asciivalue = __format_grouped_double(value, &flags, - left_prec, right_prec, pad_char, lc, loc); + asciivalue = __format_grouped_double(value, &flags, left_prec, + right_prec, pad_char, lc, loc); if (asciivalue == NULL) - goto end_error; /* errno already set */ - /* to ENOMEM by malloc() */ + goto end_error; /* + * errno already set to ENOMEM by + * malloc() + */ /* set some variables for later use */ - __setup_vars(flags, &cs_precedes, &sep_by_space, - &sign_posn, &signstr, lc); + __setup_vars(flags, &cs_precedes, &sep_by_space, &sign_posn, + &signstr, lc); /* * Description of some LC_MONETARY's values: @@ -306,7 +313,6 @@ vstrfmon_l(char * __restrict s, size_t maxsize, locale_t loc, * $currency_symbol * = 3 - the sign string precedes the $currency_symbol * = 4 - the sign string succeeds the $currency_symbol - * */ tmpptr = dst; @@ -352,12 +358,10 @@ vstrfmon_l(char * __restrict s, size_t maxsize, locale_t loc, } if (!(flags & SUPPRESS_CURR_SYMBOL)) { - if ((sign_posn == 3 && sep_by_space == 2) - || (sep_by_space == 1 - && (sign_posn == 0 - || sign_posn == 1 - || sign_posn == 2 - || sign_posn == 4))) + if ((sign_posn == 3 && sep_by_space == 2) || + (sep_by_space == 1 && + (sign_posn == 0 || sign_posn == 1 || + sign_posn == 2 || sign_posn == 4))) PRINT(space_char); PRINTS(currency_symbol); if (sign_posn == 4) { @@ -398,7 +402,7 @@ vstrfmon_l(char * __restrict s, size_t maxsize, locale_t loc, PRINT('\0'); free(asciivalue); free(currency_symbol); - return (dst - s - 1); /* return size of put data except trailing '\0' */ + return (dst - s - 1); /* size of put data except trailing '\0' */ e2big_error: errno = E2BIG; @@ -418,15 +422,15 @@ end_error: } static void -__setup_vars(int flags, char *cs_precedes, char *sep_by_space, - char *sign_posn, char **signstr, struct lconv *lc) +__setup_vars(int flags, char *cs_precedes, char *sep_by_space, char *sign_posn, + char **signstr, struct lconv *lc) { if ((flags & IS_NEGATIVE) && (flags & USE_INTL_CURRENCY)) { *cs_precedes = lc->int_n_cs_precedes; *sep_by_space = lc->int_n_sep_by_space; *sign_posn = (flags & PARENTH_POSN) ? 0 : lc->int_n_sign_posn; - *signstr = (lc->negative_sign[0] == '\0') ? "-" - : lc->negative_sign; + *signstr = (lc->negative_sign[0] == '\0') ? "-" : + lc->negative_sign; } else if (flags & USE_INTL_CURRENCY) { *cs_precedes = lc->int_p_cs_precedes; *sep_by_space = lc->int_p_sep_by_space; @@ -436,8 +440,8 @@ __setup_vars(int flags, char *cs_precedes, char *sep_by_space, *cs_precedes = lc->n_cs_precedes; *sep_by_space = lc->n_sep_by_space; *sign_posn = (flags & PARENTH_POSN) ? 0 : lc->n_sign_posn; - *signstr = (lc->negative_sign[0] == '\0') ? "-" - : lc->negative_sign; + *signstr = (lc->negative_sign[0] == '\0') ? "-" : + lc->negative_sign; } else { *cs_precedes = lc->p_cs_precedes; *sep_by_space = lc->p_sep_by_space; @@ -460,8 +464,8 @@ __calc_left_pad(int flags, char *cur_symb, struct lconv *lc) char cs_precedes, sep_by_space, sign_posn, *signstr; int left_chars = 0; - __setup_vars(flags, &cs_precedes, &sep_by_space, &sign_posn, - &signstr, lc); + __setup_vars(flags, &cs_precedes, &sep_by_space, &sign_posn, &signstr, + lc); if (cs_precedes != 0) { left_chars += strlen(cur_symb); @@ -470,17 +474,17 @@ __calc_left_pad(int flags, char *cur_symb, struct lconv *lc) } switch (sign_posn) { - case 0: - if (flags & IS_NEGATIVE) - left_chars++; - break; - case 1: + case 0: + if (flags & IS_NEGATIVE) + left_chars++; + break; + case 1: + left_chars += strlen(signstr); + break; + case 3: + case 4: + if (cs_precedes != 0) left_chars += strlen(signstr); - break; - case 3: - case 4: - if (cs_precedes != 0) - left_chars += strlen(signstr); } return (left_chars); } @@ -510,8 +514,8 @@ get_groups(int size, char *grouping) /* convert double to locale-encoded string */ static char * -__format_grouped_double(double value, int *flags, - int left_prec, int right_prec, int pad_char, struct lconv *lc, locale_t loc) +__format_grouped_double(double value, int *flags, int left_prec, int right_prec, + int pad_char, struct lconv *lc, locale_t loc) { char *rslt; @@ -529,7 +533,7 @@ __format_grouped_double(double value, int *flags, size_t decimal_point_size; size_t thousands_sep_size; - int groups = 0; + int groups = 0; grouping = lc->mon_grouping; decimal_point = lc->mon_decimal_point; @@ -592,10 +596,8 @@ __format_grouped_double(double value, int *flags, avalue_size -= (right_prec + 1); } - if ((*flags & NEED_GROUPING) && - thousands_sep_size > 0 && - *grouping != CHAR_MAX && - *grouping > 0) { + if ((*flags & NEED_GROUPING) && thousands_sep_size > 0 && + *grouping != CHAR_MAX && *grouping > 0) { while (avalue_size > (int)*grouping) { GRPCPY(*grouping); GRPSEP; @@ -638,8 +640,7 @@ __format_grouped_double(double value, int *flags, } ssize_t -strfmon(char * __restrict s, size_t maxsize, const char * __restrict format, - ...) +strfmon(char *__restrict s, size_t maxsize, const char *__restrict format, ...) { ssize_t ret; va_list ap; @@ -652,8 +653,8 @@ strfmon(char * __restrict s, size_t maxsize, const char * __restrict format, } ssize_t -strfmon_l(char * __restrict s, size_t maxsize, locale_t loc, - const char * __restrict format, ...) +strfmon_l(char *__restrict s, size_t maxsize, locale_t loc, + const char *__restrict format, ...) { ssize_t ret; va_list ap; From nobody Sat Dec 16 04:18:38 2023 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 4SsXrt3THlz54X8S; Sat, 16 Dec 2023 04:18:38 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SsXrt1zG9z3Bwh; Sat, 16 Dec 2023 04:18:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702700318; 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=Aqkegb0Ct0LqZU6F00ErI81nda1v75gn5m8UM1PRFWw=; b=BH8a9QHrZp66XKezhtLXMk6eHyBtnG+vAR0TgfW9UrpDcV+H+gjLJHkvaa2ppJBIb+6OEp iH+xjSU6Gy9DkeTfyNb6W2GY/I1m9kQVmU6brtFI7S+kofKE7cs06a4cz8rt4hBcN4Ii2h /AJjPh1Ei8yF9sVYaHEkzj3FqqiMDg47HX+zZX3UuWTT2/FIvEbEi9UeWzPq6ESUh+b7XW 8Tm7r9KLrfNqI6hB+y2dAM/vQHcb9y1/geWdDMnSsE0x1Y2S2VteIo+3Q5plttRMZdLlWP +BEKA92BYPQ2vZ/mwRnn2dnVZy2gpsy5oGkSgtzpXKu5ApMKLGCJqYdRTwMygQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702700318; a=rsa-sha256; cv=none; b=MnoRRLwGjzm4JK9Y/EhLG8UEVPlx1pn2KMpinPM6koEXAUw3mYlQRgeTqo29JJPphOzAD8 4GGETxzbnDxB0aLRKSKSzoyxrRsEgCNVgCjKZ/P30mXZwl86S1fPgH2gtC0fus4UfA+twX 5BMz7MkSXrEDeyug+aNEcaowzLG+xPHwrfKrfOTRRz3pZJOOGWW3O4UcvOw+jQcnDThY9Q qG4dn+usVLY3JGF2Gy9/Pg8z3seikeluZzBnMlClKnWiMWdboqAWXrDrkcQB7haGv9Bvby 2NXOFOgNBN3QsR5NBykft2asbZ2DMM9NCUyPBmqYD8hyF3PiHUFwK0boflRr2g== 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=1702700318; 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=Aqkegb0Ct0LqZU6F00ErI81nda1v75gn5m8UM1PRFWw=; b=upA0q+ChHjXwj69pdgj9qbdO7bg8j/GTSl//jtmXpI4NN94wbYSaFIcCYVHk9PDYOqrUhj GmPD0+Fg2I/kRJekH4neQ7HocOY3XhrFQ/nRJ3aHmZFQE7P2wNrm4PEcFE3KVbxgRCsdr2 rJnsgMti8dFm2UaOJluuEWNGhS8NKHF0LbJb2NWCI2GVxvRUA6wGaD+WRgPI0x3+OtGMLB rdrAqiC6mfUivQnp81HOOhjg/+1VcjDcB/o3haZDwdrpDihW9O9cCAEIsMel0WiM05jNkD UZBRgjsJnojuhnjZsaGHQeZ+Ldd1ugmAPGTSfY/LkHcQZz6msHoFqHWNBU6RPw== 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 4SsXrt14rLzfhp; Sat, 16 Dec 2023 04:18:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BG4Icv0059136; Sat, 16 Dec 2023 04:18:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BG4IcE3059133; Sat, 16 Dec 2023 04:18:38 GMT (envelope-from git) Date: Sat, 16 Dec 2023 04:18:38 GMT Message-Id: <202312160418.3BG4IcE3059133@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 79ca908fded3 - stable/14 - strfmon.c: Use the restrict keyword directly 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 79ca908fded37d25dad76366137bdcbba2bf300c Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=79ca908fded37d25dad76366137bdcbba2bf300c commit 79ca908fded37d25dad76366137bdcbba2bf300c Author: Konstantin Belousov AuthorDate: 2023-12-09 01:21:02 +0000 Commit: Konstantin Belousov CommitDate: 2023-12-16 04:17:51 +0000 strfmon.c: Use the restrict keyword directly (cherry picked from commit 86e2bcbf47fb4c8dbd799f2f21c0ed338b2e8f1b) --- lib/libc/stdlib/strfmon.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/libc/stdlib/strfmon.c b/lib/libc/stdlib/strfmon.c index 4b0389345eb6..68a36a6d5567 100644 --- a/lib/libc/stdlib/strfmon.c +++ b/lib/libc/stdlib/strfmon.c @@ -640,7 +640,7 @@ __format_grouped_double(double value, int *flags, int left_prec, int right_prec, } ssize_t -strfmon(char *__restrict s, size_t maxsize, const char *__restrict format, ...) +strfmon(char *restrict s, size_t maxsize, const char *restrict format, ...) { ssize_t ret; va_list ap; @@ -653,8 +653,8 @@ strfmon(char *__restrict s, size_t maxsize, const char *__restrict format, ...) } ssize_t -strfmon_l(char *__restrict s, size_t maxsize, locale_t loc, - const char *__restrict format, ...) +strfmon_l(char *restrict s, size_t maxsize, locale_t loc, + const char *restrict format, ...) { ssize_t ret; va_list ap; From nobody Sat Dec 16 04:19:21 2023 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 4SsXsk0Ksrz54Wyx; Sat, 16 Dec 2023 04:19:22 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SsXsj6fdhz3CxV; Sat, 16 Dec 2023 04:19:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702700361; 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=3Xf8yb2D1XMk3X9qy//I1plHC/f0LFMvYk/GqxkYNyg=; b=L3Io8eLTsWjZUhUFdUxHBX9nzB29cwqjmozIgRG9Ul3SxZuVYh3as0Pqmox/puJ9s9onRC 4OMUPmnkuXoUYbgoPoYiZLriP0vgjMkCWZZf+g6232hu+Jxj5fuRUmbs1GmheN62u2o4Uy AP4ROsLOyB2RgN1bXy0qdLrpSwhRSJq8ll4WEOwz57uRXjsSJsFeh6h4PjnV7D9kWeFSc0 /DcB266f/jxGlPpn24NeadyCT0RNikM/+o17PKe0xsZXHbFvCAEsy8XeaKuty25MaHtwn2 GQgMuZD9cQ4pJ53/RFpBedxzjUGu4Ao4N/IcXWh/Ccpgr2LOplSFiFdd3stJRg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702700361; a=rsa-sha256; cv=none; b=k8XQkjnCjlJnajw8gAYsRcnxXFvC9A4xcsqRxeCOLX1XPqaER4b6wfI7hgfNpFMYQO7gPY ai67S2D3VoN38XCPKizuVuQqHvSqBOsxnyAuthv8h9fyvnH11ECH2PIgTAYzp1mF4AvB6u Fs8uKscpTm/dNI2Ke6ToDb80f+TOkzeDJhRKWADu7laj4lbYh0dTTvZ784Y9dEuF+/bGni Mi6D3kgDfkp5UmMWm5HaJe7MluhnJYtaXw7NDOlG71p8hJft4mL1lpAZMe3JD/VDmKXm8i k7YFD/L6ughV5kytpLXcnEEUNgISZ0NmArYmaLdNph8014EjC5CFQ7m9bG+Nfg== 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=1702700361; 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=3Xf8yb2D1XMk3X9qy//I1plHC/f0LFMvYk/GqxkYNyg=; b=IQRk7/ijWdvvSEqvU/2jBeJr6eVt4Bv79ruejXtmH5D1mtRcenjndFibttTlqcutWvFS1t KVLfrvkq3AuJPjxKOAPo4P/MAAfmKagEyGLmK4lvLGsDGpjM3qy88dniQZUA74DbWELWhD H9WxdcWc+D+AQwETi9/K5fHQvh3/YXD5TnRQo2hNaE0TbuBr7yHMFF5d1lBgR6n8hRdyjo ctA47YbB7pW/ESGRHhE9DTjhGl8O3zJXWGrMElO0TTXr6I+B+WHxWvC7wcX+Hc3uZFX/kw gSPf72+6EV9W3+mC8FtflUeYnERNko15HqEBA7g5Woyw58Fit69QJh2mePWDGA== 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 4SsXsj5ZZPzfhq; Sat, 16 Dec 2023 04:19:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BG4JLkv059374; Sat, 16 Dec 2023 04:19:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BG4JLA9059371; Sat, 16 Dec 2023 04:19:21 GMT (envelope-from git) Date: Sat, 16 Dec 2023 04:19:21 GMT Message-Id: <202312160419.3BG4JLA9059371@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: c88024012f5b - stable/13 - strfmon.3: Cleanup example code 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c88024012f5bc82823a197bdc89874fb8804dfe5 Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=c88024012f5bc82823a197bdc89874fb8804dfe5 commit c88024012f5bc82823a197bdc89874fb8804dfe5 Author: Jose Luis Duran AuthorDate: 2023-12-01 06:50:24 +0000 Commit: Konstantin Belousov CommitDate: 2023-12-16 04:18:47 +0000 strfmon.3: Cleanup example code (cherry picked from commit 2a163c3649e59dd616e057994ec02092362f0ae7) --- lib/libc/stdlib/strfmon.3 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/libc/stdlib/strfmon.3 b/lib/libc/stdlib/strfmon.3 index 7cd283573239..20cc560d401d 100644 --- a/lib/libc/stdlib/strfmon.3 +++ b/lib/libc/stdlib/strfmon.3 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd January 25, 2023 +.Dd December 6, 2023 .Dt STRFMON 3 .Os .Sh NAME @@ -154,10 +154,10 @@ to the string .Bd -literal -offset indent #include #include -#include +#include int -main() +main(void) { char string[100]; double money = 1234567.89; @@ -169,6 +169,8 @@ main() strfmon(string, sizeof(string) - 1, "%n", money); printf("%s\\n", string); + + return (0); } .Ed .Sh ERRORS From nobody Sat Dec 16 04:19:22 2023 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 4SsXsl1Wkkz54X02; Sat, 16 Dec 2023 04:19:23 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SsXsl0MQ3z3D2v; Sat, 16 Dec 2023 04:19:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702700363; 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=F4os4PB7GIW4VslbtpO3DFz1RmWxLvN/yu329PlgoqY=; b=Vs8rFVTnN71jNZiuyZCZO9/pQrYyBFDLnuVe5r/gwv8SwXc2tdfyaRLR+vYvHFtb+rLlRm DP7WJB1WDjvLqw+/d/XLQkfbY1orJ1i7+Wd0lKZzkxBH4FYP+sWgILMGnnkzZl3OoiPGJX Xr2iE5Zc74hhE51Gf8l0T9lL33vqijezlzrq4nnN7s+mrT5WmX76YYmb39f7GRRWut2HL1 4hqulmWYfOsOuJfZ6eHbjuImqpMDx57xonztNtR5V7sP43bSEWcaYp8XMTptw5xxe8OlUO ZXD+jwe9r3aOnrHHfu+/vCDkvnJ7fwTh8bNNQW7ardEvTFAQBKsFzRRHspOSgg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702700363; a=rsa-sha256; cv=none; b=Vhf8zfRtLaNxwSA8dUvZVLafly7x4unH1ZYQfp96lKf32TmUNUP6CIc35ZJUhr4HGH1dEn Vam6IAHiFahXzqXpE4Yy0ORslDYAqRqwsT7mgwmfdzmF/NBx1/LDKmiIcb2Jbd+yG2E1yz +dMpVwZNC+3k4tAwtEhxKKgJPNAWD0m6B9lYdKXbQSc41NNzgvrMbSOfVvgreEtAD1TUzs ZFzGIOvCEuj7XG0tgpmWkN6uuAujC7W2tANHCStKDVtkfZ5Nbe+C0OlQr8qY2DO5wYAMuV We8Nq6ae/7r14zyujsqQrw/pvrbRKP1pyuPYdeJIdQcnADd19Py74PDDu+zv5A== 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=1702700363; 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=F4os4PB7GIW4VslbtpO3DFz1RmWxLvN/yu329PlgoqY=; b=jdgaNq9dSsH5jHIgz82bdZjMEa6gaRBcYU+ED7oR4pRU9l5A/VzQlAduR6SL3z88il4YLT HBdUE7PQ5st8WdfSJxQSQUEuCIseE5ogRUYjB5oEnmUBR7ug6Yi16XNDrf9/JqbxFldLcp xdNqptJpdWkFKQB77bMKSuAAbncd1Ex1tV1JYh85uJ9RmMDPbUZOevciCVYUTUOoquO4zM UnuQTChVvusFDiiIrzixfvmaOkzPNP//NBNj0nbCislKHUeOX8CHLlt639YUpZq5UJEZZG QR4ipSkAv8AEqR7+Zo51Yk9xrK2pJnMbvR+6LXpkSjDRXU0fYq/Hb//ToC0sAA== 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 4SsXsk6KFszg2Y; Sat, 16 Dec 2023 04:19:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BG4JM7q059416; Sat, 16 Dec 2023 04:19:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BG4JMP4059413; Sat, 16 Dec 2023 04:19:22 GMT (envelope-from git) Date: Sat, 16 Dec 2023 04:19:22 GMT Message-Id: <202312160419.3BG4JMP4059413@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 08f6c7481804 - stable/13 - strfmon: Silence scan-build warning 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 08f6c7481804e47d93a0f50238eefe4b6211fc37 Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=08f6c7481804e47d93a0f50238eefe4b6211fc37 commit 08f6c7481804e47d93a0f50238eefe4b6211fc37 Author: Jose Luis Duran AuthorDate: 2023-11-30 23:30:50 +0000 Commit: Konstantin Belousov CommitDate: 2023-12-16 04:18:47 +0000 strfmon: Silence scan-build warning (cherry picked from commit 6abee52e0d79f68fd725de748d7027ca8eef2294) --- lib/libc/stdlib/strfmon.c | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/libc/stdlib/strfmon.c b/lib/libc/stdlib/strfmon.c index 0e36eb0babe5..d770b6f32bd1 100644 --- a/lib/libc/stdlib/strfmon.c +++ b/lib/libc/stdlib/strfmon.c @@ -157,7 +157,6 @@ vstrfmon_l(char * __restrict s, size_t maxsize, locale_t loc, left_prec = -1; /* no left precision specified */ right_prec = -1; /* no right precision specified */ width = -1; /* no width specified */ - value = 0; /* we have no value to print now */ /* Flags */ while (1) { From nobody Sat Dec 16 04:19:23 2023 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 4SsXsm34NKz54X8g; Sat, 16 Dec 2023 04:19:24 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SsXsm1qFxz3Cy3; Sat, 16 Dec 2023 04:19:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702700364; 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=uyrBcYr1rne00skap+DZ5TCktsJaVhDnEHE8gVd6ujU=; b=VKgNQ2qELlPU65QUiPhlu6rs/tDRPrVgD3UVESJQeA5JyPf4S8VD5Oxmh4xaTxfIFmj3Wj o+kYfSJ8WXvLzGZAnZWjY1uPntS6A9UvdI/uK8yEcxH3DBb+Lb09IYI5zwxln4uSmbuQRL /xVmxPfy+2tiIgpxB/E89UjUYgUdaxgQhQsNeg0WSWMUB+jKVRvLkFXAQHYnBLkxqheVNS +0ZG58y31BMEDH+XXUpdF+fT/85lKGugAGy9OWKvK7CFKA5gtYq10576MaVJC162X8l2bJ nzZ0wx9zCXFx9d7qgxyrh3bFbMKwqmTkTg4/WXO5mw04QOhvI8soPwv+qjtakQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702700364; a=rsa-sha256; cv=none; b=VHLNN1KX2HlkKDAqljzjYGX6l1NTEi5fgZRUt92Jafh8gv9RNcCPDpJUoddrVRT5nRHOBU Aufqfzc4mALc2rOn+MCSJjUod2p10YY51qvC4n/gpgbXOdoxunRD2zdo9bP1Xa3TAFmP/k 29kYBSBZyYG8J5BhK1AvIzK2GYJdfjaJz6FuEHJCoy3HyR7U8unLPsva512Fdmye0WJFL+ vDPjuTSnazmkNYOT+yKAqYRmXDIJBgYqOAnA4dCJ9Q2SYcbSb4MwfXIiPn0GWO0V+y95BO LiR7jiYkRsDuwL9DuZxe/o1Wqituzm31pferaW34N8xLLZmdSxfzEiJADV3fxg== 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=1702700364; 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=uyrBcYr1rne00skap+DZ5TCktsJaVhDnEHE8gVd6ujU=; b=ugBQNJY0oBsileBept3a0Wo99jysxSGYvNZOIsNFSb6BpvEGQQ4KhAcqey0WfeMmQ5iw+A 8+Mln5G/7Pomw7XQ2kYihLkfB+OLpfYrljBO1LQkL2rpp+hRVzjXRYU23bVOGB3Z4l29cJ 7iIyR6eockUxre0KDLdhJsN4U6hFjUF+NoJF7fiMpDy3Z0Ma++7ovsm39IVlZ53kDEv5bl 2TbkAK3V6dacmowPtOHP1Km5WLigK79o9S5hdxYPRGBVNcsAansrSYhVwoxp3NEq83Zh1T v/SYmAfV+h/EAClSZJg67w4lgee2Xr/hkCRZb9l+FLMTami2Eb8KJKlt3pCTJg== 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 4SsXsm0R0DzfcW; Sat, 16 Dec 2023 04:19:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BG4JNl9059462; Sat, 16 Dec 2023 04:19:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BG4JNX7059459; Sat, 16 Dec 2023 04:19:23 GMT (envelope-from git) Date: Sat, 16 Dec 2023 04:19:23 GMT Message-Id: <202312160419.3BG4JNX7059459@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: fff086cfeafc - stable/13 - strfmon: style fixes 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: fff086cfeafc110f94a40eb340ddc8b13d8df0cd Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=fff086cfeafc110f94a40eb340ddc8b13d8df0cd commit fff086cfeafc110f94a40eb340ddc8b13d8df0cd Author: Jose Luis Duran AuthorDate: 2023-11-30 23:28:21 +0000 Commit: Konstantin Belousov CommitDate: 2023-12-16 04:18:48 +0000 strfmon: style fixes (cherry picked from commit 56a0d5444d6f39302f3476b61c1b81ed39abe589) --- lib/libc/stdlib/strfmon.c | 197 +++++++++++++++++++++++----------------------- 1 file changed, 99 insertions(+), 98 deletions(-) diff --git a/lib/libc/stdlib/strfmon.c b/lib/libc/stdlib/strfmon.c index d770b6f32bd1..1c9eb3f45d74 100644 --- a/lib/libc/stdlib/strfmon.c +++ b/lib/libc/stdlib/strfmon.c @@ -34,6 +34,7 @@ #include #include + #include #include #include @@ -58,7 +59,7 @@ /* internal macros */ #define PRINT(CH) do { \ - if (dst >= s + maxsize) \ + if (dst >= s + maxsize) \ goto e2big_error; \ *dst++ = CH; \ } while (0) @@ -69,9 +70,9 @@ PRINT(*tmps++); \ } while (0) -#define GET_NUMBER(VAR, LOC) do { \ +#define GET_NUMBER(VAR, LOC) do { \ VAR = 0; \ - while (isdigit_l((unsigned char)*fmt, LOC)) { \ + while (isdigit_l((unsigned char)*fmt, LOC)) { \ if (VAR > INT_MAX / 10) \ goto e2big_error; \ VAR *= 10; \ @@ -102,22 +103,22 @@ static char *__format_grouped_double(double, int *, int, int, int, struct lconv *, locale_t); static ssize_t -vstrfmon_l(char * __restrict s, size_t maxsize, locale_t loc, - const char * __restrict format, va_list ap) +vstrfmon_l(char *__restrict s, size_t maxsize, locale_t loc, + const char *__restrict format, va_list ap) { char *dst; /* output destination pointer */ const char *fmt; /* current format poistion pointer */ struct lconv *lc; /* pointer to lconv structure */ char *asciivalue; /* formatted double pointer */ - int flags; /* formatting options */ - int pad_char; /* padding character */ - int pad_size; /* pad size */ - int width; /* field width */ - int left_prec; /* left precision */ - int right_prec; /* right precision */ - double value; /* just value */ - char space_char = ' '; /* space after currency */ + int flags; /* formatting options */ + int pad_char; /* padding character */ + int pad_size; /* pad size */ + int width; /* field width */ + int left_prec; /* left precision */ + int right_prec; /* right precision */ + double value; /* just value */ + char space_char = ' '; /* space after currency */ char cs_precedes, /* values gathered from struct lconv */ sep_by_space, @@ -127,6 +128,7 @@ vstrfmon_l(char * __restrict s, size_t maxsize, locale_t loc, char *tmpptr; /* temporary vars */ int sverrno; + FIX_LOCALE(loc); lc = localeconv_l(loc); @@ -135,7 +137,7 @@ vstrfmon_l(char * __restrict s, size_t maxsize, locale_t loc, asciivalue = NULL; currency_symbol = NULL; - while (*fmt) { + while (*fmt != 0) { /* pass nonformating characters AS IS */ if (*fmt != '%') goto literal; @@ -145,13 +147,13 @@ vstrfmon_l(char * __restrict s, size_t maxsize, locale_t loc, /* "%%" mean just '%' */ if (*(fmt + 1) == '%') { fmt++; - literal: +literal: PRINT(*fmt++); continue; } /* set up initial values */ - flags = (NEED_GROUPING|LOCALE_POSN); + flags = NEED_GROUPING | LOCALE_POSN; pad_char = ' '; /* padding character is "space" */ pad_size = 0; /* no padding initially */ left_prec = -1; /* no left precision specified */ @@ -161,32 +163,32 @@ vstrfmon_l(char * __restrict s, size_t maxsize, locale_t loc, /* Flags */ while (1) { switch (*++fmt) { - case '=': /* fill character */ - pad_char = *++fmt; - if (pad_char == '\0') - goto format_error; - continue; - case '^': /* not group currency */ - flags &= ~(NEED_GROUPING); - continue; - case '+': /* use locale defined signs */ - if (flags & SIGN_POSN_USED) - goto format_error; - flags |= (SIGN_POSN_USED|LOCALE_POSN); - continue; - case '(': /* enclose negatives with () */ - if (flags & SIGN_POSN_USED) - goto format_error; - flags |= (SIGN_POSN_USED|PARENTH_POSN); - continue; - case '!': /* suppress currency symbol */ - flags |= SUPPRESS_CURR_SYMBOL; - continue; - case '-': /* alignment (left) */ - flags |= LEFT_JUSTIFY; - continue; - default: - break; + case '=': /* fill character */ + pad_char = *++fmt; + if (pad_char == '\0') + goto format_error; + continue; + case '^': /* not group currency */ + flags &= ~(NEED_GROUPING); + continue; + case '+': /* use locale defined signs */ + if (flags & SIGN_POSN_USED) + goto format_error; + flags |= (SIGN_POSN_USED | LOCALE_POSN); + continue; + case '(': /* enclose negatives with () */ + if (flags & SIGN_POSN_USED) + goto format_error; + flags |= (SIGN_POSN_USED | PARENTH_POSN); + continue; + case '!': /* suppress currency symbol */ + flags |= SUPPRESS_CURR_SYMBOL; + continue; + case '-': /* alignment (left) */ + flags |= LEFT_JUSTIFY; + continue; + default: + break; } break; } @@ -194,7 +196,8 @@ vstrfmon_l(char * __restrict s, size_t maxsize, locale_t loc, /* field Width */ if (isdigit_l((unsigned char)*fmt, loc)) { GET_NUMBER(width, loc); - /* Do we have enough space to put number with + /* + * Do we have enough space to put number with * required width ? */ if ((unsigned int)width >= maxsize - (dst - s)) @@ -215,22 +218,24 @@ vstrfmon_l(char * __restrict s, size_t maxsize, locale_t loc, if (!isdigit_l((unsigned char)*++fmt, loc)) goto format_error; GET_NUMBER(right_prec, loc); - if ((unsigned int)right_prec >= maxsize - (dst - s) - - left_prec) + if ((unsigned int)right_prec >= + maxsize - (dst - s) - left_prec) goto e2big_error; } /* Conversion Characters */ switch (*fmt++) { - case 'i': /* use international currency format */ - flags |= USE_INTL_CURRENCY; - break; - case 'n': /* use national currency format */ - flags &= ~(USE_INTL_CURRENCY); - break; - default: /* required character is missing or - premature EOS */ - goto format_error; + case 'i': /* use international currency format */ + flags |= USE_INTL_CURRENCY; + break; + case 'n': /* use national currency format */ + flags &= ~(USE_INTL_CURRENCY); + break; + default: /* + * required character is missing or + * premature EOS + */ + goto format_error; } if (currency_symbol != NULL) @@ -246,7 +251,7 @@ vstrfmon_l(char * __restrict s, size_t maxsize, locale_t loc, currency_symbol = strdup(lc->currency_symbol); if (currency_symbol == NULL) - goto end_error; /* ENOMEM. */ + goto end_error; /* ENOMEM. */ /* value itself */ value = va_arg(ap, double); @@ -268,15 +273,17 @@ vstrfmon_l(char * __restrict s, size_t maxsize, locale_t loc, if (asciivalue != NULL) free(asciivalue); - asciivalue = __format_grouped_double(value, &flags, - left_prec, right_prec, pad_char, lc, loc); + asciivalue = __format_grouped_double(value, &flags, left_prec, + right_prec, pad_char, lc, loc); if (asciivalue == NULL) - goto end_error; /* errno already set */ - /* to ENOMEM by malloc() */ + goto end_error; /* + * errno already set to ENOMEM by + * malloc() + */ /* set some variables for later use */ - __setup_vars(flags, &cs_precedes, &sep_by_space, - &sign_posn, &signstr, lc); + __setup_vars(flags, &cs_precedes, &sep_by_space, &sign_posn, + &signstr, lc); /* * Description of some LC_MONETARY's values: @@ -307,7 +314,6 @@ vstrfmon_l(char * __restrict s, size_t maxsize, locale_t loc, * $currency_symbol * = 3 - the sign string precedes the $currency_symbol * = 4 - the sign string succeeds the $currency_symbol - * */ tmpptr = dst; @@ -353,12 +359,10 @@ vstrfmon_l(char * __restrict s, size_t maxsize, locale_t loc, } if (!(flags & SUPPRESS_CURR_SYMBOL)) { - if ((sign_posn == 3 && sep_by_space == 2) - || (sep_by_space == 1 - && (sign_posn == 0 - || sign_posn == 1 - || sign_posn == 2 - || sign_posn == 4))) + if ((sign_posn == 3 && sep_by_space == 2) || + (sep_by_space == 1 && + (sign_posn == 0 || sign_posn == 1 || + sign_posn == 2 || sign_posn == 4))) PRINT(space_char); PRINTS(currency_symbol); if (sign_posn == 4) { @@ -399,7 +403,7 @@ vstrfmon_l(char * __restrict s, size_t maxsize, locale_t loc, PRINT('\0'); free(asciivalue); free(currency_symbol); - return (dst - s - 1); /* return size of put data except trailing '\0' */ + return (dst - s - 1); /* size of put data except trailing '\0' */ e2big_error: errno = E2BIG; @@ -419,15 +423,15 @@ end_error: } static void -__setup_vars(int flags, char *cs_precedes, char *sep_by_space, - char *sign_posn, char **signstr, struct lconv *lc) +__setup_vars(int flags, char *cs_precedes, char *sep_by_space, char *sign_posn, + char **signstr, struct lconv *lc) { if ((flags & IS_NEGATIVE) && (flags & USE_INTL_CURRENCY)) { *cs_precedes = lc->int_n_cs_precedes; *sep_by_space = lc->int_n_sep_by_space; *sign_posn = (flags & PARENTH_POSN) ? 0 : lc->int_n_sign_posn; - *signstr = (lc->negative_sign[0] == '\0') ? "-" - : lc->negative_sign; + *signstr = (lc->negative_sign[0] == '\0') ? "-" : + lc->negative_sign; } else if (flags & USE_INTL_CURRENCY) { *cs_precedes = lc->int_p_cs_precedes; *sep_by_space = lc->int_p_sep_by_space; @@ -437,8 +441,8 @@ __setup_vars(int flags, char *cs_precedes, char *sep_by_space, *cs_precedes = lc->n_cs_precedes; *sep_by_space = lc->n_sep_by_space; *sign_posn = (flags & PARENTH_POSN) ? 0 : lc->n_sign_posn; - *signstr = (lc->negative_sign[0] == '\0') ? "-" - : lc->negative_sign; + *signstr = (lc->negative_sign[0] == '\0') ? "-" : + lc->negative_sign; } else { *cs_precedes = lc->p_cs_precedes; *sep_by_space = lc->p_sep_by_space; @@ -461,8 +465,8 @@ __calc_left_pad(int flags, char *cur_symb, struct lconv *lc) char cs_precedes, sep_by_space, sign_posn, *signstr; int left_chars = 0; - __setup_vars(flags, &cs_precedes, &sep_by_space, &sign_posn, - &signstr, lc); + __setup_vars(flags, &cs_precedes, &sep_by_space, &sign_posn, &signstr, + lc); if (cs_precedes != 0) { left_chars += strlen(cur_symb); @@ -471,17 +475,17 @@ __calc_left_pad(int flags, char *cur_symb, struct lconv *lc) } switch (sign_posn) { - case 0: - if (flags & IS_NEGATIVE) - left_chars++; - break; - case 1: + case 0: + if (flags & IS_NEGATIVE) + left_chars++; + break; + case 1: + left_chars += strlen(signstr); + break; + case 3: + case 4: + if (cs_precedes != 0) left_chars += strlen(signstr); - break; - case 3: - case 4: - if (cs_precedes != 0) - left_chars += strlen(signstr); } return (left_chars); } @@ -511,8 +515,8 @@ get_groups(int size, char *grouping) /* convert double to locale-encoded string */ static char * -__format_grouped_double(double value, int *flags, - int left_prec, int right_prec, int pad_char, struct lconv *lc, locale_t loc) +__format_grouped_double(double value, int *flags, int left_prec, int right_prec, + int pad_char, struct lconv *lc, locale_t loc) { char *rslt; @@ -530,7 +534,7 @@ __format_grouped_double(double value, int *flags, size_t decimal_point_size; size_t thousands_sep_size; - int groups = 0; + int groups = 0; grouping = lc->mon_grouping; decimal_point = lc->mon_decimal_point; @@ -593,10 +597,8 @@ __format_grouped_double(double value, int *flags, avalue_size -= (right_prec + 1); } - if ((*flags & NEED_GROUPING) && - thousands_sep_size > 0 && - *grouping != CHAR_MAX && - *grouping > 0) { + if ((*flags & NEED_GROUPING) && thousands_sep_size > 0 && + *grouping != CHAR_MAX && *grouping > 0) { while (avalue_size > (int)*grouping) { GRPCPY(*grouping); GRPSEP; @@ -639,8 +641,7 @@ __format_grouped_double(double value, int *flags, } ssize_t -strfmon(char * __restrict s, size_t maxsize, const char * __restrict format, - ...) +strfmon(char *__restrict s, size_t maxsize, const char *__restrict format, ...) { ssize_t ret; va_list ap; @@ -653,8 +654,8 @@ strfmon(char * __restrict s, size_t maxsize, const char * __restrict format, } ssize_t -strfmon_l(char * __restrict s, size_t maxsize, locale_t loc, - const char * __restrict format, ...) +strfmon_l(char *__restrict s, size_t maxsize, locale_t loc, + const char *__restrict format, ...) { ssize_t ret; va_list ap; From nobody Sat Dec 16 04:19:25 2023 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 4SsXsn3qnSz54WsZ; Sat, 16 Dec 2023 04:19:25 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SsXsn2GBXz3CsQ; Sat, 16 Dec 2023 04:19:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702700365; 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=0MRxuaTh7PeJ6bY+l6xOHYawA8p0yzUmKOrhZbvudng=; b=LRMSntmGOXx99C1rtJ2wPPP9JjX3VW9+QrLb2FVpmGfgahSaEHFrZQjT8smHY4VNg4m+Ge cZPyMdKdCv0jk+R2Hv9bq9P3TdehPRta/O43jLzDR89+3fdx3b4XAHKhX1imkd3MUt95H5 x8AeQCjnoNbdgqfbawEIqZ1XSBFHZTzMiZ/tJYVUyCI92HuNl1mwANBfprPVgNd7EUbzXg U6Y74pyvddLPftJsTbc9dOGJqCCkdNlzxTaMr8BwSWv1C+T26NSeiAWiD58jls7kFyZt/G t8Qm754x9jFmYtSTIZEyKwZqZqd8txDBSPmWE1iS9CJn7fEqaBOmjs0WV4eYrg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702700365; a=rsa-sha256; cv=none; b=s8/vkiPQsAQLADjCVGUzZkoKXwj4dh2I7zll15Jzrrk6yQTpk/So24PaN2F5qlKgNnvTuQ lI2XuOVhmHivdxpmjL3r7/uSuo0LA0f9upLwzrE4ApNEi7VVtso1T2eWHRSKXY/PuTtPo/ uNLCnMw6/BPRvS8Domea52pbjTYEzgGmBy20pCSLFwsza0l9wRsDvhK/+rwDxVCV++B4Z6 x/v6e/JfIHVZj3cI3uSz7P6jLrd/b/PbvF9yP+/COIXrcVOHxiPCGerYoOzkLgVtDYdhd/ hkp6MV6umUvFjvvKvTL/R6We6/1JwqojwOovc7nf+aeckTzSt0UkXPzRXl3gEA== 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=1702700365; 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=0MRxuaTh7PeJ6bY+l6xOHYawA8p0yzUmKOrhZbvudng=; b=cYnTO3ndQpKmWIPr/dNVCVwT7GI2ToOfUDv9nW6XfN3rYHVExAD9bweWaTRXe5nralNdjx jBUrpN69IVJUDG2VwsU3g4AZxtMFA/ExQOjN927Ot55TefDRbyIJQ7d8ojlrzUKpf4jjOr Ce/BSbKdbAz3Unb3BhQKQGgttbH0/p/sbBpZ/gjlgbpJvxpqzt/T4tj4gdLjuUWO/Cud5l Ba8IX/jjPdag//OE54+8rpAXzuY791VyeyRCEf1l/QwHdkqG9BrtDeo6i/yjXeNZLJk72j WTppiRlBpwpzNdm1eAEOLFDTTrdsQQdpaQ9jFf5fEsKsw7UOA4GcNkKN9EKKfg== 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 4SsXsn133zzfcX; Sat, 16 Dec 2023 04:19:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BG4JPb8059507; Sat, 16 Dec 2023 04:19:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BG4JPx3059504; Sat, 16 Dec 2023 04:19:25 GMT (envelope-from git) Date: Sat, 16 Dec 2023 04:19:25 GMT Message-Id: <202312160419.3BG4JPx3059504@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 47218ed5407a - stable/13 - strfmon.c: Use the restrict keyword directly 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 47218ed5407a2edaf29d8ee7f715717d933af2c3 Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=47218ed5407a2edaf29d8ee7f715717d933af2c3 commit 47218ed5407a2edaf29d8ee7f715717d933af2c3 Author: Konstantin Belousov AuthorDate: 2023-12-09 01:21:02 +0000 Commit: Konstantin Belousov CommitDate: 2023-12-16 04:18:48 +0000 strfmon.c: Use the restrict keyword directly (cherry picked from commit 86e2bcbf47fb4c8dbd799f2f21c0ed338b2e8f1b) --- lib/libc/stdlib/strfmon.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/libc/stdlib/strfmon.c b/lib/libc/stdlib/strfmon.c index 1c9eb3f45d74..d3efc9080c09 100644 --- a/lib/libc/stdlib/strfmon.c +++ b/lib/libc/stdlib/strfmon.c @@ -641,7 +641,7 @@ __format_grouped_double(double value, int *flags, int left_prec, int right_prec, } ssize_t -strfmon(char *__restrict s, size_t maxsize, const char *__restrict format, ...) +strfmon(char *restrict s, size_t maxsize, const char *restrict format, ...) { ssize_t ret; va_list ap; @@ -654,8 +654,8 @@ strfmon(char *__restrict s, size_t maxsize, const char *__restrict format, ...) } ssize_t -strfmon_l(char *__restrict s, size_t maxsize, locale_t loc, - const char *__restrict format, ...) +strfmon_l(char *restrict s, size_t maxsize, locale_t loc, + const char *restrict format, ...) { ssize_t ret; va_list ap; From nobody Sat Dec 16 10:29:47 2023 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 4Ssj575xr7z53jgh; Sat, 16 Dec 2023 10:29:47 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ssj574Swtz4Fgv; Sat, 16 Dec 2023 10:29:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702722587; 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=7O19AEHWfiyYYEmMepzv9BNPstNk/e+Tayv6q6FedRo=; b=pj6z2sP9LF6M0jHRaHlSnt9qeWyXo8rDwWR24eUvAJ/SYVQhtP3S6PgooGD/wTL0G6itFb wPiL7NTQZ9Fsa0RN+uc9UaCs43Fynl+V3QR1Mn//BO42G6xYPTAmAcieyHE4GZaWbm3PQ8 T5836b3s8G8fBpgMxKPFUlWcsb7EB4yP8R3T7SonYFRYMtGH7sikQNMF1JzpTABOEUP9jo lbkJtqSCQvtC6Z1BxqtKLJ2AfYOEEfQihqsIKbEtDgjtnJts1Dq6OM+th0x6LyMcA6/wUR uAoqXopS5JRP9QUyedyBMWLMRL3vsgZslpc6E9tzELSp58e3prR6Xa4CWRXnsg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702722587; a=rsa-sha256; cv=none; b=oZLrvSA7JLnpA13iH4yJmP2ta+nGgmE92Ejv0zQ9H6/6v6HUOQ1sCE9mNKSYXAvam4/Vs6 uW7O5VT0PG0Bdh/f6tDQYiczrNaP5vnkzF+1G6R5isL5cG9DgcMkgCNgY1FEo6L7CaHiKc Gj9o92Jdbd88taqp9eZgsv+2LPKjtM+4FTQc173Mu0pKZKr9hSduRFnPLnwpN/Z5dhEG3q bmXZDzKRoT/48Aqo1S7IhDuWDkNFC0+tUUyMjAlMOj/IDnsd1unhK2FH9bjjN/v4V9nS4J cvvBan7TIdd6gxBUfduij5/m8YEqkiPK/Tu4TxyYBb2QiMcsQ71DU0VY1VrjKw== 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=1702722587; 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=7O19AEHWfiyYYEmMepzv9BNPstNk/e+Tayv6q6FedRo=; b=qvxO31IFYzjACBNmK1GgK2ap1fwWS6nSJMoG9Z7qDJXoWbkbeMnEHRUeb/afMJtYI1eMzJ MbYI7o7sj+RGuWiZMVDFFdrTjCBxum2naAnO5jcywG54DEAkfrajzwob/6Vk/g+PRtp4qT YqlnGDmReLoKFLAwMLI8Dq2HEmN7WLcSs5HniAWgveiMn7cDQ5qcgBOiiMoGWN5k7ZQF/u 69SfKl0buDJAine/bUfyTs8E1ZeEOuY9Yv+MQU1ZSzO7KUEQGTNp8TDBIGU+YIqT9H8um0 wg2YHnzGvFXNRvdsNGfotjC0mOEjcILb+azlJ8jPxTeo5mK7LZkAG3VVuFhC3w== 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 4Ssj573S07zqH6; Sat, 16 Dec 2023 10:29:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BGATlHW077916; Sat, 16 Dec 2023 10:29:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BGATlYU077913; Sat, 16 Dec 2023 10:29:47 GMT (envelope-from git) Date: Sat, 16 Dec 2023 10:29:47 GMT Message-Id: <202312161029.3BGATlYU077913@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Richard Scheffenegger Subject: git: 544bfa7cea3b - stable/14 - tcp: properly initialize LRD while accepting session in syncache 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rscheff X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 544bfa7cea3bb9e9525d84fad42a406912f42e17 Auto-Submitted: auto-generated The branch stable/14 has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=544bfa7cea3bb9e9525d84fad42a406912f42e17 commit 544bfa7cea3bb9e9525d84fad42a406912f42e17 Author: Richard Scheffenegger AuthorDate: 2023-12-02 11:15:37 +0000 Commit: Richard Scheffenegger CommitDate: 2023-12-15 08:23:45 +0000 tcp: properly initialize LRD while accepting session in syncache Inherit the setting from the listener socket in syncache_socket. MFC after: 2 weeks Reviewed By: tuexen, #transport Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D42874 (cherry picked from commit f071abd92e726fc12e9256662e1f286f364252ee) --- sys/netinet/tcp_syncache.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c index ffde6a4b88c9..2c381ef600d6 100644 --- a/sys/netinet/tcp_syncache.c +++ b/sys/netinet/tcp_syncache.c @@ -952,7 +952,8 @@ syncache_socket(struct syncache *sc, struct socket *lso, struct mbuf *m) tp->rcv_adv += tp->rcv_wnd; tp->last_ack_sent = tp->rcv_nxt; - tp->t_flags = sototcpcb(lso)->t_flags & (TF_NOPUSH|TF_NODELAY); + tp->t_flags = sototcpcb(lso)->t_flags & + (TF_LRD|TF_NOPUSH|TF_NODELAY); if (sc->sc_flags & SCF_NOOPT) tp->t_flags |= TF_NOOPT; else { From nobody Sat Dec 16 10:29:48 2023 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 4Ssj586yLRz53jtN; Sat, 16 Dec 2023 10:29:48 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ssj585DJCz4FkT; Sat, 16 Dec 2023 10:29:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702722588; 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=zngPLfG+louomLH/+kOhPsxHqVlLaXK9dtz3sJ4P9DA=; b=TexEMPQTdCpe8B2quv9mtTPSSbhecYeAdoTYOV5duLCO1UDLLblTdGuAiCTsqhQ01nWJmp tvCpvjsn80XO20vZbt13Esc0kBMj4x36ZIUH2coi0U4+FPwdsgw9c3OcMNylfIWx+YfE0p 8T1j2OHKfJTnsQHeca1SuZBfIdHPP9kT+EIUAGaHhaozkps0+gNn1bQXqs6zhwt3dM1iNN tql3ASEV4u44w7TFqjNqgL3R0zH4lVmRhnwnWEGK1hfFc7jL8UY1dfwgBIFal+ATyfoVOa /LT8iTyi/tNoSgv9roGCE8TXd6BYyBBgyu3mBy1lH6wBZIzpEFz3HhmS+gBF6A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702722588; a=rsa-sha256; cv=none; b=cR+jk20I8oeKvCh8obMnk2AqR3SKu3Jlp2evO/7qOh5/lU/GHSsHzLhLAegGzM2Yy4C2AD UwO21Or26vnwND5MEAHGpSh3YSPdnyxArU3thcSE4ucUrXQk3f45JHXpuHrZe5Skv1BWwo y802psns+jH7fWaSoDD33x63WF804G1X7fVXmKjkhidEVmOX+YTcdSpp+5KnY+sJD8lbax 9OpWhWsZBocAy1FZnUU5ECQEVDltp0UZFSQ1mX1z1A+EQk60v/toZgynRbTRu+EIxfaUlv xtjXknkOYRerD2x6ZObQVk5TRGPRhnw3x18EEvAnErBXgdzHx/PWMY3x6dBnpA== 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=1702722588; 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=zngPLfG+louomLH/+kOhPsxHqVlLaXK9dtz3sJ4P9DA=; b=lYS4gkL4oYnTvLVjtGcwtjb4t+34/nKyxJZJPRFDOZw2/vYIvyQgWxeyVUTuu7G9/DJpM/ x53O2GUMR1eQVraNrbY892n2yFbadqoAQWSqaCxpsxR00f4zhLTIWZw5oby0X2SOKGqJXi +dnvdwIcz6l1vF1EySR7+QKpuZwbp2hEOFxAYFY2IEmxhg4LnPLN4fe7deMqhh+U+yCr/u FV+fFVloZq24mUU3//jhwvYIqPl4VKeYAjmSrEdjnX8swXnDnxCACTLOct67eYVZRYZxzq ofndOvI5VcalKxC8BLrWO2XKt8MfQVyZfSPbIgAm3eUrYl26UvdqrU4FiDJjMQ== 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 4Ssj58491mzqcr; Sat, 16 Dec 2023 10:29:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BGATmNi077970; Sat, 16 Dec 2023 10:29:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BGATmPS077967; Sat, 16 Dec 2023 10:29:48 GMT (envelope-from git) Date: Sat, 16 Dec 2023 10:29:48 GMT Message-Id: <202312161029.3BGATmPS077967@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Richard Scheffenegger Subject: git: 1fdbb16f405f - stable/14 - tcp: add PRR 6937bis heuristic and retire prr_conservative sysctl 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rscheff X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1fdbb16f405fb44beb204c06c3c573ff7e402f2a Auto-Submitted: auto-generated The branch stable/14 has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=1fdbb16f405fb44beb204c06c3c573ff7e402f2a commit 1fdbb16f405fb44beb204c06c3c573ff7e402f2a Author: Richard Scheffenegger AuthorDate: 2023-11-15 21:37:42 +0000 Commit: Richard Scheffenegger CommitDate: 2023-12-15 08:25:07 +0000 tcp: add PRR 6937bis heuristic and retire prr_conservative sysctl Improve Proportional Rate Reduction (RFC6937) by using a heuristic, which automatically chooses between conservative CRB and more aggressive SSRB modes. Only when snd_una advances (a partial ACK), SSRB may be used. Also, that ACK must not have any indication of ongoing loss - using the addition of new holes into the scoreboard as proxy for such an event. MFC after: 4 weeks Reviewed By: #transport, kbowling, rrs Sponsored By: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D28822 (cherry picked from commit 49a6fbe38728173da74d5b497f700178e2a6c830) --- share/man/man4/tcp.4 | 8 +------- sys/netinet/tcp_input.c | 47 +++++++++++++++++++++++++++++++---------------- sys/netinet/tcp_sack.c | 32 ++++++++++++++++++++------------ sys/netinet/tcp_var.h | 13 ++++++++++--- 4 files changed, 62 insertions(+), 38 deletions(-) diff --git a/share/man/man4/tcp.4 b/share/man/man4/tcp.4 index 0ee57dcb0594..16c9e0ce84df 100644 --- a/share/man/man4/tcp.4 +++ b/share/man/man4/tcp.4 @@ -33,7 +33,7 @@ .\" .\" From: @(#)tcp.4 8.1 (Berkeley) 6/5/93 .\" -.Dd June 29, 2023 +.Dd November 17, 2023 .Dt TCP 4 .Os .Sh NAME @@ -480,12 +480,6 @@ This improves the effectiveness of retransmissions particular in environments with ACK thinning or burst loss events, as chances to run out of the ACK clock are reduced, preventing lengthy and performance reducing RTO based loss recovery (default is true). -.It Va do_prr_conservative -While doing Proportional Rate Reduction, remain strictly in a packet conserving -mode, sending only one new packet for each ACK received. -Helpful when a misconfigured token bucket traffic policer causes persistent -high losses leading to RTO, but reduces PRR effectiveness in more common settings -(default is false). .It Va do_tcpdrain Flush packets in the .Tn TCP diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 15b7311f4605..9f7e42b582c6 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -159,11 +159,6 @@ SYSCTL_INT(_net_inet_tcp, OID_AUTO, drop_synfin, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(drop_synfin), 0, "Drop TCP packets with SYN+FIN set"); -VNET_DEFINE(int, tcp_do_prr_conservative) = 0; -SYSCTL_INT(_net_inet_tcp, OID_AUTO, do_prr_conservative, CTLFLAG_VNET | CTLFLAG_RW, - &VNET_NAME(tcp_do_prr_conservative), 0, - "Do conservative Proportional Rate Reduction"); - VNET_DEFINE(int, tcp_do_prr) = 1; SYSCTL_INT(_net_inet_tcp, OID_AUTO, do_prr, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(tcp_do_prr), 1, @@ -1524,7 +1519,8 @@ tcp_do_segment(struct tcpcb *tp, struct mbuf *m, struct tcphdr *th, int drop_hdrlen, int tlen, uint8_t iptos) { uint16_t thflags; - int acked, ourfinisacked, needoutput = 0, sack_changed; + int acked, ourfinisacked, needoutput = 0; + sackstatus_t sack_changed; int rstreason, todrop, win, incforsyn = 0; uint32_t tiwin; uint16_t nsegs; @@ -1539,7 +1535,7 @@ tcp_do_segment(struct tcpcb *tp, struct mbuf *m, struct tcphdr *th, thflags = tcp_get_flags(th); tp->sackhint.last_sack_ack = 0; - sack_changed = 0; + sack_changed = SACK_NOCHANGE; nsegs = max(1, m->m_pkthdr.lro_nsegs); NET_EPOCH_ASSERT(); @@ -2582,7 +2578,7 @@ tcp_do_segment(struct tcpcb *tp, struct mbuf *m, struct tcphdr *th, */ if (th->th_ack != tp->snd_una || (tcp_is_sack_recovery(tp, &to) && - !sack_changed)) + (sack_changed == SACK_NOCHANGE))) break; else if (!tcp_timer_active(tp, TT_REXMT)) tp->t_dupacks = 0; @@ -2591,8 +2587,9 @@ tcp_do_segment(struct tcpcb *tp, struct mbuf *m, struct tcphdr *th, cc_ack_received(tp, th, nsegs, CC_DUPACK); if (V_tcp_do_prr && - IN_FASTRECOVERY(tp->t_flags)) { - tcp_do_prr_ack(tp, th, &to); + IN_FASTRECOVERY(tp->t_flags) && + (tp->t_flags & TF_SACK_PERMIT)) { + tcp_do_prr_ack(tp, th, &to, sack_changed); } else if (tcp_is_sack_recovery(tp, &to) && IN_FASTRECOVERY(tp->t_flags)) { int awnd; @@ -2667,8 +2664,12 @@ enter_recovery: * cc_cong_signal. */ if (tcp_is_sack_recovery(tp, &to)) { + /* + * Exclude Limited Transmit + * segments here + */ tp->sackhint.prr_delivered = - tp->sackhint.sacked_bytes; + maxseg; } else { tp->sackhint.prr_delivered = imin(tp->snd_max - tp->snd_una, @@ -2771,7 +2772,7 @@ enter_recovery: * counted as dupacks here. */ if (tcp_is_sack_recovery(tp, &to) && - sack_changed) { + (sack_changed != SACK_NOCHANGE)) { tp->t_dupacks++; /* limit overhead by setting maxseg last */ if (!IN_FASTRECOVERY(tp->t_flags) && @@ -2797,7 +2798,7 @@ resume_partialack: if (V_tcp_do_prr && to.to_flags & TOF_SACK) { tcp_timer_activate(tp, TT_REXMT, 0); tp->t_rtttime = 0; - tcp_do_prr_ack(tp, th, &to); + tcp_do_prr_ack(tp, th, &to, sack_changed); tp->t_flags |= TF_ACKNOW; (void) tcp_output(tp); } else @@ -2811,7 +2812,11 @@ resume_partialack: if (V_tcp_do_prr) { tp->sackhint.delivered_data = BYTES_THIS_ACK(tp, th); tp->snd_fack = th->th_ack; - tcp_do_prr_ack(tp, th, &to); + /* + * During ECN cwnd reduction + * always use PRR-SSRB + */ + tcp_do_prr_ack(tp, th, &to, SACK_CHANGE); (void) tcp_output(tp); } } else @@ -3934,7 +3939,7 @@ tcp_mssopt(struct in_conninfo *inc) } void -tcp_do_prr_ack(struct tcpcb *tp, struct tcphdr *th, struct tcpopt *to) +tcp_do_prr_ack(struct tcpcb *tp, struct tcphdr *th, struct tcpopt *to, sackstatus_t sack_changed) { int snd_cnt = 0, limit = 0, del_data = 0, pipe = 0; int maxseg = tcp_maxseg(tp); @@ -3974,7 +3979,17 @@ tcp_do_prr_ack(struct tcpcb *tp, struct tcphdr *th, struct tcpopt *to) tp->snd_ssthresh, tp->sackhint.recover_fs) - tp->sackhint.prr_out + maxseg - 1; } else { - if (V_tcp_do_prr_conservative || (del_data == 0)) + /* + * PRR 6937bis heuristic: + * - A partial ack without SACK block beneath snd_recover + * indicates further loss. + * - An SACK scoreboard update adding a new hole indicates + * further loss, so be conservative and send at most one + * segment. + * - Prevent ACK splitting attacks, by being conservative + * when no new data is acked. + */ + if ((sack_changed == SACK_NEWLOSS) || (del_data == 0)) limit = tp->sackhint.prr_delivered - tp->sackhint.prr_out; else diff --git a/sys/netinet/tcp_sack.c b/sys/netinet/tcp_sack.c index fca4b99ee83b..05aaa0b4a662 100644 --- a/sys/netinet/tcp_sack.c +++ b/sys/netinet/tcp_sack.c @@ -544,21 +544,23 @@ tcp_sackhole_remove(struct tcpcb *tp, struct sackhole *hole) * Process cumulative ACK and the TCP SACK option to update the scoreboard. * tp->snd_holes is an ordered list of holes (oldest to newest, in terms of * the sequence space). - * Returns 1 if incoming ACK has previously unknown SACK information, - * 0 otherwise. + * Returns SACK_NEWLOSS if incoming ACK indicates ongoing loss (hole split, new hole), + * SACK_CHANGE if incoming ACK has previously unknown SACK information, + * SACK_NOCHANGE otherwise. */ -int +sackstatus_t tcp_sack_doack(struct tcpcb *tp, struct tcpopt *to, tcp_seq th_ack) { struct sackhole *cur, *temp; struct sackblk sack, sack_blocks[TCP_MAX_SACK + 1], *sblkp; - int i, j, num_sack_blks, sack_changed; + int i, j, num_sack_blks; + sackstatus_t sack_changed; int delivered_data, left_edge_delta; INP_WLOCK_ASSERT(tptoinpcb(tp)); num_sack_blks = 0; - sack_changed = 0; + sack_changed = SACK_NOCHANGE; delivered_data = 0; left_edge_delta = 0; /* @@ -577,7 +579,7 @@ tcp_sack_doack(struct tcpcb *tp, struct tcpopt *to, tcp_seq th_ack) if (SEQ_LT(tp->snd_fack, th_ack)) { delivered_data += th_ack - tp->snd_una; tp->snd_fack = th_ack; - sack_changed = 1; + sack_changed = SACK_CHANGE; } } /* @@ -667,7 +669,7 @@ tcp_sack_doack(struct tcpcb *tp, struct tcpopt *to, tcp_seq th_ack) delivered_data += sblkp->end - sblkp->start; tp->snd_fack = sblkp->end; sblkp--; - sack_changed = 1; + sack_changed = SACK_NEWLOSS; } else { /* * Append a new SACK hole at the tail. If the @@ -681,7 +683,7 @@ tcp_sack_doack(struct tcpcb *tp, struct tcpopt *to, tcp_seq th_ack) tp->snd_fack = sblkp->end; /* Go to the previous sack block. */ sblkp--; - sack_changed = 1; + sack_changed = SACK_CHANGE; } else { /* * We failed to add a new hole based on the current @@ -698,7 +700,12 @@ tcp_sack_doack(struct tcpcb *tp, struct tcpopt *to, tcp_seq th_ack) SEQ_LT(tp->snd_fack, sblkp->end)) { delivered_data += sblkp->end - tp->snd_fack; tp->snd_fack = sblkp->end; - sack_changed = 1; + /* + * While the Scoreboard didn't change in + * size, we only ended up here because + * some SACK data had to be dismissed. + */ + sack_changed = SACK_NEWLOSS; } } } @@ -706,7 +713,7 @@ tcp_sack_doack(struct tcpcb *tp, struct tcpopt *to, tcp_seq th_ack) /* fack is advanced. */ delivered_data += sblkp->end - tp->snd_fack; tp->snd_fack = sblkp->end; - sack_changed = 1; + sack_changed = SACK_CHANGE; } cur = TAILQ_LAST(&tp->snd_holes, sackhole_head); /* Last SACK hole. */ /* @@ -734,7 +741,7 @@ tcp_sack_doack(struct tcpcb *tp, struct tcpopt *to, tcp_seq th_ack) (SEQ_MIN(cur->rxmit, cur->end) - cur->start); KASSERT(tp->sackhint.sack_bytes_rexmit >= 0, ("sackhint bytes rtx >= 0")); - sack_changed = 1; + sack_changed = SACK_CHANGE; if (SEQ_LEQ(sblkp->start, cur->start)) { /* Data acks at least the beginning of hole. */ if (SEQ_GEQ(sblkp->end, cur->end)) { @@ -771,6 +778,7 @@ tcp_sack_doack(struct tcpcb *tp, struct tcpopt *to, tcp_seq th_ack) */ temp = tcp_sackhole_insert(tp, sblkp->end, cur->end, cur); + sack_changed = SACK_NEWLOSS; if (temp != NULL) { if (SEQ_GT(cur->rxmit, temp->rxmit)) { temp->rxmit = cur->rxmit; @@ -808,7 +816,7 @@ tcp_sack_doack(struct tcpcb *tp, struct tcpopt *to, tcp_seq th_ack) * DupAck for this. Also required * for RFC6675 rescue retransmission. */ - sack_changed = 0; + sack_changed = SACK_NOCHANGE; tp->sackhint.delivered_data = delivered_data; tp->sackhint.sacked_bytes += delivered_data - left_edge_delta; KASSERT((delivered_data >= 0), ("delivered_data < 0")); diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h index cd5712132522..624de66e3e23 100644 --- a/sys/netinet/tcp_var.h +++ b/sys/netinet/tcp_var.h @@ -502,6 +502,13 @@ struct tcptemp { struct tcphdr tt_t; }; +/* SACK scoreboard update status */ +typedef enum { + SACK_NOCHANGE = 0, + SACK_CHANGE, + SACK_NEWLOSS +} sackstatus_t; + /* Enable TCP/UDP tunneling port */ #define TCP_TUNNELING_PORT_MIN 0 #define TCP_TUNNELING_PORT_MAX 65535 @@ -1301,7 +1308,6 @@ VNET_DECLARE(struct inpcbinfo, tcbinfo); #define V_tcp_do_lrd VNET(tcp_do_lrd) #define V_tcp_do_prr VNET(tcp_do_prr) -#define V_tcp_do_prr_conservative VNET(tcp_do_prr_conservative) #define V_tcp_do_newcwv VNET(tcp_do_newcwv) #define V_drop_synfin VNET(drop_synfin) #define V_path_mtu_discovery VNET(path_mtu_discovery) @@ -1481,7 +1487,8 @@ extern struct protosw tcp6_protosw; /* shared for TOE */ uint32_t tcp_new_ts_offset(struct in_conninfo *); tcp_seq tcp_new_isn(struct in_conninfo *); -int tcp_sack_doack(struct tcpcb *, struct tcpopt *, tcp_seq); +sackstatus_t + tcp_sack_doack(struct tcpcb *, struct tcpopt *, tcp_seq); int tcp_dsack_block_exists(struct tcpcb *); void tcp_update_dsack_list(struct tcpcb *, tcp_seq, tcp_seq); void tcp_update_sack_list(struct tcpcb *tp, tcp_seq rcv_laststart, tcp_seq rcv_lastend); @@ -1489,7 +1496,7 @@ void tcp_clean_dsack_blocks(struct tcpcb *tp); void tcp_clean_sackreport(struct tcpcb *tp); void tcp_sack_adjust(struct tcpcb *tp); struct sackhole *tcp_sack_output(struct tcpcb *tp, int *sack_bytes_rexmt); -void tcp_do_prr_ack(struct tcpcb *, struct tcphdr *, struct tcpopt *); +void tcp_do_prr_ack(struct tcpcb *, struct tcphdr *, struct tcpopt *, sackstatus_t); void tcp_lost_retransmission(struct tcpcb *, struct tcphdr *); void tcp_sack_partialack(struct tcpcb *, struct tcphdr *); void tcp_free_sackholes(struct tcpcb *tp);