From nobody Mon Apr 29 02:38:08 2024 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 4VSSDd1kqZz5J1fT; Mon, 29 Apr 2024 02:38:09 +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 4VSSDd17n7z4nc3; Mon, 29 Apr 2024 02:38:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714358289; 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=y1cXG/BpGYYWkqkvlbfpo163Gujh3WBDwxp/O+YQTbg=; b=auKxXgzbgsOne3b1zAG0Egf5aoRJbaxza5F3TFnOwcpRAvkbd+kMWm/krybAQNJqg/D7kY 4g8a7l3P1xd89zrJX5/vjwP9Trm5G7tWxf2zZHb2iFWn9zTR2Pxxw0oTJwisOw1mjbwDFY x9nULAWFRCuQ7pdXNgF+2SdF3eE+3OUz6BTfFOF3dgbM+4kq9QB/cTUD+stxFHOKrZMGD6 pIctv17pKTfaHIaX8vGVozeqst7AcBtK0TSLddDijQDVbrc0fXQNSRMOKKWDNO2T3iRuf7 fU1+Sa2KAmoVX7aOUYH8ddgpDQN+YG+FeMb5uzkwPaxE8SZvl/GvUfdKlPe3Vg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714358289; a=rsa-sha256; cv=none; b=DKMJTqmZm45zG/G+PXFv8gdjsYeAgJq7DBVQjJZcGz12cAnGgl4at77/f4TK1yey4VRbyC EnKKy66btaY6PCitjCz32bi0ygRoMME4QvwH/AvEAzTnYBEd8WSTNijnydGQ8QeXXOZH5Y xG6+GnshkLiP6uGx+CFz4teQs2bLkbJdZK9qxJzbgwzf7hLKQ6nS+O2HiFVroJpjxuIj+c VX3nOhVAc6VDNR3TIKqxE60dfWq8dMJEBeYbENE3Sh1u8GrSFBIIRItJfqLs32HJbq9aKY jpdRVz2hJUTEwOeVpn+cMtbC0qrDj6r478EMKSwmp5O0euptWPyA3Hz0iko5LA== 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=1714358289; 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=y1cXG/BpGYYWkqkvlbfpo163Gujh3WBDwxp/O+YQTbg=; b=P+yMaLI2VUnCa5ocE63g449aFl+hCRzbA1/Z7pX6AWWhWzdaoIgs6lZtUsFXKykRo3XWZV IJlfZt5IJL8NUwBNdtFfHDpvBNgFAPQxcGXY/S1VdEmtNk9z0akbi2SFaaOl1doZYoIUki UXxSHnqzAltKCylK0xH5lVonkqio0l0ivxHpj4UEQO1gx8yDZB4MB/Boeay/XbqiZQEXZI d78lIpKSHvMFUe7zoVQA4JTwmnyYYOEWsFwtwsWn6eT7f90mkkwgKTessrJsxq+6kC17g5 pMrIptWUfrZLziDjMYwNYkG32hhay+6khg0YbAQD6EWex2JjV0d6TP3+xTjp8g== 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 4VSSDd0ZTqzr1R; Mon, 29 Apr 2024 02:38:09 +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 43T2c8s3056237; Mon, 29 Apr 2024 02:38:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43T2c8lQ056234; Mon, 29 Apr 2024 02:38:08 GMT (envelope-from git) Date: Mon, 29 Apr 2024 02:38:08 GMT Message-Id: <202404290238.43T2c8lQ056234@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 6063683eb83a - stable/13 - ada: Another NCQ Trim instability drive List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6063683eb83ad7f96850869ffe3d12c6db2dcbb9 Auto-Submitted: auto-generated The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=6063683eb83ad7f96850869ffe3d12c6db2dcbb9 commit 6063683eb83ad7f96850869ffe3d12c6db2dcbb9 Author: Warner Losh AuthorDate: 2024-04-29 02:34:51 +0000 Commit: Warner Losh CommitDate: 2024-04-29 02:35:12 +0000 ada: Another NCQ Trim instability drive The Seagate IronWolf 110 SATA SSD drive has been reported to be unstable with NCQ trim enabled. PR: 264139 Sponsored by: Netflix (cherry picked from commit a6cef617660a424fcaa8343787f96d0ae720a284) --- sys/cam/ata/ata_da.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/cam/ata/ata_da.c b/sys/cam/ata/ata_da.c index c5c567645166..4ad82e8e1fc0 100644 --- a/sys/cam/ata/ata_da.c +++ b/sys/cam/ata/ata_da.c @@ -828,6 +828,11 @@ static struct ada_quirk_entry ada_quirk_table[] = { T_DIRECT, SIP_MEDIA_FIXED, "*", "WDC WDS?????G0*", "*" }, /*quirks*/ADA_Q_4K | ADA_Q_NCQ_TRIM_BROKEN }, + { + /* Seagate IronWolf 110 SATA SSD NCQ Trim is unstable */ + { T_DIRECT, SIP_MEDIA_FIXED, "*", "ZA*NM*", "*" }, + /*quirks*/ADA_Q_4K | ADA_Q_NCQ_TRIM_BROKEN + }, { /* Default */ { From nobody Mon Apr 29 02:49:28 2024 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 4VSSTj27Pcz5J25S; Mon, 29 Apr 2024 02:49: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 4VSSTj1Rxhz4qTM; Mon, 29 Apr 2024 02:49:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714358969; 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=VKZ9eWF6SG+6TOkiG4TFHA9n3eIWa1FtnGIIyOHObTo=; b=s1SbWVo+7u3UgjI5zabWSQg25kukvsUmwYgqGSD3ZiY83OjakUOdsnBFj4vRtFQES5phPr VRYq6HZ98WGrRxLR5NNOBtkLXRE9oL7c+iUWoJBBOCEYSbURpc+l1F5w685ayE0kPCtn+a pZKw/puGd616YHlzlCztLj3+uOYQwBS++r2ME01d8FDnLvcy0lSoHAFxYHwH59AfM22zlr Q71KhdAN8dBs//sCeBHtDx5SOTbUan4shBXRR+Z/6vX+5mZicpTCldTicG/smMzx+DdRBI LeKVBQ5xs0z/H0jPqc8Fh6iWTngcUIbLe1yCqNsTRkdQEVEUflOzg6BUC+kR5g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714358969; a=rsa-sha256; cv=none; b=vx5Im1FPqq5F2+FjTC5tNjGsKyQWI7wbRwFWc+qtiZbAfLFCh/43ZoS1qAf7znKf6fn4eU Z5QiWXWLcVlb2YlMfPcrpeAX0ugxejht0eULjI7K/6SjYo5Nl8Kii0wt4D0bptVPe1J+8o FRijMfJq9WDJ3QsC02TFAEjBNO5PshOBMJugV2Msk2v2d6Zkt+H2Ey1ri/JctN1ZvwwL7C gEV6xIgfp4n+FVJlmaVxxd83u2lJvn+3LGotNmdnTNjLmz7z9skfAPvfaR7spnYggpC2u9 GCxDZb5ERLswWcWwPxU1rb5S0OMXJTg2VOCcaQrSevKdwyeESgS9FVMITuvJRg== 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=1714358969; 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=VKZ9eWF6SG+6TOkiG4TFHA9n3eIWa1FtnGIIyOHObTo=; b=RjNtrvikVARgy0fKCDywc9ccsxW5+1XZr/4r+DYJFJ0WiX5oOSXTQV7psRmVT/5mKmET59 qQqeKVpCSLL4gwSsJFuG6QuC8SV1UccWKla5ZHHw7+Nu+NEIcn+IW4inr17tFBsWkbHamY YDvAFrBJsJc23C2girl15oKwySPOvdl6r1cPXFWOo5gHRhltVD7aDX0Nzlyde6blAvZ1SU VbsnRwq02BAAzguGck19TGEZqikoWmqRiL66/NjrMmhi5RWRMfmnpouNIcRsWfFeF70eVf iQ49Dmn8ThzoYLw8v4Nsv0YvphZcnO3sVCIEwBvLUXJc4akUFuO/rqBvK+mhzw== 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 4VSSTj0mTjzrfb; Mon, 29 Apr 2024 02:49: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 43T2nT4T073442; Mon, 29 Apr 2024 02:49:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43T2nSsM073439; Mon, 29 Apr 2024 02:49:28 GMT (envelope-from git) Date: Mon, 29 Apr 2024 02:49:28 GMT Message-Id: <202404290249.43T2nSsM073439@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 3e4989127020 - stable/14 - sys_procctl(): Make it clear that negative commands are invalid List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 3e498912702094b35f61fd86e557c4f4148aead8 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=3e498912702094b35f61fd86e557c4f4148aead8 commit 3e498912702094b35f61fd86e557c4f4148aead8 Author: Olivier Certner AuthorDate: 2024-04-10 14:32:32 +0000 Commit: Olivier Certner CommitDate: 2024-04-29 02:48:02 +0000 sys_procctl(): Make it clear that negative commands are invalid An initial reading of the preamble of sys_procctl() gives the impression that no test prevents a malicious user from passing a negative commands index (in 'uap->com'), which is soon used as an index into the static array procctl_cmds_info[]. However, a closer examination leads to the conclusion that the existing code is technically correct. Indeed, the comparison of 'uap->com' to the nitems() expression, which expands to a ratio of sizeof(), leads to a conversion of 'uap->com' to an 'unsigned int' as per Usual Arithmetic Conversions/Integer Promotions applied by '<=', because sizeof() returns 'size_t' values, and we define 'size_t' as an equivalent of 'unsigned int' (which is not mandated by the standard, the latter allowing, e.g., integers of lower ranks). With this conversion, negative values of 'uap->com' are automatically ruled-out since they are converted to very big unsigned integers which are caught by the test. An analysis of assembly code produced by LLVM 16 on amd64 and practical tests confirm that no exploitation is possible. However, the guard code as written is misleading to readers and might trip up static analysis tools. Make sure that negative values are explicitly excluded so that it is immediately clear that EINVAL will be returned in this case. Build tested with clang 16 and GCC 12. Approved by: markj (mentor) MFC after: 1 week Sponsored by: The FreeBSD Foundation (cherry picked from commit afc10f8bba3dd293a66461aaca41237c986b6ca7) Approved by: emaste (mentor) --- sys/kern/kern_procctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/kern_procctl.c b/sys/kern/kern_procctl.c index e6a142b2a7ac..9e860e7c80a5 100644 --- a/sys/kern/kern_procctl.c +++ b/sys/kern/kern_procctl.c @@ -1123,7 +1123,7 @@ sys_procctl(struct thread *td, struct procctl_args *uap) if (uap->com >= PROC_PROCCTL_MD_MIN) return (cpu_procctl(td, uap->idtype, uap->id, uap->com, uap->data)); - if (uap->com == 0 || uap->com >= nitems(procctl_cmds_info)) + if (uap->com <= 0 || uap->com >= nitems(procctl_cmds_info)) return (EINVAL); cmd_info = &procctl_cmds_info[uap->com]; bzero(&x, sizeof(x)); From nobody Mon Apr 29 05:29:27 2024 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 4VSX2J3Hswz5JJ0Y; Mon, 29 Apr 2024 05:29: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 4VSX2H5p0Nz4FF9; Mon, 29 Apr 2024 05:29:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714368567; 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=cRsTH4GzwMheFMCHUNjy5JW+1Shqjxa7d3RZaDsJ0hg=; b=fDNLY79iKrTXCzlqpFa1jkQYv1wiubjVNuQYhD4KmCEijuS2JDaivVE23emtAbEp2gIBGH w/SJl/5fDBB5Q4pBOpUxpDDkqb+rVGKG0Zng59cCx8+7Esom3e2oFwtknFyMyB7Bjix9/n JLaOKvuVJ7qEz5r/qMqUj3sx+JmJGj92AOGZ3PvrdxJn6adYZI4h4P6N1rpjfSu9dtXEXd dLgMpKGPe6z+vdct3IjyibwA1fgv57CQplJHSu8ImH3eOU2aUw6ePBUssfG60RKtnWsDe/ GdDXrinQIg5zDars797VgDXneuWi+F709eHAVuVYt6UWKoB8uAA/+TTub0XnGA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714368567; a=rsa-sha256; cv=none; b=LUiNsLSeWmXtseHfuQjMtq9xxaz2eDPcViJcAxIC5omVcvr+M0ZNanhp0I6ryG8K7FS5RX S00deQLMhpc/XeEFLwm9NlkhL2kM1b3UpaxNfhXMAFRUuA7zMXAF99x/z7GksKlzve1L5w yBoErTajWj0jmXEH+SsIBMLqUzcTxq+MTcILK/nSAy7+3pXH1fTf7oGBMkx0v98SWG/KHF KjyB4XbhKHxYR+N4psD0wkUOlxM2JRu0ZybkcZTwK/CV7gThyq+ftB36zcEGUY6LUSLgBF vZQUYKCT22SV6q1y4V3fsKHRLr3+bLH8L8DEzaAN0YMGfPRiNlssRwN0pTAyrA== 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=1714368567; 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=cRsTH4GzwMheFMCHUNjy5JW+1Shqjxa7d3RZaDsJ0hg=; b=D89WBvl3MHYu0BYfY9qa3k3HgLBbI1a4wyEvn1G4WahMYiM43HFO0F2axgfB7INyZ2fvP/ w9fTr0oNRqn5nTMUKRsZJyq6bvLbP1NUPbmetnOU4P+8v+PDPmjgVHLNpfVz7PhPHo7MDu IGSRo8HePFtwfw47t6Swhr1PwEWUwEXmTuzkQk6hrOmAqXGiUzXJxmnUUnoYoHXsJF/FEp ydvyI0ztFISW2qnr88gSINRNFRAfbyRpFjYmv5RC5KzohLe+Y0jeDX+Hie7Om1i4sd97Jt DC8B6w7021TzaP5iStz2juD1X8owGaAkVnDG2pPaD7dkMd91LWSCiXSz1vZW3g== 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 4VSX2H4V2YzwWP; Mon, 29 Apr 2024 05:29: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 43T5TREa047138; Mon, 29 Apr 2024 05:29:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43T5TRXi047135; Mon, 29 Apr 2024 05:29:27 GMT (envelope-from git) Date: Mon, 29 Apr 2024 05:29:27 GMT Message-Id: <202404290529.43T5TRXi047135@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: fb4c7bf8ac2d - stable/14 - script: minor style improvements List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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: fb4c7bf8ac2d72c3f886ef3f8317a8400c2a96d8 Auto-Submitted: auto-generated The branch stable/14 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=fb4c7bf8ac2d72c3f886ef3f8317a8400c2a96d8 commit fb4c7bf8ac2d72c3f886ef3f8317a8400c2a96d8 Author: Xavier Beaudouin AuthorDate: 2024-04-26 16:10:15 +0000 Commit: Kyle Evans CommitDate: 2024-04-29 05:29:02 +0000 script: minor style improvements Fix some nits pointed out by checkstyle9.pl in advance of functional changes to script(1). Reviewed by: des Sponsored by: Modirum MDPay Sponsored by: Klara, Inc. (cherry picked from commit 4459abe334eb4dbd416fa8094a64afc065ccd1cc) --- usr.bin/script/script.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/usr.bin/script/script.c b/usr.bin/script/script.c index b3a1869fcb42..3d82bad9ae2b 100644 --- a/usr.bin/script/script.c +++ b/usr.bin/script/script.c @@ -49,6 +49,7 @@ static const char sccsid[] = "@(#)script.c 8.1 (Berkeley) 6/6/93"; #include #include +#include #include #include #include @@ -123,19 +124,19 @@ main(int argc, char *argv[]) usesleep = 1; rawout = 0; flushtime = 30; - fm_fd = -1; /* Shut up stupid "may be used uninitialized" GCC - warning. (not needed w/clang) */ + fm_fd = -1; showexit = 0; while ((ch = getopt(argc, argv, "adeFfkpqrT:t:")) != -1) - switch(ch) { + switch (ch) { case 'a': aflg = 1; break; case 'd': usesleep = 0; break; - case 'e': /* Default behavior, accepted for linux compat */ + case 'e': + /* Default behavior, accepted for linux compat. */ break; case 'F': Fflg = 1; @@ -248,6 +249,8 @@ main(int argc, char *argv[]) (void)tcsetattr(STDIN_FILENO, TCSAFLUSH, &rtt); } + assert(fflg ? fm_fd >= 0 : fm_fd < 0); + child = fork(); if (child < 0) { warn("fork"); @@ -340,7 +343,7 @@ main(int argc, char *argv[]) } } if (n > 0 && FD_ISSET(master, &rfd)) { - cc = read(master, obuf, sizeof (obuf)); + cc = read(master, obuf, sizeof(obuf)); if (cc <= 0) break; (void)write(STDOUT_FILENO, obuf, cc); @@ -426,7 +429,7 @@ done(int eno) if (showexit) (void)fprintf(fscript, "\nCommand exit status:" " %d", eno); - (void)fprintf(fscript,"\nScript done on %s", + (void)fprintf(fscript, "\nScript done on %s", ctime(&tvec)); } (void)printf("\nScript done, output file is %s\n", fname); @@ -468,8 +471,7 @@ consume(FILE *fp, off_t len, char *buf, int reg) if (reg) { if (fseeko(fp, len, SEEK_CUR) == -1) err(1, NULL); - } - else { + } else { while (len > 0) { l = MIN(DEF_BUF, len); if (fread(buf, sizeof(char), l, fp) != l) From nobody Mon Apr 29 05:29:28 2024 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 4VSX2K18kbz5JHXl; Mon, 29 Apr 2024 05:29: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 4VSX2J6h6Mz4Fj2; Mon, 29 Apr 2024 05:29:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714368568; 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=Tf+1j4tqKSgtZzK83huDLqYN+JOzvPlQIFIUdF4z2/w=; b=A0mvAOeeqGjtdcGz8omR4YHoAFJtZ1m87ue84bnp4T3YsdPJCRFlkAGZXCsERnw3gWLlMK CL5JxDnLN39WlFFMdib5BJPllqhyb/eSse/JTsO/rTaqBjaujPOcomCNK49FKrz+ZSnxKC V5iJNuqDbdBMJd/NUHJxE3UG8HwNhZYsBzLzop+dYmclTQoFcPH5kd6WIMBRGn7GPmDYX7 cSuGTThboboCoK3UJIcskMo/Oj0yzAduiRAGKRj/PtJDHmRXWtJuPegRHN56Itl9XdbsXX k5PPgZQvsf/lrbTbxBFJ4dBo9Tws4ikTgKPMbyDFe/pVjvwdWfDi5M0siTAvlw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714368568; a=rsa-sha256; cv=none; b=ljES7fuj6Fnvbci7h8778ShgTd1yKCEapqvJsXEUhDDuuSx5VxOEOsNnYctC0k/wgjRZY5 uuhEuF58pOO32IY/fZfB17Bme0fC+5Jj7VhLZUXT8tmzV9nofRw2lA1js8+s8siU/lNQ2T yj2Cf05jkA64jUsck6mhm2CIWUlB0DL5mKZBtoordIrRlgqEYsY7mC7Bw3r2su1p3dy63Q b/4BA8GlSK8huBvsY9gWI3D1wEGPeGhTXzhpDo9fMrGpHw7iTmxO8Qw7ZnkMh7TTyFaIHe CCts5AFkiwd97xIyTfXGWiN7q6zfb7IS0q2KwgxdKzt/5HzsbY5tkMojNeOySA== 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=1714368568; 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=Tf+1j4tqKSgtZzK83huDLqYN+JOzvPlQIFIUdF4z2/w=; b=rbMEzSaupNJEKOo4jLEmZMceDCAqoq1gTJGk3UB/jKYGeeGK3SzOM1WnFL2A/8sk5kJ8i8 RDyEsxwSmN6bZA2dVTIKXcXRequslGKWPpxQ7ZkRvrJa2RpTcx4fBpSvGcmHG+BIRkmthr bK/OK5SYXtRt1PC4H+QmnE9cp5dUVG6WDJgk8W/qR1DZ3CO9taccvZxbT6oe5CpZHuWr6o iTvY3+8CKvAG0EB1TfljxCDKGEZ9JXqWF+d2XFcJDd/TJmI1bqyk35pHezUeb+QEeh55lC r+SRGqBmj/vS2mx7qckiiRRmZ73h6eRtFaDKCXVgQKEaPpLD6F3NeIhmYwv6aQ== 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 4VSX2J5T4rzwC2; Mon, 29 Apr 2024 05:29: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 43T5TSjD047183; Mon, 29 Apr 2024 05:29:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43T5TS48047180; Mon, 29 Apr 2024 05:29:28 GMT (envelope-from git) Date: Mon, 29 Apr 2024 05:29:28 GMT Message-Id: <202404290529.43T5TS48047180@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: 2c24df87e3f8 - stable/14 - script: handle terminal resize on SIGWINCH List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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: 2c24df87e3f8af749cc7fc371aafd023b4331ef5 Auto-Submitted: auto-generated The branch stable/14 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=2c24df87e3f8af749cc7fc371aafd023b4331ef5 commit 2c24df87e3f8af749cc7fc371aafd023b4331ef5 Author: Kyle Evans AuthorDate: 2024-04-26 16:12:00 +0000 Commit: Kyle Evans CommitDate: 2024-04-29 05:29:02 +0000 script: handle terminal resize on SIGWINCH Add a -w flag to forward terminal resize events on to the child, which can be useful in some circumstances to avoid terminal corruption. Reviewed by: des Co-authored-by: Xavier Beaudouin Sponsored by: Modirum MDPay Sponsored by: Klara, Inc. (cherry picked from commit 8ceac8e13dccbe4e177c8f2f443b87b7d2e3edb3) --- usr.bin/script/script.1 | 5 +++- usr.bin/script/script.c | 62 ++++++++++++++++++++++++++++++++++++++++++------- 2 files changed, 58 insertions(+), 9 deletions(-) diff --git a/usr.bin/script/script.1 b/usr.bin/script/script.1 index 318ae4d743d9..bc096c0895c5 100644 --- a/usr.bin/script/script.1 +++ b/usr.bin/script/script.1 @@ -35,7 +35,7 @@ .Nd make typescript of terminal session .Sh SYNOPSIS .Nm -.Op Fl aeFfkqr +.Op Fl aeFfkqrw .Op Fl t Ar time .Op Ar file Op Ar command ... .Nm @@ -133,6 +133,9 @@ characters, it indicates the default format: which is useful for both tools and humans to read, should be used. Note that time-stamps will only be output when different from the previous one. +.It Fl w +Forward terminal size changes on +.Dv SIGWINCH . .El .Pp The script ends when the forked shell (or command) exits (a diff --git a/usr.bin/script/script.c b/usr.bin/script/script.c index 3d82bad9ae2b..62f1399b6dc2 100644 --- a/usr.bin/script/script.c +++ b/usr.bin/script/script.c @@ -86,6 +86,7 @@ static char *fmfname; static int fflg, qflg, ttyflg; static int usesleep, rawout, showexit; static TAILQ_HEAD(, buf_elm) obuf_list = TAILQ_HEAD_INITIALIZER(obuf_list); +static volatile sig_atomic_t doresize; static struct termios tt; @@ -103,31 +104,43 @@ static void record(FILE *, char *, size_t, int); static void consume(FILE *, off_t, char *, int); static void playback(FILE *) __dead2; static void usage(void) __dead2; +static void resizeit(int); int main(int argc, char *argv[]) { struct termios rtt, stt; struct winsize win; - struct timeval tv, *tvp; + struct timespec tv, *tvp; time_t tvec, start; char obuf[BUFSIZ]; char ibuf[BUFSIZ]; + sigset_t *pselmask, selmask; fd_set rfd, wfd; struct buf_elm *be; ssize_t cc; - int aflg, Fflg, kflg, pflg, ch, k, n, fcm; + int aflg, Fflg, kflg, pflg, wflg, ch, k, n, fcm; int flushtime, readstdin; int fm_fd, fm_log; - aflg = Fflg = kflg = pflg = 0; + aflg = Fflg = kflg = pflg = wflg = 0; + doresize = 0; usesleep = 1; rawout = 0; flushtime = 30; fm_fd = -1; showexit = 0; - while ((ch = getopt(argc, argv, "adeFfkpqrT:t:")) != -1) + /* + * For normal operation, we'll leave pselmask == NULL so that pselect(2) + * leaves the signal mask alone. If -w is specified, we'll restore the + * process signal mask upon entry with SIGWINCH unblocked so that we can + * forward resize events properly. + */ + sigemptyset(&selmask); + pselmask = NULL; + + while ((ch = getopt(argc, argv, "adeFfkpqrT:t:w")) != -1) switch (ch) { case 'a': aflg = 1; @@ -166,6 +179,9 @@ main(int argc, char *argv[]) if (strchr(optarg, '%')) tstamp_fmt = optarg; break; + case 'w': + wflg = 1; + break; case '?': default: usage(); @@ -269,6 +285,23 @@ main(int argc, char *argv[]) } close(slave); + if (wflg) { + struct sigaction sa = { .sa_handler = resizeit }; + sigset_t smask; + + sigaction(SIGWINCH, &sa, NULL); + + sigemptyset(&smask); + sigaddset(&smask, SIGWINCH); + + if (sigprocmask(SIG_BLOCK, &smask, &selmask) != 0) + err(1, "Failed to block SIGWINCH"); + + /* Just in case SIGWINCH was blocked before we came in. */ + sigdelset(&selmask, SIGWINCH); + pselmask = &selmask; + } + start = tvec = time(0); readstdin = 1; for (;;) { @@ -281,19 +314,26 @@ main(int argc, char *argv[]) FD_SET(master, &wfd); if (!readstdin && ttyflg) { tv.tv_sec = 1; - tv.tv_usec = 0; + tv.tv_nsec = 0; tvp = &tv; readstdin = 1; } else if (flushtime > 0) { tv.tv_sec = flushtime - (tvec - start); - tv.tv_usec = 0; + tv.tv_nsec = 0; tvp = &tv; } else { tvp = NULL; } - n = select(master + 1, &rfd, &wfd, NULL, tvp); + n = pselect(master + 1, &rfd, &wfd, NULL, tvp, pselmask); if (n < 0 && errno != EINTR) break; + + if (doresize) { + if (ioctl(STDIN_FILENO, TIOCGWINSZ, &win) != -1) + ioctl(master, TIOCSWINSZ, &win); + doresize = 0; + } + if (n > 0 && FD_ISSET(STDIN_FILENO, &rfd)) { cc = read(STDIN_FILENO, ibuf, BUFSIZ); if (cc < 0) @@ -368,7 +408,7 @@ static void usage(void) { (void)fprintf(stderr, - "usage: script [-aeFfkpqr] [-t time] [file [command ...]]\n"); + "usage: script [-aeFfkpqrw] [-t time] [file [command ...]]\n"); (void)fprintf(stderr, " script -p [-deq] [-T fmt] [file]\n"); exit(1); @@ -614,3 +654,9 @@ playback(FILE *fp) (void)fclose(fp); exit(0); } + +static void +resizeit(int signo __unused) +{ + doresize = 1; +} From nobody Mon Apr 29 05:29:39 2024 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 4VSX2X32rLz5JJ0Z; Mon, 29 Apr 2024 05:29: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 4VSX2X0k9Kz4Fg8; Mon, 29 Apr 2024 05:29:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714368580; 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=H04ydHQWV+BG5lNmXoG+RaLKQeDRmbmU7uNpwh9QV3I=; b=puJFI9PtqqNWFMGyT1kTtZKRBmhucGuz2Aqu7oEuHanseb0qk/H756bR8jipqUJt/vooPP 4hO0EPxm7ENEEXdccpUdaUm/zp4tmfTVokhPHa3RhrHQlaF19i2dxTgqc9iVVO0AxX56M6 yaKRR56t+d3J9btbsZEFy+JxYc0dDU1dDveL74F7l/dQyveuvSdfAN8+LT3o60U21A+GQZ 4mDyYi1R12UXyg3BOM33FLTnE2403jEPW8xZy+/uwhvfWrpgN7J9LIGsw+QAq0UAutiZyj nMfBcxuL3CIJXCLkDXnVkV6rwhLSpbZLOmvqnmIRnkCtn5KCeIueX/UG/MxeEQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714368580; a=rsa-sha256; cv=none; b=q9snYGm2s9VRUUpc+3puERxwk4Lql4ZJgxB6DUdc8rzLDclIXdHPJcZLmDW539QgnxG/dl Edrvn8uT3jdtWm88VjBfTQNM3Vt5J1IgiFXSdxsp0OrkT4ZZG5BysCpc2StEN3xcTV45H2 QJ3bMDkRpiwRlGwXhC7hwcgMFSWHLgzdeSuS8jwv7mcVqHH8wzLWAA5eT1LndXgr8Xjdu1 57TgVB9BBi8H67bZgbBUEKP0T6WI0yEp3Nwy/dVfLviK+ChPx4ou9XR6WbeXvuzhaGiCAR v2iIqtfnYf3Hh0PEgy6m/XPSz9nyeN+skGNJSxXT/W4E5jzFcoojmZI8rdJUyg== 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=1714368580; 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=H04ydHQWV+BG5lNmXoG+RaLKQeDRmbmU7uNpwh9QV3I=; b=xwCAi8Yy62vj1o9GBxrKeyKT06d9w5VNmdjdR9tDxXXZD0+2C+XZiywYSKcfayQQflvmns u8hRLeEMaf3gX+5HkbC99qe5jnVjxc3fGZSVurXmc4XfQK1AhkZz9R737inWUJBIeEZTRB ADp+i4UpBZyKykk3YMMxTdOgD4xtZxlZO4I/ePRarqkk1tkwPpOJR5QprBuORgzxGhFw/F G2rq6D/CFvPg5JqYNynnFim8DsZuarZpBAMSbx9lyp4BL/WeKfenLTLyGqncvQa1mFg052 RT/x6CEYvvt1dAypECJytTeZC9kOQoCvLAH7ALGVYV7fUnF0r8Bf6uosEb2aWA== 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 4VSX2W6XZBzw8n; Mon, 29 Apr 2024 05:29:39 +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 43T5TdtE047352; Mon, 29 Apr 2024 05:29:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43T5Td91047349; Mon, 29 Apr 2024 05:29:39 GMT (envelope-from git) Date: Mon, 29 Apr 2024 05:29:39 GMT Message-Id: <202404290529.43T5Td91047349@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: 2a2cc22f517b - stable/13 - script: minor style improvements List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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: 2a2cc22f517b837ee6dbf1f44b99ee3fdca93b12 Auto-Submitted: auto-generated The branch stable/13 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=2a2cc22f517b837ee6dbf1f44b99ee3fdca93b12 commit 2a2cc22f517b837ee6dbf1f44b99ee3fdca93b12 Author: Xavier Beaudouin AuthorDate: 2024-04-26 16:10:15 +0000 Commit: Kyle Evans CommitDate: 2024-04-29 05:28:45 +0000 script: minor style improvements Fix some nits pointed out by checkstyle9.pl in advance of functional changes to script(1). Reviewed by: des Sponsored by: Modirum MDPay Sponsored by: Klara, Inc. (cherry picked from commit 4459abe334eb4dbd416fa8094a64afc065ccd1cc) --- usr.bin/script/script.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/usr.bin/script/script.c b/usr.bin/script/script.c index b3a1869fcb42..3d82bad9ae2b 100644 --- a/usr.bin/script/script.c +++ b/usr.bin/script/script.c @@ -49,6 +49,7 @@ static const char sccsid[] = "@(#)script.c 8.1 (Berkeley) 6/6/93"; #include #include +#include #include #include #include @@ -123,19 +124,19 @@ main(int argc, char *argv[]) usesleep = 1; rawout = 0; flushtime = 30; - fm_fd = -1; /* Shut up stupid "may be used uninitialized" GCC - warning. (not needed w/clang) */ + fm_fd = -1; showexit = 0; while ((ch = getopt(argc, argv, "adeFfkpqrT:t:")) != -1) - switch(ch) { + switch (ch) { case 'a': aflg = 1; break; case 'd': usesleep = 0; break; - case 'e': /* Default behavior, accepted for linux compat */ + case 'e': + /* Default behavior, accepted for linux compat. */ break; case 'F': Fflg = 1; @@ -248,6 +249,8 @@ main(int argc, char *argv[]) (void)tcsetattr(STDIN_FILENO, TCSAFLUSH, &rtt); } + assert(fflg ? fm_fd >= 0 : fm_fd < 0); + child = fork(); if (child < 0) { warn("fork"); @@ -340,7 +343,7 @@ main(int argc, char *argv[]) } } if (n > 0 && FD_ISSET(master, &rfd)) { - cc = read(master, obuf, sizeof (obuf)); + cc = read(master, obuf, sizeof(obuf)); if (cc <= 0) break; (void)write(STDOUT_FILENO, obuf, cc); @@ -426,7 +429,7 @@ done(int eno) if (showexit) (void)fprintf(fscript, "\nCommand exit status:" " %d", eno); - (void)fprintf(fscript,"\nScript done on %s", + (void)fprintf(fscript, "\nScript done on %s", ctime(&tvec)); } (void)printf("\nScript done, output file is %s\n", fname); @@ -468,8 +471,7 @@ consume(FILE *fp, off_t len, char *buf, int reg) if (reg) { if (fseeko(fp, len, SEEK_CUR) == -1) err(1, NULL); - } - else { + } else { while (len > 0) { l = MIN(DEF_BUF, len); if (fread(buf, sizeof(char), l, fp) != l) From nobody Mon Apr 29 05:29:40 2024 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 4VSX2Y2Vljz5JHsD; Mon, 29 Apr 2024 05:29:41 +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 4VSX2Y0tMZz4FLY; Mon, 29 Apr 2024 05:29:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714368581; 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=+Psr1swo5M1J7GLLPB21i0KLo7e45ebVoMY6d3rXnEc=; b=ljxDTReRM6eqTo/+nPBx+/5AvOUhcgUuAsBz9V54DZztZewbVft+UPZd9ekNmfnGL3zmzU 8vZJaskFA8D/OuYu7FS/W+lS1kfmMiSD3zQGDrSARSiAvSHMm53FTwMshRnAhJl6PqETWf z1sU77NhFXGtaDa4GKNiDdc6JcQfxTKLDqlQ91fhwJ70nclF7fuWTdx2Tmr1DVWYPikQmd wUwsxiLDFW6Vz+zRLOerHYhvnjTBJfE1D5eeHF73oph25N1VXz6YPL0j6x5R7WUHkqLpYH K7YPYFXVoQBESNyq+6r/iiLFJlCZ/IP8xV87US8EI2BUPhr807xY+FC1EqJ7rQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714368581; a=rsa-sha256; cv=none; b=otMgTZkNkN9bojVi9iK3AKszuFrIBWt8uF300BepmDmRo/Vlwlw6y6dmgvSN5PYfsAAn7w xxqrqVjgdhRMRC76nqXAKPp/zElTNSg7pqdP2bAayOAlULa5ErCazCONZuQ7HFF9jWXNCP s0X8+CQYMvTiDIuBk1S2J4mUUWtFyW7GePpyKYgkjjcTnr65i69oVViApPEGxKC73dI+6m nzMDaMGDheEmtnB5OqTpmq53QeaU6nKue4EN7usxOQh2lfs72Q0aW6alXXlT5FZaZ6kB3z E7ReFCW2kJDSUqazDvURkWotuyIXMs+9cVZmSjmF9M2Ik7EjJqVt8w+iXh6bzQ== 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=1714368581; 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=+Psr1swo5M1J7GLLPB21i0KLo7e45ebVoMY6d3rXnEc=; b=wXUxGi2sK1dDBdoDXYKSBRwoefxqYlWB2FHl1tTHIe9u5adtj0mHIdVXWK8X/oUVzGjTjF zSROxnHgxE1B/p0bjbOnVP1rbXAcROp7ra5FBlU78+zMm6aVAGBTCa0HKE32psAPxJI0BK U9mnKTVxCbLgcC7T7mQ6m0CXc+xV0u7NSeazVKeMDNMqBTbakzf5VJns8gM3REewY+Teou ecbH0ReadTytLV5mlGaWUP8FxeOMZP+0l5V67qxxPZEzBoE14tIpfBSfVQ15x6rnSLM0b6 bCZs2k9r9s3MgasxqC4goEqLv47vo7Osr/+UaYgW94wCp3uePeBK1z/he1L/0Q== 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 4VSX2Y0P2MzwC3; Mon, 29 Apr 2024 05:29:41 +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 43T5TeUU047397; Mon, 29 Apr 2024 05:29:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43T5TeFr047394; Mon, 29 Apr 2024 05:29:40 GMT (envelope-from git) Date: Mon, 29 Apr 2024 05:29:40 GMT Message-Id: <202404290529.43T5TeFr047394@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: f224a2ca04ad - stable/13 - script: handle terminal resize on SIGWINCH List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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: f224a2ca04ad8c9322738517a9092bc488256bc8 Auto-Submitted: auto-generated The branch stable/13 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=f224a2ca04ad8c9322738517a9092bc488256bc8 commit f224a2ca04ad8c9322738517a9092bc488256bc8 Author: Kyle Evans AuthorDate: 2024-04-26 16:12:00 +0000 Commit: Kyle Evans CommitDate: 2024-04-29 05:28:45 +0000 script: handle terminal resize on SIGWINCH Add a -w flag to forward terminal resize events on to the child, which can be useful in some circumstances to avoid terminal corruption. Reviewed by: des Co-authored-by: Xavier Beaudouin Sponsored by: Modirum MDPay Sponsored by: Klara, Inc. (cherry picked from commit 8ceac8e13dccbe4e177c8f2f443b87b7d2e3edb3) --- usr.bin/script/script.1 | 5 +++- usr.bin/script/script.c | 62 ++++++++++++++++++++++++++++++++++++++++++------- 2 files changed, 58 insertions(+), 9 deletions(-) diff --git a/usr.bin/script/script.1 b/usr.bin/script/script.1 index 318ae4d743d9..bc096c0895c5 100644 --- a/usr.bin/script/script.1 +++ b/usr.bin/script/script.1 @@ -35,7 +35,7 @@ .Nd make typescript of terminal session .Sh SYNOPSIS .Nm -.Op Fl aeFfkqr +.Op Fl aeFfkqrw .Op Fl t Ar time .Op Ar file Op Ar command ... .Nm @@ -133,6 +133,9 @@ characters, it indicates the default format: which is useful for both tools and humans to read, should be used. Note that time-stamps will only be output when different from the previous one. +.It Fl w +Forward terminal size changes on +.Dv SIGWINCH . .El .Pp The script ends when the forked shell (or command) exits (a diff --git a/usr.bin/script/script.c b/usr.bin/script/script.c index 3d82bad9ae2b..62f1399b6dc2 100644 --- a/usr.bin/script/script.c +++ b/usr.bin/script/script.c @@ -86,6 +86,7 @@ static char *fmfname; static int fflg, qflg, ttyflg; static int usesleep, rawout, showexit; static TAILQ_HEAD(, buf_elm) obuf_list = TAILQ_HEAD_INITIALIZER(obuf_list); +static volatile sig_atomic_t doresize; static struct termios tt; @@ -103,31 +104,43 @@ static void record(FILE *, char *, size_t, int); static void consume(FILE *, off_t, char *, int); static void playback(FILE *) __dead2; static void usage(void) __dead2; +static void resizeit(int); int main(int argc, char *argv[]) { struct termios rtt, stt; struct winsize win; - struct timeval tv, *tvp; + struct timespec tv, *tvp; time_t tvec, start; char obuf[BUFSIZ]; char ibuf[BUFSIZ]; + sigset_t *pselmask, selmask; fd_set rfd, wfd; struct buf_elm *be; ssize_t cc; - int aflg, Fflg, kflg, pflg, ch, k, n, fcm; + int aflg, Fflg, kflg, pflg, wflg, ch, k, n, fcm; int flushtime, readstdin; int fm_fd, fm_log; - aflg = Fflg = kflg = pflg = 0; + aflg = Fflg = kflg = pflg = wflg = 0; + doresize = 0; usesleep = 1; rawout = 0; flushtime = 30; fm_fd = -1; showexit = 0; - while ((ch = getopt(argc, argv, "adeFfkpqrT:t:")) != -1) + /* + * For normal operation, we'll leave pselmask == NULL so that pselect(2) + * leaves the signal mask alone. If -w is specified, we'll restore the + * process signal mask upon entry with SIGWINCH unblocked so that we can + * forward resize events properly. + */ + sigemptyset(&selmask); + pselmask = NULL; + + while ((ch = getopt(argc, argv, "adeFfkpqrT:t:w")) != -1) switch (ch) { case 'a': aflg = 1; @@ -166,6 +179,9 @@ main(int argc, char *argv[]) if (strchr(optarg, '%')) tstamp_fmt = optarg; break; + case 'w': + wflg = 1; + break; case '?': default: usage(); @@ -269,6 +285,23 @@ main(int argc, char *argv[]) } close(slave); + if (wflg) { + struct sigaction sa = { .sa_handler = resizeit }; + sigset_t smask; + + sigaction(SIGWINCH, &sa, NULL); + + sigemptyset(&smask); + sigaddset(&smask, SIGWINCH); + + if (sigprocmask(SIG_BLOCK, &smask, &selmask) != 0) + err(1, "Failed to block SIGWINCH"); + + /* Just in case SIGWINCH was blocked before we came in. */ + sigdelset(&selmask, SIGWINCH); + pselmask = &selmask; + } + start = tvec = time(0); readstdin = 1; for (;;) { @@ -281,19 +314,26 @@ main(int argc, char *argv[]) FD_SET(master, &wfd); if (!readstdin && ttyflg) { tv.tv_sec = 1; - tv.tv_usec = 0; + tv.tv_nsec = 0; tvp = &tv; readstdin = 1; } else if (flushtime > 0) { tv.tv_sec = flushtime - (tvec - start); - tv.tv_usec = 0; + tv.tv_nsec = 0; tvp = &tv; } else { tvp = NULL; } - n = select(master + 1, &rfd, &wfd, NULL, tvp); + n = pselect(master + 1, &rfd, &wfd, NULL, tvp, pselmask); if (n < 0 && errno != EINTR) break; + + if (doresize) { + if (ioctl(STDIN_FILENO, TIOCGWINSZ, &win) != -1) + ioctl(master, TIOCSWINSZ, &win); + doresize = 0; + } + if (n > 0 && FD_ISSET(STDIN_FILENO, &rfd)) { cc = read(STDIN_FILENO, ibuf, BUFSIZ); if (cc < 0) @@ -368,7 +408,7 @@ static void usage(void) { (void)fprintf(stderr, - "usage: script [-aeFfkpqr] [-t time] [file [command ...]]\n"); + "usage: script [-aeFfkpqrw] [-t time] [file [command ...]]\n"); (void)fprintf(stderr, " script -p [-deq] [-T fmt] [file]\n"); exit(1); @@ -614,3 +654,9 @@ playback(FILE *fp) (void)fclose(fp); exit(0); } + +static void +resizeit(int signo __unused) +{ + doresize = 1; +} From nobody Mon Apr 29 05:34:06 2024 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 4VSX7g1TZ0z5JJ8J; Mon, 29 Apr 2024 05:34: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 4VSX7f6Lsmz4Gp2; Mon, 29 Apr 2024 05:34:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714368846; 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=4VJIuF57YQGJXWM3IhfcF3dgfT7A2BoLQJpJMp3O7D4=; b=DNdS/Tqf3l9SJnOTn9QysRt+Dl2mPtnl1A5NOrwgBfWTeKD219nC/1v1zI7EA4242Vucxl wZ2jNTQReL2VRmLGKQfX3aQMt1Um2XyL0hzQKQQckih6y4w4mNXuuk6JIWu9EoA1ipfYng IZXMiqZx6e/+y/1jOU3TrseAhbPahv/UcKGKocsTtphbY8IsF0q7vbW3gSRe76OVtIOaYB UF4rAqHHsnkxfvD6ppblMzQG9GWlIrnraj878MLcCaeBtP8dbsfRQEb9Y+Pw7aCw/zg29/ dj1usY4AnT1oH/EP3jnmWTPkC8Eo8TyrXTuoPB7EPwzMqkpXEQEHsCjDKk5J6A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714368846; a=rsa-sha256; cv=none; b=h9EWMV4rk+y9k8vUfipruRBw8lueZHJTCGvuwhlCX2Zr0dlwgTx9MMCKlq7FNtxWIP5INs X1ndLM6CjzwB+XpTta5amtjYkxu1m9ccbbieYrB/Boj/9UkvO/G+jaE1IWSVnJd/hEpQQx ssGwK8B+izVka9/A2aC9Qsf9KCmL3+EXNbuiMmpX/+8p8KOo2pXP6fUl/WqhSs427jelKJ 3TGoZVzKtU+diCz/Z83w3IUatkKP++rqbsoIMw+xzR30DxvYIMBqB+vLOowtBPfao9QIoW +moPptu+Oh3JG/IC7iCXKaHAE/nuYCcnaBdgBtTa2HJaoUJBZ23Pk+xUeDGVZw== 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=1714368846; 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=4VJIuF57YQGJXWM3IhfcF3dgfT7A2BoLQJpJMp3O7D4=; b=H0wnRULWnVWW2o3kayTnHyDC/X8Gmw8G37+4DaiC4jbtmlYNFHI3xior0Oy4UxV0xWWnAf xeeNwQMxnqDdOHyMn/pop3rSk17ReYPRZeG+5YyKSpItrnwX6DrLkNuNACbKb+2m9XN/KM S3ekfKSUaELtXD496RXGBDCbycfU7oVtyz/KTu7NoEoVbyvqE2TWYSLLGPUgVZ3GzU7G4P UIziT9SkL/5JgvUWZVpU8sVhpxsOCc/nlk9qNDmWL7kqb7VHWZVAp4oY1F5Rfn/uGV+QDm s5MJ1FsLP7FcbCrdmB2S85iFhplCqtuYLF2ZAQt3SYbca1xMoELMLReSUJcpsw== 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 4VSX7f5dx3zwdG; Mon, 29 Apr 2024 05:34: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 43T5Y6CT063407; Mon, 29 Apr 2024 05:34:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43T5Y6Uv063405; Mon, 29 Apr 2024 05:34:06 GMT (envelope-from git) Date: Mon, 29 Apr 2024 05:34:06 GMT Message-Id: <202404290534.43T5Y6Uv063405@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: eb07a26af199 - stable/13 - sys_procctl(): Make it clear that negative commands are invalid List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: eb07a26af1996dc5a006cc14a670bd0583aba9c4 Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=eb07a26af1996dc5a006cc14a670bd0583aba9c4 commit eb07a26af1996dc5a006cc14a670bd0583aba9c4 Author: Olivier Certner AuthorDate: 2024-04-10 14:32:32 +0000 Commit: Olivier Certner CommitDate: 2024-04-29 05:33:30 +0000 sys_procctl(): Make it clear that negative commands are invalid An initial reading of the preamble of sys_procctl() gives the impression that no test prevents a malicious user from passing a negative commands index (in 'uap->com'), which is soon used as an index into the static array procctl_cmds_info[]. However, a closer examination leads to the conclusion that the existing code is technically correct. Indeed, the comparison of 'uap->com' to the nitems() expression, which expands to a ratio of sizeof(), leads to a conversion of 'uap->com' to an 'unsigned int' as per Usual Arithmetic Conversions/Integer Promotions applied by '<=', because sizeof() returns 'size_t' values, and we define 'size_t' as an equivalent of 'unsigned int' (which is not mandated by the standard, the latter allowing, e.g., integers of lower ranks). With this conversion, negative values of 'uap->com' are automatically ruled-out since they are converted to very big unsigned integers which are caught by the test. An analysis of assembly code produced by LLVM 16 on amd64 and practical tests confirm that no exploitation is possible. However, the guard code as written is misleading to readers and might trip up static analysis tools. Make sure that negative values are explicitly excluded so that it is immediately clear that EINVAL will be returned in this case. Build tested with clang 16 and GCC 12. Approved by: markj (mentor) MFC after: 1 week Sponsored by: The FreeBSD Foundation (cherry picked from commit afc10f8bba3dd293a66461aaca41237c986b6ca7) Approved by: emaste (mentor) --- sys/kern/kern_procctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/kern_procctl.c b/sys/kern/kern_procctl.c index e6a142b2a7ac..9e860e7c80a5 100644 --- a/sys/kern/kern_procctl.c +++ b/sys/kern/kern_procctl.c @@ -1123,7 +1123,7 @@ sys_procctl(struct thread *td, struct procctl_args *uap) if (uap->com >= PROC_PROCCTL_MD_MIN) return (cpu_procctl(td, uap->idtype, uap->id, uap->com, uap->data)); - if (uap->com == 0 || uap->com >= nitems(procctl_cmds_info)) + if (uap->com <= 0 || uap->com >= nitems(procctl_cmds_info)) return (EINVAL); cmd_info = &procctl_cmds_info[uap->com]; bzero(&x, sizeof(x)); From nobody Mon Apr 29 10:14:49 2024 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 4VSfMY42lFz5J0lY; Mon, 29 Apr 2024 10:14: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 4VSfMY3VZjz4jqX; Mon, 29 Apr 2024 10:14:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714385689; 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=AUc+N25dz+it4gE/vqLwLjrBnM4jCeDZCM9ycP49tfs=; b=KjmPOXYy+z4kCLHo1u1Se4cVVdP4yMe1tIGL/9lc4WQavKt1hZwlWRWoubOoDYTMA59GaG 9E6+M7zdwY4lDCB+kVVwzCB9MfI5a7iBpedfXAkHHIhtZ6W5vs4XGMXz/SfJkOHP8mBy4Q tZHkd23Nt9v+kHEm1KVc2Du3/loQ/zKgWkmxI12Kt/IS08u6iMwA7c4UsbeQoKg+t87HxD VYiNv9Tx+i8dEqqMP/UcAQ4oBnVml4NMhZAYsdREOoSX0HGEAPD5OzLQop+D/TgmoCiKdD zCmzxN3mgRRo5BOjxy0DjZrJK6erp9bq0tQwDLPCbu1V+VA7B8W+5ZHjpA/AiQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714385689; a=rsa-sha256; cv=none; b=wOESF2VY0KzDyluG5TaEwtOi8DQHpYwAKWK4jECyH9iilZr9rbOp5VSaev3T7YBcn6/CFE PKxrhJYJxnRSzd4tgxN1/E9Cj3INQhMuFdoi65pFqukarkrNxFJSeRYlGYECtAsmRrUGfn S59KbrP9c7rlZ+Nus2ngl3nWbZvIE4TPdR5Bz8IZEVNscE21bwC0GECT60Aj+Vhc+li0n2 weRgkw7H1KysOf5xUst1SMgMC+pntAH5py+44T0pW4se28ZruG1M7dtE6NSqHjhFVJf6bb Ai60TcnPrbtWD97OMmrnGj0f4fZwAw90bqo9Uv5LuVSIPE7ef5beyIhOg1KDYg== 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=1714385689; 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=AUc+N25dz+it4gE/vqLwLjrBnM4jCeDZCM9ycP49tfs=; b=wtfTo175/jnkLyi/aMr+sNXypFU0dD84J/298/CxQ2sG1PWDlFaZHVjRhtTp8f298WpWDI L3rz4QWYjNP8Pzd+B369XVNUTPVDgoxY1yN6/ALlWJUAqwgOXZlGv+VgNxPZa0kXdDvqMf 8zuXVmvfOmeBJDb0budhyofAqmiPCAOwqpO5hMdEtm18iZZGLNWLQqVkD/nHMmGSKhW80C B+UJLaAsSrxxXUeQjTCKPQC/9fCFataFQO0ewEkJPRjsCPk6DyKFgcxnThO4DU0FrLL0M6 DjttfCs9xJOy9pPmCBmNpsUmUOHLnSQ+LLgRSzPu7DNkpoKy58w4EVSuV2pteQ== 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 4VSfMY36Cxz14vC; Mon, 29 Apr 2024 10:14: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 43TAEnIl037063; Mon, 29 Apr 2024 10:14:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43TAEnoA037060; Mon, 29 Apr 2024 10:14:49 GMT (envelope-from git) Date: Mon, 29 Apr 2024 10:14:49 GMT Message-Id: <202404291014.43TAEnoA037060@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: 516009ce8d38 - stable/14 - adduser(8): support creation of ZFS dataset List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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: 516009ce8d380c8299a1d1115b24251c0925562b Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=516009ce8d380c8299a1d1115b24251c0925562b commit 516009ce8d380c8299a1d1115b24251c0925562b Author: John Grafton AuthorDate: 2024-04-11 18:11:18 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-04-29 10:14:16 +0000 adduser(8): support creation of ZFS dataset On systems utilizing ZFS, default to creating a ZFS dataset for a new user's home directory if the parent directory resides on a ZFS dataset. Add a flag that disables this behavior if the administrator explicitly does not want it. If run during installation from within a chroot, set mountpoint to legacy after dataset creation and mount directly into the chroot. Then umount and reset the mountpoint to inherit from parent. Also support ZFS default encryption on user's home directory. Feedback by: delphij Reviewed by: imp, kevans Pull Request: https://github.com/freebsd/freebsd-src/pull/881 (cherry picked from commit 215c0a5158f17f515f365fc28a9ff0b367be8fc9) --- usr.sbin/adduser/adduser.8 | 10 ++- usr.sbin/adduser/adduser.conf.5 | 2 + usr.sbin/adduser/adduser.sh | 161 +++++++++++++++++++++++++++++++++++++--- 3 files changed, 159 insertions(+), 14 deletions(-) diff --git a/usr.sbin/adduser/adduser.8 b/usr.sbin/adduser/adduser.8 index 4669afc2bfe6..ed67e21f9430 100644 --- a/usr.sbin/adduser/adduser.8 +++ b/usr.sbin/adduser/adduser.8 @@ -24,7 +24,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd September 15, 2012 +.Dd April 11, 2024 .Dt ADDUSER 8 .Os .Sh NAME @@ -32,7 +32,7 @@ .Nd command for adding new users .Sh SYNOPSIS .Nm -.Op Fl CDENShq +.Op Fl CDENSZhq .Op Fl G Ar groups .Op Fl L Ar login_class .Op Fl M Ar mode @@ -52,6 +52,10 @@ utility is a shell script, implemented around the command, for adding new users. It creates passwd/group entries, a home directory, copies dotfiles and sends the new user a welcome message. +On systems where the parent of home directory is a ZFS dataset, +.Nm +will create the home directory as a ZFS dataset by default, +unless the system administrator specified otherwise. It supports two modes of operation. It may be used interactively at the command line to add one user at a time, or it may be directed @@ -295,6 +299,8 @@ In addition, it will be available for inclusion in the message file in the .Va randompass variable. .El +.It Fl Z +Do not attempt to create ZFS home dataset. .El .Sh FORMAT When the diff --git a/usr.sbin/adduser/adduser.conf.5 b/usr.sbin/adduser/adduser.conf.5 index 2d445a2fabbf..09b80f2df021 100644 --- a/usr.sbin/adduser/adduser.conf.5 +++ b/usr.sbin/adduser/adduser.conf.5 @@ -171,6 +171,8 @@ The default information to be held in the GECOS field of .It Va uidstart The default user ID setting. This must be a number above 1000 and fewer than 65534. +.It Va Zflag +Do not attempt to create ZFS home dataset. .El .Sh EXAMPLES The following is an example diff --git a/usr.sbin/adduser/adduser.sh b/usr.sbin/adduser/adduser.sh index fef9e293c1ce..0d5a628f8f33 100644 --- a/usr.sbin/adduser/adduser.sh +++ b/usr.sbin/adduser/adduser.sh @@ -84,6 +84,7 @@ show_usage() { echo " -L login class of the user" echo " -M file permission for home directory" echo " -N do not read configuration file" + echo " -Z do not attempt to create ZFS home dataset" echo " -S a nonexistent shell is not an error" echo " -d home directory" echo " -f file from which input will be received" @@ -283,6 +284,22 @@ add_user() { ;; esac + # create ZFS dataset before home directory is created with pw + if [ "${Zcreate}" = "yes" ]; then + if [ "${Zencrypt}" = "yes" ]; then + echo "Enter encryption keyphrase for ZFS dataset (${zhome}):" + fi + if [ -n "$BSDINSTALL_CHROOT" ]; then + create_zfs_chrooted_dataset + else + create_zfs_dataset + if [ "$?" -ne 0 ]; then + err "There was an error adding user ($username)." + return 1 + fi + fi + fi + _pwcmd="$_upasswd ${PWCMD} useradd $_uid $_name $_group $_grouplist $_comment" _pwcmd="$_pwcmd $_shell $_class $_home $_dotdir $_passwdmethod $_passwd" _pwcmd="$_pwcmd $_expire $_pwexpire" @@ -306,6 +323,14 @@ add_user() { fi fi + # give newly created user permissions to their home zfs dataset + if [ "${Zcreate}" = "yes" ]; then + set_zfs_perms + if [ -n "$BSDINSTALL_CHROOT" ]; then + umount_legacy_zfs + fi + fi + _line= _owner= _perms= @@ -479,6 +504,26 @@ get_homeperm() { fi } +# get_zfs_home +# Determine if homeprefix is located on a ZFS filesystem and if +# so, enable ZFS home dataset creation. +# +get_zfs_home() { + # check if zfs kernel module is loaded before attempting to run zfs to + # prevent loading the kernel module on systems that don't use ZFS + if ! "$KLDSTATCMD" -q -m zfs; then + Zcreate="no" + return + fi + zfs_homeprefix=`${ZFSCMD} list -Ho name "${homeprefix}" 2>/dev/null` + if [ "$?" -ne 0 ]; then + Zcreate="no" + elif [ -z "${zfs_homeprefix}" ]; then + Zcreate="no" + fi + zhome="${zfs_homeprefix}/${username}" +} + # get_uid # Reads a numeric userid in an interactive or batch session. Automatically # allocates one if it is not specified. @@ -613,6 +658,81 @@ get_password() { fi } +# get_zfs_encryption +# Ask user if they want to enable encryption on their ZFS home dataset. +# +get_zfs_encryption() { + _input= + _prompt="Enable ZFS encryption? (yes/no) [${Zencrypt}]: " + while : ; do + echo -n "$_prompt" + read _input + + [ -z "$_input" ] && _input=$Zencrypt + case $_input in + [Nn][Oo]|[Nn]) + Zencrypt="no" + break + ;; + [Yy][Ee][Ss]|[Yy][Ee]|[Yy]) + Zencrypt="yes" + break + ;; + *) + # invalid answer; repeat loop + continue + ;; + esac + done + + if [ "${Zencrypt}" = "yes" ]; then + zfsopt="-o encryption=on -o keylocation=prompt -o keyformat=passphrase" + fi +} + +# create_zfs_chrooted_dataset +# Create ZFS dataset owned by the user that was just added within a bsdinstall chroot +# +create_zfs_chrooted_dataset() { + if ! ${ZFSCMD} create -u ${zfsopt} "${zhome}"; then + err "There was an error creating ZFS dataset (${zhome})." + return 1 + fi + ${ZFSCMD} set mountpoint=legacy "${zhome}" + ${MKDIRCMD} -p "${uhome}" + ${MOUNTCMD} -t zfs "${zhome}" "${uhome}" +} + +# umount_legacy_zfs +# Unmount ZFS home directory created as a legacy mount and switch inheritance +# +umount_legacy_zfs() { + ${UMOUNTCMD} "${uhome}" + ${ZFSCMD} inherit mountpoint "${zhome}" +} + +# create_zfs_dataset +# Create ZFS dataset owned by the user that was just added. +# +create_zfs_dataset() { + if ! ${ZFSCMD} create ${zfsopt} "${zhome}"; then + err "There was an error creating ZFS dataset (${zhome})." + return 1 + else + info "Successfully created ZFS dataset (${zhome})." + fi +} + +# set_zfs_perms +# Give new user ownership of newly created zfs dataset. +# +set_zfs_perms() { + if ! ${ZFSCMD} allow "${username}" create,destroy,mount,snapshot "${zhome}"; then + err "There was an error setting permissions on ZFS dataset (${zhome})." + return 1 + fi +} + # input_from_file # Reads a line of account information from standard input and # adds it to the user database. @@ -632,6 +752,7 @@ input_from_file() { get_class get_shell get_homedir + get_zfs_home get_homeperm get_password get_expire_dates @@ -704,6 +825,8 @@ input_interactive() { get_shell get_homedir get_homeperm + get_zfs_home + [ "$Zcreate" = "yes" ] && get_zfs_encryption while : ; do echo -n "Use password-based authentication? [$_usepass]: " @@ -787,12 +910,12 @@ input_interactive() { esac break done - + # Display the information we have so far and prompt to # commit it. # _disable=${disableflag:-"no"} - [ -z "$configflag" ] && printf "%-10s : %s\n" Username $username + [ -z "$configflag" ] && printf "%-11s : %s\n" Username $username case $passwdtype in yes) _pass='*****' @@ -807,16 +930,18 @@ input_interactive() { _pass='' ;; esac - [ -z "$configflag" ] && printf "%-10s : %s\n" "Password" "$_pass" - [ -n "$configflag" ] && printf "%-10s : %s\n" "Pass Type" "$passwdtype" - [ -z "$configflag" ] && printf "%-10s : %s\n" "Full Name" "$ugecos" - [ -z "$configflag" ] && printf "%-10s : %s\n" "Uid" "$uuid" - printf "%-10s : %s\n" "Class" "$uclass" - printf "%-10s : %s %s\n" "Groups" "${ulogingroup:-$username}" "$ugroups" - printf "%-10s : %s\n" "Home" "$uhome" - printf "%-10s : %s\n" "Home Mode" "$uhomeperm" - printf "%-10s : %s\n" "Shell" "$ushell" - printf "%-10s : %s\n" "Locked" "$_disable" + [ -z "$configflag" ] && printf "%-11s : %s\n" "Password" "$_pass" + [ -n "$configflag" ] && printf "%-11s : %s\n" "Pass Type" "$passwdtype" + [ -z "$configflag" ] && printf "%-11s : %s\n" "Full Name" "$ugecos" + [ -z "$configflag" ] && printf "%-11s : %s\n" "Uid" "$uuid" + [ "$Zcreate" = "yes" -a -z "$configflag" ] && printf "%-11s : %s\n" "ZFS dataset" "${zhome}" + [ "$Zencrypt" = "yes" -a -z "$configflag" ] && printf "%-11s : %s\n" "Encrypted" "${Zencrypt}" + printf "%-11s : %s\n" "Class" "$uclass" + printf "%-11s : %s %s\n" "Groups" "${ulogingroup:-$username}" "$ugroups" + printf "%-11s : %s\n" "Home" "$uhome" + printf "%-11s : %s\n" "Home Mode" "$uhomeperm" + printf "%-11s : %s\n" "Shell" "$ushell" + printf "%-11s : %s\n" "Locked" "$_disable" while : ; do echo -n "OK? (yes/no) [$_all_ok]: " read _input @@ -852,6 +977,11 @@ NOLOGIN="nologin" NOLOGIN_PATH="/usr/sbin/nologin" GREPCMD="/usr/bin/grep" DATECMD="/bin/date" +MKDIRCMD="/bin/mkdir" +MOUNTCMD="/sbin/mount" +UMOUNTCMD="/sbin/umount" +ZFSCMD="/sbin/zfs" +KLDSTATCMD="/sbin/kldstat" # Set default values # @@ -880,6 +1010,7 @@ infile= disableflag= Dflag= Sflag= +Zcreate="yes" readconfig="yes" homeprefix="/home" randompass= @@ -890,6 +1021,8 @@ defaultLgroup= defaultgroups= defaultshell="${DEFAULTSHELL}" defaultHomePerm= +zfsopt= +Zencrypt="no" # Make sure the user running this program is root. This isn't a security # measure as much as it is a useful method of reminding the user to @@ -1014,6 +1147,10 @@ for _switch ; do uidstart=$2 shift; shift ;; + -Z) + Zcreate="no" + shift + ;; esac done From nobody Mon Apr 29 10:14:50 2024 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 4VSfMZ50jBz5J0lZ; Mon, 29 Apr 2024 10:14: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 4VSfMZ4XJqz4jqY; Mon, 29 Apr 2024 10:14:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714385690; 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=g3MYn39YoYNuDVX4stiMyNYO7JwwgwqyGF0x+WYlHNU=; b=BQa39O5BJS1Lqv5mkDrHvDNa9aVJN9o0JK3y+oPJop0k69zbn0/rtXxyiE35AqqCedPva7 pjBfNbH40TKdS9CnmtrCwhEDa2+TrWmyt9JtWM4iu6irAGGwHiez7Y1ejoSpdbQcW36H/z 0Fp2Iri1frxe/LyAPZxcQctQko1L+M4p0CC6rYcprss8fJ1uNpjxajVeESAyDb4V6EnNlE JjoGnZHx5HVqXncxqH4PCXXkJ1wvf0mYiOMO64KH4Mk2rCp11ow4ZQNK20Ri6zSqwZo28L fVMpFKjwePm3gpBJzy7eU/3TFWLimKygFKto7MmX8xOOcvm33ALJDkfUXQToYw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714385690; a=rsa-sha256; cv=none; b=ll3Sxk4w5qWuOsXXDdLPQLycfPCMhIU1/itGKU212jHKE2kw3LmlC41r49oqG3phAT6R8y 7CsjdXKu9+oV67U7Jat4aK9GV+IsLwOYYVNvZukY6XTRsXtxugMVSY5Qd6dUDDiswtJ2UB 6RXpC1JTgPaZL/Pu+DALthPeM1SbnK+H55edtQmRjgW62Epmc2izlF7G1XYgda1NYXWPZ7 48qOWI8vO5qM4akQbXczKnmDUqGwRok6hLV+ga8vcaFSGEXCf1YvcKXOs1MF4UctaeiPIm cgynZrZciw282Dm6OQh4CCz2c3gPrtJok5TO2rg5XNRWlk9TZDrkJLHf8j1XaQ== 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=1714385690; 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=g3MYn39YoYNuDVX4stiMyNYO7JwwgwqyGF0x+WYlHNU=; b=rkArPqCl0+foF/VFslL6G7eg1M4OaOUoVicSNXdqVIeXBDq7/Bd2aYAUMeep/uJ8+kS2FC QBHP4MWNBUgYyB2I7FItTDQYuCcGgYWELGWlCYOMdRcQ1IlxdDboO/JJ+YhgXtyCgl2jkA 07gj/ON79F7ds1usSU3HrsiJVcW5stU2wOLbARBn/V5gznU1z53TGvFtmqGLYdpczHtoxM nDYOfK09IuJoXwWL8kjr43Ybt+3zSNcmYDvRIb6HuBvmdFDAtYnaKtq/JdYNeO/+FTnR5o 0HLPnntKJc7FZbL1xw7NnFMFzZfLUG/LSNykdQZpa75S7aH0PpegfVTJrgPgmg== 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 4VSfMZ47k0z14vD; Mon, 29 Apr 2024 10:14: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 43TAEoAl037099; Mon, 29 Apr 2024 10:14:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43TAEooo037096; Mon, 29 Apr 2024 10:14:50 GMT (envelope-from git) Date: Mon, 29 Apr 2024 10:14:50 GMT Message-Id: <202404291014.43TAEooo037096@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: 4f4905b2ef1c - stable/14 - adduser: Overhaul. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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: 4f4905b2ef1ca9df70d8c2966a8fe8a5040c1ed5 Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=4f4905b2ef1ca9df70d8c2966a8fe8a5040c1ed5 commit 4f4905b2ef1ca9df70d8c2966a8fe8a5040c1ed5 Author: Dag-Erling Smørgrav AuthorDate: 2024-04-19 15:11:16 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-04-29 10:14:16 +0000 adduser: Overhaul. Most importantly: * Make local variables local. * Use `$()` instead of backticks. * Avoid unsafe use of `-a` and `-o` operators in `test` expressions. * Remove a hack intended to ease the transition from Perl 22 years ago. MFC after: 1 week Reviewed by: allanjude Differential Revision: https://reviews.freebsd.org/D44863 (cherry picked from commit 170d0882903eb75b92cd10e9a1bcbe57a647ae7d) adduser: A few more improvements. MFC after: 1 week Reviewed by: jrm Differential Revision: https://reviews.freebsd.org/D44871 (cherry picked from commit b37333899bd27a74bdef34b7f34eb41bc6bd51bd) adduser: Fix a syntax error Reported by: Jose Luis Duran Fixes: b37333899bd2 MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D44871 (cherry picked from commit 5cafc38f11297cb302514f3cedb703a3ed199a22) --- usr.sbin/adduser/adduser.sh | 246 ++++++++++++++++++-------------------------- 1 file changed, 102 insertions(+), 144 deletions(-) diff --git a/usr.sbin/adduser/adduser.sh b/usr.sbin/adduser/adduser.sh index 0d5a628f8f33..9739b2e589fa 100644 --- a/usr.sbin/adduser/adduser.sh +++ b/usr.sbin/adduser/adduser.sh @@ -53,19 +53,17 @@ info() { # by pw(8). # get_nextuid () { - _uid=$1 - _nextuid= + local _uid=$1 _nextuid if [ -z "$_uid" ]; then - _nextuid="`${PWCMD} usernext | cut -f1 -d:`" + _nextuid="$(${PWCMD} usernext | cut -f1 -d:)" else while : ; do - ${PWCMD} usershow $_uid > /dev/null 2>&1 - if [ ! "$?" -eq 0 ]; then + if ! ${PWCMD} usershow $_uid > /dev/null 2>&1; then _nextuid=$_uid break fi - _uid=$(($_uid + 1)) + _uid=$((_uid + 1)) done fi echo $_nextuid @@ -103,17 +101,12 @@ show_usage() { # basename of the shell is output. # valid_shells() { - _prefix= - cat ${ETCSHELLS} | + local _prefix + + ${GREPCMD} '^[^#]' ${ETCSHELLS} | while read _path _junk ; do - case $_path in - \#*|'') - ;; - *) - echo -n "${_prefix}`basename $_path`" - _prefix=' ' - ;; - esac + echo -n "${_prefix}${_path##*/}" + _prefix=' ' done # /usr/sbin/nologin is a special case @@ -126,36 +119,31 @@ valid_shells() { # full path to the shell from the /etc/shells file. # fullpath_from_shell() { - _shell=$1 - [ -z "$_shell" ] && return 1 + local _shell=$1 _fullpath + + if [ -z "$_shell" ]; then + return + fi # /usr/sbin/nologin is a special case; it needs to be handled - # before the cat | while loop, since a 'return' from within + # before the grep | while loop, since a 'return' from within # a subshell will not terminate the function's execution, and # the path to the nologin shell might be printed out twice. # - if [ "$_shell" = "${NOLOGIN}" -o \ - "$_shell" = "${NOLOGIN_PATH}" ]; then + if [ "$_shell" = "${NOLOGIN}" ] || + [ "$_shell" = "${NOLOGIN_PATH}" ]; then echo ${NOLOGIN_PATH} - return 0; + return fi - cat ${ETCSHELLS} | + ${GREPCMD} '^[^#]' ${ETCSHELLS} | while read _path _junk ; do - case "$_path" in - \#*|'') - ;; - *) - if [ "$_path" = "$_shell" -o \ - "`basename $_path`" = "$_shell" ]; then - echo $_path - return 0 - fi - ;; - esac + if [ "$_path" = "$_shell" ] || + [ "${_path##*/}" = "$_shell" ]; then + echo "$_path" + break + fi done - - return 1 } # shell_exists shell @@ -166,19 +154,14 @@ fullpath_from_shell() { # will emit an informational message saying so. # shell_exists() { - _sh="$1" - _shellchk="${GREPCMD} '^$_sh$' ${ETCSHELLS} > /dev/null 2>&1" + local _sh="$1" - if ! eval $_shellchk; then - # The nologin shell is not listed in /etc/shells. - if [ "$_sh" != "${NOLOGIN_PATH}" ]; then - err "Invalid shell ($_sh) for user $username." - return 1 - fi + if [ -z "$(fullpath_from_shell "$_sh")" ] ; then + err "Invalid shell ($_sh) for user $username." + return 1 fi - ! [ -x "$_sh" ] && + [ -x "$_sh" ] || info "The shell ($_sh) does not exist or is not executable." - return 0 } @@ -190,7 +173,7 @@ shell_exists() { save_config() { echo "# Configuration file for adduser(8)." > ${ADDUSERCONF} echo "# NOTE: only *some* variables are saved." >> ${ADDUSERCONF} - echo "# Last Modified on `${DATECMD}`." >> ${ADDUSERCONF} + echo "# Last Modified on $(${DATECMD})." >> ${ADDUSERCONF} echo '' >> ${ADDUSERCONF} echo "defaultHomePerm=$uhomeperm" >> ${ADDUSERCONF} echo "defaultLgroup=$ulogingroup" >> ${ADDUSERCONF} @@ -210,6 +193,8 @@ save_config() { # message or lock the account, do so. # add_user() { + local _uid _name _comment _gecos _home _group _grouplist _shell _class + local _dotdir _expire _pwexpire _passwd _upasswd _passwdmethod # Is this a configuration run? If so, don't modify user database. # @@ -218,22 +203,6 @@ add_user() { return fi - _uid= - _name= - _comment= - _gecos= - _home= - _group= - _grouplist= - _shell= - _class= - _dotdir= - _expire= - _pwexpire= - _passwd= - _upasswd= - _passwdmethod= - _name="-n '$username'" [ -n "$uuid" ] && _uid='-u "$uuid"' [ -n "$ulogingroup" ] && _group='-g "$ulogingroup"' @@ -244,7 +213,7 @@ add_user() { [ -n "$udotdir" ] && _dotdir='-k "$udotdir"' [ -n "$uexpire" ] && _expire='-e "$uexpire"' [ -n "$upwexpire" ] && _pwexpire='-p "$upwexpire"' - if [ -z "$Dflag" -a -n "$uhome" ]; then + if [ -z "$Dflag" ] && [ -n "$uhome" ]; then # The /nonexistent home directory is special. It # means the user has no home directory. if [ "$uhome" = "$NOHOME" ]; then @@ -257,7 +226,7 @@ add_user() { _home='-m -d "$uhome"' fi fi - elif [ -n "$Dflag" -a -n "$uhome" ]; then + elif [ -n "$Dflag" ] && [ -n "$uhome" ]; then _home='-d "$uhome"' fi case $passwdtype in @@ -292,8 +261,7 @@ add_user() { if [ -n "$BSDINSTALL_CHROOT" ]; then create_zfs_chrooted_dataset else - create_zfs_dataset - if [ "$?" -ne 0 ]; then + if ! create_zfs_dataset; then err "There was an error adding user ($username)." return 1 fi @@ -304,7 +272,7 @@ add_user() { _pwcmd="$_pwcmd $_shell $_class $_home $_dotdir $_passwdmethod $_passwd" _pwcmd="$_pwcmd $_expire $_pwexpire" - if ! _output=`eval $_pwcmd` ; then + if ! _output=$(eval $_pwcmd) ; then err "There was an error adding user ($username)." return 1 else @@ -331,30 +299,27 @@ add_user() { fi fi - _line= - _owner= - _perms= + local _line _owner _perms _file _dir if [ -n "$msgflag" ]; then - [ -r "$msgfile" ] && { + if [ -r "$msgfile" ]; then # We're evaluating the contents of an external file. # Let's not open ourselves up for attack. _perms will # be empty if it's writeable only by the owner. _owner # will *NOT* be empty if the file is owned by root. # - _dir="`dirname $msgfile`" - _file="`basename $msgfile`" - _perms=`/usr/bin/find $_dir -name $_file -perm +07022 -prune` - _owner=`/usr/bin/find $_dir -name $_file -user 0 -prune` - if [ -z "$_owner" -o -n "$_perms" ]; then + _dir="$(dirname "$msgfile")" + _file="$(basename "$msgfile")" + _perms=$(/usr/bin/find "$_dir" -name "$_file" -perm +07022 -prune) + _owner=$(/usr/bin/find "$_dir" -name "$_file" -user 0 -prune) + if [ -z "$_owner" ] || [ -n "$_perms" ]; then err "The message file ($msgfile) may be writeable only by root." return 1 fi - cat "$msgfile" | while read _line ; do eval echo "$_line" - done | ${MAILCMD} -s"Welcome" ${username} + done <"$msgfile" | ${MAILCMD} -s"Welcome" ${username} info "Sent welcome message to ($username)." - } + fi fi } @@ -366,7 +331,7 @@ add_user() { # a file it will output an error message and return to the caller. # get_user() { - _input= + local _input # No need to take down user names if this is a configuration saving run. [ -n "$configflag" ] && return @@ -376,7 +341,7 @@ get_user() { echo -n "Username: " read _input else - _input="`echo "$fileline" | cut -f1 -d:`" + _input="$(echo "$fileline" | cut -f1 -d:)" fi # There *must* be a username, and it must not exist. If @@ -387,8 +352,7 @@ get_user() { err "You must enter a username!" [ -z "$fflag" ] && continue fi - ${PWCMD} usershow $_input > /dev/null 2>&1 - if [ "$?" -eq 0 ]; then + if ${PWCMD} usershow "$_input" > /dev/null 2>&1; then err "User exists!" [ -z "$fflag" ] && continue fi @@ -402,7 +366,7 @@ get_user() { # and batch (from file) mode. # get_gecos() { - _input= + local _input # No need to take down additional user information for a configuration run. [ -n "$configflag" ] && return @@ -411,7 +375,7 @@ get_gecos() { echo -n "Full name: " read _input else - _input="`echo "$fileline" | cut -f7 -d:`" + _input="$(echo "$fileline" | cut -f7 -d:)" fi ugecos="$_input" } @@ -422,8 +386,7 @@ get_gecos() { # If an invalid shell is entered it will simply use the default shell. # get_shell() { - _input= - _fullpath= + local _input _fullpath ushell="$defaultshell" # Make sure the current value of the shell is a valid one @@ -435,16 +398,16 @@ get_shell() { fi if [ -z "$fflag" ]; then - echo -n "Shell ($shells) [`basename $ushell`]: " + echo -n "Shell ($shells) [${ushell##*/}]: " read _input else - _input="`echo "$fileline" | cut -f9 -d:`" + _input="$(echo "$fileline" | cut -f9 -d:)" fi if [ -n "$_input" ]; then if [ -n "$Sflag" ]; then ushell="$_input" else - _fullpath=`fullpath_from_shell $_input` + _fullpath=$(fullpath_from_shell "$_input") if [ -n "$_fullpath" ]; then ushell="$_fullpath" else @@ -466,7 +429,7 @@ get_homedir() { echo -n "Home directory [${homeprefix}/${username}]: " read _input else - _input="`echo "$fileline" | cut -f8 -d:`" + _input="$(echo "$fileline" | cut -f8 -d:)" fi if [ -n "$_input" ]; then @@ -475,7 +438,9 @@ get_homedir() { # directory prefix. Otherwise it is understood to # be $prefix/$user # - [ -z "$configflag" ] && homeprefix="`dirname $uhome`" || homeprefix="$uhome" + [ -z "$configflag" ] && + homeprefix="$(dirname "$uhome")" || + homeprefix="$uhome" else uhome="${homeprefix}/${username}" fi @@ -485,9 +450,8 @@ get_homedir() { # Reads the account's home directory permissions. # get_homeperm() { + local _input _prompt uhomeperm=$defaultHomePerm - _input= - _prompt= if [ -n "$uhomeperm" ]; then _prompt="Home directory permissions [${uhomeperm}]: " @@ -509,19 +473,19 @@ get_homeperm() { # so, enable ZFS home dataset creation. # get_zfs_home() { + local _prefix + # check if zfs kernel module is loaded before attempting to run zfs to # prevent loading the kernel module on systems that don't use ZFS - if ! "$KLDSTATCMD" -q -m zfs; then - Zcreate="no" + if ! "$KLDSTATCMD" -q -m zfs || Zcreate="no"; then return fi - zfs_homeprefix=`${ZFSCMD} list -Ho name "${homeprefix}" 2>/dev/null` - if [ "$?" -ne 0 ]; then - Zcreate="no" - elif [ -z "${zfs_homeprefix}" ]; then + if ! _prefix=$(${ZFSCMD} list -Ho name "${homeprefix}" 2>/dev/null) || + [ -z "${_prefix}" ]; then Zcreate="no" + return fi - zhome="${zfs_homeprefix}/${username}" + zhome="${_prefix}/${username}" } # get_uid @@ -529,12 +493,11 @@ get_zfs_home() { # allocates one if it is not specified. # get_uid() { + local _input _prompt uuid=${uidstart} - _input= - _prompt= if [ -n "$uuid" ]; then - uuid=`get_nextuid $uuid` + uuid=$(get_nextuid "$uuid") _prompt="Uid [$uuid]: " else _prompt="Uid (Leave empty for default): " @@ -543,11 +506,11 @@ get_uid() { echo -n "$_prompt" read _input else - _input="`echo "$fileline" | cut -f2 -d:`" + _input="$(echo "$fileline" | cut -f2 -d:)" fi [ -n "$_input" ] && uuid=$_input - uuid=`get_nextuid $uuid` + uuid=$(get_nextuid "$uuid") uidstart=$uuid } @@ -555,15 +518,15 @@ get_uid() { # Reads login class of account. Can be used in interactive or batch mode. # get_class() { + local _input _uclass uclass="$defaultclass" - _input= _class=${uclass:-"default"} if [ -z "$fflag" ]; then echo -n "Login class [$_class]: " read _input else - _input="`echo "$fileline" | cut -f4 -d:`" + _input="$(echo "$fileline" | cut -f4 -d:)" fi [ -n "$_input" ] && uclass="$_input" @@ -577,14 +540,14 @@ get_class() { # will then provide a login group with the same name as the username. # get_logingroup() { + local _input ulogingroup="$defaultLgroup" - _input= if [ -z "$fflag" ]; then echo -n "Login group [${ulogingroup:-$username}]: " read _input else - _input="`echo "$fileline" | cut -f3 -d:`" + _input="$(echo "$fileline" | cut -f3 -d:)" fi # Pw(8) will use the username as login group if it's left empty @@ -596,8 +559,8 @@ get_logingroup() { # and batch modes. # get_groups() { + local _input _group ugroups="$defaultgroups" - _input= _group=${ulogingroup:-"${username}"} if [ -z "$configflag" ]; then @@ -616,8 +579,8 @@ get_groups() { # routine is used only from batch processing mode. # get_expire_dates() { - upwexpire="`echo "$fileline" | cut -f5 -d:`" - uexpire="`echo "$fileline" | cut -f6 -d:`" + upwexpire="$(echo "$fileline" | cut -f5 -d:)" + uexpire="$(echo "$fileline" | cut -f6 -d:)" } # get_password @@ -632,10 +595,10 @@ get_password() { # We may temporarily change a password type. Make sure it's changed # back to whatever it was before we process the next account. # - [ -n "$savedpwtype" ] && { + if [ -n "$savedpwtype" ]; then passwdtype=$savedpwtype savedpwtype= - } + fi # There may be a ':' in the password upass=${fileline#*:*:*:*:*:*:*:*:*:} @@ -662,7 +625,7 @@ get_password() { # Ask user if they want to enable encryption on their ZFS home dataset. # get_zfs_encryption() { - _input= + local _input _prompt _prompt="Enable ZFS encryption? (yes/no) [${Zencrypt}]: " while : ; do echo -n "$_prompt" @@ -738,7 +701,7 @@ set_zfs_perms() { # adds it to the user database. # input_from_file() { - _field= + local _field while read -r fileline ; do case "$fileline" in @@ -769,16 +732,14 @@ input_from_file() { # the user database. # input_interactive() { - _disable= - _pass= - _passconfirm= - _random="no" - _emptypass="no" - _usepass="yes" - _logingroup_ok="no" - _groups_ok="no" - _all_ok="yes" - _another_user="no" + local _disable _pass _passconfirm _input + local _random="no" + local _emptypass="no" + local _usepass="yes" + local _logingroup_ok="no" + local _groups_ok="no" + local _all_ok="yes" + local _another_user="no" case $passwdtype in none) _emptypass="yes" @@ -801,7 +762,7 @@ input_interactive() { until [ "$_logingroup_ok" = yes ]; do get_logingroup _logingroup_ok=yes - if [ -n "$ulogingroup" -a "$username" != "$ulogingroup" ]; then + if [ -n "$ulogingroup" ] && [ "$username" != "$ulogingroup" ]; then if ! ${PWCMD} show group $ulogingroup > /dev/null 2>&1; then echo "Group $ulogingroup does not exist!" _logingroup_ok=no @@ -865,8 +826,7 @@ input_interactive() { stty echo # if user entered a blank password # explicitly ask again. - [ -z "$upass" -a -z "$_passconfirm" ] \ - && continue + [ -z "$upass$_passconfirm" ] && continue ;; [Yy][Ee][Ss]|[Yy][Ee]|[Yy]) passwdtype="none" @@ -934,8 +894,10 @@ input_interactive() { [ -n "$configflag" ] && printf "%-11s : %s\n" "Pass Type" "$passwdtype" [ -z "$configflag" ] && printf "%-11s : %s\n" "Full Name" "$ugecos" [ -z "$configflag" ] && printf "%-11s : %s\n" "Uid" "$uuid" - [ "$Zcreate" = "yes" -a -z "$configflag" ] && printf "%-11s : %s\n" "ZFS dataset" "${zhome}" - [ "$Zencrypt" = "yes" -a -z "$configflag" ] && printf "%-11s : %s\n" "Encrypted" "${Zencrypt}" + [ "$Zcreate" = "yes" ] && [ -z "$configflag" ] && + printf "%-11s : %s\n" "ZFS dataset" "${zhome}" + [ "$Zencrypt" = "yes" ] && [ -z "$configflag" ] && + printf "%-11s : %s\n" "Encrypted" "${Zencrypt}" printf "%-11s : %s\n" "Class" "$uclass" printf "%-11s : %s %s\n" "Groups" "${ulogingroup:-$username}" "$ugroups" printf "%-11s : %s\n" "Home" "$uhome" @@ -966,7 +928,7 @@ input_interactive() { #### END SUBROUTINE DEFINITION #### -THISCMD=`/usr/bin/basename $0` +THISCMD=${0##*/} DEFAULTSHELL=/bin/sh ADDUSERCONF="${ADDUSERCONF:-/etc/adduser.conf}" PWCMD="${PWCMD:-/usr/sbin/pw}" @@ -999,7 +961,7 @@ udotdir=/usr/share/skel ugroups= uexpire= upwexpire= -shells="`valid_shells`" +shells="$(valid_shells)" passwdtype="yes" msgfile=/etc/adduser.msg msgflag= @@ -1028,7 +990,7 @@ Zencrypt="no" # measure as much as it is a useful method of reminding the user to # 'su -' before he/she wastes time entering data that won't be saved. # -procowner=${procowner:-`/usr/bin/id -u`} +procowner=${procowner:-$(/usr/bin/id -u)} if [ "$procowner" != "0" ]; then err 'you must be the super-user (uid 0) to use this utility.' exit 1 @@ -1046,12 +1008,8 @@ for _i in $* ; do break; fi done -if [ -n "$readconfig" ]; then - # On a long-lived system, the first time this script is run it - # will barf upon reading the configuration file for its perl predecessor. - if ( . ${ADDUSERCONF} > /dev/null 2>&1 ); then - [ -r ${ADDUSERCONF} ] && . ${ADDUSERCONF} > /dev/null 2>&1 - fi +if [ -n "$readconfig" ] && [ -r "${ADDUSERCONF}" ]; then + . "${ADDUSERCONF}" fi # Process command-line options @@ -1136,7 +1094,7 @@ for _switch ; do shift ;; -s) - defaultshell="`fullpath_from_shell $2`" + defaultshell="$(fullpath_from_shell $2)" shift; shift ;; -S) @@ -1181,7 +1139,7 @@ else fi case $_input in [Yy][Ee][Ss]|[Yy][Ee]|[Yy]) - uidstart=`get_nextuid $uidstart` + uidstart=$(get_nextuid $uidstart) input_interactive continue ;; From nobody Mon Apr 29 10:30:27 2024 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 4VSfjb3SjXz5J2D6; Mon, 29 Apr 2024 10:30: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 4VSfjb2n8Lz4lPH; Mon, 29 Apr 2024 10:30:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714386627; 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=SvjnmbQ1raGzFHhMWK5iETmQhDOuzygcAmuSYuiZSnQ=; b=eNwRBhvmQEXxqjzgpDmmXB0RO0Be8Kq0PVaAU14hdWZNxkR1fU/Go7hmGWrCoB3ETQ9CEs eRdis1HywrmoDI0txe7QXpiSnOS0TtKkUgaKT/lnFaGTwtdk1WFbLmghWQI2vKytAldwMo FNFlLAhjjOppC6uU0mazC86pcJLYL5GRfh7candWM73A1HaQkRfxbINiJ2vsuGh6S9eyRB ZieIDGOQlcG0csqH5jc3mjwUHfsFW8LICuGL5I6z73SbGNsNvwuyHFOpxVqCzgFUTeoKQR WWyEfUzT8Mk2LegDrHKWWwqAAk8ATpyo4DjkHOMhRstZOFg51WtRmk4T3ssP3A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714386627; a=rsa-sha256; cv=none; b=IDSNwHtl3GxkIlSXT2aU1xFd7zHthOgFLmumm0tfe+EG+Bpt0vdl+TfPslI+cFP6mU2/R4 vMLAEy/ggjKVa0oaHpfrru2pd1BchLc7QcL6U37lUwqcaoE3r2KBWEwXmnE/H7FuzDreNX JlfLhuXq2btlQ6kZ2DOwAEKNPMw82GEOaKFqq+Lk0XFlu6oXLSlPAB4yr7B8erUvV5v7Xa bQGn/4FKTYNfkN+UiYx0uJeSSODkYa896uJcg9QSkx18zcUSCzh96K2HCjwa2Zt9FQvl4i dJdWS0/UcZso/QHSqNqwVCmpiSd8Y6nWKJ0exqyloX9PP+eUH57Jm7XAFFqomg== 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=1714386627; 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=SvjnmbQ1raGzFHhMWK5iETmQhDOuzygcAmuSYuiZSnQ=; b=KTy6kNMXn0sKe+6cx+vUVjoElMmTJWhZr7vwnFi9sCYonSI/0xZAnOhdAN6+5jDlGOeYai DqOkWflxxmTaJgdzLyAXVPIVtcFa+lq10Yfo0Kl2vAiOOCTy6CGgnuvgJqU8c27Yt9bdxg 0OczZXYhRw48lPaa16rF101YBm7M6Uqqq+EuekTix98j165LTKgqk0MtMV7ffgvt7XfhUK xZDgrV9ReWlmmpOCz7ztC07X+OsrQviOj34tzNJApedqmRDLEb5F7xmg8Q5BRd3SCFOCas ByEQ/LWWvw+W608X+I+pJKKOE4ozPsZ60/Nf1/2BnYz9iWPCWXOARq1Naw3U0A== 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 4VSfjb2Nnmz14k2; Mon, 29 Apr 2024 10:30: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 43TAURYs063427; Mon, 29 Apr 2024 10:30:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43TAURfG063424; Mon, 29 Apr 2024 10:30:27 GMT (envelope-from git) Date: Mon, 29 Apr 2024 10:30:27 GMT Message-Id: <202404291030.43TAURfG063424@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: edff88aee215 - stable/14 - adduser: Really fix a syntax 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: edff88aee2150ad4e1e855f07f1eddbba7f193cd Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=edff88aee2150ad4e1e855f07f1eddbba7f193cd commit edff88aee2150ad4e1e855f07f1eddbba7f193cd Author: Dag-Erling Smørgrav AuthorDate: 2024-04-29 10:29:35 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-04-29 10:30:20 +0000 adduser: Really fix a syntax error Fixes: 5cafc38f1129 Differential Revision: https://reviews.freebsd.org/D44871 (cherry picked from commit 9e8618276fada5c68cc64676fba2ae2abd0544f5) --- usr.sbin/adduser/adduser.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usr.sbin/adduser/adduser.sh b/usr.sbin/adduser/adduser.sh index 9739b2e589fa..e9027b6b7876 100644 --- a/usr.sbin/adduser/adduser.sh +++ b/usr.sbin/adduser/adduser.sh @@ -477,7 +477,8 @@ get_zfs_home() { # check if zfs kernel module is loaded before attempting to run zfs to # prevent loading the kernel module on systems that don't use ZFS - if ! "$KLDSTATCMD" -q -m zfs || Zcreate="no"; then + if ! "$KLDSTATCMD" -q -m zfs; then + Zcreate="no" return fi if ! _prefix=$(${ZFSCMD} list -Ho name "${homeprefix}" 2>/dev/null) || From nobody Mon Apr 29 10:34:24 2024 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 4VSfp84sZPz5J2DT; Mon, 29 Apr 2024 10:34: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 4VSfp84GR0z4lsX; Mon, 29 Apr 2024 10:34:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714386864; 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=bs45+3EBdVQvN4+gvateN5bnsmT6hw7xVUVOP9v+4ps=; b=v8UxvrIGu2svUzKa9VzaDNbfokWAMbrrWzhNKGmTfUjA5tb2XsEd4VtVoXCST4C2JFIdIk zSPRAemIKTzDKEhqtNa7tNDtIZqxZ4VEqRAKc2vCRO/eGWV8ki6sBiQvfrrBvafq400XQY aUf78I3PhSuZmarRP3tYR4oWyFW6/MhFWW9OvbGRWHyxC1hEZj/s+9O3X/m40IID5QbQq/ 4QohVDhEoamdaqt4/+GwOMIBtJs3qf83NQOnUNTAgi1T4J9B7lbwcURkWXxl8a86JCy4Aa h7qgAudxthaXQBFyd5ssx424fSAEWj7TI6bweDQeWj2lxsoJRhugp4CN6TrKHg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714386864; a=rsa-sha256; cv=none; b=G/pl1G6HdmcSth5d3Rb6j5FYbu1e3IkBnA534ntBvhyYVg0t3gZu4QXSNXMHDtGoyGmCui I48wFtPfHExUIMt+r6TmnRZf/2UmpskeMBwb30UbeuYVjd6EhRADFrS11g05HBK1addoZk efaJ/+QVAxxWFfWk1qMhZ1Mqzc03Afk4QvzRKZ5+9k08InbF22e2OpD+hYW603swb6dGfi CrG1JAiNkprBQMlqSyvzVSi3r39aYuUHdtlW5O6E9JSXwJlDBCAbsNX3m7ScnLdTs7JHtA kL2ceHRlTFdre7XUUvakx/xdV0KYSpaps1Em8YT3D6eBg1EJZDCcIvNzVpQaVA== 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=1714386864; 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=bs45+3EBdVQvN4+gvateN5bnsmT6hw7xVUVOP9v+4ps=; b=d2yjkpgG3I1rMGXqGkZa82ZNVolZi9KkokYrzm6qXVokI608EaNWBF0uDs3nyfXEK2urKl DSpennJG5ARZpLLFe9Ge6vRBRlBqfdnNmHKugYcCEs7gQyJs89jk0/4pMrBk7pUUI2b18b uxuXJmNFX446yELatUupsshwSWhbjfMdKosOYVSPh9LEJ4ixrKiFiAaYDbhjVSlwh+g0fI Sr4sRlULxBYep9JMZSAzC5mdFLUSVqLqk8ZGtWKQvb+QbrjbAdDmcXyXnfs7AUU3p7WKQ2 M1XbaH8p6pi4a2E6AMTuDMQH/pAxW9YWxgxo12WPDms77RZzjCRIqA57pD/kcg== 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 4VSfp83sTFz14F4; Mon, 29 Apr 2024 10:34: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 43TAYOr7071347; Mon, 29 Apr 2024 10:34:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43TAYOWd071344; Mon, 29 Apr 2024 10:34:24 GMT (envelope-from git) Date: Mon, 29 Apr 2024 10:34:24 GMT Message-Id: <202404291034.43TAYOWd071344@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: 1da8405cdec4 - stable/13 - add defaults for adduser.sh (OK? [yes] & additional user [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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: 1da8405cdec442bc75c5443a727905f0f2c5800d Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=1da8405cdec442bc75c5443a727905f0f2c5800d commit 1da8405cdec442bc75c5443a727905f0f2c5800d Author: Sven Ruediger AuthorDate: 2023-07-18 17:37:48 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-04-29 10:16:06 +0000 add defaults for adduser.sh (OK? [yes] & additional user [no]) Event: Kitchener-Waterloo Hackathon 202305 Differential Revision: https://reviews.freebsd.org/D40157 (cherry picked from commit 9efad6f9e1084e97dd6e2599562e7db0bd31a4ab) --- usr.sbin/adduser/adduser.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/usr.sbin/adduser/adduser.sh b/usr.sbin/adduser/adduser.sh index 89dec9cf3d25..fef9e293c1ce 100644 --- a/usr.sbin/adduser/adduser.sh +++ b/usr.sbin/adduser/adduser.sh @@ -656,6 +656,8 @@ input_interactive() { _usepass="yes" _logingroup_ok="no" _groups_ok="no" + _all_ok="yes" + _another_user="no" case $passwdtype in none) _emptypass="yes" @@ -816,8 +818,11 @@ input_interactive() { printf "%-10s : %s\n" "Shell" "$ushell" printf "%-10s : %s\n" "Locked" "$_disable" while : ; do - echo -n "OK? (yes/no): " + echo -n "OK? (yes/no) [$_all_ok]: " read _input + if [ -z "$_input" ]; then + _input=$_all_ok + fi case $_input in [Nn][Oo]|[Nn]) return 1 @@ -1029,11 +1034,14 @@ else input_interactive while : ; do if [ -z "$configflag" ]; then - echo -n "Add another user? (yes/no): " + echo -n "Add another user? (yes/no) [$_another_user]: " else - echo -n "Re-edit the default configuration? (yes/no): " + echo -n "Re-edit the default configuration? (yes/no) [$_another_user]: " fi read _input + if [ -z "$_input" ]; then + _input=$_another_user + fi case $_input in [Yy][Ee][Ss]|[Yy][Ee]|[Yy]) uidstart=`get_nextuid $uidstart` From nobody Mon Apr 29 10:34:25 2024 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 4VSfp96Vx8z5J2Mq; Mon, 29 Apr 2024 10:34: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 4VSfp954Whz4lpd; Mon, 29 Apr 2024 10:34:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714386865; 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=Rg5OnYjnF3WetrVOUPKXmaoPRtv61zV+FAtS+CVIJ2k=; b=IRffq3aD+t77D01s9q7J24ZGr9tHSeMAWVdmrj+uhsexvy5anZygp9g0C7Gpxbb2UvLBYG jMHtJNgYgRaBWqdlnpuRxHU9j8wMTRz7IRxokTlcufhK4/uPKET6S5zSURX7ngyE4XduSw q4p2OSsRC7VKn49XAsUYc7OrbsURCstAt+wMTlDeJwjvdeFchArWM4jhVhUh4ukg7Ut7Xh 3ocDgbZHvUUcefVreF/P9UkK3bzbgOBUKVM9vNVvtqgYQjR21o8sXEp35YpIelD/tUkupk sDLByxArnWhc4gsEOFKk8yeyYx8ANToUa/vme3sonvMdvNqw0w4LIlciFTVJug== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714386865; a=rsa-sha256; cv=none; b=sEFJQBfAGhkg1wxkbzUoE7z3mB6uqXoqc4fPLfS9Xy8rH37wK/EUMMfr1rW4e11ycxAd8Y Czi1SP9O/AeZ5wPJIlNFHWj8bM4DPUQEOLxFgEN/Br1OHHjwg7gwdtsoH6fbTtnSwmSTrb fki64fQPDMzf9JF1vIEnVNBUapVFG9vcIp4pNvWL/gsEUowQICEBEB6j5Ir99WyrUPseCR BVcEIu/YP4SedgRQze88ijDiB0MY5Q1jD2213V6unD9I5MDeRvxnwHSXBzusN2/mCy7sWq OMW9spyDZwqKDVwaGJLLdMlmNTyRGlOlAWVjCOgvrWehRxwmRgIGWn7aalavKg== 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=1714386865; 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=Rg5OnYjnF3WetrVOUPKXmaoPRtv61zV+FAtS+CVIJ2k=; b=vPrV0ZnBxFBKRELkF4lzWxZqLEsbiEV62lWsD2VbrUkpM40BTc8IDDaA/qH66YjJzST9QB gZQmwkPLmT4fSI8KPhzuEX/uyUTI4ltDMtEdRshJ7huZkTjWaTrr1VH8fjLMgNDpqGYOCX dLiYaCo1U4CTTg82HLK6JmDean30vGhz0hL6HIOMxQrqqiyetX/kWBmT5Tb+OuCgoTPwQq VDa7Hv3zugbuwU6Mgy3wDMSP7F/zRGhIMzT+/fhUed4Ju5I1IJdiav0LnBkaIzXlW/xQ2U qxNfcddYHV33cbITdl4j308Y6wbfCXb7RDJ9F7kW4buFsp0lK6TdJ+A5e9w81g== 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 4VSfp94gwxz15R0; Mon, 29 Apr 2024 10:34: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 43TAYPGM071402; Mon, 29 Apr 2024 10:34:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43TAYPJd071400; Mon, 29 Apr 2024 10:34:25 GMT (envelope-from git) Date: Mon, 29 Apr 2024 10:34:25 GMT Message-Id: <202404291034.43TAYPJd071400@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: 72fc3645e079 - stable/13 - adduser(8): support creation of ZFS dataset List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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: 72fc3645e079ecf930f3fedc218b9f8bf690fa5a Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=72fc3645e079ecf930f3fedc218b9f8bf690fa5a commit 72fc3645e079ecf930f3fedc218b9f8bf690fa5a Author: John Grafton AuthorDate: 2024-04-11 18:11:18 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-04-29 10:16:06 +0000 adduser(8): support creation of ZFS dataset On systems utilizing ZFS, default to creating a ZFS dataset for a new user's home directory if the parent directory resides on a ZFS dataset. Add a flag that disables this behavior if the administrator explicitly does not want it. If run during installation from within a chroot, set mountpoint to legacy after dataset creation and mount directly into the chroot. Then umount and reset the mountpoint to inherit from parent. Also support ZFS default encryption on user's home directory. Feedback by: delphij Reviewed by: imp, kevans Pull Request: https://github.com/freebsd/freebsd-src/pull/881 (cherry picked from commit 215c0a5158f17f515f365fc28a9ff0b367be8fc9) --- usr.sbin/adduser/adduser.8 | 10 ++- usr.sbin/adduser/adduser.conf.5 | 2 + usr.sbin/adduser/adduser.sh | 161 +++++++++++++++++++++++++++++++++++++--- 3 files changed, 159 insertions(+), 14 deletions(-) diff --git a/usr.sbin/adduser/adduser.8 b/usr.sbin/adduser/adduser.8 index 4669afc2bfe6..ed67e21f9430 100644 --- a/usr.sbin/adduser/adduser.8 +++ b/usr.sbin/adduser/adduser.8 @@ -24,7 +24,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd September 15, 2012 +.Dd April 11, 2024 .Dt ADDUSER 8 .Os .Sh NAME @@ -32,7 +32,7 @@ .Nd command for adding new users .Sh SYNOPSIS .Nm -.Op Fl CDENShq +.Op Fl CDENSZhq .Op Fl G Ar groups .Op Fl L Ar login_class .Op Fl M Ar mode @@ -52,6 +52,10 @@ utility is a shell script, implemented around the command, for adding new users. It creates passwd/group entries, a home directory, copies dotfiles and sends the new user a welcome message. +On systems where the parent of home directory is a ZFS dataset, +.Nm +will create the home directory as a ZFS dataset by default, +unless the system administrator specified otherwise. It supports two modes of operation. It may be used interactively at the command line to add one user at a time, or it may be directed @@ -295,6 +299,8 @@ In addition, it will be available for inclusion in the message file in the .Va randompass variable. .El +.It Fl Z +Do not attempt to create ZFS home dataset. .El .Sh FORMAT When the diff --git a/usr.sbin/adduser/adduser.conf.5 b/usr.sbin/adduser/adduser.conf.5 index 2d445a2fabbf..09b80f2df021 100644 --- a/usr.sbin/adduser/adduser.conf.5 +++ b/usr.sbin/adduser/adduser.conf.5 @@ -171,6 +171,8 @@ The default information to be held in the GECOS field of .It Va uidstart The default user ID setting. This must be a number above 1000 and fewer than 65534. +.It Va Zflag +Do not attempt to create ZFS home dataset. .El .Sh EXAMPLES The following is an example diff --git a/usr.sbin/adduser/adduser.sh b/usr.sbin/adduser/adduser.sh index fef9e293c1ce..0d5a628f8f33 100644 --- a/usr.sbin/adduser/adduser.sh +++ b/usr.sbin/adduser/adduser.sh @@ -84,6 +84,7 @@ show_usage() { echo " -L login class of the user" echo " -M file permission for home directory" echo " -N do not read configuration file" + echo " -Z do not attempt to create ZFS home dataset" echo " -S a nonexistent shell is not an error" echo " -d home directory" echo " -f file from which input will be received" @@ -283,6 +284,22 @@ add_user() { ;; esac + # create ZFS dataset before home directory is created with pw + if [ "${Zcreate}" = "yes" ]; then + if [ "${Zencrypt}" = "yes" ]; then + echo "Enter encryption keyphrase for ZFS dataset (${zhome}):" + fi + if [ -n "$BSDINSTALL_CHROOT" ]; then + create_zfs_chrooted_dataset + else + create_zfs_dataset + if [ "$?" -ne 0 ]; then + err "There was an error adding user ($username)." + return 1 + fi + fi + fi + _pwcmd="$_upasswd ${PWCMD} useradd $_uid $_name $_group $_grouplist $_comment" _pwcmd="$_pwcmd $_shell $_class $_home $_dotdir $_passwdmethod $_passwd" _pwcmd="$_pwcmd $_expire $_pwexpire" @@ -306,6 +323,14 @@ add_user() { fi fi + # give newly created user permissions to their home zfs dataset + if [ "${Zcreate}" = "yes" ]; then + set_zfs_perms + if [ -n "$BSDINSTALL_CHROOT" ]; then + umount_legacy_zfs + fi + fi + _line= _owner= _perms= @@ -479,6 +504,26 @@ get_homeperm() { fi } +# get_zfs_home +# Determine if homeprefix is located on a ZFS filesystem and if +# so, enable ZFS home dataset creation. +# +get_zfs_home() { + # check if zfs kernel module is loaded before attempting to run zfs to + # prevent loading the kernel module on systems that don't use ZFS + if ! "$KLDSTATCMD" -q -m zfs; then + Zcreate="no" + return + fi + zfs_homeprefix=`${ZFSCMD} list -Ho name "${homeprefix}" 2>/dev/null` + if [ "$?" -ne 0 ]; then + Zcreate="no" + elif [ -z "${zfs_homeprefix}" ]; then + Zcreate="no" + fi + zhome="${zfs_homeprefix}/${username}" +} + # get_uid # Reads a numeric userid in an interactive or batch session. Automatically # allocates one if it is not specified. @@ -613,6 +658,81 @@ get_password() { fi } +# get_zfs_encryption +# Ask user if they want to enable encryption on their ZFS home dataset. +# +get_zfs_encryption() { + _input= + _prompt="Enable ZFS encryption? (yes/no) [${Zencrypt}]: " + while : ; do + echo -n "$_prompt" + read _input + + [ -z "$_input" ] && _input=$Zencrypt + case $_input in + [Nn][Oo]|[Nn]) + Zencrypt="no" + break + ;; + [Yy][Ee][Ss]|[Yy][Ee]|[Yy]) + Zencrypt="yes" + break + ;; + *) + # invalid answer; repeat loop + continue + ;; + esac + done + + if [ "${Zencrypt}" = "yes" ]; then + zfsopt="-o encryption=on -o keylocation=prompt -o keyformat=passphrase" + fi +} + +# create_zfs_chrooted_dataset +# Create ZFS dataset owned by the user that was just added within a bsdinstall chroot +# +create_zfs_chrooted_dataset() { + if ! ${ZFSCMD} create -u ${zfsopt} "${zhome}"; then + err "There was an error creating ZFS dataset (${zhome})." + return 1 + fi + ${ZFSCMD} set mountpoint=legacy "${zhome}" + ${MKDIRCMD} -p "${uhome}" + ${MOUNTCMD} -t zfs "${zhome}" "${uhome}" +} + +# umount_legacy_zfs +# Unmount ZFS home directory created as a legacy mount and switch inheritance +# +umount_legacy_zfs() { + ${UMOUNTCMD} "${uhome}" + ${ZFSCMD} inherit mountpoint "${zhome}" +} + +# create_zfs_dataset +# Create ZFS dataset owned by the user that was just added. +# +create_zfs_dataset() { + if ! ${ZFSCMD} create ${zfsopt} "${zhome}"; then + err "There was an error creating ZFS dataset (${zhome})." + return 1 + else + info "Successfully created ZFS dataset (${zhome})." + fi +} + +# set_zfs_perms +# Give new user ownership of newly created zfs dataset. +# +set_zfs_perms() { + if ! ${ZFSCMD} allow "${username}" create,destroy,mount,snapshot "${zhome}"; then + err "There was an error setting permissions on ZFS dataset (${zhome})." + return 1 + fi +} + # input_from_file # Reads a line of account information from standard input and # adds it to the user database. @@ -632,6 +752,7 @@ input_from_file() { get_class get_shell get_homedir + get_zfs_home get_homeperm get_password get_expire_dates @@ -704,6 +825,8 @@ input_interactive() { get_shell get_homedir get_homeperm + get_zfs_home + [ "$Zcreate" = "yes" ] && get_zfs_encryption while : ; do echo -n "Use password-based authentication? [$_usepass]: " @@ -787,12 +910,12 @@ input_interactive() { esac break done - + # Display the information we have so far and prompt to # commit it. # _disable=${disableflag:-"no"} - [ -z "$configflag" ] && printf "%-10s : %s\n" Username $username + [ -z "$configflag" ] && printf "%-11s : %s\n" Username $username case $passwdtype in yes) _pass='*****' @@ -807,16 +930,18 @@ input_interactive() { _pass='' ;; esac - [ -z "$configflag" ] && printf "%-10s : %s\n" "Password" "$_pass" - [ -n "$configflag" ] && printf "%-10s : %s\n" "Pass Type" "$passwdtype" - [ -z "$configflag" ] && printf "%-10s : %s\n" "Full Name" "$ugecos" - [ -z "$configflag" ] && printf "%-10s : %s\n" "Uid" "$uuid" - printf "%-10s : %s\n" "Class" "$uclass" - printf "%-10s : %s %s\n" "Groups" "${ulogingroup:-$username}" "$ugroups" - printf "%-10s : %s\n" "Home" "$uhome" - printf "%-10s : %s\n" "Home Mode" "$uhomeperm" - printf "%-10s : %s\n" "Shell" "$ushell" - printf "%-10s : %s\n" "Locked" "$_disable" + [ -z "$configflag" ] && printf "%-11s : %s\n" "Password" "$_pass" + [ -n "$configflag" ] && printf "%-11s : %s\n" "Pass Type" "$passwdtype" + [ -z "$configflag" ] && printf "%-11s : %s\n" "Full Name" "$ugecos" + [ -z "$configflag" ] && printf "%-11s : %s\n" "Uid" "$uuid" + [ "$Zcreate" = "yes" -a -z "$configflag" ] && printf "%-11s : %s\n" "ZFS dataset" "${zhome}" + [ "$Zencrypt" = "yes" -a -z "$configflag" ] && printf "%-11s : %s\n" "Encrypted" "${Zencrypt}" + printf "%-11s : %s\n" "Class" "$uclass" + printf "%-11s : %s %s\n" "Groups" "${ulogingroup:-$username}" "$ugroups" + printf "%-11s : %s\n" "Home" "$uhome" + printf "%-11s : %s\n" "Home Mode" "$uhomeperm" + printf "%-11s : %s\n" "Shell" "$ushell" + printf "%-11s : %s\n" "Locked" "$_disable" while : ; do echo -n "OK? (yes/no) [$_all_ok]: " read _input @@ -852,6 +977,11 @@ NOLOGIN="nologin" NOLOGIN_PATH="/usr/sbin/nologin" GREPCMD="/usr/bin/grep" DATECMD="/bin/date" +MKDIRCMD="/bin/mkdir" +MOUNTCMD="/sbin/mount" +UMOUNTCMD="/sbin/umount" +ZFSCMD="/sbin/zfs" +KLDSTATCMD="/sbin/kldstat" # Set default values # @@ -880,6 +1010,7 @@ infile= disableflag= Dflag= Sflag= +Zcreate="yes" readconfig="yes" homeprefix="/home" randompass= @@ -890,6 +1021,8 @@ defaultLgroup= defaultgroups= defaultshell="${DEFAULTSHELL}" defaultHomePerm= +zfsopt= +Zencrypt="no" # Make sure the user running this program is root. This isn't a security # measure as much as it is a useful method of reminding the user to @@ -1014,6 +1147,10 @@ for _switch ; do uidstart=$2 shift; shift ;; + -Z) + Zcreate="no" + shift + ;; esac done From nobody Mon Apr 29 10:34:26 2024 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 4VSfpB6BkWz5J2d5; Mon, 29 Apr 2024 10:34: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 4VSfpB5V1rz4mC4; Mon, 29 Apr 2024 10:34:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714386866; 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=kWB2xAjPaAw0/+O4D+YzsXk+NpUKTKP3UxWFvY+edOQ=; b=WRuWD53RU3OS8kSzib6iCzTpzOlFqtrM6lUUQ1zPar8RN299cLtGnh5f4Lgy4t78cWh/RQ UCosPhsHNSS+bYhp1321Ty0IL5x8dv96pZ8kcup77ySWPTcpInzyCR4FkBQP1oe89hXyrl UT9Oxy0J6WOeHYC3lTFGQoZ5LN+pgY30U6L5xRthC++A0gwKgUzauqda1oCnZ2Uj+CPITh WBcUF8THOPP7J8lGj+BxgqexNuK3ucM993CV7D3dRcMD7e1M5f0wSZWAI8GpYd6qniq+k+ lwZ3szcRNRhdGtmqq9sUK8DArKYqgIKcmD+MZkwCuNBb1Xqpox5eHeRU+MU9jQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714386866; a=rsa-sha256; cv=none; b=TUcw+TAQD01d+v6rf193r5JJKHPk6LqHgS9TSKS6SibyyNgUZxQQPN6BvivgGC3XWVESyf 1f4GXYOi/zcdflxMre/jc/AQWaTVlo8luDf+SZg8QVvTpj1PVtulwSdqzUihcrgBv0lfOZ yUSAMqejvIqJsRoX+1+KaIw4INNDhzwxLMYeRErX17sjdCKYqilTRliYKkTUTPeTeMPCWC V4VJnaKCJV/iAKDYN24JJla7SR7HyjERvjEL7SZApzpdLNTTnOEeHmzM5RkWwUI4bKJgUP o4KGBb8wfVh8wctdP1sXhac5VseZ96sGXQ6nw4msQo3yyD73P8wg0lEDWtCBoQ== 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=1714386866; 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=kWB2xAjPaAw0/+O4D+YzsXk+NpUKTKP3UxWFvY+edOQ=; b=voMNaLkCmn8+/67n0K9+aA6V+mbIRk5T9t+ay9MXlVLhT7+FimN5V8u+DDZTc877e5thii z/s/YP9MhD1MhgCR32rQBFDeWzxitfgao6bt/4ZoMor8OOxVjrr/xrYMDBVtoiPSS1OL+N 400lUOXhAXnho06xftsl36rjfKU9dx5r5wjD2kZExWHMah8l/n+2jj4brbUcdkNATNFCtP rRF6ZOMuWGdhZju3oT0/geP7sAVPemeaxDXcsGFcRrVrFDQ4s0wK1oRP2kAICnJOzfpEh3 O5PcZukmjuObNEVLKVyTUna9MEnXdJ9b0YKDh57YRX+9K2OWDr6DisCUZVQTgg== 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 4VSfpB55qyz158N; Mon, 29 Apr 2024 10:34: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 43TAYQOb071558; Mon, 29 Apr 2024 10:34:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43TAYQeJ071555; Mon, 29 Apr 2024 10:34:26 GMT (envelope-from git) Date: Mon, 29 Apr 2024 10:34:26 GMT Message-Id: <202404291034.43TAYQeJ071555@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: b7a56907af0c - stable/13 - adduser: Overhaul. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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: b7a56907af0cae57375ca2fb7f3e3a77da916ca8 Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=b7a56907af0cae57375ca2fb7f3e3a77da916ca8 commit b7a56907af0cae57375ca2fb7f3e3a77da916ca8 Author: Dag-Erling Smørgrav AuthorDate: 2024-04-19 15:11:16 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-04-29 10:30:39 +0000 adduser: Overhaul. Most importantly: * Make local variables local. * Use `$()` instead of backticks. * Avoid unsafe use of `-a` and `-o` operators in `test` expressions. * Remove a hack intended to ease the transition from Perl 22 years ago. MFC after: 1 week Reviewed by: allanjude Differential Revision: https://reviews.freebsd.org/D44863 (cherry picked from commit 170d0882903eb75b92cd10e9a1bcbe57a647ae7d) adduser: A few more improvements. MFC after: 1 week Reviewed by: jrm Differential Revision: https://reviews.freebsd.org/D44871 (cherry picked from commit b37333899bd27a74bdef34b7f34eb41bc6bd51bd) adduser: Fix a syntax error Reported by: Jose Luis Duran Fixes: b37333899bd2 MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D44871 (cherry picked from commit 5cafc38f11297cb302514f3cedb703a3ed199a22) adduser: Really fix a syntax error Fixes: 5cafc38f1129 Differential Revision: https://reviews.freebsd.org/D44871 (cherry picked from commit 9e8618276fada5c68cc64676fba2ae2abd0544f5) --- usr.sbin/adduser/adduser.sh | 243 ++++++++++++++++++-------------------------- 1 file changed, 101 insertions(+), 142 deletions(-) diff --git a/usr.sbin/adduser/adduser.sh b/usr.sbin/adduser/adduser.sh index 0d5a628f8f33..e9027b6b7876 100644 --- a/usr.sbin/adduser/adduser.sh +++ b/usr.sbin/adduser/adduser.sh @@ -53,19 +53,17 @@ info() { # by pw(8). # get_nextuid () { - _uid=$1 - _nextuid= + local _uid=$1 _nextuid if [ -z "$_uid" ]; then - _nextuid="`${PWCMD} usernext | cut -f1 -d:`" + _nextuid="$(${PWCMD} usernext | cut -f1 -d:)" else while : ; do - ${PWCMD} usershow $_uid > /dev/null 2>&1 - if [ ! "$?" -eq 0 ]; then + if ! ${PWCMD} usershow $_uid > /dev/null 2>&1; then _nextuid=$_uid break fi - _uid=$(($_uid + 1)) + _uid=$((_uid + 1)) done fi echo $_nextuid @@ -103,17 +101,12 @@ show_usage() { # basename of the shell is output. # valid_shells() { - _prefix= - cat ${ETCSHELLS} | + local _prefix + + ${GREPCMD} '^[^#]' ${ETCSHELLS} | while read _path _junk ; do - case $_path in - \#*|'') - ;; - *) - echo -n "${_prefix}`basename $_path`" - _prefix=' ' - ;; - esac + echo -n "${_prefix}${_path##*/}" + _prefix=' ' done # /usr/sbin/nologin is a special case @@ -126,36 +119,31 @@ valid_shells() { # full path to the shell from the /etc/shells file. # fullpath_from_shell() { - _shell=$1 - [ -z "$_shell" ] && return 1 + local _shell=$1 _fullpath + + if [ -z "$_shell" ]; then + return + fi # /usr/sbin/nologin is a special case; it needs to be handled - # before the cat | while loop, since a 'return' from within + # before the grep | while loop, since a 'return' from within # a subshell will not terminate the function's execution, and # the path to the nologin shell might be printed out twice. # - if [ "$_shell" = "${NOLOGIN}" -o \ - "$_shell" = "${NOLOGIN_PATH}" ]; then + if [ "$_shell" = "${NOLOGIN}" ] || + [ "$_shell" = "${NOLOGIN_PATH}" ]; then echo ${NOLOGIN_PATH} - return 0; + return fi - cat ${ETCSHELLS} | + ${GREPCMD} '^[^#]' ${ETCSHELLS} | while read _path _junk ; do - case "$_path" in - \#*|'') - ;; - *) - if [ "$_path" = "$_shell" -o \ - "`basename $_path`" = "$_shell" ]; then - echo $_path - return 0 - fi - ;; - esac + if [ "$_path" = "$_shell" ] || + [ "${_path##*/}" = "$_shell" ]; then + echo "$_path" + break + fi done - - return 1 } # shell_exists shell @@ -166,19 +154,14 @@ fullpath_from_shell() { # will emit an informational message saying so. # shell_exists() { - _sh="$1" - _shellchk="${GREPCMD} '^$_sh$' ${ETCSHELLS} > /dev/null 2>&1" + local _sh="$1" - if ! eval $_shellchk; then - # The nologin shell is not listed in /etc/shells. - if [ "$_sh" != "${NOLOGIN_PATH}" ]; then - err "Invalid shell ($_sh) for user $username." - return 1 - fi + if [ -z "$(fullpath_from_shell "$_sh")" ] ; then + err "Invalid shell ($_sh) for user $username." + return 1 fi - ! [ -x "$_sh" ] && + [ -x "$_sh" ] || info "The shell ($_sh) does not exist or is not executable." - return 0 } @@ -190,7 +173,7 @@ shell_exists() { save_config() { echo "# Configuration file for adduser(8)." > ${ADDUSERCONF} echo "# NOTE: only *some* variables are saved." >> ${ADDUSERCONF} - echo "# Last Modified on `${DATECMD}`." >> ${ADDUSERCONF} + echo "# Last Modified on $(${DATECMD})." >> ${ADDUSERCONF} echo '' >> ${ADDUSERCONF} echo "defaultHomePerm=$uhomeperm" >> ${ADDUSERCONF} echo "defaultLgroup=$ulogingroup" >> ${ADDUSERCONF} @@ -210,6 +193,8 @@ save_config() { # message or lock the account, do so. # add_user() { + local _uid _name _comment _gecos _home _group _grouplist _shell _class + local _dotdir _expire _pwexpire _passwd _upasswd _passwdmethod # Is this a configuration run? If so, don't modify user database. # @@ -218,22 +203,6 @@ add_user() { return fi - _uid= - _name= - _comment= - _gecos= - _home= - _group= - _grouplist= - _shell= - _class= - _dotdir= - _expire= - _pwexpire= - _passwd= - _upasswd= - _passwdmethod= - _name="-n '$username'" [ -n "$uuid" ] && _uid='-u "$uuid"' [ -n "$ulogingroup" ] && _group='-g "$ulogingroup"' @@ -244,7 +213,7 @@ add_user() { [ -n "$udotdir" ] && _dotdir='-k "$udotdir"' [ -n "$uexpire" ] && _expire='-e "$uexpire"' [ -n "$upwexpire" ] && _pwexpire='-p "$upwexpire"' - if [ -z "$Dflag" -a -n "$uhome" ]; then + if [ -z "$Dflag" ] && [ -n "$uhome" ]; then # The /nonexistent home directory is special. It # means the user has no home directory. if [ "$uhome" = "$NOHOME" ]; then @@ -257,7 +226,7 @@ add_user() { _home='-m -d "$uhome"' fi fi - elif [ -n "$Dflag" -a -n "$uhome" ]; then + elif [ -n "$Dflag" ] && [ -n "$uhome" ]; then _home='-d "$uhome"' fi case $passwdtype in @@ -292,8 +261,7 @@ add_user() { if [ -n "$BSDINSTALL_CHROOT" ]; then create_zfs_chrooted_dataset else - create_zfs_dataset - if [ "$?" -ne 0 ]; then + if ! create_zfs_dataset; then err "There was an error adding user ($username)." return 1 fi @@ -304,7 +272,7 @@ add_user() { _pwcmd="$_pwcmd $_shell $_class $_home $_dotdir $_passwdmethod $_passwd" _pwcmd="$_pwcmd $_expire $_pwexpire" - if ! _output=`eval $_pwcmd` ; then + if ! _output=$(eval $_pwcmd) ; then err "There was an error adding user ($username)." return 1 else @@ -331,30 +299,27 @@ add_user() { fi fi - _line= - _owner= - _perms= + local _line _owner _perms _file _dir if [ -n "$msgflag" ]; then - [ -r "$msgfile" ] && { + if [ -r "$msgfile" ]; then # We're evaluating the contents of an external file. # Let's not open ourselves up for attack. _perms will # be empty if it's writeable only by the owner. _owner # will *NOT* be empty if the file is owned by root. # - _dir="`dirname $msgfile`" - _file="`basename $msgfile`" - _perms=`/usr/bin/find $_dir -name $_file -perm +07022 -prune` - _owner=`/usr/bin/find $_dir -name $_file -user 0 -prune` - if [ -z "$_owner" -o -n "$_perms" ]; then + _dir="$(dirname "$msgfile")" + _file="$(basename "$msgfile")" + _perms=$(/usr/bin/find "$_dir" -name "$_file" -perm +07022 -prune) + _owner=$(/usr/bin/find "$_dir" -name "$_file" -user 0 -prune) + if [ -z "$_owner" ] || [ -n "$_perms" ]; then err "The message file ($msgfile) may be writeable only by root." return 1 fi - cat "$msgfile" | while read _line ; do eval echo "$_line" - done | ${MAILCMD} -s"Welcome" ${username} + done <"$msgfile" | ${MAILCMD} -s"Welcome" ${username} info "Sent welcome message to ($username)." - } + fi fi } @@ -366,7 +331,7 @@ add_user() { # a file it will output an error message and return to the caller. # get_user() { - _input= + local _input # No need to take down user names if this is a configuration saving run. [ -n "$configflag" ] && return @@ -376,7 +341,7 @@ get_user() { echo -n "Username: " read _input else - _input="`echo "$fileline" | cut -f1 -d:`" + _input="$(echo "$fileline" | cut -f1 -d:)" fi # There *must* be a username, and it must not exist. If @@ -387,8 +352,7 @@ get_user() { err "You must enter a username!" [ -z "$fflag" ] && continue fi - ${PWCMD} usershow $_input > /dev/null 2>&1 - if [ "$?" -eq 0 ]; then + if ${PWCMD} usershow "$_input" > /dev/null 2>&1; then err "User exists!" [ -z "$fflag" ] && continue fi @@ -402,7 +366,7 @@ get_user() { # and batch (from file) mode. # get_gecos() { - _input= + local _input # No need to take down additional user information for a configuration run. [ -n "$configflag" ] && return @@ -411,7 +375,7 @@ get_gecos() { echo -n "Full name: " read _input else - _input="`echo "$fileline" | cut -f7 -d:`" + _input="$(echo "$fileline" | cut -f7 -d:)" fi ugecos="$_input" } @@ -422,8 +386,7 @@ get_gecos() { # If an invalid shell is entered it will simply use the default shell. # get_shell() { - _input= - _fullpath= + local _input _fullpath ushell="$defaultshell" # Make sure the current value of the shell is a valid one @@ -435,16 +398,16 @@ get_shell() { fi if [ -z "$fflag" ]; then - echo -n "Shell ($shells) [`basename $ushell`]: " + echo -n "Shell ($shells) [${ushell##*/}]: " read _input else - _input="`echo "$fileline" | cut -f9 -d:`" + _input="$(echo "$fileline" | cut -f9 -d:)" fi if [ -n "$_input" ]; then if [ -n "$Sflag" ]; then ushell="$_input" else - _fullpath=`fullpath_from_shell $_input` + _fullpath=$(fullpath_from_shell "$_input") if [ -n "$_fullpath" ]; then ushell="$_fullpath" else @@ -466,7 +429,7 @@ get_homedir() { echo -n "Home directory [${homeprefix}/${username}]: " read _input else - _input="`echo "$fileline" | cut -f8 -d:`" + _input="$(echo "$fileline" | cut -f8 -d:)" fi if [ -n "$_input" ]; then @@ -475,7 +438,9 @@ get_homedir() { # directory prefix. Otherwise it is understood to # be $prefix/$user # - [ -z "$configflag" ] && homeprefix="`dirname $uhome`" || homeprefix="$uhome" + [ -z "$configflag" ] && + homeprefix="$(dirname "$uhome")" || + homeprefix="$uhome" else uhome="${homeprefix}/${username}" fi @@ -485,9 +450,8 @@ get_homedir() { # Reads the account's home directory permissions. # get_homeperm() { + local _input _prompt uhomeperm=$defaultHomePerm - _input= - _prompt= if [ -n "$uhomeperm" ]; then _prompt="Home directory permissions [${uhomeperm}]: " @@ -509,19 +473,20 @@ get_homeperm() { # so, enable ZFS home dataset creation. # get_zfs_home() { + local _prefix + # check if zfs kernel module is loaded before attempting to run zfs to # prevent loading the kernel module on systems that don't use ZFS if ! "$KLDSTATCMD" -q -m zfs; then Zcreate="no" return fi - zfs_homeprefix=`${ZFSCMD} list -Ho name "${homeprefix}" 2>/dev/null` - if [ "$?" -ne 0 ]; then - Zcreate="no" - elif [ -z "${zfs_homeprefix}" ]; then + if ! _prefix=$(${ZFSCMD} list -Ho name "${homeprefix}" 2>/dev/null) || + [ -z "${_prefix}" ]; then Zcreate="no" + return fi - zhome="${zfs_homeprefix}/${username}" + zhome="${_prefix}/${username}" } # get_uid @@ -529,12 +494,11 @@ get_zfs_home() { # allocates one if it is not specified. # get_uid() { + local _input _prompt uuid=${uidstart} - _input= - _prompt= if [ -n "$uuid" ]; then - uuid=`get_nextuid $uuid` + uuid=$(get_nextuid "$uuid") _prompt="Uid [$uuid]: " else _prompt="Uid (Leave empty for default): " @@ -543,11 +507,11 @@ get_uid() { echo -n "$_prompt" read _input else - _input="`echo "$fileline" | cut -f2 -d:`" + _input="$(echo "$fileline" | cut -f2 -d:)" fi [ -n "$_input" ] && uuid=$_input - uuid=`get_nextuid $uuid` + uuid=$(get_nextuid "$uuid") uidstart=$uuid } @@ -555,15 +519,15 @@ get_uid() { # Reads login class of account. Can be used in interactive or batch mode. # get_class() { + local _input _uclass uclass="$defaultclass" - _input= _class=${uclass:-"default"} if [ -z "$fflag" ]; then echo -n "Login class [$_class]: " read _input else - _input="`echo "$fileline" | cut -f4 -d:`" + _input="$(echo "$fileline" | cut -f4 -d:)" fi [ -n "$_input" ] && uclass="$_input" @@ -577,14 +541,14 @@ get_class() { # will then provide a login group with the same name as the username. # get_logingroup() { + local _input ulogingroup="$defaultLgroup" - _input= if [ -z "$fflag" ]; then echo -n "Login group [${ulogingroup:-$username}]: " read _input else - _input="`echo "$fileline" | cut -f3 -d:`" + _input="$(echo "$fileline" | cut -f3 -d:)" fi # Pw(8) will use the username as login group if it's left empty @@ -596,8 +560,8 @@ get_logingroup() { # and batch modes. # get_groups() { + local _input _group ugroups="$defaultgroups" - _input= _group=${ulogingroup:-"${username}"} if [ -z "$configflag" ]; then @@ -616,8 +580,8 @@ get_groups() { # routine is used only from batch processing mode. # get_expire_dates() { - upwexpire="`echo "$fileline" | cut -f5 -d:`" - uexpire="`echo "$fileline" | cut -f6 -d:`" + upwexpire="$(echo "$fileline" | cut -f5 -d:)" + uexpire="$(echo "$fileline" | cut -f6 -d:)" } # get_password @@ -632,10 +596,10 @@ get_password() { # We may temporarily change a password type. Make sure it's changed # back to whatever it was before we process the next account. # - [ -n "$savedpwtype" ] && { + if [ -n "$savedpwtype" ]; then passwdtype=$savedpwtype savedpwtype= - } + fi # There may be a ':' in the password upass=${fileline#*:*:*:*:*:*:*:*:*:} @@ -662,7 +626,7 @@ get_password() { # Ask user if they want to enable encryption on their ZFS home dataset. # get_zfs_encryption() { - _input= + local _input _prompt _prompt="Enable ZFS encryption? (yes/no) [${Zencrypt}]: " while : ; do echo -n "$_prompt" @@ -738,7 +702,7 @@ set_zfs_perms() { # adds it to the user database. # input_from_file() { - _field= + local _field while read -r fileline ; do case "$fileline" in @@ -769,16 +733,14 @@ input_from_file() { # the user database. # input_interactive() { - _disable= - _pass= - _passconfirm= - _random="no" - _emptypass="no" - _usepass="yes" - _logingroup_ok="no" - _groups_ok="no" - _all_ok="yes" - _another_user="no" + local _disable _pass _passconfirm _input + local _random="no" + local _emptypass="no" + local _usepass="yes" + local _logingroup_ok="no" + local _groups_ok="no" + local _all_ok="yes" + local _another_user="no" case $passwdtype in none) _emptypass="yes" @@ -801,7 +763,7 @@ input_interactive() { until [ "$_logingroup_ok" = yes ]; do get_logingroup _logingroup_ok=yes - if [ -n "$ulogingroup" -a "$username" != "$ulogingroup" ]; then + if [ -n "$ulogingroup" ] && [ "$username" != "$ulogingroup" ]; then if ! ${PWCMD} show group $ulogingroup > /dev/null 2>&1; then echo "Group $ulogingroup does not exist!" _logingroup_ok=no @@ -865,8 +827,7 @@ input_interactive() { stty echo # if user entered a blank password # explicitly ask again. - [ -z "$upass" -a -z "$_passconfirm" ] \ - && continue + [ -z "$upass$_passconfirm" ] && continue ;; [Yy][Ee][Ss]|[Yy][Ee]|[Yy]) passwdtype="none" @@ -934,8 +895,10 @@ input_interactive() { [ -n "$configflag" ] && printf "%-11s : %s\n" "Pass Type" "$passwdtype" [ -z "$configflag" ] && printf "%-11s : %s\n" "Full Name" "$ugecos" [ -z "$configflag" ] && printf "%-11s : %s\n" "Uid" "$uuid" - [ "$Zcreate" = "yes" -a -z "$configflag" ] && printf "%-11s : %s\n" "ZFS dataset" "${zhome}" - [ "$Zencrypt" = "yes" -a -z "$configflag" ] && printf "%-11s : %s\n" "Encrypted" "${Zencrypt}" + [ "$Zcreate" = "yes" ] && [ -z "$configflag" ] && + printf "%-11s : %s\n" "ZFS dataset" "${zhome}" + [ "$Zencrypt" = "yes" ] && [ -z "$configflag" ] && + printf "%-11s : %s\n" "Encrypted" "${Zencrypt}" printf "%-11s : %s\n" "Class" "$uclass" printf "%-11s : %s %s\n" "Groups" "${ulogingroup:-$username}" "$ugroups" printf "%-11s : %s\n" "Home" "$uhome" @@ -966,7 +929,7 @@ input_interactive() { #### END SUBROUTINE DEFINITION #### -THISCMD=`/usr/bin/basename $0` +THISCMD=${0##*/} DEFAULTSHELL=/bin/sh ADDUSERCONF="${ADDUSERCONF:-/etc/adduser.conf}" PWCMD="${PWCMD:-/usr/sbin/pw}" @@ -999,7 +962,7 @@ udotdir=/usr/share/skel ugroups= uexpire= upwexpire= -shells="`valid_shells`" +shells="$(valid_shells)" passwdtype="yes" msgfile=/etc/adduser.msg msgflag= @@ -1028,7 +991,7 @@ Zencrypt="no" # measure as much as it is a useful method of reminding the user to # 'su -' before he/she wastes time entering data that won't be saved. # -procowner=${procowner:-`/usr/bin/id -u`} +procowner=${procowner:-$(/usr/bin/id -u)} if [ "$procowner" != "0" ]; then err 'you must be the super-user (uid 0) to use this utility.' exit 1 @@ -1046,12 +1009,8 @@ for _i in $* ; do break; fi done -if [ -n "$readconfig" ]; then - # On a long-lived system, the first time this script is run it - # will barf upon reading the configuration file for its perl predecessor. - if ( . ${ADDUSERCONF} > /dev/null 2>&1 ); then - [ -r ${ADDUSERCONF} ] && . ${ADDUSERCONF} > /dev/null 2>&1 - fi +if [ -n "$readconfig" ] && [ -r "${ADDUSERCONF}" ]; then + . "${ADDUSERCONF}" fi # Process command-line options @@ -1136,7 +1095,7 @@ for _switch ; do shift ;; -s) - defaultshell="`fullpath_from_shell $2`" + defaultshell="$(fullpath_from_shell $2)" shift; shift ;; -S) @@ -1181,7 +1140,7 @@ else fi case $_input in [Yy][Ee][Ss]|[Yy][Ee]|[Yy]) - uidstart=`get_nextuid $uidstart` + uidstart=$(get_nextuid $uidstart) input_interactive continue ;; From nobody Mon Apr 29 10:43:42 2024 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 4VSg0t5XkDz5J2pv; Mon, 29 Apr 2024 10:43:42 +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 4VSg0t4yZKz4pMS; Mon, 29 Apr 2024 10:43:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714387422; 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=eCxLm+9e2UrwCIoOQf33E/L/T0rWsqo+sMo2tY21pBg=; b=RdGQDvzKTqDPDywuZitUAo1Czjl6U0SdO6JrTnXFBKp/G9z4Vq/a5ky4LiRYbpYABC1+AO oWCHIjwprlorLcJUxc2ftM4L1eRqv3/Ju0522u4la6ybTVYvX8HLVQgyi59dIsHwHKosUU 07s7wVNMqI7YOFad9h1VmrDfVDnjhzn+aV4zQyT2tHIevd0kqznFdzhAT1C45F/5s66cea 0dbYffT1r34W3jCdpHjzMt0dyqB/LBqtqxg35+iihzyVPaLuTx9l2Q6CbBaj4rYYcFt4yn D8iL5XNgHwwaAgt0d5IY657PBc9f3DXJ3YMql9g2QSWyTn6lUtEqYUpBV1mYmg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714387422; a=rsa-sha256; cv=none; b=W2AYv7IvOz5/QdmJe6JDDjUhwiEmk3BR5M+LszU/MSjKQO8MRMIwbWaTxmBIBCyYB7yegg bvXjaYUMdA/O5qlMOZUeobsRdGOxffAIqXoz+zpIhjx6M2x2EVm6xBO4kNTlYq4RdYvIeb 9fxLX0QKXvgmzL3XP8oLGjyTY4KK11YgPDiq3Mc+SvOqdUOoXpvvF6j7nfjlufFYNSMaeu MP3pB484+Ue5l3ppCy2o2fR1AlJR23/zatTAH/5/Gb0bRliwx0czUfqfdDo836wW5FIBQ8 kKH+eHSjv76JF4FP1QkZcQKczongpCEHz6FDHbsU2+7+S4MF7D5KmEDDBN0r9Q== 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=1714387422; 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=eCxLm+9e2UrwCIoOQf33E/L/T0rWsqo+sMo2tY21pBg=; b=c1VrIXKKCL5C3VNuoOrIV+Si9BJUvSBXbzkOqqAIZqt/y/8fnwROmfaW5Hj+b9klaeXRgX rUkClBF1MnBCL9A0NmwsJAQj6sNL7S7UQZ6Q43qwIOVyKPhc7a/tGsuR8y2XlxQ1zU+RcE hTiPxJuQBToaI/qUHzRrZT+GBB9A09hFCGumL+SiEy7OvlKJEhr2ir6fXD8EJeo2AaYIKA BOSjF2zioFwQLZzhIjUATldnlzN0LvJDSXAL45lEUUah5V/bxNX5EjzM7s/uwq/h/4id/u 3Kd2JKwQQkUr79ol+E0oZOfVBzyqvtq2dlR96NJgJN9ytOAKhe/KoCxwujrgKw== 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 4VSg0t4Yp6z15PN; Mon, 29 Apr 2024 10:43:42 +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 43TAhgiT088283; Mon, 29 Apr 2024 10:43:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43TAhgcd088280; Mon, 29 Apr 2024 10:43:42 GMT (envelope-from git) Date: Mon, 29 Apr 2024 10:43:42 GMT Message-Id: <202404291043.43TAhgcd088280@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: ac316062a747 - stable/14 - sound: Remove obsolete chn_setvolume() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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: ac316062a74777da86ffe30830d956639e0cc19a Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=ac316062a74777da86ffe30830d956639e0cc19a commit ac316062a74777da86ffe30830d956639e0cc19a Author: Christos Margiolis AuthorDate: 2024-04-18 20:35:11 +0000 Commit: Christos Margiolis CommitDate: 2024-04-29 10:43:30 +0000 sound: Remove obsolete chn_setvolume() It is marked as obsolete and there are no consumers of it anymore. Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: markj, emaste Differential Revision: https://reviews.freebsd.org/D44853 (cherry picked from commit 17969e696325273e250a1dc73f43de76c0836aae) --- sys/dev/sound/pcm/channel.c | 13 ------------- sys/dev/sound/pcm/channel.h | 1 - 2 files changed, 14 deletions(-) diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c index 4cb2b2a92b44..b4872fdb8037 100644 --- a/sys/dev/sound/pcm/channel.c +++ b/sys/dev/sound/pcm/channel.c @@ -1301,19 +1301,6 @@ chn_kill(struct pcm_channel *c) return (0); } -/* XXX Obsolete. Use *_matrix() variant instead. */ -int -chn_setvolume(struct pcm_channel *c, int left, int right) -{ - int ret; - - ret = chn_setvolume_matrix(c, SND_VOL_C_MASTER, SND_CHN_T_FL, left); - ret |= chn_setvolume_matrix(c, SND_VOL_C_MASTER, SND_CHN_T_FR, - right) << 8; - - return (ret); -} - int chn_setvolume_multi(struct pcm_channel *c, int vc, int left, int right, int center) diff --git a/sys/dev/sound/pcm/channel.h b/sys/dev/sound/pcm/channel.h index 4199dc282f06..21007454584e 100644 --- a/sys/dev/sound/pcm/channel.h +++ b/sys/dev/sound/pcm/channel.h @@ -265,7 +265,6 @@ int chn_poll(struct pcm_channel *c, int ev, struct thread *td); int chn_init(struct pcm_channel *c, void *devinfo, int dir, int direction); int chn_kill(struct pcm_channel *c); int chn_reset(struct pcm_channel *c, u_int32_t fmt, u_int32_t spd); -int chn_setvolume(struct pcm_channel *c, int left, int right); int chn_setvolume_multi(struct pcm_channel *c, int vc, int left, int right, int center); int chn_setvolume_matrix(struct pcm_channel *c, int vc, int vt, int val); From nobody Mon Apr 29 10:43:43 2024 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 4VSg0v72T4z5J3P0; Mon, 29 Apr 2024 10:43: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 4VSg0v63Dsz4pdR; Mon, 29 Apr 2024 10:43:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714387423; 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=NDhDE5VqB5MJXR5J7bR2W0BBAiuXf3Cerwlee2NFOak=; b=ELEzi74RhOKJV1IOQ2M0CtsqJEnYBVdcb7VRSn2RFoJ4izcloaPWf9yaViEZhZmlH6mCfv hg0QCmXByCHFQnBbLZAEUrJAZbHFlo2s0eUBbhGR8AswbQbjIOO+woIES/8viPhck07Vet PkEfdeTSz3Axa6XJRRjmagzGjXiwekW4c6jCXQhxU5yOFXTGsZQ8qM0GJv2noT8NlIbP9D UTpB8H4icnfnYMJVqu7zef6Ug7lswmd9pnrZt/PVKgrTyG3Ap+oUa2MABfxQ4s6nF5Zzgv xzSkdXJ+YP0XJGU0veEa17m8avsES6KVw4x5vufsi2rjQVjBnoPjas2246/2iw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714387423; a=rsa-sha256; cv=none; b=BvraLVHM9+Vk4q9MEmesVAE9O4kr6OC8Fnvah7IslqVAtlU1PeJU7/Qe2zXvc7pzDTCMR2 VjmMZzBdB2IC3G1cLXLFNSP64nMj8PqNYlt8Thhl9MlmaZwVYFG/IHAaLNAK/tBtwdHjh9 W6HCtwbetdl97WIicIy1PvB0gpBKzr4RGiFBMt1NyKYOpkhwSqjeIdWlnDqPubym423xv7 1BQHXHcH5G+3jDkfIhg50LwT+hDRyF7sTRLf7XHuYA72tDKEixxwdQYJDojcQIh1fruJtd uz7aagsLP52PuQNf7fa7vtGAp70w04M0Hf6domHeOIkVXIoPBSSAgpfaGA5kug== 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=1714387423; 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=NDhDE5VqB5MJXR5J7bR2W0BBAiuXf3Cerwlee2NFOak=; b=j6UhmIGtsyJQajyG/mCCesjZX0cyOoQAbxgdC+YaH2WAuU7NfsY3iEjt6Eczd5qiu+zkzC Dp7HcBLTonbfOgI2FwUB4pxYGvMtEQgvNgqmnQEBDy2EYjLkM1Jxz5nfREM4qilM9J+USu kYBuyvPk7CeZsqnzSm/lRi3hm2m/MNHQ6p1an6TYl0Ig4RMFHtxblSTqXTtpNyyzwkgrRp ZpvQ06v7jJVwq7GpKlFdmYPYtlWKA7+r5QsTxEUMJunKWufbApJyWyig1fOsdur2MkFlxJ Nxq/MP1eXwqvtMTSQ1nMp9mTVdQLT2uq3q00wVjhPfcMvuPnf1JdyiVAukVKcQ== 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 4VSg0v5cZmz15NB; Mon, 29 Apr 2024 10:43: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 43TAhhmZ088334; Mon, 29 Apr 2024 10:43:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43TAhhqn088331; Mon, 29 Apr 2024 10:43:43 GMT (envelope-from git) Date: Mon, 29 Apr 2024 10:43:43 GMT Message-Id: <202404291043.43TAhhqn088331@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: cc72812c49ba - stable/14 - sound: Fix NULL dereference in dsp_clone() and mixer_clone() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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: cc72812c49babc4b3a9bf904c91851e4921785fc Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=cc72812c49babc4b3a9bf904c91851e4921785fc commit cc72812c49babc4b3a9bf904c91851e4921785fc Author: Christos Margiolis AuthorDate: 2024-04-28 19:40:14 +0000 Commit: Christos Margiolis CommitDate: 2024-04-29 10:43:30 +0000 sound: Fix NULL dereference in dsp_clone() and mixer_clone() If we only have a single soundcard attached and we detach it right before entering [dsp|mixer]_clone(), there is a chance pcm_unregister() will have returned already, meaning it will have set snd_unit to -1, and thus devclass_get_softc() will return NULL here. While here, 1) move the calls to dsp_destroy_dev() and mixer_uninit() below the point where we unset SD_F_REGISTERED, and 2) follow what mixer_clone() does and make sure we don't use a NULL d->dsp_dev in dsp_clone(). Reported by: KASAN Sponsored by: The FreeBSD Foundation MFC after: 1 day Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D44924 (cherry picked from commit 074d6fbebc160222cde6b726adcc7350881d7824) --- sys/dev/sound/pcm/dsp.c | 14 ++++++++++---- sys/dev/sound/pcm/mixer.c | 3 ++- sys/dev/sound/pcm/sound.c | 7 +++---- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c index f685d7e38f6d..20625641a601 100644 --- a/sys/dev/sound/pcm/dsp.c +++ b/sys/dev/sound/pcm/dsp.c @@ -2086,10 +2086,16 @@ dsp_clone(void *arg, struct ucred *cred, char *name, int namelen, return; found: d = devclass_get_softc(pcm_devclass, snd_unit); - if (!PCM_REGISTERED(d)) - return; - *dev = d->dsp_dev; - dev_ref(*dev); + /* + * If we only have a single soundcard attached and we detach it right + * before entering dsp_clone(), there is a chance pcm_unregister() will + * have returned already, meaning it will have set snd_unit to -1, and + * thus devclass_get_softc() will return NULL here. + */ + if (d != NULL && PCM_REGISTERED(d) && d->dsp_dev != NULL) { + *dev = d->dsp_dev; + dev_ref(*dev); + } } static void diff --git a/sys/dev/sound/pcm/mixer.c b/sys/dev/sound/pcm/mixer.c index cc8cf5b1ceea..b84dfeba7043 100644 --- a/sys/dev/sound/pcm/mixer.c +++ b/sys/dev/sound/pcm/mixer.c @@ -1376,7 +1376,8 @@ mixer_clone(void *arg, return; if (strcmp(name, "mixer") == 0) { d = devclass_get_softc(pcm_devclass, snd_unit); - if (PCM_REGISTERED(d) && d->mixer_dev != NULL) { + /* See related comment in dsp_clone(). */ + if (d != NULL && PCM_REGISTERED(d) && d->mixer_dev != NULL) { *dev = d->mixer_dev; dev_ref(*dev); } diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c index 52ead91853e9..7de099cfe5ca 100644 --- a/sys/dev/sound/pcm/sound.c +++ b/sys/dev/sound/pcm/sound.c @@ -1018,10 +1018,6 @@ pcm_unregister(device_t dev) CHN_UNLOCK(ch); } - dsp_destroy_dev(dev); - - (void)mixer_uninit(dev); - /* remove /dev/sndstat entry first */ sndstat_unregister(dev); @@ -1039,6 +1035,9 @@ pcm_unregister(device_t dev) d->rec_sysctl_tree = NULL; } + dsp_destroy_dev(dev); + (void)mixer_uninit(dev); + while (!CHN_EMPTY(d, channels.pcm)) pcm_killchan(dev); From nobody Mon Apr 29 10:43:44 2024 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 4VSg0x1XvRz5J3DR; Mon, 29 Apr 2024 10:43:45 +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 4VSg0w6sZ4z4p9x; Mon, 29 Apr 2024 10:43:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714387425; 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=He3VsJLU8GMQk790kCgIPhAAjbzdLGzO3IeMwGcg+EU=; b=k70hMG6V/igCWdOOAV6lfsdIovlPrH7gCLoQIGFzilC1+UXtOS4jZMVsd4x4V/fPCzunSt TSvV5XQr6ja1wMsT1KEdlWjoC3rPz5Bb5ZClvNXETZfCG869SCW3HDf6LyWu1+h3ZRLTKu RXNyDVMOhw2jUJudWdigJVgkQrmqu2zdENVp4SeD7CCXgFxPOipEr+NGTLXPVupk4IgKBg qSk0BONzUSzGMGZHLtxBRx+ReVk8w2t2A2SsMW70eGTk0LXbaFw0432vKCZD4UcyCbUQse 8yDT6nhPHi0G3yYi0HmxZuxShd15B4/nPgVC9KpKEKxix6TSJDLvcEjqtntrgQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714387425; a=rsa-sha256; cv=none; b=rRqBBCD9cggquwAbHfLgFREfjBYlEgejrpxFonaDENdKZeT6bCPv8gTWwuVV05Gdw3NJLj pls1qlQUqXPXHuHgWCqgABKzpwns05vhSFB17vUdcdBuPORIS+x+X8v6ZSlGcPi1oNL/Fe 5NhYjbj+JKhuGmBA+eXxny4/cTjvOlEskRJP/UC8pKoMf6a7nINvGx7WiR3UsPRizbfAI6 AYW/2AsHC7tkBO6RWi5CzMZTq9jNO7r7uqiXz4vSqGk2uIGCQ809gtBq7sWDK3JX8YW94c uLnOhPKmUodFcz/oyk3gPG/wnvj69PM4vkukdn5hq6zb7CfZHK0M7PhqH9p0nQ== 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=1714387425; 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=He3VsJLU8GMQk790kCgIPhAAjbzdLGzO3IeMwGcg+EU=; b=VEwdfEZleSqGfjZHwwI58iGRyvOqCunu9tDsHHOa+iq4hnJQRAxya25DTP4Z44EJ6qrXWc 4R3n256ZNZ5xzPw2udLF1t868O8QBc0iJE4V9g9RMy+sZOpplYE+gj4z5BFQjF06eN6OVa o06dlNVsIcrFso1w1VvgEixKqj447/fCMqWTXSCNgxWqte/rMYZ+XNwjLRKVeYTu8P8ZT1 GHVqxjeODh/vowd3sJK322iCFogpshv4GmxfqRUfV69+IvNWje8hgf/cg51PJu1v2RhQy2 PMwGrkZwcV5CVyAf+oTZJ6rJqIlhM2BIXfCP46GqniG7lpmqLHT9uz8F2zzdSQ== 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 4VSg0w6SDJz159h; Mon, 29 Apr 2024 10:43: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 43TAhiS8088382; Mon, 29 Apr 2024 10:43:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43TAhiVl088379; Mon, 29 Apr 2024 10:43:44 GMT (envelope-from git) Date: Mon, 29 Apr 2024 10:43:44 GMT Message-Id: <202404291043.43TAhiVl088379@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: 9847c2497d2b - stable/14 - sound: Wrap dsp_clone() and mixer_clone() with bus_topo_lock() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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: 9847c2497d2b5b5b1e956c6f565bf994358f545b Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=9847c2497d2b5b5b1e956c6f565bf994358f545b commit 9847c2497d2b5b5b1e956c6f565bf994358f545b Author: Christos Margiolis AuthorDate: 2024-04-28 19:40:29 +0000 Commit: Christos Margiolis CommitDate: 2024-04-29 10:43:30 +0000 sound: Wrap dsp_clone() and mixer_clone() with bus_topo_lock() Make sure that the softc isn't freed in between the checks. Sponsored by: The FreeBSD Foundation MFC after; 1 day Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D44991 (cherry picked from commit b18b990d8e7b15d25243d85ea22374dfdde8a18b) --- sys/dev/sound/pcm/dsp.c | 2 ++ sys/dev/sound/pcm/mixer.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c index 20625641a601..aa6c21f36601 100644 --- a/sys/dev/sound/pcm/dsp.c +++ b/sys/dev/sound/pcm/dsp.c @@ -2085,6 +2085,7 @@ dsp_clone(void *arg, struct ucred *cred, char *name, int namelen, } return; found: + bus_topo_lock(); d = devclass_get_softc(pcm_devclass, snd_unit); /* * If we only have a single soundcard attached and we detach it right @@ -2096,6 +2097,7 @@ found: *dev = d->dsp_dev; dev_ref(*dev); } + bus_topo_unlock(); } static void diff --git a/sys/dev/sound/pcm/mixer.c b/sys/dev/sound/pcm/mixer.c index b84dfeba7043..0645089ac503 100644 --- a/sys/dev/sound/pcm/mixer.c +++ b/sys/dev/sound/pcm/mixer.c @@ -1375,12 +1375,14 @@ mixer_clone(void *arg, if (*dev != NULL) return; if (strcmp(name, "mixer") == 0) { + bus_topo_lock(); d = devclass_get_softc(pcm_devclass, snd_unit); /* See related comment in dsp_clone(). */ if (d != NULL && PCM_REGISTERED(d) && d->mixer_dev != NULL) { *dev = d->mixer_dev; dev_ref(*dev); } + bus_topo_unlock(); } } From nobody Mon Apr 29 10:43:45 2024 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 4VSg0y2xpNz5J3P7; Mon, 29 Apr 2024 10:43: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 4VSg0y0scYz4pQ5; Mon, 29 Apr 2024 10:43:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714387426; 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=8Y2QaOigreXUSI9HzxUW450qJU+6gQGe5OFH9oiGALc=; b=Boc9huRVApRzWqiE5p2hUUJ7j1yiCI5qu7Omf+deCRPQUNhHgW5MW9cKSy26BrwIJEVW+w ITZRpDP0DHRb7xRTnjrLZMdxq4Jl93b3pq4zvreDpigbe9o6tSqnhIeNL/LgVUZlJQ/k8c t6Me8XeJXvvNerSRWCTM979iqMBP4i1nvQA5AvciMxfPsuuQ8WqaOHwYnVd1LEm1MSWsgD i88pADHTkmlWvX/ldAIABUArv6EIH0QoAPnFNo6R7cgOOheiSb3WztsuNcVZctUb4qZFp0 s2dJd3kUDjD7+9crCqWzPa/xl8aPDvHOYkBr3BsF6pWsIvo1jmKpxsM6jngsWg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714387426; a=rsa-sha256; cv=none; b=wTMO9Qj2ye0D6CHQZv8nan0KhhbHxZyYkixUB9xKsP70Y6Tdy++XZDHYkFlsmyWFPTNpOZ QlrPVxj7kNKsBIWCDcQT8P+P8vDcieLAkcQy6iww9PrPrJoHVptGpMPP51FpD7hTjKUUSx HBqgVL/V+qr57AAeByhnAjmiP/jlEpVzmTtMptFq6fEI0IokDFD38E4j/c+M6nzmZB6bfj OBI5dOH5ztEjigjAueOIQueIYJZks/Styf1Z6bQLqdsO+71kSAf8KbdE/t7mpVodmfvmeT flmjDKqAJMsYCMFccr7AoDSGM8STogd8MetlZtCaxvyV8cOGquVnJL+PwOy18Q== 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=1714387426; 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=8Y2QaOigreXUSI9HzxUW450qJU+6gQGe5OFH9oiGALc=; b=WMvi34JyKsTplMQ7Vd/c/m4oxCqlsRJSYoaeP0aPxAGp9W8uGLNHgM8QwrFWigBpjNDhcn xcWcflTj47Zzxlf9gvB6qCDAUAldI7CP1+Z0nwEAfjJ7o7yyCSOnvo8nBJYddiqjJNShbI j+TlgLxt/jUILxguxzNOJ66x27Nurp5wVu6WPwBP8LpdC3hLIXpJW1OaBzoivxaXwCJVzW CHKbxXdElVqH/rTdM+Pa/PAWX52BVERVovKcCMDNRL2IQ/suizdjklpbsoh3PTDFNqQAnH qQrbOX1JjxYJ1Ym6wQ5iafiv3jUbtO9UV5SkGzj+VAZ85OU6r2IjWRJPWiwN3g== 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 4VSg0y0SZ8z159j; Mon, 29 Apr 2024 10:43: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 43TAhjxR088439; Mon, 29 Apr 2024 10:43:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43TAhjql088436; Mon, 29 Apr 2024 10:43:45 GMT (envelope-from git) Date: Mon, 29 Apr 2024 10:43:45 GMT Message-Id: <202404291043.43TAhjql088436@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: d8d7907826cc - stable/14 - sound: Fix panic caused by sleeping-channel destruction during asynchronous detach List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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: d8d7907826cc0799d29b9ee9c23688704f619e86 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=d8d7907826cc0799d29b9ee9c23688704f619e86 commit d8d7907826cc0799d29b9ee9c23688704f619e86 Author: Christos Margiolis AuthorDate: 2024-04-28 19:40:40 +0000 Commit: Christos Margiolis CommitDate: 2024-04-29 10:43:30 +0000 sound: Fix panic caused by sleeping-channel destruction during asynchronous detach Currently we are force-destroying all channels unconditionally in pcm_killchan(). However, since asynchronous audio device detach is possible as of 44e128fe9d92, if we do not check whether the channel is sleeping or not and forcefully kill it, we will get a panic from cv_timedwait_sig() (called from chn_sleep()), because it will try to use a freed lock/cv. Modify pcm_killchan() (renamed to pcm_killchans() since that's a more appropriate name now) to loop through the channel list and destroy only the channels that are awake, otherwise wake up the sleeping thread and try again. This loop is repeated until all channels are awakened and destroyed. To reduce code duplication, implement chn_shutdown() which wakes up the channel and sets CHN_F_DEAD, and use it in pcm_unregister() and pcm_killchans(). Reported by: KASAN Fixes: 44e128fe9d92 ("sound: Implement asynchronous device detach") Sponsored by: The FreeBSD Foundation MFC after: 1 day Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D44923 (cherry picked from commit 03614fcba25b9de99e69819bc4690f66a3d24438) --- sys/dev/sound/pcm/channel.c | 9 +++++++ sys/dev/sound/pcm/channel.h | 1 + sys/dev/sound/pcm/sound.c | 64 ++++++++++++++++++++++++++++++--------------- 3 files changed, 53 insertions(+), 21 deletions(-) diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c index b4872fdb8037..cf9239839aca 100644 --- a/sys/dev/sound/pcm/channel.c +++ b/sys/dev/sound/pcm/channel.c @@ -1301,6 +1301,15 @@ chn_kill(struct pcm_channel *c) return (0); } +void +chn_shutdown(struct pcm_channel *c) +{ + CHN_LOCKASSERT(c); + + chn_wakeup(c); + c->flags |= CHN_F_DEAD; +} + int chn_setvolume_multi(struct pcm_channel *c, int vc, int left, int right, int center) diff --git a/sys/dev/sound/pcm/channel.h b/sys/dev/sound/pcm/channel.h index 21007454584e..c8d33c583188 100644 --- a/sys/dev/sound/pcm/channel.h +++ b/sys/dev/sound/pcm/channel.h @@ -264,6 +264,7 @@ int chn_poll(struct pcm_channel *c, int ev, struct thread *td); int chn_init(struct pcm_channel *c, void *devinfo, int dir, int direction); int chn_kill(struct pcm_channel *c); +void chn_shutdown(struct pcm_channel *c); int chn_reset(struct pcm_channel *c, u_int32_t fmt, u_int32_t spd); int chn_setvolume_multi(struct pcm_channel *c, int vc, int left, int right, int center); diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c index 7de099cfe5ca..57cbf37005a7 100644 --- a/sys/dev/sound/pcm/sound.c +++ b/sys/dev/sound/pcm/sound.c @@ -678,23 +678,50 @@ pcm_addchan(device_t dev, int dir, kobj_class_t cls, void *devinfo) return (err); } -static int -pcm_killchan(device_t dev) +static void +pcm_killchans(struct snddev_info *d) { - struct snddev_info *d = device_get_softc(dev); struct pcm_channel *ch; int error; + bool found; PCM_BUSYASSERT(d); + do { + found = false; + CHN_FOREACH(ch, d, channels.pcm) { + CHN_LOCK(ch); + /* + * Make sure no channel has went to sleep in the + * meantime. + */ + chn_shutdown(ch); + /* + * We have to give a thread sleeping in chn_sleep() a + * chance to observe that the channel is dead. + */ + if ((ch->flags & CHN_F_SLEEPING) == 0) { + found = true; + CHN_UNLOCK(ch); + break; + } + CHN_UNLOCK(ch); + } - ch = CHN_FIRST(d, channels.pcm); + /* + * All channels are still sleeping. Sleep for a bit and try + * again to see if any of them is awake now. + */ + if (!found) { + pause_sbt("pcmkillchans", SBT_1MS * 5, 0, 0); + continue; + } - PCM_LOCK(d); - error = pcm_chn_remove(d, ch); - PCM_UNLOCK(d); - if (error) - return (error); - return (pcm_chn_destroy(ch)); + PCM_LOCK(d); + error = pcm_chn_remove(d, ch); + PCM_UNLOCK(d); + if (error == 0) + pcm_chn_destroy(ch); + } while (!CHN_EMPTY(d, channels.pcm)); } static int @@ -1005,15 +1032,11 @@ pcm_unregister(device_t dev) CHN_FOREACH(ch, d, channels.pcm) { CHN_LOCK(ch); - if (ch->flags & CHN_F_SLEEPING) { - /* - * We are detaching, so do not wait for the timeout in - * chn_read()/chn_write(). Wake up the thread and kill - * the channel immediately. - */ - CHN_BROADCAST(&ch->intr_cv); - ch->flags |= CHN_F_DEAD; - } + /* + * Do not wait for the timeout in chn_read()/chn_write(). Wake + * up the sleeping thread and kill the channel. + */ + chn_shutdown(ch); chn_abort(ch); CHN_UNLOCK(ch); } @@ -1038,8 +1061,7 @@ pcm_unregister(device_t dev) dsp_destroy_dev(dev); (void)mixer_uninit(dev); - while (!CHN_EMPTY(d, channels.pcm)) - pcm_killchan(dev); + pcm_killchans(d); PCM_LOCK(d); PCM_RELEASE(d); From nobody Mon Apr 29 10:43:47 2024 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 4VSg0z38Vvz5J3cp; Mon, 29 Apr 2024 10:43: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 4VSg0z1yz2z4pgf; Mon, 29 Apr 2024 10:43:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714387427; 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=HYrvza0nfT02JZS3tCJtgk5bqWx70bF09hPHs+m5x0Q=; b=N26OcE+NiiTe4hHiKKa/lOCxa7KxXwtnxPhyNuYGVh4KEMoKUSWKFa5+n1i0vLVskkM7Fv I1kNR/3IpIaIqoLGA7l8Xp7Ewnf6iFKbiqP9NmvGJ3USLi/aP7hER52agLXM5Jcpk9NJGT e3cCN1/xkQzQmLHmAHVXsrEuIPjG0DPkiQOH3vMzsF0cs+9tEmHuYcveO9KbUUQqKGrSY6 dnOyThJWgTktK850OYK/uqy1lApIi6WZi4TzWgxkh/e4ogMp/O1Afs58Q/Hs1ZdV+eC0iu T+iC4E+f3i5p4sgJEd3hScNiBHRgn70yckXZJdvzGgISmOCJLiO7t+s0nV/N+w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714387427; a=rsa-sha256; cv=none; b=BlRZoueAb8vk3X5b6gK4vaRXzsUk0bqbr+g67jjPCj7PfTRj5QneuG6HVisL5swAjElWxB 0h+1Tdnqk+hxruvY1KMp11d17K8OezIsnf8OYeXV41EuGxAlnk1rJ3xy+xUspHK+LBsoo/ plDEouhG9UGcE7EtFLyRfU9O+Xp9cVLnUlXy65pfuE2uop47WmITDMUVbdEKgVdkg0/Wy9 siIKxc9UTlq21hwfDhrpTxL7wm/fNK0XnGP9UTA7oLBDZFyf9wKbYh9O3VRpGwsuA4UJBD QmUkNN/iEwKiBhOJI/7ZbRptdGBJ8Awqz1ATgQri1/5v2SE2fIjCOxgM+Iu3yw== 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=1714387427; 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=HYrvza0nfT02JZS3tCJtgk5bqWx70bF09hPHs+m5x0Q=; b=CDVbrCm6joy1hVlUdo6P/FMJNwAuz/QeWs2g3Hg3+E80ZMpiF8oEDEjlXR4XOXAIyXgu0C grPD6UCUIPrqWutLEHtajyhe19yqIxX2KN20HQlGqhy6jGryk4OMuq8z94RYGdOoP+SsdW E3O51CCx8TYzSCtXQ0ZWAreKYMQbq/MSZsERLSOGtTz/oZsTTS8EDmPOY/mJT+e/2qdnr5 YLeokh1DX/IeljPzM9sPnfLjJ4xrIoPn8OeKFOt7X8SO5LFRMYcWWKyYm0gE4hBf8fAcOd VuXUqhPDL4dq6srHsVapKuHyB8CGMr/UrAOayzragRsNQilVYixYhrKjLrhW9Q== 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 4VSg0z1SqBz14XD; Mon, 29 Apr 2024 10:43: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 43TAhlNB088497; Mon, 29 Apr 2024 10:43:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43TAhlg3088494; Mon, 29 Apr 2024 10:43:47 GMT (envelope-from git) Date: Mon, 29 Apr 2024 10:43:47 GMT Message-Id: <202404291043.43TAhlg3088494@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: 33e0f0cd6ba8 - stable/14 - sound: Assert that we do not enter chn_sleep() with CHN_F_SLEEPING List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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: 33e0f0cd6ba8496f469d6616a0367d85025be523 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=33e0f0cd6ba8496f469d6616a0367d85025be523 commit 33e0f0cd6ba8496f469d6616a0367d85025be523 Author: Christos Margiolis AuthorDate: 2024-04-28 19:40:52 +0000 Commit: Christos Margiolis CommitDate: 2024-04-29 10:43:31 +0000 sound: Assert that we do not enter chn_sleep() with CHN_F_SLEEPING Sponsored by: The FreeBSD Foundation MFC after: 1 day Reviewed by: markj, emaste Differential Revision: https://reviews.freebsd.org/D44959 (cherry picked from commit fa284525499d75955525839074bf5968d0923e6b) --- sys/dev/sound/pcm/channel.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c index cf9239839aca..1527d5ea3d2c 100644 --- a/sys/dev/sound/pcm/channel.c +++ b/sys/dev/sound/pcm/channel.c @@ -332,6 +332,8 @@ chn_sleep(struct pcm_channel *c, int timeout) int ret; CHN_LOCKASSERT(c); + KASSERT((c->flags & CHN_F_SLEEPING) == 0, + ("%s(): entered with CHN_F_SLEEPING", __func__)); if (c->flags & CHN_F_DEAD) return (EINVAL); From nobody Mon Apr 29 10:43:48 2024 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 4VSg105Hv6z5J2qK; Mon, 29 Apr 2024 10:43: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 4VSg1030GNz4pgx; Mon, 29 Apr 2024 10:43:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714387428; 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=jgUL50lWfh4/1NGqlJAI3RsMrshqsUHEheNGy7BAFpU=; b=usQWd4gU9FU64gXlGeJfKYvIlnEHGdf4RSc5RzNYEltV720/N1AprszwdD2wOq4GaiSxHX obDQB35gT2ASR141Od50X+N2kKPf3CiTRayKiEarhvcqIDUqVx2aserBlzY+8I+uhXYJjY HPpzAKpvj9igiStRdf4ZHgJ2yOzb6q1X8uMsMu1aQKGugCtbQimwWXEYM9KM7YYaIYD/t6 r7Mw95sWneIUWks+ddqWV/ffKw4noyl6s5wZQw2rGUjr4idWYsDkXFJVNWp9eLkzy8+LvW 6IFgHHlebej6pn84qjnORLK9nmHjaVZ1aVVmyokITk4QEfr4hdzMCkJuhkXq+Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714387428; a=rsa-sha256; cv=none; b=iXJJXqM0/R9/p3ntNiZPXyS2Ack8aDh7ve753jhhPM5tbDOv+2eIq/k82/r7SJwtAYrARM L3k5xhMpeTHiazVJLNsGtAhcAZNkyFDrwpSmTdYcLDYqEvggemVlKPbGidCbHMLq8QiyTa OLIIwkT/Cqs/Xss9RuI72Kxo5uJde5YZj2m2mwTBT3L9NZ4LsF1GSQ0vGwtusxFU+nbet3 FBED6oztx7DACKeg1khXhRDqlLs7+XI33ScNlcMFRXYYycRkNLTKPdg3x1sK/+iQDsTbH9 u2nuCMnw1c3MULfvaukgiG8hksc2BP7s0ucgs3Gfdocs7DlNFobN+FtuhJTEQA== 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=1714387428; 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=jgUL50lWfh4/1NGqlJAI3RsMrshqsUHEheNGy7BAFpU=; b=l1rZ6Ga+zmT+USt3+RR9Ud5SC6G2KpGARQoUBNowlAy8p86m68INZHeHgn/6mQvBpdS86a ETKEw7Ai6DqmMULZxDqcuAn53arJQ4BXHzDeXkJN/foEwk5gBZHMBgFQ7VeazAhioyj4BG mMqUA+o6Mc4vzZXbKHBVSwZHDR3xEiuCTHBM4M7pBr5MGusmGlUP1e/3mK5A1MY42iyrs7 zqEtWUyXSpr//b6i0qQh1rKoJyuRADHZ1L5WLOM7IOY1f6ZlOdKcqtAsFzvc8Tpm5wZLRp L7vLldesquvJm8Wuhw+/h+f4YUX34v8xP78/fmwJ0KbUq0AxIvQJtH9dnBb1pQ== 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 4VSg102VzLz15NC; Mon, 29 Apr 2024 10:43: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 43TAhmGT088552; Mon, 29 Apr 2024 10:43:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43TAhmC0088549; Mon, 29 Apr 2024 10:43:48 GMT (envelope-from git) Date: Mon, 29 Apr 2024 10:43:48 GMT Message-Id: <202404291043.43TAhmC0088549@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: a2b09fc4b8b3 - stable/14 - sound: Add missing space in dev.pcm.X.mode description List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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: a2b09fc4b8b31387bf8901b1347ba0e9fc9daf06 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=a2b09fc4b8b31387bf8901b1347ba0e9fc9daf06 commit a2b09fc4b8b31387bf8901b1347ba0e9fc9daf06 Author: Christos Margiolis AuthorDate: 2024-04-28 19:47:11 +0000 Commit: Christos Margiolis CommitDate: 2024-04-29 10:43:31 +0000 sound: Add missing space in dev.pcm.X.mode description Sponsored by: The FreeBSD Foundation MFC after: 1 day Reviewed by: markj, emaste Differential Revision: https://reviews.freebsd.org/D44990 (cherry picked from commit e56c8996fc437488686e7cdef18258f16c5ea74e) --- sys/dev/sound/pcm/sound.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c index 57cbf37005a7..2057c7572ad6 100644 --- a/sys/dev/sound/pcm/sound.c +++ b/sys/dev/sound/pcm/sound.c @@ -923,8 +923,8 @@ pcm_sysinit(device_t dev) SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "mode", CTLFLAG_RD, NULL, mode, - "mode (1=mixer, 2=play, 4=rec. The values are OR'ed if more than one" - "mode is supported)"); + "mode (1=mixer, 2=play, 4=rec. The values are OR'ed if more than " + "one mode is supported)"); if (d->flags & SD_F_AUTOVCHAN) vchan_initsys(dev); if (d->flags & SD_F_EQ) From nobody Mon Apr 29 12:50:50 2024 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 4VSjqZ3Mzfz5JFv5; Mon, 29 Apr 2024 12:50: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 4VSjqZ2mb3z440f; Mon, 29 Apr 2024 12:50:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714395050; 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=bV0T2Xu19QU+U5XCeGOn1gVvPALBT47KDT2CmWqR048=; b=GlEQWvsimaQjf40x6Gm71p56YeppwNbXPBeSpRqFQ4tjHu/IMVHyfe/PlUQlk3Zz4R6uXs Umbgkbz/qPrjOqLifVvTCMS1IADJaG3wMlfeveHfRx7y6pgjFng7zWx4VKAb2R9tMkm2Dj hMzbx/876EtfxrziE28AO577xNC0S8hk5ulsZYk6lTzqJtRcxklCR6UayIXA/CYKt3rMcP M/Bi+dGRww5STZOA+0QuiAUEtNw61hZkJ9b0MLv3k9D9elDnLQDTDTASFIvfpz9n8m4ODd h29J6kmXMEN9le8e0/k9tfEtka9e/08ZOGh/v2oZ0SQWbmaMf2L2NnTvJspWtA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714395050; a=rsa-sha256; cv=none; b=Gb1+dgvsxCpchEDXg6JNmIh3+aSD7urDayRdno7+N4ZW4dfZ5luhYqSA1haLF43rZePMsW pFf+xW05uSeV3nOPO1MB0oToRwDM2Kai4ONvB8nDoAx9PdO+Ol+enfpAUKRE4dXAgwxjSn 0up00AgVupcfO5D1iPZj3X3BLP0A89eEuJdPEQyxWnTk53EJV/Eif2mmXL9ZVbmtTLLoF0 eVLUlnw96XDfBvBHHEEHHtqh3DEQcdWbLExXLAOpbUs/hqzxf+yRTfj6EwGcYk8rX+SsYp /5hYVg/2mM8Nqr5GEudNRWhMwH8TEgOp8Col7lQVo+segMt1x4Wps5BaaFjsvw== 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=1714395050; 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=bV0T2Xu19QU+U5XCeGOn1gVvPALBT47KDT2CmWqR048=; b=wOQQ9r/kCNYqFPF5JVkIXdZZB53HZ5NzHt6ZrXJHve9qa+2orGtgksjm+2EIdGYAEhQKpV PELPF8HNMCzZ63SxQD8us/flk84ap3RkeP4IW+XuoSgjHaMh96ulzlbutqWndGVTk938ml 80R6b9lk8ZJWH+rZsRueLJrRaSZdZ28sXIZ+Kioz9QGVoP6nzEedrTpNflAuHoHI9pg2xj +vO/NPNqpiVss3bco9c3wPb4sO4VpQmQAtHWF6v5VvHf2ZNQMix6xCUDJlbpuY1i0X5INq z50CwSrFmu3GquALKj1nfgW47uEjtPrzi+LQHghDFW4JAp0abFAZY3F4q4HMqA== 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 4VSjqZ2NkJz18XY; Mon, 29 Apr 2024 12:50: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 43TCoopB001131; Mon, 29 Apr 2024 12:50:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43TCoojR001128; Mon, 29 Apr 2024 12:50:50 GMT (envelope-from git) Date: Mon, 29 Apr 2024 12:50:50 GMT Message-Id: <202404291250.43TCoojR001128@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 8640bd657d84 - stable/14 - heimdal: Fix compiling hdb ldap as a 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8640bd657d841d1307520eca792e959acdf2063f Auto-Submitted: auto-generated The branch stable/14 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=8640bd657d841d1307520eca792e959acdf2063f commit 8640bd657d841d1307520eca792e959acdf2063f Author: Cy Schubert AuthorDate: 2014-01-10 19:18:06 +0000 Commit: Cy Schubert CommitDate: 2024-04-29 12:50:19 +0000 heimdal: Fix compiling hdb ldap as a module Fix build when WITH_OPENLDAP defined. PR: 278430 Obtained from: Upstream c1c7da7f79 (cherry picked from commit a0d7d68a2dd818ce84e37e1ff20c8849cda6d853) --- crypto/heimdal/lib/hdb/hdb-ldap.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/crypto/heimdal/lib/hdb/hdb-ldap.c b/crypto/heimdal/lib/hdb/hdb-ldap.c index 1b4024aa540a..d58ffe8e06e9 100644 --- a/crypto/heimdal/lib/hdb/hdb-ldap.c +++ b/crypto/heimdal/lib/hdb/hdb-ldap.c @@ -44,6 +44,9 @@ static krb5_error_code LDAP__connect(krb5_context context, HDB *); static krb5_error_code LDAP_close(krb5_context context, HDB *); +static krb5_error_code hdb_ldap_create(krb5_context context, HDB **, const char *); +static krb5_error_code hdb_ldapi_create(krb5_context context, HDB **, const char *); + static krb5_error_code LDAP_message2entry(krb5_context context, HDB * db, LDAPMessage * msg, int flags, hdb_entry_ex * ent); @@ -797,10 +800,10 @@ need_quote(unsigned char c) (c == 0x7f); } -const static char hexchar[] = "0123456789ABCDEF"; +static const char hexchar[] = "0123456789ABCDEF"; static krb5_error_code -escape_value(krb5_context context, const unsigned char *unquoted, char **quoted) +escape_value(krb5_context context, const char *unquoted, char **quoted) { size_t i, len; @@ -816,7 +819,7 @@ escape_value(krb5_context context, const unsigned char *unquoted, char **quoted) } for (i = 0; unquoted[0] ; unquoted++) { - if (need_quote((unsigned char *)unquoted[0])) { + if (need_quote((unsigned char)unquoted[0])) { (*quoted)[i++] = '\\'; (*quoted)[i++] = hexchar[(unquoted[0] >> 4) & 0xf]; (*quoted)[i++] = hexchar[(unquoted[0] ) & 0xf]; From nobody Mon Apr 29 12:50:51 2024 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 4VSjqb6jBTz5JG4q; Mon, 29 Apr 2024 12:50: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 4VSjqb3xLBz442l; Mon, 29 Apr 2024 12:50:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714395051; 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=I8j0XAk4bPlkyik3o/ThOXzmadWFVEVqCPYbDoneWik=; b=nSpJ7WOrHMw/IxyW7fflL5vfnrjIcMtVWIPnIYUa2eqMM0H8URi1rIhszXawzGtWURdgmV Cya2jN3kAU35wstPygOE2E7lSwbqIEmzYj4jkZrtlkvPM6JisTWUzirztW+4MSk0UTBWuk JtB75FVxsh+tT/Nv9zybtiUdSeM+6+Au3Y/tScALdeul0Zoloat0J3oP74U4RA8ntjDcBw p3Tf+Uze+UNDdOrBUH5Gwq1DZYeKnBmN6gE3PJGQddG485duIIApsKkT0tYfEWJ3vlXmBl /pEjQSc9ak0rV+bs8v0Up6b9VehWKm6T8eqvQNCoapu/AqDBFp45kXSalVcjbQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714395051; a=rsa-sha256; cv=none; b=FnQ13YWQkBiQJEUNzQO/L/MWbXTpJ45L2BCKWOGn/hfSjerLjWsWaFR1fY9Lr34BqTY2sO Yjq7vb5Uvh2qr1tsdRv/FxZGEtCitlOZq/aM10+KDPaZ8Fg61Z9N7Iu+ew1WKj4hS2Dr1p pPQkq7W8CKZvHis67dVCYWu71DxlWa3qw+yWtrE7+kz8RkB8/ILVvR2TpSXFi71Q1MaujY 52f040AyBc7KfSBZ4x27Q1r1am7JESMvJsZ/csM1Q0ftf0qNL/GqOwzgiG3kaqK4gGmNvV 0WNjV+Cq3RD4vyhFLWQI82EdwT/cwnpOHTkXSo8vlY+afhUVhu+2+5pAwucnSg== 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=1714395051; 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=I8j0XAk4bPlkyik3o/ThOXzmadWFVEVqCPYbDoneWik=; b=Dd+aoLG2YZXXQV2KuLFWZUZSpjZ9Y6gfJVb/Yrcjf5KH1rOaidWVqBApgNVionbZf160a1 9imH5SYOk/yvb1sWOjnoyK01yb7TSjJnwPtwGjGFD2gEmEvdw2ARTnA2EL/3TJ0JddOpIX UPtksJb5f+eNHD5xvM8ipCFbHvCfawVbH6Ny4JF5ZAt/jAwrW2z/1c+xv7yPzqKYsFDDVp Ku3vSb75Z8RbxuilqtUTTfwCms0907csGtOQSobuZu27cKAGXO5EEVXqs3IEKUrKMW+RHF zOXKvNYV/7YnnAtQ5uAg4N1TmngGUkGINlB2cUPkAokH54Fl3TFWluy/SyUGoQ== 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 4VSjqb3XdBz18ht; Mon, 29 Apr 2024 12:50: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 43TCopiK001170; Mon, 29 Apr 2024 12:50:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43TCopWc001167; Mon, 29 Apr 2024 12:50:51 GMT (envelope-from git) Date: Mon, 29 Apr 2024 12:50:51 GMT Message-Id: <202404291250.43TCopWc001167@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: abc4b3088941 - stable/14 - kdc: Add restart option List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: abc4b3088941d772728c28146d466010f816ea66 Auto-Submitted: auto-generated The branch stable/14 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=abc4b3088941d772728c28146d466010f816ea66 commit abc4b3088941d772728c28146d466010f816ea66 Author: Cy Schubert AuthorDate: 2024-04-18 18:56:54 +0000 Commit: Cy Schubert CommitDate: 2024-04-29 12:50:19 +0000 kdc: Add restart option Add a new kdc_restart rc variable that manages kdc (or krb5kdc) under daemon(8). This automatically restarts the kdc should it fail, i.e. when it's configured to use LDAP as a backend and cannot connect to its LDAP directory. Set kdc_restart="YES" to auto restart kdc on abnormal termination. Set kdc_restart_delay="N" to the number of seconds to delay before restarting the kdc. The daemon(8) default seconds applies when not set. Reported by: Lexi Winter PR: 278395 Differential Revision: https://reviews.freebsd.org/D44898 (cherry picked from commit 9e248b7f645cdf05615a49cc15295df49b54d659) --- libexec/rc/rc.conf | 2 ++ libexec/rc/rc.d/kdc | 29 +++++++++++++++++++++++++++-- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/libexec/rc/rc.conf b/libexec/rc/rc.conf index f31efb4e2052..831ef202219c 100644 --- a/libexec/rc/rc.conf +++ b/libexec/rc/rc.conf @@ -329,6 +329,8 @@ resolv_enable="YES" # Enable resolv / resolvconf kdc_enable="NO" # Run a kerberos 5 KDC (or NO). kdc_program="/usr/libexec/kdc" # path to kerberos 5 KDC kdc_flags="" # Additional flags to the kerberos 5 KDC +kdc_restart="NO" # Auto restart kdc on abnormal termination +kdc_restart_delay="" # Auto restart delay seconds kadmind_enable="NO" # Run kadmind (or NO) kadmind_program="/usr/libexec/kadmind" # path to kadmind kpasswdd_enable="NO" # Run kpasswdd (or NO) diff --git a/libexec/rc/rc.d/kdc b/libexec/rc/rc.d/kdc index c3059f261e09..a2d9f87f8e20 100755 --- a/libexec/rc/rc.d/kdc +++ b/libexec/rc/rc.d/kdc @@ -12,15 +12,40 @@ name=kdc desc="Kerberos 5 server" rcvar=${name}_enable +: ${kdc_restart:="NO"} +: ${kdc_restart_delay:=""} set_rcvar_obsolete kerberos5_server_enable kdc_enable set_rcvar_obsolete kerberos5_server kdc_program set_rcvar_obsolete kerberos5_server_flags kdc_flags - load_rc_config $name if [ "${kdc_program}" = /usr/libexec/kdc -o \ "${kdc_program}" = /usr/local/libexec/kdc ]; then - command_args="$command_args --detach" + detach="--detach" + flavor=heimdal +else + flavor=mit + unset detach fi + +case ${kdc_restart} in +[Yy][Ee][Ss]) + if [ "$flavor" = mit ]; then + detach=-n + else + unset detach + fi + case ${kdc_restart_delay} in + "") unset daemon_restart_delay;; + *) daemon_restart_delay="-R ${kdc_restart_delay}";; + esac + command_args="-r ${daemon_restart_delay} ${kdc_program} ${detach} ${command_args}" + kdc_program=/usr/sbin/daemon + ;; +*) + command_args="${detach} ${command_args}" + ;; +esac + run_rc_command "$1" From nobody Mon Apr 29 12:51:19 2024 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 4VSjr736F1z5JGxl; Mon, 29 Apr 2024 12:51: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 4VSjr71pgGz44jZ; Mon, 29 Apr 2024 12:51:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714395079; 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=uoyjoajccg70oVcCHrhZrpbkRWqoWrjfAF3zsNWmNGg=; b=BROqzdrl5OZL13alN+Z8tlp/wUjuWQSQK7VXqsMvsznl9P1S3BHLUMQeEY3ZDep4kxU114 YtGFvs2WPHTH010QiswtCMJHi9+dA+RIWdHK+GakzklE+w36vO/nBinBJJbS6TiY19rZx2 VBRGBiaPTFBoF6VaVUa3H9PsCIEeG5YxAdtbYG0NqZb/oGWAyw/fvljHJvtfU101ettPQb ooDkPFwueDceQQtEr2XR6OVtkHfuYiw+R2HPRzeXsFBqlBzDxtiwc6SfYGDPKj32kZvKyX oftSpFQZn35AzmAEz2suHl3jAITfGY9h9NWH398H9Lm6O3bMpn55f6hWv8LaRA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714395079; a=rsa-sha256; cv=none; b=EqWLwdsuAO63scTRDPT7UgdCChjUhxwbBHZN6921X9Rt3FCJ+g/YddCdN26YecsNKInXMH mV/tYNnnCtpqjtkWLl5a0OCi+l1XRG3WXIvPcKTZ5G5pWB2Dp/4qV3MVcKzPqrzSkczKjw X55MzW73Aa+rSHImFdnuLMQLnQDzi77HrT3cSX9zq6izaSO9ecSz4Vm1pC/6lnLbqqGpFQ E8qZGiQyx6UR5y7DI9daOsLvQSMYIo9OdMh/rWM5rN/rZudIbCXcDXjTMddFmiRBl6YoIR AasPyZsnTKv+eTVk41taZeIcEpmUnrSCU+YRhYegtNynDXCO0vJWD3zhxGcYRw== 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=1714395079; 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=uoyjoajccg70oVcCHrhZrpbkRWqoWrjfAF3zsNWmNGg=; b=Eb+L7TT1+QVHCgotsh9qFwbdSaVnJfPPR8n84yJ/x1WDHlgUOn8nDPpNbw8EYDFdBv9erx tN59YpequTCZS04hXpk7lcJyKNSn5WA4oNsV+2mYs3A0LClCXQ1qpl0q/gQHjD+GSzWIpz oERQsHyLeNqeA0PaRv/DmUGd9Y8m0LX8GFsO1o3ojsyaNYh/HQ5aYsSpyE9MksYxTL5nSO kIHq+bqZyfIgVmf/vqB9IAZ32/TSlVOoZa5Pe4ZRjlTybqy36l5/c8UodeP8AHVETfbK5Y qDZDEnR1Wcpb6reRj21lDUKA6qA0FB8hJLmRa1I+tfSmgxtfwTEvwUYEjnSIbA== 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 4VSjr71QHkz17y9; Mon, 29 Apr 2024 12:51: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 43TCpJZO001395; Mon, 29 Apr 2024 12:51:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43TCpJPD001392; Mon, 29 Apr 2024 12:51:19 GMT (envelope-from git) Date: Mon, 29 Apr 2024 12:51:19 GMT Message-Id: <202404291251.43TCpJPD001392@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: a161f2405f10 - stable/13 - heimdal: Fix compiling hdb ldap as a 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a161f2405f10a5b39e87b7e9fdd5c8405462d133 Auto-Submitted: auto-generated The branch stable/13 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=a161f2405f10a5b39e87b7e9fdd5c8405462d133 commit a161f2405f10a5b39e87b7e9fdd5c8405462d133 Author: Cy Schubert AuthorDate: 2014-01-10 19:18:06 +0000 Commit: Cy Schubert CommitDate: 2024-04-29 12:51:11 +0000 heimdal: Fix compiling hdb ldap as a module Fix build when WITH_OPENLDAP defined. PR: 278430 Obtained from: Upstream c1c7da7f79 (cherry picked from commit a0d7d68a2dd818ce84e37e1ff20c8849cda6d853) --- crypto/heimdal/lib/hdb/hdb-ldap.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/crypto/heimdal/lib/hdb/hdb-ldap.c b/crypto/heimdal/lib/hdb/hdb-ldap.c index 1b4024aa540a..d58ffe8e06e9 100644 --- a/crypto/heimdal/lib/hdb/hdb-ldap.c +++ b/crypto/heimdal/lib/hdb/hdb-ldap.c @@ -44,6 +44,9 @@ static krb5_error_code LDAP__connect(krb5_context context, HDB *); static krb5_error_code LDAP_close(krb5_context context, HDB *); +static krb5_error_code hdb_ldap_create(krb5_context context, HDB **, const char *); +static krb5_error_code hdb_ldapi_create(krb5_context context, HDB **, const char *); + static krb5_error_code LDAP_message2entry(krb5_context context, HDB * db, LDAPMessage * msg, int flags, hdb_entry_ex * ent); @@ -797,10 +800,10 @@ need_quote(unsigned char c) (c == 0x7f); } -const static char hexchar[] = "0123456789ABCDEF"; +static const char hexchar[] = "0123456789ABCDEF"; static krb5_error_code -escape_value(krb5_context context, const unsigned char *unquoted, char **quoted) +escape_value(krb5_context context, const char *unquoted, char **quoted) { size_t i, len; @@ -816,7 +819,7 @@ escape_value(krb5_context context, const unsigned char *unquoted, char **quoted) } for (i = 0; unquoted[0] ; unquoted++) { - if (need_quote((unsigned char *)unquoted[0])) { + if (need_quote((unsigned char)unquoted[0])) { (*quoted)[i++] = '\\'; (*quoted)[i++] = hexchar[(unquoted[0] >> 4) & 0xf]; (*quoted)[i++] = hexchar[(unquoted[0] ) & 0xf]; From nobody Mon Apr 29 12:51:20 2024 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 4VSjr84qRwz5JGs5; Mon, 29 Apr 2024 12:51: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 4VSjr82lP5z44jc; Mon, 29 Apr 2024 12:51:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714395080; 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=JpX19HP8i2rZRL4E4Gt6InV+AWP+edCHbO8Naug/Om4=; b=oKtG+nVuVEq1Z7K9cA/ulPHq4GkQ0XNiWyj8MdpU5ABe07Y9hDTWj64BCjb03z9G/7MhpW sR1b4Th+xQdHm1HSLhyXZA5sdtv0OyQnsDIS7HnyMDu8KS75uHsucfCSc0O4RcIRRlLRLL XTBVaEUVTrquVpgVVmEjymuSrZJ5AhokCO7Wa0Ep1Xs9VxtYBn60mJfsuEEEQkL4QBW414 T3ZhtMoYBmUIQ/q1yDmBv45je+yFaXG2im0XM5Ts+3DWTLE6Fkyev3HFMMq3RC1j4ObOQQ z4vMP+jwpBwW51mEV7SMEPgjNQKL6eKElga7e1sljttJApNHUpls9JmMi8DlFQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714395080; a=rsa-sha256; cv=none; b=AgnIFKwgELtcqNoyxHH6j6Dhh3mQCEEMALTZqjhS+O9nesLoU/CqWzvc34NccwG46fJAeb FIIPclpNokEai2W+eAJDvqZSK7QIzcM/ASIvqwDkkLuhoBo8n7RTcqJ97AjhhInOA3g5Yl kVHLQwat3XfQ6wtf2EvRJqBGl4q07mRXiYwwck7yq9o2yS+nnfeJh4m5iAXnRCFcV/P0Yi ebMVi35Np9Xeg8IYs8NahtX7ZqllimXAHK6ndXortiNn513OrKJmiNCpwQ2qXr7RP0wF/M N0DH5f9EH4YdYmhSdbkUb08Q7CmZ1YZW0FBH95k1+YuJEOZ4eNDmSwrXU2xyEQ== 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=1714395080; 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=JpX19HP8i2rZRL4E4Gt6InV+AWP+edCHbO8Naug/Om4=; b=kMdKkDZywtKEVQ/vXg0U1ztjiDNQptTfMCqDO0lZknMY1WKJVOxbGtGSDym3aP5I7pXy7t tdCJC5HyWdMncwxgJuf8FoiiS82rT4OU3Q0DOHkYV3+qNgb0QTLk7U0EwHpaBDS0vRDC0j r4UI/xjAirfxBoJGi4KqXfGIp41+OLjCDjVjnBb+ihm7JVzEFwy196mJ1G3Wjwvk7Kv/xm BIhXu+hf6wmk6+9lNkKmPn9ZtvmR6CjBj0Kr4k8lo7byoR98N/HvdLrcUE0T741QsNh7Sx PiOIABar7C9WRmkfYB1wO636PnqemCwuAz1e98qJjG7ZHMbGosHh2i0vPoIuow== 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 4VSjr8252Kz18S2; Mon, 29 Apr 2024 12:51: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 43TCpK2h001435; Mon, 29 Apr 2024 12:51:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43TCpKOp001432; Mon, 29 Apr 2024 12:51:20 GMT (envelope-from git) Date: Mon, 29 Apr 2024 12:51:20 GMT Message-Id: <202404291251.43TCpKOp001432@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: e750111ced03 - stable/13 - kdc: Add restart option List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e750111ced0370a90f585467a79a773d20f14360 Auto-Submitted: auto-generated The branch stable/13 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=e750111ced0370a90f585467a79a773d20f14360 commit e750111ced0370a90f585467a79a773d20f14360 Author: Cy Schubert AuthorDate: 2024-04-18 18:56:54 +0000 Commit: Cy Schubert CommitDate: 2024-04-29 12:51:11 +0000 kdc: Add restart option Add a new kdc_restart rc variable that manages kdc (or krb5kdc) under daemon(8). This automatically restarts the kdc should it fail, i.e. when it's configured to use LDAP as a backend and cannot connect to its LDAP directory. Set kdc_restart="YES" to auto restart kdc on abnormal termination. Set kdc_restart_delay="N" to the number of seconds to delay before restarting the kdc. The daemon(8) default seconds applies when not set. Reported by: Lexi Winter PR: 278395 Differential Revision: https://reviews.freebsd.org/D44898 (cherry picked from commit 9e248b7f645cdf05615a49cc15295df49b54d659) --- libexec/rc/rc.conf | 2 ++ libexec/rc/rc.d/kdc | 29 +++++++++++++++++++++++++++-- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/libexec/rc/rc.conf b/libexec/rc/rc.conf index 824751078833..16c44baaa68a 100644 --- a/libexec/rc/rc.conf +++ b/libexec/rc/rc.conf @@ -326,6 +326,8 @@ resolv_enable="YES" # Enable resolv / resolvconf kdc_enable="NO" # Run a kerberos 5 KDC (or NO). kdc_program="/usr/libexec/kdc" # path to kerberos 5 KDC kdc_flags="" # Additional flags to the kerberos 5 KDC +kdc_restart="NO" # Auto restart kdc on abnormal termination +kdc_restart_delay="" # Auto restart delay seconds kadmind_enable="NO" # Run kadmind (or NO) kadmind_program="/usr/libexec/kadmind" # path to kadmind kpasswdd_enable="NO" # Run kpasswdd (or NO) diff --git a/libexec/rc/rc.d/kdc b/libexec/rc/rc.d/kdc index c3059f261e09..a2d9f87f8e20 100755 --- a/libexec/rc/rc.d/kdc +++ b/libexec/rc/rc.d/kdc @@ -12,15 +12,40 @@ name=kdc desc="Kerberos 5 server" rcvar=${name}_enable +: ${kdc_restart:="NO"} +: ${kdc_restart_delay:=""} set_rcvar_obsolete kerberos5_server_enable kdc_enable set_rcvar_obsolete kerberos5_server kdc_program set_rcvar_obsolete kerberos5_server_flags kdc_flags - load_rc_config $name if [ "${kdc_program}" = /usr/libexec/kdc -o \ "${kdc_program}" = /usr/local/libexec/kdc ]; then - command_args="$command_args --detach" + detach="--detach" + flavor=heimdal +else + flavor=mit + unset detach fi + +case ${kdc_restart} in +[Yy][Ee][Ss]) + if [ "$flavor" = mit ]; then + detach=-n + else + unset detach + fi + case ${kdc_restart_delay} in + "") unset daemon_restart_delay;; + *) daemon_restart_delay="-R ${kdc_restart_delay}";; + esac + command_args="-r ${daemon_restart_delay} ${kdc_program} ${detach} ${command_args}" + kdc_program=/usr/sbin/daemon + ;; +*) + command_args="${detach} ${command_args}" + ;; +esac + run_rc_command "$1" From nobody Mon Apr 29 14:12:34 2024 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 4VSldv1B0gz5JQRC; Mon, 29 Apr 2024 14:12: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 4VSldv0jVTz4F77; Mon, 29 Apr 2024 14:12:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714399955; 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=wrFVlFzMOxKSZWW4bi/1m6afpGuXPGf4FrSib4ouJ4E=; b=O8Ghp0F4bBG3fswnYjt86K0CLa9pKeqmzbhh055L0vyAApkvgf/zsaffIAbgWbR63Pf7NP jTmJQ4GSsvDUK3Wh+cE/G7L18qI+qmZheSV6menesxW4Ag7InYeORg+JFe1GNzzkxc6i/L 7speLHKAWmSnpdAfTI6KzRli42upJimRsWlym0s3JOzjJycJHeT7gGRMEHslIlXfhifs6r WS8pyd8D4hwl3UybnTGOsdLFuqQn1HJBPRs4C37fIFqucol43KuU1k/Nd1l+shgSbH+0DN Uh/2GKhqnuJB7lBepUgwapot/w3/0tRJDieGkS4MVEzkckgrFbk5SnbhFW3bEA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714399955; a=rsa-sha256; cv=none; b=yWLKCSbAuKHA8+GmBowJ+C1tWA7GU4XdZfeRkbnc1GAddYs7XU3vwGdoaeWO3yrDvLH4jM pk11vK0vHTkc8pWDwnoPx1hYu7J1nc/pUkRGMj7rQMDNJsCAwLE7tEVlm4U6uNkERhOoS9 AFqq5LpUNfJXsQ568d6HsWCNNpl4y8vvBAT+ZQmqbF51Y1rAgmHsY04QRAeQTggBYhAjFi UVv9ghqaCetCqEShU0ByijQPkrVe1HDY3Q7uAL5p/HzAQgQpTEwOKPmiFZwL6xfeUr76qP Ea0vHKu7cAmpAjWuFTgihA7wD0B6WYRsLqI0cp3pRkZ2EKnP3Iem2tUSQrcKeg== 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=1714399955; 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=wrFVlFzMOxKSZWW4bi/1m6afpGuXPGf4FrSib4ouJ4E=; b=y4x7I7M+i75qt02WZdV45jQo8pc4ZF1fXz+4VugI7/YeU0DQNtK7k0kHKJBJgnCrxgqrfJ FEOVN9LftMAO+fD2iKDguHHyCQqHbWXH4JFB/ikbFlewBTFsXTTrEB6c7JYVjmgBGHhTgs cRNOGTrTNbCXa2KgUFmdEfftLe5640th0Xxd1XDZW1vxgdCbA+mXaEI7pNSOD10nsmaGXG 3NxcKdOgEi0k8U/t+QX+Ajfn7a/OsdN/oVztfulJtTnZ1mJE6DuUkrWIhEaYwvXNPDf4hr dYIALBwqxB2m85yhnNLsjkd5FyWu5jmOyIZC9k9zkYIpcOrrn/L3Tqpnkx/C5A== 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 4VSldv0JYxz1BtY; Mon, 29 Apr 2024 14:12: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 43TECYai045821; Mon, 29 Apr 2024 14:12:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43TECYgi045818; Mon, 29 Apr 2024 14:12:34 GMT (envelope-from git) Date: Mon, 29 Apr 2024 14:12:34 GMT Message-Id: <202404291412.43TECYgi045818@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: 59e7c575c544 - stable/14 - tests: move atf_python/sys/ into the tests package List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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: 59e7c575c5449044164b3814d9c898de3e910ad9 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=59e7c575c5449044164b3814d9c898de3e910ad9 commit 59e7c575c5449044164b3814d9c898de3e910ad9 Author: Lexi Winter AuthorDate: 2024-04-16 11:18:23 +0000 Commit: Mark Johnston CommitDate: 2024-04-29 14:11:07 +0000 tests: move atf_python/sys/ into the tests package Reviewed by: markj MFC after: 1 week Pull Request: https://github.com/freebsd/freebsd-src/pull/1174 (cherry picked from commit e1e636193db45630c7881246d25902e57c43d24e) --- tests/atf_python/sys/Makefile | 1 + tests/atf_python/sys/net/Makefile | 1 + tests/atf_python/sys/netlink/Makefile | 1 + tests/atf_python/sys/netpfil/Makefile | 1 + tests/atf_python/sys/netpfil/ipfw/Makefile | 1 + 5 files changed, 5 insertions(+) diff --git a/tests/atf_python/sys/Makefile b/tests/atf_python/sys/Makefile index 85f66a85088e..a5a1a532104d 100644 --- a/tests/atf_python/sys/Makefile +++ b/tests/atf_python/sys/Makefile @@ -2,6 +2,7 @@ .PATH: ${.CURDIR} +PACKAGE=tests FILES= __init__.py SUBDIR= net netlink netpfil diff --git a/tests/atf_python/sys/net/Makefile b/tests/atf_python/sys/net/Makefile index 05b1d8afe863..70d5b1a3284b 100644 --- a/tests/atf_python/sys/net/Makefile +++ b/tests/atf_python/sys/net/Makefile @@ -2,6 +2,7 @@ .PATH: ${.CURDIR} +PACKAGE=tests FILES= __init__.py rtsock.py tools.py vnet.py .include diff --git a/tests/atf_python/sys/netlink/Makefile b/tests/atf_python/sys/netlink/Makefile index 73ce5ac50261..6a40a93f3ae9 100644 --- a/tests/atf_python/sys/netlink/Makefile +++ b/tests/atf_python/sys/netlink/Makefile @@ -2,6 +2,7 @@ .PATH: ${.CURDIR} +PACKAGE=tests FILES= __init__.py attrs.py base_headers.py message.py netlink.py \ netlink_generic.py netlink_route.py utils.py diff --git a/tests/atf_python/sys/netpfil/Makefile b/tests/atf_python/sys/netpfil/Makefile index 417a16d85359..47e7a0d4d4f1 100644 --- a/tests/atf_python/sys/netpfil/Makefile +++ b/tests/atf_python/sys/netpfil/Makefile @@ -2,6 +2,7 @@ .PATH: ${.CURDIR} +PACKAGE=tests FILES= __init__.py SUBDIR= ipfw diff --git a/tests/atf_python/sys/netpfil/ipfw/Makefile b/tests/atf_python/sys/netpfil/ipfw/Makefile index a85dc7de9417..fde36de23c93 100644 --- a/tests/atf_python/sys/netpfil/ipfw/Makefile +++ b/tests/atf_python/sys/netpfil/ipfw/Makefile @@ -2,6 +2,7 @@ .PATH: ${.CURDIR} +PACKAGE=tests FILES= __init__.py insns.py insn_headers.py ioctl.py ioctl_headers.py \ ipfw.py utils.py From nobody Mon Apr 29 14:12:36 2024 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 4VSldw39wHz5JQLm; Mon, 29 Apr 2024 14:12: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 4VSldw1hxVz4DlQ; Mon, 29 Apr 2024 14:12:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714399956; 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=Gr6s5ohI/Qv67Cf7c52cVgbi4U1rHjKHCsoIZebSWM8=; b=JQe//tcGKjdyMM4qAl2JYXc+QRZmCe0vELeSCFKfoMtd41TLU7hOLEam+z5fMUq4w8ur4W uru2h5psFAOkF2NKfZRhJ/TIOGDDjXw63sLkpTIuUDDqUt5oWWhHStFsuFEC0mMdInd/tv xs30cZvl7+xhVvBoeRD3CUR2I+wjO0MwXtkxnJ1LroMQRW2rvcnOrZmjgvxHLGZL5jB0j5 7GR7ymusxeOMrz8arfp8+uIsyDloedfXTuau7tYa0OwZNtVEgnkXqcKC/yLQGK5st9NKyA PJgOfb7n2oDlZHfpJVmTbxRPtaXzoVGdZg2Gf4A/Ms2VWcgMWmHrFLGkSFSWYA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714399956; a=rsa-sha256; cv=none; b=KKYXnC5rQIdJB5mlahoBAA9HlQbv8YzqDDzIDi4SIwYtSki2XfwEUMda0x5KvJUYp/1l1B AqMa/+HSngb4veSNqcoBKkIf4yFjseZ9DDoWhvw3SpW+Kz7IibHvaxK9W8cRXa+ShqvRvu 4qVINIHXEp3wZaXPVLqK//KduJ01m+2TofTtOggl6Z7VrFYM+7yL0V6sLb4EwhPqHzwcOe xh4x/iO0lefstdddDI3WmWyd5FslD17r5WNEfZX3HsLpKxOW5o+j1Kzc9K39lXWMMqHEFY HQKL2yuFNuz1bVSOxrVZwNr3TLEsMqaVXqNyAPbUgOUKUgEMAXsAN7s1OZxiIg== 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=1714399956; 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=Gr6s5ohI/Qv67Cf7c52cVgbi4U1rHjKHCsoIZebSWM8=; b=ESPnL9ZH6NLAfEpamEgDwFCbU58SFrF79Mh1gwgF/exuOjqOoajl13Ic0bWx28h2ZylMyr NroNa8DLcXjPOoaBuL4SeF5Hx5tLl0uewICYTsSDhUiczAVrduUOmABcIKoR0g2Ys4/Upj DhPEbWcdRbs9rk1YFAYa0eFcpQU9p2KM8bNe94CZlWN7DFTQk73lRz+gJl9rHMHRSTLoJ8 KVrKGK+ZqYbROgUrfOo4K9/uxjvbLDELuKIhnMCvf+H3gz0X+gttcyd41FtzQ3gzVVQSlw DNxde6Yyo4qaY09eWRPsAMnVYQYstGnJQBbbLGSp7f6Y+OHk1ylFrRYCzZLiuQ== 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 4VSldw1JT1z1Bfb; Mon, 29 Apr 2024 14:12: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 43TECa8a045869; Mon, 29 Apr 2024 14:12:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43TECaCS045866; Mon, 29 Apr 2024 14:12:36 GMT (envelope-from git) Date: Mon, 29 Apr 2024 14:12:36 GMT Message-Id: <202404291412.43TECaCS045866@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: 28fcfebdaf0f - stable/14 - ng_hci: Add sockaddr validation to sendto() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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: 28fcfebdaf0f43f2c006453c778494567fc0a6c4 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=28fcfebdaf0f43f2c006453c778494567fc0a6c4 commit 28fcfebdaf0f43f2c006453c778494567fc0a6c4 Author: Mark Johnston AuthorDate: 2024-04-22 15:48:00 +0000 Commit: Mark Johnston CommitDate: 2024-04-29 14:11:07 +0000 ng_hci: Add sockaddr validation to sendto() ng_btsocket_hci_raw_send() wasn't verifying that the destination address specified by sendto() is large enough to fill a struct sockaddr_hci. Thus, when copying the socket address into an mbuf, ng_btsocket_hci_raw_send() may read past the end of the input sockaddr while copying. In practice this is effectively harmless since ng_btsocket_hci_raw_output() only uses the address to identify a netgraph node. Reported by: Oliver Sieber MFC after: 1 week Sponsored by: The FreeBSD Foundation (cherry picked from commit 7f7b4926a779845116913c85ecbb10527daeab02) --- sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c b/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c index 935991696929..755e26f1f534 100644 --- a/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c +++ b/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c @@ -1608,6 +1608,17 @@ ng_btsocket_hci_raw_send(struct socket *so, int flags, struct mbuf *m, goto drop; } + if (sa != NULL) { + if (sa->sa_family != AF_BLUETOOTH) { + error = EAFNOSUPPORT; + goto drop; + } + if (sa->sa_len != sizeof(struct sockaddr_hci)) { + error = EINVAL; + goto drop; + } + } + mtx_lock(&pcb->pcb_mtx); error = ng_btsocket_hci_raw_filter(pcb, m, 0); From nobody Mon Apr 29 14:12:37 2024 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 4VSldx3mJZz5JQWg; Mon, 29 Apr 2024 14:12: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 4VSldx2kZXz4Dlc; Mon, 29 Apr 2024 14:12:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714399957; 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=mDNLRSho0V9xXUDrokjmxhEOKZvwqfrnmF/EJJWqZ/Y=; b=LcPR2iDRd1Ob48NSh8Qtq+d2e83TcuX5kTVnZpo14IxFcw4Tb/oo0W8v6N9EyCS53qXsAy WQtZzMoRY8WEM20ANJ91dnQVgIZQO3GzCRS5F1r5h0l10GTYm4axt3S7UyLcmBNiG+OYbM QJxXUU096HhdJPyAf8yxCxOn9kbSKeMu3Q7Q477ewreI3E/ShvHgFyM5JYYbKlo8K/fcb1 FYRoFG45KC72SPxIA9N2AJSalNcK47lw+RLlwmgSZ5uHoSgKoj3I0UXWgOicFG7CKjo1nA LhuKkuzKR2X2yM4z6vo6+SHhon99zxf44b5VbiiE0uZCSEFxKu2KmAZpufbJ+Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714399957; a=rsa-sha256; cv=none; b=IG5/7yZQLWvlluBOaQmzjRbT2QDZDnP6U2MgiYqjngaPR0Z369Nt8zBDleIfKS1gozdyke 84KwRCiJsL3tSbhh9WHlHQUVRSKm7xYqmad7XH1wVMc9xg1/b5YRx3SvfwpZGi/WIK7tmt CefwKmlOwHk/rV8z7JYi/5BLFE95iF+KZK/E1b7XJBY2W6uWM08EzAPcqMVJU9NcXrj5Cj znNrNbqEKKMQHMosqhwkVxxLhoKXIY6JjI2U4bn4QtR9V5YdIIUdqC8Y4BRLOSIao4XCwu GeUa1XtaVVaXwUlzt3xZfhsjq5mIsSBW2V7+HUWxzclj/y61aPGNTRo8799TUw== 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=1714399957; 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=mDNLRSho0V9xXUDrokjmxhEOKZvwqfrnmF/EJJWqZ/Y=; b=vJ9xw3jrRaYTP6xo/XND3U5cALJEEeclLPyjiz52a0R6070WdhNT+5VBDqB1SLW2ZKRS6W +T14HeozLW7pOn42/GLZz66Qyvd5zMOprz3TX9U73s9rpcWnTpYAc0FAWDfbLJQbDptiUe z9NWL8/hcaWelbAKouPvz2JfU25vneJwhhdqsJ9XdEY0h1AXZtP4W7RSCGZl8ZGf6NBppe X8EFneo771lfojPUMBc0xndEgbsOEDVzMVhad/hTasYp3wEi4k55FPyG83BqhpkMkr+5mz LTY6hOG70Ae7MUnp3zDhoMYcOXg4dOcX1y7hEEbqQdfBNFO44O5TX01ZgDzGQQ== 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 4VSldx2KRFz1BZ3; Mon, 29 Apr 2024 14:12: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 43TECbZX045911; Mon, 29 Apr 2024 14:12:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43TECb0h045908; Mon, 29 Apr 2024 14:12:37 GMT (envelope-from git) Date: Mon, 29 Apr 2024 14:12:37 GMT Message-Id: <202404291412.43TECb0h045908@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: 2f95e4a01e19 - stable/14 - if_bridge: clean up INET/INET6 handling List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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: 2f95e4a01e194428d65572ff3a3c97563120b38a Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=2f95e4a01e194428d65572ff3a3c97563120b38a commit 2f95e4a01e194428d65572ff3a3c97563120b38a Author: Lexi Winter AuthorDate: 2024-04-21 18:56:23 +0000 Commit: Mark Johnston CommitDate: 2024-04-29 14:11:07 +0000 if_bridge: clean up INET/INET6 handling The if_bridge contains several instances of: if (AF_INET code ... #ifdef INET6 AF_INET6 code ... #endif ) { ... Clean this up by adding a couple of macros at the top of the file that are conditionally defined based on whether INET and/or INET6 are enabled, which makes the code more readable and easier to maintain. No functional change intended. Reviewed by: zlei, markj MFC after: 1 week Pull Request: https://github.com/freebsd/freebsd-src/pull/1191 (cherry picked from commit ef84dd8f4926304306d5989ca9afdbf760c6d813) --- sys/net/if_bridge.c | 65 +++++++++++++++++++++++++---------------------------- 1 file changed, 31 insertions(+), 34 deletions(-) diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c index 31758733adb1..1b4ac92b62a3 100644 --- a/sys/net/if_bridge.c +++ b/sys/net/if_bridge.c @@ -134,6 +134,31 @@ #include +/* + * At various points in the code we need to know if we're hooked into the INET + * and/or INET6 pfil. Define some macros to do that based on which IP versions + * are enabled in the kernel. This avoids littering the rest of the code with + * #ifnet INET6 to avoid referencing V_inet6_pfil_head. + */ +#ifdef INET6 +#define PFIL_HOOKED_IN_INET6 PFIL_HOOKED_IN(V_inet6_pfil_head) +#define PFIL_HOOKED_OUT_INET6 PFIL_HOOKED_OUT(V_inet6_pfil_head) +#else +#define PFIL_HOOKED_IN_INET6 false +#define PFIL_HOOKED_OUT_INET6 false +#endif + +#ifdef INET +#define PFIL_HOOKED_IN_INET PFIL_HOOKED_IN(V_inet_pfil_head) +#define PFIL_HOOKED_OUT_INET PFIL_HOOKED_OUT(V_inet_pfil_head) +#else +#define PFIL_HOOKED_IN_INET false +#define PFIL_HOOKED_OUT_INET false +#endif + +#define PFIL_HOOKED_IN_46 (PFIL_HOOKED_IN_INET6 || PFIL_HOOKED_IN_INET) +#define PFIL_HOOKED_OUT_46 (PFIL_HOOKED_OUT_INET6 || PFIL_HOOKED_OUT_INET) + /* * Size of the route hash table. Must be a power of two. */ @@ -2127,11 +2152,7 @@ bridge_dummynet(struct mbuf *m, struct ifnet *ifp) return; } - if (PFIL_HOOKED_OUT(V_inet_pfil_head) -#ifdef INET6 - || PFIL_HOOKED_OUT(V_inet6_pfil_head) -#endif - ) { + if (PFIL_HOOKED_OUT_46) { if (bridge_pfil(&m, sc->sc_ifp, ifp, PFIL_OUT) != 0) return; if (m == NULL) @@ -2429,11 +2450,7 @@ bridge_forward(struct bridge_softc *sc, struct bridge_iflist *sbif, ETHER_BPF_MTAP(ifp, m); /* run the packet filter */ - if (PFIL_HOOKED_IN(V_inet_pfil_head) -#ifdef INET6 - || PFIL_HOOKED_IN(V_inet6_pfil_head) -#endif - ) { + if (PFIL_HOOKED_IN_46) { if (bridge_pfil(&m, ifp, src_if, PFIL_IN) != 0) return; if (m == NULL) @@ -2465,11 +2482,7 @@ bridge_forward(struct bridge_softc *sc, struct bridge_iflist *sbif, dbif->bif_stp.bp_state == BSTP_IFSTATE_DISCARDING) goto drop; - if (PFIL_HOOKED_OUT(V_inet_pfil_head) -#ifdef INET6 - || PFIL_HOOKED_OUT(V_inet6_pfil_head) -#endif - ) { + if (PFIL_HOOKED_OUT_46) { if (bridge_pfil(&m, ifp, dst_if, PFIL_OUT) != 0) return; if (m == NULL) @@ -2626,12 +2639,6 @@ bridge_input(struct ifnet *ifp, struct mbuf *m) #define CARP_CHECK_WE_ARE_SRC(iface) false #endif -#ifdef INET6 -#define PFIL_HOOKED_INET6 PFIL_HOOKED_IN(V_inet6_pfil_head) -#else -#define PFIL_HOOKED_INET6 false -#endif - #ifdef DEV_NETMAP #define GRAB_FOR_NETMAP(ifp, m) do { \ if ((if_getcapenable(ifp) & IFCAP_NETMAP) != 0 && \ @@ -2670,8 +2677,7 @@ bridge_input(struct ifnet *ifp, struct mbuf *m) /* Hand the packet over to netmap if necessary. */ \ GRAB_FOR_NETMAP(bifp, m); \ /* Filter on the physical interface. */ \ - if (V_pfil_local_phys && (PFIL_HOOKED_IN(V_inet_pfil_head) || \ - PFIL_HOOKED_INET6)) { \ + if (V_pfil_local_phys && PFIL_HOOKED_IN_46) { \ if (bridge_pfil(&m, NULL, ifp, \ PFIL_IN) != 0 || m == NULL) { \ return (NULL); \ @@ -2710,7 +2716,6 @@ bridge_input(struct ifnet *ifp, struct mbuf *m) #undef CARP_CHECK_WE_ARE_DST #undef CARP_CHECK_WE_ARE_SRC -#undef PFIL_HOOKED_INET6 #undef GRAB_FOR_NETMAP #undef GRAB_OUR_PACKETS @@ -2765,11 +2770,7 @@ bridge_broadcast(struct bridge_softc *sc, struct ifnet *src_if, sbif = bridge_lookup_member_if(sc, src_if); /* Filter on the bridge interface before broadcasting */ - if (runfilt && (PFIL_HOOKED_OUT(V_inet_pfil_head) -#ifdef INET6 - || PFIL_HOOKED_OUT(V_inet6_pfil_head) -#endif - )) { + if (runfilt && PFIL_HOOKED_OUT_46) { if (bridge_pfil(&m, sc->sc_ifp, NULL, PFIL_OUT) != 0) return; if (m == NULL) @@ -2812,11 +2813,7 @@ bridge_broadcast(struct bridge_softc *sc, struct ifnet *src_if, * pointer so we do not redundantly filter on the bridge for * each interface we broadcast on. */ - if (runfilt && (PFIL_HOOKED_OUT(V_inet_pfil_head) -#ifdef INET6 - || PFIL_HOOKED_OUT(V_inet6_pfil_head) -#endif - )) { + if (runfilt && PFIL_HOOKED_OUT_46) { if (used == 0) { /* Keep the layer3 header aligned */ i = min(mc->m_pkthdr.len, max_protohdr); From nobody Mon Apr 29 14:13:14 2024 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 4VSlfg0nbZz5JQcm; Mon, 29 Apr 2024 14:13: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 4VSlff6xXNz4Fgg; Mon, 29 Apr 2024 14:13:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714399995; 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=5x+8VcbNGFyboG6qQonGbXfeLMuZoKOEzANG3cBwxNU=; b=EzJJlqIpT4dMA3RWh4gF+56MWzpn+QlWiSXucn4us8SZeYC1SvZnQVBySi/+LpzRkLy5l5 sV5u0tMOnIyWExw82NnojlRKEDcQ2syJXNHsRRq5mF57etuY+4Qc7zrbDD/kNaIAfJZwo+ H8oCmvX71PpIK4o0jhh+/cSpzim6avMBFIIRN325MOv3miTj0SRjI5Ot/265zLKt/c/utD Qs7kImakix5FGE+y4CVmMcahu0QNK9ELR4M7kjSaUEWDXGEoCVS1SlbfqaOOOKHRK523EU lS/IdztFzQLXUAcB/aMWSlDMi/yIvw3rBdsJEb63KQSm0i7fuVfMwZfqk/rS3g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714399995; a=rsa-sha256; cv=none; b=EtMlDwrJf2nyj8c5GhHWtr7ZWhzoHY/TIHorDVpKJQd2PXtnBSFiGiGua/o/M5eJAgncVI fEUWFPWTvKiUaT7JByGBfbTL23g9f0YPekFfiK+bc4/eWr1VrzmVsOM93ZCgsfofdUH9dg kthHs+6FmHYsBBA19UgWjBWADumDw4erubbCj4iWIJz4/h5TKT31C4NI8v/aotNax2tcT8 A+50oF76aWFeDYJyrCNWwKyeQTn+cT9Uh+I3fXXbi4xW80801pXVSf32uN5OTjOy8Jq/BP YDMEsyBa3LEhcOF7fFtUMPnWKGF8N6LBVaWdO0cBjLBMTadz6YnhBy4vdIvGog== 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=1714399995; 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=5x+8VcbNGFyboG6qQonGbXfeLMuZoKOEzANG3cBwxNU=; b=eQF1u8d6irYmlBOyqAoZIA/PlMhYrfPzcvCzZvXmDLDqqYEhvDUPledvpKapmmvju0Bi6A kRJ0uaNd9H96uBVk/aJbqViXkLXUUoEyBcvHnKvagiIwOV6SryywfEj5CEx0g2UfqZ/2if hKq90Ee/wjgFOT3urvMt1eShHP8QPGaRyyh0Xg/5fBIwDDFEDA4re5mVdqovBebQ3gYRMl Qvk2jrPI5bLyj3rA5iVBvs6LvEfFNixj/UwsJ46Z6vYZ8QMiqtUAjx+AntjyLOobMHuHuM jW2fI5PLxrCwAyolK616YnJEw01kz+Ae4Rtx9oosKiIGUb3U/2gQ3k3YxYvufQ== 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 4VSlff6Vr7z1Bj0; Mon, 29 Apr 2024 14:13: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 43TEDEC8046157; Mon, 29 Apr 2024 14:13:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43TEDEpN046154; Mon, 29 Apr 2024 14:13:14 GMT (envelope-from git) Date: Mon, 29 Apr 2024 14:13:14 GMT Message-Id: <202404291413.43TEDEpN046154@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: 6f028e91084b - stable/13 - ng_hci: Add sockaddr validation to sendto() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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: 6f028e91084bfedb9a5ca99c857a9c30a094beb5 Auto-Submitted: auto-generated The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=6f028e91084bfedb9a5ca99c857a9c30a094beb5 commit 6f028e91084bfedb9a5ca99c857a9c30a094beb5 Author: Mark Johnston AuthorDate: 2024-04-22 15:48:00 +0000 Commit: Mark Johnston CommitDate: 2024-04-29 14:05:34 +0000 ng_hci: Add sockaddr validation to sendto() ng_btsocket_hci_raw_send() wasn't verifying that the destination address specified by sendto() is large enough to fill a struct sockaddr_hci. Thus, when copying the socket address into an mbuf, ng_btsocket_hci_raw_send() may read past the end of the input sockaddr while copying. In practice this is effectively harmless since ng_btsocket_hci_raw_output() only uses the address to identify a netgraph node. Reported by: Oliver Sieber MFC after: 1 week Sponsored by: The FreeBSD Foundation (cherry picked from commit 7f7b4926a779845116913c85ecbb10527daeab02) --- sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c b/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c index d4a447f4254f..de25f5369ffa 100644 --- a/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c +++ b/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c @@ -1610,6 +1610,17 @@ ng_btsocket_hci_raw_send(struct socket *so, int flags, struct mbuf *m, goto drop; } + if (sa != NULL) { + if (sa->sa_family != AF_BLUETOOTH) { + error = EAFNOSUPPORT; + goto drop; + } + if (sa->sa_len != sizeof(struct sockaddr_hci)) { + error = EINVAL; + goto drop; + } + } + mtx_lock(&pcb->pcb_mtx); error = ng_btsocket_hci_raw_filter(pcb, m, 0); From nobody Tue Apr 30 00:48:54 2024 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 4VT1m70qLkz5Hjxb; Tue, 30 Apr 2024 00:48: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 4VT1m700DKz4KHK; Tue, 30 Apr 2024 00:48:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714438135; 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=HMsTaC5Idhppj847i5/GegySw4vKWqUwggw7O97OOMs=; b=fe6JJ2hap4M/U58/Nkh29lmrN7PX0F1bL/DIPufDHvqaIpyXaNy6YQJpoFiTbhGfL0sfpH TdbVNFGyUMrjVHTI1IKfb0VssAg/+IWIeEyuJ2xHZDywTS5ljya6tEKyu0NKKIKAWGlK3Q EuGU4apYVc+h6JtSh93iznng2VVoJzR+kXWnoLsHGchEaZAaVDwhHj2MuBH2bOAr5JPa0o h6idr/zBD/z52HfIWuSRhqa50sVdlXzUcMpT17JYInQinqYzxqFclhWsxEZspcJiMfFm4Y 9SmV6bhtMLsaxy214+5tj5zI3s7tYh0P97UNue42IL7VVbWd2n7+qceDTqOTig== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714438135; a=rsa-sha256; cv=none; b=DvYSZLMJEWVJauqwDL61uKbR+Y+DvB1LRnXsEm5SqgjXKPVd3CfXg4HEKgfTIWcRUWVstH tix8PiDuvFw2UP3bp+MFYn4rsSikauwu6Uzgy0Anza6V43nEAAoPFJuFsVGdPJ+dE56h2D DBafrd7l+Za7OHcGrHt//2I7Glv3EOPQoDa0tY6OYzW6mXY5QtlKlhu3+433ay679PrmxY 2g9NBTc0I7hH4K3KPMfN6sMIZE3Cqa5lV9dLcHP6DT7zOYRm5FZQrXjz+/IHoPpSEa2nn+ kstkl2qD25qXslcEVG6E/j5NFd4WPrUzhtZOUGOy4M1VTL1OaOtF9IGnm3P3Pw== 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=1714438135; 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=HMsTaC5Idhppj847i5/GegySw4vKWqUwggw7O97OOMs=; b=wqdOISAZ5Unv7kGNWcimBtDVF+m7dRbdmx2VMiCZ5kYQ3vSj4asaABMrM8cZ9Fb5MUJvMj 5nWddqlocza7hOkzxoihQl3d2z8mu1DLA85hQohi7K+RoFE7uH/tqUZu+JulaXQxiVG1kr XW5hFn3vfTExCqGw0MyBBoEUC7c4GF/Kzn9mtpsHNh03T2efLuGU4BjS2HtScbjZr33//V z5tTc2mOccEkyn++Z/i6HAddMpBF2DI2e8B77h+7xjtdYsgQwgF/TDHOqHXvf5hwrSI1vc EQrAQwQUVEZ6VJQH2U0eka16+c31JMcRr1T7QRBnEGTxGZBBtWVPNuwwOEnm8g== 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 4VT1m66jh2z1SJ0; Tue, 30 Apr 2024 00:48: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 43U0mske012656; Tue, 30 Apr 2024 00:48:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43U0mstP012653; Tue, 30 Apr 2024 00:48:54 GMT (envelope-from git) Date: Tue, 30 Apr 2024 00:48:54 GMT Message-Id: <202404300048.43U0mstP012653@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: 6bf819c91048 - stable/14 - kern_thread.c: remove unneeded include of sys/param.h List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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: 6bf819c910482a3376560d58a481b0e7f8f328f0 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=6bf819c910482a3376560d58a481b0e7f8f328f0 commit 6bf819c910482a3376560d58a481b0e7f8f328f0 Author: Konstantin Belousov AuthorDate: 2024-04-19 14:46:08 +0000 Commit: Konstantin Belousov CommitDate: 2024-04-30 00:48:09 +0000 kern_thread.c: remove unneeded include of sys/param.h (cherry picked from commit 53e0938b0b5619fa851e8550c2396bd8c440b7ae) --- sys/kern/kern_thread.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c index 1586d6c664fe..102ba609cae7 100644 --- a/sys/kern/kern_thread.c +++ b/sys/kern/kern_thread.c @@ -31,8 +31,6 @@ #include "opt_witness.h" #include "opt_hwpmc_hooks.h" -#include -#include #include #include #include From nobody Tue Apr 30 00:48:55 2024 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 4VT1m84DT1z5Hjxf; Tue, 30 Apr 2024 00:48: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 4VT1m82HFwz4KMy; Tue, 30 Apr 2024 00:48:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714438136; 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=UcFQ2emieWVe94Fpt9kaRm0XNMsG1V8Cz5RV8pOq8cQ=; b=ycI8hr4kj88KkF6SaGwDC05ZgnvB3jEcpcDmQw72Vnfbc044ie4ofqVeSprRNpbjrCW8EL cNcnf1lTSzcxFgXliO7kXe7fgSZBWO/BWCoCMFbeNi0gwa9MHCGdK3Z1zzwo8LjSxe9i5d CWRFVSBVgLONgL2Vkf/ueDr2wKVIfZGVfOYScUEbcyBUkFOFYXoFPvIyxuRiJ5u6NxsMEp YweK63o4RzCYLcdFjHTvJuqRgLs9eBAxY5DGATvXmjUzsbnEipYMMQkh/DlfyOXwVB5Z2O PQxyOA5u6kw69wYbXpJiAvHuPaCzO3aq2X4yubHxiztVRPPxFWD8iz5mTZ/guA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714438136; a=rsa-sha256; cv=none; b=R1GB465F6bGRSeeC4DLZOrqupoxMKJp1SWEcRHy/qNcL94G4EYqR8+fbTBiI8Fs7bUYEls OoktBGkUqpYY0y4IBZ6h9NqBxMxKE3nxqCWfgLGvWv/9bCN936/go9odjcq9QsLHua0Jzn cc9QbOnBTcSTqXvNWc/6FRqocjIsah07RcPWWvpun4RdnCaoKemHWAbqYCcVawfUWPkssV 5IGQck5KAr6Cyd7eIfYdhALP8IWaoURgMqQsDGJGvXaLqoQKvMdFk3vAevCwQl3dKeOu3f QAMvWJVTprz9HkoV3cE1XgsDtnSxDm4aB2iwlJyru4Drvp0EiJ95H17pUkB86A== 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=1714438136; 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=UcFQ2emieWVe94Fpt9kaRm0XNMsG1V8Cz5RV8pOq8cQ=; b=Lxok7N2tsW33ZRmXibtzavtBt0M+3Emdc+O2JJUIPNiUFDN/6/XP0Px8Uu4NCmfRQlj980 4srhsPWmhGw9uQOL3DQvu3Uy2aY8R1q9u8hX3UU7aWkmbbXQ/JomZyzgYQL2ORte2r5ZMZ gT75ZOoO7IY0JiWtS/+eOADJyafJAfFbzrJQ9KwnQVmrt8NP7/8pYjCfJklgCmMprT1BYx IMq3Mo+oy4YxQl7u9taXNg+umFpsycA/Bcf9hrgxEXo2Beq1t2e8hdsnLCxxNwPrfZoTnw UazTws3z0h1/0z8g7K3btFek1mnQmHNt1PPRDylZzIVB+6kseT2ZjgRqqqQmkg== 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 4VT1m80b3nz1SGd; Tue, 30 Apr 2024 00:48:56 +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 43U0mtn2012692; Tue, 30 Apr 2024 00:48:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43U0mtaY012689; Tue, 30 Apr 2024 00:48:55 GMT (envelope-from git) Date: Tue, 30 Apr 2024 00:48:55 GMT Message-Id: <202404300048.43U0mtaY012689@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: 29c4e3198456 - stable/14 - kern_thr.c/kern_sig.c: remove sys/cdefs.h List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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: 29c4e3198456adc6095ce594941b87ccf879e2d6 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=29c4e3198456adc6095ce594941b87ccf879e2d6 commit 29c4e3198456adc6095ce594941b87ccf879e2d6 Author: Konstantin Belousov AuthorDate: 2024-04-19 14:25:04 +0000 Commit: Konstantin Belousov CommitDate: 2024-04-30 00:48:09 +0000 kern_thr.c/kern_sig.c: remove sys/cdefs.h (cherry picked from commit 2effad53b4676dcfe4da892cd72a9a235a9539d1) --- sys/kern/kern_sig.c | 1 - sys/kern/kern_thr.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index d35c35a534f9..54e39d2cd310 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -36,7 +36,6 @@ * @(#)kern_sig.c 8.7 (Berkeley) 4/18/94 */ -#include #include "opt_capsicum.h" #include "opt_ktrace.h" diff --git a/sys/kern/kern_thr.c b/sys/kern/kern_thr.c index e2f1b6baca4b..5df5620842fd 100644 --- a/sys/kern/kern_thr.c +++ b/sys/kern/kern_thr.c @@ -26,9 +26,9 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include #include "opt_posix.h" #include "opt_hwpmc_hooks.h" + #include #include #include From nobody Tue Apr 30 00:48:57 2024 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 4VT1m92kYcz5Hk38; Tue, 30 Apr 2024 00:48: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 4VT1m91z71z4Kdw; Tue, 30 Apr 2024 00:48:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714438137; 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=6Q5MmCR3lKaXH2gowaDcpME6byBV/GN7rkDbAscLb7o=; b=rvWZX+GW7mkjzSundbUBRTAozqYHCHE56oONeGuEhXcwwGE1GmVpIgcJ763KyBWfvtLztp 1yFoQH3Pv8r9eCrtuZTUsPZ0876asonTuU/CpW5jGAEnrDmYWyCCFfypTQxhXJGs2JTZGw 8yEMNUQZOlDPPgPALyZ5+LcEXcHiT0UgFiAgyIlLMGZZXC36TE3OzYT1XTBC6RQmcsKpw1 UIGLGV0kyZP/6neYhOxJhOEpRMwlOvpjqKK1cXxfPk5AsfksmvD0gm6tE8VxKqDaSseFkF f4QPiJjJu1aS/MeUSaWtnQrlLFhC29J2eX1DiRv5RupwP6jrVMqB6/WNO4Jj+A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714438137; a=rsa-sha256; cv=none; b=C7DcSKSxLBKd2v0oFs71NcvGKZIqPl4CoJncEscNZVS5JMqe0hrojMw19tfU9g8FiSrfy+ 2L7PJSfA9kl2l5l/DvS4CufD8zemfE9jqSROsqdK8Nnw/7ogzzJVfyafga/5pJtlqfd9Zt MQ1YikVPpQ6JwtQCda/00TZCBc20MyUx3k1/ueMMscpx9ia5sMw85BCHbb2OYkC+EzileU k2SiBfyri77VvZ8sfMuzqlZeFIUhrdXcFQI3k9xl2ROJox4qY5FHNcwB8uRw+TZVb49ScX CqjAILtjUagj/+vOAIrUZDRF9kTMWa0rnS1c31jQKZZGtUzA+MfJXE/gGqaIeA== 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=1714438137; 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=6Q5MmCR3lKaXH2gowaDcpME6byBV/GN7rkDbAscLb7o=; b=ru5NOu2dk9W3tlBTHPYDlqdhLPtD4zJ5leCzMO9Nvo2qa3sBV3KHX9ovinhatUp1JbgowA 7J3QxoWIaqUd+0J8ShlhGqyjH2MqnVzX4wd1kne5VuWQUr6wlxVTaDht8oflugiELniLc5 SablNkQLk6urV+T28wBCM76P8EAJ2d08jRDbOudCNY1g47Ki2Xe78i9gY30MB1A3yMjNuW wmFKhDB01QwVoqo9JmqpujL1ungIedv4X4mng3wLVhVX0LecSe2uBr+529wh3WczvdFrHW 6HCVCeb/gkpNaVvSrzmcmbRFV4k/BI2qmo7JyPfOJvLL7NRLqfB7ZYrqmRHwPQ== 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 4VT1m91ZY8z1SJ1; Tue, 30 Apr 2024 00:48: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 43U0mvbB012734; Tue, 30 Apr 2024 00:48:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43U0mvgD012731; Tue, 30 Apr 2024 00:48:57 GMT (envelope-from git) Date: Tue, 30 Apr 2024 00:48:57 GMT Message-Id: <202404300048.43U0mvgD012731@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: de4b8c8ae1a8 - stable/14 - kern_thr.c: normalize includes List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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: de4b8c8ae1a83d154971781835db44dffb05c874 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=de4b8c8ae1a83d154971781835db44dffb05c874 commit de4b8c8ae1a83d154971781835db44dffb05c874 Author: Konstantin Belousov AuthorDate: 2024-04-19 14:27:42 +0000 Commit: Konstantin Belousov CommitDate: 2024-04-30 00:48:09 +0000 kern_thr.c: normalize includes (cherry picked from commit 0c11c1792b139baffbf74e5f1c6fe065708301cc) --- sys/kern/kern_thr.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/sys/kern/kern_thr.c b/sys/kern/kern_thr.c index 5df5620842fd..0ab4cb5f7970 100644 --- a/sys/kern/kern_thr.c +++ b/sys/kern/kern_thr.c @@ -29,8 +29,9 @@ #include "opt_posix.h" #include "opt_hwpmc_hooks.h" -#include +#include #include +#include #include #include #include @@ -39,21 +40,19 @@ #include #include #include +#include #include #include #include #include #include #include -#include #include #include #include -#include #include -#include +#include #include -#include #ifdef HWPMC_HOOKS #include #endif From nobody Tue Apr 30 00:48:58 2024 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 4VT1mC2LSrz5Hk7q; Tue, 30 Apr 2024 00:48: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 4VT1mB3Gbyz4KfB; Tue, 30 Apr 2024 00:48:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714438138; 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=S1WFAbYaeR/f6U6kRKETiBYppOJFHEtcy4k+8hvdsAg=; b=Kf9N8gwLPmvL341/vfSomTFt0Q3FWvQ7ThASs/6ZPtRV+DJJOwLgqp6OCNouNj7qAhplK1 KBBt405L3MOigOPeCuYGbQAJgzA6ZJcoswLRJAHMd4RNQCQWClpKg5V/ws+V+EeOwH7vTl F+ED8vPQVKrZUor+Rg+46R1o7NrwxsDwgBEi4Bz+RwErc+Cq2TNQP0eVsrBsnecDKLlKXj TxsXZ+FhrXPw3nhIypMJAJxvhfQ4RLICR3ggZjihYc5HYDauLa/A/WC2TH3AjYiFBJp7ur YnIFwqenDtPMfNo1wh90j3lP4Vo3S+FrZxpcquPDY9zqvSZ7d9M7/iQnsS1CBw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714438138; a=rsa-sha256; cv=none; b=xBTJciNaFPGlPhMT9tTtKxftHDz18Yu9w7SsJLd9F7dJnacnIIldx16HPfCRjoa9rppHel sMTLjm4ItPG3vf0nKKkpgD/JVbkk0gnIy7PB8HN1sZWMEIqWXFLj36LPsTHz8wL+uOKn+b JnzlTZsbwnNBpX3QQ86ZLZCaVwISZOFTyLSN0I0y5wB01kBlwnYD5gk0Hv1KqtszFW9oOs 3GzGeRRpI0WmHNhxQ1BcOeRq63KzoG+OPmg2uwEt7rkBDwXY5N6dgPiRDbLSqmJEM875tZ 6CADjDZOunzdI/oPJvfZ50MKA/VLZQ4MyBk23O4eUH7VR/HWmNBxo3JTdHWklA== 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=1714438138; 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=S1WFAbYaeR/f6U6kRKETiBYppOJFHEtcy4k+8hvdsAg=; b=g3yayQY1a3HyKSZ2GljhSFHB0rN108sy0AZRztuzDzEF1I5UPRpZD00FmhBQvlSTddT3JN W3CupyK5PHBmHNu4UGnT8ti+xb2R43kX6tG6T9FmXEIsnruRg499opGqrHGN2T1jJJnzNk MG+K6nTMtc1bU+5p/BmjLNu0KQR3CgSYjwjZRWtTlq00yWNaC1Vq80cDMlXdOE9vHPKH6o h5EEnf00agLVSs/u61FWWj89IAEIiyDSRX3Tc8qhs9M4avexMB627mK11UXJRQN35+DMty 8zRNdhppnyd9GE378+L1OEwExI4YYpqKNTQ8+n/FWASSz4PsATTD1H8bJsj0Bw== 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 4VT1mB2Zr3z1SCF; Tue, 30 Apr 2024 00:48: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 43U0mwG6012777; Tue, 30 Apr 2024 00:48:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43U0mwUj012774; Tue, 30 Apr 2024 00:48:58 GMT (envelope-from git) Date: Tue, 30 Apr 2024 00:48:58 GMT Message-Id: <202404300048.43U0mwUj012774@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: ed9e2991c2da - stable/14 - sigqueue(2): add impl-specific flag __SIGQUEUE_TID List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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: ed9e2991c2da5924a1876383dbe9a51e1015b69e Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=ed9e2991c2da5924a1876383dbe9a51e1015b69e commit ed9e2991c2da5924a1876383dbe9a51e1015b69e Author: Konstantin Belousov AuthorDate: 2024-04-19 14:29:05 +0000 Commit: Konstantin Belousov CommitDate: 2024-04-30 00:48:09 +0000 sigqueue(2): add impl-specific flag __SIGQUEUE_TID (cherry picked from commit 53186bc1435e2c3ccf9c2124c066a08c6a80c504) --- sys/kern/kern_sig.c | 22 +++++++++++++++++----- sys/sys/signal.h | 4 ++++ 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index 54e39d2cd310..2f2ec7edfb12 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -2010,13 +2010,16 @@ sys_sigqueue(struct thread *td, struct sigqueue_args *uap) } int -kern_sigqueue(struct thread *td, pid_t pid, int signum, union sigval *value) +kern_sigqueue(struct thread *td, pid_t pid, int signumf, union sigval *value) { ksiginfo_t ksi; struct proc *p; + struct thread *td2; + u_int signum; int error; - if ((u_int)signum > _SIG_MAXSIG) + signum = signumf & ~__SIGQUEUE_TID; + if (signum > _SIG_MAXSIG) return (EINVAL); /* @@ -2026,8 +2029,17 @@ kern_sigqueue(struct thread *td, pid_t pid, int signum, union sigval *value) if (pid <= 0) return (EINVAL); - if ((p = pfind_any(pid)) == NULL) - return (ESRCH); + if ((signumf & __SIGQUEUE_TID) == 0) { + if ((p = pfind_any(pid)) == NULL) + return (ESRCH); + td2 = NULL; + } else { + p = td->td_proc; + td2 = tdfind((lwpid_t)pid, p->p_pid); + if (td2 == NULL) + return (ESRCH); + } + error = p_cansignal(td, p, signum); if (error == 0 && signum != 0) { ksiginfo_init(&ksi); @@ -2037,7 +2049,7 @@ kern_sigqueue(struct thread *td, pid_t pid, int signum, union sigval *value) ksi.ksi_pid = td->td_proc->p_pid; ksi.ksi_uid = td->td_ucred->cr_ruid; ksi.ksi_value = *value; - error = pksignal(p, ksi.ksi_signo, &ksi); + error = tdsendsignal(p, td2, ksi.ksi_signo, &ksi); } PROC_UNLOCK(p); return (error); diff --git a/sys/sys/signal.h b/sys/sys/signal.h index 4007c6968eae..2165a9655a10 100644 --- a/sys/sys/signal.h +++ b/sys/sys/signal.h @@ -499,6 +499,10 @@ struct sigstack { #if __BSD_VISIBLE #define BADSIG SIG_ERR + +/* sigqueue(2) signo high-bits flags */ +#define __SIGQUEUE_TID 0x80000000 /* queue for tid, instead of pid */ +#define __SIGQUEUE_RSRV 0x40000000 /* reserved */ #endif #if __POSIX_VISIBLE || __XSI_VISIBLE From nobody Tue Apr 30 00:48:59 2024 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 4VT1mC6Pq9z5HjvB; Tue, 30 Apr 2024 00:48: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 4VT1mC3g8wz4KSy; Tue, 30 Apr 2024 00:48:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714438139; 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=Fk3Qg/XVbbtXX2oep4m/GaaHRYN805nVPJT4ALbvTGI=; b=WruNMwHs2ycyUHErwUnn28qUjBWWlQUaq9qodv4TLKUWlGy9pTxRPGeITsMZaIlmMrjZfY K18hG1V9OmJnv6KWHHNFsxv420B7lb76ktPFniu+MfeqU+T1pP/+V3BKlKfNLtBunpFsJD e3s+lxqbcS4XE3du3kFDcZ47NU9bo5IYo4Thwy5cptKWREAv4lp0eSqbEkt4qeK4EYE6TJ eHFy5CGLUE8fIAbKaAZ6QNzLZvNwhMIt4O/kOYYebnfZc1qJewdVOAgSE4TM9aJkvT9lls KzAhsCwA1k7ZO/HiS/1GGED//hsbqLq4JZsjP0SFhqFCzinpDVlqUKeNk2hw5Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714438139; a=rsa-sha256; cv=none; b=v/5chMnKnmqtuSon/TPewG9mLmMmO7CalA87Yj+YccW5OC2ORu9SlWivcOdRCx1NGuGgy0 ggkGQ9d+fUz5VA07rVjVEn0wgfypzdNoYojbSGunde7+7JHvOgihhIQlOg/7n5MyB76/ie 5qS2iPZUM5IcdZ6OWw3L2IZZmNGPzOwQsARD/CYgkQ1BigruXgctMCyfcHHWQbTZngCp41 v8qkOyIolA0nz915cNY72Vn2D3LfMBIL37gDvhUhcJZMESsLhwKunof8LdwKGcdCMrZvnm 3+fEMeBtPe2N0hm/SZCLmPPCpoCymSmSGO/97i2l2cpkN2EKL0hx8rDtxSRChw== 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=1714438139; 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=Fk3Qg/XVbbtXX2oep4m/GaaHRYN805nVPJT4ALbvTGI=; b=FwBig2zwIRtXvA2tJ66k2dot4iZanwmC5GyfkCYWCwicjM2qv+kGeIHt12ETSTLRFOdH1D u0lR+HLsj8l4O/shD82hid45pY2vOy+B2+en8E2OZmdjivWLEQ/oxQJqeSJ+dIVVLIGYw0 +tYxaHy+K6gg9CiKceRtyKQlkIhVkTVYf+1+PeNkORVpTLjFWWI+2tFnrccD+OoiVZ02Rh M50W74Yx4CJAhrT0r+6usV+ZHPenEKYUXGzJprLs8KJslc3+vjnVHi/DtT4dSsnpnguLmJ izGhssGOVV9yHqTZAbrkw09GifJopud9cDG3Pos0o/6L4Ufjc0JM8xGgH2Lfuw== 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 4VT1mC3GDBz1SJ2; Tue, 30 Apr 2024 00:48: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 43U0mxCq012814; Tue, 30 Apr 2024 00:48:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43U0mxD8012811; Tue, 30 Apr 2024 00:48:59 GMT (envelope-from git) Date: Tue, 30 Apr 2024 00:48:59 GMT Message-Id: <202404300048.43U0mxD8012811@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: afc8b17816e4 - stable/14 - sigqueue(2): Document __SIGQUEUE_TID List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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: afc8b17816e49cd3d318c8760452d8f1e5b898a6 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=afc8b17816e49cd3d318c8760452d8f1e5b898a6 commit afc8b17816e49cd3d318c8760452d8f1e5b898a6 Author: Konstantin Belousov AuthorDate: 2024-04-20 21:58:15 +0000 Commit: Konstantin Belousov CommitDate: 2024-04-30 00:48:09 +0000 sigqueue(2): Document __SIGQUEUE_TID (cherry picked from commit dcc180c51b9c13df3d1158d14d450308711fe93c) --- lib/libc/sys/sigqueue.2 | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/lib/libc/sys/sigqueue.2 b/lib/libc/sys/sigqueue.2 index 5b154efa20fd..2fac63610ac7 100644 --- a/lib/libc/sys/sigqueue.2 +++ b/lib/libc/sys/sigqueue.2 @@ -25,7 +25,7 @@ .\" OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd May 5, 2017 +.Dd April 21, 2024 .Dt SIGQUEUE 2 .Os .Sh NAME @@ -96,6 +96,19 @@ be selected for delivery, it is the lowest numbered one. The selection order between realtime and non-realtime signals, or between multiple pending non-realtime signals, is unspecified. +.Pp +As a +.Fx +extension, the value of +.Fa signo +can be or-ed with the following flags: +.Bl -tag -width __SIGQUEUE_TID +.It Dv __SIGQUEUE_TID +The +.Fa pid +parameter is the thread identifier of a thread in the current process, +and the specified signal is queued into the specified thread' queue. +.El .Sh RETURN VALUES .Rv -std .Sh ERRORS @@ -122,6 +135,10 @@ to the receiving process. The process .Fa pid does not exist. +.It Bq Er ESRCH +The thread with id +.Fa pid +does not exist in the current process. .El .Sh SEE ALSO .Xr kill 2 , From nobody Tue Apr 30 00:49:00 2024 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 4VT1mD6Pw5z5Hjxr; Tue, 30 Apr 2024 00:49: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 4VT1mD4MRNz4KTB; Tue, 30 Apr 2024 00:49:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714438140; 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=kO2y0jgDhu7dSBrDizevy4AtTNkfVflJ6wo+3CWyRO4=; b=jmt4gMjHbsYR3O0N3CMMDGSO2KDlDiA1LldC0x769LMCIn+tzI/U7rKZuthU03nk24k2uK RKj6xw+2pvMBWXIHDA9Z6IQjXQLhPBQsUfNb1q3YaoISh40yR1i1LSiIHriYkyo7bmVaor jD+s+9c9ZA28i8fEfBNxu/9xTdALNN0tMrBOadXa6zTABcXMvkSNNS4iV0bBNnRVeh4ueC yPI6UIlevW6jXnJoNjpTQPxlJt/TfrGh6uq/YmrA0Q9QlzYQffi3NW2r6wBHA74A6orQ8N odrcGVJBvDR6ceCt2Q3swTnKYGsJYcMETjJUfAeR67AuDzx4P+cDDR7+zBqV6A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714438140; a=rsa-sha256; cv=none; b=hZMxd9BZKdAG5dGJp26qfF/LaClcm6xTYULtb0J+aWLcTnhudkNoCDE111wQ8sHhINPthA vwAexdCd89zcqxzsWW1aE5KrO6TQKZ5uqP6Y+CeJuiBHxvqf4ye6ucDE3GaM95jE7Z+VRh aLoS4qbCpgTFfiwWey/xzHnxkdgs4+CYNN6OofoZmAvZkzjpEqr1D/gWAvrLlJNpVHFfIa VKCOjf74fkfiNS19iC1Rd6KlqHrz3z+r4hQgl1vgf8wn4IInSoPkwahKrcbumc/oaBGvbA 9VeQe63w8mtc89FvUUBjUaM8V7bbNjE1nxXeakWVSwkQdvinMFhvF8VGSTEOKQ== 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=1714438140; 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=kO2y0jgDhu7dSBrDizevy4AtTNkfVflJ6wo+3CWyRO4=; b=pbu7NCA7qgg+1wGXwaR8vVBA5qFqkd1hB5mtTZ6BKG3SeBp28u5NOUXB3TIC3AqQucwCnJ rIhrXhVoCDjshYFUF69mqCxyS8VsK8EpUXAuf8kUjXk+m1/3uz1ULHhK3HN1DMHQSP92Pr 2hwuMahlTbqlt4N+dc7UHCloLa8munVG/7V9zVzh3wthYR+PqnE45GUv+ZzLSUSBi7+hGE h8y4kXw19J3yz4RawRIhL5jelteMc0BwFzVKKxKwiAdDdy8O2j0WW9WkfD9IITQ/MpRCzu 480bWJJNJaEqKU5UFdBRhkke3Q8sthmZKEGiORpdOHbLYix7NiVwrTP1XjoBbw== 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 4VT1mD3yDtz1SJ3; Tue, 30 Apr 2024 00:49: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 43U0n0Do012879; Tue, 30 Apr 2024 00:49:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43U0n0nm012876; Tue, 30 Apr 2024 00:49:00 GMT (envelope-from git) Date: Tue, 30 Apr 2024 00:49:00 GMT Message-Id: <202404300049.43U0n0nm012876@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: 3fbb97541cfe - stable/14 - sys/signal.h: move union sigval into dedicated private header sys/_sigval.h List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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: 3fbb97541cfe1833fb45ff69830948d08413f6c6 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=3fbb97541cfe1833fb45ff69830948d08413f6c6 commit 3fbb97541cfe1833fb45ff69830948d08413f6c6 Author: Konstantin Belousov AuthorDate: 2024-04-19 14:57:51 +0000 Commit: Konstantin Belousov CommitDate: 2024-04-30 00:48:09 +0000 sys/signal.h: move union sigval into dedicated private header sys/_sigval.h (cherry picked from commit 97acb35bd704ac1ef0bd2e286eb8bd09ce4b3ef0) --- sys/sys/_sigval.h | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ sys/sys/signal.h | 22 +------------------- 2 files changed, 62 insertions(+), 21 deletions(-) diff --git a/sys/sys/_sigval.h b/sys/sys/_sigval.h new file mode 100644 index 000000000000..b25a88b9bd71 --- /dev/null +++ b/sys/sys/_sigval.h @@ -0,0 +1,61 @@ +/*- + * SPDX-License-Identifier: BSD-3-Clause + * + * Copyright (c) 1982, 1986, 1989, 1991, 1993 + * The Regents of the University of California. All rights reserved. + * (c) UNIX System Laboratories, Inc. + * All or some portions of this file are derived from material licensed + * to the University of California by American Telephone and Telegraph + * Co. or Unix System Laboratories, Inc. and are reproduced herein with + * the permission of UNIX System Laboratories, 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. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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 __SYS__SIGVAL_H +#define __SYS__SIGVAL_H + +#if __POSIX_VISIBLE >= 199309 || __XSI_VISIBLE >= 500 +union sigval { + /* Members as suggested by Annex C of POSIX 1003.1b. */ + int sival_int; + void *sival_ptr; + /* 6.0 compatibility */ + int sigval_int; + void *sigval_ptr; +}; + +#if defined(_WANT_LWPINFO32) || (defined(_KERNEL) && defined(__LP64__)) +union sigval32 { + int sival_int; + __uint32_t sival_ptr; + /* 6.0 compatibility */ + int sigval_int; + __uint32_t sigval_ptr; +}; +#endif +#endif + +#endif /* __SYS__SIGVAL_H */ diff --git a/sys/sys/signal.h b/sys/sys/signal.h index 2165a9655a10..6a519db54893 100644 --- a/sys/sys/signal.h +++ b/sys/sys/signal.h @@ -42,6 +42,7 @@ #include #include #include +#include #include /* __MINSIGSTKSZ */ #include /* sig_atomic_t; trap codes; sigcontext */ @@ -166,27 +167,6 @@ typedef __sigset_t sigset_t; #endif #endif -#if __POSIX_VISIBLE >= 199309 || __XSI_VISIBLE >= 500 -union sigval { - /* Members as suggested by Annex C of POSIX 1003.1b. */ - int sival_int; - void *sival_ptr; - /* 6.0 compatibility */ - int sigval_int; - void *sigval_ptr; -}; - -#if defined(_WANT_LWPINFO32) || (defined(_KERNEL) && defined(__LP64__)) -union sigval32 { - int sival_int; - uint32_t sival_ptr; - /* 6.0 compatibility */ - int sigval_int; - uint32_t sigval_ptr; -}; -#endif -#endif - #if __POSIX_VISIBLE >= 199309 struct pthread_attr; From nobody Tue Apr 30 00:49:01 2024 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 4VT1mG0cnQz5HjvG; Tue, 30 Apr 2024 00:49: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 4VT1mF5kxZz4KlH; Tue, 30 Apr 2024 00:49:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714438141; 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=czofkP3NiaWq5jKXjgfajBQUOvE6pqi734e+RRxDEoo=; b=ZUg2rP0rQFEjHoa0xWimBvwFGCzm50ghQ0g/nlu87kinJJXCGh+Qx5hNp1mgIJF+P0FQ82 pJzGktZvtPfjnlBW3hDj5yBLKm2z3rniupgQh5QcQAjrNdZIQA2XhepCXxU6uTeztojWik 8sfl89dHCG6/9Y9sc+Kzs6eqV1kqOc2qKQCyyt+saTeOQJnzpTRzXmppxs3UPzzjxGTQ8B WWhGyXkAQdhz9SbGujzuJWFpiOfpeCAzjRWgOTAkNWBTQe+NOCEhNrlmxXhyzVrBTr+Lue jdYnvYUGJIAY+jLw+/StGIPWlJI3IYKhLi9iRehdBwVG/VijFH5un2ZBV5rtfw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714438141; a=rsa-sha256; cv=none; b=dqMigBRHxeZZjO+YomMn5rejFfsQy+wUbl95TtzYCWMzGp1YKmLgBGoQdTFMcl/Rr+k/1z BtK3v79I1FUy2PULko2Dn7QxfPH4Oo5qGj0za7P8unH3GA7zCK2lVmGtvkhtvJCGnew3OM yqIkmMnzL+fRkWy3WfJK+0gmmkvQMtqOFOmHSnUI4/s/TVjsoq5QpaJLZ00fNh4EwXp8WN a4+TVy3fwwfDsXL694oDJWsmybQ8nyDVb1qpoteNUOS2gNhxTUBqgwLSxCoHOLCh773Uup qeqy9SyY60Ccxu9uqLO/VcS5vVTn78xfpCzctiaLZDR8Mhvx4aZ2g8DtwwjjCA== 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=1714438141; 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=czofkP3NiaWq5jKXjgfajBQUOvE6pqi734e+RRxDEoo=; b=yoS+Z1+tw4sG9DaFXxUiS9EwFKvqMXXg4CqVk9iR9DyDsmRzvk2fAHxorE4SyR/OHQGdJ9 RmmHmEwaEOyaFFKMC8NRTx9Y5BKJ8IMa35Ld0ttS6Xw1wN7vYKSbG6FLRe6n8x5H/3Is/T Te17GTD76tc01vDqk1EBLjm6OuEiaAUUqerqV8zIAFQuf1EfQ9wmd8ITtUYNt+9Ecs5i7Y lrsKuXvm50lTMNej08fGIqSq+UtkjQTXzwfJbo/UyAkunTtN3a7Vx2LTZhVbhfeUiXRoKP fOqfLEjNNOSBiQ7vCssanrY6oS2Y3J1owVZsw4hF7Lz6yRXKr96g5kiQdHY4Pw== 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 4VT1mF5Ls7z1STX; Tue, 30 Apr 2024 00:49: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 43U0n1Ur012916; Tue, 30 Apr 2024 00:49:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43U0n18O012913; Tue, 30 Apr 2024 00:49:01 GMT (envelope-from git) Date: Tue, 30 Apr 2024 00:49:01 GMT Message-Id: <202404300049.43U0n18O012913@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: e449481bee5f - stable/14 - libthr: add pthread_sigqueue(3) List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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: e449481bee5fd08d4342156696eb4a6eef531ef0 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e449481bee5fd08d4342156696eb4a6eef531ef0 commit e449481bee5fd08d4342156696eb4a6eef531ef0 Author: Konstantin Belousov AuthorDate: 2024-04-19 14:40:40 +0000 Commit: Konstantin Belousov CommitDate: 2024-04-30 00:48:09 +0000 libthr: add pthread_sigqueue(3) PR: 278459 (cherry picked from commit 220aa0f450409948b869237e5c4505f992c913ce) --- include/pthread.h | 7 ++++ lib/libthr/pthread.map | 4 ++ lib/libthr/thread/Makefile.inc | 1 + lib/libthr/thread/thr_private.h | 1 + lib/libthr/thread/thr_sigqueue.c | 79 ++++++++++++++++++++++++++++++++++++++++ 5 files changed, 92 insertions(+) diff --git a/include/pthread.h b/include/pthread.h index feb094c39fce..311211cb48f1 100644 --- a/include/pthread.h +++ b/include/pthread.h @@ -43,6 +43,9 @@ #include #include #include +#if __BSD_VISIBLE +#include +#endif #include #include @@ -302,6 +305,10 @@ void pthread_yield(void); int pthread_getname_np(pthread_t, char *, size_t); int pthread_setname_np(pthread_t, const char *); + +int pthread_sigqueue(pthread_t thread, int sig, + const union sigval value); + #endif int pthread_mutexattr_getprioceiling( diff --git a/lib/libthr/pthread.map b/lib/libthr/pthread.map index 348fd48df398..76c574e783a2 100644 --- a/lib/libthr/pthread.map +++ b/lib/libthr/pthread.map @@ -334,3 +334,7 @@ FBSD_1.6 { pthread_peekjoin_np; pthread_setname_np; }; + +FBSD_1.8 { + pthread_sigqueue; +}; diff --git a/lib/libthr/thread/Makefile.inc b/lib/libthr/thread/Makefile.inc index 33b95e9dd76d..c75322d6be95 100644 --- a/lib/libthr/thread/Makefile.inc +++ b/lib/libthr/thread/Makefile.inc @@ -47,6 +47,7 @@ SRCS+= \ thr_setprio.c \ thr_setschedparam.c \ thr_sig.c \ + thr_sigqueue.c \ thr_single_np.c \ thr_sleepq.c \ thr_spec.c \ diff --git a/lib/libthr/thread/thr_private.h b/lib/libthr/thread/thr_private.h index e590fb0c1e7a..f89941f96c78 100644 --- a/lib/libthr/thread/thr_private.h +++ b/lib/libthr/thread/thr_private.h @@ -1102,6 +1102,7 @@ int __Tthr_mutex_lock(pthread_mutex_t *); int __Tthr_mutex_trylock(pthread_mutex_t *); bool __thr_get_main_stack_base(char **base); bool __thr_get_main_stack_lim(size_t *lim); +int _Tthr_sigqueue(pthread_t pthread, int sig, const union sigval value); __END_DECLS __NULLABILITY_PRAGMA_POP diff --git a/lib/libthr/thread/thr_sigqueue.c b/lib/libthr/thread/thr_sigqueue.c new file mode 100644 index 000000000000..6f7ad8c63bad --- /dev/null +++ b/lib/libthr/thread/thr_sigqueue.c @@ -0,0 +1,79 @@ +/*- + * SPDX-License-Identifier: BSD-3-Clause + * + * Copyright (c) 1997 John Birrell . + * All rights reserved. + * + * Copyright 2024 The FreeBSD Foundation + * + * Portions of this software were developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * 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. + * 3. Neither the name of the author nor the names of any co-contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY JOHN BIRRELL 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 "namespace.h" +#include +#include +#include +#include "un-namespace.h" + +#include "thr_private.h" + +__weak_reference(_Tthr_sigqueue, _pthread_sigqueue); +__weak_reference(_Tthr_sigqueue, pthread_sigqueue); + +int +_Tthr_sigqueue(pthread_t pthread, int sig, const union sigval value) +{ + struct pthread *curthread; + int e, ret; + + if (sig < 0 || sig > _SIG_MAXSIG) + return (EINVAL); + + curthread = _get_curthread(); + ret = 0; + + if (curthread == pthread) { + if (sig > 0) { + e = sigqueue(pthread->tid, sig | __SIGQUEUE_TID, + value); + if (e == -1) + ret = errno; + } + } else if ((ret = _thr_find_thread(curthread, pthread, + 0)) == 0) { + if (sig > 0) { + e = sigqueue(pthread->tid, sig | __SIGQUEUE_TID, + value); + if (e == -1) + ret = errno; + } + THR_THREAD_UNLOCK(curthread, pthread); + } + + return (ret); +} From nobody Tue Apr 30 00:49:02 2024 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 4VT1mH1mZ7z5HjtF; Tue, 30 Apr 2024 00:49: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 4VT1mG6kn6z4Klb; Tue, 30 Apr 2024 00:49:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714438142; 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=g7na17N0JYwIzSZBVZVu9IxtKyITb8mVh1oWUmeUkL4=; b=AXNQW2jkkAfwsT96robPVsafemQhhEiHuoJRQgN3EKNXale0zfaDDgVqIbgZqFeupRBc1Q 0QSwSwfzmyYfaMsOTJnvPMB3IPSneCI7EqiVz7rUj8vHB91mf+XL8Oudcsk7u4KM5RBdVd y5P6CVXVhfLcBLs90OPC4QOmJXgmJqxlpPP8dRzNyLrzHmYs1v6JKwmW8UeITXIKVaO6W7 yDkD6P5GdpYb7xXukEyqFcjcqoxPkgyaX7XjpMreHxzcoFe8BLr9F/vzrgrj2SL9Wnjb63 GvYvAWTg8lt+jtYUCRk//iwxo5MrmJMHPwB2ZK/9NIUZAfWtSFjT++kHMxl44Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714438142; a=rsa-sha256; cv=none; b=lvjz/nglOcdjU5MwznYuF8QhCPxa/XRiLmisQHc5qBAvyEGFJodzG93U3ysv2xViWTHmBf 8QI+FZHqBAmNIse0i28ULJUdFAJYEA7iiLJgoVn3Uk5npacY7HVsKO+/Rci61nsqFR52Tp kGJ3AMR5nV3Xb4Etltgmfsk5hVDjyS5m5m5LEdIp5oJGWEtTwHDxCOnnv19UMVXVskS8Qy VLxeANij3rzrHHYQ/RJVv9UlmxjcWWE2dwCSZLI1cx62Vi3D1vw+GvQTPfYBLSwtZTjYX3 abyFhsHuPUmumqbRxzt1DKJvxxfIb/8JhSfhN5dpXnjn69qUpZ0B6eEVzlP2kA== 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=1714438142; 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=g7na17N0JYwIzSZBVZVu9IxtKyITb8mVh1oWUmeUkL4=; b=PtP7Qvr2d4YpbtA0b/Tzq0O8ukFJMLMGEh7CTIABd15YjB+1hwD2JPYVpnHtYJ9DTgENAs nui6vpxijTx/dN8nw9gX0K+qVdlnPRJhZqCuu+1h6N7huBAbV9jq7+LgjRbaad9akcPJ8Z Ps4aqWsaJNfwIARp3KX8cBCxgaLtjBXGaFPCgiVB8AhjAE7ikDI1LykRrRrI5rykRGHXUk 7FmbQtNK+Y5spX6Dl6/DbR6JIBiZD5vD/ySfHzWZC1rIkZ6ZZE2kkpFGU/g1maxXs03Tmw XCgA1U0fLN9p4jlJjN1bAvIfgQlMiuGV6XRcypX7OiYOc63zzqWS4X8vc8FR3g== 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 4VT1mG6M65z1STY; Tue, 30 Apr 2024 00:49: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 43U0n2dN012952; Tue, 30 Apr 2024 00:49:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43U0n2rK012949; Tue, 30 Apr 2024 00:49:02 GMT (envelope-from git) Date: Tue, 30 Apr 2024 00:49:02 GMT Message-Id: <202404300049.43U0n2rK012949@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: 42b071cbc91e - stable/14 - pthread_sigqueue(3): document List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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: 42b071cbc91e18e45e21feff39ca9e47ef93cc55 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=42b071cbc91e18e45e21feff39ca9e47ef93cc55 commit 42b071cbc91e18e45e21feff39ca9e47ef93cc55 Author: Konstantin Belousov AuthorDate: 2024-04-20 22:16:08 +0000 Commit: Konstantin Belousov CommitDate: 2024-04-30 00:48:09 +0000 pthread_sigqueue(3): document (cherry picked from commit 91da6becae6291533b9b59646b59bace2f905c81) --- share/man/man3/Makefile | 1 + share/man/man3/pthread_sigqueue.3 | 102 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 103 insertions(+) diff --git a/share/man/man3/Makefile b/share/man/man3/Makefile index 2b2d7516c11f..75f209ab4e0d 100644 --- a/share/man/man3/Makefile +++ b/share/man/man3/Makefile @@ -453,6 +453,7 @@ PTHREAD_MAN= pthread.3 \ pthread_set_name_np.3 \ pthread_setspecific.3 \ pthread_sigmask.3 \ + pthread_sigqueue.3 \ pthread_spin_init.3 \ pthread_spin_lock.3 \ pthread_suspend_all_np.3 \ diff --git a/share/man/man3/pthread_sigqueue.3 b/share/man/man3/pthread_sigqueue.3 new file mode 100644 index 000000000000..bf5dd62f04e6 --- /dev/null +++ b/share/man/man3/pthread_sigqueue.3 @@ -0,0 +1,102 @@ +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.\" Copyright 2024 The FreeBSD Foundation, Inc. +.\" +.\" This documentation was written by +.\" Konstantin Belousov under sponsorship +.\" from the FreeBSD Foundation. +.\" +.\" 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(s), this list of conditions and the following disclaimer as +.\" the first lines of this file unmodified other than the possible +.\" addition of one or more copyright notices. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice(s), 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 COPYRIGHT HOLDER(S) ``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 COPYRIGHT HOLDER(S) 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. +.\" +.Dd April 21, 2024 +.Dt PTHREAD_SIGQUEUE 3 +.Os +.Sh NAME +.Nm pthread_sigqueue +.Nd queue a signal to a specified thread +.Sh LIBRARY +.Lb libpthread +.Sh SYNOPSIS +.In pthread.h +.In signal.h +.Ft int +.Fn pthread_sigqueue "pthread_t thread" "int sig" "const union sigval value" +.Sh DESCRIPTION +The +.Fn pthread_queue +function queues a signal, specified by +.Fa sig , +to a thread, specified by +.Fa thread . +If +.Fa sig +is 0, error checking is performed, but no signal is actually sent. +The +.Fa value +is queued together with the signal, and becomes available in +.Vt siginfo_t +data passed to the signal handler. +.Pp +The +.Nm +function is similar to +.Xr sigqueue 2 , +but targets a thread in the current process instead of a process. +See +.Xr sigqueue 2 +for details about signal queueing and delivery selection. +.Sh RETURN VALUES +If successful, +.Fn pthread_sigqueue +returns 0. +Otherwise, an error number is returned. +.Sh ERRORS +The +.Fn pthread_sigqueue +function will fail if: +.Bl -tag -width Er +.It Bq Er EAGAIN +No resources are available to queue the signal. +The current process has already queued +.Brq Dv SIGQUEUE_MAX +signals that are still pending, +or a system-wide resource limit has been exceeded. +.It Bq Er ESRCH +.Fa thread +is an invalid thread ID. +.It Bq Er EINVAL +.Fa sig +is an invalid or unsupported signal number. +.El +.Sh SEE ALSO +.Xr sigqueue 2 +.Sh STANDARDS +The +.Fn pthread_sigqueue +function is a +.Fx +extension. +An identical function with the same semantic is available in other +operating systems. From nobody Tue Apr 30 00:49:03 2024 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 4VT1mJ2ytwz5Hk0t; Tue, 30 Apr 2024 00:49: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 4VT1mJ0RKPz4KxB; Tue, 30 Apr 2024 00:49:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714438144; 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=Pj+ERTL4pZqAqkZ5EN9oVnsz3LTuNSgFV/Jgan8rJlY=; b=JafG4fxUmRkhcBSWig9bT1cgvY4wAypJisf/9zoWSp8V+hl4YWWM1ABOtT/j0IFbFOR4qm BWqX1Es/LZ+P8a+rTtXMtT5rOrqob1Lqnpzyo37YkGD11uGcPrkd4/q6UjvWZhL4xM632J hloHzGRKbLeJF7Y0703siEbcd4MDrQ3dte6Ja7i/zcR+BRRE6bIQcje8iGvwkuFIfP0Co/ FAuXllR+ZZu5idAAH2vVvfK5//Ayf5r41Yb0RtwR/8xAJtpfyBhJXP02O+T0jnjlYDX/wh JWFK2jHkxfMAN84yqnjQPTFl4ryiVFa0jquNugXPtQzZRoCgT15PbHpsJKL+Yg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714438144; a=rsa-sha256; cv=none; b=NgLGq2VxNMU2B4s2207RBKhiuGoFz0H3NeSw0f4t0yCTqog4o7vQYT7Y0h+Z6Q101/6VT4 BcqVKkQj/BLhN8ZNz2CI/XQMV4la1qjYrfSW9uYLPzFvXm85PgDiYCnkfGrDrb6ieS07PO mvsc1NDwZh+DBoL+Vd042TB73APvoclaGaxBrpnQwJZkDhA8sMY7WnFAaCyrnLLcWj60XP yjkqICmA8o6J3CHASxsQkGDJvbfZm9nWqPaXZB4tluD3CkzoofnBI4rR/w96h/DknG9zFJ 5drm0l/l7tV+CLvhcO9OEBWNFvQ2ylp4EtLLngdtYf+wmjAJKhMTNOdZJQlapQ== 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=1714438144; 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=Pj+ERTL4pZqAqkZ5EN9oVnsz3LTuNSgFV/Jgan8rJlY=; b=gOYUbn+lYHcQ6lkX+1zny1DFf4w79cUsR3a69NINhl9l7ka2IDjm5xJxS3dP0gcL905FyZ hia1AOWjYbscETFKv844kUkAF0kssx6m8yvuz1+mkJ9uu7E8Ki41WC3cZFALNZKNE2YHbT yDKQwzEDBQDnGSAUwChvcgArjoCKStPODnWK5x2RYIuxzA5J2qRlvtgZXQ4urzg9LPYWfs L9iMSHkdAqA4DYM17ti2FCXjtiwdifc/CrtHg++GCseAXgq9YZYhi6zPvC9RqD0ZGPb3Y/ r0OagC3bAn2mk63EjioZo7l0IoxIaa2BKoml0UM45Mnrxr4U/+oHrZOD7x8drA== 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 4VT1mJ03lCz1SGf; Tue, 30 Apr 2024 00:49: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 43U0n3uG012994; Tue, 30 Apr 2024 00:49:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43U0n3vt012991; Tue, 30 Apr 2024 00:49:03 GMT (envelope-from git) Date: Tue, 30 Apr 2024 00:49:03 GMT Message-Id: <202404300049.43U0n3vt012991@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: bd30b3dfd5c8 - stable/14 - Add test for pthread_sigqueue(3) List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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: bd30b3dfd5c860849bb6bad43bbe824fe3d8b211 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=bd30b3dfd5c860849bb6bad43bbe824fe3d8b211 commit bd30b3dfd5c860849bb6bad43bbe824fe3d8b211 Author: Konstantin Belousov AuthorDate: 2024-04-20 19:59:14 +0000 Commit: Konstantin Belousov CommitDate: 2024-04-30 00:48:09 +0000 Add test for pthread_sigqueue(3) (cherry picked from commit fb2ab7ce52d3f1e9d0998f3e5c12c3468ce4563a) --- lib/libthr/tests/Makefile | 1 + lib/libthr/tests/pthread_sigqueue_test.c | 120 +++++++++++++++++++++++++++++++ 2 files changed, 121 insertions(+) diff --git a/lib/libthr/tests/Makefile b/lib/libthr/tests/Makefile index 8b7850b94265..d882ccfd877c 100644 --- a/lib/libthr/tests/Makefile +++ b/lib/libthr/tests/Makefile @@ -35,6 +35,7 @@ NETBSD_ATF_TESTS_SH+= exit_test NETBSD_ATF_TESTS_SH+= resolv_test ATF_TESTS_C+= umtx_op_test +ATF_TESTS_C+= pthread_sigqueue_test LIBADD+= pthread LIBADD.fpu_test+= m diff --git a/lib/libthr/tests/pthread_sigqueue_test.c b/lib/libthr/tests/pthread_sigqueue_test.c new file mode 100644 index 000000000000..053a8dac4039 --- /dev/null +++ b/lib/libthr/tests/pthread_sigqueue_test.c @@ -0,0 +1,120 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright 2024 The FreeBSD Foundation + * + * This software was developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * 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 +#include +#include +#include +#include + +#define NTHREADS 330 +static int value[NTHREADS]; +static pthread_t thr[NTHREADS]; +static pthread_barrier_t barrier; + +static void +handler(int signo __unused, siginfo_t *info, void *data __unused) +{ + pthread_t self; + int i; + + /* + * Formally this is thread-unsafe but we know context from + * where the signal is sent. + */ + self = pthread_self(); + for (i = 0; i < NTHREADS; i++) { + if (pthread_equal(self, thr[i])) { + value[i] = info->si_value.sival_int; + pthread_exit(NULL); + } + } +} + +static void * +threadfunc(void *arg __unused) +{ + pthread_barrier_wait(&barrier); + for (;;) + pause(); +} + +ATF_TC(pthread_sigqueue); +ATF_TC_HEAD(pthread_sigqueue, tc) +{ + atf_tc_set_md_var(tc, "descr", + "Checks pthread_sigqueue(3) sigval delivery"); +} + +ATF_TC_BODY(pthread_sigqueue, tc) +{ + struct sigaction sa; + union sigval sv; + int error, i; + + error = pthread_barrier_init(&barrier, NULL, NTHREADS + 1); + ATF_REQUIRE_EQ(0, error); + + memset(&sa, 0, sizeof(sa)); + sa.sa_sigaction = handler; + sigemptyset(&sa.sa_mask); + sa.sa_flags = SA_SIGINFO; + + if (sigaction(SIGUSR1, &sa, NULL) != 0) + atf_tc_fail("sigaction failed"); + + memset(&sv, 0, sizeof(sv)); + + for (i = 0; i < NTHREADS; i++) { + error = pthread_create(&thr[i], NULL, threadfunc, NULL); + ATF_REQUIRE_EQ(0, error); + } + error = pthread_barrier_wait(&barrier); + ATF_REQUIRE(error == 0 || error == PTHREAD_BARRIER_SERIAL_THREAD); + + for (i = 0; i < NTHREADS; i++) { + sv.sival_int = i + 1000; + error = pthread_sigqueue(thr[i], SIGUSR1, sv); + ATF_REQUIRE_EQ(0, error); + error = pthread_join(thr[i], NULL); + ATF_REQUIRE_EQ(0, error); + } + for (i = 0; i < NTHREADS; i++) + ATF_REQUIRE_EQ(i + 1000, value[i]); +} + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, pthread_sigqueue); + return atf_no_error(); +} From nobody Tue Apr 30 00:49:05 2024 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 4VT1mK4qqzz5Hk3V; Tue, 30 Apr 2024 00:49: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 4VT1mK2Drlz4L0S; Tue, 30 Apr 2024 00:49:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714438145; 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=Kbcw1SPg4WxbY8ZsN57HCKs6JfKginm02nDNPNhOT3Q=; b=JaevtrIATduxA4etAkiizJICJLYUgUZ/YRaCCVgTkbs0lLbQ5ZIAefdV7Qm9wMsTFlCI0X gwuKJ73L/+YDyITSuPpmtAVAaaWd/u01U429bs/qdLBeSM8xAhl8EXXBdA6/dUHpDeIWym xIzvOXp6ejaMoQBRXqMer81GDKMXjJa3YNcLVibZvyLNFylit+rs/1WIvp4qdDehBktniO X+hgDvP74KCJe3upajnCHxhMRCvEGlUPuHH2tGE9Ueksreqwxn1rH98d9HqKt9Hfqpa+6r 2peWhz+nXzTgoQ4P0/1/dhiNBg7OQw1DZcrb8A7LqSXDIJAZeqNuXCEKGjifmw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714438145; a=rsa-sha256; cv=none; b=RCYoh/yHejXBaC56xs3gEVqDigbGLf8c6T52tlsn/TAZfz27Dfy8gcOQnJja7JgOJUg3zY j5rHPvg/+iF5tYpCXhXMzzd/xgRG4t4eXIQDV7J0i8KUXWlbaHwqXXQ625CqHaUlp7Hb3S Yct4W9ZbxqKgZHeBUImonsa5XIN/scHsb0NoYjcYQs+L1J2y4OD/Z77E9Zcfmtk9hRtLoD oOjgsNWPaRVV5HthQUmbPEksO2Q1VOSg/0gAzhvqoD0LvBp90TNRStLMmGFLv1w4GnCRwb xqoaogzpisHtgwAIe43RysSo87T3wUNdsBqB7vjQsv4MySGfa7qaRLXlCSismg== 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=1714438145; 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=Kbcw1SPg4WxbY8ZsN57HCKs6JfKginm02nDNPNhOT3Q=; b=Nl3aU2nyqsGMMU4JOaVcoNodSkDQ6WNCAiShdsbIDnWS+H76yLSD61CT4iJ5i8xtK3nCEO MoSafm/VoSYLBwACQzLn6d8KJ6I519lQ6+PPo8/uTw+3GrJ4s1X0kn5Bc1XgjhtVF45hXg EgseAypdqfNOavn3/A6MtuiLoRzOTZsNWnK+yU9s0mQNfgY2kvGWLTTH4d82hN7VLrPmEw XqKntCgnSyNaiX+hy7nJ1ZZe9K1wACbSxUvGVB5RccIPQ+YHtp1guMZHq7tMrSjEWau8f4 G5nTA9HMRKvzNw4SczBhGaJCjDwVCkvtNffsqe2CO0HRKUxRwvYbVf3XA9A2ww== 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 4VT1mK1VDDz1SJ4; Tue, 30 Apr 2024 00:49: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 43U0n5On013042; Tue, 30 Apr 2024 00:49:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43U0n5Et013039; Tue, 30 Apr 2024 00:49:05 GMT (envelope-from git) Date: Tue, 30 Apr 2024 00:49:05 GMT Message-Id: <202404300049.43U0n5Et013039@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: 8f19af4b0955 - stable/14 - libc: make strerror_rl() usable for libc List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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: 8f19af4b0955dc3f4309a41d6aeb7514f6884848 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=8f19af4b0955dc3f4309a41d6aeb7514f6884848 commit 8f19af4b0955dc3f4309a41d6aeb7514f6884848 Author: Konstantin Belousov AuthorDate: 2024-04-23 17:04:29 +0000 Commit: Konstantin Belousov CommitDate: 2024-04-30 00:48:10 +0000 libc: make strerror_rl() usable for libc (cherry picked from commit 92771bc00ad0f567b27876c34450bef7a0ee61d0) --- lib/libc/include/libc_private.h | 2 ++ lib/libc/string/strerror.c | 10 +++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/libc/include/libc_private.h b/lib/libc/include/libc_private.h index bfeada696538..22467a211df6 100644 --- a/lib/libc/include/libc_private.h +++ b/lib/libc/include/libc_private.h @@ -444,5 +444,7 @@ struct __nl_cat_d; struct _xlocale; struct __nl_cat_d *__catopen_l(const char *name, int type, struct _xlocale *locale); +int __strerror_rl(int errnum, char *strerrbuf, size_t buflen, + struct _xlocale *locale); #endif /* _LIBC_PRIVATE_H_ */ diff --git a/lib/libc/string/strerror.c b/lib/libc/string/strerror.c index d5f8a5193ac1..0eb36424cb24 100644 --- a/lib/libc/string/strerror.c +++ b/lib/libc/string/strerror.c @@ -77,8 +77,8 @@ errstr(int num, const char *uprefix, char *buf, size_t len) strlcat(buf, t, len); } -static int -strerror_rl(int errnum, char *strerrbuf, size_t buflen, locale_t locale) +int +__strerror_rl(int errnum, char *strerrbuf, size_t buflen, locale_t locale) { int retval = 0; #if defined(NLS) @@ -119,7 +119,7 @@ strerror_rl(int errnum, char *strerrbuf, size_t buflen, locale_t locale) int strerror_r(int errnum, char *strerrbuf, size_t buflen) { - return (strerror_rl(errnum, strerrbuf, buflen, __get_locale())); + return (__strerror_rl(errnum, strerrbuf, buflen, __get_locale())); } char * @@ -127,7 +127,7 @@ strerror_l(int num, locale_t locale) { static _Thread_local char ebuf[NL_TEXTMAX]; - if (strerror_rl(num, ebuf, sizeof(ebuf), locale) != 0) + if (__strerror_rl(num, ebuf, sizeof(ebuf), locale) != 0) errno = EINVAL; return (ebuf); } @@ -137,7 +137,7 @@ strerror(int num) { static char ebuf[NL_TEXTMAX]; - if (strerror_rl(num, ebuf, sizeof(ebuf), __get_locale()) != 0) + if (__strerror_rl(num, ebuf, sizeof(ebuf), __get_locale()) != 0) errno = EINVAL; return (ebuf); } From nobody Tue Apr 30 00:49:06 2024 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 4VT1mL4lP4z5Hk5T; Tue, 30 Apr 2024 00:49: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 4VT1mL2wzqz4Kxk; Tue, 30 Apr 2024 00:49:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714438146; 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=CICRjSEchDdoKTGTHlA0oTT5ZZ9f23GuFz+DOTcKKfI=; b=ImketwvpetgxMME5GCsY4vmliU6DRBitLlXFSH0jZQ2+KTC9IO1kOx37ifXMgQQgLbChrm oaF+7LzT7lot3NCdWkVoDtSr4oM0BTN0pOrV8hQ3eo5rHfC0NyJFDfhrvIKjtzRASWyuTS D1YYowK1HiPZaxbReG7nfAM9NfRcjxdhy2+F7L+wVecIJd7GBYB+dm5hZqD8MSLLqeFpOW uKhLO+lEf9+mLRZn1K56kyrBJR1TwfN09yFqJUKUIDVjxcFGfJmDIYndTx9iilAjtZDAEn aNn0NRnsZcMyk4UxMZWhE72mHpQIONd0yUVi7IGjI1mOLKRy3dR8Tz4MvcgEmA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714438146; a=rsa-sha256; cv=none; b=i5ZrED2hwdHJJ2tMU6lKs663MiPPPwuWpY6kkSFTgQf3lQV7Y/Azl/BF93kFWo5wmWq9zM ZLo2z5hLXE8vqpxv3hSNeh60pAmkX5Q9Td9eWvrcrY2oyA19pmeSJFX4pVn/RacxxxM8dP XswRio0CE7RBjkac6n173uXJwV8Q8Pq+kvCXHDAK2uNldXU3o3EeSwQbYoEXmV960PXeTO Nli8Oye7CU7VrOg70byuui39WA4FQTOHJicXwm3+5XYpm5q4SlcFZHezmCDQA5yaLTaxsi znpwxS3yQCyVPRF7grxGDEVwBwY8lxlBuvgK7lfzBqYZ8t8Gs5QMtwk8KkkJ+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=1714438146; 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=CICRjSEchDdoKTGTHlA0oTT5ZZ9f23GuFz+DOTcKKfI=; b=y2UESKLNzWSA0ouIhxofWDjh7BQ0llgy25Nv5cNJPpcG7wV2LdY05Vka5/uQRbvgo/SPrV QPEIE4Ql/oBz7DiODT6Vxoy55VTb3MJLJ09kFuj/IaBUysyGigxfx4TL+3mbVMxLFbKjbt ucK8PaTK1t42YLWz+eeDTxmpfJrekr6dRfFT/0tY7oQ3RQO8EeVMwwenSJD6xSs3mai3vP 4CgfQcUVNsDnasCGqYcW0mNFBTjCG3WKghutL9r968ehuj/0e9s9I064S/79de1lZDe0wk ujw61eq/9jvFwz0mzh0h44eiT2UsSZVB7WUWnlqKtZtivnMlcqS5NYD6u9UjaQ== 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 4VT1mL2WYPz1STZ; Tue, 30 Apr 2024 00:49: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 43U0n6k0013088; Tue, 30 Apr 2024 00:49:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43U0n6xX013085; Tue, 30 Apr 2024 00:49:06 GMT (envelope-from git) Date: Tue, 30 Apr 2024 00:49:06 GMT Message-Id: <202404300049.43U0n6xX013085@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: ade62d406239 - stable/14 - __vprintf(): switch from strerror() to strerror_rl() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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: ade62d406239b728a1c74974bbb57ed493c733e0 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=ade62d406239b728a1c74974bbb57ed493c733e0 commit ade62d406239b728a1c74974bbb57ed493c733e0 Author: Konstantin Belousov AuthorDate: 2024-04-23 17:10:30 +0000 Commit: Konstantin Belousov CommitDate: 2024-04-30 00:48:10 +0000 __vprintf(): switch from strerror() to strerror_rl() PR: 278556 (cherry picked from commit f887667694632c829b0599b54ff86a072e93df87) --- lib/libc/stdio/vfprintf.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/libc/stdio/vfprintf.c b/lib/libc/stdio/vfprintf.c index 38c77aebf316..0ce9d6f37569 100644 --- a/lib/libc/stdio/vfprintf.c +++ b/lib/libc/stdio/vfprintf.c @@ -315,6 +315,8 @@ __vfprintf(FILE *fp, locale_t locale, const char *fmt0, va_list ap) int width; /* width from format (%8d), or 0 */ int prec; /* precision from format; <0 for N/A */ int saved_errno; + int error; + char errnomsg[NL_TEXTMAX]; char sign; /* sign prefix (' ', '+', '-', or \0) */ struct grouping_state gs; /* thousands' grouping info */ @@ -832,7 +834,9 @@ fp_common: break; #endif /* !NO_FLOATING_POINT */ case 'm': - cp = strerror(saved_errno); + error = __strerror_rl(saved_errno, errnomsg, + sizeof(errnomsg), locale); + cp = error == 0 ? errnomsg : ""; size = (prec >= 0) ? strnlen(cp, prec) : strlen(cp); sign = '\0'; break; From nobody Tue Apr 30 00:49:07 2024 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 4VT1mM6qzQz5Hk3d; Tue, 30 Apr 2024 00:49: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 4VT1mM4pnxz4L51; Tue, 30 Apr 2024 00:49:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714438147; 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=9z0tOVUwYrFsNvmraSsiUAiZiWdiQoLewBESKxA8tuM=; b=KSwmRPThTsB3Czcuvvl/WIyO+xeJc6UIaA5/sjnqOlLPlninglhXacteguX8Zi8NNz/rcj Evyfuc1OblzY4TjectUr8BMR/kzIxIErosKbS60fItjIatrOegeyVZD4VjEykpZTnCpZJo HgknKBF+kU8WNSrQjzrHNnbSGBl8P5tt4n/Bhk67cixgdw1hrbd0h3PM157o23NeWhrRWi UQGuJCjSqjgcsaSBWeEK8uwIXxxdnpILIcGmBu0TJTVW8mxI8gIHIbS5A7b2ZJfJAVJMgo nPjLT+n5dqNAQrgvmzl6gydbsQgvf+rcLg8MmZiKqNCaxK8fPk1l+F7O9sUd6Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714438147; a=rsa-sha256; cv=none; b=I23AVhkjrsaRmvuQB3ttL+/1nTbjiU8RxzPWwNZG0ToKcRTfEgpv/ORJEDCA/w7Zsif5Sq LQQUN2Q9xOjZsnqgstYXtUdQYgUDsYppS7yWIjijXaJ4EBVkg3uWevAgrgTk4TR1O1BXxo fqKKS5q7uRzz8rkA4nAacjiVDVsp2fecsdnBcVfa4n65s1WkQrcRL3BX+p0XwP+i4Kvd1b +2dW/xCoLHFUBi6hpRv/IEwZ2h2YLY7plVzq4RKfUwJFYW1bc7+QO0A05C2dJRcXs3YyVd haBtvKVItOaAkxk55iKklub/9hUravxfbpZxwqjBKNhti63T8zHjHq7NHxd3wA== 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=1714438147; 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=9z0tOVUwYrFsNvmraSsiUAiZiWdiQoLewBESKxA8tuM=; b=SMAI9HDhAVKIkvcQGf1oKWApAhwouAoJqc3+2aaNQnfY8VsF29vmVRE3SZktWOQI8Fdc0s J5rOF2sPpifE8YokVwOHRMe+Oxs6fUwZWXHIou0aLd07EpzDdJvlN1fDnvx8UuggYoSXzy lE7adIeDSEzT42rBG4gEDjayAeV/ACEqljVpWPUUgt9oc3JoCn5C6rPvZs31aCMZ+34LrS sLRwKJ1ZbAHr0wXKKeRbGWZCkURQsdasmy1CX12s2YguQKZuh/C4F76ZwMe2WJb8I6o7j2 cXWt7qsJDDcAYVhcQq7/8iS3uynEiGkDITDx/lOEnwubMGR7dJRVdH8k2nbFkQ== 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 4VT1mM3Yb4z1SSb; Tue, 30 Apr 2024 00:49:07 +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 43U0n7vN013133; Tue, 30 Apr 2024 00:49:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43U0n7rn013130; Tue, 30 Apr 2024 00:49:07 GMT (envelope-from git) Date: Tue, 30 Apr 2024 00:49:07 GMT Message-Id: <202404300049.43U0n7rn013130@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: 0451d4287a92 - stable/14 - libc: minor style, wrap long lines List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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: 0451d4287a929910e9cccf2431d2464632e51965 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=0451d4287a929910e9cccf2431d2464632e51965 commit 0451d4287a929910e9cccf2431d2464632e51965 Author: Konstantin Belousov AuthorDate: 2024-04-23 17:14:34 +0000 Commit: Konstantin Belousov CommitDate: 2024-04-30 00:48:10 +0000 libc: minor style, wrap long lines (cherry picked from commit bac9d7e8f2931149815c3d5a9ab69594bbdffde6) --- lib/libc/stdio/xprintf_errno.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/libc/stdio/xprintf_errno.c b/lib/libc/stdio/xprintf_errno.c index db897328f0fe..c63a7afd35e0 100644 --- a/lib/libc/stdio/xprintf_errno.c +++ b/lib/libc/stdio/xprintf_errno.c @@ -38,7 +38,8 @@ #include "printf.h" int -__printf_arginfo_errno(const struct printf_info *pi __unused, size_t n, int *argt) +__printf_arginfo_errno(const struct printf_info *pi __unused, size_t n, + int *argt) { assert(n >= 1); @@ -47,7 +48,8 @@ __printf_arginfo_errno(const struct printf_info *pi __unused, size_t n, int *arg } int -__printf_render_errno(struct __printf_io *io, const struct printf_info *pi __unused, const void *const *arg) +__printf_render_errno(struct __printf_io *io, const struct printf_info *pi + __unused, const void *const *arg) { int ret, error; char buf[64]; From nobody Tue Apr 30 00:49:08 2024 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 4VT1mP0Pwgz5Hk3k; Tue, 30 Apr 2024 00:49:09 +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 4VT1mN4yghz4KyG; Tue, 30 Apr 2024 00:49:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714438148; 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=tdGNwnO+pw9kuPwqG4n0ciMqmE1DfRqkY+UE4D025lk=; b=ElzNtxe0A8znAqZiNtK8l9gxTemlLMiJs5VraoqWBSakYdFM5e/xekfxZE0gkz5QeRcn1x VIdNG0ciqsQkVA+BGlcfNmkQtJ96AMaH6b1jhaKz5idzWsIa8N5790K0kYFdFUM+NPVVbU 70YYUP8LcGaek5DhDtb7cwBS2+p4+a5RB3KImscs8wNeCs0JtKqnfkt23H92NVdm1Ia/LI f/OvModLhrjg6QNlaAytAhzXONyhn+VmQnCKugVYvaENzrBnKC7g3djRqcpyxwVrmPK6F5 qMfsXVNzUF9P4pm95b6FuKp6eWYAqEqtFrSfsXSx9hHlx8npcNZWJro5MDrzQg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714438148; a=rsa-sha256; cv=none; b=nuol/jSXiBZKR6HNPrYQEHAQQfvTb6D1KxZzW/5DoEpVJaiAg6PonUDuKRxJmq5X0Dm4iu ucldkZ09KbabbQViQ1xDZWunQWRPMkQbhu1qmgYAi4WQxCC5axjJF64y2AcaDmve8nzr5U kyNBbRg+cbu57wUNxLcZsXsJlyuHP2MTP7jfreJeXbnbuzfmbxkf6zgJRcdfdo7Fiftkvp /G9RSGvUgNYdmdq9rdCGND2hIa7paFa3h0D5SXR53pud5QYU338g+7qt6kI8G1K8sV6xrA nYxpHwUjyyPNDq07kUgFWKWFL6b0kZndlam0VxkHm6qtONQf0a8/2yK3v9dNig== 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=1714438148; 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=tdGNwnO+pw9kuPwqG4n0ciMqmE1DfRqkY+UE4D025lk=; b=TkVk4ZNZE/2YegiLbhff9ePhJ8c+uaSYlLgmVHYISPFGuSbQfBwhY6O1GTu2v4g0+dn9Yv HH/xvk563dTA+xg0PXtHQaFoZqWSMgKA8OUwRemuKuZ00fVo4tu6K49bs36fJh1Xlw/bLz MCjgGGT9gIgMpH75fR/o9N5LgPgsuezLj2eyRMDXIeGoUW58SYvuUwVhhWXebH9o2XEAyM N/f1bph3UdVmOakzkL7TkycXKkbKjVTJ0qsBFL3AOk3ZvOViMjtifElYbEDczPdO+u+an6 GGC44qcnFrh/4jZc8HvDJueTQMrR9Y+EgNcjzb9BU7CTxpHIRtflIEX0MqNe1A== 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 4VT1mN4ZTzz1SSc; Tue, 30 Apr 2024 00:49: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 43U0n89S013182; Tue, 30 Apr 2024 00:49:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43U0n8Q9013179; Tue, 30 Apr 2024 00:49:08 GMT (envelope-from git) Date: Tue, 30 Apr 2024 00:49:08 GMT Message-Id: <202404300049.43U0n8Q9013179@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: 09bcfbd1aede - stable/14 - libc printf_render_errno(): do not use strerror() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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: 09bcfbd1aede8f7596f14a95fd408aa79a239a9c Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=09bcfbd1aede8f7596f14a95fd408aa79a239a9c commit 09bcfbd1aede8f7596f14a95fd408aa79a239a9c Author: Konstantin Belousov AuthorDate: 2024-04-23 17:15:22 +0000 Commit: Konstantin Belousov CommitDate: 2024-04-30 00:48:10 +0000 libc printf_render_errno(): do not use strerror() (cherry picked from commit aa66995b4c804cbb579f71645d97fe282a798bfc) --- lib/libc/stdio/xprintf_errno.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/libc/stdio/xprintf_errno.c b/lib/libc/stdio/xprintf_errno.c index c63a7afd35e0..f1e5421f60c8 100644 --- a/lib/libc/stdio/xprintf_errno.c +++ b/lib/libc/stdio/xprintf_errno.c @@ -27,6 +27,7 @@ */ #include +#include #include #include #include @@ -53,13 +54,13 @@ __printf_render_errno(struct __printf_io *io, const struct printf_info *pi { int ret, error; char buf[64]; - const char *p; + char errnomsg[NL_TEXTMAX]; ret = 0; error = *((const int *)arg[0]); if (error >= 0 && error < __hidden_sys_nerr) { - p = strerror(error); - return (__printf_out(io, pi, p, strlen(p))); + strerror_r(error, errnomsg, sizeof(errnomsg)); + return (__printf_out(io, pi, errnomsg, strlen(errnomsg))); } sprintf(buf, "errno=%d/0x%x", error, error); ret += __printf_out(io, pi, buf, strlen(buf)); From nobody Tue Apr 30 00:50:20 2024 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 4VT1nn1mCnz5HkJR; Tue, 30 Apr 2024 00:50: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 4VT1nn0ssSz4P0Q; Tue, 30 Apr 2024 00:50:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714438221; 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=8hwS2TEXDE46Tuqtpsfrj8MApdFtaVWVqlxldQfz7b4=; b=GP9QDAmmDIFqpH2IS+ehvGE6Vf780Zlki1QtiXjY3SY+kxFl4YneBPMIxgh0qymLr5WNvd C0Vwv+czepxQ0U/1rHL5+hIkvxBOsa9wLyDiuLqjgMvOGxBrCx703yBSG+/E+Wk6EX3IPe FPhJ7OyaGCEHXCbWHFIlsr0UceZlCQ0p8i5dSMNDoJW8YLp8OZhX6DfuI4b2GyePQbr7RL xwe9Dv0IXIenthHyviKr647VSoh5k8yCjOUk1sh5zD8L12mNzupcCkuxk/mgSCv45VKDWc n8rGHw+PvRKjPdOCWtdD4/cdExW5BnqVPduje4ImBKgYj17UOPGQdAEQatVTuw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714438221; a=rsa-sha256; cv=none; b=DywDwFbXWlGWUC9TdEZfY+mQj4wds6cCZ0rjQf1Ysb/UZNow39H9uQBFobcLEykAInBVON P2jfqnHUVv4nBN1CLKI/2bcQafNy1gXywhl7jzCE9uV8zuxKvyoPxFvvPo0f72SmBg74z7 M7JdLF1lGWhVuJMkzfw1fV+nbyc4SdCrXENYv46rBpups8buXwALo7HLdvj8eIvDT3trRX hrPIGdgGmOdeFeFbas0H0ank6DeaHCwmJlNb9jcchO2ShjTlDbN1B0B7jUqOszpPDq/OGL JNUZ7xiDW4xG5dYlKfG1f+Ehlawqn+FKawZiQVJNY0B/LBsjNToMyqWQ6pB1xA== 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=1714438221; 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=8hwS2TEXDE46Tuqtpsfrj8MApdFtaVWVqlxldQfz7b4=; b=sIodGFLPzpiiVvGD16Xut2ZDRfqFcn/4pf8H6K6LRnQZzis536xwqKNzULYemjL7mKEAE+ u9XJjSJLjqSppiJU6uJYB5yVeIasH7m2hXoxkIsrdrnxQVf8SS65w2i5p9UIlDzRjh46Hz k8VNB64rELTMzAO8rIBUpuRcWRLrYbURObn0xqKZvtRO/a0DccZkQ+A8/tWX65xSlqbVTy 87Z4oNzi6KcjAw70CkAMCGLTaGAZ/fAnpa+eMnGc+Jd+CQNBh/HrFMJOZJHnVSXpVEeOnu 7Gz+JQrbUMWJSyqhZ0HCZy/yzJhVhEdWQjZvmkOlhAn7lQTnc5QCAPfTVS0JLQ== 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 4VT1nn0TW4z1STh; Tue, 30 Apr 2024 00:50: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 43U0oKjX022114; Tue, 30 Apr 2024 00:50:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43U0oKuD022111; Tue, 30 Apr 2024 00:50:20 GMT (envelope-from git) Date: Tue, 30 Apr 2024 00:50:20 GMT Message-Id: <202404300050.43U0oKuD022111@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: a8ae94b9e2cb - stable/13 - libc: make strerror_rl() usable for libc List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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: a8ae94b9e2cbb5ddee2ba6c4fcdda508dc295b5d Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=a8ae94b9e2cbb5ddee2ba6c4fcdda508dc295b5d commit a8ae94b9e2cbb5ddee2ba6c4fcdda508dc295b5d Author: Konstantin Belousov AuthorDate: 2024-04-23 17:04:29 +0000 Commit: Konstantin Belousov CommitDate: 2024-04-30 00:49:52 +0000 libc: make strerror_rl() usable for libc (cherry picked from commit 92771bc00ad0f567b27876c34450bef7a0ee61d0) --- lib/libc/include/libc_private.h | 2 ++ lib/libc/string/strerror.c | 10 +++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/libc/include/libc_private.h b/lib/libc/include/libc_private.h index 593d106f3af6..34aa50d0f12d 100644 --- a/lib/libc/include/libc_private.h +++ b/lib/libc/include/libc_private.h @@ -453,5 +453,7 @@ struct __nl_cat_d; struct _xlocale; struct __nl_cat_d *__catopen_l(const char *name, int type, struct _xlocale *locale); +int __strerror_rl(int errnum, char *strerrbuf, size_t buflen, + struct _xlocale *locale); #endif /* _LIBC_PRIVATE_H_ */ diff --git a/lib/libc/string/strerror.c b/lib/libc/string/strerror.c index 673ccbf37ef7..a43b53ed59b5 100644 --- a/lib/libc/string/strerror.c +++ b/lib/libc/string/strerror.c @@ -78,8 +78,8 @@ errstr(int num, const char *uprefix, char *buf, size_t len) strlcat(buf, t, len); } -static int -strerror_rl(int errnum, char *strerrbuf, size_t buflen, locale_t locale) +int +__strerror_rl(int errnum, char *strerrbuf, size_t buflen, locale_t locale) { int retval = 0; #if defined(NLS) @@ -120,7 +120,7 @@ strerror_rl(int errnum, char *strerrbuf, size_t buflen, locale_t locale) int strerror_r(int errnum, char *strerrbuf, size_t buflen) { - return (strerror_rl(errnum, strerrbuf, buflen, __get_locale())); + return (__strerror_rl(errnum, strerrbuf, buflen, __get_locale())); } char * @@ -128,7 +128,7 @@ strerror_l(int num, locale_t locale) { static _Thread_local char ebuf[NL_TEXTMAX]; - if (strerror_rl(num, ebuf, sizeof(ebuf), locale) != 0) + if (__strerror_rl(num, ebuf, sizeof(ebuf), locale) != 0) errno = EINVAL; return (ebuf); } @@ -138,7 +138,7 @@ strerror(int num) { static char ebuf[NL_TEXTMAX]; - if (strerror_rl(num, ebuf, sizeof(ebuf), __get_locale()) != 0) + if (__strerror_rl(num, ebuf, sizeof(ebuf), __get_locale()) != 0) errno = EINVAL; return (ebuf); } From nobody Tue Apr 30 00:50:22 2024 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 4VT1np2J97z5HkBF; Tue, 30 Apr 2024 00:50: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 4VT1np1Xxsz4Nrg; Tue, 30 Apr 2024 00:50:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714438222; 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=2IJsOZJwolqGSodJuMklcNsMGRQAFoTGxUmbsOnW7k8=; b=rOl9LIgieBSKrOk4OjF4WrWCE4wLVnTmeij6worxCedt2VVGIzKBxlxjINJviKKXVAdbH8 0k0QJPFri9oOqwuX21OswlTrKV50617daCQqF080UwpCVop8gcuXnFH8eid9OEFDfDo79T HgsZGBmqxquUbh28a7EAeMct9POkTbSI7vLMysN9AlqGP4tTGKUL5ZRvD/wo5RHqkVMWSl vS7XSXYvVW1UICz9Csrs46gMb1TjuHp9k0KUkoD3DlsuOJyr6jcp/2Z2bVwU+3xE7w3lIP prevWN47P/1VzHShFDt4p2vwXAserMsQhSzOV+VDJFoki2tR64q+ozDoq3D/jw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714438222; a=rsa-sha256; cv=none; b=MvQto1Ld3HEMrMUw7DwrFV2KepKnsuUIkrSQ1AiQ3IrOgJfd7qQh/yo14seR/1hdgOWj7l 4TqRe4xlBVZqxaL2nVgn67liW1FRnoaA8Pj8ahF8Z2hdZPsTzUpDOkckdiDRHjRZsPrF2v ASjwRErqEobyJSMw2aLBn6mV/TB8FkNjFyhEc850HO+Ow3qAr2Nzs4YjVXWAnsOfJEW0R0 x7/r5y7I82uuIK00bnRkcmUKG7fp4jmRFiggx7TS4ji6ycodYKrbx+ZPwoDccVsbD5/x64 abI5lb3Trwo3Cz4ZRg+1ga4JFqfMX5r42ziu2HybGkMsOR99YYpHb2auLva1rw== 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=1714438222; 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=2IJsOZJwolqGSodJuMklcNsMGRQAFoTGxUmbsOnW7k8=; b=uWN4YNwuf86zGJpJp6DRnVGTsbyLWD31qSczDCUzThbr9WxwW0vBRDt4+L/4DELKiFFgEO haT3XQKZaasWmYKgJntV3GnVyiWAHE7hgS3w/rQr20pUneawkIg0Y5N7EfA14nlvAsuXmN 640PFCPnl5EupNQbwOgjMlYv/wuIF7cmcjbrsjWUj5z00ZXQe+325f3hSf+Dw36u89NIdh NGTWtBDejzNYFKX/dBkTgSqK7rePMhk9t/kMQoa9k1vRzz0wdkn/QMz0pbu5nntzwTyHKU JGCoOZy9FZVLqO9GsfpUP/h5XBzgS6/oocgcfrp5DbuoHHbosAXwvBoWfPqeCg== 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 4VT1np17btz1STj; Tue, 30 Apr 2024 00:50: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 43U0oM8X022166; Tue, 30 Apr 2024 00:50:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43U0oM92022163; Tue, 30 Apr 2024 00:50:22 GMT (envelope-from git) Date: Tue, 30 Apr 2024 00:50:22 GMT Message-Id: <202404300050.43U0oM92022163@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: 27e54c9f1628 - stable/13 - __vprintf(): switch from strerror() to strerror_rl() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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: 27e54c9f162879fcbf6f1d9dc221b98c8180f012 Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=27e54c9f162879fcbf6f1d9dc221b98c8180f012 commit 27e54c9f162879fcbf6f1d9dc221b98c8180f012 Author: Konstantin Belousov AuthorDate: 2024-04-23 17:10:30 +0000 Commit: Konstantin Belousov CommitDate: 2024-04-30 00:49:53 +0000 __vprintf(): switch from strerror() to strerror_rl() PR: 278556 (cherry picked from commit f887667694632c829b0599b54ff86a072e93df87) --- lib/libc/stdio/vfprintf.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/libc/stdio/vfprintf.c b/lib/libc/stdio/vfprintf.c index ad655c5d78d4..e656a2707d3a 100644 --- a/lib/libc/stdio/vfprintf.c +++ b/lib/libc/stdio/vfprintf.c @@ -316,6 +316,8 @@ __vfprintf(FILE *fp, locale_t locale, const char *fmt0, va_list ap) int width; /* width from format (%8d), or 0 */ int prec; /* precision from format; <0 for N/A */ int saved_errno; + int error; + char errnomsg[NL_TEXTMAX]; char sign; /* sign prefix (' ', '+', '-', or \0) */ struct grouping_state gs; /* thousands' grouping info */ @@ -777,7 +779,9 @@ fp_common: break; #endif /* !NO_FLOATING_POINT */ case 'm': - cp = strerror(saved_errno); + error = __strerror_rl(saved_errno, errnomsg, + sizeof(errnomsg), locale); + cp = error == 0 ? errnomsg : ""; size = (prec >= 0) ? strnlen(cp, prec) : strlen(cp); sign = '\0'; break; From nobody Tue Apr 30 00:50:23 2024 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 4VT1nq3VZxz5HkR5; Tue, 30 Apr 2024 00:50: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 4VT1nq2Ymwz4Nv8; Tue, 30 Apr 2024 00:50:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714438223; 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=AD21n0Ezco7N4CjQfvszgLfTg0cVbq6qBtTZkWZoupQ=; b=cLIT4KmbfxRYt+7iOLBEoAoy9szpJJRJc9V8lXrOuILAq7UOXJ4oxA2GqwQWX61BsIM7uf t7WAqSiQ8sdKgXZJy/1Fo8N8cE05i6P25MXC0rmVRsezg4GlmvPlto6zqLM0cC/RBo1qsf gCkWWB1BrKX4CqZ1pO9KTCdfjPrBIiTYgydy4OULl6+mZP4ciY4iBRWl9FqKdZBrLFzaG2 H9f+EKYPBb9mP61J66Wbv9dPZMeSOoiT+OkclR2Uoq+w/vJxwiOZlkWn2765WkpNzs64Ee JPd4qiDSOPL3qlGIRE7/JCfztU+GCgvRpxzLMKzVIiN+XT9HSwscE8TAhe9THQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714438223; a=rsa-sha256; cv=none; b=iINt01nteuurheRdcakWJfd2hisQNfIm6Whzm7TalcWAzMbdUFopi45B2uAKUOBym4sy6y Gibn3Q1JFr9zrfyu1Wz1XmOEvSbQFSLutui5WlkZIrp/Xapew7oJ1wx/XjGY39xSh3H+Ch qgDCp/53zAhtkMyO7zhGK38RyztRcMWB5ELs4mjcA91lhxkwVpI+dPmeiBoRm0v3aPVZBk oapTjMmGvhV00/BZsY7CaAwRdoSPkJcpF7zS+wpvpaMiFVAuHOc8u4nPZpEtR2+EktrK7y VJnYcFl6Z++8obIPHniVOMYIzdUpmD9daYtPKTyBV57rr9tK99M+0SBmnPP+3A== 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=1714438223; 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=AD21n0Ezco7N4CjQfvszgLfTg0cVbq6qBtTZkWZoupQ=; b=sqvGZP2CgIw1xG9NgflLvSaX5oxmt7APuHm+mW9cw3qigRpusZnBj/ABM0ylPvncEo9v2s V4V/gvRQoU0LyQtZxA9lsS0Avv3UFminGaypRttIp3nf2aCWi+LqPRia1KzhCmCf/WiIGM pHcw+b8DPH4sX/ixPQBtzxvWtQrBAq5T/NRzI9iAlDzqqafmFmT8yE1rfnbI1rK/Co/9jY vaG2tymDWPLrSvNsZ80V9k+9HZo1rLacPfMl0wtf6wHH+u+rsPvzKG5ZGsMnEK5OTxq6Qf U93VCylLbQLQSqHn3vOQT7AJJwhsMfBhQus/wKu3K3f3ohHo4eQ4m7zaWIiveA== 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 4VT1nq27kHz1SJ6; Tue, 30 Apr 2024 00:50: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 43U0oN9x022212; Tue, 30 Apr 2024 00:50:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43U0oNJJ022209; Tue, 30 Apr 2024 00:50:23 GMT (envelope-from git) Date: Tue, 30 Apr 2024 00:50:23 GMT Message-Id: <202404300050.43U0oNJJ022209@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: fcac864ee14b - stable/13 - libc: minor style, wrap long lines List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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: fcac864ee14bfd6f332678974e574bb766d97796 Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=fcac864ee14bfd6f332678974e574bb766d97796 commit fcac864ee14bfd6f332678974e574bb766d97796 Author: Konstantin Belousov AuthorDate: 2024-04-23 17:14:34 +0000 Commit: Konstantin Belousov CommitDate: 2024-04-30 00:49:53 +0000 libc: minor style, wrap long lines (cherry picked from commit bac9d7e8f2931149815c3d5a9ab69594bbdffde6) --- lib/libc/stdio/xprintf_errno.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/libc/stdio/xprintf_errno.c b/lib/libc/stdio/xprintf_errno.c index db897328f0fe..c63a7afd35e0 100644 --- a/lib/libc/stdio/xprintf_errno.c +++ b/lib/libc/stdio/xprintf_errno.c @@ -38,7 +38,8 @@ #include "printf.h" int -__printf_arginfo_errno(const struct printf_info *pi __unused, size_t n, int *argt) +__printf_arginfo_errno(const struct printf_info *pi __unused, size_t n, + int *argt) { assert(n >= 1); @@ -47,7 +48,8 @@ __printf_arginfo_errno(const struct printf_info *pi __unused, size_t n, int *arg } int -__printf_render_errno(struct __printf_io *io, const struct printf_info *pi __unused, const void *const *arg) +__printf_render_errno(struct __printf_io *io, const struct printf_info *pi + __unused, const void *const *arg) { int ret, error; char buf[64]; From nobody Tue Apr 30 00:50:24 2024 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 4VT1nr4JWPz5HkJY; Tue, 30 Apr 2024 00:50: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 4VT1nr3Zqmz4NvJ; Tue, 30 Apr 2024 00:50:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714438224; 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=zFBincSzCz6tlpBYp1f4h/it5CUvk/vtUSKiz2vAzPc=; b=UOL1d2Sn8ZZ4STYAoLSq0Cv6SL7bIvEYaCT1EuNjz3+Uq5SdImXEMC26gJN/uKu2wZVc8T nvr+ASjCkp8FYW6xJgDtGAeJJNGlk/wj+y2zW75y0WPciGC+H68FZzTqCNttPrSWhO9+wO H5+vafV50XskYJ/4oHESAcknfpB6h4Dgmvm9wxiKlO1/yTZ4A23WMsiifTOPdOCQOuNnzL cF54x88Wb5w6PBK/ANuXzEvT6bKsgGBLnnMo+Ge39Fh/sfFcIWEBX/P2bpL9EGdJgv8i2q nfsYQvXbYkVAVjSKWEvfbOHgnUQT4cB8V4JPBB7dCreBVFeXCvXHz9FoXMoWgA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714438224; a=rsa-sha256; cv=none; b=rlXX+cHiLU5LtJesXcRKfNhl4Gb7JK4vTd+1TrfP0KTzOB2HckqULX5oQ30E7tyxGdR9Ld IJ5tz/aVxTArSJxHuS01vnHPHn3tianf3h9Apm7un4r1MxNKTWrXsU1/dbwr+8XkBcjW9O dpS6Xrtrlc9h2dF2fqqRT+tnlvEUd74jQ3mJ0YJPCOxz198E2kzqb9SB/+1+e4J54ugpKP JTbjzRWTUtFzhhYBmr5DCfgB1rNEA0qCbwOVGzdchdPQ5aaD3Q0ipjTNSze7MjMl5Cbq5H Q46DKqOk1NhZIVbVXlFUybcL9ETslBI4grv1bh04702P8a6MN6LTI92A2AHcmA== 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=1714438224; 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=zFBincSzCz6tlpBYp1f4h/it5CUvk/vtUSKiz2vAzPc=; b=NyiWLTE30luL8nSKe8GVyX6TEEu8yp1e7VvGFj23rx+ZOnXuJamEPgmRxFZasUBLBpP/Pu 3guNDNZ9LSdg2sle8eETEiG1g+PljgFNbcRsTHm3bBj/BRIsszFZSVBMb0In2I77ZL06qa t3Vnh2pNJXgNaN2pkY4P2ie4uO2aMxL0aMoWux9X/WZNJOIRP2Uhp4gB3K7nR3OaZwWGG2 vXz8PHLWuj3cbveLBI0e5NyfhZqLtJNxWiMytMRFqNPzuzU+YnvZHLf8XmGMWTJ5XByjjZ FHZG/TRCYa5cCMT27TFAlUpnt6LzkAbyIw4KNucPw+9b1CNbNWZTFMMpM+byWg== 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 4VT1nr38Ywz1SSf; Tue, 30 Apr 2024 00:50: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 43U0oOXl022258; Tue, 30 Apr 2024 00:50:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43U0oO11022255; Tue, 30 Apr 2024 00:50:24 GMT (envelope-from git) Date: Tue, 30 Apr 2024 00:50:24 GMT Message-Id: <202404300050.43U0oO11022255@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: f0e8600d71e0 - stable/13 - libc printf_render_errno(): do not use strerror() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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: f0e8600d71e0a39480bdad08b6237c6d20ab1ae2 Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=f0e8600d71e0a39480bdad08b6237c6d20ab1ae2 commit f0e8600d71e0a39480bdad08b6237c6d20ab1ae2 Author: Konstantin Belousov AuthorDate: 2024-04-23 17:15:22 +0000 Commit: Konstantin Belousov CommitDate: 2024-04-30 00:49:53 +0000 libc printf_render_errno(): do not use strerror() (cherry picked from commit aa66995b4c804cbb579f71645d97fe282a798bfc) --- lib/libc/stdio/xprintf_errno.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/libc/stdio/xprintf_errno.c b/lib/libc/stdio/xprintf_errno.c index c63a7afd35e0..f1e5421f60c8 100644 --- a/lib/libc/stdio/xprintf_errno.c +++ b/lib/libc/stdio/xprintf_errno.c @@ -27,6 +27,7 @@ */ #include +#include #include #include #include @@ -53,13 +54,13 @@ __printf_render_errno(struct __printf_io *io, const struct printf_info *pi { int ret, error; char buf[64]; - const char *p; + char errnomsg[NL_TEXTMAX]; ret = 0; error = *((const int *)arg[0]); if (error >= 0 && error < __hidden_sys_nerr) { - p = strerror(error); - return (__printf_out(io, pi, p, strlen(p))); + strerror_r(error, errnomsg, sizeof(errnomsg)); + return (__printf_out(io, pi, errnomsg, strlen(errnomsg))); } sprintf(buf, "errno=%d/0x%x", error, error); ret += __printf_out(io, pi, buf, strlen(buf)); From nobody Tue Apr 30 01:15:13 2024 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 4VT2LT1qqSz5Hn12; Tue, 30 Apr 2024 01:15:13 +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 4VT2LT1Mvcz4Th5; Tue, 30 Apr 2024 01:15:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714439713; 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=+2fbXoRu3wzjHx5jS/Ju8DCicliXsEUlv1Qt4eBxaGk=; b=qHiRd2tau0l/OqQfPlHrDZAy6ac2kAIIuzXCKXJ3QfZttFLaNSJJs8zEXIZ6xH5B+Loxuc IrXK8KjOgCMiAhweIuUPg5RP45Y4z5/VwZzb+FIn93LyKwS7Ko2OggIttjglaqweXTgQHS 6aHkIEngeqLpsoC8yiv71slg55h2Nn5/E2scQpS8yfCRoYOrd1uFa0OARC/KHzGOMtv2H7 CagtDwEVR5zI6sWsCEX5GKpJTxURlQcyWg0bV/zZy/Jktl8iInXyVTFI8YZ7OBDye5sGqQ awOwyhFMF1U1N2tmqXcw5cgyMk0Ka9F7Q5Okx2ixiyfyrpyRec+M7PRAoHDTuA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714439713; a=rsa-sha256; cv=none; b=sT2R60LJtXGl3ckkO2CHkB+7oRrw5ou7ZTX6FqulIn8XeiPi/aOilCUtSQmpo7m+mLAVgJ ZX6/Eng+2Ajqy+V4I7UB1K8NwkKLp1nbyv3Jvtv2qC4ivPwG4p6wT5uXkp9ibBCHfhwalh 81qCrd5IKl/L7azZ2waVatIeGnNTZwGzpDIdA0lhhAFmMnjqU0I7ow7+OmcF0YJeOu2mhg l62CWIo/qiUPQ3IDSAqT2pPsiT/+lQG5JE/XjIN6vMudqVFQWJZ2J0GftCYs++7roFixU5 Dtu5LGSomlH2aIEL6GBgLQAScr+wtBtt/xknWzuLRVGfbX10LLnvJ4RVT4v+NA== 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=1714439713; 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=+2fbXoRu3wzjHx5jS/Ju8DCicliXsEUlv1Qt4eBxaGk=; b=AU4y+FylXkOSFCjaXPTNZDZX1s02Ot5D/zp5NcaKlChIwAGzMAI/beBRVGyvw60LmHGmBV dv5QUFh9/I0ay2WoSOw6BKSYd0kSY+jxJQO2k/1UB470pcR5UkL7l0gadJ4NkTRPtMztTM 48c8bi50sy16ZraCqq0vMBCL3g5P5CJOQsE8rp3vBGK8LsqjDXMd0599dXtzebsfKjAb7M jr0yI5OXYIj6EzT57SVf96enEGwyIZDnIOSnYfZBLwLN0IuVEfblBb9mMhp3SkFiu8+uOx vMYaahY4k+TWJKNH1cRKdfS1S7VNrKfbuseWCsdUy6Q39OISdNko4DbEcal7sw== 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 4VT2LT0z9XzF39; Tue, 30 Apr 2024 01:15: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 43U1FD08064456; Tue, 30 Apr 2024 01:15:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43U1FDVs064453; Tue, 30 Apr 2024 01:15:13 GMT (envelope-from git) Date: Tue, 30 Apr 2024 01:15:13 GMT Message-Id: <202404300115.43U1FDVs064453@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: a951992d1eb3 - stable/14 - libc_private.h: use private namespace name for size_t List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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: a951992d1eb332ed1e97ef6b89ead3f05707adc2 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=a951992d1eb332ed1e97ef6b89ead3f05707adc2 commit a951992d1eb332ed1e97ef6b89ead3f05707adc2 Author: Konstantin Belousov AuthorDate: 2024-04-30 01:14:02 +0000 Commit: Konstantin Belousov CommitDate: 2024-04-30 01:14:52 +0000 libc_private.h: use private namespace name for size_t This is direct commit to stable/14. --- lib/libc/include/libc_private.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libc/include/libc_private.h b/lib/libc/include/libc_private.h index 22467a211df6..e051961712ec 100644 --- a/lib/libc/include/libc_private.h +++ b/lib/libc/include/libc_private.h @@ -444,7 +444,7 @@ struct __nl_cat_d; struct _xlocale; struct __nl_cat_d *__catopen_l(const char *name, int type, struct _xlocale *locale); -int __strerror_rl(int errnum, char *strerrbuf, size_t buflen, +int __strerror_rl(int errnum, char *strerrbuf, __size_t buflen, struct _xlocale *locale); #endif /* _LIBC_PRIVATE_H_ */ From nobody Tue Apr 30 01:16:30 2024 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 4VT2My5fk8z5Hn8C; Tue, 30 Apr 2024 01:16: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 4VT2My4ykSz4V4C; Tue, 30 Apr 2024 01:16:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714439790; 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=HubFnfWAklQWeyQZ+166GpUBia1ghTemt8fEF2i3TG0=; b=JcamGOqVJfmPM8uq9LsMfjdiJTxwjeAwpWsHoIL372L6PX4tsKyf+Z8+pxUeR9VrS5Ol0/ cmZw8U9x2Ug0G2ShGkmrH9U+FlRSQgfe8oyAmHj6yd6a13Gj+DKvcEapSfWgusyYkt3YmP 8tK7Q6qB3lSwkGj0ucAscNvr9Nv1ZW6Zk9CDvQVMv5N8V33LyUFqUzus26zmV8PyFJgV+d YE+0P5gM9ag2ByB6WFBLNnb0IY0yElm8Oji1kaDflC6Uk83RKogsWYQS9+8+Q+ci0KG/SD rhQ8PeoxgQ2kAjQBSDISCzPZpWPuiUs9EugOSlnOW7A/cgbbdHb5bjUstP3i5A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714439790; a=rsa-sha256; cv=none; b=aBO2/7qfrgkHrAxtaRwnQf5y0mkjSgO1ENxPQD9sXAYV5WouFfSFUyljkEPAZYgSVJtuXj IGFotbP/ViNsmUvLbwhJTdeJ5kwJR8LFV2jmoUbMVCcS9G+4LRMoQpeU5vinpDcymUrs8M NPLTDebbAOlnDPZPeRwRiX4NIXnpDK/oSs1Y5xay471+F1ZUrODstWdQG2fu4pJ9ipbFBY O2OOJhHYZ26CHRdloFFGI3mzD7Vzw1YU7zIaZUh4g8IMeUxHIwGEWsCdoq5Q1V2wAXJYto mqfpUci39y3BxgeFpy+2HtqkIEBXiemwosgTQxn0ymcv0neXnhOXNSzs9LY5nA== 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=1714439790; 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=HubFnfWAklQWeyQZ+166GpUBia1ghTemt8fEF2i3TG0=; b=ipsqLPv3SE3iEWGc5GN+B2VYGNw9aqfWLsdMYmSA39rot4WtwOrvktxWE5lNmtjYbIXws1 WHlR0TZtqmpTf8IB+3KqqypmMABPLt/s5nRyKuvE1O+9DnnX/i9dtH4PNSLYZlBz+/xC5q Pl4NKHjOYIwTkpl/ujGn9hntdqI5g+k5m/l3Td3LRkdVVvizewxdYNIlki4268rUWi9Ztf 78xVAnShMP7wLUimHIVF7S7tUSKpdjATFDdOvlDr3PPWzDhkmekhN7Qho7Tv24MxQDb2ht fg2mdOSZjC/pZrZ2trCrigUNbgc1IkUE5xiUgE2PqBwVcHtbIaonlVJA6Ad68A== 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 4VT2My4YvqzF97; Tue, 30 Apr 2024 01:16: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 43U1GU2S064681; Tue, 30 Apr 2024 01:16:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43U1GUuc064678; Tue, 30 Apr 2024 01:16:30 GMT (envelope-from git) Date: Tue, 30 Apr 2024 01:16:30 GMT Message-Id: <202404300116.43U1GUuc064678@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: 509819691cb8 - stable/13 - libc_private.h: use private namespace name for size_t List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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: 509819691cb8d2f62ec9f14fe84928872ceb126e Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=509819691cb8d2f62ec9f14fe84928872ceb126e commit 509819691cb8d2f62ec9f14fe84928872ceb126e Author: Konstantin Belousov AuthorDate: 2024-04-30 01:14:02 +0000 Commit: Konstantin Belousov CommitDate: 2024-04-30 01:15:47 +0000 libc_private.h: use private namespace name for size_t This is direct commit to stable/13. (cherry picked from commit a951992d1eb332ed1e97ef6b89ead3f05707adc2) --- lib/libc/include/libc_private.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libc/include/libc_private.h b/lib/libc/include/libc_private.h index 34aa50d0f12d..b2ad24ff33f2 100644 --- a/lib/libc/include/libc_private.h +++ b/lib/libc/include/libc_private.h @@ -453,7 +453,7 @@ struct __nl_cat_d; struct _xlocale; struct __nl_cat_d *__catopen_l(const char *name, int type, struct _xlocale *locale); -int __strerror_rl(int errnum, char *strerrbuf, size_t buflen, +int __strerror_rl(int errnum, char *strerrbuf, __size_t buflen, struct _xlocale *locale); #endif /* _LIBC_PRIVATE_H_ */ From nobody Tue Apr 30 07:56:15 2024 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 4VTCFC6QdVz5JSB0; Tue, 30 Apr 2024 07:56: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 4VTCFC6B8vz41Sl; Tue, 30 Apr 2024 07:56:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714463775; 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=y4cI6ImHEnSCyh41AU4bTdCXaholZ3r4RbcsVTnzQRs=; b=cF3c89aZRP7J+DMMakm6Y6SUyHeFCFwnBzw6Abt9zA+hEsl8qVFWrJihqZwLeTxiBgCfe7 kYU7dQ0Mz6NXA/BzOIOtB1gX5xe2PXyi+wWota3lak4I/h5xvjPf9Z23V5bGILK/zdGbgx AA10dWtntFLSg6BFHNyt948BM6tel4gqaVZAR8t2BE3QfsLrA9Nk6xSBVW/bG1mYS29MTM OI0L+PUEwB6+VRb+9w4mP9svLDXfzAuN+P1OPJToUQezG1HkRgfinVlF2jVP6f2nRdf1ET nrzikbV7k7877rFhG7bWoXtDPhanDmD3Y33vkum4wtW6wKMa+W5+8lQwJw9y2w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714463775; a=rsa-sha256; cv=none; b=eIhZMtySHEswF1POC+4tETiBhy34sI2vMKB71VzlvLYESbqsdvxTqzkfL0Qe24D123SUxK 7b3mxc9yH48C9JRl3VpFfrec2cbvXNXdhoPP4VfWOp/cWdgEqn5msodluSlvMEOVqCO/xK ZoFoBSnuetw5qhYpXm4YoRTx84NifCQd01xeGzhrUS481B7ByT4XqWACv9TktUcXm4tKXL rBSX8kxl1//5RuJNVqWDsHp3RFlG2xboHv1tJPKfalT4Hnm1IXlolbqkBNDUMKm3swuFEk cZp8riThhhG1Hurao25Jw/wehdJeraebN07E3O3y5AstsOdDNm7ePApB3Iee6A== 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=1714463775; 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=y4cI6ImHEnSCyh41AU4bTdCXaholZ3r4RbcsVTnzQRs=; b=hg+oJYzNHoM7kwyWsvkSNa4mFdFKP6/0F17bu06hkCf+JsfBU9389bAZdma6ePqxIWx7ZR xdc7ZHYyABXNLamPE/BvDKAbs23jw0KAoLaTt4fitxGa8Q8swG1ipz/dH89y+u9C0fRU1/ l4ynWvsnCel9jHVPOluVPCJO7pz3qguWwHxnuCZkdGvX/wIgeWUzeUS4rr4YOyy/lZj4Ft 11d30cWIFFdcEfgbMbIuVt5xAYSO/7BKrPGhHv4Q4TkPUrfFt+MGbKIJ+N1NSo9y3gUIf0 kx+C39VtoFHJkfS7d78L0KtQu8LLDGgr1VBVh4qienY0Mz2/ruD8vdM1qWKweA== 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 4VTCFC5msCzRWq; Tue, 30 Apr 2024 07:56: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 43U7uFij041850; Tue, 30 Apr 2024 07:56:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43U7uFtC041847; Tue, 30 Apr 2024 07:56:15 GMT (envelope-from git) Date: Tue, 30 Apr 2024 07:56:15 GMT Message-Id: <202404300756.43U7uFtC041847@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Martin Matuska Subject: git: d2539274f402 - stable/14 - libarchive: merge from vendor branch List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d2539274f402248ae5091f0488af61059e1ca48f Auto-Submitted: auto-generated The branch stable/14 has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=d2539274f402248ae5091f0488af61059e1ca48f commit d2539274f402248ae5091f0488af61059e1ca48f Author: Martin Matuska AuthorDate: 2024-04-16 21:39:31 +0000 Commit: Martin Matuska CommitDate: 2024-04-30 06:46:59 +0000 libarchive: merge from vendor branch Libarchive 3.7.3 New features: #1941 uudecode filter: support file name and file mode in raw mode #1943 7-zip reader: translate Windows permissions into UNIX permissions #1962 zstd filter now supports the "long" write option #2012 add trailing letter b to bsdtar(1) substitute pattern #2031 PCRE2 support #2054 add support for long options "--group" and "--owner" to tar(1) Security fixes: #2101 Fix possible vulnerability in tar error reporting introduced in f27c173 Important bugfixes: #1974 ISO9660: preserve the natural order of links #2105 rar5: fix infinite loop if during rar5 decompression the last block produced no data #2027 xz filter: fix incorrect eof at the end of an lzip member #2043 zip: fix end-of-data marker processing when decompressing zip archives (cherry picked from commit b9128a37faafede823eb456aa65a11ac69997284) --- contrib/libarchive/.editorconfig | 18 - contrib/libarchive/.github/workflows/cifuzz.yml | 24 - contrib/libarchive/NEWS | 4 + .../build/autoconf/m4_ax_compile_check_sizeof.m4 | 115 -- contrib/libarchive/cat/bsdcat.1 | 2 - contrib/libarchive/cat/bsdcat.c | 36 +- contrib/libarchive/cat/bsdcat.h | 7 - contrib/libarchive/cat/bsdcat_platform.h | 24 +- contrib/libarchive/cat/cmdline.c | 1 - contrib/libarchive/cat/test/test.h | 2 - contrib/libarchive/cpio/bsdcpio.1 | 2 - contrib/libarchive/cpio/cmdline.c | 1 - contrib/libarchive/cpio/cpio.c | 17 +- contrib/libarchive/cpio/cpio.h | 2 - contrib/libarchive/cpio/cpio_platform.h | 18 +- contrib/libarchive/cpio/test/test.h | 2 - contrib/libarchive/cpio/test/test_0.c | 1 - contrib/libarchive/cpio/test/test_basic.c | 1 - contrib/libarchive/cpio/test/test_cmdline.c | 1 - contrib/libarchive/cpio/test/test_extract_cpio_Z.c | 1 - .../libarchive/cpio/test/test_extract_cpio_bz2.c | 1 - .../libarchive/cpio/test/test_extract_cpio_grz.c | 1 - .../libarchive/cpio/test/test_extract_cpio_gz.c | 1 - .../libarchive/cpio/test/test_extract_cpio_lrz.c | 1 - .../libarchive/cpio/test/test_extract_cpio_lz.c | 1 - .../libarchive/cpio/test/test_extract_cpio_lz4.c | 1 - .../libarchive/cpio/test/test_extract_cpio_lzma.c | 1 - .../libarchive/cpio/test/test_extract_cpio_lzo.c | 1 - .../libarchive/cpio/test/test_extract_cpio_xz.c | 1 - .../libarchive/cpio/test/test_extract_cpio_zstd.c | 1 - contrib/libarchive/cpio/test/test_format_newc.c | 1 - contrib/libarchive/cpio/test/test_gcpio_compat.c | 1 - .../cpio/test/test_gcpio_compat_ref.bin.uu | 1 - .../cpio/test/test_gcpio_compat_ref.crc.uu | 1 - .../cpio/test/test_gcpio_compat_ref.newc.uu | 1 - .../cpio/test/test_gcpio_compat_ref.ustar.uu | 1 - contrib/libarchive/cpio/test/test_missing_file.c | 1 - contrib/libarchive/cpio/test/test_option_0.c | 1 - contrib/libarchive/cpio/test/test_option_B_upper.c | 2 - contrib/libarchive/cpio/test/test_option_C_upper.c | 2 - contrib/libarchive/cpio/test/test_option_J_upper.c | 1 - contrib/libarchive/cpio/test/test_option_L_upper.c | 1 - contrib/libarchive/cpio/test/test_option_Z_upper.c | 1 - contrib/libarchive/cpio/test/test_option_a.c | 1 - .../libarchive/cpio/test/test_option_b64encode.c | 1 - contrib/libarchive/cpio/test/test_option_c.c | 1 - contrib/libarchive/cpio/test/test_option_d.c | 2 - contrib/libarchive/cpio/test/test_option_f.c | 1 - contrib/libarchive/cpio/test/test_option_f.cpio.uu | 1 - contrib/libarchive/cpio/test/test_option_grzip.c | 1 - contrib/libarchive/cpio/test/test_option_help.c | 1 - contrib/libarchive/cpio/test/test_option_l.c | 1 - contrib/libarchive/cpio/test/test_option_lrzip.c | 1 - contrib/libarchive/cpio/test/test_option_lz4.c | 1 - contrib/libarchive/cpio/test/test_option_lzma.c | 1 - contrib/libarchive/cpio/test/test_option_lzop.c | 1 - contrib/libarchive/cpio/test/test_option_m.c | 2 - contrib/libarchive/cpio/test/test_option_m.cpio.uu | 1 - .../libarchive/cpio/test/test_option_passphrase.c | 1 - contrib/libarchive/cpio/test/test_option_t.c | 1 - contrib/libarchive/cpio/test/test_option_t.cpio.uu | 1 - .../libarchive/cpio/test/test_option_t.stdout.uu | 1 - .../libarchive/cpio/test/test_option_tv.stdout.uu | 1 - contrib/libarchive/cpio/test/test_option_u.c | 1 - .../libarchive/cpio/test/test_option_uuencode.c | 1 - contrib/libarchive/cpio/test/test_option_xz.c | 1 - contrib/libarchive/cpio/test/test_option_y.c | 1 - contrib/libarchive/cpio/test/test_option_z.c | 1 - contrib/libarchive/cpio/test/test_option_zstd.c | 1 - contrib/libarchive/cpio/test/test_owner_parse.c | 1 - .../libarchive/cpio/test/test_passthrough_dotdot.c | 1 - .../cpio/test/test_passthrough_reverse.c | 1 - contrib/libarchive/libarchive/archive.h | 10 +- contrib/libarchive/libarchive/archive_acl.c | 1 - .../libarchive/libarchive/archive_acl_private.h | 2 - .../libarchive/libarchive/archive_check_magic.c | 20 +- contrib/libarchive/libarchive/archive_cmdline.c | 2 - .../libarchive/archive_cmdline_private.h | 2 - contrib/libarchive/libarchive/archive_crc32.h | 2 - contrib/libarchive/libarchive/archive_cryptor.c | 4 +- contrib/libarchive/libarchive/archive_digest.c | 2 +- contrib/libarchive/libarchive/archive_endian.h | 2 - contrib/libarchive/libarchive/archive_entry.3 | 2 - contrib/libarchive/libarchive/archive_entry.c | 30 +- contrib/libarchive/libarchive/archive_entry.h | 8 +- .../libarchive/archive_entry_copy_stat.c | 1 - .../libarchive/archive_entry_link_resolver.c | 1 - .../libarchive/libarchive/archive_entry_locale.h | 2 - .../libarchive/libarchive/archive_entry_private.h | 6 +- .../libarchive/libarchive/archive_entry_sparse.c | 1 - contrib/libarchive/libarchive/archive_entry_stat.c | 1 - .../libarchive/libarchive/archive_entry_strmode.c | 1 - contrib/libarchive/libarchive/archive_entry_time.3 | 2 - .../libarchive/libarchive/archive_entry_xattr.c | 1 - contrib/libarchive/libarchive/archive_getdate.c | 4 - contrib/libarchive/libarchive/archive_getdate.h | 2 - contrib/libarchive/libarchive/archive_match.c | 1 - contrib/libarchive/libarchive/archive_options.c | 1 - .../libarchive/archive_options_private.h | 2 - contrib/libarchive/libarchive/archive_pack_dev.c | 7 - contrib/libarchive/libarchive/archive_pathmatch.c | 1 - contrib/libarchive/libarchive/archive_pathmatch.h | 2 - contrib/libarchive/libarchive/archive_platform.h | 15 - .../libarchive/libarchive/archive_platform_acl.h | 2 - .../libarchive/libarchive/archive_platform_xattr.h | 2 - contrib/libarchive/libarchive/archive_private.h | 12 +- contrib/libarchive/libarchive/archive_random.c | 3 +- contrib/libarchive/libarchive/archive_read.3 | 2 - contrib/libarchive/libarchive/archive_read.c | 1 - .../libarchive/archive_read_add_passphrase.3 | 2 - .../libarchive/archive_read_add_passphrase.c | 1 - .../libarchive/archive_read_append_filter.c | 1 - contrib/libarchive/libarchive/archive_read_data.3 | 2 - .../libarchive/archive_read_data_into_fd.c | 1 - contrib/libarchive/libarchive/archive_read_disk.3 | 2 - .../libarchive/archive_read_disk_entry_from_file.c | 1 - .../libarchive/archive_read_disk_posix.c | 1 - .../libarchive/archive_read_disk_private.h | 2 - .../archive_read_disk_set_standard_lookup.c | 1 - .../libarchive/libarchive/archive_read_extract.3 | 2 - .../libarchive/libarchive/archive_read_extract.c | 1 - .../libarchive/libarchive/archive_read_extract2.c | 1 - .../libarchive/libarchive/archive_read_filter.3 | 2 - .../libarchive/libarchive/archive_read_format.3 | 2 - contrib/libarchive/libarchive/archive_read_free.3 | 2 - .../libarchive/libarchive/archive_read_header.3 | 2 - contrib/libarchive/libarchive/archive_read_new.3 | 2 - contrib/libarchive/libarchive/archive_read_open.3 | 2 - .../libarchive/libarchive/archive_read_open_fd.c | 1 - .../libarchive/libarchive/archive_read_open_file.c | 1 - .../libarchive/archive_read_open_filename.c | 112 +- .../libarchive/archive_read_open_memory.c | 1 - .../libarchive/libarchive/archive_read_private.h | 2 - .../libarchive/archive_read_set_format.c | 1 - .../libarchive/archive_read_set_options.3 | 2 - .../libarchive/archive_read_set_options.c | 1 - .../libarchive/archive_read_support_filter_all.c | 1 - .../archive_read_support_filter_by_code.c | 1 - .../libarchive/archive_read_support_filter_bzip2.c | 4 +- .../archive_read_support_filter_compress.c | 3 +- .../libarchive/archive_read_support_filter_grzip.c | 3 - .../libarchive/archive_read_support_filter_gzip.c | 5 +- .../libarchive/archive_read_support_filter_lrzip.c | 3 - .../libarchive/archive_read_support_filter_lz4.c | 8 +- .../libarchive/archive_read_support_filter_lzop.c | 6 +- .../libarchive/archive_read_support_filter_none.c | 1 - .../archive_read_support_filter_program.c | 1 - .../libarchive/archive_read_support_filter_rpm.c | 2 +- .../libarchive/archive_read_support_filter_uu.c | 53 +- .../libarchive/archive_read_support_filter_xz.c | 20 +- .../libarchive/archive_read_support_filter_zstd.c | 4 +- .../libarchive/archive_read_support_format_7zip.c | 83 +- .../libarchive/archive_read_support_format_all.c | 1 - .../libarchive/archive_read_support_format_ar.c | 1 - .../archive_read_support_format_by_code.c | 1 - .../libarchive/archive_read_support_format_cpio.c | 1 - .../libarchive/archive_read_support_format_empty.c | 1 - .../archive_read_support_format_iso9660.c | 6 +- .../libarchive/archive_read_support_format_mtree.c | 1 - .../libarchive/archive_read_support_format_rar.c | 2 +- .../libarchive/archive_read_support_format_rar5.c | 12 +- .../libarchive/archive_read_support_format_raw.c | 1 - .../libarchive/archive_read_support_format_tar.c | 1 - .../libarchive/archive_read_support_format_warc.c | 1 - .../libarchive/archive_read_support_format_xar.c | 3 +- .../libarchive/archive_read_support_format_zip.c | 499 ++++--- contrib/libarchive/libarchive/archive_string.c | 16 +- contrib/libarchive/libarchive/archive_string.h | 3 - .../libarchive/archive_string_composition.h | 2 - .../libarchive/libarchive/archive_string_sprintf.c | 1 - contrib/libarchive/libarchive/archive_util.3 | 2 - contrib/libarchive/libarchive/archive_util.c | 1 - .../libarchive/archive_version_details.c | 1 - contrib/libarchive/libarchive/archive_virtual.c | 1 - contrib/libarchive/libarchive/archive_write.3 | 2 - contrib/libarchive/libarchive/archive_write.c | 3 +- .../libarchive/archive_write_add_filter.c | 1 - .../archive_write_add_filter_b64encode.c | 2 - .../libarchive/archive_write_add_filter_by_name.c | 1 - .../libarchive/archive_write_add_filter_bzip2.c | 2 - .../libarchive/archive_write_add_filter_compress.c | 2 - .../libarchive/archive_write_add_filter_grzip.c | 2 - .../libarchive/archive_write_add_filter_gzip.c | 2 - .../libarchive/archive_write_add_filter_lrzip.c | 2 - .../libarchive/archive_write_add_filter_lz4.c | 2 - .../libarchive/archive_write_add_filter_lzop.c | 1 - .../libarchive/archive_write_add_filter_none.c | 1 - .../libarchive/archive_write_add_filter_program.c | 1 - .../libarchive/archive_write_add_filter_uuencode.c | 2 - .../libarchive/archive_write_add_filter_xz.c | 2 - .../libarchive/archive_write_add_filter_zstd.c | 149 +- .../libarchive/archive_write_blocksize.3 | 2 - contrib/libarchive/libarchive/archive_write_data.3 | 2 - contrib/libarchive/libarchive/archive_write_disk.3 | 2 - .../libarchive/archive_write_disk_posix.c | 1 - .../libarchive/archive_write_disk_private.h | 2 - .../archive_write_disk_set_standard_lookup.c | 1 - .../libarchive/libarchive/archive_write_filter.3 | 2 - .../libarchive/archive_write_finish_entry.3 | 2 - .../libarchive/libarchive/archive_write_format.3 | 2 - contrib/libarchive/libarchive/archive_write_free.3 | 2 - .../libarchive/libarchive/archive_write_header.3 | 2 - contrib/libarchive/libarchive/archive_write_new.3 | 2 - contrib/libarchive/libarchive/archive_write_open.3 | 2 - .../libarchive/libarchive/archive_write_open_fd.c | 1 - .../libarchive/archive_write_open_file.c | 1 - .../libarchive/archive_write_open_filename.c | 1 - .../libarchive/archive_write_open_memory.c | 1 - .../libarchive/libarchive/archive_write_private.h | 2 - .../libarchive/archive_write_set_format.c | 1 - .../libarchive/archive_write_set_format_7zip.c | 34 +- .../libarchive/archive_write_set_format_ar.c | 1 - .../libarchive/archive_write_set_format_by_name.c | 1 - .../archive_write_set_format_cpio_binary.c | 1 - .../archive_write_set_format_cpio_newc.c | 1 - .../libarchive/archive_write_set_format_cpio_odc.c | 1 - .../archive_write_set_format_filter_by_ext.c | 1 - .../libarchive/archive_write_set_format_gnutar.c | 2 - .../libarchive/archive_write_set_format_mtree.c | 1 - .../libarchive/archive_write_set_format_pax.c | 1 - .../libarchive/archive_write_set_format_private.h | 2 - .../libarchive/archive_write_set_format_shar.c | 1 - .../libarchive/archive_write_set_format_ustar.c | 2 - .../libarchive/archive_write_set_format_v7tar.c | 2 - .../libarchive/archive_write_set_format_warc.c | 1 - .../libarchive/archive_write_set_format_xar.c | 1 - .../libarchive/archive_write_set_format_zip.c | 189 ++- .../libarchive/archive_write_set_options.3 | 20 +- .../libarchive/archive_write_set_options.c | 1 - .../libarchive/archive_write_set_passphrase.3 | 2 - .../libarchive/archive_write_set_passphrase.c | 1 - contrib/libarchive/libarchive/cpio.5 | 2 - contrib/libarchive/libarchive/filter_fork.h | 2 - contrib/libarchive/libarchive/filter_fork_posix.c | 2 - contrib/libarchive/libarchive/libarchive-formats.5 | 2 - contrib/libarchive/libarchive/libarchive.3 | 2 - contrib/libarchive/libarchive/libarchive_changes.3 | 2 - .../libarchive/libarchive/libarchive_internals.3 | 2 - contrib/libarchive/libarchive/tar.5 | 2 - contrib/libarchive/libarchive/test/README | 2 - .../libarchive/libarchive/test/read_open_memory.c | 1 - contrib/libarchive/libarchive/test/test_acl_nfs4.c | 1 - contrib/libarchive/libarchive/test/test_acl_pax.c | 1 - .../libarchive/test/test_acl_platform_nfs4.c | 1 - .../libarchive/test/test_acl_platform_posix1e.c | 1 - .../libarchive/libarchive/test/test_acl_posix1e.c | 1 - contrib/libarchive/libarchive/test/test_acl_text.c | 1 - .../libarchive/test/test_archive_api_feature.c | 1 - .../libarchive/test/test_archive_clear_error.c | 1 - .../libarchive/test/test_archive_cmdline.c | 1 - .../libarchive/test/test_archive_getdate.c | 1 - .../libarchive/test/test_archive_match_owner.c | 1 - .../libarchive/test/test_archive_match_path.c | 1 - .../libarchive/test/test_archive_match_time.c | 1 - .../libarchive/test/test_archive_pathmatch.c | 1 - .../test/test_archive_read_add_passphrase.c | 1 - .../test/test_archive_read_close_twice.c | 2 - .../test/test_archive_read_close_twice_open_fd.c | 1 - .../test_archive_read_close_twice_open_filename.c | 1 - .../test/test_archive_read_multiple_data_objects.c | 5 +- .../test/test_archive_read_next_header_empty.c | 1 - .../test/test_archive_read_next_header_raw.c | 1 - .../libarchive/test/test_archive_read_open2.c | 1 - .../test/test_archive_read_set_filter_option.c | 1 - .../test/test_archive_read_set_format_option.c | 1 - .../libarchive/test/test_archive_read_set_option.c | 1 - .../test/test_archive_read_set_options.c | 1 - .../libarchive/test/test_archive_read_support.c | 1 - .../libarchive/test/test_archive_set_error.c | 1 - .../libarchive/test/test_archive_string.c | 3 +- .../test/test_archive_string_conversion.c | 4 +- .../test/test_archive_string_conversion.txt.Z.uu | 1 - .../test/test_archive_write_add_filter_by_name.c | 4 +- .../test/test_archive_write_set_filter_option.c | 1 - .../test/test_archive_write_set_format_by_name.c | 2 - .../test_archive_write_set_format_filter_by_ext.c | 2 - .../test/test_archive_write_set_format_option.c | 1 - .../test/test_archive_write_set_option.c | 1 - .../test/test_archive_write_set_options.c | 1 - .../test/test_archive_write_set_passphrase.c | 1 - contrib/libarchive/libarchive/test/test_bad_fd.c | 1 - .../libarchive/libarchive/test/test_compat_bzip2.c | 1 - .../libarchive/test/test_compat_bzip2_1.tbz.uu | 2 - .../libarchive/test/test_compat_bzip2_2.tbz.uu | 2 - .../libarchive/libarchive/test/test_compat_cpio.c | 1 - .../libarchive/test/test_compat_cpio_1.cpio.uu | 2 - .../libarchive/libarchive/test/test_compat_gtar.c | 1 - .../libarchive/test/test_compat_gtar_1.tar.uu | 1 - .../libarchive/test/test_compat_gtar_2.tar.uu | 2 +- .../libarchive/libarchive/test/test_compat_gzip.c | 1 - .../libarchive/test/test_compat_gzip_1.tgz.uu | 2 - .../libarchive/test/test_compat_gzip_2.tgz.uu | 2 - .../libarchive/libarchive/test/test_compat_lz4.c | 1 - .../libarchive/libarchive/test/test_compat_lzip.c | 85 +- .../libarchive/test/test_compat_lzip_3.lz.uu | 1461 +++++++++++++++++++ .../libarchive/test/test_compat_lzip_4.tlz.uu | 1474 ++++++++++++++++++++ .../libarchive/libarchive/test/test_compat_lzma.c | 1 - .../libarchive/test/test_compat_lzma_1.tlz.uu | 2 - .../libarchive/test/test_compat_lzma_2.tlz.uu | 2 - .../libarchive/test/test_compat_lzma_3.tlz.uu | 2 - .../libarchive/libarchive/test/test_compat_lzop.c | 1 - .../libarchive/libarchive/test/test_compat_mac.c | 1 - .../libarchive/test/test_compat_perl_archive_tar.c | 1 - .../test/test_compat_plexus_archiver_tar.c | 1 - .../test/test_compat_solaris_pax_sparse.c | 2 - .../libarchive/test/test_compat_solaris_tar_acl.c | 1 - .../libarchive/test/test_compat_star_acl.c | 1 - .../libarchive/test/test_compat_tar_directory.c | 1 - .../test/test_compat_tar_directory_1.tar.uu | 1 - .../libarchive/test/test_compat_tar_hardlink.c | 1 - .../test/test_compat_tar_hardlink_1.tar.uu | 1 - .../libarchive/test/test_compat_uudecode.c | 1 - .../libarchive/test/test_compat_uudecode_large.c | 1 - .../libarchive/libarchive/test/test_compat_xz.c | 1 - .../libarchive/test/test_compat_xz_1.txz.uu | 3 +- .../libarchive/libarchive/test/test_compat_zip.c | 1 - .../libarchive/test/test_compat_zip_1.zip.uu | 1 - .../libarchive/test/test_compat_zip_8.zip.uu | 12 +- .../libarchive/libarchive/test/test_compat_zstd.c | 2 - .../libarchive/libarchive/test/test_empty_write.c | 1 - contrib/libarchive/libarchive/test/test_entry.c | 1 - .../libarchive/test/test_entry_strmode.c | 1 - .../libarchive/test/test_extattr_freebsd.c | 1 - .../libarchive/libarchive/test/test_filter_count.c | 1 - contrib/libarchive/libarchive/test/test_fuzz.c | 1 - .../libarchive/test/test_fuzz_1.iso.Z.uu | 2 - .../test/test_gnutar_filename_encoding.c | 2 - .../libarchive/test/test_link_resolver.c | 1 - .../libarchive/libarchive/test/test_open_failure.c | 1 - contrib/libarchive/libarchive/test/test_open_fd.c | 1 - .../libarchive/libarchive/test/test_open_file.c | 1 - .../libarchive/test/test_open_filename.c | 1 - .../libarchive/test/test_pax_filename_encoding.c | 1 - .../test/test_pax_filename_encoding.tar.uu | 1 - .../libarchive/test/test_pax_xattr_header.c | 1 - .../test_rar_multivolume_single_file.part1.rar.uu | 2 +- .../test_rar_multivolume_single_file.part2.rar.uu | 2 +- .../test_rar_multivolume_single_file.part3.rar.uu | 2 +- ...ar_multivolume_uncompressed_files.part01.rar.uu | 2 +- ...ar_multivolume_uncompressed_files.part02.rar.uu | 2 +- ...ar_multivolume_uncompressed_files.part03.rar.uu | 2 +- ...ar_multivolume_uncompressed_files.part04.rar.uu | 2 +- ...ar_multivolume_uncompressed_files.part05.rar.uu | 2 +- ...ar_multivolume_uncompressed_files.part06.rar.uu | 2 +- ...ar_multivolume_uncompressed_files.part07.rar.uu | 2 +- ...ar_multivolume_uncompressed_files.part08.rar.uu | 2 +- ...ar_multivolume_uncompressed_files.part09.rar.uu | 2 +- ...ar_multivolume_uncompressed_files.part10.rar.uu | 2 +- .../libarchive/test/test_read_data_large.c | 1 - .../libarchive/libarchive/test/test_read_disk.c | 1 - .../test/test_read_disk_directory_traversals.c | 1 - .../test/test_read_disk_entry_from_file.c | 1 - .../libarchive/libarchive/test/test_read_extract.c | 1 - .../libarchive/test/test_read_file_nonexistent.c | 1 - .../test/test_read_filter_lrzip.tar.lrz.uu | 2 +- .../libarchive/test/test_read_filter_program.c | 1 - .../test/test_read_filter_program_signature.c | 1 - .../libarchive/test/test_read_filter_uudecode.c | 1 - .../test/test_read_filter_uudecode_base64_raw.uu | 11 + .../test/test_read_filter_uudecode_raw.c | 67 + .../test/test_read_filter_uudecode_raw.uu | 14 + .../libarchive/test/test_read_format_7zip.c | 81 +- .../test/test_read_format_7zip_copy.7z.uu | 2 +- .../test/test_read_format_7zip_deflate_arm64.7z.uu | 2 +- .../test/test_read_format_7zip_encryption_data.c | 1 - .../test/test_read_format_7zip_encryption_header.c | 2 - .../test_read_format_7zip_encryption_partially.c | 1 - .../test/test_read_format_7zip_lzma2_arm64.7z.uu | 2 +- .../test/test_read_format_7zip_malformed.c | 1 - .../test/test_read_format_7zip_packinfo_digests.c | 5 +- .../test/test_read_format_7zip_win_attrib.7z.uu | 10 + .../libarchive/test/test_read_format_ar.ar.uu | 2 - .../libarchive/test/test_read_format_ar.c | 2 - .../libarchive/test/test_read_format_cab.c | 1 - .../test/test_read_format_cab_filename.c | 1 - .../test_read_format_cab_filename_cp932.cab.uu | 2 +- .../libarchive/test/test_read_format_cpio_afio.c | 1 - .../libarchive/test/test_read_format_cpio_bin.c | 1 - .../libarchive/test/test_read_format_cpio_bin_Z.c | 1 - .../libarchive/test/test_read_format_cpio_bin_be.c | 1 - .../test/test_read_format_cpio_bin_be.cpio.uu | 1 - .../test/test_read_format_cpio_bin_bz2.c | 1 - .../libarchive/test/test_read_format_cpio_bin_gz.c | 1 - .../libarchive/test/test_read_format_cpio_bin_le.c | 1 - .../test/test_read_format_cpio_bin_lzip.c | 1 - .../test/test_read_format_cpio_bin_lzma.c | 1 - .../libarchive/test/test_read_format_cpio_bin_xz.c | 1 - .../test/test_read_format_cpio_filename.c | 13 +- .../test_read_format_cpio_filename_cp866.cpio.uu | 2 +- .../test_read_format_cpio_filename_eucjp.cpio.uu | 2 +- .../test_read_format_cpio_filename_koi8r.cpio.uu | 2 +- .../test_read_format_cpio_filename_utf8_jp.cpio.uu | 2 +- .../test_read_format_cpio_filename_utf8_ru.cpio.uu | 2 +- .../libarchive/test/test_read_format_cpio_odc.c | 1 - .../test/test_read_format_cpio_svr4_gzip.c | 1 - .../test/test_read_format_cpio_svr4c_Z.c | 1 - .../libarchive/test/test_read_format_empty.c | 1 - .../test/test_read_format_gtar_filename.c | 1 - .../test_read_format_gtar_filename_cp866.tar.Z.uu | 2 +- .../test_read_format_gtar_filename_eucjp.tar.Z.uu | 2 +- .../test_read_format_gtar_filename_koi8r.tar.Z.uu | 2 +- .../libarchive/test/test_read_format_gtar_gz.c | 1 - .../libarchive/test/test_read_format_gtar_lzma.c | 1 - .../libarchive/test/test_read_format_gtar_sparse.c | 2 - .../test/test_read_format_gtar_sparse_1_13.tar.uu | 1 - .../test/test_read_format_gtar_sparse_1_17.tar.uu | 1 - ...est_read_format_gtar_sparse_1_17_posix00.tar.uu | 1 - ...est_read_format_gtar_sparse_1_17_posix01.tar.uu | 1 - ...est_read_format_gtar_sparse_1_17_posix10.tar.uu | 1 - ...format_gtar_sparse_1_17_posix10_modified.tar.uu | 1 - .../test/test_read_format_gtar_sparse_skip_entry.c | 1 - ...est_read_format_gtar_sparse_skip_entry.tar.Z.uu | 2 +- .../libarchive/test/test_read_format_iso.iso.Z.uu | 2 - .../libarchive/test/test_read_format_iso_Z.c | 1 - .../test/test_read_format_iso_joliet.iso.Z.uu | 2 - .../test/test_read_format_iso_joliet_long.iso.Z.uu | 2 - .../test_read_format_iso_joliet_rockridge.iso.Z.uu | 2 - .../test/test_read_format_iso_multi_extent.c | 1 - .../test_read_format_iso_multi_extent.iso.Z.uu | 2 - .../test/test_read_format_iso_rockridge.iso.Z.uu | 2 - .../test_read_format_iso_rockridge_ce.iso.Z.uu | 2 - .../test_read_format_iso_rockridge_new.iso.Z.uu | 2 - ...est_read_format_iso_rockridge_rr_moved.iso.Z.uu | 2 - .../libarchive/test/test_read_format_iso_xorriso.c | 2 - .../test/test_read_format_iso_zisofs.iso.Z.uu | 2 - .../test/test_read_format_isojoliet_bz2.c | 1 - .../test/test_read_format_isojoliet_long.c | 7 +- .../test/test_read_format_isojoliet_rr.c | 1 - .../test/test_read_format_isojoliet_versioned.c | 1 - .../libarchive/test/test_read_format_isorr_bz2.c | 1 - .../libarchive/test/test_read_format_isorr_ce.c | 1 - .../test/test_read_format_isorr_new_bz2.c | 2 - .../test/test_read_format_isorr_rr_moved.c | 1 - .../test/test_read_format_isozisofs_bz2.c | 1 - .../libarchive/test/test_read_format_lha.c | 1 - .../test/test_read_format_lha_bugfix_0.c | 1 - .../test/test_read_format_lha_filename.c | 1 - .../test_read_format_lha_filename_cp932.lzh.uu | 2 +- .../test/test_read_format_lha_filename_utf16.c | 1 - .../test_read_format_lha_filename_utf16.lzh.uu | 38 +- .../libarchive/test/test_read_format_mtree.c | 1 - .../libarchive/test/test_read_format_pax_bz2.c | 1 - .../libarchive/test/test_read_format_rar.c | 85 +- .../libarchive/test/test_read_format_rar.rar.uu | 2 +- .../libarchive/test/test_read_format_rar5.c | 30 + ...format_rar5_bad_window_sz_in_mltarc_file.rar.uu | 2 +- .../test/test_read_format_rar5_compressed.rar.uu | 2 +- ...d_format_rar5_different_winsize_on_merge.rar.uu | 2 +- ...est_read_format_rar5_multiarchive.part01.rar.uu | 2 +- ...est_read_format_rar5_multiarchive.part02.rar.uu | 2 +- ...est_read_format_rar5_multiarchive.part03.rar.uu | 2 +- ...est_read_format_rar5_multiarchive.part04.rar.uu | 2 +- ...est_read_format_rar5_multiarchive.part05.rar.uu | 2 +- ...est_read_format_rar5_multiarchive.part06.rar.uu | 2 +- ...est_read_format_rar5_multiarchive.part07.rar.uu | 2 +- ...est_read_format_rar5_multiarchive.part08.rar.uu | 2 +- .../test_read_format_rar5_multiple_files.rar.uu | 2 +- ...st_read_format_rar5_multiple_files_solid.rar.uu | 2 +- .../test/test_read_format_rar5_sfx.exe.uu | 2 +- .../test/test_read_format_rar5_stored.rar.uu | 2 +- .../test/test_read_format_rar5_unicode.rar.uu | 9 + .../test/test_read_format_rar_binary_data.rar.uu | 2 +- .../test/test_read_format_rar_compress_best.rar.uu | 2 +- .../test_read_format_rar_compress_normal.rar.uu | 2 +- .../test/test_read_format_rar_encryption_data.c | 1 - .../test/test_read_format_rar_encryption_header.c | 1 - .../test_read_format_rar_encryption_partially.c | 1 - .../libarchive/test/test_read_format_rar_filter.c | 1 - .../test/test_read_format_rar_invalid1.c | 1 - .../test_read_format_rar_multi_lzss_blocks.rar.uu | 2 +- ...est_read_format_rar_multivolume.part0001.rar.uu | 2 +- ...est_read_format_rar_multivolume.part0002.rar.uu | 2 +- ...est_read_format_rar_multivolume.part0003.rar.uu | 2 +- ...est_read_format_rar_multivolume.part0004.rar.uu | 2 +- .../test/test_read_format_rar_noeof.rar.uu | 2 +- ...est_read_format_rar_ppmd_lzss_conversion.rar.uu | 2 +- .../test/test_read_format_rar_sfx.exe.uu | 2 +- .../test/test_read_format_rar_subblock.rar.uu | 2 +- .../test/test_read_format_rar_windows.rar.uu | 2 +- .../libarchive/test/test_read_format_raw.bufr.uu | 2 +- .../libarchive/test/test_read_format_raw.c | 1 - .../libarchive/test/test_read_format_raw.data.Z.uu | 1 - .../libarchive/test/test_read_format_raw.data.uu | 1 - .../libarchive/test/test_read_format_tar.c | 1 - .../test/test_read_format_tar_concatenated.c | 1 - .../test/test_read_format_tar_empty_filename.c | 1 - .../test_read_format_tar_empty_filename.tar.uu | 3 +- .../test/test_read_format_tar_empty_pax.c | 1 - .../test/test_read_format_tar_empty_pax.tar.Z.uu | 2 +- .../test_read_format_tar_empty_with_gnulabel.c | 1 - .../test/test_read_format_tar_filename.c | 1 - .../test/test_read_format_tar_invalid_pax_size.c | 1 - .../test_read_format_tar_invalid_pax_size.tar.uu | 2 +- .../libarchive/test/test_read_format_tbz.c | 1 - .../libarchive/test/test_read_format_tgz.c | 1 - .../libarchive/test/test_read_format_tlz.c | 1 - .../libarchive/test/test_read_format_txz.c | 1 - .../libarchive/test/test_read_format_tz.c | 1 - .../test/test_read_format_ustar_filename.c | 1 - .../libarchive/test/test_read_format_warc.c | 2 - .../libarchive/test/test_read_format_xar.c | 1 - .../libarchive/test/test_read_format_zip.c | 3 +- .../test/test_read_format_zip_7075_utf8_paths.c | 1 - .../test/test_read_format_zip_bzip2.zipx.uu | 2 +- .../test/test_read_format_zip_comment_stored.c | 1 - .../test/test_read_format_zip_encryption_data.c | 1 - .../test/test_read_format_zip_encryption_header.c | 1 - .../test_read_format_zip_encryption_partially.c | 1 - .../test/test_read_format_zip_filename.c | 7 +- .../test_read_format_zip_filename_cp866.zip.uu | 2 +- .../test_read_format_zip_filename_cp932.zip.uu | 2 +- .../test_read_format_zip_filename_koi8r.zip.uu | 2 +- .../test_read_format_zip_filename_utf8_jp.zip.uu | 2 +- .../test_read_format_zip_filename_utf8_ru.zip.uu | 2 +- .../test_read_format_zip_filename_utf8_ru2.zip.uu | 2 +- .../test/test_read_format_zip_high_compression.c | 2 - .../libarchive/test/test_read_format_zip_jar.c | 1 - .../test/test_read_format_zip_lzma.zipx.uu | 2 +- .../test/test_read_format_zip_mac_metadata.c | 1 - .../test/test_read_format_zip_malformed.c | 1 - .../libarchive/test/test_read_format_zip_nested.c | 3 +- .../test/test_read_format_zip_nofiletype.c | 1 - .../libarchive/test/test_read_format_zip_padded.c | 1 - .../test/test_read_format_zip_ppmd8.zipx.uu | 2 +- .../libarchive/test/test_read_format_zip_sfx.c | 1 - ...t_read_format_zip_traditional_encryption_data.c | 1 - .../test/test_read_format_zip_winzip_aes.c | 1 - .../test/test_read_format_zip_winzip_aes128.zip.uu | 2 +- .../test/test_read_format_zip_winzip_aes256.zip.uu | 2 +- ...est_read_format_zip_winzip_aes256_stored.zip.uu | 2 +- .../test/test_read_format_zip_winzip_aes_large.c | 1 - ...read_format_zip_with_invalid_traditional_eocd.c | 2 - ...format_zip_with_invalid_traditional_eocd.zip.uu | 2 +- .../libarchive/test/test_read_format_zip_zip64.c | 1 - .../libarchive/libarchive/test/test_read_large.c | 1 - .../test/test_read_large_splitted_rar_aa.uu | 2 +- .../test/test_read_large_splitted_rar_ab.uu | 2 +- .../test/test_read_large_splitted_rar_ac.uu | 2 +- .../test/test_read_large_splitted_rar_ad.uu | 2 +- .../test/test_read_large_splitted_rar_ae.uu | 2 +- .../libarchive/test/test_read_pax_truncated.c | 1 - .../test/test_read_pax_xattr_schily.tar.uu | 2 +- .../libarchive/test/test_read_position.c | 1 - .../libarchive/test/test_read_splitted_rar_aa.uu | 2 +- .../libarchive/test/test_read_splitted_rar_ab.uu | 2 +- .../libarchive/test/test_read_splitted_rar_ac.uu | 2 +- .../libarchive/test/test_read_splitted_rar_ad.uu | 2 +- .../libarchive/test/test_read_truncated.c | 1 - .../libarchive/test/test_read_truncated_filter.c | 1 - .../libarchive/libarchive/test/test_sparse_basic.c | 3 +- .../test/test_splitted_rar_seek_support_aa.uu | 2 +- .../test/test_splitted_rar_seek_support_ab.uu | 2 +- .../test/test_splitted_rar_seek_support_ac.uu | 2 +- .../libarchive/test/test_tar_filenames.c | 1 - .../libarchive/libarchive/test/test_tar_large.c | 1 - .../libarchive/test/test_ustar_filename_encoding.c | 1 - .../libarchive/test/test_ustar_filenames.c | 1 - .../libarchive/libarchive/test/test_write_disk.c | 1 - .../libarchive/test/test_write_disk_appledouble.c | 1 - .../libarchive/test/test_write_disk_failures.c | 1 - .../libarchive/test/test_write_disk_hardlink.c | 1 - .../test/test_write_disk_hfs_compression.c | 1 - .../libarchive/test/test_write_disk_lookup.c | 1 - .../libarchive/test/test_write_disk_mac_metadata.c | 1 - .../test/test_write_disk_no_hfs_compression.c | 1 - .../libarchive/test/test_write_disk_perms.c | 1 - .../libarchive/test/test_write_disk_secure.c | 1 - .../libarchive/test/test_write_disk_secure744.c | 1 - .../libarchive/test/test_write_disk_secure745.c | 1 - .../libarchive/test/test_write_disk_secure746.c | 1 - .../libarchive/test/test_write_disk_sparse.c | 1 - .../libarchive/test/test_write_disk_symlink.c | 1 - .../libarchive/test/test_write_disk_times.c | 1 - .../libarchive/test/test_write_filter_b64encode.c | 1 - .../libarchive/test/test_write_filter_bzip2.c | 1 - .../libarchive/test/test_write_filter_compress.c | 1 - .../libarchive/test/test_write_filter_gzip.c | 1 - .../test/test_write_filter_gzip_timestamp.c | 1 - .../libarchive/test/test_write_filter_lz4.c | 5 +- .../libarchive/test/test_write_filter_lzip.c | 1 - .../libarchive/test/test_write_filter_lzma.c | 1 - .../libarchive/test/test_write_filter_lzop.c | 4 +- .../libarchive/test/test_write_filter_program.c | 1 - .../libarchive/test/test_write_filter_uuencode.c | 1 - .../libarchive/test/test_write_filter_xz.c | 1 - .../libarchive/test/test_write_filter_zstd.c | 107 +- .../libarchive/test/test_write_format_7zip.c | 1 - .../libarchive/test/test_write_format_7zip_empty.c | 1 - .../libarchive/test/test_write_format_7zip_large.c | 1 - .../libarchive/test/test_write_format_ar.c | 1 - .../libarchive/test/test_write_format_cpio.c | 1 - .../libarchive/test/test_write_format_cpio_empty.c | 1 - .../libarchive/test/test_write_format_cpio_newc.c | 2 - .../libarchive/test/test_write_format_cpio_odc.c | 2 - .../libarchive/test/test_write_format_gnutar.c | 1 - .../test/test_write_format_gnutar_filenames.c | 1 - .../libarchive/test/test_write_format_iso9660.c | 21 +- .../libarchive/test/test_write_format_mtree.c | 1 - .../test/test_write_format_mtree_absolute_path.c | 1 - .../test/test_write_format_mtree_classic.c | 1 - .../test/test_write_format_mtree_classic_indent.c | 1 - .../test/test_write_format_mtree_fflags.c | 2 +- .../test/test_write_format_mtree_no_separator.c | 2 +- .../test/test_write_format_mtree_quoted_filename.c | 1 - .../libarchive/test/test_write_format_pax.c | 1 - .../libarchive/test/test_write_format_shar_empty.c | 1 - .../libarchive/test/test_write_format_tar.c | 1 - .../libarchive/test/test_write_format_tar_empty.c | 1 - .../libarchive/test/test_write_format_tar_sparse.c | 1 - .../libarchive/test/test_write_format_tar_ustar.c | 1 - .../libarchive/test/test_write_format_tar_v7tar.c | 1 - .../libarchive/test/test_write_format_warc.c | 1 - .../libarchive/test/test_write_format_warc_empty.c | 1 - .../libarchive/test/test_write_format_xar.c | 1 - .../libarchive/test/test_write_format_xar_empty.c | 1 - .../libarchive/test/test_write_format_zip.c | 50 +- .../test/test_write_format_zip64_stream.c | 276 ++++ .../test/test_write_format_zip_compression_store.c | 66 +- .../libarchive/test/test_write_format_zip_empty.c | 1 - .../test/test_write_format_zip_empty_zip64.c | 1 - .../test/test_write_format_zip_entry_size_unset.c | 13 +- .../libarchive/test/test_write_format_zip_file.c | 43 +- .../test/test_write_format_zip_file_zip64.c | 47 +- .../libarchive/test/test_write_format_zip_large.c | 31 +- .../libarchive/test/test_write_format_zip_stream.c | 247 ++++ .../libarchive/test/test_write_format_zip_zip64.c | 1 - .../libarchive/test/test_write_open_memory.c | 1 - .../libarchive/test/test_write_read_format_zip.c | 56 +- .../libarchive/test/test_xattr_platform.c | 1 - .../libarchive/test/test_zip_filename_encoding.c | 4 +- contrib/libarchive/libarchive_fe/err.c | 2 - contrib/libarchive/libarchive_fe/err.h | 11 +- contrib/libarchive/libarchive_fe/lafe_platform.h | 12 - contrib/libarchive/libarchive_fe/line_reader.c | 2 - contrib/libarchive/libarchive_fe/passphrase.c | 4 +- contrib/libarchive/tar/bsdtar.1 | 77 +- contrib/libarchive/tar/bsdtar.c | 82 +- contrib/libarchive/tar/bsdtar.h | 8 +- contrib/libarchive/tar/bsdtar_platform.h | 24 +- contrib/libarchive/tar/cmdline.c | 3 +- contrib/libarchive/tar/creation_set.c | 1 - contrib/libarchive/tar/read.c | 1 - contrib/libarchive/tar/subst.c | 28 +- contrib/libarchive/tar/test/test.h | 2 - contrib/libarchive/tar/test/test_0.c | 1 - contrib/libarchive/tar/test/test_basic.c | 1 - contrib/libarchive/tar/test/test_copy.c | 1 - contrib/libarchive/tar/test/test_empty_mtree.c | 1 - contrib/libarchive/tar/test/test_extract_tar_Z.c | 1 - contrib/libarchive/tar/test/test_extract_tar_bz2.c | 1 - contrib/libarchive/tar/test/test_extract_tar_grz.c | 1 - contrib/libarchive/tar/test/test_extract_tar_gz.c | 1 - contrib/libarchive/tar/test/test_extract_tar_lrz.c | 1 - contrib/libarchive/tar/test/test_extract_tar_lz.c | 1 - contrib/libarchive/tar/test/test_extract_tar_lz4.c | 1 - .../libarchive/tar/test/test_extract_tar_lzma.c | 1 - contrib/libarchive/tar/test/test_extract_tar_lzo.c | 1 - contrib/libarchive/tar/test/test_extract_tar_xz.c | 1 - .../libarchive/tar/test/test_extract_tar_zstd.c | 1 - contrib/libarchive/tar/test/test_format_newc.c | 1 - contrib/libarchive/tar/test/test_help.c | 1 - contrib/libarchive/tar/test/test_leading_slash.c | 1 - contrib/libarchive/tar/test/test_missing_file.c | 1 - contrib/libarchive/tar/test/test_option_C_mtree.c | 1 - contrib/libarchive/tar/test/test_option_C_upper.c | 1 - contrib/libarchive/tar/test/test_option_H_upper.c | 1 - contrib/libarchive/tar/test/test_option_L_upper.c | 1 - contrib/libarchive/tar/test/test_option_O_upper.c | 1 - contrib/libarchive/tar/test/test_option_T_upper.c | 1 - contrib/libarchive/tar/test/test_option_U_upper.c | 1 - contrib/libarchive/tar/test/test_option_X_upper.c | 1 - contrib/libarchive/tar/test/test_option_a.c | 1 - contrib/libarchive/tar/test/test_option_acls.c | 1 - contrib/libarchive/tar/test/test_option_b.c | 1 - .../libarchive/tar/test/test_option_b64encode.c | 1 - contrib/libarchive/tar/test/test_option_exclude.c | 1 - .../libarchive/tar/test/test_option_exclude_vcs.c | 2 +- contrib/libarchive/tar/test/test_option_fflags.c | 1 - .../libarchive/tar/test/test_option_gid_gname.c | 1 - contrib/libarchive/tar/test/test_option_group.c | 84 ++ contrib/libarchive/tar/test/test_option_grzip.c | 1 - .../libarchive/tar/test/test_option_ignore_zeros.c | 1 - contrib/libarchive/tar/test/test_option_j.c | 1 - contrib/libarchive/tar/test/test_option_k.c | 1 - .../tar/test/test_option_keep_newer_files.c | 1 - contrib/libarchive/tar/test/test_option_lrzip.c | 1 - contrib/libarchive/tar/test/test_option_lz4.c | 1 - contrib/libarchive/tar/test/test_option_lzma.c | 1 - contrib/libarchive/tar/test/test_option_lzop.c | 1 - contrib/libarchive/tar/test/test_option_n.c | 1 - .../libarchive/tar/test/test_option_newer_than.c | 1 - contrib/libarchive/tar/test/test_option_nodump.c | 1 - .../libarchive/tar/test/test_option_older_than.c | 1 - contrib/libarchive/tar/test/test_option_owner.c | 84 ++ .../libarchive/tar/test/test_option_passphrase.c | 1 - contrib/libarchive/tar/test/test_option_q.c | 1 - contrib/libarchive/tar/test/test_option_r.c | 1 - contrib/libarchive/tar/test/test_option_s.c | 12 +- .../libarchive/tar/test/test_option_safe_writes.c | 1 - .../libarchive/tar/test/test_option_uid_uname.c | 1 - contrib/libarchive/tar/test/test_option_uuencode.c | 1 - contrib/libarchive/tar/test/test_option_xattrs.c | 1 - contrib/libarchive/tar/test/test_option_xz.c | 1 - contrib/libarchive/tar/test/test_option_z.c | 1 - contrib/libarchive/tar/test/test_option_zstd.c | 1 - contrib/libarchive/tar/test/test_patterns.c | 1 - contrib/libarchive/tar/test/test_print_longpath.c | 1 - contrib/libarchive/tar/test/test_stdio.c | 1 - .../libarchive/tar/test/test_strip_components.c | 1 - contrib/libarchive/tar/test/test_symlink_dir.c | 1 - contrib/libarchive/tar/util.c | 3 +- contrib/libarchive/tar/write.c | 1 - contrib/libarchive/test_utils/test_common.h | 15 +- contrib/libarchive/test_utils/test_main.c | 18 +- contrib/libarchive/unzip/bsdunzip.1 | 2 - contrib/libarchive/unzip/bsdunzip.c | 17 +- contrib/libarchive/unzip/bsdunzip_platform.h | 24 +- contrib/libarchive/unzip/cmdline.c | 3 +- contrib/libarchive/unzip/test/test.h | 2 - contrib/libarchive/unzip/test/test_I.c | 41 + contrib/libarchive/unzip/test/test_I.zip.uu | 8 + contrib/libarchive/unzip/test/test_doubledash.c | 44 + lib/libarchive/Makefile.inc | 2 +- lib/libarchive/tests/Makefile | 7 + usr.bin/unzip/tests/Makefile | 3 + 725 files changed, 5735 insertions(+), 1735 deletions(-) diff --git a/contrib/libarchive/.editorconfig b/contrib/libarchive/.editorconfig deleted file mode 100644 index 2b797a039e97..000000000000 --- a/contrib/libarchive/.editorconfig +++ /dev/null @@ -1,18 +0,0 @@ -# To use this config on you editor, follow the instructions at: -# http://editorconfig.org - -root = true - -[*] -charset = utf-8 -indent_style = tab -insert_final_newline = true -trim_trailing_whitespace = true - -[*.sh] -indent_style = space -indent_size = 4 - -[CMakeLists.txt] -indent_style = space -indent_size = 2 diff --git a/contrib/libarchive/.github/workflows/cifuzz.yml b/contrib/libarchive/.github/workflows/cifuzz.yml deleted file mode 100644 index e5c60e4b0de2..000000000000 --- a/contrib/libarchive/.github/workflows/cifuzz.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: CIFuzz -on: [pull_request] -jobs: - Fuzzing: - runs-on: ubuntu-latest - steps: - - name: Build Fuzzers - id: build - uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master - with: - oss-fuzz-project-name: 'libarchive' - dry-run: false - - name: Run Fuzzers - uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master - with: - oss-fuzz-project-name: 'libarchive' - fuzz-seconds: 600 - dry-run: false - - name: Upload Crash - uses: actions/upload-artifact@v1 - if: failure() && steps.build.outcome == 'success' - with: - name: artifacts - path: ./out/artifacts diff --git a/contrib/libarchive/NEWS b/contrib/libarchive/NEWS index 7509c9ce5fa1..f4395fd1c979 100644 --- a/contrib/libarchive/NEWS +++ b/contrib/libarchive/NEWS @@ -1,3 +1,7 @@ +Apr 08, 2024: libarchive 3.7.3 released + +Sep 12, 2023: libarchive 3.7.2 released + Jul 29, 2023: libarchive 3.7.1 released Jul 18, 2023: libarchive 3.7.0 released diff --git a/contrib/libarchive/build/autoconf/m4_ax_compile_check_sizeof.m4 b/contrib/libarchive/build/autoconf/m4_ax_compile_check_sizeof.m4 deleted file mode 100644 index f834df6346c9..000000000000 --- a/contrib/libarchive/build/autoconf/m4_ax_compile_check_sizeof.m4 +++ /dev/null @@ -1,115 +0,0 @@ -# ============================================================================ -# https://www.gnu.org/software/autoconf-archive/ax_compile_check_sizeof.html -# ============================================================================ -# -# SYNOPSIS -# -# AX_COMPILE_CHECK_SIZEOF(TYPE [, HEADERS [, EXTRA_SIZES...]]) -# -# DESCRIPTION -# -# This macro checks for the size of TYPE using compile checks, not run -# checks. You can supply extra HEADERS to look into. the check will cycle -# through 1 2 4 8 16 and any EXTRA_SIZES the user supplies. If a match is -# found, it will #define SIZEOF_`TYPE' to that value. Otherwise it will -# emit a configure time error indicating the size of the type could not be -# determined. -# -# The trick is that C will not allow duplicate case labels. While this is -# valid C code: -# -# switch (0) case 0: case 1:; -# -# The following is not: -# -# switch (0) case 0: case 0:; -# -# Thus, the AC_COMPILE_IFELSE will fail if the currently tried size does -# not match. -# -# Here is an example skeleton configure.in script, demonstrating the -# macro's usage: -# -# AC_PROG_CC -# AC_CHECK_HEADERS(stddef.h unistd.h) -# AC_TYPE_SIZE_T -# AC_CHECK_TYPE(ssize_t, int) -# -# headers='#ifdef HAVE_STDDEF_H -# #include -# #endif -# #ifdef HAVE_UNISTD_H -# #include -# #endif -# ' -# -# AX_COMPILE_CHECK_SIZEOF(char) -# AX_COMPILE_CHECK_SIZEOF(short) -# AX_COMPILE_CHECK_SIZEOF(int) -# AX_COMPILE_CHECK_SIZEOF(long) -# AX_COMPILE_CHECK_SIZEOF(unsigned char *) -# AX_COMPILE_CHECK_SIZEOF(void *) -# AX_COMPILE_CHECK_SIZEOF(size_t, $headers) -# AX_COMPILE_CHECK_SIZEOF(ssize_t, $headers) -# AX_COMPILE_CHECK_SIZEOF(ptrdiff_t, $headers) -# AX_COMPILE_CHECK_SIZEOF(off_t, $headers) -# -# LICENSE -# -# Copyright (c) 2008 Kaveh Ghazi -# Copyright (c) 2017 Reini Urban -# -# This program is free software: you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the -# Free Software Foundation, either version 3 of the License, or (at your -# option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -# Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see . -# -# As a special exception, the respective Autoconf Macro's copyright owner -# gives unlimited permission to copy, distribute and modify the configure -# scripts that are the output of Autoconf when processing the Macro. You -# need not follow the terms of the GNU General Public License when using -# or distributing such scripts, even though portions of the text of the -# Macro appear in them. The GNU General Public License (GPL) does govern -# all other use of the material that constitutes the Autoconf Macro. -# -# This special exception to the GPL applies to versions of the Autoconf -# Macro released by the Autoconf Archive. When you make and distribute a -# modified version of the Autoconf Macro, you may extend this special -# exception to the GPL to apply to your modified version as well. - -#serial 8 - -AU_ALIAS([AC_COMPILE_CHECK_SIZEOF], [AX_COMPILE_CHECK_SIZEOF]) -AC_DEFUN([AX_COMPILE_CHECK_SIZEOF], -[changequote(<<, >>)dnl -dnl The name to #define. -define(<>, translit(sizeof_$1, [a-z *], [A-Z_P]))dnl -dnl The cache variable name. -define(<>, translit(ac_cv_sizeof_$1, [ *], [_p]))dnl -changequote([, ])dnl -AC_MSG_CHECKING(size of $1) -AC_CACHE_VAL(AC_CV_NAME, -[for ac_size in 4 8 1 2 16 $3 ; do # List sizes in rough order of prevalence. - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ -#include -$2 -]], [[switch (0) case 0: case (sizeof ($1) == $ac_size):;]])], [AC_CV_NAME=$ac_size]) - if test x$AC_CV_NAME != x ; then break; fi -done -]) -if test x$AC_CV_NAME = x ; then - AC_MSG_ERROR([cannot determine a size for $1]) -fi -AC_MSG_RESULT($AC_CV_NAME) -AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME, [The number of bytes in type $1]) -undefine([AC_TYPE_NAME])dnl -undefine([AC_CV_NAME])dnl -]) diff --git a/contrib/libarchive/cat/bsdcat.1 b/contrib/libarchive/cat/bsdcat.1 index 036623e4e4d6..9fa66d60e1e6 100644 --- a/contrib/libarchive/cat/bsdcat.1 +++ b/contrib/libarchive/cat/bsdcat.1 @@ -22,8 +22,6 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $FreeBSD$ -.\" .Dd March 1, 2014 .Dt BSDCAT 1 .Os diff --git a/contrib/libarchive/cat/bsdcat.c b/contrib/libarchive/cat/bsdcat.c index bdb9c40b9150..19d3de65cea4 100644 --- a/contrib/libarchive/cat/bsdcat.c +++ b/contrib/libarchive/cat/bsdcat.c @@ -24,7 +24,6 @@ */ #include "bsdcat_platform.h" -__FBSDID("$FreeBSD$"); #include #ifdef HAVE_STDLIB_H @@ -37,6 +36,9 @@ __FBSDID("$FreeBSD$"); #include #endif +#include +#include + #include "bsdcat.h" #include "err.h" *** 16950 LINES SKIPPED *** From nobody Tue Apr 30 07:56:16 2024 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 4VTCFF153Jz5JS53; Tue, 30 Apr 2024 07:56: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 4VTCFF05YNz41Sm; Tue, 30 Apr 2024 07:56:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714463777; 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=/FQ0V71m3ZaXI0LRmC6d0k+91d6bCPT8vv6cwNCTX+k=; b=CpFEtRr+f+VmvqtKUUtZ5sX81t0E0KdFBSx/eoWps+9FXvearvTuX+Qut2FCP5VXW9IRAY iiOx3pppQUe/DfF8f/T5NnStefWoP/shTrQ174vzq9kbKZQ25e1G0if7Kigkvuh+o1A6xZ LAAL7AUsoPJtV0fgmpfjk7D2TvmzD0rTqlN7eUT0GELtVevsEnnNoCKXcOPeBCEm+Abgfr S3D/NEFMRLcXPTaLdVE2du7FB0prAsi0NZZj7x10b1sLkT16tkXfWR5D5RcoIHBS7Sst/m hjEw0sgWl6/CBxHS2mOFK0dD4u56haaDSUp4LeJzu2Ud7LDc8g4hExz/+tWbVg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714463777; a=rsa-sha256; cv=none; b=iWA9x2qIEeq8k27FvsSd/UJ8C1u5P4eWH6VBLHqYfkZrY5OvqIAGnsCyuDKPzhVywqz/sG XjIgBcg0vZybYqY2BdxfIZ36qSYb6HcjDMSk1TECT1T3XGAFXrdJJ8Olc+3Jkk5HdVjc/n 7A8CNO/ZxJhyiTjnUssdI3E3UVHi9TVW5nJ8BshIhwM5cSbW1RpFew9/rIfp84d1hUL+pc ifOB9s6x6jS1IY+AoiI+D9RRFzNhTI1WowX0fZs7I6Sut/ikjFJUYucheYGRGZL5P/DkqL /Lve/sASQ+SRiGUIgIQ1e5u+/ZQ7OE6g5t9xhLdgRYZfrPF2jTiCvELLBboXkQ== 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=1714463777; 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=/FQ0V71m3ZaXI0LRmC6d0k+91d6bCPT8vv6cwNCTX+k=; b=aqqY0DAj3nbWUvk5PeJD8R3ohzCZH0moKqk7eukNudiippwSDlQ+qtIkTelxWN/jXiMNRs u+iwJNDR6Jv+C0A70WdjwsHbsQw3uBJEEDDsbKSxZd3DCNvxXJVNzGQ/iUNCeadZrh79ca 7tC6tSvn7w5zNVOiEdm9ZwVgictw5BqNkjk6xk1LyjqhQmadq0qrEKhuaXsVE693l/pTPn cHhZNaVN1lcD8XZi5ovbBkGEl/nC8upeeEYlkBJ2gMvPjme3MbdmvnHS+HWOWeGA107Yhe c/ZrozE5eqGii8bQg3HYp+NHEZxoAW6KipqWs0m8tAfsRUjKAnmyO+YG5HpXXQ== 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 4VTCFD6pf0zRWr; Tue, 30 Apr 2024 07:56: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 43U7uGrf041910; Tue, 30 Apr 2024 07:56:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43U7uGKu041907; Tue, 30 Apr 2024 07:56:16 GMT (envelope-from git) Date: Tue, 30 Apr 2024 07:56:16 GMT Message-Id: <202404300756.43U7uGKu041907@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Martin Matuska Subject: git: 2d92e58b68e1 - stable/14 - libarchive: fix null format string error in tests (unbreaks gcc13 build) List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 2d92e58b68e1bcade3d4097660c24afb64811ddf Auto-Submitted: auto-generated The branch stable/14 has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=2d92e58b68e1bcade3d4097660c24afb64811ddf commit 2d92e58b68e1bcade3d4097660c24afb64811ddf Author: Martin Matuska AuthorDate: 2024-04-17 07:33:13 +0000 Commit: Martin Matuska CommitDate: 2024-04-30 06:47:22 +0000 libarchive: fix null format string error in tests (unbreaks gcc13 build) Obtained from: libarchive (d43c39247) (cherry picked from commit 701d0666c03dacba9b73d91dff2a6140e157bdc4) --- contrib/libarchive/libarchive/test/test_compat_lzip.c | 1 - 1 file changed, 1 deletion(-) diff --git a/contrib/libarchive/libarchive/test/test_compat_lzip.c b/contrib/libarchive/libarchive/test/test_compat_lzip.c index d3b8b118322b..1420e5bb9ac0 100644 --- a/contrib/libarchive/libarchive/test/test_compat_lzip.c +++ b/contrib/libarchive/libarchive/test/test_compat_lzip.c @@ -195,7 +195,6 @@ compat_lzip_4(const char *name) assertEqualString("test.bin", archive_entry_pathname(ae)); /* Verify the end-of-archive. */ - archive_set_error(a, ARCHIVE_OK, NULL); assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); /* Verify that the format detection worked. */ From nobody Tue Apr 30 07:56:18 2024 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 4VTCFG37Mqz5JSFM; Tue, 30 Apr 2024 07:56: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 4VTCFG19w5z41j4; Tue, 30 Apr 2024 07:56:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714463778; 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=25z3/DB55somlX+UvUnpzh1l+ByY3hGKTJplyq5H9Kw=; b=lh0N//BiFZ4wHglf8tYpW1a6G2sTLaDKu5O/RavWSmTFV08hMnk9qIJfQnjy+hALcE4ZNc cecZJ/S69CYFVsBRtCiRU753CpLJOiuHfvgBsytqEXzrvTIUeFpq3NyTDe265hSlVUtgYU eiTTj11mGHEqBQZb+QcFKgbUM2hsSLbLhq4m79RXS2qpnSvUUN+Z3Vi3Pd4QZATyJWmgm1 A2wlCwcmkpu13G8UptVjleYBdsaPOQvYK4Sak1EkjplP5knbWDPtjGSJcK3VK6iIw4DaUq K1MvtcJgJlqMRUlMQyWe2Wwx2mE1wUGec9jdbqncmXlFlG3wLDMg44J8G8bsOQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714463778; a=rsa-sha256; cv=none; b=nIoqhB0Hbfb/oJE1eQ70nFek/rgmjnZwwOOGNwc0v14bvPVclrGi9yU/3DiTpfakkK7q69 aGdUVjPACagxfbqyF32CCo/j2OhC3dGSWx09gSwMaY3QfDYwZ+hKWIjPy3/byOMtBFW6Hf bgkeY3GDkGKqFNFUbJaZCMMHhSJVcEWQ+A+6A+85VrCXloXY3ZGKi99Xae95KPR1W7DCKi DIsRC1vp9qpbFzaelbLklfLc6BFxcWlvnAzvBO19MXbHSskTgLjuBa6wTvIPKRPrLgQnFn /skVsqkfSnBkvu8im7kW1RdfopNkIiimu84QjoltQ3OOwJddrfdwUTO+2RI+8A== 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=1714463778; 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=25z3/DB55somlX+UvUnpzh1l+ByY3hGKTJplyq5H9Kw=; b=cOH339VybeH4nfY1sFqRw9UIVAmSTFiZ/yWq3b6pvPVrUs1g43vXwcRRpmsTmzLir5Cjzs w9rc98GhZqj4/Drop9Wojdq7aiNf47sT/ExioC8ASmr6bwUarjO8vMI9DsY9/WCWLbPxah 1wyyzjiGqecRJQhWiLzj4yyzbWaT/e6T6qwNi88aZOFMAt5TSUzC0XLQdeTckVPCuFA8zT IMIZF3H8HV2MJ2Y475Kwqtp+XkFQhuMjErljcNY3qo439l7RG0dCPuI8SsQcPEs8b5Dm++ PgOWxRnO6MbFoY7kjNY52XBMv8HfwLkGxta3tLOgp8Qwd1/UXzNq3M3m6TEevg== 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 4VTCFG0kgBzRFd; Tue, 30 Apr 2024 07:56: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 43U7uIc0041965; Tue, 30 Apr 2024 07:56:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43U7uI9r041962; Tue, 30 Apr 2024 07:56:18 GMT (envelope-from git) Date: Tue, 30 Apr 2024 07:56:18 GMT Message-Id: <202404300756.43U7uI9r041962@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Martin Matuska Subject: git: 3cf9a5010e7d - stable/14 - libarchive: add two missing package files to libarchive 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 3cf9a5010e7dbd77e152b340e19e8d59ca053f2e Auto-Submitted: auto-generated The branch stable/14 has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=3cf9a5010e7dbd77e152b340e19e8d59ca053f2e commit 3cf9a5010e7dbd77e152b340e19e8d59ca053f2e Author: Martin Matuska AuthorDate: 2024-04-17 07:58:32 +0000 Commit: Martin Matuska CommitDate: 2024-04-30 06:47:37 +0000 libarchive: add two missing package files to libarchive tests (cherry picked from commit 7d03ec330684a4e82e6113df3f40305849e5fb6c) --- lib/libarchive/tests/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/libarchive/tests/Makefile b/lib/libarchive/tests/Makefile index 0d47e1a5ed3c..e14b37621e5c 100644 --- a/lib/libarchive/tests/Makefile +++ b/lib/libarchive/tests/Makefile @@ -373,6 +373,8 @@ ${PACKAGE}FILES+= test_compat_lz4_B7.tar.lz4.uu ${PACKAGE}FILES+= test_compat_lz4_B7BD.tar.lz4.uu ${PACKAGE}FILES+= test_compat_lzip_1.tlz.uu ${PACKAGE}FILES+= test_compat_lzip_2.tlz.uu +${PACKAGE}FILES+= test_compat_lzip_3.lz.uu +${PACKAGE}FILES+= test_compat_lzip_4.tlz.uu ${PACKAGE}FILES+= test_compat_lzma_1.tlz.uu ${PACKAGE}FILES+= test_compat_lzma_2.tlz.uu ${PACKAGE}FILES+= test_compat_lzma_3.tlz.uu From nobody Tue Apr 30 07:56:19 2024 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 4VTCFH6Vm9z5JS56; Tue, 30 Apr 2024 07:56: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 4VTCFH36dXz41lZ; Tue, 30 Apr 2024 07:56:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714463779; 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=zk9NfA59SSVX1xHZYc1a98eVMLPFnPCYzdHPHOO3BGQ=; b=TBjuhdKYyo6rwCJEzGCNvhwWSB9vGeFTgemKqiv3tr9TxQrp5tBLWWoUQadeHySeigcZYB pzOeOo9/8IV4koaf2LsdonOCalK4d/3omTyZ5mHvotshJqBRVvalWZiQFIXPs1uHfYQoEP O+bDPnm68C2DjpWMxqeqfzKnc4ECsGeDmbHhc0abP3rGCpg4sT2bS2AtFwA/3C7+OgD+sc wDpe8Z0SGB8KueMgkhoQqlu+8CnlNbt/qnMVrUt13Cg+XKQE5DA441jEiLT/RnTketD5qI DqqfUbro3Lt2LEta1rj3eX0OLvPmfmiUA6K7Ow6cuqbV7z2u6KJmaNSZOfzKjw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714463779; a=rsa-sha256; cv=none; b=p35/sqw/RaNtoBdwbMsMLBWDP46RbD48KU8MFd4AcmRbOXzE0LBGPa1jT76t/FBTaytHx3 qfkqUrz2itcMABvitKAwt58A7nK9oBvHP3RrHO9FimR1apCl8tm0XAmZqhc+HtZK/N7x31 1Cv9ON3novb0RUq1tkCEaUjONi0WFApTW57B46Vwn6zMayoRZeNgV5dASs+xBSHwwRqQ9U shN9JzRl+ZNgvNvHfiK9V6+jFf/FfwZOJUV6VEb7EfBIZaSHRmY+Yy/46tcM6mhcQoA7Ki hnPtqCY9ePAfTp3vBf7Cf5YgaYz1gbGXtBNB/ceMRcryLI3a1V3jmFs+eTxEAg== 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=1714463779; 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=zk9NfA59SSVX1xHZYc1a98eVMLPFnPCYzdHPHOO3BGQ=; b=rGA3Fc2RqQICXgc0/1l2r9dBSMYZ4Ekfx2KMTOo6wCXwhv4+FAc0SkXCZn+sFC/j4to7bh ZG8p1anEBhu68nq+8cWHBA0xdmHAW77YjcfB9WjE31Tc5Y0wEcM4u0MmB+DziCU434OVZ6 a76PzZ/g69I4XHDh4of6cTxj37BS/7DIOLJegIJVC3G9lUaMgpdA2B7YF5spJ6WnPV3HpJ ZJK3USAkGcqJrI/6YXpqA030tlkGwD0HIaH4Ay0ZW5/qSGcl76GA5/NWvqSGDeoWtT5usA scJk0G+a9NKBcTVYOI64+t0WIeeSVVWHDweO3ujIzxz9drSObsbHg3WQNwMFFA== 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 4VTCFH1fCXzRFf; Tue, 30 Apr 2024 07:56: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 43U7uJfC042009; Tue, 30 Apr 2024 07:56:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43U7uJKj042006; Tue, 30 Apr 2024 07:56:19 GMT (envelope-from git) Date: Tue, 30 Apr 2024 07:56:19 GMT Message-Id: <202404300756.43U7uJKj042006@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Martin Matuska Subject: git: 8774c92e32b2 - stable/14 - libarchive: merge from vendor branch List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8774c92e32b25cb0253f1a7a0fbf5d2e6fecc4a3 Auto-Submitted: auto-generated The branch stable/14 has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=8774c92e32b25cb0253f1a7a0fbf5d2e6fecc4a3 commit 8774c92e32b25cb0253f1a7a0fbf5d2e6fecc4a3 Author: Martin Matuska AuthorDate: 2024-04-29 08:15:04 +0000 Commit: Martin Matuska CommitDate: 2024-04-30 06:47:56 +0000 libarchive: merge from vendor branch Libarchive 3.7.4 + three fixes from master Security fixes: #2135 rar: Fix OOB in rar e8 filter (CVE-2024-26256) #2145 zip: Fix out of boundary access #2148 rar: Fix OOB in rar delta filter #2149 rar: Fix OOB in rar audio filter Important bugfixes: #2131 7zip: Limit amount of properties #2110 bsdtar: Fix error handling around strtol() usages #2116 passphrase: Never allow empty passwords #2124 rar: Fix "File CRC Error" when extracting specific rar4 archives #2123 xar: Avoid infinite link loop #2150 xar: Fix another infinite loop and expat error handling #2108 zip: Update AppleDouble support for directories #2071 zstd: Implement core detectiongit (cherry picked from commit 13d826ff947d9026f98e317e7385b22abfc0eace) --- contrib/libarchive/NEWS | 2 + contrib/libarchive/README.md | 2 +- contrib/libarchive/cat/cmdline.c | 16 +++-- contrib/libarchive/cpio/cmdline.c | 16 +++-- contrib/libarchive/libarchive/archive.h | 6 +- contrib/libarchive/libarchive/archive_entry.h | 2 +- contrib/libarchive/libarchive/archive_entry_acl.3 | 2 +- contrib/libarchive/libarchive/archive_read_disk.3 | 4 +- .../libarchive/archive_read_support_format_7zip.c | 2 + .../libarchive/archive_read_support_format_all.c | 2 +- .../libarchive/archive_read_support_format_ar.c | 4 +- .../libarchive/archive_read_support_format_lha.c | 4 +- .../libarchive/archive_read_support_format_mtree.c | 8 +-- .../libarchive/archive_read_support_format_rar.c | 30 +++++++- .../libarchive/archive_read_support_format_warc.c | 10 ++- .../libarchive/archive_read_support_format_xar.c | 9 +++ .../libarchive/archive_read_support_format_zip.c | 15 +++- contrib/libarchive/libarchive/archive_util.c | 3 +- .../libarchive/archive_write_add_filter_zstd.c | 23 +++++- .../libarchive/archive_write_disk_posix.c | 3 +- .../libarchive/libarchive/archive_write_private.h | 2 +- .../libarchive/archive_write_set_format_gnutar.c | 2 +- .../libarchive/archive_write_set_passphrase.c | 35 ++++----- .../libarchive/libarchive/libarchive_internals.3 | 2 +- .../test/test_read_format_xar_doublelink.c | 55 ++++++++++++++ .../test/test_read_format_xar_doublelink.xar.uu | 12 ++++ .../libarchive/test/test_write_disk_appledouble.c | 84 ++++++++++++++++++++++ .../test/test_write_disk_appledouble_zip.zip.uu | 27 +++++++ contrib/libarchive/libarchive_fe/passphrase.c | 4 +- contrib/libarchive/tar/bsdtar.1 | 15 ++-- contrib/libarchive/tar/bsdtar.c | 63 ++++++++-------- contrib/libarchive/tar/cmdline.c | 16 +++-- contrib/libarchive/unzip/cmdline.c | 18 +++-- contrib/libarchive/unzip/test/test_I.c | 13 ++++ lib/libarchive/tests/Makefile | 3 + 35 files changed, 404 insertions(+), 110 deletions(-) diff --git a/contrib/libarchive/NEWS b/contrib/libarchive/NEWS index f4395fd1c979..ebdbb2a978ec 100644 --- a/contrib/libarchive/NEWS +++ b/contrib/libarchive/NEWS @@ -1,3 +1,5 @@ +Apr 26, 2024: libarchive 3.7.4 released + Apr 08, 2024: libarchive 3.7.3 released Sep 12, 2023: libarchive 3.7.2 released diff --git a/contrib/libarchive/README.md b/contrib/libarchive/README.md index 727ed49856b6..933de6986425 100644 --- a/contrib/libarchive/README.md +++ b/contrib/libarchive/README.md @@ -201,7 +201,7 @@ questions we are asked about libarchive: In case other thread calls the same function in parallel, it might get interrupted by it and cause the executable to use umask=0 for the remaining execution. - This will then lead to implicitely created directories to have 777 + This will then lead to implicitly created directories to have 777 permissions without sticky bit. * In particular, libarchive's modules to read or write a directory diff --git a/contrib/libarchive/cat/cmdline.c b/contrib/libarchive/cat/cmdline.c index ea1e0eed6d0a..851b63de06e5 100644 --- a/contrib/libarchive/cat/cmdline.c +++ b/contrib/libarchive/cat/cmdline.c @@ -114,12 +114,18 @@ bsdcat_getopt(struct bsdcat *bsdcat) enum { state_start = 0, state_old_tar, state_next_word, state_short, state_long }; - const struct bsdcat_option *popt, *match = NULL, *match2 = NULL; - const char *p, *long_prefix = "--"; + const struct bsdcat_option *popt, *match, *match2; + const char *p, *long_prefix; size_t optlength; - int opt = '?'; - int required = 0; + int opt; + int required; +again: + match = NULL; + match2 = NULL; + long_prefix = "--"; + opt = '?'; + required = 0; bsdcat->argument = NULL; /* First time through, initialize everything. */ @@ -172,7 +178,7 @@ bsdcat_getopt(struct bsdcat *bsdcat) if (opt == '\0') { /* End of this group; recurse to get next option. */ bsdcat->getopt_state = state_next_word; - return bsdcat_getopt(bsdcat); + goto again; } /* Does this option take an argument? */ diff --git a/contrib/libarchive/cpio/cmdline.c b/contrib/libarchive/cpio/cmdline.c index 312d762c8f46..ab25492ede48 100644 --- a/contrib/libarchive/cpio/cmdline.c +++ b/contrib/libarchive/cpio/cmdline.c @@ -114,12 +114,18 @@ cpio_getopt(struct cpio *cpio) static int state = state_start; static char *opt_word; - const struct option *popt, *match = NULL, *match2 = NULL; - const char *p, *long_prefix = "--"; + const struct option *popt, *match, *match2; + const char *p, *long_prefix; size_t optlength; - int opt = '?'; - int required = 0; + int opt; + int required; +again: + match = NULL; + match2 = NULL; + long_prefix = "--"; + opt = '?'; + required = 0; cpio->argument = NULL; /* First time through, initialize everything. */ @@ -169,7 +175,7 @@ cpio_getopt(struct cpio *cpio) if (opt == '\0') { /* End of this group; recurse to get next option. */ state = state_next_word; - return cpio_getopt(cpio); + goto again; } /* Does this option take an argument? */ diff --git a/contrib/libarchive/libarchive/archive.h b/contrib/libarchive/libarchive/archive.h index 2e3a9f31cd33..fd4dd20fad13 100644 --- a/contrib/libarchive/libarchive/archive.h +++ b/contrib/libarchive/libarchive/archive.h @@ -34,7 +34,7 @@ * assert that ARCHIVE_VERSION_NUMBER >= 2012108. */ /* Note: Compiler will complain if this does not match archive_entry.h! */ -#define ARCHIVE_VERSION_NUMBER 3007003 +#define ARCHIVE_VERSION_NUMBER 3007004 #include #include /* for wchar_t */ @@ -155,7 +155,7 @@ __LA_DECL int archive_version_number(void); /* * Textual name/version of the library, useful for version displays. */ -#define ARCHIVE_VERSION_ONLY_STRING "3.7.3" +#define ARCHIVE_VERSION_ONLY_STRING "3.7.4" #define ARCHIVE_VERSION_STRING "libarchive " ARCHIVE_VERSION_ONLY_STRING __LA_DECL const char * archive_version_string(void); @@ -895,7 +895,7 @@ __LA_DECL int archive_write_set_options(struct archive *_a, const char *opts); /* - * Set a encryption passphrase. + * Set an encryption passphrase. */ __LA_DECL int archive_write_set_passphrase(struct archive *_a, const char *p); __LA_DECL int archive_write_set_passphrase_callback(struct archive *, diff --git a/contrib/libarchive/libarchive/archive_entry.h b/contrib/libarchive/libarchive/archive_entry.h index df9cb765f7e8..1c59ded7c911 100644 --- a/contrib/libarchive/libarchive/archive_entry.h +++ b/contrib/libarchive/libarchive/archive_entry.h @@ -28,7 +28,7 @@ #define ARCHIVE_ENTRY_H_INCLUDED /* Note: Compiler will complain if this does not match archive.h! */ -#define ARCHIVE_VERSION_NUMBER 3007003 +#define ARCHIVE_VERSION_NUMBER 3007004 /* * Note: archive_entry.h is for use outside of libarchive; the diff --git a/contrib/libarchive/libarchive/archive_entry_acl.3 b/contrib/libarchive/libarchive/archive_entry_acl.3 index 50dd642c20c6..4d0d8b50ed07 100644 --- a/contrib/libarchive/libarchive/archive_entry_acl.3 +++ b/contrib/libarchive/libarchive/archive_entry_acl.3 @@ -383,7 +383,7 @@ Prefix each default ACL entry with the word The mask and other ACLs don not contain a double colon. .El .Pp -The following flags are effecive only on NFSv4 ACL: +The following flags are effective only on NFSv4 ACL: .Bl -tag -offset indent -compact -width ARCHIV .It Dv ARCHIVE_ENTRY_ACL_STYLE_COMPACT Do not output minus characters for unset permissions and flags in NFSv4 ACL diff --git a/contrib/libarchive/libarchive/archive_read_disk.3 b/contrib/libarchive/libarchive/archive_read_disk.3 index 7cde3c232713..990c1514c4d5 100644 --- a/contrib/libarchive/libarchive/archive_read_disk.3 +++ b/contrib/libarchive/libarchive/archive_read_disk.3 @@ -288,11 +288,11 @@ calls. If matched based on calls to .Tn archive_match_time_excluded , or .Tn archive_match_owner_excluded , -then the callback function specified by the _excluded_func parameter will execute. This function will recieve data provided to the fourth parameter, void *_client_data. +then the callback function specified by the _excluded_func parameter will execute. This function will receive data provided to the fourth parameter, void *_client_data. .It Fn archive_read_disk_set_metadata_filter_callback Allows the caller to set a callback function during calls to .Xr archive_read_header 3 -to filter out metadata for each entry. The callback function recieves the +to filter out metadata for each entry. The callback function receives the .Tn struct archive object, void* custom filter data, and the .Tn struct archive_entry . diff --git a/contrib/libarchive/libarchive/archive_read_support_format_7zip.c b/contrib/libarchive/libarchive/archive_read_support_format_7zip.c index 92495e628f9a..7e465935c902 100644 --- a/contrib/libarchive/libarchive/archive_read_support_format_7zip.c +++ b/contrib/libarchive/libarchive/archive_read_support_format_7zip.c @@ -2037,6 +2037,8 @@ read_Folder(struct archive_read *a, struct _7z_folder *f) if (parse_7zip_uint64( a, &(f->coders[i].propertiesSize)) < 0) return (-1); + if (UMAX_ENTRY < f->coders[i].propertiesSize) + return (-1); if ((p = header_bytes( a, (size_t)f->coders[i].propertiesSize)) == NULL) return (-1); diff --git a/contrib/libarchive/libarchive/archive_read_support_format_all.c b/contrib/libarchive/libarchive/archive_read_support_format_all.c index 5a4e1ab675a5..3b53c9ad5f57 100644 --- a/contrib/libarchive/libarchive/archive_read_support_format_all.c +++ b/contrib/libarchive/libarchive/archive_read_support_format_all.c @@ -67,7 +67,7 @@ archive_read_support_format_all(struct archive *a) * increase the chance that a high bid from someone else will * make it unnecessary for these to do anything at all. */ - /* These three have potentially large look-ahead. */ + /* These have potentially large look-ahead. */ archive_read_support_format_7zip(a); archive_read_support_format_cab(a); archive_read_support_format_rar(a); diff --git a/contrib/libarchive/libarchive/archive_read_support_format_ar.c b/contrib/libarchive/libarchive/archive_read_support_format_ar.c index ca8effb0b0ee..6f1be8591fef 100644 --- a/contrib/libarchive/libarchive/archive_read_support_format_ar.c +++ b/contrib/libarchive/libarchive/archive_read_support_format_ar.c @@ -270,7 +270,7 @@ _ar_read_header(struct archive_read *a, struct archive_entry *entry, } if (ar->strtab != NULL) { archive_set_error(&a->archive, EINVAL, - "More than one string tables exist"); + "More than one string table exists"); return (ARCHIVE_FATAL); } @@ -515,7 +515,7 @@ archive_read_format_ar_read_data(struct archive_read *a, if (ar->entry_padding) { if (skipped >= 0) { archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, - "Truncated ar archive- failed consuming padding"); + "Truncated ar archive - failed consuming padding"); } return (ARCHIVE_FATAL); } diff --git a/contrib/libarchive/libarchive/archive_read_support_format_lha.c b/contrib/libarchive/libarchive/archive_read_support_format_lha.c index 1c64b2900b8e..4d6290ac33bb 100644 --- a/contrib/libarchive/libarchive/archive_read_support_format_lha.c +++ b/contrib/libarchive/libarchive/archive_read_support_format_lha.c @@ -1693,7 +1693,7 @@ archive_read_format_lha_cleanup(struct archive_read *a) * example. * 1. a symbolic-name is 'aaa/bb/cc' * 2. a filename is 'xxx/bbb' - * then a archived pathname is 'xxx/bbb|aaa/bb/cc' + * then an archived pathname is 'xxx/bbb|aaa/bb/cc' */ static int lha_parse_linkname(struct archive_wstring *linkname, @@ -2385,7 +2385,7 @@ lzh_decode_blocks(struct lzh_stream *strm, int last) return (100); } - /* lzh_br_read_ahead() always try to fill the + /* lzh_br_read_ahead() always tries to fill the * cache buffer up. In specific situation we * are close to the end of the data, the cache * buffer will not be full and thus we have to diff --git a/contrib/libarchive/libarchive/archive_read_support_format_mtree.c b/contrib/libarchive/libarchive/archive_read_support_format_mtree.c index 630cff6e3999..6971228eefad 100644 --- a/contrib/libarchive/libarchive/archive_read_support_format_mtree.c +++ b/contrib/libarchive/libarchive/archive_read_support_format_mtree.c @@ -416,8 +416,8 @@ next_line(struct archive_read *a, } /* - * Compare characters with a mtree keyword. - * Returns the length of a mtree keyword if matched. + * Compare characters with an mtree keyword. + * Returns the length of an mtree keyword if matched. * Returns 0 if not matched. */ static int @@ -515,7 +515,7 @@ bid_keyword(const char *p, ssize_t len) /* * Test whether there is a set of mtree keywords. - * Returns the number of keyword. + * Returns the number of keywords. * Returns -1 if we got incorrect sequence. * This function expects a set of "keyword=value". * When "unset" is specified, expects a set of "keyword". @@ -760,7 +760,7 @@ detect_form(struct archive_read *a, int *is_form_d) multiline = 1; else { /* We've got plenty of correct lines - * to assume that this file is a mtree + * to assume that this file is an mtree * format. */ if (++entry_cnt >= MAX_BID_ENTRY) break; diff --git a/contrib/libarchive/libarchive/archive_read_support_format_rar.c b/contrib/libarchive/libarchive/archive_read_support_format_rar.c index 99a11d170074..4fc6626cacfd 100644 --- a/contrib/libarchive/libarchive/archive_read_support_format_rar.c +++ b/contrib/libarchive/libarchive/archive_read_support_format_rar.c @@ -2176,6 +2176,19 @@ read_data_compressed(struct archive_read *a, const void **buff, size_t *size, { start = rar->offset; end = start + rar->dictionary_size; + + /* We don't want to overflow the window and overwrite data that we write + * at 'start'. Therefore, reduce the end length by the maximum match size, + * which is 260 bytes. You can compute this maximum by looking at the + * definition of 'expand', in particular when 'symbol >= 271'. */ + /* NOTE: It's possible for 'dictionary_size' to be less than this 260 + * value, however that will only be the case when 'unp_size' is small, + * which should only happen when the entry size is small and there's no + * risk of overflowing the buffer */ + if (rar->dictionary_size > 260) { + end -= 260; + } + if (rar->filters.filterstart < end) { end = rar->filters.filterstart; } @@ -3599,7 +3612,15 @@ execute_filter_delta(struct rar_filter *filter, struct rar_virtual_machine *vm) { uint8_t lastbyte = 0; for (idx = i; idx < length; idx += numchannels) + { + /* + * The src block should not overlap with the dst block. + * If so it would be better to consider this archive is broken. + */ + if (src >= dst) + return 0; lastbyte = dst[idx] = lastbyte - *src++; + } } filter->filteredblockaddress = length; @@ -3615,7 +3636,7 @@ execute_filter_e8(struct rar_filter *filter, struct rar_virtual_machine *vm, siz uint32_t filesize = 0x1000000; uint32_t i; - if (length > PROGRAM_WORK_SIZE || length < 4) + if (length > PROGRAM_WORK_SIZE || length <= 4) return 0; for (i = 0; i <= length - 5; i++) @@ -3701,6 +3722,13 @@ execute_filter_audio(struct rar_filter *filter, struct rar_virtual_machine *vm) memset(&state, 0, sizeof(state)); for (j = i; j < length; j += numchannels) { + /* + * The src block should not overlap with the dst block. + * If so it would be better to consider this archive is broken. + */ + if (src >= dst) + return 0; + int8_t delta = (int8_t)*src++; uint8_t predbyte, byte; int prederror; diff --git a/contrib/libarchive/libarchive/archive_read_support_format_warc.c b/contrib/libarchive/libarchive/archive_read_support_format_warc.c index c49d44eba5e5..fcec5bc4cbb9 100644 --- a/contrib/libarchive/libarchive/archive_read_support_format_warc.c +++ b/contrib/libarchive/libarchive/archive_read_support_format_warc.c @@ -215,6 +215,7 @@ _warc_rdhdr(struct archive_read *a, struct archive_entry *entry) const char *buf; ssize_t nrd; const char *eoh; + char *tmp; /* for the file name, saves some strndup()'ing */ warc_string_t fnam; /* warc record type, not that we really use it a lot */ @@ -321,7 +322,14 @@ start_over: * malloc()+free() roundtrip */ if (fnam.len + 1U > w->pool.len) { w->pool.len = ((fnam.len + 64U) / 64U) * 64U; - w->pool.str = realloc(w->pool.str, w->pool.len); + tmp = realloc(w->pool.str, w->pool.len); + if (tmp == NULL) { + archive_set_error( + &a->archive, ENOMEM, + "Out of memory"); + return (ARCHIVE_FATAL); + } + w->pool.str = tmp; } memcpy(w->pool.str, fnam.str, fnam.len); w->pool.str[fnam.len] = '\0'; diff --git a/contrib/libarchive/libarchive/archive_read_support_format_xar.c b/contrib/libarchive/libarchive/archive_read_support_format_xar.c index fd63594373cb..cefb36410e77 100644 --- a/contrib/libarchive/libarchive/archive_read_support_format_xar.c +++ b/contrib/libarchive/libarchive/archive_read_support_format_xar.c @@ -2055,6 +2055,12 @@ xml_start(struct archive_read *a, const char *name, struct xmlattr_list *list) attr = attr->next) { if (strcmp(attr->name, "link") != 0) continue; + if (xar->file->hdnext != NULL || xar->file->link != 0 || + xar->file == xar->hdlink_orgs) { + archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, + "File with multiple link attributes"); + return (ARCHIVE_FATAL); + } if (strcmp(attr->value, "original") == 0) { xar->file->hdnext = xar->hdlink_orgs; xar->hdlink_orgs = xar->file; @@ -3251,6 +3257,9 @@ expat_start_cb(void *userData, const XML_Char *name, const XML_Char **atts) struct xmlattr_list list; int r; + if (ud->state != ARCHIVE_OK) + return; + r = expat_xmlattr_setup(a, &list, atts); if (r == ARCHIVE_OK) r = xml_start(a, (const char *)name, &list); diff --git a/contrib/libarchive/libarchive/archive_read_support_format_zip.c b/contrib/libarchive/libarchive/archive_read_support_format_zip.c index 212bfff9fa7b..c9759eaf9a89 100644 --- a/contrib/libarchive/libarchive/archive_read_support_format_zip.c +++ b/contrib/libarchive/libarchive/archive_read_support_format_zip.c @@ -1393,7 +1393,7 @@ check_authentication_code(struct archive_read *a, const void *_p) * [CRC32] [compressed low] [compressed high] [uncompressed low] [uncompressed high] [other PK marker] * ``` * Since the 32-bit and 64-bit compressed sizes both match, the - * actualy size must fit in 32 bits, which implies the high-order + * actual size must fit in 32 bits, which implies the high-order * word of the compressed size is zero. So we know the uncompressed * low word is zero, which again implies that if we accept the shorter * format, there will not be a valid PK marker following it. @@ -4083,6 +4083,17 @@ slurp_central_directory(struct archive_read *a, struct archive_entry* entry, } else { /* Generate resource fork name to find its * resource file at zip->tree_rsrc. */ + + /* If this is an entry ending with slash, + * make the resource for name slash-less + * as the actual resource fork doesn't end with '/'. + */ + size_t tmp_length = filename_length; + if (tmp_length > 0 && name[tmp_length - 1] == '/') { + tmp_length--; + r = rsrc_basename(name, tmp_length); + } + archive_strcpy(&(zip_entry->rsrcname), "__MACOSX/"); archive_strncat(&(zip_entry->rsrcname), @@ -4090,7 +4101,7 @@ slurp_central_directory(struct archive_read *a, struct archive_entry* entry, archive_strcat(&(zip_entry->rsrcname), "._"); archive_strncat(&(zip_entry->rsrcname), name + (r - name), - filename_length - (r - name)); + tmp_length - (r - name)); /* Register an entry to RB tree to sort it by * file offset. */ __archive_rb_tree_insert_node(&zip->tree, diff --git a/contrib/libarchive/libarchive/archive_util.c b/contrib/libarchive/libarchive/archive_util.c index 32d4bd40988c..7b918fef04b8 100644 --- a/contrib/libarchive/libarchive/archive_util.c +++ b/contrib/libarchive/libarchive/archive_util.c @@ -255,10 +255,9 @@ __archive_mktempx(const char *tmpdir, wchar_t *template) #endif fd = -1; ws = NULL; + archive_string_init(&temp_name); if (template == NULL) { - archive_string_init(&temp_name); - /* Get a temporary directory. */ if (tmpdir == NULL) { size_t l; diff --git a/contrib/libarchive/libarchive/archive_write_add_filter_zstd.c b/contrib/libarchive/libarchive/archive_write_add_filter_zstd.c index 94249accd08b..7ea3d18c9b76 100644 --- a/contrib/libarchive/libarchive/archive_write_add_filter_zstd.c +++ b/contrib/libarchive/libarchive/archive_write_add_filter_zstd.c @@ -29,6 +29,9 @@ #ifdef HAVE_ERRNO_H #include #endif +#ifdef HAVE_LIMITS_H +#include +#endif #ifdef HAVE_STDINT_H #include #endif @@ -38,6 +41,9 @@ #ifdef HAVE_STRING_H #include #endif +#ifdef HAVE_UNISTD_H +#include +#endif #ifdef HAVE_ZSTD_H #include #endif @@ -190,6 +196,7 @@ string_to_number(const char *string, intmax_t *numberp) return (ARCHIVE_OK); } +#if HAVE_ZSTD_H && HAVE_ZSTD_compressStream static int string_to_size(const char *string, size_t *numberp) { @@ -224,6 +231,7 @@ string_to_size(const char *string, size_t *numberp) *numberp = (size_t)(number << shift); return (ARCHIVE_OK); } +#endif /* * Set write options. @@ -264,7 +272,20 @@ archive_compressor_zstd_options(struct archive_write_filter *f, const char *key, if (string_to_number(value, &threads) != ARCHIVE_OK) { return (ARCHIVE_WARN); } - if (threads < 0) { + +#if defined(HAVE_SYSCONF) && defined(_SC_NPROCESSORS_ONLN) + if (threads == 0) { + threads = sysconf(_SC_NPROCESSORS_ONLN); + } +#elif !defined(__CYGWIN__) && defined(_WIN32_WINNT) && \ + _WIN32_WINNT >= 0x0601 /* _WIN32_WINNT_WIN7 */ + if (threads == 0) { + DWORD winCores = GetActiveProcessorCount( + ALL_PROCESSOR_GROUPS); + threads = (intmax_t)winCores; + } +#endif + if (threads < 0 || threads > INT_MAX) { return (ARCHIVE_WARN); } data->threads = (int)threads; diff --git a/contrib/libarchive/libarchive/archive_write_disk_posix.c b/contrib/libarchive/libarchive/archive_write_disk_posix.c index f671bc6db747..d69c77ea0517 100644 --- a/contrib/libarchive/libarchive/archive_write_disk_posix.c +++ b/contrib/libarchive/libarchive/archive_write_disk_posix.c @@ -4427,7 +4427,8 @@ fixup_appledouble(struct archive_write_disk *a, const char *pathname) #else la_stat(datafork.s, &st) == -1 || #endif - (st.st_mode & AE_IFMT) != AE_IFREG) + (((st.st_mode & AE_IFMT) != AE_IFREG) && + ((st.st_mode & AE_IFMT) != AE_IFDIR))) goto skip_appledouble; /* diff --git a/contrib/libarchive/libarchive/archive_write_private.h b/contrib/libarchive/libarchive/archive_write_private.h index abd5a8ddcd85..f259ccb16546 100644 --- a/contrib/libarchive/libarchive/archive_write_private.h +++ b/contrib/libarchive/libarchive/archive_write_private.h @@ -158,7 +158,7 @@ int __archive_write_program_write(struct archive_write_filter *, struct archive_write_program_data *, const void *, size_t); /* - * Get a encryption passphrase. + * Get an encryption passphrase. */ const char * __archive_write_get_passphrase(struct archive_write *a); #endif diff --git a/contrib/libarchive/libarchive/archive_write_set_format_gnutar.c b/contrib/libarchive/libarchive/archive_write_set_format_gnutar.c index 92b06c5f5fb4..a88350b87411 100644 --- a/contrib/libarchive/libarchive/archive_write_set_format_gnutar.c +++ b/contrib/libarchive/libarchive/archive_write_set_format_gnutar.c @@ -387,7 +387,7 @@ archive_write_gnutar_header(struct archive_write *a, if (r != 0) { if (errno == ENOMEM) { archive_set_error(&a->archive, ENOMEM, - "Can't allocate memory for Pathame"); + "Can't allocate memory for pathname"); ret = ARCHIVE_FATAL; goto exit_write_header; } diff --git a/contrib/libarchive/libarchive/archive_write_set_passphrase.c b/contrib/libarchive/libarchive/archive_write_set_passphrase.c index 977fc4a9ee6b..f871c8e2f810 100644 --- a/contrib/libarchive/libarchive/archive_write_set_passphrase.c +++ b/contrib/libarchive/libarchive/archive_write_set_passphrase.c @@ -30,14 +30,9 @@ #endif #include "archive_write_private.h" -int -archive_write_set_passphrase(struct archive *_a, const char *p) +static int +set_passphrase(struct archive_write *a, const char *p) { - struct archive_write *a = (struct archive_write *)_a; - - archive_check_magic(_a, ARCHIVE_WRITE_MAGIC, ARCHIVE_STATE_NEW, - "archive_write_set_passphrase"); - if (p == NULL || p[0] == '\0') { archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Empty passphrase is unacceptable"); @@ -54,6 +49,18 @@ archive_write_set_passphrase(struct archive *_a, const char *p) } +int +archive_write_set_passphrase(struct archive *_a, const char *p) +{ + struct archive_write *a = (struct archive_write *)_a; + + archive_check_magic(_a, ARCHIVE_WRITE_MAGIC, ARCHIVE_STATE_NEW, + "archive_write_set_passphrase"); + + return (set_passphrase(a, p)); +} + + int archive_write_set_passphrase_callback(struct archive *_a, void *client_data, archive_passphrase_callback *cb) @@ -80,15 +87,9 @@ __archive_write_get_passphrase(struct archive_write *a) const char *p; p = a->passphrase_callback(&a->archive, a->passphrase_client_data); - if (p != NULL) { - a->passphrase = strdup(p); - if (a->passphrase == NULL) { - archive_set_error(&a->archive, ENOMEM, - "Can't allocate data for passphrase"); - return (NULL); - } - return (a->passphrase); - } + set_passphrase(a, p); + a->passphrase_callback = NULL; + a->passphrase_client_data = NULL; } - return (NULL); + return (a->passphrase); } diff --git a/contrib/libarchive/libarchive/libarchive_internals.3 b/contrib/libarchive/libarchive/libarchive_internals.3 index d4696f648292..2978b48c3e97 100644 --- a/contrib/libarchive/libarchive/libarchive_internals.3 +++ b/contrib/libarchive/libarchive/libarchive_internals.3 @@ -124,7 +124,7 @@ to read the entire file into memory at once and return the entire file to libarchive as a single block; other clients may begin asynchronous I/O operations for the next block on each request. -.Ss Decompresssion Layer +.Ss Decompression Layer The decompression layer not only handles decompression, it also buffers data so that the format handlers see a much nicer I/O model. diff --git a/contrib/libarchive/libarchive/test/test_read_format_xar_doublelink.c b/contrib/libarchive/libarchive/test/test_read_format_xar_doublelink.c new file mode 100644 index 000000000000..78d6626a09bf --- /dev/null +++ b/contrib/libarchive/libarchive/test/test_read_format_xar_doublelink.c @@ -0,0 +1,55 @@ +/*- + * Copyright (c) 2024 Martin Matuska + * All rights reserved. + * + * 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(S) ``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(S) 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 "test.h" + +#define __LIBARCHIVE_BUILD + +DEFINE_TEST(test_read_format_xar_doublelink) +{ + const char *refname = "test_read_format_xar_doublelink.xar"; + struct archive *a; + struct archive_entry *ae; + + extract_reference_file(refname); + + /* Verify with seeking reader. */ + assert((a = archive_read_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a)); + if(ARCHIVE_OK != archive_read_support_format_xar(a)) { + skipping("XAR format unsupported"); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); + return; + } + assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, refname, + 10240)); + + assertA(ARCHIVE_FATAL == archive_read_next_header(a, &ae)); + assertEqualString(archive_error_string(a), + "File with multiple link attributes"); + assert(archive_errno(a) != 0); + + assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); +} diff --git a/contrib/libarchive/libarchive/test/test_read_format_xar_doublelink.xar.uu b/contrib/libarchive/libarchive/test/test_read_format_xar_doublelink.xar.uu new file mode 100644 index 000000000000..7aa638a86e7c --- /dev/null +++ b/contrib/libarchive/libarchive/test/test_read_format_xar_doublelink.xar.uu @@ -0,0 +1,12 @@ +begin 664 test_read_format_xar_doublelink.xar +M>&%R(0`<``$````````!0`````````/7`````7B<[9/!D3&``]'1?GT!-1U;;:=[5[G<=WB0=P>^..@![<%Y94V# +M\R>*$9C6=LKT#7Y;OF8O>"%F_""=F"$^VC9\$&\=R#'LR$:E03#*RHR6&2N6 +MM*KIO,YS3JZ1M&D-[<;O-/+C<8`&^[7,<:P@;E:;52`R#5A6N?VQ@9CHIN.#_IY(['+:!!F4V#K5.],G+`8BU=%SU.8OF? +MH#*V`U%5K"@9)Z=5*G2P5RT8*YY+3J9%*ND(T?D\%/3$[U0GJ=W6T3=E+);&^E4=0%?0^#N\00;G(;8U7`]! #include static char * @@ -113,8 +114,7 @@ readpassphrase(const char *prompt, char *buf, size_t bufsiz, int flags) WriteFile(hStdout, "\r\n", 2, NULL, NULL); buf[rbytes] = '\0'; /* Remove trailing carriage return(s). */ - if (rbytes > 2 && buf[rbytes - 2] == '\r' && buf[rbytes - 1] == '\n') - buf[rbytes - 2] = '\0'; + buf[strcspn(buf, "\r\n")] = '\0'; return (buf); } diff --git a/contrib/libarchive/tar/bsdtar.1 b/contrib/libarchive/tar/bsdtar.1 index e570d2a48a01..fe9ec9504674 100644 --- a/contrib/libarchive/tar/bsdtar.1 +++ b/contrib/libarchive/tar/bsdtar.1 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd March 1, 2024 +.Dd April 23, 2024 .Dt TAR 1 .Os .Sh NAME @@ -644,14 +644,13 @@ A decimal integer from 4 to 7 specifying the lz4 compression block size .It Cm lz4:block-dependence Use the previous block of the block being compressed for a compression dictionary to improve compression ratio. -.It Cm zstd:compression-level -A decimal integer specifying the zstd compression level. Supported values depend +.It Cm zstd:compression-level Ns = Ns Ar N +A decimal integer specifying the zstd compression level. +Supported values depend on the library version, common values are from 1 to 22. -.It Cm zstd:threads -Specify the number of worker threads to use. -Setting threads to a special value 0 makes -.Xr zstd 1 -use as many threads as there are CPU cores on the system. +.It Cm zstd:threads Ns = Ns Ar N +Specify the number of worker threads to use, or 0 to use as many +threads as there are CPU cores in the system. .It Cm zstd:frame-per-file Start a new compression frame at the beginning of each file in the archive. diff --git a/contrib/libarchive/tar/bsdtar.c b/contrib/libarchive/tar/bsdtar.c index b070e0faeb66..42baab2861bd 100644 --- a/contrib/libarchive/tar/bsdtar.c +++ b/contrib/libarchive/tar/bsdtar.c @@ -157,6 +157,7 @@ main(int argc, char **argv) char *tptr, *uptr; char possible_help_request; char buff[16]; + long l; /* * Use a pointer for consistency, but stack-allocated storage @@ -301,16 +302,15 @@ main(int argc, char **argv) /* libarchive doesn't need this; just ignore it. */ break; case 'b': /* SUSv2 */ - errno = 0; tptr = NULL; - t = (int)strtol(bsdtar->argument, &tptr, 10); - if (errno || t <= 0 || t > 8192 || + l = strtol(bsdtar->argument, &tptr, 10); + if (l <= 0 || l > 8192L || *(bsdtar->argument) == '\0' || tptr == NULL || *tptr != '\0') { lafe_errc(1, 0, "Invalid or out of range " "(1..8192) argument to -b"); } - bsdtar->bytes_per_block = 512 * t; + bsdtar->bytes_per_block = 512 * (int)l; /* Explicit -b forces last block size. */ bsdtar->bytes_in_last_block = bsdtar->bytes_per_block; break; @@ -369,44 +369,42 @@ main(int argc, char **argv) bsdtar->filename = bsdtar->argument; break; *** 261 LINES SKIPPED *** From nobody Tue Apr 30 09:46:42 2024 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 4VTFhf6zNhz5JcP7; Tue, 30 Apr 2024 09:46:42 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (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 "freefall.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VTFhf6B4nz4Dxn; Tue, 30 Apr 2024 09:46:42 +0000 (UTC) (envelope-from danfe@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714470402; 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: in-reply-to:in-reply-to:references:references; bh=DlQAyOMiADFfo/pGAxuU+8Um4KVb5gJK3fKs8zrdkI0=; b=DWHsTa1ctl5tvAui/chDaYaVF/ObjE19ZDG7S0SCSpiz7Uu0pHRYlav2w30bX09Vu1WSdh RNRzwPOB+OerrMcHU586ZFxUiu6B15ytD9cMFuNTphRQQrr/xvkeG65WHxvh2qSS1I1n2U d+Y9B+IHMRY9/RkG5WXJSMyiTcKWm/rwT4hgrWbczhc5XWuCuTCjT0Yt7MWwfRNmhbr+fu aXJHRJX9WnexXEOd/2Vb+Lncg/xBdt9KZkX8VoB6E7Wz9/ldKyeBgprkGo2mdzx+spVDLr vvNGvaiHqW5ZKx8H8p2/dPTdToTcOtu84mRWMI8vtag6Z1uyojry8aRYNw6HeA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714470402; a=rsa-sha256; cv=none; b=NtZqehGitYEUNyJt/VIcMA6DlQ/xH26tBk2zhMyF4du+SJYxFrecYnZcmUBA5si3r1OAbl RiRFiDOQgzD5cgDemZBopp5C+yOAAf4yF3NxYfrKz5hdH17a5KA3w81d6938EnI+o045PT GPpKmEztyDxmHBKvQcnNE75p4gHlusuMIHNnDDNC3S+yjv+kCVi3fdNRdG7nM9vhKDSTDP gW322jAP7h/fmYXudC0H67KS06HmPDkXYebqQnGdZz5+Zi2jDqXHDl83DfmSUT+zouV7OL TXwlUEg5EDFot4aqfCORpTP3x+Ib2pO/O9xlIgYotMkVTE5k1oArrHED8+9GLQ== 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=1714470402; 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: in-reply-to:in-reply-to:references:references; bh=DlQAyOMiADFfo/pGAxuU+8Um4KVb5gJK3fKs8zrdkI0=; b=OdmbXwG3Ue/RXqbVoptPC2AzlMUHen07EzuF4Fgg1SI3UvKMPgJ2ghPg/sKwFxLHFeLBAu YI9f3QdYGW6SsKtBIW7SiX44WXbmU7aqtzl0mDXud23KbHmP1Y9H2j34Ci4Nj/usqaXaF1 DSWTOLDxd0fWnHSzUOncRhzfg4zRpNHtcJ9DG8L4a6Qz9KlCVnGw9i07HPO/LZTdtKcZtG q3u6Zyz8sHu08B+/QJhWfTYD4FxAVrh+jo7y6nBOP7OfiQFyDnPcc0WzkDJCXrnn7s1tYA e1MV9UDiVA1x5A7z+k+PwqigPD0gnEZZiRptv2pSUld7wQU4XfH39CDijYKyqA== Received: by freefall.freebsd.org (Postfix, from userid 1033) id A256112138; Tue, 30 Apr 2024 09:46:42 +0000 (UTC) Date: Tue, 30 Apr 2024 09:46:42 +0000 From: Alexey Dokuchaev To: Gordon Bergling Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-branches@freebsd.org Subject: Re: git: 770e03ac3913 - stable/14 - wtap: Fix typos in kernel messages Message-ID: References: <202404280520.43S5Ku2S096796@gitrepo.freebsd.org> List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202404280520.43S5Ku2S096796@gitrepo.freebsd.org> On Sun, Apr 28, 2024 at 05:20:56AM +0000, Gordon Bergling wrote: > commit 770e03ac3913685733ec2d634b457664e1dd7904 > > wtap: Fix typos in kernel messages > > - s/cant/can't/ Wouldn't it make sense to take one step further and spell those as "cannot"? ./danfe From nobody Wed May 1 01:06:13 2024 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 4VTf5d5ZPQz5HmhC; Wed, 1 May 2024 01:06:13 +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 4VTf5d53G3z4rTC; Wed, 1 May 2024 01:06:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714525573; 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=nEH/B7qpJCt6NLtheh6AJGMcAaQB5y197Ze7SXFih5c=; b=Db93IIHxT3NG/GRujdrOUEVVobpDL0st0GFEWTEef9iW1SswGIVP3yWtluloFNZ4C11xNk zSb96ZeJn9FXDhOKq3OWxjPKg+s5C/Z5fJEeBndYYcFpnX9Qyu8fuoEaZVcFOtQlrwPcSk DQr9GnMjMdDZAIlfMpXzeKeg/+eT4jgBR5gjFZ4DJTs+ZSlYwBD7N4FiWU17ebXix8Nj+Y +f75Y1nz1BjII+yJtamcXD6Wd/HOsrHquDH4tzkXEu6eePaBkmM7pR+H8on4WBPJyTnoHd tmxj1whdLTOIoVN5jqqyBT2f2uzHUx9Sr4cvSvsV75g1xlVhn+awOXdNTCQVDQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714525573; a=rsa-sha256; cv=none; b=Li3ckkg06bxM1qWQhOfP/ZskgTxACSPEWxmnr2ZG51psYpzhMj7vnp5b2YY2eLjki2+djv 7RSBPk7E4sP4fLk2XMtU4jIu2ehkCWhaDUQkwICw4tEKL2H6gP00IOBNza0mobu2gvDTZC 9Dnih9iINhbWU9n/zzn9yW3zSPPTvsXdBv7L3tqvqXjLFSU1XzcmFTNXLumy5K9J+mjXzt Bbc39qg9Fm7i0zL6ViEHg+aLdAE5ZVwllvmuGsTEQgkq7KzbigGZdpdG11f64eN6EhoQQx yxDjnCgb4Qc1oJHcjkaCMQBu6riGEBc0oiYbWttuuNCQpU2J/Nx7ABSqBO8t9A== 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=1714525573; 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=nEH/B7qpJCt6NLtheh6AJGMcAaQB5y197Ze7SXFih5c=; b=ets8E0xRSiha5WxZCBvXt3VdOIer4k7mkRs6vKtTgK0z/5pGv0sHYuATtjHdgknjX+lFdD TICwE6yMQ2IFBU3RAwc2qdAxSGSnVDYUVwhndZ0qIEsTLJtYgmMYmMzbcyRqGkgtwcn7eJ wJLpop5NCsdpPTuJ2SqW0xAZ+rKUsoHXAF2MxNDmxGrIZCocAOPGzlJk9BGTy5twnRmVgp SVe+l0wFzxAj0+gnKspmatVyxTLXakBS3xx1RAt2/u+ER8cMdpX7OJ0pPtHkN/d7Bew1UD Acv9LWeNiyRJKQ2LTI8UWufqS5rAQsnKN6GMvarxtkQwJoRwoT876I/yaZ5pUQ== 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 4VTf5d4fcLzyLf; Wed, 1 May 2024 01:06: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 44116Dra086636; Wed, 1 May 2024 01:06:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44116Ddf086633; Wed, 1 May 2024 01:06:13 GMT (envelope-from git) Date: Wed, 1 May 2024 01:06:13 GMT Message-Id: <202405010106.44116Ddf086633@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: c91861cc216d - stable/14 - nfscl: Do not use nfso_own for delayed nfsrpc_doclose() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c91861cc216d5fdd4824eaace53d08c372f6cf73 Auto-Submitted: auto-generated The branch stable/14 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=c91861cc216d5fdd4824eaace53d08c372f6cf73 commit c91861cc216d5fdd4824eaace53d08c372f6cf73 Author: Rick Macklem AuthorDate: 2024-04-26 03:58:21 +0000 Commit: Rick Macklem CommitDate: 2024-05-01 01:04:52 +0000 nfscl: Do not use nfso_own for delayed nfsrpc_doclose() When an initial attempt to close an NFSv4 lock returns NFSERR_DELAY, the open structure is put on a list for delayed closing. When this is done, the nfso_own field is set to NULL, so it cannot be used by nfsrpc_doclose(). Without this patch, the NFSv4 client can crash when a NFSv4 server replies NFSERR_DELAY to a Close operation. Fortunately, most extant NFSv4 servers do not do this. This patch avoids the crash for any that do return NFSERR_DELAY for Close. Found during a IETF bakeathon testing event this week. (cherry picked from commit 6251027c4252edb3b8f8fc359a40e610349e9af3) --- sys/fs/nfsclient/nfs_clrpcops.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c index 75bb5236cb65..8c5532268287 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -826,6 +826,7 @@ nfsrpc_doclose(struct nfsmount *nmp, struct nfsclopen *op, NFSPROC_T *p, u_int64_t off = 0, len = 0; u_int32_t type = NFSV4LOCKT_READ; int error, do_unlock, trycnt; + bool own_not_null; tcred = newnfs_getcred(); newnfs_copycred(&op->nfso_cred, tcred); @@ -892,22 +893,29 @@ nfsrpc_doclose(struct nfsmount *nmp, struct nfsclopen *op, NFSPROC_T *p, * There could be other Opens for different files on the same * OpenOwner, so locking is required. */ - NFSLOCKCLSTATE(); - nfscl_lockexcl(&op->nfso_own->nfsow_rwlock, NFSCLSTATEMUTEXPTR); - NFSUNLOCKCLSTATE(); + own_not_null = false; + if (op->nfso_own != NULL) { + own_not_null = true; + NFSLOCKCLSTATE(); + nfscl_lockexcl(&op->nfso_own->nfsow_rwlock, NFSCLSTATEMUTEXPTR); + NFSUNLOCKCLSTATE(); + } do { error = nfscl_tryclose(op, tcred, nmp, p, loop_on_delayed); if (error == NFSERR_GRACE) (void) nfs_catnap(PZERO, error, "nfs_close"); } while (error == NFSERR_GRACE); - NFSLOCKCLSTATE(); - nfscl_lockunlock(&op->nfso_own->nfsow_rwlock); + if (own_not_null) { + NFSLOCKCLSTATE(); + nfscl_lockunlock(&op->nfso_own->nfsow_rwlock); + } LIST_FOREACH_SAFE(lp, &op->nfso_lock, nfsl_list, nlp) nfscl_freelockowner(lp, 0); if (freeop && error != NFSERR_DELAY) nfscl_freeopen(op, 0, true); - NFSUNLOCKCLSTATE(); + if (own_not_null) + NFSUNLOCKCLSTATE(); NFSFREECRED(tcred); return (error); } From nobody Wed May 1 01:11:27 2024 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 4VTfCg67m9z5HnM3; Wed, 1 May 2024 01:11: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 4VTfCg5w21z4sqT; Wed, 1 May 2024 01:11:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714525887; 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=C6gx64t1Pz0FktO5X3Q++EDMz/ng4HQNxaWt4H/4kBU=; b=bGjMrB3dqVNGZv9tGNmBKyLaXMdFm90UKcwLqNkbG1VSbU3XcZumo/9qcEeWRIg3qgNJlO 0nuw61NnCJ+ISdainZwbqsSYM+K0Op3jID8M23hREOer5VAmCgmLD3XC/Sf3DcLBBi13Cw Mz8ta1uLcAMxrhYFBKNlHqoa5LrtjVMJDHAPycXImTGESUPRK9fIXsacow9/xmNw3/YIV+ sqZrdvS/SP71fJuEw1bFTPsru/LJNJIbdO0xINpENdaPQ33+Ce14XGO14p0Uu/AGJ083hm 5PLXnUN4kIf7cY5ImVDza/3LUMk047Pphh2fOWrHt8mElAmxN+BiVsicLGO24g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714525887; a=rsa-sha256; cv=none; b=HU6CoqqL3vntt0hdoqzkYZN+wmmkeSmlFsDc68KUhNTXhxiW5dQoLTc2qrDJYJJorZgOq+ d7dKxSYXchahCjP/BTXur4uF/hoyTHhDqa6Mdj68Fc4MNxnT3Wphfd30dc6VfXZ7pgefV9 rbVDuOTLg0q5O8jS0VMws+dNKu4CBBOrNz2iaSGZO++fUzB3vTRaZEm5Q9ygMcNYh+5OmW oFt8Lgf1LoV/NFhtN5GCxjwNYfzvN0gmYRyeE2laVPGfIoNu77Ol7l9spWVtiyrS9eipQv 6PDeZbyfK8fUIYTuy/IqdL+WwPQL3UuN9EYThAomfMkoqfWWpF/PbxsQTRxaPg== 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=1714525887; 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=C6gx64t1Pz0FktO5X3Q++EDMz/ng4HQNxaWt4H/4kBU=; b=Z4XijRX0EDFBG73x++/grfoJdli//R39lg0UBpCx/FKGL6C0QCtevDz76O0WjCx6Mf/6XU liyX6M5XVNx3UeXCgpJBKKg+I0jX7jFE/qQUj3jow89QB0avuxfY3r4ZpaJK7JUkhPzcBF e2rjpIWwpTi50R2BWbl8x/lA93yw00KYM51gJIp90ZhxDWkIhgjn30DFCrtKpp4slVvdaA UOiuXULB8Ofhwycay02dV0jjY3RAATxN+Ftc6LJTRLuODhXv8BcMWABSE0jaevFN2eovlf iWpRq6g2CrpnnJQcxa33Qwf+R+NdoMyiqSzXWjYFyQQ+VBDxix8S9/LY3SHaMg== 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 4VTfCg5WgPzyNW; Wed, 1 May 2024 01:11: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 4411BRVl095883; Wed, 1 May 2024 01:11:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4411BRkB095881; Wed, 1 May 2024 01:11:27 GMT (envelope-from git) Date: Wed, 1 May 2024 01:11:27 GMT Message-Id: <202405010111.4411BRkB095881@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: a3b8266f5420 - stable/14 - nfscl: Clear out a lot of cruft related to B_DIRECT List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a3b8266f5420601e231bc08c5402d9a4929fbdc0 Auto-Submitted: auto-generated The branch stable/14 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=a3b8266f5420601e231bc08c5402d9a4929fbdc0 commit a3b8266f5420601e231bc08c5402d9a4929fbdc0 Author: Rick Macklem AuthorDate: 2024-04-28 00:10:48 +0000 Commit: Rick Macklem CommitDate: 2024-05-01 01:06:36 +0000 nfscl: Clear out a lot of cruft related to B_DIRECT There is only one place in the unpatched sources where B_DIRECT is set in the NFS client and this code is never executed. As such, this patch removes this code that is never executed, since B_DIRECT should never be set. During a IETF testing event this week, I saw a crash in ncl_doio_directwrite(), but this function is only called if B_DIRECT is set. I cannot explain how ncl_doio_directwrite() got called, but once this patch was applied to the sources, the crash did not recur. This is not surprising, since this patch deleted the function. (cherry picked from commit 03a39a17089adc1d0e28076670e664dcdebccf73) --- sys/fs/nfs/nfs_commonport.c | 1 - sys/fs/nfs/nfsport.h | 2 - sys/fs/nfsclient/nfs.h | 1 - sys/fs/nfsclient/nfs_clbio.c | 237 ++++++++-------------------------------- sys/fs/nfsclient/nfs_clnfsiod.c | 19 ++-- sys/fs/nfsclient/nfs_clvnops.c | 24 +--- sys/fs/nfsclient/nfsnode.h | 3 - 7 files changed, 57 insertions(+), 230 deletions(-) diff --git a/sys/fs/nfs/nfs_commonport.c b/sys/fs/nfs/nfs_commonport.c index cfceaf604b13..2db9af5b9ea9 100644 --- a/sys/fs/nfs/nfs_commonport.c +++ b/sys/fs/nfs/nfs_commonport.c @@ -121,7 +121,6 @@ MALLOC_DEFINE(M_NEWNFSCLCLIENT, "NFSCL client", "NFSCL Client"); MALLOC_DEFINE(M_NEWNFSCLLOCKOWNER, "NFSCL lckown", "NFSCL Lock Owner"); MALLOC_DEFINE(M_NEWNFSCLLOCK, "NFSCL lck", "NFSCL Lock"); MALLOC_DEFINE(M_NEWNFSV4NODE, "NEWNFSnode", "NFS vnode"); -MALLOC_DEFINE(M_NEWNFSDIRECTIO, "NEWdirectio", "NFS Direct IO buffer"); MALLOC_DEFINE(M_NEWNFSDIROFF, "NFSCL diroff", "NFS directory offset data"); MALLOC_DEFINE(M_NEWNFSDROLLBACK, "NFSD rollback", diff --git a/sys/fs/nfs/nfsport.h b/sys/fs/nfs/nfsport.h index 7e88ccdaffa1..0b16ba9b85a8 100644 --- a/sys/fs/nfs/nfsport.h +++ b/sys/fs/nfs/nfsport.h @@ -938,7 +938,6 @@ MALLOC_DECLARE(M_NEWNFSCLLOCKOWNER); MALLOC_DECLARE(M_NEWNFSCLLOCK); MALLOC_DECLARE(M_NEWNFSDIROFF); MALLOC_DECLARE(M_NEWNFSV4NODE); -MALLOC_DECLARE(M_NEWNFSDIRECTIO); MALLOC_DECLARE(M_NEWNFSMNT); MALLOC_DECLARE(M_NEWNFSDROLLBACK); MALLOC_DECLARE(M_NEWNFSLAYOUT); @@ -965,7 +964,6 @@ MALLOC_DECLARE(M_NEWNFSDSESSION); #define M_NFSCLLOCK M_NEWNFSCLLOCK #define M_NFSDIROFF M_NEWNFSDIROFF #define M_NFSV4NODE M_NEWNFSV4NODE -#define M_NFSDIRECTIO M_NEWNFSDIRECTIO #define M_NFSDROLLBACK M_NEWNFSDROLLBACK #define M_NFSLAYOUT M_NEWNFSLAYOUT #define M_NFSFLAYOUT M_NEWNFSFLAYOUT diff --git a/sys/fs/nfsclient/nfs.h b/sys/fs/nfsclient/nfs.h index aa755a6b5f4d..eeb68a434a6b 100644 --- a/sys/fs/nfsclient/nfs.h +++ b/sys/fs/nfsclient/nfs.h @@ -90,7 +90,6 @@ enum nfsiod_state { * Function prototypes. */ int ncl_meta_setsize(struct vnode *, struct thread *, u_quad_t); -void ncl_doio_directwrite(struct buf *); int ncl_bioread(struct vnode *, struct uio *, int, struct ucred *); int ncl_biowrite(struct vnode *, struct uio *, int, struct ucred *); int ncl_vinvalbuf(struct vnode *, int, struct thread *, int); diff --git a/sys/fs/nfsclient/nfs_clbio.c b/sys/fs/nfsclient/nfs_clbio.c index 9a471f6681ca..43f3de8fa2d3 100644 --- a/sys/fs/nfsclient/nfs_clbio.c +++ b/sys/fs/nfsclient/nfs_clbio.c @@ -767,144 +767,58 @@ static int nfs_directio_write(struct vnode *vp, struct uio *uiop, struct ucred *cred, int ioflag) { - int error; + struct uio uio; + struct iovec iov; struct nfsmount *nmp = VFSTONFS(vp->v_mount); struct thread *td = uiop->uio_td; - int size; - int wsize; + int error, iomode, must_commit, size, wsize; + KASSERT((ioflag & IO_SYNC) != 0, ("nfs_directio_write: not sync")); mtx_lock(&nmp->nm_mtx); wsize = nmp->nm_wsize; mtx_unlock(&nmp->nm_mtx); - if (ioflag & IO_SYNC) { - int iomode, must_commit; - struct uio uio; - struct iovec iov; -do_sync: - while (uiop->uio_resid > 0) { - size = MIN(uiop->uio_resid, wsize); - size = MIN(uiop->uio_iov->iov_len, size); - iov.iov_base = uiop->uio_iov->iov_base; - iov.iov_len = size; - uio.uio_iov = &iov; - uio.uio_iovcnt = 1; - uio.uio_offset = uiop->uio_offset; - uio.uio_resid = size; - uio.uio_segflg = uiop->uio_segflg; - uio.uio_rw = UIO_WRITE; - uio.uio_td = td; - iomode = NFSWRITE_FILESYNC; - /* - * When doing direct I/O we do not care if the - * server's write verifier has changed, but we - * do not want to update the verifier if it has - * changed, since that hides the change from - * writes being done through the buffer cache. - * By passing must_commit in set to two, the code - * in nfsrpc_writerpc() will not update the - * verifier on the mount point. - */ - must_commit = 2; - error = ncl_writerpc(vp, &uio, cred, &iomode, - &must_commit, 0, ioflag); - KASSERT((must_commit == 2), - ("ncl_directio_write: Updated write verifier")); - if (error) - return (error); - if (iomode != NFSWRITE_FILESYNC) - printf("nfs_directio_write: Broken server " - "did not reply FILE_SYNC\n"); - uiop->uio_offset += size; - uiop->uio_resid -= size; - if (uiop->uio_iov->iov_len <= size) { - uiop->uio_iovcnt--; - uiop->uio_iov++; - } else { - uiop->uio_iov->iov_base = - (char *)uiop->uio_iov->iov_base + size; - uiop->uio_iov->iov_len -= size; - } - } - } else { - struct uio *t_uio; - struct iovec *t_iov; - struct buf *bp; - + while (uiop->uio_resid > 0) { + size = MIN(uiop->uio_resid, wsize); + size = MIN(uiop->uio_iov->iov_len, size); + iov.iov_base = uiop->uio_iov->iov_base; + iov.iov_len = size; + uio.uio_iov = &iov; + uio.uio_iovcnt = 1; + uio.uio_offset = uiop->uio_offset; + uio.uio_resid = size; + uio.uio_segflg = uiop->uio_segflg; + uio.uio_rw = UIO_WRITE; + uio.uio_td = td; + iomode = NFSWRITE_FILESYNC; /* - * Break up the write into blocksize chunks and hand these - * over to nfsiod's for write back. - * Unfortunately, this incurs a copy of the data. Since - * the user could modify the buffer before the write is - * initiated. - * - * The obvious optimization here is that one of the 2 copies - * in the async write path can be eliminated by copying the - * data here directly into mbufs and passing the mbuf chain - * down. But that will require a fair amount of re-working - * of the code and can be done if there's enough interest - * in NFS directio access. + * When doing direct I/O we do not care if the + * server's write verifier has changed, but we + * do not want to update the verifier if it has + * changed, since that hides the change from + * writes being done through the buffer cache. + * By passing must_commit in set to two, the code + * in nfsrpc_writerpc() will not update the + * verifier on the mount point. */ - while (uiop->uio_resid > 0) { - size = MIN(uiop->uio_resid, wsize); - size = MIN(uiop->uio_iov->iov_len, size); - bp = uma_zalloc(ncl_pbuf_zone, M_WAITOK); - t_uio = malloc(sizeof(struct uio), M_NFSDIRECTIO, M_WAITOK); - t_iov = malloc(sizeof(struct iovec), M_NFSDIRECTIO, M_WAITOK); - t_iov->iov_base = malloc(size, M_NFSDIRECTIO, M_WAITOK); - t_iov->iov_len = size; - t_uio->uio_iov = t_iov; - t_uio->uio_iovcnt = 1; - t_uio->uio_offset = uiop->uio_offset; - t_uio->uio_resid = size; - t_uio->uio_segflg = UIO_SYSSPACE; - t_uio->uio_rw = UIO_WRITE; - t_uio->uio_td = td; - KASSERT(uiop->uio_segflg == UIO_USERSPACE || - uiop->uio_segflg == UIO_SYSSPACE, - ("nfs_directio_write: Bad uio_segflg")); - if (uiop->uio_segflg == UIO_USERSPACE) { - error = copyin(uiop->uio_iov->iov_base, - t_iov->iov_base, size); - if (error != 0) - goto err_free; - } else - /* - * UIO_SYSSPACE may never happen, but handle - * it just in case it does. - */ - bcopy(uiop->uio_iov->iov_base, t_iov->iov_base, - size); - bp->b_flags |= B_DIRECT; - bp->b_iocmd = BIO_WRITE; - if (cred != NOCRED) { - crhold(cred); - bp->b_wcred = cred; - } else - bp->b_wcred = NOCRED; - bp->b_caller1 = (void *)t_uio; - bp->b_vp = vp; - error = ncl_asyncio(nmp, bp, NOCRED, td); -err_free: - if (error) { - free(t_iov->iov_base, M_NFSDIRECTIO); - free(t_iov, M_NFSDIRECTIO); - free(t_uio, M_NFSDIRECTIO); - bp->b_vp = NULL; - uma_zfree(ncl_pbuf_zone, bp); - if (error == EINTR) - return (error); - goto do_sync; - } - uiop->uio_offset += size; - uiop->uio_resid -= size; - if (uiop->uio_iov->iov_len <= size) { - uiop->uio_iovcnt--; - uiop->uio_iov++; - } else { - uiop->uio_iov->iov_base = - (char *)uiop->uio_iov->iov_base + size; - uiop->uio_iov->iov_len -= size; - } + must_commit = 2; + error = ncl_writerpc(vp, &uio, cred, &iomode, + &must_commit, 0, ioflag); + KASSERT(must_commit == 2, + ("ncl_directio_write: Updated write verifier")); + if (error != 0) + return (error); + if (iomode != NFSWRITE_FILESYNC) + printf("nfs_directio_write: Broken server " + "did not reply FILE_SYNC\n"); + uiop->uio_offset += size; + uiop->uio_resid -= size; + if (uiop->uio_iov->iov_len <= size) { + uiop->uio_iovcnt--; + uiop->uio_iov++; + } else { + uiop->uio_iov->iov_base = + (char *)uiop->uio_iov->iov_base + size; + uiop->uio_iov->iov_len -= size; } } return (0); @@ -1470,7 +1384,7 @@ ncl_vinvalbuf(struct vnode *vp, int flags, struct thread *td, int intrflg) nanouptime(&ts); NFSLOCKNODE(np); } - if (np->n_directio_asyncwr == 0 && (np->n_flag & NMODIFIED) != 0) { + if ((np->n_flag & NMODIFIED) != 0) { np->n_localmodtime = ts; np->n_flag &= ~NMODIFIED; } @@ -1615,12 +1529,8 @@ again: BUF_KERNPROC(bp); TAILQ_INSERT_TAIL(&nmp->nm_bufq, bp, b_freelist); nmp->nm_bufqlen++; - if ((bp->b_flags & B_DIRECT) && bp->b_iocmd == BIO_WRITE) { - NFSLOCKNODE(VTONFS(bp->b_vp)); - VTONFS(bp->b_vp)->n_flag |= NMODIFIED; - VTONFS(bp->b_vp)->n_directio_asyncwr++; - NFSUNLOCKNODE(VTONFS(bp->b_vp)); - } + KASSERT((bp->b_flags & B_DIRECT) == 0, + ("ncl_asyncio: B_DIRECT set")); NFSUNLOCKIOD(); return (0); } @@ -1635,59 +1545,6 @@ again: return (EIO); } -void -ncl_doio_directwrite(struct buf *bp) -{ - int iomode, must_commit; - struct uio *uiop = (struct uio *)bp->b_caller1; - char *iov_base = uiop->uio_iov->iov_base; - - iomode = NFSWRITE_FILESYNC; - uiop->uio_td = NULL; /* NULL since we're in nfsiod */ - /* - * When doing direct I/O we do not care if the - * server's write verifier has changed, but we - * do not want to update the verifier if it has - * changed, since that hides the change from - * writes being done through the buffer cache. - * By passing must_commit in set to two, the code - * in nfsrpc_writerpc() will not update the - * verifier on the mount point. - */ - must_commit = 2; - ncl_writerpc(bp->b_vp, uiop, bp->b_wcred, &iomode, &must_commit, 0, 0); - KASSERT((must_commit == 2), ("ncl_doio_directwrite: Updated write" - " verifier")); - if (iomode != NFSWRITE_FILESYNC) - printf("ncl_doio_directwrite: Broken server " - "did not reply FILE_SYNC\n"); - free(iov_base, M_NFSDIRECTIO); - free(uiop->uio_iov, M_NFSDIRECTIO); - free(uiop, M_NFSDIRECTIO); - if ((bp->b_flags & B_DIRECT) && bp->b_iocmd == BIO_WRITE) { - struct nfsnode *np = VTONFS(bp->b_vp); - NFSLOCKNODE(np); - if (NFSHASPNFS(VFSTONFS(bp->b_vp->v_mount))) { - /* - * Invalidate the attribute cache, since writes to a DS - * won't update the size attribute. - */ - np->n_attrstamp = 0; - } - np->n_directio_asyncwr--; - if (np->n_directio_asyncwr == 0) { - np->n_flag &= ~NMODIFIED; - if ((np->n_flag & NFSYNCWAIT)) { - np->n_flag &= ~NFSYNCWAIT; - wakeup((caddr_t)&np->n_directio_asyncwr); - } - } - NFSUNLOCKNODE(np); - } - bp->b_vp = NULL; - uma_zfree(ncl_pbuf_zone, bp); -} - /* * Do an I/O operation to/from a cache block. This may be called * synchronously or from an nfsiod. diff --git a/sys/fs/nfsclient/nfs_clnfsiod.c b/sys/fs/nfsclient/nfs_clnfsiod.c index f4f97a8646f0..b29b0430ac3c 100644 --- a/sys/fs/nfsclient/nfs_clnfsiod.c +++ b/sys/fs/nfsclient/nfs_clnfsiod.c @@ -292,17 +292,14 @@ nfssvc_iod(void *instance) wakeup(&nmp->nm_bufq); } NFSUNLOCKIOD(); - if (bp->b_flags & B_DIRECT) { - KASSERT((bp->b_iocmd == BIO_WRITE), ("nfscvs_iod: BIO_WRITE not set")); - (void)ncl_doio_directwrite(bp); - } else { - if (bp->b_iocmd == BIO_READ) - (void) ncl_doio(bp->b_vp, bp, bp->b_rcred, - NULL, 0); - else - (void) ncl_doio(bp->b_vp, bp, bp->b_wcred, - NULL, 0); - } + KASSERT((bp->b_flags & B_DIRECT) == 0, + ("nfssvc_iod: B_DIRECT set")); + if (bp->b_iocmd == BIO_READ) + (void) ncl_doio(bp->b_vp, bp, bp->b_rcred, + NULL, 0); + else + (void) ncl_doio(bp->b_vp, bp, bp->b_wcred, + NULL, 0); NFSLOCKIOD(); /* * Make sure the nmp hasn't been dismounted as soon as diff --git a/sys/fs/nfsclient/nfs_clvnops.c b/sys/fs/nfsclient/nfs_clvnops.c index 85c0ebd7a10f..76a3cdf9281e 100644 --- a/sys/fs/nfsclient/nfs_clvnops.c +++ b/sys/fs/nfsclient/nfs_clvnops.c @@ -961,10 +961,6 @@ nfs_close(struct vop_close_args *ap) error = nfscl_maperr(ap->a_td, error, (uid_t)0, (gid_t)0); } - if (newnfs_directio_enable) - KASSERT((np->n_directio_asyncwr == 0), - ("nfs_close: dirty unflushed (%d) directio buffers\n", - np->n_directio_asyncwr)); if (newnfs_directio_enable && (fmode & O_DIRECT) && (vp->v_type == VREG)) { NFSLOCKNODE(np); KASSERT((np->n_directio_opens > 0), @@ -3188,21 +3184,6 @@ loop: * Wait for all the async IO requests to drain */ BO_UNLOCK(bo); - NFSLOCKNODE(np); - while (np->n_directio_asyncwr > 0) { - np->n_flag |= NFSYNCWAIT; - error = newnfs_msleep(td, &np->n_directio_asyncwr, - &np->n_mtx, slpflag | (PRIBIO + 1), - "nfsfsync", 0); - if (error) { - if (newnfs_sigintr(nmp, td)) { - NFSUNLOCKNODE(np); - error = EINTR; - goto done; - } - } - } - NFSUNLOCKNODE(np); } else BO_UNLOCK(bo); if (NFSHASPNFS(nmp)) { @@ -3220,15 +3201,14 @@ loop: np->n_flag &= ~NWRITEERR; } if (commit && bo->bo_dirty.bv_cnt == 0 && - bo->bo_numoutput == 0 && np->n_directio_asyncwr == 0) + bo->bo_numoutput == 0) np->n_flag &= ~NMODIFIED; NFSUNLOCKNODE(np); done: if (bvec != NULL && bvec != bvec_on_stack) free(bvec, M_TEMP); if (error == 0 && commit != 0 && waitfor == MNT_WAIT && - (bo->bo_dirty.bv_cnt != 0 || bo->bo_numoutput != 0 || - np->n_directio_asyncwr != 0)) { + (bo->bo_dirty.bv_cnt != 0 || bo->bo_numoutput != 0)) { if (trycnt++ < 5) { /* try, try again... */ passone = 1; diff --git a/sys/fs/nfsclient/nfsnode.h b/sys/fs/nfsclient/nfsnode.h index 99b6ae57b1fd..cc1959b7bf79 100644 --- a/sys/fs/nfsclient/nfsnode.h +++ b/sys/fs/nfsclient/nfsnode.h @@ -122,7 +122,6 @@ struct nfsnode { short n_fhsize; /* size in bytes, of fh */ u_int32_t n_flag; /* Flag for locking.. */ int n_directio_opens; - int n_directio_asyncwr; u_int64_t n_change; /* old Change attribute */ struct nfsv4node *n_v4; /* extra V4 stuff */ struct ucred *n_writecred; /* Cred. for putpages */ @@ -142,8 +141,6 @@ struct nfsnode { * Flags for n_flag */ #define NDIRCOOKIELK 0x00000001 /* Lock to serialize access to directory cookies */ -#define NFSYNCWAIT 0x00000002 /* fsync waiting for all directio async - writes to drain */ #define NMODIFIED 0x00000004 /* Might have a modified buffer in bio */ #define NWRITEERR 0x00000008 /* Flag write errors so close will know */ #define NCREATED 0x00000010 /* Opened by nfs_create() */ From nobody Wed May 1 01:17:48 2024 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 4VTfM073Jzz5Hnv2; Wed, 1 May 2024 01:17: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 4VTfM06Qr2z4tHd; Wed, 1 May 2024 01:17:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714526268; 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=61tWxn2dBTIon9Dz3vI9BgjI24QUQPMFNfgNb3zt9CU=; b=RbU6jVwTVyuNk5Y1n2LHJZ+vsuglx/xtAjwSmZphrBUYV/8RuhuhxDl9EaQbKWQpzI1uFN ySnTuD0LGTU0bHWR486LF8czuCxe1kCoUKbcL1KoDCrAKE1bn/pTWnVASMoVX7pRi+t3Oa O0X//7oAxbxscnKBF6pu7+RmBzojjJKyn+YIG7dfRk7mRSadih/BEsVdMjNlsMSuLNXz9D r0dicau9lxxHnCFHLAwyAtgYQZaErKvbbd/hHMjPtS1bae7pjutAhTWnw0R1qObVMrRFwk OHdQ6DNNxI8yicrSYfNbBs348oD82A0Jl+5FVHiHtHsWXopbC22Ey2EncVVa5Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714526268; a=rsa-sha256; cv=none; b=StuZKoJBQQw7LkfhWhG5QOh1OGi0xaSsoQq42g99MxMn5isZXf9KlLU/2rNMPp1A6XBVX/ EdXgIQtfg6Bn3sTFo4AfaAL8Gj/r2gcGiq15VN4nO6ISnAYmcPlpMmq5t19/HMTDCeveAl tEPnibit3TDQewnrS1t2dZoCDh5jeBaOb3nHcqoSG+yyY6M6JuVwwEyq8fiwqt8DZH9qrR Nv7z35pezr5lfKfVmuJ4kV4Geuq6FMAqKWe1obCImyNP0gfZWGwgFQKdSH62qpAuyLSheh ZmD15mbzKwKfYTjzz1mXNLK3Awqbb0TB/c1x9BDEd75oOK/aSyBZRJ44BYWVWw== 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=1714526268; 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=61tWxn2dBTIon9Dz3vI9BgjI24QUQPMFNfgNb3zt9CU=; b=jKAIR8295MbDd7YtC2ZRc4kiNRkDjCBXqJU1KoMbj/r8m2KcHIj9ED/6CJrRr94ocsLl0y ak6AOp6tQb+Wm25BtK3EF7is3Q8VbIsigzNjDpV0Y0f9JCK99QLFKjWrtjoXR/h+2Ag2Qz x6DyTzqwWA8ny+ZDhONrnsvFDKVFWMfgvMvacZPm7QY32dRyAni4FJ4hqTIhA/yj2isnh9 YspUEAyuWwiAsdGpzs90InePlpupwZIuvemqW9dMc72hYX/lOwDSfN06od1XOzNrF78H7A ug+m+4XhMTP0bZGVmaBe6Rf11Fe2i/PTC4/JR0F75ZjSiug+2Yjy3J5z+MJEkw== 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 4VTfM05kr2zy6y; Wed, 1 May 2024 01:17: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 4411HmnJ004132; Wed, 1 May 2024 01:17:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4411HmMj004129; Wed, 1 May 2024 01:17:48 GMT (envelope-from git) Date: Wed, 1 May 2024 01:17:48 GMT Message-Id: <202405010117.4411HmMj004129@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 19b6aa047e77 - stable/13 - nfscl: Do not use nfso_own for delayed nfsrpc_doclose() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 19b6aa047e77757de58811f02c564e8dff3679b6 Auto-Submitted: auto-generated The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=19b6aa047e77757de58811f02c564e8dff3679b6 commit 19b6aa047e77757de58811f02c564e8dff3679b6 Author: Rick Macklem AuthorDate: 2024-04-26 03:58:21 +0000 Commit: Rick Macklem CommitDate: 2024-05-01 01:16:33 +0000 nfscl: Do not use nfso_own for delayed nfsrpc_doclose() When an initial attempt to close an NFSv4 lock returns NFSERR_DELAY, the open structure is put on a list for delayed closing. When this is done, the nfso_own field is set to NULL, so it cannot be used by nfsrpc_doclose(). Without this patch, the NFSv4 client can crash when a NFSv4 server replies NFSERR_DELAY to a Close operation. Fortunately, most extant NFSv4 servers do not do this. This patch avoids the crash for any that do return NFSERR_DELAY for Close. Found during a IETF bakeathon testing event this week. (cherry picked from commit 6251027c4252edb3b8f8fc359a40e610349e9af3) --- sys/fs/nfsclient/nfs_clrpcops.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c index 899d81efcf7c..475034768e04 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -799,6 +799,7 @@ nfsrpc_doclose(struct nfsmount *nmp, struct nfsclopen *op, NFSPROC_T *p, u_int64_t off = 0, len = 0; u_int32_t type = NFSV4LOCKT_READ; int error, do_unlock, trycnt; + bool own_not_null; tcred = newnfs_getcred(); newnfs_copycred(&op->nfso_cred, tcred); @@ -865,22 +866,29 @@ nfsrpc_doclose(struct nfsmount *nmp, struct nfsclopen *op, NFSPROC_T *p, * There could be other Opens for different files on the same * OpenOwner, so locking is required. */ - NFSLOCKCLSTATE(); - nfscl_lockexcl(&op->nfso_own->nfsow_rwlock, NFSCLSTATEMUTEXPTR); - NFSUNLOCKCLSTATE(); + own_not_null = false; + if (op->nfso_own != NULL) { + own_not_null = true; + NFSLOCKCLSTATE(); + nfscl_lockexcl(&op->nfso_own->nfsow_rwlock, NFSCLSTATEMUTEXPTR); + NFSUNLOCKCLSTATE(); + } do { error = nfscl_tryclose(op, tcred, nmp, p, loop_on_delayed); if (error == NFSERR_GRACE) (void) nfs_catnap(PZERO, error, "nfs_close"); } while (error == NFSERR_GRACE); - NFSLOCKCLSTATE(); - nfscl_lockunlock(&op->nfso_own->nfsow_rwlock); + if (own_not_null) { + NFSLOCKCLSTATE(); + nfscl_lockunlock(&op->nfso_own->nfsow_rwlock); + } LIST_FOREACH_SAFE(lp, &op->nfso_lock, nfsl_list, nlp) nfscl_freelockowner(lp, 0); if (freeop && error != NFSERR_DELAY) nfscl_freeopen(op, 0, true); - NFSUNLOCKCLSTATE(); + if (own_not_null) + NFSUNLOCKCLSTATE(); NFSFREECRED(tcred); return (error); } From nobody Wed May 1 01:24:41 2024 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 4VTfVx2bX5z5HpZp; Wed, 1 May 2024 01:24:41 +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 4VTfVx2P50z4v1t; Wed, 1 May 2024 01:24:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714526681; 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=wIDQAImucbl80eYz9YFq/n4rPO8B2mgcopEy/4siEWg=; b=qEWs7nAe+3kDcVJLb2XIx+p84hzoMn2+m1qtdXLyL6MmbrkNRL7jUkDDRFlmqL9XHg/XrX aMIslY7bPtw8Xj3fUZlPe2G4fss5oUdT7RZ3FMLzOBNeXpZGrsje8xg+EMpeP2/Wyb5aEG dWwe/NdAJeXWoJER+9ltl+ViHRaXyr3Y7z+r9HZnhF6CaulPO7QNY3iKWkyI300sJRD1TA M1G0rda0tna55jufkh9quDcJy7Jck06Tc57bFlyOP48A0rsRBkNpKYSrNJjODqxUcMX8qP lmbEJPvD+rqfHkc1kOQTKU9WxPVHK+vof8roEaIBW2rVovJhuQ7XQ+jnQEgLKw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714526681; a=rsa-sha256; cv=none; b=hE3vhC2CnrzIq2NUw1yqYRYba/uLLabWfpDYiPYMm3J6RvgJzDgAiwBoQkgKZu+jMHlPJy FGgGvQZAHnWShwyUpDPej39kq3VH/8Tq08bcoet0koj83cNCm+TRVRdZiafWlW1wTNjcOO 1EGA+eKgVPlEStnA+LpBy1VgcrUutH+XOB7Y3/a77q4R0n/LewV06BuAGUl+jEh0wwD4y7 F0AO0i1U54odIZRHIF6VjqQMgLoTik6xnL14R05h/W3CnEmKbUBQxiTYOpIzAivGIN02Yw 4eVe6VUVClkM66XIE/moXIn8i5xvEJFS1ROBl+ir4VdQ6ialk8jMQu6xMcr+CQ== 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=1714526681; 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=wIDQAImucbl80eYz9YFq/n4rPO8B2mgcopEy/4siEWg=; b=tS2OVg0DCezzor1m6g4y75n91w1qgKzyiUSE6k3mpoCPC42Q7/B8NhtS2aIjRh2XKXRwX1 XyEzZQmf+ad/t7fieX47pZBOtdjz4+VROGvVDqMfzNoSvazpJXoYiTyljz9TpCQxWUeIFt +1jX4c3kgA9EWMxM/+LaRbfRoBmFrSNBESszp2vurxWs1+EfB8xCSBKZcSNO8/CnSNdOhd J+Yb4oNEpVaQhCLRfrl5LBrbCu1CSIBBUEKDYzuAbeNgpnWlT9P/1l8f3ytIODTZRS3hbL KAL3oJAMdhHm360BVM1fQi64KTaopz7+RQFyCSvAgT3291tqPSkJl3kpV+fudA== 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 4VTfVx20LSzypN; Wed, 1 May 2024 01:24:41 +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 4411Ofla020290; Wed, 1 May 2024 01:24:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4411OfJt020287; Wed, 1 May 2024 01:24:41 GMT (envelope-from git) Date: Wed, 1 May 2024 01:24:41 GMT Message-Id: <202405010124.4411OfJt020287@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 825cb4c850f2 - stable/13 - nfscl: Clear out a lot of cruft related to B_DIRECT List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 825cb4c850f2b97cfd1b24ed421d7938bf37eee7 Auto-Submitted: auto-generated The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=825cb4c850f2b97cfd1b24ed421d7938bf37eee7 commit 825cb4c850f2b97cfd1b24ed421d7938bf37eee7 Author: Rick Macklem AuthorDate: 2024-04-28 00:10:48 +0000 Commit: Rick Macklem CommitDate: 2024-05-01 01:20:50 +0000 nfscl: Clear out a lot of cruft related to B_DIRECT There is only one place in the unpatched sources where B_DIRECT is set in the NFS client and this code is never executed. As such, this patch removes this code that is never executed, since B_DIRECT should never be set. During a IETF testing event this week, I saw a crash in ncl_doio_directwrite(), but this function is only called if B_DIRECT is set. I cannot explain how ncl_doio_directwrite() got called, but once this patch was applied to the sources, the crash did not recur. This is not surprising, since this patch deleted the function. (cherry picked from commit 03a39a17089adc1d0e28076670e664dcdebccf73) --- sys/fs/nfs/nfs_commonport.c | 1 - sys/fs/nfs/nfsport.h | 2 - sys/fs/nfsclient/nfs.h | 1 - sys/fs/nfsclient/nfs_clbio.c | 237 ++++++++-------------------------------- sys/fs/nfsclient/nfs_clnfsiod.c | 19 ++-- sys/fs/nfsclient/nfs_clvnops.c | 24 +--- sys/fs/nfsclient/nfsnode.h | 3 - 7 files changed, 57 insertions(+), 230 deletions(-) diff --git a/sys/fs/nfs/nfs_commonport.c b/sys/fs/nfs/nfs_commonport.c index 67ba119bd39f..b8e6bfc170a2 100644 --- a/sys/fs/nfs/nfs_commonport.c +++ b/sys/fs/nfs/nfs_commonport.c @@ -121,7 +121,6 @@ MALLOC_DEFINE(M_NEWNFSCLCLIENT, "NFSCL client", "NFSCL Client"); MALLOC_DEFINE(M_NEWNFSCLLOCKOWNER, "NFSCL lckown", "NFSCL Lock Owner"); MALLOC_DEFINE(M_NEWNFSCLLOCK, "NFSCL lck", "NFSCL Lock"); MALLOC_DEFINE(M_NEWNFSV4NODE, "NEWNFSnode", "NFS vnode"); -MALLOC_DEFINE(M_NEWNFSDIRECTIO, "NEWdirectio", "NFS Direct IO buffer"); MALLOC_DEFINE(M_NEWNFSDIROFF, "NFSCL diroff", "NFS directory offset data"); MALLOC_DEFINE(M_NEWNFSDROLLBACK, "NFSD rollback", diff --git a/sys/fs/nfs/nfsport.h b/sys/fs/nfs/nfsport.h index 950df6a1d7b4..e65334358219 100644 --- a/sys/fs/nfs/nfsport.h +++ b/sys/fs/nfs/nfsport.h @@ -938,7 +938,6 @@ MALLOC_DECLARE(M_NEWNFSCLLOCKOWNER); MALLOC_DECLARE(M_NEWNFSCLLOCK); MALLOC_DECLARE(M_NEWNFSDIROFF); MALLOC_DECLARE(M_NEWNFSV4NODE); -MALLOC_DECLARE(M_NEWNFSDIRECTIO); MALLOC_DECLARE(M_NEWNFSMNT); MALLOC_DECLARE(M_NEWNFSDROLLBACK); MALLOC_DECLARE(M_NEWNFSLAYOUT); @@ -965,7 +964,6 @@ MALLOC_DECLARE(M_NEWNFSDSESSION); #define M_NFSCLLOCK M_NEWNFSCLLOCK #define M_NFSDIROFF M_NEWNFSDIROFF #define M_NFSV4NODE M_NEWNFSV4NODE -#define M_NFSDIRECTIO M_NEWNFSDIRECTIO #define M_NFSDROLLBACK M_NEWNFSDROLLBACK #define M_NFSLAYOUT M_NEWNFSLAYOUT #define M_NFSFLAYOUT M_NEWNFSFLAYOUT diff --git a/sys/fs/nfsclient/nfs.h b/sys/fs/nfsclient/nfs.h index aa755a6b5f4d..eeb68a434a6b 100644 --- a/sys/fs/nfsclient/nfs.h +++ b/sys/fs/nfsclient/nfs.h @@ -90,7 +90,6 @@ enum nfsiod_state { * Function prototypes. */ int ncl_meta_setsize(struct vnode *, struct thread *, u_quad_t); -void ncl_doio_directwrite(struct buf *); int ncl_bioread(struct vnode *, struct uio *, int, struct ucred *); int ncl_biowrite(struct vnode *, struct uio *, int, struct ucred *); int ncl_vinvalbuf(struct vnode *, int, struct thread *, int); diff --git a/sys/fs/nfsclient/nfs_clbio.c b/sys/fs/nfsclient/nfs_clbio.c index 9a471f6681ca..43f3de8fa2d3 100644 --- a/sys/fs/nfsclient/nfs_clbio.c +++ b/sys/fs/nfsclient/nfs_clbio.c @@ -767,144 +767,58 @@ static int nfs_directio_write(struct vnode *vp, struct uio *uiop, struct ucred *cred, int ioflag) { - int error; + struct uio uio; + struct iovec iov; struct nfsmount *nmp = VFSTONFS(vp->v_mount); struct thread *td = uiop->uio_td; - int size; - int wsize; + int error, iomode, must_commit, size, wsize; + KASSERT((ioflag & IO_SYNC) != 0, ("nfs_directio_write: not sync")); mtx_lock(&nmp->nm_mtx); wsize = nmp->nm_wsize; mtx_unlock(&nmp->nm_mtx); - if (ioflag & IO_SYNC) { - int iomode, must_commit; - struct uio uio; - struct iovec iov; -do_sync: - while (uiop->uio_resid > 0) { - size = MIN(uiop->uio_resid, wsize); - size = MIN(uiop->uio_iov->iov_len, size); - iov.iov_base = uiop->uio_iov->iov_base; - iov.iov_len = size; - uio.uio_iov = &iov; - uio.uio_iovcnt = 1; - uio.uio_offset = uiop->uio_offset; - uio.uio_resid = size; - uio.uio_segflg = uiop->uio_segflg; - uio.uio_rw = UIO_WRITE; - uio.uio_td = td; - iomode = NFSWRITE_FILESYNC; - /* - * When doing direct I/O we do not care if the - * server's write verifier has changed, but we - * do not want to update the verifier if it has - * changed, since that hides the change from - * writes being done through the buffer cache. - * By passing must_commit in set to two, the code - * in nfsrpc_writerpc() will not update the - * verifier on the mount point. - */ - must_commit = 2; - error = ncl_writerpc(vp, &uio, cred, &iomode, - &must_commit, 0, ioflag); - KASSERT((must_commit == 2), - ("ncl_directio_write: Updated write verifier")); - if (error) - return (error); - if (iomode != NFSWRITE_FILESYNC) - printf("nfs_directio_write: Broken server " - "did not reply FILE_SYNC\n"); - uiop->uio_offset += size; - uiop->uio_resid -= size; - if (uiop->uio_iov->iov_len <= size) { - uiop->uio_iovcnt--; - uiop->uio_iov++; - } else { - uiop->uio_iov->iov_base = - (char *)uiop->uio_iov->iov_base + size; - uiop->uio_iov->iov_len -= size; - } - } - } else { - struct uio *t_uio; - struct iovec *t_iov; - struct buf *bp; - + while (uiop->uio_resid > 0) { + size = MIN(uiop->uio_resid, wsize); + size = MIN(uiop->uio_iov->iov_len, size); + iov.iov_base = uiop->uio_iov->iov_base; + iov.iov_len = size; + uio.uio_iov = &iov; + uio.uio_iovcnt = 1; + uio.uio_offset = uiop->uio_offset; + uio.uio_resid = size; + uio.uio_segflg = uiop->uio_segflg; + uio.uio_rw = UIO_WRITE; + uio.uio_td = td; + iomode = NFSWRITE_FILESYNC; /* - * Break up the write into blocksize chunks and hand these - * over to nfsiod's for write back. - * Unfortunately, this incurs a copy of the data. Since - * the user could modify the buffer before the write is - * initiated. - * - * The obvious optimization here is that one of the 2 copies - * in the async write path can be eliminated by copying the - * data here directly into mbufs and passing the mbuf chain - * down. But that will require a fair amount of re-working - * of the code and can be done if there's enough interest - * in NFS directio access. + * When doing direct I/O we do not care if the + * server's write verifier has changed, but we + * do not want to update the verifier if it has + * changed, since that hides the change from + * writes being done through the buffer cache. + * By passing must_commit in set to two, the code + * in nfsrpc_writerpc() will not update the + * verifier on the mount point. */ - while (uiop->uio_resid > 0) { - size = MIN(uiop->uio_resid, wsize); - size = MIN(uiop->uio_iov->iov_len, size); - bp = uma_zalloc(ncl_pbuf_zone, M_WAITOK); - t_uio = malloc(sizeof(struct uio), M_NFSDIRECTIO, M_WAITOK); - t_iov = malloc(sizeof(struct iovec), M_NFSDIRECTIO, M_WAITOK); - t_iov->iov_base = malloc(size, M_NFSDIRECTIO, M_WAITOK); - t_iov->iov_len = size; - t_uio->uio_iov = t_iov; - t_uio->uio_iovcnt = 1; - t_uio->uio_offset = uiop->uio_offset; - t_uio->uio_resid = size; - t_uio->uio_segflg = UIO_SYSSPACE; - t_uio->uio_rw = UIO_WRITE; - t_uio->uio_td = td; - KASSERT(uiop->uio_segflg == UIO_USERSPACE || - uiop->uio_segflg == UIO_SYSSPACE, - ("nfs_directio_write: Bad uio_segflg")); - if (uiop->uio_segflg == UIO_USERSPACE) { - error = copyin(uiop->uio_iov->iov_base, - t_iov->iov_base, size); - if (error != 0) - goto err_free; - } else - /* - * UIO_SYSSPACE may never happen, but handle - * it just in case it does. - */ - bcopy(uiop->uio_iov->iov_base, t_iov->iov_base, - size); - bp->b_flags |= B_DIRECT; - bp->b_iocmd = BIO_WRITE; - if (cred != NOCRED) { - crhold(cred); - bp->b_wcred = cred; - } else - bp->b_wcred = NOCRED; - bp->b_caller1 = (void *)t_uio; - bp->b_vp = vp; - error = ncl_asyncio(nmp, bp, NOCRED, td); -err_free: - if (error) { - free(t_iov->iov_base, M_NFSDIRECTIO); - free(t_iov, M_NFSDIRECTIO); - free(t_uio, M_NFSDIRECTIO); - bp->b_vp = NULL; - uma_zfree(ncl_pbuf_zone, bp); - if (error == EINTR) - return (error); - goto do_sync; - } - uiop->uio_offset += size; - uiop->uio_resid -= size; - if (uiop->uio_iov->iov_len <= size) { - uiop->uio_iovcnt--; - uiop->uio_iov++; - } else { - uiop->uio_iov->iov_base = - (char *)uiop->uio_iov->iov_base + size; - uiop->uio_iov->iov_len -= size; - } + must_commit = 2; + error = ncl_writerpc(vp, &uio, cred, &iomode, + &must_commit, 0, ioflag); + KASSERT(must_commit == 2, + ("ncl_directio_write: Updated write verifier")); + if (error != 0) + return (error); + if (iomode != NFSWRITE_FILESYNC) + printf("nfs_directio_write: Broken server " + "did not reply FILE_SYNC\n"); + uiop->uio_offset += size; + uiop->uio_resid -= size; + if (uiop->uio_iov->iov_len <= size) { + uiop->uio_iovcnt--; + uiop->uio_iov++; + } else { + uiop->uio_iov->iov_base = + (char *)uiop->uio_iov->iov_base + size; + uiop->uio_iov->iov_len -= size; } } return (0); @@ -1470,7 +1384,7 @@ ncl_vinvalbuf(struct vnode *vp, int flags, struct thread *td, int intrflg) nanouptime(&ts); NFSLOCKNODE(np); } - if (np->n_directio_asyncwr == 0 && (np->n_flag & NMODIFIED) != 0) { + if ((np->n_flag & NMODIFIED) != 0) { np->n_localmodtime = ts; np->n_flag &= ~NMODIFIED; } @@ -1615,12 +1529,8 @@ again: BUF_KERNPROC(bp); TAILQ_INSERT_TAIL(&nmp->nm_bufq, bp, b_freelist); nmp->nm_bufqlen++; - if ((bp->b_flags & B_DIRECT) && bp->b_iocmd == BIO_WRITE) { - NFSLOCKNODE(VTONFS(bp->b_vp)); - VTONFS(bp->b_vp)->n_flag |= NMODIFIED; - VTONFS(bp->b_vp)->n_directio_asyncwr++; - NFSUNLOCKNODE(VTONFS(bp->b_vp)); - } + KASSERT((bp->b_flags & B_DIRECT) == 0, + ("ncl_asyncio: B_DIRECT set")); NFSUNLOCKIOD(); return (0); } @@ -1635,59 +1545,6 @@ again: return (EIO); } -void -ncl_doio_directwrite(struct buf *bp) -{ - int iomode, must_commit; - struct uio *uiop = (struct uio *)bp->b_caller1; - char *iov_base = uiop->uio_iov->iov_base; - - iomode = NFSWRITE_FILESYNC; - uiop->uio_td = NULL; /* NULL since we're in nfsiod */ - /* - * When doing direct I/O we do not care if the - * server's write verifier has changed, but we - * do not want to update the verifier if it has - * changed, since that hides the change from - * writes being done through the buffer cache. - * By passing must_commit in set to two, the code - * in nfsrpc_writerpc() will not update the - * verifier on the mount point. - */ - must_commit = 2; - ncl_writerpc(bp->b_vp, uiop, bp->b_wcred, &iomode, &must_commit, 0, 0); - KASSERT((must_commit == 2), ("ncl_doio_directwrite: Updated write" - " verifier")); - if (iomode != NFSWRITE_FILESYNC) - printf("ncl_doio_directwrite: Broken server " - "did not reply FILE_SYNC\n"); - free(iov_base, M_NFSDIRECTIO); - free(uiop->uio_iov, M_NFSDIRECTIO); - free(uiop, M_NFSDIRECTIO); - if ((bp->b_flags & B_DIRECT) && bp->b_iocmd == BIO_WRITE) { - struct nfsnode *np = VTONFS(bp->b_vp); - NFSLOCKNODE(np); - if (NFSHASPNFS(VFSTONFS(bp->b_vp->v_mount))) { - /* - * Invalidate the attribute cache, since writes to a DS - * won't update the size attribute. - */ - np->n_attrstamp = 0; - } - np->n_directio_asyncwr--; - if (np->n_directio_asyncwr == 0) { - np->n_flag &= ~NMODIFIED; - if ((np->n_flag & NFSYNCWAIT)) { - np->n_flag &= ~NFSYNCWAIT; - wakeup((caddr_t)&np->n_directio_asyncwr); - } - } - NFSUNLOCKNODE(np); - } - bp->b_vp = NULL; - uma_zfree(ncl_pbuf_zone, bp); -} - /* * Do an I/O operation to/from a cache block. This may be called * synchronously or from an nfsiod. diff --git a/sys/fs/nfsclient/nfs_clnfsiod.c b/sys/fs/nfsclient/nfs_clnfsiod.c index f4f97a8646f0..b29b0430ac3c 100644 --- a/sys/fs/nfsclient/nfs_clnfsiod.c +++ b/sys/fs/nfsclient/nfs_clnfsiod.c @@ -292,17 +292,14 @@ nfssvc_iod(void *instance) wakeup(&nmp->nm_bufq); } NFSUNLOCKIOD(); - if (bp->b_flags & B_DIRECT) { - KASSERT((bp->b_iocmd == BIO_WRITE), ("nfscvs_iod: BIO_WRITE not set")); - (void)ncl_doio_directwrite(bp); - } else { - if (bp->b_iocmd == BIO_READ) - (void) ncl_doio(bp->b_vp, bp, bp->b_rcred, - NULL, 0); - else - (void) ncl_doio(bp->b_vp, bp, bp->b_wcred, - NULL, 0); - } + KASSERT((bp->b_flags & B_DIRECT) == 0, + ("nfssvc_iod: B_DIRECT set")); + if (bp->b_iocmd == BIO_READ) + (void) ncl_doio(bp->b_vp, bp, bp->b_rcred, + NULL, 0); + else + (void) ncl_doio(bp->b_vp, bp, bp->b_wcred, + NULL, 0); NFSLOCKIOD(); /* * Make sure the nmp hasn't been dismounted as soon as diff --git a/sys/fs/nfsclient/nfs_clvnops.c b/sys/fs/nfsclient/nfs_clvnops.c index 411b7f82a445..38a2f6c8f4f1 100644 --- a/sys/fs/nfsclient/nfs_clvnops.c +++ b/sys/fs/nfsclient/nfs_clvnops.c @@ -960,10 +960,6 @@ nfs_close(struct vop_close_args *ap) error = nfscl_maperr(ap->a_td, error, (uid_t)0, (gid_t)0); } - if (newnfs_directio_enable) - KASSERT((np->n_directio_asyncwr == 0), - ("nfs_close: dirty unflushed (%d) directio buffers\n", - np->n_directio_asyncwr)); if (newnfs_directio_enable && (fmode & O_DIRECT) && (vp->v_type == VREG)) { NFSLOCKNODE(np); KASSERT((np->n_directio_opens > 0), @@ -3202,21 +3198,6 @@ loop: * Wait for all the async IO requests to drain */ BO_UNLOCK(bo); - NFSLOCKNODE(np); - while (np->n_directio_asyncwr > 0) { - np->n_flag |= NFSYNCWAIT; - error = newnfs_msleep(td, &np->n_directio_asyncwr, - &np->n_mtx, slpflag | (PRIBIO + 1), - "nfsfsync", 0); - if (error) { - if (newnfs_sigintr(nmp, td)) { - NFSUNLOCKNODE(np); - error = EINTR; - goto done; - } - } - } - NFSUNLOCKNODE(np); } else BO_UNLOCK(bo); if (NFSHASPNFS(nmp)) { @@ -3234,15 +3215,14 @@ loop: np->n_flag &= ~NWRITEERR; } if (commit && bo->bo_dirty.bv_cnt == 0 && - bo->bo_numoutput == 0 && np->n_directio_asyncwr == 0) + bo->bo_numoutput == 0) np->n_flag &= ~NMODIFIED; NFSUNLOCKNODE(np); done: if (bvec != NULL && bvec != bvec_on_stack) free(bvec, M_TEMP); if (error == 0 && commit != 0 && waitfor == MNT_WAIT && - (bo->bo_dirty.bv_cnt != 0 || bo->bo_numoutput != 0 || - np->n_directio_asyncwr != 0)) { + (bo->bo_dirty.bv_cnt != 0 || bo->bo_numoutput != 0)) { if (trycnt++ < 5) { /* try, try again... */ passone = 1; diff --git a/sys/fs/nfsclient/nfsnode.h b/sys/fs/nfsclient/nfsnode.h index 99b6ae57b1fd..cc1959b7bf79 100644 --- a/sys/fs/nfsclient/nfsnode.h +++ b/sys/fs/nfsclient/nfsnode.h @@ -122,7 +122,6 @@ struct nfsnode { short n_fhsize; /* size in bytes, of fh */ u_int32_t n_flag; /* Flag for locking.. */ int n_directio_opens; - int n_directio_asyncwr; u_int64_t n_change; /* old Change attribute */ struct nfsv4node *n_v4; /* extra V4 stuff */ struct ucred *n_writecred; /* Cred. for putpages */ @@ -142,8 +141,6 @@ struct nfsnode { * Flags for n_flag */ #define NDIRCOOKIELK 0x00000001 /* Lock to serialize access to directory cookies */ -#define NFSYNCWAIT 0x00000002 /* fsync waiting for all directio async - writes to drain */ #define NMODIFIED 0x00000004 /* Might have a modified buffer in bio */ #define NWRITEERR 0x00000008 /* Flag write errors so close will know */ #define NCREATED 0x00000010 /* Opened by nfs_create() */ From nobody Wed May 1 18:47:23 2024 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 4VV5f35FdMz5Js3W; Wed, 1 May 2024 18:47: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 4VV5f34H1cz4Xr4; Wed, 1 May 2024 18:47:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714589243; 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=/fCFq9b7AtKJD6WZWR1GLvmC9cQAXb4AvK3YLWHYh8E=; b=ibNIinixeDN7ZoMYrBDTjzoZnHdJla+U4PteIQprDxzSToYNi3h8bLrOj64SvtpxZola4o 00CMvyeiCPDCeY5r/SJdfsYgmNHpaJSVUogQC/EV9LgbbLcafb69CgcifML/nPpdTl14pz Rq6j11QA7zSXUuZIYdDZTN3gCggtPeNi5Oi3ztCVC7NmHf6mc+Cqfarwegijt7UyyyK3QH DpF5NhHg5/EOkWaI4muZUd0TX1pBvb5F5ifX+z2XH3DsWX6NGWNUp6uwF5K5c8ItpLSzS3 iwuRp2mcYU2iJSyJujmMoojUzuk19X+yyqrEELaPQ5zIcBz7g/+2ziZ8WVNExA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714589243; a=rsa-sha256; cv=none; b=T/SlKfMFxGG/aBmNpqyqD66ezjDadwQQeIbtluCPTO9se2ZPC2VJR93AsPUE7ZkSZ+VUGZ X4NgQr50CyyVb4O4CpTeRA++zxz0vKRsRSjWodbhQbM4zb8zjvtR6B0vBEqn9tWkWl/VpI 8BPmwmjYOr2Dtw3hFp0VRc3AkXs6ilwQK/j4XtJ8UEM0V9PHj0EOd0zLSf66C6LpOvrVrH WkSUacuRGFY33WE4nc5xR0Lskrct/MM6f2fjZ24wg0OzMU6QkNXy4gCLNIHiLLLIhMJSGE hRA6QLdlS5sGcHiHRNPt3oHdb3XVOQ0uYgkH3wzFb9WW+ngGGb+VEsO2NjuNEw== 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=1714589243; 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=/fCFq9b7AtKJD6WZWR1GLvmC9cQAXb4AvK3YLWHYh8E=; b=iC39XHKmpFdiRBsNUBneV5K58SWU/hKA9cP0bfxH0VLQ8DAqzrDDoVeMleDt8C8w3U1EYF M4e+nsQ46oQwJ+Yw4fiEVxw1NGkKj9T19BOi2lfIXKdg09IPF0alkMNXA04kPncziupuKk 1QRr9UrR2PoEEc3MRn5Sb2dLmj+xcx5w1Bwbt3aZh3di3ry8F3D/ntRu3cPQ2sk2ehhnW1 M1LOk3PJh1N4WukhzbtudwhLndFbum/g+ky5qnhprR0boDMiTyUxMfX20lm/rfjICOCjsJ g5PWZc/xaYTbs+ImLCAPJFNpHio7NQ4rWEjbgq22fEd+Pn34qI97EYD/19XvPA== 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 4VV5f33tHrzVyh; Wed, 1 May 2024 18:47: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 441IlN8c082075; Wed, 1 May 2024 18:47:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 441IlNmW082072; Wed, 1 May 2024 18:47:23 GMT (envelope-from git) Date: Wed, 1 May 2024 18:47:23 GMT Message-Id: <202405011847.441IlNmW082072@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 1d921be5a889 - stable/14 - ieee80211_vap(9): fix the title List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1d921be5a889f52dfa48db8ac6b022302a435a44 Auto-Submitted: auto-generated The branch stable/14 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=1d921be5a889f52dfa48db8ac6b022302a435a44 commit 1d921be5a889f52dfa48db8ac6b022302a435a44 Author: Mitchell Horne AuthorDate: 2023-03-19 22:58:56 +0000 Commit: Mitchell Horne CommitDate: 2024-05-01 18:36:48 +0000 ieee80211_vap(9): fix the title MFC after: 3 days (cherry picked from commit c5989febcc00be41e05b4b714bbfc6ea1359abaf) --- share/man/man9/ieee80211_vap.9 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man9/ieee80211_vap.9 b/share/man/man9/ieee80211_vap.9 index e0c9760d8d31..ee811107f035 100644 --- a/share/man/man9/ieee80211_vap.9 +++ b/share/man/man9/ieee80211_vap.9 @@ -24,7 +24,7 @@ .\" SUCH DAMAGE. .\" .Dd August 4, 2009 -.Dt IEEE8021_VAP 9 +.Dt IEEE80211_VAP 9 .Os .Sh NAME .Nm net80211_vap From nobody Wed May 1 18:47:24 2024 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 4VV5f45dXLz5Js4K; Wed, 1 May 2024 18:47: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 4VV5f450Cbz4Xxx; Wed, 1 May 2024 18:47:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714589244; 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=3WAWtwdbqZGXiKmzIKXmJd2kQi47KdBs8GCKmlX24Sw=; b=obkAL8vew9KXaOKl9MpeIELEAC/scphUUr0BF74PIQTi6i1FYEiINF1SJX+RZ7SKEgvQS6 bJq7akP3s2fQa/CfcAucMKoKbRZA8C2kJN6Z/uwhyJqO45MADlbGzHw6LcrsU7ceDho4bW Xt77er+FdOqx6d694RpzUq8RJZbo7Wnrw8aUULeEBbBL/pRT9LbdDuIX5nzwY72bGZEYYk XSUDp4MoAYoBqBXGTIdtJ8cIs9Vo4wOc3MMMsCMzDECdOSEKEjJiT+mbXjJZAfjBCzkWVr sRL1+1NwM24hIzP7gsTMGGwLufQ8Yklea3pic5Lc6JgaTTE/WlFdRLbZg+ioQQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714589244; a=rsa-sha256; cv=none; b=RhYxy219nrL1EjDgj/F2tnCVjHMDss3FHVFnzHAx4kERM4ZAjB/GQku+IG7gtsvqHwZK6N INaHEHD0f4vNhWk4p3+2ekvyJ+FYtqadHgYGywExIVwcD9FQJprqhIxHUfgyhEOgLbq6Bp rKebWbx/qn7ifwxqC8+sWqkcYpAf81tORwbnE8N8ys2KNXXacO822in7iTa1MZzvXTRtn/ Nc5e1muJrLRmr5GarYril0aFODiEFkCqiNIqTXrHOvptjv4kK3mgsVuSZrFS+TzCu8n9A3 iuM+UbswK88MJHYp8S4S4TwyVTUS1v/7Hdd4yPMMeInEvlFccpFSfgYb76g0yQ== 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=1714589244; 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=3WAWtwdbqZGXiKmzIKXmJd2kQi47KdBs8GCKmlX24Sw=; b=mPP9r1DoXrNji0Na+QSf2DtlLEZJ+0WnaMmvosPhtCZLEEBRCo4tMYTsPGFWWFulwx+Kll rmtnGgrqRRDFU7tlKQREW9v93cEnkqMa3UE7WkiWdmqtTK+z7ZaiwfwrbvCHJIWLbhqCWn vfE19I2Q4XwcRJl6gd0AGzxXBbA5/UTYhruD+91UwUEdYDpB+R+UqxSvZWgUMfadoEPhct 7lM3eNLhYw5DbltJSiW0B97u98td3NnqczRO2p/FhW1Pqtt2Qhb3z5aM5J3nkkqjWl2701 zxeLQnrkw+XAknR/6M3V7+kmQ1H4f2A6f0gl6S61JVAJeYS/3E4qhp1NU1XoYQ== 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 4VV5f44Z45zVyj; Wed, 1 May 2024 18:47: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 441IlOYR082114; Wed, 1 May 2024 18:47:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 441IlOeq082111; Wed, 1 May 2024 18:47:24 GMT (envelope-from git) Date: Wed, 1 May 2024 18:47:24 GMT Message-Id: <202405011847.441IlOeq082111@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 3d509058db55 - stable/14 - hier.7: various improvements List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 3d509058db5545cc2b29884a0c408a43e25821f5 Auto-Submitted: auto-generated The branch stable/14 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=3d509058db5545cc2b29884a0c408a43e25821f5 commit 3d509058db5545cc2b29884a0c408a43e25821f5 Author: Alexander Ziaee AuthorDate: 2024-02-28 05:16:35 +0000 Commit: Mitchell Horne CommitDate: 2024-05-01 18:42:27 +0000 hier.7: various improvements Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/831 (cherry picked from commit 03ee09148950c9ea99987bfee8a769473079745b) (cherry picked from commit 94dedfdfa96baef02e4ad661512a267ae5647d7b) (cherry picked from commit a5b07274fcaf71fc9c14947a75fbe0a13d381a79) (cherry picked from commit f19875b66bf403ed5c57f82bbe2a3f42475d0a06) --- share/man/man7/hier.7 | 516 ++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 418 insertions(+), 98 deletions(-) diff --git a/share/man/man7/hier.7 b/share/man/man7/hier.7 index 0eeaa7beb6d1..10847993c0f5 100644 --- a/share/man/man7/hier.7 +++ b/share/man/man7/hier.7 @@ -1,3 +1,6 @@ +.\"- +.\" SPDX-License-Identifier: BSD-3-Clause +.\" .\" Copyright (c) 1990, 1993 .\" The Regents of the University of California. All rights reserved. .\" @@ -25,27 +28,35 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd February 6, 2024 +.Dd February 27, 2024 .Dt HIER 7 .Os .Sh NAME .Nm hier -.Nd layout of file systems -.Sh SYNOPSIS -An overview of the file system hierarchy. +.Nd layout of +.Fx +file system hierarchy .Sh DESCRIPTION .Bl -tag -width "/libexec/" .It Pa / -root directory +root directory of the file system +.It Pa /COPYRIGHT +.Fx +copyright information .It Pa /bin/ -user utilities that are fundamental to single-user and multi-user modes +user utilities fundamental to both single and multi-user modes .It Pa /boot/ -programs and configuration files used during bootstrap of the operating system +programs and configurations used during +.Fx +bootstrap .Pp -.Bl -tag -width "nvmecontrol/" -compact +.Bl -tag -width "loader.conf.d/" -compact .It Pa defaults/ default bootstrap configuration files; see .Xr loader.conf 5 +.It Pa device.hints +kernel variables for controlling drivers; see +.Xr device.hints 5 .It Pa dtb/ compiled flattened device tree (FDT) files; see .Xr fdt 4 @@ -61,71 +72,212 @@ setting in .El .Pp .It Pa efi/ -mount point for the EFI System Partition (ESP) on UEFI systems +mount point for EFI System Partition (ESP) on UEFI systems .It Pa firmware/ -loadable kernel modules containing binary firmware, for hardware to which -firmware must be downloaded +loadable binary firmware kernel modules +.It Pa fonts/ +binary bitmap console fonts; see +.Xr loader.conf 5 +and +.Xr vtfontcvt 8 +.It Pa images/ +beastie boot menu images; see +.Xr loader_lua 8 .It Pa kernel/ -pure kernel executable (the operating system loaded into memory at boot time) -and kernel modules +pure kernel executable +.Pq the operating system loaded into memory at boot time +and kernel modules; see +.Xr kldstat 8 +.It Pa kernel.old/ +alternative kernel and modules +.It Pa loader.conf +boot loader configuration; see +.Xr loader.conf 5 +.It Pa loader.conf.d/ +.Xr loader.conf 5 +configuration files +.It Pa lua/ +scripts for kernel bootstrapping final stage; see +.Xr loader_lua 8 .It Pa modules/ -third-party loadable kernel modules, such as those associated with +third-party loadable kernel modules, such as those installed with +.Xr pkg 8 +or from .Xr ports 7 .It Pa zfs/ -.Xr zfs 8 -pool cache files +ZFS +.Xr zpool 8 +cache files .El .It Pa /compat/ files supporting binary compatibility with other operating systems .Pp -.Bl -tag -width "nvmecontrol/" -compact +.Bl -tag -width "loader.conf.d" -compact .It Pa linux/ default location for .Xr linux 4 compatibility run-time .El -.Pp .It Pa /dev/ -the normal mount point for +device special files managed by .Xr devfs 5 .Pp -.Bl -tag -width "nvmecontrol/" -compact +.Bl -tag -width "loader.conf.d" -compact +.It Pa ada0 +first ATA storage device +.It Pa ada0p1 +first partition on ada0 +.It Pa cd0 +first optical drive +.It Pa da0 +first SCSI storage device +.It Pa da0s1 +first partition on da0 +.It Pa dri/ +GPU character device node; see +.Xr drm 7 +.It Pa drm/ +GPU +.Xr drm 7 +special files .It Pa fd/ file descriptor files; see .Xr fd 4 +.It Pa fd0 +first floppy drive +.It Pa mmcsd0 +first SD storage device +.It Pa mmcsd0s1 +first partition on mmcsd0 +.It Pa nda0 +first NVMe storage device attached via +.Xr cam 3 +.It Pa null +infinite loop that accepts anything and contains nothing +.It Pa nvd0 +first NVMe storage device using NVMe namespaces +.It Pa pts/ +pseduo-terminals +.It Pa random +source of weak randomness; see +.Xr random 4 +.It Pa sa0 +first tape drive +.It Pa usb/ +USB busses .El +.It Pa /entropy +provides initial state to RNG; see +.Xr save-entropy 8 .It Pa /etc/ -system configuration files and scripts +system wide configuration files and scripts .Pp -.Bl -tag -width "nvmecontrol/" -compact +.Bl -tag -width "freebsd-update.conf" -compact +.It Pa auto_master +autofs +.Xr automount 8 +configuration .It Pa bluetooth/ bluetooth configuration files +.It Pa cron.d/ +tables for driving scheduled tasks; see +.Xr crontab 5 +.It Pa crontab +root's cron table .It Pa defaults/ default system configuration files; see .Xr rc 8 +.It Pa devd/ +configuration for +.Xr devd 8 , +the device state change daemon +.It Pa devfs.conf +boot time device configuration +.It Pa dma/ +configuration for +.Xr dma 8 +.It Pa freebsd-update.conf +configuration for the base system updater +.Xr freebsd-update 8 +.It Pa fstab +static filesystem configuration; see +.Xr fstab 5 +.It Pa hosts +database of local hosts if no network name server is running +.It Pa inetd.conf +configuration for +.Bx +heritage internet servers; see +.Xr inetd 8 .It Pa localtime local timezone information; see .Xr ctime 3 +.It Pa jail.conf.d/ +.Xr jail 8 +startup scripts. +.It Pa login.conf +login class capability database; see +.Xr login.conf 5 +.It Pa machine-id +defines the UUID for the local system, required for dbus .It Pa mail/ .Xr sendmail 8 control files +.Pp +.Bl -tag -width "mailer.conf" -compact +.It Pa aliases +addresses to deliver system mail +.It Pa mailer.conf +.Xr mailwrapper 8 +configuration +.El +.Pp +.It Pa motd.template +message displayed upon tty login; see +.Xr motd 5 .It Pa mtree/ +system mapper specification; see .Xr mtree 8 -configuration files +.It Pa newsyslog.conf.d/ +log rotation configuration files. +.It Pa ntp/ +stored time for the Network Time Protocol +.It Pa ntp.conf +configuration for the NTP client, +.Xr ntpd 8 .It Pa pam.d/ -configuration files for the Pluggable Authentication Modules (PAM) library; see +configuration files for the Pluggable Authentication Modules (PAM) library; +see .Xr pam 3 .It Pa periodic/ scripts that are run daily, weekly, or monthly by .Xr cron 8 ; see .Xr periodic 8 +.It Pa pf.conf +configuration for the Packet Filter firewall; see +.Xr pf 4 +.It Pa pkg/ +default configuration for the package manager, +.Xr pkg 8 .It Pa ppp/ PPP configuration files; see .Xr ppp 8 +.It Pa rc.conf +system and daemon configuration; see +.Xr rc.conf 5 .It Pa rc.d/ system and daemon startup/control scripts; see .Xr rc 8 +.It Pa resolv.conf +DNS configuration; see +.Xr resolv.conf 5 +.It Pa resolvconf.conf +DNS configuration manager configuration, often generated by +local-unbound; see +.Xr local_unbound 8 +or +.Xr resolvconf 8 .It Pa security/ OpenBSM audit configuration files; see .Xr audit 8 @@ -134,9 +286,20 @@ OpenSSH configuration files; see .Xr ssh 1 .It Pa ssl/ OpenSSL configuration files +.It Pa sysctl.conf +kernel state defaults; see +.Xr sysctl.conf 5 +.It Pa syslog.conf +system log configuration +.It Pa ttys +tty creation configuration; see +.Xr getty 8 +.It Pa wpa_supplicant.conf +client wifi configuration; see +.Xr wpa_supplicant.conf 5 .El .It Pa /home/ -users' home directories; whilst the layout is not standardized, the typical home for an interactive user +home directories for users; the typical home for an interactive user .Dv beastie would be .Pa /home/beastie/ @@ -162,29 +325,34 @@ system utilities that are critical to binaries in and .Pa /sbin .It Pa /media/ -empty directory commonly containing mount points for removable media such as -USB drives, CDs, and DVDs +mount points for removable storage media such as CDs, DVDs, +and USB drives; see +.Xr automount 8 +or +.Xr bsdisks 8 .It Pa /mnt/ -empty directory commonly used by system administrators as a temporary mount -point +empty directory commonly used by +system administrators as a temporary mount point .It Pa /net/ automounted NFS shares; see .Xr auto_master 5 .It Pa /nonexistent/ -a non-existent directory; conventionally, a home directory for special user -accounts that do not require a home directory. See also +a non-existent directory; +by convention, it serves as a home directory +for special user accounts +that need no home directory; see also .Pa /var/empty/ .It Pa /proc/ process file system; see .Xr procfs 5 .It Pa /rescue/ -statically-linked programs for emergency recovery; see +statically linked programs for emergency recovery; see .Xr rescue 8 .It Pa /root/ home directory of the root user .It Pa /sbin/ -system programs and administration utilities that are fundamental to -single-user and multi-user modes +system programs and administration utilities +fundamental to both single and multi-user modes .It Pa /tmp/ temporary files that may be removed by .Xr rc 8 ; @@ -205,13 +373,16 @@ distribution files and .Xr bsdinstall 8 .It Pa include/ -standard C include files +standard C include header files .It Pa lib/ shared and archive .Xr ar 1 Ns -type libraries .Pp .Bl -tag -width Fl -compact +.It Pa clang/ +shared libraries for the system compiler, +.Xr clang 1 .It Pa compat/ shared libraries for compatibility .It Pa debug/ @@ -219,9 +390,18 @@ standalone debug data for the kernel and base system libraries and binaries .It Pa dtrace/ DTrace library scripts .It Pa engines/ -OpenSSL (Cryptography/SSL toolkit) dynamically loadable engines +OpenSSL +.Pq Cryptography/SSL toolkit +dynamically loadable engines +.It Pa flua/ +.Fx +Lua shared libraries +.It Pa i18n/ +shared libraries for internationalization .El .Pp +.It Pa lib32/ +32-bit comparability libraries .It Pa libdata/ miscellaneous utility data files .Pp @@ -232,21 +412,31 @@ GCC configuration data linker scripts; see .Xr ld 1 .It Pa pkgconfig/ -.Xr pc 5 Pq Pa ports/devel/pkgconf -files; collections of compiler flags, linker flags, and other information -relevant to library use +collections of compiler and linker flags for the +.Xr pkgconf 1 +development tool .El -.Pp .It Pa libexec/ -system daemons and system utilities that are executed by other programs +system daemons and utilities that are executed by other programs .Pp -.Bl -tag -width Fl -compact -.It Pa aout/ -utilities to manipulate a.out executables -.It Pa elf/ -utilities to manipulate ELF executables +.Bl -tag -width "bsdinstall/" -compact +.It Pa bsdconfig/ +utilities called by the ncurses +.Fx +configuration wizard +.It Pa bsdinstall/ +utilities for +.Xr bsdinstall 8 +.It Pa dwatch/ +profiles for +.Xr dwatch 1 +.It Pa fwget/ +utilities called by +.Xr fwget 8 +.It Pa hyperv/ +??? .It Pa lpr/ -utilities and filters for LP print system; see +utilities and filters for the line printer system; see .Xr lpr 1 .It Pa sendmail/ the @@ -258,27 +448,37 @@ restricted shell for .Xr sendmail 8 ; see .Xr smrsh 8 +.It Pa zfs/ +Z file system utilities .El .Pp .It Pa local/ -local executables, libraries, etc. -Also used as the default destination for the +default destination for local executables, libraries, etc, installed by +.Xr pkg 7 +or .Xr ports 7 -framework. -Within +.Pp +within .Pa local/ , the general layout sketched out by .Nm for .Pa /usr -should be used. -Exceptions are the ports documentation +should be used ; exceptions are the ports documentation .Po in .Pa share/doc// Ns Pc , and .Pa /usr/local/etc .Po mimics -.Pa /etc Ns Pc . +.Pa /etc Ns Pc +.Pp +.Bl -tag -width Fl -compact +.It Pa share/doc/freebsd/ +articles, books, FAQ, and handbooks available from the +.Fx +project +.El +.Pp .It Pa obj/ architecture-specific target tree produced by building .Fx @@ -289,14 +489,17 @@ from source; see ports collection; see .Xr ports 7 .It Pa sbin/ -system daemons and system utilities that are executed by users +system daemons and utilities meant for user execution .It Pa share/ architecture-independent files .Pp .Bl -tag -width Fl -compact .It Pa calendar/ -system-wide calendar files; see +a variety of pre-fab calendar files; see .Xr calendar 1 +.It Pa certs/ +TLS certificates for +.Xr openssl 1 .It Pa dict/ word lists; see .Xr look 1 @@ -311,12 +514,17 @@ words from Webster's Second International .Pp .It Pa doc/ miscellaneous documentation +.It Pa dtrace/ +scripts for the Dynamic Tracing Compiler; see +.Xr dtrace 1 .It Pa examples/ various examples for users and programmers .It Pa firmware/ firmware images loaded by userland programs .It Pa games/ -used by various games +ASCII text files used by +.Bx +heritage games .It Pa keys/ known trusted and revoked keys .Pp @@ -332,11 +540,18 @@ and localization files; see .Xr setlocale 3 .It Pa man/ -manual pages +system manual pages .It Pa misc/ -miscellaneous system-wide files +miscellaneous system-wide ASCII text files .Pp .Bl -tag -width Fl -compact +.It Pa ascii +chart of the ASCII codepoints +.It Pa flowers +the meanings of flowers +.It Pa magic +magic numbers used by +.Xr file 1 .It Pa termcap terminal characteristics database; see .Xr termcap 5 @@ -365,7 +580,9 @@ MIBs, example files and tree definitions for the SNMP daemon tree definition files for use with .Xr gensnmptree 1 .It Pa mibs/ -MIB files +management Information Base +.Pq MIB +files .El .Pp .It Pa syscons/ @@ -395,51 +612,50 @@ binaries .It Pa VERSION/ files for .Fx -release VERSION. -By convention, +release VERSION; +by convention, .Dq VERSION matches .Xr uname 1 -.Fl r . +.Fl r .Pp .Bl -tag -width Fl -compact .It Pa MACHINE.MACHINE_ARCH/ -represent the binary ABI for these files. +represent the binary ABI for these files; .Dq MACHINE matches .Xr uname 1 -.Fl m . +.Fl m ; .Dq MACHINE_ARCH matches .Xr uname 1 -.Fl p . +.Fl p .El .El .Pp .It Pa tabset/ -tab description files for a variety of terminals; used in the termcap file; -see +tab description files for a variety of terminals; used in +the termcap file; see .Xr termcap 5 .It Pa vi/ localization support and utilities for .Xr vi 1 .It Pa vt/ +files used by the system console; see .Xr vt 4 -files .Pp .Bl -tag -width Fl -compact .It Pa fonts/ console fonts; see -.Xr vidcontrol 1 +.Xr vidcontrol 1 , +.Xr vidfont 1 , and -.Xr vidfont 1 +.Xr vtfontcvt 8 .It Pa keymaps/ console keyboard maps; see .Xr kbdcontrol 1 and .Xr kbdmap 1 -.\" .It Pa scrnmaps/ -.\" console screen maps .El .Pp .It Pa zoneinfo/ @@ -450,10 +666,10 @@ timezone configuration information; see .It Pa src/ .Fx source code; see -.Xr development 7 . -The layout of the source tree is described by the top-level +.Xr development 7 ; +the layout of the source tree is described by the top-level .Pa README.md -file. +file .Pp .It Pa tests/ the @@ -468,7 +684,7 @@ log, temporary, transient, and spool files .It Pa account/ system accounting files .Pp -.Bl -tag -width Fl -compact +.Bl -tag -width Ds -compact .It Pa acct execution accounting file; see .Xr acct 5 @@ -478,67 +694,155 @@ execution accounting file; see timed command scheduling files; see .Xr at 1 .Pp -.Bl -tag -width Fl -compact +.Bl -tag -width Ds -compact .It Pa jobs/ job files .It Pa spool/ output spool files .El .Pp +.It Pa audit/ +security event audit trail files; see +.Xr audit 8 +.It Pa authpf/ +user shell sessions for authenticating gateways; see +.Xr authpf 8 .It Pa backups/ -miscellaneous backup files +critical system configuration backups .It Pa cache/ miscellaneous cache files .Pp -.Bl -tag -width Fl -compact +.Bl -tag -width Ds -compact .It Pa pkg/ cached packages for .Xr pkg 8 +.It Pa cups/ +cached printers for the Common Unix Prinitng system; see +.Xr cups 1 .El .Pp .It Pa crash/ -default directory for kernel crash dumps; see +default directory to store kernel crash dumps; see .Xr crash 8 and .Xr savecore 8 .It Pa cron/ +files used by cron; see .Xr cron 8 -files .Pp -.Bl -tag -width Fl -compact +.Bl -tag -width Ds -compact .It Pa tabs/ +crontab files; see .Xr crontab 5 -files .El .Pp .It Pa db/ miscellaneous automatically-generated system-specific database files .Pp .Bl -tag -width "freebsd-update/" -compact +.It Pa etcupdate/ +temporary files and log for +.Xr etcupdate 8 .It Pa freebsd-update/ -temporary files and downloads for +downloads and temporary files for .Xr freebsd-update 8 +.It Pa pkg/ +package database .El .Pp .It Pa empty/ -for use by programs that require an empty directory. -Uses include privilege separation by +for use by programs that require an empty directory, +used for instance by .Xr sshd 8 +for privilege separation .It Pa games/ -miscellaneous game status and score files +miscellaneous game status and score files for +.Bx +heritage games .It Pa heimdal/ Kerberos server databases; see .Xr kdc 8 +.It Pa lib/ +holds state information for applications ported from linux .It Pa log/ -miscellaneous system log files -.Pp -.Bl -tag -width "utx.lastlogin" -compact +system log files +.Pp +.Bl -tag -width "bsdinstall_log" -compact +.It Pa Xorg.0.log +.Xr Xserver 1 +log, if +.Xr X 7 +is installed +rotates to +.Pa Xorg.0.log.old +.It Pa aculog +serial line access log; see +.Xr cu 1 +.It Pa auth.log +system authentication log +.It Pa bsdinstall_log +system installation log +.It Pa bsdisks.log +FreeDesktop.org automounter log, if a desktop environment is using +.Xr bsdisks 8 , +from +.Xr ports 7 +.It Pa cron +scheduled task log; see +.Xr cron 8 +.It Pa cups/ +logs for +.Xr cups 1 +.It Pa daemon.log +default log for system daemons +.It Pa devd.log +default log for device state change daemon +.It Pa dmesg.today +system message buffer log +Rotates to +.Pa dmesg.yesterday +.It Pa debug.log +??? +.It Pa lpd-errs +logs for the line printer daemon; see +.Xr lpd 8 +.It Pa maillog +.Xr sendmail 8 +log, rotates and compresses to maillog.0.bz2 +.It Pa messages +general system log; see +.Xr syslog 3 +.It Pa mount.today +currently loaded +.Xr fstab 5 , +rotates to +.Pa mount.yesterday +.It Pa pf.today +packet filter firewall log; see +.Xr pf 4 +.It Pa pflog +saved packets caught by +.Xr pflogd 8 +.It Pa ppp.log +see +.Xr ppp 8 +.It Pa security +transcript of events marked with the security flag +.It Pa setuid.today +listing of executable files which run with elevated permissions, rotates +to +.Pa setuid.yesterday +.It Pa userlog +logs changes in users or groups .It Pa utx.lastlogin last login log; see .Xr getutxent 3 .It Pa utx.log login/logout log; see .Xr getutxent 3 +.It Pa xferlog +default log for +.Xr ftpd 8 .El .Pp .It Pa mail/ @@ -549,11 +853,11 @@ system messages database; see .It Pa preserve/ unused, present for historical reasons .It Pa quotas/ -file system quota information files +UFS quota information files .It Pa run/ files containing information about the operating system since it was booted .Pp -.Bl -tag -width Fl -compact +.Bl -tag -width "wpa_supplicant/" -compact .It Pa bhyve/ .Xr bhyve 8 virtual machine @@ -566,10 +870,12 @@ group for command connection sockets; see .It Pa utx.active database of current users; see .Xr getutxent 3 +.It Pa wpa_supplicant/ +IEEE Std. 802.11 wifi run time files .El .Pp .It Pa rwho/ -rwho data files; see +information about other systems on the local network; see .Xr rwhod 8 , .Xr rwho 1 , and @@ -581,26 +887,40 @@ miscellaneous printer and mail system spooling directories .It Pa clientmqueue/ undelivered submission mail queue; see .Xr sendmail 8 +.It Pa cups/ +print jobs and temporary files for +.Xr cups 1 +.It Pa dma/ +undelivered mail queue for +.Dx +Mail Agent; see +.Xr dma 8 +.It Pa lock/ +??? .It Pa ftp/ ftp root directory; see .Xr ftpd 8 .It Pa mqueue/ -undelivered mail queue; see +undelivered mail queue for .Xr sendmail 8 .It Pa output/ line printer spooling directories .El .Pp .It Pa tmp/ -temporary files that are not removed by +temporary files that are not removed between system reboots by .Xr rc 8 .Pp .Bl -tag -width "vi.recover/" -compact .It Pa vi.recover/ +recovery files for the .Xr vi 1 -recovery files +editor .El .Pp +.It Pa unbound/ +files and configuration for +.Xr unbound 8 .It Pa yp/ the NIS maps; see .Xr yp 8 @@ -624,5 +944,5 @@ this document. .Sh HISTORY A .Nm -manual page appeared in +manual page first appeared in 1979 with .At v7 . From nobody Wed May 1 18:47:25 2024 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 4VV5f63Q26z5Js4S; Wed, 1 May 2024 18:47: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 4VV5f56FRSz4XfD; Wed, 1 May 2024 18:47:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714589245; 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=93wkWyHdbfTSEIy9V5vfWUY5j904g3v+LmnsIJUdwuQ=; b=KL9bfNdTX4VLgD36akMXTl6MlHk8Iy2NxCIhnPN5j3JfTtIeh+fYexELbCYmadyeh7RfPS y1mh4k4vxQyvkubeosHe5Er5p102oXxwOStm7QedkQaYDAi9Woal1JvfW2ERDsA1PkU+/X 7xzaBWyaQn7i/F7GNeMY7z1fGDh0790mZzXcnCgJBnrR84MB3SLgk6i7kBNZGIqD1IgNGG bOgdY28DakRVHgCBm3BNLvMqU3ioNqvJVxn8iVlS0H/hCuUMF1dFYtG8luZLQsJCgRGpnW W+IaJgI7rL5JFy3hv9y1iiKS5k94KRyMlW7pPUQCZHbsipdu6j8vVypNpT9CYA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714589245; a=rsa-sha256; cv=none; b=O0Lp9+dffzL7sVqtBtSq3lushVHjEImhBIvjYoGgtmznTbTURl+lkHPLNOzbft5Nl4KVu1 92AhhG/j1TGoVEdTKMxKgp+C3fdlBRd7LGxT/2E0T1XFHHuxKcguomOyMc0igtySA1IaYX VXq/fERCQDGEcFvxOnzI5KEj9yHWYXt3zQrIOhXgzSWfiADlkGRfD9xvtooye6+4YddSyF FXFzN4e8DzvIjP3LcfSeEmLb9lL9c8nB1jLKzF1WN9WIl7QDgu7f2PH2uRKcKygM3A607f qv4CsS+lBAAQ3Ey7nXKh8PjG97X8EUcjIp/y3+FSGDiP0Xb//03t08dRid6vYw== 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=1714589245; 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=93wkWyHdbfTSEIy9V5vfWUY5j904g3v+LmnsIJUdwuQ=; b=KrU2+WuSQ2xZz3FEvK2fGg2S+8xka6zCYtzlwL8OtXoPaOhkTy0RmrcW8rvW1yITL1/zZo nUenZXC5tFF3wCI4oEdj0Jjr7OjmSpyuDhenOuPu2FK9sJ5w1JRaO06CgI5X32VkFIhdwT mGNb2JfyozrTjJPtCezxL21Dk9006IKuSBolF7/n3p0nAX+DkY+9dmfMFLg5YNRdzZ4+Ab TlYhn6PlWy7STl0piXO4lF1qKP8j20baH8D4x/LsoJVUtCQgkDXFtY9+/vGkXVdYeKKFZ0 4PrVPHOppMwIIn+P96floEVQRZZBCoOr+ZFPpU3HIKknaBID8MFDrJfdNxP2Zw== 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 4VV5f55DRbzWBf; Wed, 1 May 2024 18:47: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 441IlP30082156; Wed, 1 May 2024 18:47:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 441IlPEd082153; Wed, 1 May 2024 18:47:25 GMT (envelope-from git) Date: Wed, 1 May 2024 18:47:25 GMT Message-Id: <202405011847.441IlPEd082153@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: a7a687302375 - stable/14 - BSD.usr.dist: remove empty /usr/libdata/gcc directory List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a7a687302375e1130b8655223696ea8866a49af2 Auto-Submitted: auto-generated The branch stable/14 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=a7a687302375e1130b8655223696ea8866a49af2 commit a7a687302375e1130b8655223696ea8866a49af2 Author: Mitchell Horne AuthorDate: 2024-03-21 14:53:55 +0000 Commit: Mitchell Horne CommitDate: 2024-05-01 18:42:57 +0000 BSD.usr.dist: remove empty /usr/libdata/gcc directory I am unsure of its exact historical usage, but, we no longer ship GCC with FreeBSD, and it should have been removed. Reviewed by: imp, emaste MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D44440 (cherry picked from commit cc1268a926772900a08c61fd791bb66df1e6c30c) --- ObsoleteFiles.inc | 3 +++ etc/mtree/BSD.usr.dist | 2 -- share/man/man7/hier.7 | 4 +--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 2b0766222429..b5253c28d42c 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -497,6 +497,9 @@ OLD_FILES+=usr/include/c++/v1/experimental/vector OLD_FILES+=usr/include/c++/v1/limits.h OLD_FILES+=usr/include/c++/v1/setjmp.h +# 20240321: remove empty /usr/libdata/gcc directory +OLD_DIRS+=usr/libdata/gcc + # 20240213: caroot bundle updated OLD_FILES+=usr/share/certs/trusted/Security_Communication_Root_CA.pem diff --git a/etc/mtree/BSD.usr.dist b/etc/mtree/BSD.usr.dist index 4b75fbb3b4e5..193184c3a134 100644 --- a/etc/mtree/BSD.usr.dist +++ b/etc/mtree/BSD.usr.dist @@ -85,8 +85,6 @@ .. .. libdata - gcc - .. ldscripts .. pkgconfig diff --git a/share/man/man7/hier.7 b/share/man/man7/hier.7 index 10847993c0f5..8cd6ff338b5c 100644 --- a/share/man/man7/hier.7 +++ b/share/man/man7/hier.7 @@ -28,7 +28,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd February 27, 2024 +.Dd March 21, 2024 .Dt HIER 7 .Os .Sh NAME @@ -406,8 +406,6 @@ shared libraries for internationalization miscellaneous utility data files .Pp .Bl -tag -width Fl -compact -.It Pa gcc/ -GCC configuration data .It Pa ldscripts/ linker scripts; see .Xr ld 1 From nobody Wed May 1 18:47:26 2024 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 4VV5f717VFz5Jrnc; Wed, 1 May 2024 18:47: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 4VV5f66j0vz4Xw5; Wed, 1 May 2024 18:47:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714589246; 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=fLwVFywGIH+vy+vdDvCrarrhVgsWuA8u60YkQihuWQQ=; b=rtPAJAfuGmrEGkcxLG7UB5YSzDcjLWsNZ8woLqjX0mpne0Bfh+CuErF11EHGQSZv8HUd9t Y9fPnndq6H3vXCzbFdBZzRhGl8TxsM7A18igC7R0oQ14A2WjVmwuh87i1irkrDu/A35cgI azGfCy0plBAwcNpFqogUbJvcNSiyyYtrFwjLr/1Iy7/yhTxhmNm/EyMzUoWUUvC+t4fvZk LbtlyVNDAZtESJ/2Jz/wAdJ12+rKK0FlAimS54VOrqNp8Ri6+vZHr3cLgB8hKn0k2TljJ+ fNThG/HUYKZND3IORgjPiu4OPWTbQAqu9hTxGvwCyTgqHbWx+c0fs5E3umG3WA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714589246; a=rsa-sha256; cv=none; b=JVNR9ugTR+KYtPFJxinTrIzQqelhOTglgur5nSmicqriWdIXWQ0QrcjqXnLlOLnzVZYfhC eNHuj06XcxuLW3APUS8qGfXB18HmAv9+EP9I0TER1pFDbMIO8bGGxfun2WVyHLJPjW3qk6 fEwX2ynCPD/92O6ctKUj+4vkXgEDOqy8bm+Io1XDpBnlWdJdRcWIwDIwcP3Jccbdd6mcLG HTd59+Keb4Rqx/5dGXyB8GcDQtq5rIbO6xFIgcsixYEBKCPNF2XuUYvR+Djf1psBxsHM3B I4fDkfsUWNq9BlU/FZRWZVIzcBmaYUdV7a4TUuP6TF5OJe+keLYbLvIDTEYAdA== 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=1714589246; 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=fLwVFywGIH+vy+vdDvCrarrhVgsWuA8u60YkQihuWQQ=; b=GRqajRluX6YMx7sQEwbMGAWzwripyo98YG/bAqG7RKYhygTyzsOPqCqCGM7DO1Y3MQjHPP KFM0p9z6ZambEo73018HvKjCcFpGLh20ebxGHTEx4VX9vGaKH5xul6ubfC64djpbV5UmE6 miZDHJqiowyIO2dasIg48r/XDrkGf86PHg2xzS1CGfTUZWRj8E7nuwbvCiZSPwBsb/zpy9 KNsU/dQ/3XnSMp31Umbt0TuSHajIB4vS8wvW+k0VOJpHrSCQe7ImnuTIXv+n/XjpTT155f rYVklKcWlHjhh8gLDu65zR46+xCAMdzrepOHDhxHPwmWKP2IKkMhFn1+W5CxKQ== 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 4VV5f66GQdzVyk; Wed, 1 May 2024 18:47: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 441IlQQZ082208; Wed, 1 May 2024 18:47:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 441IlQXV082205; Wed, 1 May 2024 18:47:26 GMT (envelope-from git) Date: Wed, 1 May 2024 18:47:26 GMT Message-Id: <202405011847.441IlQXV082205@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 63b747823bea - stable/14 - hier.7: polish entry to system manual List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 63b747823bead05837f6893a2f2d38b516bc1e49 Auto-Submitted: auto-generated The branch stable/14 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=63b747823bead05837f6893a2f2d38b516bc1e49 commit 63b747823bead05837f6893a2f2d38b516bc1e49 Author: Alexander Ziaee AuthorDate: 2024-03-20 17:40:57 +0000 Commit: Mitchell Horne CommitDate: 2024-05-01 18:43:20 +0000 hier.7: polish entry to system manual Entries reworded to improve grammar or add keywords: - document description: substitute layout for index for first-glance - /etc/freebsd/update.conf - /usr/share/vi/ Entries that have been wordshuffled for brevity or consistency: - /{bin,libexec,nonexistent,sbin,tmp}/ - /boot/dtb/overlays/ - /boot/{defaults,efi,kernel,lua}/ - /usr/libexec/ - /var/{db,games,lib,log/{bsdisks.log,spool/,tmp/}} - /usr/share/sysroot/VERSION/MACHINE.MACHINE_ARCH/ (unfold a little) - /usr/local/share/doc/freebsd/ (unfold a little) Entries that have macro or linking adjustments: - /{boot,boot/efi,dev,etc,home,sbin,usr/bin}/ (overview or intro pages) - /media/ (bsdisks is from ports, but afaik pulled by every desktop) - /usr/share/{lib/,lib/dtrace/,libdata/games/,man/}/ (intro pages) - /var/log/messages (syslog(3) -> syslogd(8)) Entries that have been added: - /dev/{cuaU0,vmm,zvol}/ - /usr/share/{atf,bhyve}/ - /usr/share/libexec/hyperv/ (thanks @rtprio) - /local// - /var/log/debug.log (thanks @pauamma) - /var/spool/{lock,lpd} Please forgive my earlier mistakes fixed in this commit: - /{dev,/usr/share/{calendar,misc}} : accidentally reverted description - /etc/local-unbound.conf/ (wrong link) - /usr/{freebsd-dist,lib32,libdata},/var/log/{dmesg.today,lpd-errs} (typos) - /{usr/libdata/gcc/,var/log/bsdisks.log} (removed, unnecessary) PR: 261349 Reviewed by: mhorne MFC after: 1 week Pull Request: https://github.com/freebsd/freebsd-src/pull/1131 (cherry picked from commit 9dfe484e126d0e477a0d79b3f7a2350af9f5e025) --- share/man/man7/hier.7 | 207 ++++++++++++++++++++++++++++++-------------------- 1 file changed, 123 insertions(+), 84 deletions(-) diff --git a/share/man/man7/hier.7 b/share/man/man7/hier.7 index 8cd6ff338b5c..7d164b5683d6 100644 --- a/share/man/man7/hier.7 +++ b/share/man/man7/hier.7 @@ -28,12 +28,12 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd March 21, 2024 +.Dd April 18, 2024 .Dt HIER 7 .Os .Sh NAME .Nm hier -.Nd layout of +.Nd index of .Fx file system hierarchy .Sh DESCRIPTION @@ -44,15 +44,18 @@ root directory of the file system .Fx copyright information .It Pa /bin/ -user utilities fundamental to both single and multi-user modes +fundamental +.Bx +user utilities; see +.Xr intro 1 .It Pa /boot/ programs and configurations used during .Fx -bootstrap +.Xr boot 8 .Pp .Bl -tag -width "loader.conf.d/" -compact .It Pa defaults/ -default bootstrap configuration files; see +default boot configuration files; see .Xr loader.conf 5 .It Pa device.hints kernel variables for controlling drivers; see @@ -65,14 +68,18 @@ and .Pp .Bl -tag -width "overlays/" -compact .It Pa overlays/ -compiled flattened device tree (FDT) overlays; these can be applied using the +compiled +.Xr fdt 4 +overlays; see .Va fdt_overlays -setting in +in .Xr loader.conf 5 .El .Pp .It Pa efi/ -mount point for EFI System Partition (ESP) on UEFI systems +the +.Xr uefi 8 +EFI System Partition (ESP) mount point .It Pa firmware/ loadable binary firmware kernel modules .It Pa fonts/ @@ -84,9 +91,8 @@ and beastie boot menu images; see .Xr loader_lua 8 .It Pa kernel/ -pure kernel executable -.Pq the operating system loaded into memory at boot time -and kernel modules; see +.Fx +kernel and modules; see .Xr kldstat 8 .It Pa kernel.old/ alternative kernel and modules @@ -97,7 +103,7 @@ boot loader configuration; see .Xr loader.conf 5 configuration files .It Pa lua/ -scripts for kernel bootstrapping final stage; see +scripts for the Lua boot loader; see .Xr loader_lua 8 .It Pa modules/ third-party loadable kernel modules, such as those installed with @@ -119,7 +125,9 @@ default location for compatibility run-time .El .It Pa /dev/ -device special files managed by +device nodes and special files; see +.Xr intro 4 +and .Xr devfs 5 .Pp .Bl -tag -width "loader.conf.d" -compact @@ -129,12 +137,15 @@ first ATA storage device first partition on ada0 .It Pa cd0 first optical drive +.It Pa cuaU0 +first USB serial port; see +.Xr cu 1 .It Pa da0 first SCSI storage device .It Pa da0s1 first partition on da0 .It Pa dri/ -GPU character device node; see +GPU character device nodes; see .Xr drm 7 .It Pa drm/ GPU @@ -157,7 +168,8 @@ infinite loop that accepts anything and contains nothing .It Pa nvd0 first NVMe storage device using NVMe namespaces .It Pa pts/ -pseduo-terminals +pseduo-terminals; see +.Xr pts 4 .It Pa random source of weak randomness; see .Xr random 4 @@ -165,12 +177,20 @@ source of weak randomness; see first tape drive .It Pa usb/ USB busses +.It Pa vmm/ +active +.Xr bhyve 8 +virtual machines +.It Pa zvol/ +.Xr zfs 8 +volumes .El .It Pa /entropy provides initial state to RNG; see .Xr save-entropy 8 .It Pa /etc/ -system wide configuration files and scripts +base system configuration files and scripts; see +.Xr intro 5 .Pp .Bl -tag -width "freebsd-update.conf" -compact .It Pa auto_master @@ -197,7 +217,7 @@ boot time device configuration configuration for .Xr dma 8 .It Pa freebsd-update.conf -configuration for the base system updater +configuration for the base system updater; see .Xr freebsd-update 8 .It Pa fstab static filesystem configuration; see @@ -214,7 +234,7 @@ local timezone information; see .Xr ctime 3 .It Pa jail.conf.d/ .Xr jail 8 -startup scripts. +startup scripts .It Pa login.conf login class capability database; see .Xr login.conf 5 @@ -275,7 +295,7 @@ DNS configuration; see .It Pa resolvconf.conf DNS configuration manager configuration, often generated by local-unbound; see -.Xr local_unbound 8 +.Xr local-unbound 8 or .Xr resolvconf 8 .It Pa security/ @@ -300,11 +320,11 @@ client wifi configuration; see .El .It Pa /home/ home directories for users; the typical home for an interactive user -.Dv beastie +.Va beastie would be .Pa /home/beastie/ .It Pa /lib/ -system libraries that are critical to binaries in +system libraries critical to binaries in .Pa /bin and .Pa /sbin @@ -320,16 +340,18 @@ vendor-specific libraries to extend the utility .El .It Pa /libexec/ -system utilities that are critical to binaries in +system utilities critical to binaries in .Pa /bin and .Pa /sbin .It Pa /media/ mount points for removable storage media such as CDs, DVDs, and USB drives; see -.Xr automount 8 +.Xr automount 8 , or .Xr bsdisks 8 +if a using a desktop environment from +.Xr ports 7 .It Pa /mnt/ empty directory commonly used by system administrators as a temporary mount point @@ -338,8 +360,7 @@ automounted NFS shares; see .Xr auto_master 5 .It Pa /nonexistent/ a non-existent directory; -by convention, it serves as a home directory -for special user accounts +by convention, it serves as a home directory for user accounts that need no home directory; see also .Pa /var/empty/ .It Pa /proc/ @@ -351,33 +372,37 @@ statically linked programs for emergency recovery; see .It Pa /root/ home directory of the root user .It Pa /sbin/ -system programs and administration utilities -fundamental to both single and multi-user modes +fundamental +.Bx +system administration utilities; see +.Xr intro 8 .It Pa /tmp/ -temporary files that may be removed by -.Xr rc 8 ; -see the +temporary files commonly removed between system reboots; +see .Va clear_tmp_enable -variable of +in .Xr rc.conf 5 .It Pa /usr/ contains the majority of user utilities and applications .Pp .Bl -tag -width "freebsd-dist/" -compact .It Pa bin/ -common utilities, programming tools, and applications +common utilities, programming tools, and applications; see +.Xr intro 1 .It Pa freebsd-dist/ distribution files -.Pq like base.txz ; see +.Pq like base.txz ; +see .Xr release 7 and .Xr bsdinstall 8 .It Pa include/ standard C include header files .It Pa lib/ -shared and archive +shared and .Xr ar 1 Ns -type -libraries +libraries; see +.Xr intro 3 .Pp .Bl -tag -width Fl -compact .It Pa clang/ @@ -388,7 +413,8 @@ shared libraries for compatibility .It Pa debug/ standalone debug data for the kernel and base system libraries and binaries .It Pa dtrace/ -DTrace library scripts +.Xr dtrace 1 +library scripts .It Pa engines/ OpenSSL .Pq Cryptography/SSL toolkit @@ -401,7 +427,7 @@ shared libraries for internationalization .El .Pp .It Pa lib32/ -32-bit comparability libraries +32-bit compatibility libraries .It Pa libdata/ miscellaneous utility data files .Pp @@ -414,8 +440,9 @@ collections of compiler and linker flags for the .Xr pkgconf 1 development tool .El +.Pp .It Pa libexec/ -system daemons and utilities that are executed by other programs +system daemons and utilities executed by programs .Pp .Bl -tag -width "bsdinstall/" -compact .It Pa bsdconfig/ @@ -432,7 +459,7 @@ profiles for utilities called by .Xr fwget 8 .It Pa hyperv/ -??? +scripts for communicating with the Hyper-V hypervisor .It Pa lpr/ utilities and filters for the line printer system; see .Xr lpr 1 @@ -451,26 +478,36 @@ Z file system utilities .El .Pp .It Pa local/ -default destination for local executables, libraries, etc, installed by +local executables, libraries, etc, installed by .Xr pkg 7 or .Xr ports 7 .Pp -within -.Pa local/ , -the general layout sketched out by -.Nm -for -.Pa /usr -should be used ; exceptions are the ports documentation -.Po in -.Pa share/doc// Ns Pc , -and -.Pa /usr/local/etc -.Po mimics -.Pa /etc Ns Pc -.Pp .Bl -tag -width Fl -compact +.It Pa bin/ +local user utilities, see +.Xr intro 1 +.It Pa etc/ +local program configurations +.It Pa include/ +local library headers +.It Pa lib/ +local libraries +.It Pa lib32/ +local 32-bit compatability libraries +.It Pa libdata/ +local utility data files +.It Pa libexec/ +utilities executed by local utilities +.It Pa man/ +local manual pages; see +.Xr man 1 +.It Pa sbin/ +local administration utilities +.It Pa share/ +local architecture-independent files +.It Pa share/doc/ +local documentation .It Pa share/doc/freebsd/ articles, books, FAQ, and handbooks available from the .Fx @@ -487,13 +524,20 @@ from source; see ports collection; see .Xr ports 7 .It Pa sbin/ -system daemons and utilities meant for user execution +system daemons and utilities meant for user execution; see +.Xr intro 8 .It Pa share/ architecture-independent files .Pp .Bl -tag -width Fl -compact +.It Pa atf/ +scripts for the Automated Testing Framework; see +.Xr ATF 7 +.It Pa bhyve/ +.Xr bhyve 8 +keyboard mappings .It Pa calendar/ -a variety of pre-fab calendar files; see +system-wide calendar files; see .Xr calendar 1 .It Pa certs/ TLS certificates for @@ -522,7 +566,8 @@ firmware images loaded by userland programs .It Pa games/ ASCII text files used by .Bx -heritage games +heritage games, see +.Xr intro 6 .It Pa keys/ known trusted and revoked keys .Pp @@ -538,9 +583,10 @@ and localization files; see .Xr setlocale 3 .It Pa man/ -system manual pages +system manual pages; see +.Xr man 1 .It Pa misc/ -miscellaneous system-wide ASCII text files +miscellaneous system-wide files .Pp .Bl -tag -width Fl -compact .It Pa ascii @@ -606,7 +652,7 @@ console screen maps files necessary for the -sysroot compiler/linker argument to build non-native binaries .Pp -.Bl -tag -width Fl -compact +.Bl -tag -width "VERSION/" -compact .It Pa VERSION/ files for .Fx @@ -616,9 +662,7 @@ by convention, matches .Xr uname 1 .Fl r -.Pp -.Bl -tag -width Fl -compact -.It Pa MACHINE.MACHINE_ARCH/ +.It Pa VERSION/MACHINE.MACHINE_ARCH/ represent the binary ABI for these files; .Dq MACHINE matches @@ -629,15 +673,15 @@ matches .Xr uname 1 .Fl p .El -.El .Pp .It Pa tabset/ tab description files for a variety of terminals; used in the termcap file; see .Xr termcap 5 .It Pa vi/ -localization support and utilities for +localization support and utilities for the .Xr vi 1 +editor .It Pa vt/ files used by the system console; see .Xr vt 4 @@ -735,7 +779,7 @@ crontab files; see .El .Pp .It Pa db/ -miscellaneous automatically-generated system-specific database files +autogenerated system-specific database files .Pp .Bl -tag -width "freebsd-update/" -compact .It Pa etcupdate/ @@ -754,14 +798,14 @@ used for instance by .Xr sshd 8 for privilege separation .It Pa games/ -miscellaneous game status and score files for +status and score files for .Bx heritage games .It Pa heimdal/ Kerberos server databases; see .Xr kdc 8 .It Pa lib/ -holds state information for applications ported from linux +state information for ported Linux applications .It Pa log/ system log files .Pp @@ -770,8 +814,7 @@ system log files .Xr Xserver 1 log, if .Xr X 7 -is installed -rotates to +is installed rotates to .Pa Xorg.0.log.old .It Pa aculog serial line access log; see @@ -780,11 +823,6 @@ serial line access log; see system authentication log .It Pa bsdinstall_log system installation log -.It Pa bsdisks.log -FreeDesktop.org automounter log, if a desktop environment is using -.Xr bsdisks 8 , -from -.Xr ports 7 .It Pa cron scheduled task log; see .Xr cron 8 @@ -796,20 +834,19 @@ default log for system daemons .It Pa devd.log default log for device state change daemon .It Pa dmesg.today -system message buffer log -Rotates to +system message buffer log, rotates to .Pa dmesg.yesterday .It Pa debug.log -??? +undiscarded debug syslog messages .It Pa lpd-errs -logs for the line printer daemon; see +logs for the line printer spooler daemon; see .Xr lpd 8 .It Pa maillog .Xr sendmail 8 log, rotates and compresses to maillog.0.bz2 .It Pa messages general system log; see -.Xr syslog 3 +.Xr syslogd 8 .It Pa mount.today currently loaded .Xr fstab 5 , @@ -879,7 +916,7 @@ information about other systems on the local network; see and .Xr ruptime 1 .It Pa spool/ -miscellaneous printer and mail system spooling directories +printer and mail system spooling directories .Pp .Bl -tag -width "clientmqueue/" -compact .It Pa clientmqueue/ @@ -894,7 +931,10 @@ undelivered mail queue for Mail Agent; see .Xr dma 8 .It Pa lock/ -??? +serial device locks; see +.Xr uucplock 3 +.It Pa lpd/ +line printer spooler daemon spool .It Pa ftp/ ftp root directory; see .Xr ftpd 8 @@ -906,8 +946,7 @@ line printer spooling directories .El .Pp .It Pa tmp/ -temporary files that are not removed between system reboots by -.Xr rc 8 +temporary files not removed between system reboots .Pp .Bl -tag -width "vi.recover/" -compact .It Pa vi.recover/ From nobody Thu May 2 01:11:25 2024 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 4VVG995xd4z5KNXy; Thu, 2 May 2024 01:11: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 4VVG993KgHz58lg; Thu, 2 May 2024 01:11:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714612285; 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=NGB5+KXsQAAhBjHfDPFzelW5yNxIGaN2xfAR4oH+KEU=; b=D5b2tgXK3acCFAo4AW03d6zcfXrofWG7MJc0aqmcFwJ3Q5bxehMxvhAmItqPFQVCWdQArw 2OqN0CXViCWhlZkeGwaz1SIqtHZSY85rWLXMDE7LPfTXXoeXCCrsIhV0ezng8N7X75bboD As1vuwhCLcL3+3/hg1qgx/EOb7Wbs51n30fg/i3y4AL3qtc+3huCBtRk3tGT6CBGHNIwsZ 5XjiKrDkjSrjO3occ3+9MFUTNze5uSuqw64qd1+JteBxJRLihh4avoKnHc4VMbSPoZ0YWt ms6rkfsUPzd3Q92JZFK9ueJnyOYxS4ypL/sD7BrghvUSzjfP2eFNujaXyV63BA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714612285; a=rsa-sha256; cv=none; b=FEYKoi6e4u0QN8knWYzDkqrR0XHJ0hA7Ar978LUwlPxPTixD8WV1U+8X14PsJPiP5bHUMV oXN3G9Giyb+kiTTrx9umDtwfZSWydNB2OgyaUbij6PWxH3UKsTLdvbVvbHKUSKw6lYEmN3 PHYkZa7OSJxEJRgRIB+vCEwUR6aT8uLNtOTx++QhPxfBCCiWowhazCWZAMwbMc9bcreXmw nCKgRXVxGL9I6iX4sTm8Empr73nd+vQ5xv1tP8GGP8m9ClZurUx5JX2YvUh3w0awdhXx73 Yky4ree6xjQRubfcyF+is6pM4NBOWztGjvNT68QGwoOxS8seYO9TjT12bH5N7w== 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=1714612285; 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=NGB5+KXsQAAhBjHfDPFzelW5yNxIGaN2xfAR4oH+KEU=; b=TaNupRtjb7i1IO9JkooomhcacdVFXJgdXQ0kE7T/YJ3i+AjIGq8HdHmFeKbjF1HQ9ekjNI VbjdJQak+BQDbuqLdafQPlkGOvwdDZYeHb+FkDto3PKaOpeRu1qAZRifUKwxwyF98Wjt5W Q95aVwGrIut3/SWsYpVAMsChkKU00lZljLJ144kGRkTYmp9wIB8Y3zeR0ejr1U249RXY/X DyyHUfhWygGP+qevZffJ39xk1aO2JOKSHU/UicJ40REGprDJPWq0k/t6FLrnxeKGyAWihG wJM7ss6/1gMUY8HKNZcquOgShcshCtrmwdXR0bggDDngO3P7dNlsGqTfs2FflQ== 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 4VVG992xDPzhmK; Thu, 2 May 2024 01:11: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 4421BP1I040028; Thu, 2 May 2024 01:11:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4421BPP3040025; Thu, 2 May 2024 01:11:25 GMT (envelope-from git) Date: Thu, 2 May 2024 01:11:25 GMT Message-Id: <202405020111.4421BPP3040025@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: f6b902a4117a - stable/14 - krpc: Ref cnt the client structures for TLS upcalls List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f6b902a4117a9893179be4e46c50358d32321301 Auto-Submitted: auto-generated The branch stable/14 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=f6b902a4117a9893179be4e46c50358d32321301 commit f6b902a4117a9893179be4e46c50358d32321301 Author: Rick Macklem AuthorDate: 2024-04-27 00:55:24 +0000 Commit: Rick Macklem CommitDate: 2024-05-02 01:09:52 +0000 krpc: Ref cnt the client structures for TLS upcalls A crash occurred during testing, where the client structures had already been free'd when the upcall thread tried to lock them. This patch acquires a reference count on both of the structures and these are released when the upcall is done, so that the structures cannot be free'd prematurely. This happened because the testing is done over a very slow vpn. Found during a IETF bakeathon testing event this week. (cherry picked from commit 4ba444de708bada46a88ecac17b2f6c1dc912234) --- sys/rpc/clnt_vc.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sys/rpc/clnt_vc.c b/sys/rpc/clnt_vc.c index b4ddaec3cbdc..cc2471f95e8c 100644 --- a/sys/rpc/clnt_vc.c +++ b/sys/rpc/clnt_vc.c @@ -759,6 +759,7 @@ clnt_vc_control(CLIENT *cl, u_int request, void *info) case CLSET_BACKCHANNEL: xprt = (SVCXPRT *)info; if (ct->ct_backchannelxprt == NULL) { + SVC_ACQUIRE(xprt); xprt->xp_p2 = ct; if (ct->ct_sslrefno != 0) xprt->xp_tls = RPCTLS_FLAGS_HANDSHAKE; @@ -772,9 +773,11 @@ clnt_vc_control(CLIENT *cl, u_int request, void *info) ct->ct_sslusec = *p++; ct->ct_sslrefno = *p; if (ct->ct_sslrefno != RPCTLS_REFNO_HANDSHAKE) { + /* cl ref cnt is released by clnt_vc_dotlsupcall(). */ + CLNT_ACQUIRE(cl); mtx_unlock(&ct->ct_lock); /* Start the kthread that handles upcalls. */ - error = kthread_add(clnt_vc_dotlsupcall, ct, + error = kthread_add(clnt_vc_dotlsupcall, cl, NULL, NULL, 0, 0, "krpctls%u", thrdnum++); if (error != 0) panic("Can't add KRPC thread error %d", error); @@ -874,6 +877,7 @@ clnt_vc_destroy(CLIENT *cl) mtx_lock(&ct->ct_lock); xprt->xp_p2 = NULL; sx_xunlock(&xprt->xp_lock); + SVC_RELEASE(xprt); } if (ct->ct_socket) { @@ -1274,7 +1278,8 @@ clnt_vc_upcallsdone(struct ct_data *ct) static void clnt_vc_dotlsupcall(void *data) { - struct ct_data *ct = (struct ct_data *)data; + CLIENT *cl = (CLIENT *)data; + struct ct_data *ct = (struct ct_data *)cl->cl_private; enum clnt_stat ret; uint32_t reterr; @@ -1311,5 +1316,6 @@ clnt_vc_dotlsupcall(void *data) ct->ct_rcvstate &= ~RPCRCVSTATE_UPCALLTHREAD; wakeup(&ct->ct_sslrefno); mtx_unlock(&ct->ct_lock); + CLNT_RELEASE(cl); kthread_exit(); } From nobody Thu May 2 01:20:56 2024 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 4VVGN84sqMz5KPDn; Thu, 2 May 2024 01:20: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 4VVGN82NTnz3wsW; Thu, 2 May 2024 01:20:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714612856; 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=1ELtroNkqrLE0DlAkJeL8k/MopWq6m7djf/eNJBrrBs=; b=OwD7jogqzDglK0Idev6Q/gFXuYmtDxJgILoH68etg6d6Y473T94tG1JwPCsQtTftfmmWnm 4cgtB7NZbeR2v4XOsmpahcGJu4TwGCevVCJams8QHRdoPnVAtULE+EPE4MisiX5mvsWjue vxrEJ2hExHFQZuRoMkybM7S+UAGxW8AOsPCVRyuhQD9Xdc/bZLuunqNByAzGmgKTbF8YdW 5CbVBmViYJ8cCLewFSnTGcVPQSweBMhYTFIrdXNt+GKtNxWWbd4Ojs//lZubF4yPO7sC21 yikVhbGwdJhZcGJt1l/uVLSfHOAk2TJE7UOeDnyU/X7c4Oe+tXFjV+nmebIHOQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714612856; a=rsa-sha256; cv=none; b=WISDVfhHeqvhQbn3XlTpv34hLVBnsYJ73r26DQ6kmazkTTeHdcZqkCtYI+qYnRPZztMkSk rF83mhgKq/8wT6OftVggCGcBoMyJdFG0fmwXCZcsQUagGWoc7cOQ4nVb6Hk0CMQ+2zFi4O he7CRZyxyP5KYvWFD6Y2QFChGrWDgkwR6ChFR2NMFPa2nbCVHLxRYIdFCkYIekI5zN4r8n bBhbbCCbGxUWrG6pNZrpLJVpWIrAyezy9N9QsH3i7hba+9sOB9oV674uzQ0pnt8PEmA2ek NrR9Y6muY/rZCD4efJ0g2YwIteUgYYY14zGaMsXHjtYG9OVt/pgCV9gEpmuo2g== 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=1714612856; 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=1ELtroNkqrLE0DlAkJeL8k/MopWq6m7djf/eNJBrrBs=; b=J14617mlCmvBv+6fF0vJmYmkDSaVScedCumyjDGmpZX1bPe0UjE8ay0sJN3q0cLHlOd0Ge weBNoVDsbdLKb/czhhtspcz8wJy532I7bYKm6nnXUC3PHOXJ0BY/xSq6sb9oJpW3RKb8JA nHTPZYolj0UJcNsZCTMBYImH8QmdQrrdZv+dWBqHyJNxpTEuacI3w2qpl0MwNymwLTiYB9 xI4FdgX0OemBuEsT4NXkbaMaOfC3DAvsK/Fx6NMD/ZWfIG8vEd5DUXDsL+isVa2c1t8Hje niBZT0Dz1wm5qfv/4dDG7H/3FWuv5PAf+nmgiT/gQP1KO1d6th94KYoP6hBzUQ== 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 4VVGN820ySzjJS; Thu, 2 May 2024 01:20:56 +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 4421Kuae053432; Thu, 2 May 2024 01:20:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4421KuNn053430; Thu, 2 May 2024 01:20:56 GMT (envelope-from git) Date: Thu, 2 May 2024 01:20:56 GMT Message-Id: <202405020120.4421KuNn053430@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: f8575d4e4758 - stable/13 - krpc: Ref cnt the client structures for TLS upcalls List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f8575d4e47587dc0153360debd3a6ec5665a57b5 Auto-Submitted: auto-generated The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=f8575d4e47587dc0153360debd3a6ec5665a57b5 commit f8575d4e47587dc0153360debd3a6ec5665a57b5 Author: Rick Macklem AuthorDate: 2024-04-27 00:55:24 +0000 Commit: Rick Macklem CommitDate: 2024-05-02 01:19:09 +0000 krpc: Ref cnt the client structures for TLS upcalls A crash occurred during testing, where the client structures had already been free'd when the upcall thread tried to lock them. This patch acquires a reference count on both of the structures and these are released when the upcall is done, so that the structures cannot be free'd prematurely. This happened because the testing is done over a very slow vpn. Found during a IETF bakeathon testing event this week. (cherry picked from commit 4ba444de708bada46a88ecac17b2f6c1dc912234) --- sys/rpc/clnt_vc.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sys/rpc/clnt_vc.c b/sys/rpc/clnt_vc.c index 2edd7421f5c8..a8670553546e 100644 --- a/sys/rpc/clnt_vc.c +++ b/sys/rpc/clnt_vc.c @@ -759,6 +759,7 @@ clnt_vc_control(CLIENT *cl, u_int request, void *info) case CLSET_BACKCHANNEL: xprt = (SVCXPRT *)info; if (ct->ct_backchannelxprt == NULL) { + SVC_ACQUIRE(xprt); xprt->xp_p2 = ct; if (ct->ct_sslrefno != 0) xprt->xp_tls = RPCTLS_FLAGS_HANDSHAKE; @@ -772,9 +773,11 @@ clnt_vc_control(CLIENT *cl, u_int request, void *info) ct->ct_sslusec = *p++; ct->ct_sslrefno = *p; if (ct->ct_sslrefno != RPCTLS_REFNO_HANDSHAKE) { + /* cl ref cnt is released by clnt_vc_dotlsupcall(). */ + CLNT_ACQUIRE(cl); mtx_unlock(&ct->ct_lock); /* Start the kthread that handles upcalls. */ - error = kthread_add(clnt_vc_dotlsupcall, ct, + error = kthread_add(clnt_vc_dotlsupcall, cl, NULL, NULL, 0, 0, "krpctls%u", thrdnum++); if (error != 0) panic("Can't add KRPC thread error %d", error); @@ -874,6 +877,7 @@ clnt_vc_destroy(CLIENT *cl) mtx_lock(&ct->ct_lock); xprt->xp_p2 = NULL; sx_xunlock(&xprt->xp_lock); + SVC_RELEASE(xprt); } if (ct->ct_socket) { @@ -1275,7 +1279,8 @@ clnt_vc_upcallsdone(struct ct_data *ct) static void clnt_vc_dotlsupcall(void *data) { - struct ct_data *ct = (struct ct_data *)data; + CLIENT *cl = (CLIENT *)data; + struct ct_data *ct = (struct ct_data *)cl->cl_private; enum clnt_stat ret; uint32_t reterr; @@ -1312,5 +1317,6 @@ clnt_vc_dotlsupcall(void *data) ct->ct_rcvstate &= ~RPCRCVSTATE_UPCALLTHREAD; wakeup(&ct->ct_sslrefno); mtx_unlock(&ct->ct_lock); + CLNT_RELEASE(cl); kthread_exit(); } From nobody Thu May 2 07:49:49 2024 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 4VVR0s1wZLz5JW0S; Thu, 2 May 2024 07:49: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 4VVR0s1KDJz4VHD; Thu, 2 May 2024 07:49:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714636189; 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=rUiBfCfy9DpDQ52Ewvo4OSC/r4Qpo1UVR2ZXgjLstw0=; b=jvLanx3MtlTwm9yshaqc5AJoCdkIpPT00iLGCfP1eJg45BRTN3fg2WhHyI9EJPVjmBAmpD FdMRW1gdv+UvGP5pbK4O5mpYNuXXhNZqJYAE3CGjmTv2SDxCSaSLzwiNkNyITSq1KiQa60 5QJl8hJi9T3kJ8qkDBfJkeZh9VjWQiNNwRImBeE6BjlK1dgRbE/HikRfphpYL5OI3LcHnj /JnQ2Gyv2N7uAb9aC9ecnqF6dxZjoslmIY22kr0/Kzmnhzl/2/n2CtNKv/saqb1cLLHXhU KWJcDWJ+VeVTl/DbVLKyuKMNRBNoM8fI5zbvbJwYeXQA0eJ/IguyH2iGrlW3nA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714636189; a=rsa-sha256; cv=none; b=W0t28as0iHet4rntZTsRNIcHgCG4hXHxAnMlSiJenhx/sDUYEdQUoyeqzQon0P8lBmb05L XbnNnkyKJ4p0ZicsF6ZtX1jXMLz/RaBe/0KPr5ZPXEz1ghOfAYpmsCj2uEkl1wE0O+gCZX f+WgcyWjekfNPlVUiVZpiLPiivIbHEnpjKP3x7/0QJ11lYjw6hFKVL/QJA0SWF4VUnRJiG L3XBJ2o7SsyaQ9NgnHWkLZ1Jma7uBbwW1ysQ7jqaL9fh5NLt/wJDyAVQnoMT8dF6O+SJIA ByAQKYtiNF8jby6YBBlbRy+cqBGUujnTgTXvpMYL3sQYOemGHhKNVZAy8KSmtg== 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=1714636189; 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=rUiBfCfy9DpDQ52Ewvo4OSC/r4Qpo1UVR2ZXgjLstw0=; b=CdQ3hE1TY0vpH/peLo1xu+A/63WmAU2OYHWKuGrFZENpejYIMjvxvL+vBF7+n7w649nrQF 8XVJkfYNHBsqlbG80ZyaaDga2dH48JDf3ov0B1CvzguLGFsx5cpNuFUFr3hJwpNfh7z4QD qqkj8MMcJwanV4dW/rl1pakOHPQU3rIk+mELB1BWnOFuFyht+oqHR9OshhS8NwLWnECKxu 4dinMaa4NmcoGoJi0FgcCq80eYc3/bXJNTq28ZU8q6sUVOy5QXTplSTzJ8S1nnDBLBaddi ogC49Ia/dBfuVA/coPwmt+wOKAfojUryQiK7onpPpI35hMiA3+rkkluwAsDpaA== 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 4VVR0s0wSGzv5N; Thu, 2 May 2024 07:49: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 4427nn3x003972; Thu, 2 May 2024 07:49:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4427nng3003969; Thu, 2 May 2024 07:49:49 GMT (envelope-from git) Date: Thu, 2 May 2024 07:49:49 GMT Message-Id: <202405020749.4427nng3003969@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: 93b11fe0a16a - stable/14 - nuageinit: start the script after zfs List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 93b11fe0a16ab9cfa4a879ba2ac4be5237f33f6b Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=93b11fe0a16ab9cfa4a879ba2ac4be5237f33f6b commit 93b11fe0a16ab9cfa4a879ba2ac4be5237f33f6b Author: Baptiste Daroussin AuthorDate: 2024-04-17 14:25:02 +0000 Commit: Baptiste Daroussin CommitDate: 2024-05-02 07:49:41 +0000 nuageinit: start the script after zfs It prevents the home directory for the new users to be hidden by late mount of the home directory (cherry picked from commit b6a4776008519bb4a1d5abfe63c46d5f009ce102) --- libexec/rc/rc.d/nuageinit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libexec/rc/rc.d/nuageinit b/libexec/rc/rc.d/nuageinit index 977b44e465fe..8da0b1aed741 100755 --- a/libexec/rc/rc.d/nuageinit +++ b/libexec/rc/rc.d/nuageinit @@ -2,7 +2,7 @@ # # PROVIDE: nuageinit -# REQUIRE: mountcritlocal +# REQUIRE: mountcritlocal zfs # BEFORE: NETWORKING # KEYWORD: firstboot From nobody Thu May 2 08:09:28 2024 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 4VVRRX5FkVz5JXr0; Thu, 2 May 2024 08:09: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 4VVRRX4PRnz4XZD; Thu, 2 May 2024 08:09:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714637368; 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=pOV07aBNn6t8Awy8JNNPyuO71cJ8v/bLt/EjS/Wk41k=; b=C6YYlrZhAESh28y20q+Fe7n3ONBVEaClpAePeidA3fMfgat896872SUZW0PZNdbTPPUFWg urJpjJ2zzmTOGIGv6jjzCDKEKnOMnZLS+zsfDCEDkzYv3P1dzBQX7E6V0KMIxi5FowQg9C 0Zd224oCV0w8lWK33+8JPRq8q4XQpyYuepQNAsSXA2SAp3y9550SPm4iZ/A6Cq9EGPhBaT 1ufdhi9RVrf8AIp/bqjlXIGaqoXH4rTV+9WBA5jO/XaFTHtiV5rXbh2sVrYpZ+UyA3bPKQ kGMQr+vT9R5rZkGbwSb2jp5vo+lmP9Ibmh1UT7SJxH+KQyyQUH1X5lQoKIYguA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714637368; a=rsa-sha256; cv=none; b=IT7n6NSAECfUSYroT2ewXq6RirvvPOLQRP7v8SuXb7PuxGGRrJ1B6cMiaUqE7u9Rr65iIj TaURR7ujtK228uh1WfXvxtKOjO/IMeFCzXlUC60Gz+GMnu/WdDMx3KKuEV6QxI7Fj+B5Hb 7NJpMBd4rmEdZnkoy8IFjpErN6uu55CUv14S1sYcI+1Rze6Oice2naNmT6Ge7Zzof6x9Oq KT71wvvA1YLdU/LmyIZQTfGA+XWWIRvOUkBaOgq+T7WQGgObrY6Q6oQzVYtyAFqdAjXnrD VZrmMwWeRBbyx4MjfsKaP6unBN6ZkJKQIGtJ+nGCophAxY859LFT4SpSbhBjag== 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=1714637368; 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=pOV07aBNn6t8Awy8JNNPyuO71cJ8v/bLt/EjS/Wk41k=; b=ixm9ReGUBbjVy6weH9Y7zWsszhMlHLHg/V8X6BPGhDHagYgPkTOFAwMAnMHJcGwTVEMIxI AXSSTpMfXYr6RCXLmC/11dyWNrUzja0K4Tx54HW/aXXWjj6Y35v5V+v2gAyKsXe/f/PrVV XBDShbMOwFf4kZHF97xOoCoaMCt3CsYhcqrwzujbbak1ze6bXBDHcZcVIk9LTgZJgi4/US ZFuRjIfpNQ69n5g61gr1f96eoXQY6q6LdfOnZvh8Eq1QcQpeRUf9pYbt6lQDbVEhW9eFM0 /ebNKriUWlhTSjqpv0itCJ+OiNtktNCOc3dbLTZznPgtbCZUgzPobaLlBw/ItQ== 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 4VVRRX41P0zv94; Thu, 2 May 2024 08:09: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 44289SC7039012; Thu, 2 May 2024 08:09:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44289SnN039009; Thu, 2 May 2024 08:09:28 GMT (envelope-from git) Date: Thu, 2 May 2024 08:09:28 GMT Message-Id: <202405020809.44289SnN039009@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: c3a3b231da00 - stable/14 - arm64: Check DMAP address is valid in PHYS_IN_DMAP List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c3a3b231da00e93fcd7baced74fa933b112de473 Auto-Submitted: auto-generated The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=c3a3b231da00e93fcd7baced74fa933b112de473 commit c3a3b231da00e93fcd7baced74fa933b112de473 Author: Andrew Turner AuthorDate: 2024-04-08 10:44:33 +0000 Commit: Andrew Turner CommitDate: 2024-05-02 07:59:31 +0000 arm64: Check DMAP address is valid in PHYS_IN_DMAP When checking if a physical address is in the DMAP region we assume all physical addresses between DMAP_MIN_PHYSADDR and DMAP_MAX_PHYSADDR are able to be accesses through the DMAP. It may be the case that there is device memory in this range that shouldn't be accessed through the DMAP mappings. Add a check to PHYS_IN_DMAP that the translated virtual address is a valid kernel address. To support code that already checks the address is valid add PHYS_IN_DMAP_RANGE. PR: 278233 Reviewed by: alc, markj Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D44677 (cherry picked from commit 9d40492efa467095340cf3dca5860880aa441472) --- sys/arm64/arm64/efirt_machdep.c | 9 ++------- sys/arm64/arm64/machdep.c | 2 +- sys/arm64/arm64/minidump_machdep.c | 7 ++++--- sys/arm64/include/vmparam.h | 18 +++++++++++++++--- 4 files changed, 22 insertions(+), 14 deletions(-) diff --git a/sys/arm64/arm64/efirt_machdep.c b/sys/arm64/arm64/efirt_machdep.c index c51987625356..b1fd60037134 100644 --- a/sys/arm64/arm64/efirt_machdep.c +++ b/sys/arm64/arm64/efirt_machdep.c @@ -145,13 +145,8 @@ efi_1t1_l3(vm_offset_t va) vm_offset_t efi_phys_to_kva(vm_paddr_t paddr) { - vm_offset_t vaddr; - - if (PHYS_IN_DMAP(paddr)) { - vaddr = PHYS_TO_DMAP(paddr); - if (pmap_klookup(vaddr, NULL)) - return (vaddr); - } + if (PHYS_IN_DMAP(paddr)) + return (PHYS_TO_DMAP(paddr)); /* TODO: Map memory not in the DMAP */ diff --git a/sys/arm64/arm64/machdep.c b/sys/arm64/arm64/machdep.c index 01896c15e650..ea2b7e9da2ee 100644 --- a/sys/arm64/arm64/machdep.c +++ b/sys/arm64/arm64/machdep.c @@ -427,7 +427,7 @@ arm64_get_writable_addr(vm_offset_t addr, vm_offset_t *out) /* * If it is within the DMAP region and is writable use that. */ - if (PHYS_IN_DMAP(pa)) { + if (PHYS_IN_DMAP_RANGE(pa)) { addr = PHYS_TO_DMAP(pa); if (PAR_SUCCESS(arm64_address_translate_s1e1w(addr))) { *out = addr; diff --git a/sys/arm64/arm64/minidump_machdep.c b/sys/arm64/arm64/minidump_machdep.c index 87bf41b27fdf..8ee626953aef 100644 --- a/sys/arm64/arm64/minidump_machdep.c +++ b/sys/arm64/arm64/minidump_machdep.c @@ -202,7 +202,8 @@ cpu_minidumpsys(struct dumperinfo *di, const struct minidumpstate *state) if ((l3e & ATTR_DESCR_MASK) != L3_PAGE) continue; pa = PTE_TO_PHYS(l3e); - if (PHYS_IN_DMAP(pa) && vm_phys_is_dumpable(pa)) + if (PHYS_IN_DMAP_RANGE(pa) && + vm_phys_is_dumpable(pa)) vm_page_dump_add(state->dump_bitset, pa); } @@ -216,7 +217,7 @@ cpu_minidumpsys(struct dumperinfo *di, const struct minidumpstate *state) dumpsize += round_page(sizeof(dump_avail)); dumpsize += round_page(BITSET_SIZE(vm_page_dump_pages)); VM_PAGE_DUMP_FOREACH(state->dump_bitset, pa) { - if (PHYS_IN_DMAP(pa) && vm_phys_is_dumpable(pa)) + if (PHYS_IN_DMAP_RANGE(pa) && vm_phys_is_dumpable(pa)) dumpsize += PAGE_SIZE; else vm_page_dump_drop(state->dump_bitset, pa); @@ -347,7 +348,7 @@ cpu_minidumpsys(struct dumperinfo *di, const struct minidumpstate *state) * We always write a page, even if it is zero. If pa * is malformed, write the zeroed tmpbuffer. */ - if (PHYS_IN_DMAP(pa) && vm_phys_is_dumpable(pa)) + if (PHYS_IN_DMAP_RANGE(pa) && vm_phys_is_dumpable(pa)) error = blk_write(di, NULL, pa, PAGE_SIZE); else error = blk_write(di, (char *)&tmpbuffer, 0, diff --git a/sys/arm64/include/vmparam.h b/sys/arm64/include/vmparam.h index 0176045f0cae..fee8e01f72c4 100644 --- a/sys/arm64/include/vmparam.h +++ b/sys/arm64/include/vmparam.h @@ -195,9 +195,21 @@ #define DMAP_MIN_PHYSADDR (dmap_phys_base) #define DMAP_MAX_PHYSADDR (dmap_phys_max) -/* True if pa is in the dmap range */ -#define PHYS_IN_DMAP(pa) ((pa) >= DMAP_MIN_PHYSADDR && \ +/* + * Checks to see if a physical address is in the DMAP range. + * - PHYS_IN_DMAP_RANGE will return true that may be within the DMAP range + * but not accessible through the DMAP, e.g. device memory between two + * DMAP physical address regions. + * - PHYS_IN_DMAP will check if DMAP address is mapped before returning true. + * + * PHYS_IN_DMAP_RANGE should only be used when a check on the address is + * performed, e.g. by checking the physical address is within phys_avail, + * or checking the virtual address is mapped. + */ +#define PHYS_IN_DMAP_RANGE(pa) ((pa) >= DMAP_MIN_PHYSADDR && \ (pa) < DMAP_MAX_PHYSADDR) +#define PHYS_IN_DMAP(pa) (PHYS_IN_DMAP_RANGE(pa) && \ + pmap_klookup(PHYS_TO_DMAP(pa), NULL)) /* True if va is in the dmap range */ #define VIRT_IN_DMAP(va) ((va) >= DMAP_MIN_ADDRESS && \ (va) < (dmap_max_addr)) @@ -205,7 +217,7 @@ #define PMAP_HAS_DMAP 1 #define PHYS_TO_DMAP(pa) \ ({ \ - KASSERT(PHYS_IN_DMAP(pa), \ + KASSERT(PHYS_IN_DMAP_RANGE(pa), \ ("%s: PA out of range, PA: 0x%lx", __func__, \ (vm_paddr_t)(pa))); \ ((pa) - dmap_phys_base) + DMAP_MIN_ADDRESS; \ From nobody Thu May 2 09:06:25 2024 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 4VVSjF3T7Vz5JdlB; Thu, 2 May 2024 09: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 4VVSjF30jRz4jNk; Thu, 2 May 2024 09: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=1714640785; 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=J96f2IwyJSQZk+93cj8GSon0k9CY16ihrVh12EFK+aA=; b=rWmprnKRuyAlUWIbeuxH9WPKDWhGLa/qy3qFwRgAh+ngVeocv5V5l81KMB/l7hwFMM1ou8 39bf3WZYAphwtVAtHXR3E9UJECzKfai/+tUoka6BJExflBMtGGy8YVDUJ8O+SZO4qjLja8 R+FcsJNt+7PjoyK+y0vE4f8+33csex/1bjJw8SC9HLJqJKt0cS3GMnskO9kyhiyztCV6+k WHfb7ua4BtcwnXlvOj3/Seoca5VPetR8p1eF1YKHqSnrkpcJR3RF3QfM1OwlU0nQCOhaDw ESaLwHWt+jTQ+A47KEzLkZ7h2HEc3lM6KGzDMazX0B/EPaLZuxgKclqDygPcTg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714640785; a=rsa-sha256; cv=none; b=f540jc1tY94IutSGvVCl2fw+twR2zkRceS4x/Et3c2AfYXkKtG8p6JNZDi24iIlK0nvXdg kCUyrx7E9dYwj4TzPuY8xMMsMs+HTmYA+RNYitSj/A1owJuwZq5xsKUpkbNfz8R/RzZyn4 PctazXxGmSdSN+r6qXWpah6T56ZCxdQGlG5sjm9eKVraqNsAqELJmsyT5bxpon3OVbNxWC Isrix16rZ9r2xVbfyVZOZiSYm1tlquFw2xh6WWdie+j8kjtD/Fjo/DejOkXb6/XzQiqSYb QtvWuUZHzQv6G3AwD5fOoxohMHveqYTCHsogbEeebDVWBCCnN/i+Udsl5Ie+0w== 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=1714640785; 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=J96f2IwyJSQZk+93cj8GSon0k9CY16ihrVh12EFK+aA=; b=rqwuPxzcJqcIRwHB4Ctczsd2sivb9Mj5l8xIV4yWq/4K1uEYcGh5qXgIueSH4obe/+kWbR ZE3Ar9tPi3G/jzQScOIE2SpsAJ5yTz3B7z4a7E7GytYBAjB6nV8z7bHJCBAjaVGRuNZnfb Wnv4dIJGN6XGUsbkzs+m2ujJtynSASf8by79NxK1gbh8NCjmZVtJQyL+GmqTPlaG+a8VlA prxgII1OZ/8MzLX/xa3xAJ1vxvkDKvq7UO+QeabNo7hVwAbcl0wVNbtALDaEK3aBd2DnDS 3fT/PHaC/SfH9N72LSbuYEWmHeVKh5EP6F16HfyCiyMQDOCQvhtPdlVoIlqTVg== 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 4VVSjF2bmCzx1l; Thu, 2 May 2024 09: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 44296PnH039782; Thu, 2 May 2024 09: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 44296P2Z039779; Thu, 2 May 2024 09:06:25 GMT (envelope-from git) Date: Thu, 2 May 2024 09:06:25 GMT Message-Id: <202405020906.44296P2Z039779@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: 986cceda16d8 - stable/14 - tftpd: Use `size_t` where appropriate. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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: 986cceda16d8de091524314b50325d52fe403d75 Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=986cceda16d8de091524314b50325d52fe403d75 commit 986cceda16d8de091524314b50325d52fe403d75 Author: Dag-Erling Smørgrav AuthorDate: 2024-04-25 18:35:15 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-05-02 09:02:21 +0000 tftpd: Use `size_t` where appropriate. * Limit the use of `ssize_t` to only where it's needed. * Correct one case of `int` being used for a length. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D44954 (cherry picked from commit 1ed44fcc44b2c04db330663589541608135402f4) tftpd: Clean up the tests. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D44955 (cherry picked from commit 7ab7ecfcfe777f7816e3e01df5f277060b2b609a) tftpd: Check the server status after each test. * In the setup phase, wait for the server to start (or fail to start) before proceeding with the test. This makes it possible to write test cases that don't expect a response from the server without ending up in a race over the server PID file. * After running each test, wait up to 30 seconds for the server to exit and check that the exit status matches what the test case says to expect (usually 0). * We still kill and collect the server in the cleanup phase, in case the test ended early. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D44956 (cherry picked from commit 83a6e984ac01657819418746f722163367ec30db) tftpd: Immediately reject any request shorter than 4 bytes. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D44957 (cherry picked from commit 9f231af307b80eb222d9761bbd81fa4e130bb3d7) tftpd: Untangle a conditional. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D45026 (cherry picked from commit 21b5829d28b1e02e9f30bfa439238c382dd19114) --- libexec/tftpd/tests/functional.c | 352 +++++++++++++++++++++++---------------- libexec/tftpd/tftp-utils.c | 4 +- libexec/tftpd/tftp-utils.h | 2 +- libexec/tftpd/tftpd.c | 30 ++-- 4 files changed, 233 insertions(+), 155 deletions(-) diff --git a/libexec/tftpd/tests/functional.c b/libexec/tftpd/tests/functional.c index 1d5c1e17c420..f31d2a893da1 100644 --- a/libexec/tftpd/tests/functional.c +++ b/libexec/tftpd/tests/functional.c @@ -52,8 +52,8 @@ static bool s_flag = false; /* Pass -s to tftpd */ static bool w_flag = false; /* Pass -w to tftpd */ /* Helper functions*/ -static void require_bufeq(const char *expected, ssize_t expected_len, - const char *actual, ssize_t len); +static void require_bufeq(const char *expected, size_t expected_len, + const char *actual, size_t len); /* * Receive a response from tftpd @@ -61,24 +61,24 @@ static void require_bufeq(const char *expected, ssize_t expected_len, * @param contents The reply's expected contents, as a char array * @param contents_len Length of contents */ -#define RECV(hdr, contents, contents_len) do { \ - char buffer[1024]; \ - struct sockaddr_storage from; \ - socklen_t fromlen = sizeof(from); \ - ssize_t r = recvfrom(s, buffer, sizeof(buffer), 0, \ - (struct sockaddr*)&from, &fromlen); \ - ATF_REQUIRE(r > 0); \ - require_bufeq((hdr), sizeof(hdr), buffer, \ - MIN(r, (ssize_t)sizeof(hdr))); \ - require_bufeq((const char*) (contents), (contents_len), \ - &buffer[sizeof(hdr)], r - sizeof(hdr)); \ - if (protocol == PF_INET) { \ - ((struct sockaddr_in*)&addr)->sin_port = \ - ((struct sockaddr_in*)&from)->sin_port; \ - } else { \ - ((struct sockaddr_in6*)&addr)->sin6_port = \ - ((struct sockaddr_in6*)&from)->sin6_port; \ - } \ +#define RECV(hdr, contents, contents_len) do { \ + char buffer[1024]; \ + struct sockaddr_storage from; \ + socklen_t fromlen = sizeof(from); \ + ssize_t r = recvfrom(s, buffer, sizeof(buffer), 0, \ + (struct sockaddr *)&from, &fromlen); \ + ATF_REQUIRE(r > 0); \ + require_bufeq((hdr), sizeof(hdr), buffer, \ + MIN((size_t)r, sizeof(hdr))); \ + require_bufeq((const char *) (contents), (contents_len), \ + &buffer[sizeof(hdr)], r - sizeof(hdr)); \ + if (protocol == PF_INET) { \ + ((struct sockaddr_in *)&addr)->sin_port = \ + ((struct sockaddr_in *)&from)->sin_port; \ + } else { \ + ((struct sockaddr_in6 *)&addr)->sin6_port = \ + ((struct sockaddr_in6 *)&from)->sin6_port; \ + } \ } while(0) static void @@ -102,15 +102,15 @@ recv_oack(const char *options, size_t options_len) * @param contents_len Length of contents expected to receive */ static void -recv_data(uint16_t blocknum, const char* contents, size_t contents_len) +recv_data(uint16_t blocknum, const char *contents, size_t contents_len) { char hdr[] = {0, 3, blocknum >> 8, blocknum & 0xFF}; RECV(hdr, contents, contents_len); } -#define RECV_ERROR(code, msg) do { \ - char hdr[] = {0, 5, code >> 8, code & 0xFF}; \ - RECV(hdr, msg, sizeof(msg)); \ +#define RECV_ERROR(code, msg) do { \ + char hdr[] = {0, 5, code >> 8, code & 0xFF}; \ + RECV(hdr, msg, sizeof(msg)); \ } while (0) /* @@ -118,16 +118,17 @@ recv_data(uint16_t blocknum, const char* contents, size_t contents_len) * @param cmd Command to send, as a char array */ static void -send_bytes(const void* cmd, ssize_t len) +send_bytes(const void *cmd, size_t len) { ssize_t r; - r = sendto(s, cmd, len, 0, (struct sockaddr*)(&addr), addr.ss_len); - ATF_REQUIRE_EQ(r, len); + r = sendto(s, cmd, len, 0, (struct sockaddr *)(&addr), addr.ss_len); + ATF_REQUIRE(r >= 0); + ATF_REQUIRE_EQ(len, (size_t)r); } static void -send_data(uint16_t blocknum, const char* contents, size_t contents_len) +send_data(uint16_t blocknum, const char *contents, size_t contents_len) { char buffer[1024]; @@ -144,10 +145,10 @@ send_data(uint16_t blocknum, const char* contents, size_t contents_len) * @param cmd Command to send, as a const string * (terminating NUL will be ignored) */ -#define SEND_STR(cmd) ATF_REQUIRE_EQ( \ - sendto(s, (cmd), sizeof(cmd) - 1, 0, (struct sockaddr*)(&addr), \ - addr.ss_len), \ - sizeof(cmd) - 1) +#define SEND_STR(cmd) \ + ATF_REQUIRE_EQ(sizeof(cmd) - 1, \ + sendto(s, (cmd), sizeof(cmd) - 1, 0, \ + (struct sockaddr *)(&addr), addr.ss_len)) /* * Acknowledge block blocknum @@ -156,13 +157,12 @@ static void send_ack(uint16_t blocknum) { char packet[] = { - 0, 4, /* ACK opcode in BE */ - blocknum >> 8, - blocknum & 0xFF + 0, 4, /* ACK opcode in BE */ + blocknum >> 8, + blocknum & 0xFF }; send_bytes(packet, sizeof(packet)); - } /* @@ -175,73 +175,109 @@ send_ack(uint16_t blocknum) * @param filename filename as a string, absolute or relative * @param mode either "octet" or "netascii" */ -#define SEND_RRQ(filename, mode) SEND_STR("\0\001" filename "\0" mode "\0") +#define SEND_RRQ(filename, mode) \ + SEND_STR("\0\001" filename "\0" mode "\0") /* * send a read request with options */ -#define SEND_RRQ_OPT(filename, mode, options) SEND_STR("\0\001" filename "\0" mode "\000" options) +#define SEND_RRQ_OPT(filename, mode, options) \ + SEND_STR("\0\001" filename "\0" mode "\000" options) /* * send a write request to tftpd. * @param filename filename as a string, absolute or relative * @param mode either "octet" or "netascii" */ -#define SEND_WRQ(filename, mode) SEND_STR("\0\002" filename "\0" mode "\0") +#define SEND_WRQ(filename, mode) \ + SEND_STR("\0\002" filename "\0" mode "\0") /* * send a write request with options */ -#define SEND_WRQ_OPT(filename, mode, options) SEND_STR("\0\002" filename "\0" mode "\000" options) +#define SEND_WRQ_OPT(filename, mode, options) \ + SEND_STR("\0\002" filename "\0" mode "\000" options) /* Define a test case, for both IPv4 and IPv6 */ -#define TFTPD_TC_DEFINE(name, head, ...) \ -static void \ -name ## _body(void); \ -ATF_TC_WITH_CLEANUP(name ## _v4); \ -ATF_TC_HEAD(name ## _v4, tc) \ -{ \ - head \ -} \ -ATF_TC_BODY(name ## _v4, tc) \ -{ \ - __VA_ARGS__; \ - protocol = AF_INET; \ - s = setup(&addr, __COUNTER__); \ - name ## _body(); \ - close(s); \ -} \ -ATF_TC_CLEANUP(name ## _v4, tc) \ -{ \ - cleanup(); \ -} \ -ATF_TC_WITH_CLEANUP(name ## _v6); \ -ATF_TC_HEAD(name ## _v6, tc) \ -{ \ - head \ -} \ -ATF_TC_BODY(name ## _v6, tc) \ -{ \ - __VA_ARGS__; \ - protocol = AF_INET6; \ - s = setup(&addr, __COUNTER__); \ - name ## _body(); \ - close(s); \ -} \ -ATF_TC_CLEANUP(name ## _v6, tc) \ -{ \ - cleanup(); \ -} \ -static void \ +#define TFTPD_TC_DEFINE(name, head, ...) \ +static void \ +name ## _body(void); \ +ATF_TC_WITH_CLEANUP(name ## _v4); \ +ATF_TC_HEAD(name ## _v4, tc) \ +{ \ + head \ +} \ +ATF_TC_BODY(name ## _v4, tc) \ +{ \ + int exitcode = 0; \ + __VA_ARGS__; \ + protocol = AF_INET; \ + s = setup(&addr, __COUNTER__); \ + name ## _body(); \ + close(s); \ + if (exitcode >= 0) \ + check_server(exitcode); \ +} \ +ATF_TC_CLEANUP(name ## _v4, tc) \ +{ \ + cleanup(); \ +} \ +ATF_TC_WITH_CLEANUP(name ## _v6); \ +ATF_TC_HEAD(name ## _v6, tc) \ +{ \ + head \ +} \ +ATF_TC_BODY(name ## _v6, tc) \ +{ \ + int exitcode = 0; \ + __VA_ARGS__; \ + protocol = AF_INET6; \ + s = setup(&addr, __COUNTER__); \ + name ## _body(); \ + close(s); \ + if (exitcode >= 0) \ + check_server(exitcode); \ +} \ +ATF_TC_CLEANUP(name ## _v6, tc) \ +{ \ + cleanup(); \ +} \ +static void \ name ## _body(void) /* Add the IPv4 and IPv6 versions of a test case */ -#define TFTPD_TC_ADD(tp, name ) \ -do { \ - ATF_TP_ADD_TC(tp, name ## _v4); \ - ATF_TP_ADD_TC(tp, name ## _v6); \ +#define TFTPD_TC_ADD(tp, name) do { \ + ATF_TP_ADD_TC(tp, name ## _v4); \ + ATF_TP_ADD_TC(tp, name ## _v6); \ } while (0) +static void +sigalrm(int signo __unused) +{ +} + +/* Check that server exits with specific exit code */ +static void +check_server(int exitcode) +{ + struct sigaction sa = { .sa_handler = sigalrm }; + struct itimerval it = { .it_value = { .tv_sec = 30 } }; + FILE *f; + pid_t pid; + int wstatus; + + f = fopen(pidfile, "r"); + ATF_REQUIRE(f != NULL); + ATF_REQUIRE_INTEQ(1, fscanf(f, "%d", &pid)); + ATF_CHECK_INTEQ(0, fclose(f)); + ATF_REQUIRE_INTEQ(0, sigaction(SIGALRM, &sa, NULL)); + ATF_REQUIRE_EQ(0, setitimer(ITIMER_REAL, &it, NULL)); + ATF_REQUIRE_EQ(pid, waitpid(pid, &wstatus, 0)); + ATF_CHECK(WIFEXITED(wstatus)); + ATF_CHECK_INTEQ(exitcode, WEXITSTATUS(wstatus)); + unlink(pidfile); +} + /* Standard cleanup used by all testcases */ static void cleanup(void) @@ -252,26 +288,26 @@ cleanup(void) f = fopen(pidfile, "r"); if (f == NULL) return; + unlink(pidfile); if (fscanf(f, "%d", &pid) == 1) { kill(pid, SIGTERM); waitpid(pid, NULL, 0); } fclose(f); - unlink(pidfile); } /* Assert that two binary buffers are identical */ static void -require_bufeq(const char *expected, ssize_t expected_len, const char *actual, - ssize_t len) +require_bufeq(const char *expected, size_t expected_len, + const char *actual, size_t len) { - ssize_t i; + size_t i; ATF_REQUIRE_EQ_MSG(expected_len, len, - "Expected %zd bytes but got %zd", expected_len, len); + "Expected %zu bytes but got %zu", expected_len, len); for (i = 0; i < len; i++) { - ATF_REQUIRE_EQ_MSG(actual[i], expected[i], - "Expected %#hhx at position %zd; got %hhx instead", + ATF_REQUIRE_EQ_MSG(expected[i], actual[i], + "Expected %#hhx at position %zu; got %hhx instead", expected[i], i, actual[i]); } } @@ -297,6 +333,9 @@ setup(struct sockaddr_storage *to, uint16_t idx) struct pidfh *pfh; uint16_t port = BASEPORT + idx; socklen_t len; + int pd[2]; + + ATF_REQUIRE_EQ(0, pipe2(pd, O_CLOEXEC)); if (protocol == PF_INET) { len = sizeof(addr4); @@ -304,17 +343,17 @@ setup(struct sockaddr_storage *to, uint16_t idx) addr4.sin_len = len; addr4.sin_family = PF_INET; addr4.sin_port = htons(port); - server_addr = (struct sockaddr*)&addr4; + server_addr = (struct sockaddr *)&addr4; } else { len = sizeof(addr6); bzero(&addr6, len); addr6.sin6_len = len; addr6.sin6_family = PF_INET6; addr6.sin6_port = htons(port); - server_addr = (struct sockaddr*)&addr6; + server_addr = (struct sockaddr *)&addr6; } - ATF_REQUIRE_EQ(getcwd(pwd, sizeof(pwd)), pwd); + ATF_REQUIRE_EQ(pwd, getcwd(pwd, sizeof(pwd))); /* Must bind(2) pre-fork so it happens before the client's send(2) */ server_s = socket(protocol, SOCK_DGRAM, 0); @@ -324,7 +363,7 @@ setup(struct sockaddr_storage *to, uint16_t idx) } ATF_REQUIRE_MSG(server_s >= 0, "socket failed with error %s", strerror(errno)); - ATF_REQUIRE_EQ_MSG(bind(server_s, server_addr, len), 0, + ATF_REQUIRE_EQ_MSG(0, bind(server_s, server_addr, len), "bind failed with error %s", strerror(errno)); pid = fork(); @@ -337,8 +376,8 @@ setup(struct sockaddr_storage *to, uint16_t idx) pfh = pidfile_open(pidfile, 0644, NULL); ATF_REQUIRE_MSG(pfh != NULL, "pidfile_open: %s", strerror(errno)); - ATF_REQUIRE_EQ(pidfile_write(pfh), 0); - ATF_REQUIRE_EQ(pidfile_close(pfh), 0); + ATF_REQUIRE_EQ(0, pidfile_write(pfh)); + ATF_REQUIRE_EQ(0, pidfile_close(pfh)); bzero(argv, sizeof(argv)); argv[0] = execname; @@ -348,31 +387,35 @@ setup(struct sockaddr_storage *to, uint16_t idx) if (s_flag) argv[argv_idx++] = s_flag_str; argv[argv_idx++] = pwd; - ATF_REQUIRE_EQ(dup2(server_s, STDOUT_FILENO), STDOUT_FILENO); - ATF_REQUIRE_EQ(dup2(server_s, STDIN_FILENO), STDIN_FILENO); - ATF_REQUIRE_EQ(dup2(server_s, STDERR_FILENO), STDERR_FILENO); + ATF_REQUIRE_EQ(STDOUT_FILENO, dup2(server_s, STDOUT_FILENO)); + ATF_REQUIRE_EQ(STDIN_FILENO, dup2(server_s, STDIN_FILENO)); + ATF_REQUIRE_EQ(STDERR_FILENO, dup2(server_s, STDERR_FILENO)); execv(execname, argv); atf_tc_fail("exec failed"); break; default: /* In parent */ + ATF_REQUIRE_INTEQ(0, close(pd[1])); + /* block until other end is closed on exec() or exit() */ + ATF_REQUIRE_INTEQ(0, read(pd[0], &pd[1], sizeof(pd[1]))); + ATF_REQUIRE_INTEQ(0, close(pd[0])); bzero(to, sizeof(*to)); if (protocol == PF_INET) { - struct sockaddr_in *to4 = (struct sockaddr_in*)to; + struct sockaddr_in *to4 = (struct sockaddr_in *)to; to4->sin_len = sizeof(*to4); to4->sin_family = PF_INET; to4->sin_port = htons(port); to4->sin_addr.s_addr = htonl(INADDR_LOOPBACK); } else { struct in6_addr loopback = IN6ADDR_LOOPBACK_INIT; - struct sockaddr_in6 *to6 = (struct sockaddr_in6*)to; + struct sockaddr_in6 *to6 = (struct sockaddr_in6 *)to; to6->sin6_len = sizeof(*to6); to6->sin6_family = PF_INET6; to6->sin6_port = htons(port); to6->sin6_addr = loopback; } - close(server_s); + ATF_REQUIRE_INTEQ(0, close(server_s)); ATF_REQUIRE((client_s = socket(protocol, SOCK_DGRAM, 0)) > 0); break; } @@ -392,8 +435,8 @@ write_all(int fd, const void *buf, size_t nbytes) while (nbytes > 0) { r = write(fd, buf, nbytes); ATF_REQUIRE(r > 0); - nbytes -= r; - buf = (const char*)buf + r; + nbytes -= (size_t)r; + buf = (const char *)buf + (size_t)r; } } @@ -433,13 +476,13 @@ TFTPD_TC_DEFINE(abspath,) */ TFTPD_TC_DEFINE(dotdot,) { - ATF_REQUIRE_EQ(mkdir("subdir", 0777), 0); + ATF_REQUIRE_EQ(0, mkdir("subdir", 0777)); SEND_RRQ("../disallowed.txt", "octet"); RECV_ERROR(2, "Access violation"); - s = setup(&addr, __COUNTER__); \ + s = setup(&addr, __COUNTER__); SEND_RRQ("subdir/../../disallowed.txt", "octet"); RECV_ERROR(2, "Access violation"); - s = setup(&addr, __COUNTER__); \ + s = setup(&addr, __COUNTER__); SEND_RRQ("/etc/passwd", "octet"); RECV_ERROR(2, "Access violation"); } @@ -447,8 +490,9 @@ TFTPD_TC_DEFINE(dotdot,) /* * With "-s", tftpd should chroot to the specified directory */ -TFTPD_TC_DEFINE(s_flag, atf_tc_set_md_var(tc, "require.user", "root");, - s_flag = true) +TFTPD_TC_DEFINE(s_flag, + atf_tc_set_md_var(tc, "require.user", "root");, + s_flag = true) { int fd; char contents[] = "small"; @@ -505,7 +549,7 @@ TFTPD_TC_DEFINE(rrq_dropped_data,) close(fd); SEND_RRQ("medium.txt", "octet"); - recv_data(1, (const char*)&contents[0], 512); + recv_data(1, (const char *)&contents[0], 512); send_ack(1); (void) recvfrom(s, buffer, sizeof(buffer), 0, NULL, NULL); /* @@ -513,7 +557,7 @@ TFTPD_TC_DEFINE(rrq_dropped_data,) * Eventually, client should resend the last ACK */ send_ack(1); - recv_data(2, (const char*)&contents[128], 256); + recv_data(2, (const char *)&contents[128], 256); send_ack(2); } @@ -535,11 +579,11 @@ TFTPD_TC_DEFINE(rrq_duped_ack,) close(fd); SEND_RRQ("medium.txt", "octet"); - recv_data(1, (const char*)&contents[0], 512); + recv_data(1, (const char *)&contents[0], 512); send_ack(1); send_ack(1); /* Dupe an ACK packet */ - recv_data(2, (const char*)&contents[128], 256); - recv_data(2, (const char*)&contents[128], 256); + recv_data(2, (const char *)&contents[128], 256); + recv_data(2, (const char *)&contents[128], 256); send_ack(2); } @@ -593,9 +637,9 @@ TFTPD_TC_DEFINE(rrq_medium,) close(fd); SEND_RRQ("medium.txt", "octet"); - recv_data(1, (const char*)&contents[0], 512); + recv_data(1, (const char *)&contents[0], 512); send_ack(1); - recv_data(2, (const char*)&contents[128], 256); + recv_data(2, (const char *)&contents[128], 256); send_ack(2); } @@ -620,8 +664,8 @@ TFTPD_TC_DEFINE(rrq_medium_window,) SEND_RRQ_OPT("medium.txt", "octet", OPTION_STR("windowsize", "2")); recv_oack(options, sizeof(options) - 1); send_ack(0); - recv_data(1, (const char*)&contents[0], 512); - recv_data(2, (const char*)&contents[128], 256); + recv_data(1, (const char *)&contents[0], 512); + recv_data(2, (const char *)&contents[128], 256); send_ack(2); } @@ -764,13 +808,13 @@ TFTPD_TC_DEFINE(unknown_modes,) { SEND_RRQ("foo.txt", "ascii"); /* Misspelling of "ascii" */ RECV_ERROR(4, "Illegal TFTP operation"); - s = setup(&addr, __COUNTER__); \ + s = setup(&addr, __COUNTER__); SEND_RRQ("foo.txt", "binary"); /* Obsolete. Use "octet" instead */ RECV_ERROR(4, "Illegal TFTP operation"); - s = setup(&addr, __COUNTER__); \ + s = setup(&addr, __COUNTER__); SEND_RRQ("foo.txt", "en_US.UTF-8"); RECV_ERROR(4, "Illegal TFTP operation"); - s = setup(&addr, __COUNTER__); \ + s = setup(&addr, __COUNTER__); SEND_RRQ("foo.txt", "mail"); /* Obsolete in RFC-1350 */ RECV_ERROR(4, "Illegal TFTP operation"); } @@ -805,8 +849,9 @@ TFTPD_TC_DEFINE(w_flag,, w_flag = 1;) fd = open("small.txt", O_RDONLY); ATF_REQUIRE(fd >= 0); r = read(fd, buffer, sizeof(buffer)); + ATF_REQUIRE(r > 0); close(fd); - require_bufeq(contents, contents_len, buffer, r); + require_bufeq(contents, contents_len, buffer, (size_t)r); } /* @@ -829,21 +874,22 @@ TFTPD_TC_DEFINE(wrq_dropped_ack,) SEND_WRQ("medium.txt", "octet"); recv_ack(0); - send_data(1, (const char*)&contents[0], 512); + send_data(1, (const char *)&contents[0], 512); /* * Servers "sends" an ACK packet, but network drops it. * Eventually, server should resend the last ACK */ (void) recvfrom(s, buffer, sizeof(buffer), 0, NULL, NULL); recv_ack(1); - send_data(2, (const char*)&contents[128], 256); + send_data(2, (const char *)&contents[128], 256); recv_ack(2); fd = open("medium.txt", O_RDONLY); ATF_REQUIRE(fd >= 0); r = read(fd, buffer, sizeof(buffer)); + ATF_REQUIRE(r > 0); close(fd); - require_bufeq((const char*)contents, 768, buffer, r); + require_bufeq((const char *)contents, 768, buffer, (size_t)r); } /* @@ -875,8 +921,9 @@ TFTPD_TC_DEFINE(wrq_dropped_data,) fd = open("small.txt", O_RDONLY); ATF_REQUIRE(fd >= 0); r = read(fd, buffer, sizeof(buffer)); + ATF_REQUIRE(r > 0); close(fd); - require_bufeq(contents, contents_len, buffer, r); + require_bufeq(contents, contents_len, buffer, (size_t)r); } /* @@ -899,18 +946,19 @@ TFTPD_TC_DEFINE(wrq_duped_data,) SEND_WRQ("medium.txt", "octet"); recv_ack(0); - send_data(1, (const char*)&contents[0], 512); - send_data(1, (const char*)&contents[0], 512); + send_data(1, (const char *)&contents[0], 512); + send_data(1, (const char *)&contents[0], 512); recv_ack(1); recv_ack(1); - send_data(2, (const char*)&contents[128], 256); + send_data(2, (const char *)&contents[128], 256); recv_ack(2); fd = open("medium.txt", O_RDONLY); ATF_REQUIRE(fd >= 0); r = read(fd, buffer, sizeof(buffer)); + ATF_REQUIRE(r > 0); close(fd); - require_bufeq((const char*)contents, 768, buffer, r); + require_bufeq((const char *)contents, 768, buffer, (size_t)r); } /* @@ -965,16 +1013,17 @@ TFTPD_TC_DEFINE(wrq_medium,) SEND_WRQ("medium.txt", "octet"); recv_ack(0); - send_data(1, (const char*)&contents[0], 512); + send_data(1, (const char *)&contents[0], 512); recv_ack(1); - send_data(2, (const char*)&contents[128], 256); + send_data(2, (const char *)&contents[128], 256); recv_ack(2); fd = open("medium.txt", O_RDONLY); ATF_REQUIRE(fd >= 0); r = read(fd, buffer, sizeof(buffer)); + ATF_REQUIRE(r > 0); close(fd); - require_bufeq((const char*)contents, 768, buffer, r); + require_bufeq((const char *)contents, 768, buffer, (size_t)r); } /* @@ -998,15 +1047,16 @@ TFTPD_TC_DEFINE(wrq_medium_window,) SEND_WRQ_OPT("medium.txt", "octet", OPTION_STR("windowsize", "2")); recv_oack(options, sizeof(options) - 1); - send_data(1, (const char*)&contents[0], 512); - send_data(2, (const char*)&contents[128], 256); + send_data(1, (const char *)&contents[0], 512); + send_data(2, (const char *)&contents[128], 256); recv_ack(2); fd = open("medium.txt", O_RDONLY); ATF_REQUIRE(fd >= 0); r = read(fd, buffer, sizeof(buffer)); + ATF_REQUIRE(r > 0); close(fd); - require_bufeq((const char*)contents, 768, buffer, r); + require_bufeq((const char *)contents, 768, buffer, (size_t)r); } /* @@ -1038,8 +1088,9 @@ TFTPD_TC_DEFINE(wrq_netascii,) fd = open("unix.txt", O_RDONLY); ATF_REQUIRE(fd >= 0); r = read(fd, buffer, sizeof(buffer)); + ATF_REQUIRE(r > 0); close(fd); - require_bufeq(expected, sizeof(expected), buffer, r); + require_bufeq(expected, sizeof(expected), buffer, (size_t)r); } /* @@ -1076,8 +1127,9 @@ TFTPD_TC_DEFINE(wrq_small,) fd = open("small.txt", O_RDONLY); ATF_REQUIRE(fd >= 0); r = read(fd, buffer, sizeof(buffer)); + ATF_REQUIRE(r > 0); close(fd); - require_bufeq(contents, contents_len, buffer, r); + require_bufeq(contents, contents_len, buffer, (size_t)r); } /* @@ -1099,8 +1151,8 @@ TFTPD_TC_DEFINE(wrq_truncate,) send_data(1, NULL, 0); recv_ack(1); - ATF_REQUIRE_EQ(stat("small.txt", &sb), 0); - ATF_REQUIRE_EQ(sb.st_size, 0); + ATF_REQUIRE_EQ(0, stat("small.txt", &sb)); + ATF_REQUIRE_EQ(0, sb.st_size); } /* @@ -1163,8 +1215,25 @@ TFTPD_TC_DEFINE(wrq_window_rfc7440,) fd = open("rfc7440.txt", O_RDONLY); ATF_REQUIRE(fd >= 0); r = read(fd, buffer, sizeof(buffer)); + ATF_REQUIRE(r > 0); close(fd); - require_bufeq(contents, sizeof(contents), buffer, r); + require_bufeq(contents, sizeof(contents), buffer, (size_t)r); +} + +/* + * Send less than four bytes + */ +TFTPD_TC_DEFINE(short_packet1, /* no head */, exitcode = 1) +{ + SEND_STR("\1"); +} +TFTPD_TC_DEFINE(short_packet2, /* no head */, exitcode = 1) +{ + SEND_STR("\1\2"); +} +TFTPD_TC_DEFINE(short_packet3, /* no head */, exitcode = 1) +{ + SEND_STR("\1\2\3"); } @@ -1204,6 +1273,9 @@ ATF_TP_ADD_TCS(tp) TFTPD_TC_ADD(tp, wrq_small); TFTPD_TC_ADD(tp, wrq_truncate); TFTPD_TC_ADD(tp, wrq_window_rfc7440); + TFTPD_TC_ADD(tp, short_packet1); + TFTPD_TC_ADD(tp, short_packet2); + TFTPD_TC_ADD(tp, short_packet3); return (atf_no_error()); } diff --git a/libexec/tftpd/tftp-utils.c b/libexec/tftpd/tftp-utils.c index 9754c3238d50..b309a94f7653 100644 --- a/libexec/tftpd/tftp-utils.c +++ b/libexec/tftpd/tftp-utils.c @@ -104,8 +104,8 @@ unmappedaddr(struct sockaddr_in6 *sin6) } /* Get a field from a \0 separated string */ -ssize_t -get_field(int peer, char *buffer, ssize_t size) +size_t +get_field(int peer, char *buffer, size_t size) { char *cp = buffer; diff --git a/libexec/tftpd/tftp-utils.h b/libexec/tftpd/tftp-utils.h index 3fecf1fc8696..763b3b493c7e 100644 --- a/libexec/tftpd/tftp-utils.h +++ b/libexec/tftpd/tftp-utils.h @@ -63,7 +63,7 @@ extern int acting_as_client; /* */ void unmappedaddr(struct sockaddr_in6 *sin6); -ssize_t get_field(int peer, char *buffer, ssize_t size); +size_t get_field(int peer, char *buffer, size_t size); /* * Packet types diff --git a/libexec/tftpd/tftpd.c b/libexec/tftpd/tftpd.c index ffe31927780e..78348a8c6aaf 100644 --- a/libexec/tftpd/tftpd.c +++ b/libexec/tftpd/tftpd.c @@ -80,8 +80,8 @@ static char sccsid[] = "@(#)tftpd.c 8.1 (Berkeley) 6/4/93"; #include #endif -static void tftp_wrq(int peer, char *, ssize_t); -static void tftp_rrq(int peer, char *, ssize_t); +static void tftp_wrq(int peer, char *, size_t); +static void tftp_rrq(int peer, char *, size_t); /* * Null-terminated directory prefix list for absolute pathname requests and @@ -93,7 +93,7 @@ static void tftp_rrq(int peer, char *, ssize_t); #define MAXDIRS 20 static struct dirlist { const char *name; - int len; + size_t len; } dirs[MAXDIRS+1]; static int suppress_naks; static int logging; @@ -240,6 +240,11 @@ main(int argc, char *argv[]) } getnameinfo((struct sockaddr *)&peer_sock, peer_sock.ss_len, peername, sizeof(peername), NULL, 0, NI_NUMERICHOST); + if ((size_t)n < 4 /* tftphdr */) { + tftp_log(LOG_ERR, "Rejecting %zd-byte request from %s", + n, peername); + exit(1); + } /* * Now that we have read the message out of the UDP @@ -404,7 +409,7 @@ main(int argc, char *argv[]) tp->th_opcode = ntohs(tp->th_opcode); if (tp->th_opcode == RRQ) { if (allow_ro) - tftp_rrq(peer, tp->th_stuff, n - 1); + tftp_rrq(peer, tp->th_stuff, (size_t)n - 1); else { tftp_log(LOG_WARNING, "%s read access denied", peername); @@ -412,7 +417,7 @@ main(int argc, char *argv[]) } } else if (tp->th_opcode == WRQ) { if (allow_wo) - tftp_wrq(peer, tp->th_stuff, n - 1); + tftp_wrq(peer, tp->th_stuff, (size_t)n - 1); else { tftp_log(LOG_WARNING, "%s write access denied", peername); @@ -455,7 +460,7 @@ reduce_path(char *fn) } static char * -parse_header(int peer, char *recvbuffer, ssize_t size, +parse_header(int peer, char *recvbuffer, size_t size, char **filename, char **mode) { char *cp; @@ -501,7 +506,7 @@ parse_header(int peer, char *recvbuffer, ssize_t size, * WRQ - receive a file from the client */ void -tftp_wrq(int peer, char *recvbuffer, ssize_t size) +tftp_wrq(int peer, char *recvbuffer, size_t size) { char *cp; int has_options = 0, ecode; @@ -546,7 +551,7 @@ tftp_wrq(int peer, char *recvbuffer, ssize_t size) * RRQ - send a file to the client */ void -tftp_rrq(int peer, char *recvbuffer, ssize_t size) +tftp_rrq(int peer, char *recvbuffer, size_t size) { char *cp; int has_options = 0, ecode; @@ -694,10 +699,11 @@ validate_access(int peer, char **filep, int mode) * it's a /. */ for (dirp = dirs; dirp->name != NULL; dirp++) { - if (dirp->len == 1 || - (!strncmp(filename, dirp->name, dirp->len) && - filename[dirp->len] == '/')) - break; + if (dirp->len == 1) + break; + if (strncmp(filename, dirp->name, dirp->len) == 0 && + filename[dirp->len] == '/') + break; } /* If directory list is empty, allow access to any file */ if (dirp->name == NULL && dirp != dirs) From nobody Thu May 2 09:08:28 2024 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 4VVSlc2dPlz5Jdvw; Thu, 2 May 2024 09:08: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 4VVSlc1nTfz4jmG; Thu, 2 May 2024 09:08:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714640908; 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=a8Rjzbve9bTOcKiYt/9DTOtPyhYgX26pn/WOabqLsSo=; b=A4ASZIMe5G1QePY45Gv+Drk4IW2LFX3CW5526Oizi0FSQLQ3BtLs39EgPR0zNB8PBDTw2G bXTDyBl2Ok32TSiVYPnaWTSgAfrjPcPPvmHpoxvTLL3Dy3/gAOl9ijdMQSLGjpZFSNhE+b /vrIKf7wDWE+hmDDCd1TMHEhdRB+BiXLYR2uQQPtn1vmXFZYSubtl9Z52aNFC95z9KJvaI IfIQWFHsCVeUhIi49ngXnXiTYf58ojobClJfRejdaafXi9RE+x+GU4z1AyRaCNkFGhrxgU 7YQ5AbDmGm8GXvzpHMkAso1k34tOZVY4g3HWb2ox+V/z9xZcEKsogbKVkpJCYw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714640908; a=rsa-sha256; cv=none; b=a+S3j86sHrJOUcIigQvZPSUx9QbFZv2NRGwb6ZCz7lkAxg/oUmEAFS5pbX1KeMC/MMV1Dx dAkWSwxcn6l5iLt7UNO9m+CgjnfnymHllZeKMza0L7TmEnTC+MTiz4LWKloTZ/YyfE/+NN R+pVt73jgzAz0EgcWt1v88Zzb7g3gU3XIWcapndSUwcRZVChZMVh3SGpX64fPkEhuQvmqa MUBlHHBtO11AhromE4ja+H4pBwZ8t2fVn9BhFQxKIJzYR8fGm3LiWSPj1Hhb4wONWvSoH8 HC6/dLF+tBvX7aoooEpZoKWIhp/BAH7GFTvkWwU3NDRX+yK91IZ4Y5EIhed1jg== 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=1714640908; 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=a8Rjzbve9bTOcKiYt/9DTOtPyhYgX26pn/WOabqLsSo=; b=MbzpCdUmz3f8bvCaNeYsh61MpiXypOVWWeSFgeoDSa2PKNZvsjxXnMeVhfDETr1FE9nDZo minASpFvw8vNKK9gWctYMazVBb5sUghkJsOc5qiLIKTFqtmYfKiOHotZA7Z62Hve1nz0SG E4kVLpf1oIRXKjpucxlKFpitjOuk1SA8wKqorLEppWIE7cSymS4z9A9QPKUk1Gl8jNck+E PXVEpFlQWwH27rVEHB6NfVoTojXjIrP3cnReg0l0FKqTUtuEqGg5YvsT+B1JI2qdS+yqF0 e3MT5M8xB0lOoQtVjRE/snWkhYo8hTHnD7yytyGD5jaV6aDBjMJS6KKrB4VusQ== 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 4VVSlc1NW3zwPN; Thu, 2 May 2024 09:08: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 44298SK6040192; Thu, 2 May 2024 09:08:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44298SDm040189; Thu, 2 May 2024 09:08:28 GMT (envelope-from git) Date: Thu, 2 May 2024 09:08:28 GMT Message-Id: <202405020908.44298SDm040189@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: 2bdfc2988986 - stable/14 - libulog: Make sure ut_line, ut_user, ut_host are terminated. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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: 2bdfc2988986461bac0c28fb6fdc4ee99e421c6c Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=2bdfc2988986461bac0c28fb6fdc4ee99e421c6c commit 2bdfc2988986461bac0c28fb6fdc4ee99e421c6c Author: Dag-Erling Smørgrav AuthorDate: 2024-04-29 10:11:12 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-05-02 09:08:17 +0000 libulog: Make sure ut_line, ut_user, ut_host are terminated. MFC after: 3 days Reviewed by: bapt Differential Revision: https://reviews.freebsd.org/D45004 (cherry picked from commit c28253ecde333c9908b7160664805acc3a92e2b0) --- lib/libulog/ulog_login.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/libulog/ulog_login.c b/lib/libulog/ulog_login.c index dc08ac7d331d..adf6bdbb7489 100644 --- a/lib/libulog/ulog_login.c +++ b/lib/libulog/ulog_login.c @@ -50,7 +50,7 @@ ulog_fill(struct utmpx *utx, const char *line) utx->ut_pid = getpid(); gettimeofday(&utx->ut_tv, NULL); - strncpy(utx->ut_line, line, sizeof utx->ut_line); + strlcpy(utx->ut_line, line, sizeof utx->ut_line); SHA1_Init(&c); SHA1_Update(&c, "libulog", 7); @@ -67,9 +67,9 @@ ulog_login(const char *line, const char *user, const char *host) ulog_fill(&utx, line); utx.ut_type = USER_PROCESS; - strncpy(utx.ut_user, user, sizeof utx.ut_user); + strlcpy(utx.ut_user, user, sizeof utx.ut_user); if (host != NULL) - strncpy(utx.ut_host, host, sizeof utx.ut_host); + strlcpy(utx.ut_host, host, sizeof utx.ut_host); pututxline(&utx); } From nobody Thu May 2 09:08:46 2024 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 4VVSly372xz5Jdxq; Thu, 2 May 2024 09:08: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 4VVSly2Zb1z4jws; Thu, 2 May 2024 09:08:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714640926; 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=+rvwvxZQvFvJRsvfJcgCr5N1MoiTMyicI7JWsKQbpsQ=; b=ejPmxbGGE5jLF6XUpOA+T+0HUq3zlHkcpShG3RGZGzqRoA+8/wFcPG2wJUg/Troes9rdIE cxzgnVcTtpkkeKDXU3xg6tmxkS9x/7loBkYi4+EDoTyECBYTMiX88Dk7c2lwViQaZoxUnQ fMdyeuAaLcMA/uwsp/whKjdkWna86X2yM2nmd6V2SivQJ9UK1/99vXttqfhJpeAdDlyWee 6VBrnwXqf4DGYUAIahC+FpqbeeEcMVvqPFSpWb4TmA3UOKG4p6tCQvO8RGt3YekdMeI5XB E7biEBEq8gNWTPhMN6cE7YWQkRiquMMJ1Mmv0AsXYwW1iW4psbzNOyGEzageOg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714640926; a=rsa-sha256; cv=none; b=gSi6SVJqyf8XsE/o7ASrcoLDVnKj4xgEc3fzK5um+hA9mXzl++fcd9U2d3YgCZfaopEERU Sgq9Hv203SHmf2uXJ00vRaLy7+XYNtSvAgHj0qZZeeGJusdLo2U7QkuLOr0wiOC0cJjfqz 42u6K5lN4t0HSAlTcTgbaMTDrZPCi0rkLRMAGEWuTXoQItZ+Cxrk6zxgWzYcFg7iPDNSXl YhpKH4YxdAs4OBb52nkvnAmt9kw0lQpsEHZqKDzMmTcFIUOMmmC2RzP+oq5TZSjsYglJaz I8+noIJbR25AjDXylHH2hYaFqtKCucxWsnfNMCywaklsDxSQiydOjdfBFkp8Zw== 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=1714640926; 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=+rvwvxZQvFvJRsvfJcgCr5N1MoiTMyicI7JWsKQbpsQ=; b=QjvtEt0u/P7dReFC2jVAqu+vyc/GuO75Bqf6SDB3cnhD1zVg+5UjCHpmlpCXeiJk3dLLl5 oAU7YJqutPYMRtDfZC0yV0+UDuceIXW/8whfIGP2Xt1kYoJ0JcoSpoY8+kL7mNSWLY56qk iZ1/0cZXWwAP2M8hxoYfEdk0dEIv6YXmre3P7QSY1jcYT1FEMomBZ+XlU4BC49liAvgd1l ChM8TU26KrqUaRS8dr4oeCSB45gidWPlIa8JQqzosMFY8FT7lEKTvJ+tGH4Z13Q1gSejo1 JF5fcHvHn7fG9ghISuAEvnB/nstWVsgU3g4q8uxmwTDYypojJ/TJa/HHASh8mw== 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 4VVSly29ljzwdy; Thu, 2 May 2024 09:08: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 44298kcH040393; Thu, 2 May 2024 09:08:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44298kAj040390; Thu, 2 May 2024 09:08:46 GMT (envelope-from git) Date: Thu, 2 May 2024 09:08:46 GMT Message-Id: <202405020908.44298kAj040390@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: 3f59eb314103 - stable/13 - libulog: Make sure ut_line, ut_user, ut_host are terminated. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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: 3f59eb314103869e3f54468cf2a2b4464bd8a484 Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=3f59eb314103869e3f54468cf2a2b4464bd8a484 commit 3f59eb314103869e3f54468cf2a2b4464bd8a484 Author: Dag-Erling Smørgrav AuthorDate: 2024-04-29 10:11:12 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-05-02 09:08:36 +0000 libulog: Make sure ut_line, ut_user, ut_host are terminated. MFC after: 3 days Reviewed by: bapt Differential Revision: https://reviews.freebsd.org/D45004 (cherry picked from commit c28253ecde333c9908b7160664805acc3a92e2b0) --- lib/libulog/ulog_login.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/libulog/ulog_login.c b/lib/libulog/ulog_login.c index dc08ac7d331d..adf6bdbb7489 100644 --- a/lib/libulog/ulog_login.c +++ b/lib/libulog/ulog_login.c @@ -50,7 +50,7 @@ ulog_fill(struct utmpx *utx, const char *line) utx->ut_pid = getpid(); gettimeofday(&utx->ut_tv, NULL); - strncpy(utx->ut_line, line, sizeof utx->ut_line); + strlcpy(utx->ut_line, line, sizeof utx->ut_line); SHA1_Init(&c); SHA1_Update(&c, "libulog", 7); @@ -67,9 +67,9 @@ ulog_login(const char *line, const char *user, const char *host) ulog_fill(&utx, line); utx.ut_type = USER_PROCESS; - strncpy(utx.ut_user, user, sizeof utx.ut_user); + strlcpy(utx.ut_user, user, sizeof utx.ut_user); if (host != NULL) - strncpy(utx.ut_host, host, sizeof utx.ut_host); + strlcpy(utx.ut_host, host, sizeof utx.ut_host); pututxline(&utx); } From nobody Thu May 2 13:26:43 2024 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 4VVZTb3KZcz5JJcT; Thu, 2 May 2024 13:26: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 4VVZTb2tpxz49dX; Thu, 2 May 2024 13:26:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714656403; 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=sWlkvIpBmTz7I43yKQCxPdUOeNF+OsITGJ+ZE8lxRc4=; b=MbYmhJVnseS+oBb/7OdV4qUJBtmi2kfHky3kUwi7fASe3IgtKm7F1YV0UceWIxsKH93viL xKjcDgKf7WulAItYkWyldaUSDnKjRYkTqTG4wtOxWfsct/3n/jXAKQn+lmLe2EpThA5QWY ZtxsHpQQYfxlkX7dVvXEJ/TxpcGvSHS/wvxab/ef07181vNjYKbGz+xxnsjogrEW0yaOzl rzQbVN645+HAMCQJpQm2P13Ik3nuPVUOp31/fDtg9JcjvY8dmQTa7h38kHLa3GRQ8i59Fz O6McqFnXB+ZgQpAamszzQ2gMs6tAsSsEL0xWWrU6nSCavJIbi6PgChfjoY26Pw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714656403; a=rsa-sha256; cv=none; b=AMP9+YBbZ0DzrjyUims5ZFfo8SCxHFJLCkqkA2qDjpBfnN+ib7a2WQaJ0y5pBum0gyZcAk oGzYPLON2kXLrHeazI3+2JaTjhI78ulPFRFfpwffH3SaBYEFBoAxjCBJS+CP6rJLQ9mM4a 4pQeDt8oXYiC6pFj3VVWdEv/pSsBbRnEX7rIEOel5fgc1T4ktztK2nVQT2/ayQviHWBEsC xrMnciMTMu5D9aGDdkrj61E5pqVnU3VwVIebju2Z+E0qg8NPIcQPcV8qQ2+C54xDagiqLL 9p76LFCO6iovfNN4vYXNP5uCAOfPsngcvgom5svN3XQ563ui0yiLHVnZOwJzFQ== 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=1714656403; 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=sWlkvIpBmTz7I43yKQCxPdUOeNF+OsITGJ+ZE8lxRc4=; b=IzQiCialz8txOeAsBSjecnW/fGKOUvCLuAJ92lhUt9QeyVUMKo2LfInT2iBugHnHMk3Q5m 6AXD6XZwi2KIbfW0ZwM/riEHpWHMlTIh+ITWCzShRVxgccRyOv60anYiACfdXg/feAcBGA G0TghSfX0yoWv+ADmZnN7ekoa72QmbmCyzIl5uWKSrJOEXm1bWoh9Xvh3YNVp6rk3mhPxh piGWO66aWD6ppkeWhzgnidF9k+yyYBLmND2C1PoOe1ILtDa4JX431niwlF207p2w3RYmfz pi2PmALOxIJBhjCdf/t/O2F3IQ4YD+q4DLWVhdJJnCmve8HFik6tdnWAbavAzA== 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 4VVZTb2Mlsz14YD; Thu, 2 May 2024 13:26: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 442DQh5D080648; Thu, 2 May 2024 13:26:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 442DQhSI080645; Thu, 2 May 2024 13:26:43 GMT (envelope-from git) Date: Thu, 2 May 2024 13:26:43 GMT Message-Id: <202405021326.442DQhSI080645@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: 4ee7b8e1ef3c - stable/14 - dpaa: uma_zcreate() does not fail List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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: 4ee7b8e1ef3c5f8ee0b2853fc719f9bf186577ee Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=4ee7b8e1ef3c5f8ee0b2853fc719f9bf186577ee commit 4ee7b8e1ef3c5f8ee0b2853fc719f9bf186577ee Author: Mark Johnston AuthorDate: 2024-04-23 16:18:21 +0000 Commit: Mark Johnston CommitDate: 2024-05-02 13:25:08 +0000 dpaa: uma_zcreate() does not fail No functional change intended. MFC after: 1 week (cherry picked from commit 964064937ea04519bd400668dc1ce38848d50901) --- sys/dev/dpaa/if_dtsec_rm.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/sys/dev/dpaa/if_dtsec_rm.c b/sys/dev/dpaa/if_dtsec_rm.c index 63ae0504782d..b213a259b5bc 100644 --- a/sys/dev/dpaa/if_dtsec_rm.c +++ b/sys/dev/dpaa/if_dtsec_rm.c @@ -116,8 +116,6 @@ dtsec_rm_fi_pool_init(struct dtsec_softc *sc) sc->sc_fi_zone = uma_zcreate(sc->sc_fi_zname, sizeof(struct dtsec_rm_frame_info), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); - if (sc->sc_fi_zone == NULL) - return (EIO); return (0); } @@ -313,8 +311,6 @@ dtsec_rm_pool_rx_init(struct dtsec_softc *sc) sc->sc_rx_zone = uma_zcreate(sc->sc_rx_zname, FM_PORT_BUFFER_SIZE, NULL, NULL, NULL, NULL, FM_PORT_BUFFER_SIZE - 1, 0); - if (sc->sc_rx_zone == NULL) - return (EIO); sc->sc_rx_pool = bman_pool_create(&sc->sc_rx_bpid, FM_PORT_BUFFER_SIZE, 0, 0, DTSEC_RM_POOL_RX_MAX_SIZE, dtsec_rm_pool_rx_get_buffer, From nobody Thu May 2 13:26:44 2024 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 4VVZTc4X7kz5JJcV; Thu, 2 May 2024 13:26: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 4VVZTc3SL4z49SH; Thu, 2 May 2024 13:26:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714656404; 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=oYkve/xiSJ3uCAgZ5OA2F//Jegff7FvvhREb0DOlIx0=; b=n/1WPLOHlpPN3cFlj1a0fmndUVdBD4BjT0CBRr/VE7DCIrXvo+2YX6JFyAGsnbUWxpAHq6 qS8TWzvRP5qQtnPOlXISx8Domk7tPBS5j2vMPxPnMdlvdQBgiOIAyj+ZACH8fltn4AecRD e8FYkG7F/9F6FAX8AuHjgHg1qJQj868YIA5qdpYj73jBZrcJLtSyKRbKp1APNdooLR9XE2 S/iPuXh0+tn8R0xt6lXZjJeQ/fL+BYpBfCksfMRc3Jd6k62OHkLcDBruZsySYH8SKgVV0b vsj/BGFvqYJtLEOjldySmyXtIr59Idfcf/qhOP9oZRHwse2HRO4ZQ6y60aKMzQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714656404; a=rsa-sha256; cv=none; b=vQPycQUD2p1fqcEc4CzpFWvpKWLbHeq568p2Dods2IvaRnlHbq596vnLFnyM/Qr1W5GWq3 NNB/pJRqPuXYrkcXrzgsLJSbqdLm+TVIlrZAHU0W6xH8ZH3636C8SmpqB27YAdHJ7U06pb JuNGpAZKFRvSgv+upX+4NhfYfyaNllMn5wK3LOMGVnLs5az6sDw3gcokHZsLmjSyB9P8jn I31PNkOZzqvDYeYLggI4+T2oCaSY/+QqwaglzGwMSp/01DwYb3YK1BvwICfKWvSBLt3wss OdKGmkePlum2sg4THJoYRIo9eYGXNgSBnHbURZaGpPCOHnXXbGgDXLqDrHfiGg== 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=1714656404; 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=oYkve/xiSJ3uCAgZ5OA2F//Jegff7FvvhREb0DOlIx0=; b=M4W6kWzxqi200GDDM+LyQnOqXr7gqMh7FFvm1TB7OskAF0yWClSBPhlXMW0M94SWc+1XTC IYuhv4wBRejRBZKgvMTyuW4k9M3uTqibz1iIw6IjSEHo89H4ikMNYDAvrQXPR7iZ1zbTzS qyV+lj986yVfDa3Hcraf9Z16x6V+jmkRfSB5J3rLS767X9QH6KrSyONZZ3T83Xem/Vvroh s+cIgFxZfC3bZI8pfhj9gsH0oej/oz24h/SXZ1kLY1jdHltBqSj954JXwBUEJmbTv7ux1q pXr42tWMOa5yEzP7LwIJ7c8tOXjM87LuhEow67dM+/GcJFFH5Y3XeiCbBy8XrQ== 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 4VVZTc3417z1471; Thu, 2 May 2024 13:26: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 442DQixk080693; Thu, 2 May 2024 13:26:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 442DQikw080690; Thu, 2 May 2024 13:26:44 GMT (envelope-from git) Date: Thu, 2 May 2024 13:26:44 GMT Message-Id: <202405021326.442DQikw080690@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: fa1d1e824b9d - stable/14 - khelp: uma_zcreate() does not fail List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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: fa1d1e824b9da32c6ad6d3ad3a36597f576e1cc3 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=fa1d1e824b9da32c6ad6d3ad3a36597f576e1cc3 commit fa1d1e824b9da32c6ad6d3ad3a36597f576e1cc3 Author: Mark Johnston AuthorDate: 2024-04-23 16:22:27 +0000 Commit: Mark Johnston CommitDate: 2024-05-02 13:25:08 +0000 khelp: uma_zcreate() does not fail No functional change intended. MFC after: 1 week (cherry picked from commit 1e607a0753ff93847926a46003fe74087426b580) --- sys/kern/kern_khelp.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/sys/kern/kern_khelp.c b/sys/kern/kern_khelp.c index f8a6f3e749da..eadb2b5a8db9 100644 --- a/sys/kern/kern_khelp.c +++ b/sys/kern/kern_khelp.c @@ -331,10 +331,6 @@ khelp_modevent(module_t mod, int event_type, void *data) kmd->helper->h_zone = uma_zcreate(kmd->name, kmd->uma_zsize, kmd->umactor, kmd->umadtor, NULL, NULL, 0, 0); - if (kmd->helper->h_zone == NULL) { - error = ENOMEM; - break; - } } strlcpy(kmd->helper->h_name, kmd->name, HELPER_NAME_MAXLEN); kmd->helper->h_hooks = kmd->hooks; From nobody Thu May 2 13:26:45 2024 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 4VVZTf1Dm0z5JJfk; Thu, 2 May 2024 13:26: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 4VVZTd4TKlz49xp; Thu, 2 May 2024 13:26:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714656405; 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=uqWdpbwzLhLMVS4Ela/CBdqR5OdEc3qMtT1e9Ia11FQ=; b=AixGHng5wWxWipl9QCTcbpOwVEaud1HWplqaPh303QRHjlvEowXufhXImZveN4ebaIyfpQ lWcxD0O+CJSGIY4pTzOdRC60Srfsjbjjwbjfjpx2x/0jon1Lr2pHCbONnP0wxALwt6TYD0 voszDFXI0BHfbFfYwV9Fpe2MPKiNsTl7sK2xGw7LglwoV6vEneexCeX3BU9IRkByx/5WYQ G88doG9WhMU8DawQk/ronwIfLR5WMP6OCBOZyRktq9iw4pi+I+mqg8JhhYH69K5AZ0Kb1h BmWAMvXPrS+Mc6hSbf+tgt9p7hvLCHafsrryFrb/CTvaMf9BP8CPhOTZjg9saA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714656405; a=rsa-sha256; cv=none; b=T79YQuh9/ZdxjvLz/Wv4G7C6WvNgSu6map7x3mcG+XS2Vmeth1LLRx+aBXvU5LvgK/PbSb PdnB/nZhYP8PIIoObZCl3/8L58K7amXeyFNf1UE6b3nAcpBOFOQ4Xuc0yryYhBIO9RUrWE 8H02fkJPByO4LpPGTDqZr/9NCl7jUdh6wSwx01OzzqLmjnPARSBLBcVMdjUmt7W2tXcJAM G/Xy/c+G2qpXcuhevB3xZpc17JQdesJxSqTLZAWKo7m3If9BHy5u+k1tGvanNRh6NfuOiH HxdKw6KzJpeB8iJVW4EMb2yoABY22/IC/xGnnASKqyynq5rNtRXwphtD9SeGCQ== 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=1714656405; 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=uqWdpbwzLhLMVS4Ela/CBdqR5OdEc3qMtT1e9Ia11FQ=; b=ZHy/Iwrcd+0UuNEl7fL5imF9ncLdO/7CvA1jTRa7tNgkZtQRLLzuIna70PCgcAiordcvq/ eoXZKlcaWukX2Ov6I4gyLuVTZ7PyD0BVyfxo42fltNo+X7m6OXEnK0vsas4AeyHBPWQTca MTUNzPl4Dvh+uUcelxwP4wjiJZ9P6/IOpyUumAxvQg1cAKT4emvtODRSJNN783qUlyEKO8 kEPH2meG8EsImQZGau+iLal1TN4qAVwPmHkAFAWn4CeRvtL6K4sbhz/0SA/IARPmFNE5W4 CH3qa17unRXl77GwHVlZ2TrqOtAA5BQxsIxQJmQu00OlLbixZ9Dscv61dV2/vQ== 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 4VVZTd43XDz14HP; Thu, 2 May 2024 13:26: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 442DQjgY080739; Thu, 2 May 2024 13:26:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 442DQjo7080736; Thu, 2 May 2024 13:26:45 GMT (envelope-from git) Date: Thu, 2 May 2024 13:26:45 GMT Message-Id: <202405021326.442DQjo7080736@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: bff26fe7aa07 - stable/14 - wg: uma_zcreate() does not fail List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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: bff26fe7aa07173729bff549a00cc355bc977baf Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=bff26fe7aa07173729bff549a00cc355bc977baf commit bff26fe7aa07173729bff549a00cc355bc977baf Author: Mark Johnston AuthorDate: 2024-04-23 16:19:08 +0000 Commit: Mark Johnston CommitDate: 2024-05-02 13:25:08 +0000 wg: uma_zcreate() does not fail No functional change intended. MFC after: 1 week (cherry picked from commit b6a0ed7c78dd45937e404706620467bef61c308d) --- sys/dev/wg/if_wg.c | 6 +++--- sys/dev/wg/wg_cookie.c | 5 ++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/sys/dev/wg/if_wg.c b/sys/dev/wg/if_wg.c index bf4eef31c0b3..2c867956912a 100644 --- a/sys/dev/wg/if_wg.c +++ b/sys/dev/wg/if_wg.c @@ -2989,9 +2989,9 @@ wg_module_init(void) [PR_METHOD_REMOVE] = wg_prison_remove, }; - if ((wg_packet_zone = uma_zcreate("wg packet", sizeof(struct wg_packet), - NULL, NULL, NULL, NULL, 0, 0)) == NULL) - return (ENOMEM); + wg_packet_zone = uma_zcreate("wg packet", sizeof(struct wg_packet), + NULL, NULL, NULL, NULL, 0, 0); + ret = crypto_init(); if (ret != 0) return (ret); diff --git a/sys/dev/wg/wg_cookie.c b/sys/dev/wg/wg_cookie.c index 6ff9325c6613..80617d473471 100644 --- a/sys/dev/wg/wg_cookie.c +++ b/sys/dev/wg/wg_cookie.c @@ -85,9 +85,8 @@ static uma_zone_t ratelimit_zone; int cookie_init(void) { - if ((ratelimit_zone = uma_zcreate("wg ratelimit", - sizeof(struct ratelimit_entry), NULL, NULL, NULL, NULL, 0, 0)) == NULL) - return ENOMEM; + ratelimit_zone = uma_zcreate("wg ratelimit", + sizeof(struct ratelimit_entry), NULL, NULL, NULL, NULL, 0, 0); ratelimit_init(&ratelimit_v4); #ifdef INET6 From nobody Thu May 2 13:26:46 2024 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 4VVZTg0fJYz5JJcb; Thu, 2 May 2024 13:26: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 4VVZTf5JFFz49kX; Thu, 2 May 2024 13:26:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714656406; 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=MFhejzJHh3J9NT09rpC73y2Om/TtQ7pTwZCyjDqLN2w=; b=QffEQRuCU4jGJYs+ob2IsozMEC/o+vzJ3KNbTFhYDqeArU+a/zkTBTAipZLXh+mmOgGjz7 AU31H7ffhMW9zCOFdw8DNge80USZxZ4KDi7C8jEolOiOTep18SVSMSfccd0BfY4jm8xFFh 5xYpbJzd5MRM8Ouk9wyaW8IvQy7tJCHSz7scR/rnlqFKp2Jjlh2XSt9Kthp/7m/ZsRHY/Z mb4rpd9H2RxnDFMKSlr2Rz12SMxGJ+ibOQtx9VpRFltaxoKjI8sncF9IYx9ucw+k07caag 4yJ0SCkO9hAa52Td1yXihoAizPpOsqywM5lEU8Yr5joWlLqEoRaqgSObTZdKvw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714656406; a=rsa-sha256; cv=none; b=aKR+vVAdW+P7bCs0+f/S4P6N+Mm1pArj9XCiAMyRN5f5YjOyPUxDxf20S/deBYESlJklhW RCnq12jH7/ps3LVkATEqFjnTI4isdfchQlOfFK/1eMO94Q2ItxRCRf1K13tTksoEhAMM6I OkqgDenYYt4Q+k6tCOj05wFJtmSmfn10sxJcSHk6/E4b8xeLWfY8TzYpZZkoQT2IWlbjuK 8UR2TFljkCEp4C+9z7nXsaOw9TL12/WB8ZlSv6Dsv0KqCA+TAYY0OYxoKRFse/SicTyEGe p+D7zDhwY4t66TsdJqV6LppXBAWdfZV6bsbtO+CZl4GtyLPHYrmb3JoLD4pHuw== 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=1714656406; 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=MFhejzJHh3J9NT09rpC73y2Om/TtQ7pTwZCyjDqLN2w=; b=GKB/MKsLuPWCSx+nOysHRJ5x3yVbMMuAHAMqIInHYO4lmrp9sLQwuc/MFcEDYQTwrHQHEv 3nc3GAfozSXCgx/GG5uzrLJslth3QJwVlFY5cl0A4NvndNPB0sz4TRaa3nG/RsMZUCZ5kk 9sTPorbg9ARtMhjWGn/143LQHGw/AdHom79Xk44W2ZOgGgUCBwye8gjHD8hfsrv20WN4z3 nSlL3eHBhnwYdX9akqtvsqwQZs4kpwwHqn4RElkrpcYA3X4wHr24RfsXZ/YdoyrE8VfwWu /fTK3pdgZVvZSBF/yWZvyF5UKpIdJCVX/kQyg0Qhl0kvV35hepr0YwPD4+xJhQ== 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 4VVZTf4wWZz14JV; Thu, 2 May 2024 13:26: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 442DQkn4080781; Thu, 2 May 2024 13:26:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 442DQkv0080778; Thu, 2 May 2024 13:26:46 GMT (envelope-from git) Date: Thu, 2 May 2024 13:26:46 GMT Message-Id: <202405021326.442DQkv0080778@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: 7a8b49047659 - stable/14 - busdma: uma_zcreate() does not fail List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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: 7a8b49047659bb8e06660de9ddb47d1059899d89 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=7a8b49047659bb8e06660de9ddb47d1059899d89 commit 7a8b49047659bb8e06660de9ddb47d1059899d89 Author: Mark Johnston AuthorDate: 2024-04-23 16:23:13 +0000 Commit: Mark Johnston CommitDate: 2024-05-02 13:25:08 +0000 busdma: uma_zcreate() does not fail No functional change intended. MFC after: 1 week (cherry picked from commit 8ef2c021822f59a334e3926e8505c8a8e8a3475f) --- sys/kern/subr_busdma_bufalloc.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/sys/kern/subr_busdma_bufalloc.c b/sys/kern/subr_busdma_bufalloc.c index 2cc47b006753..fa7191341db6 100644 --- a/sys/kern/subr_busdma_bufalloc.c +++ b/sys/kern/subr_busdma_bufalloc.c @@ -100,10 +100,6 @@ busdma_bufalloc_create(const char *name, bus_size_t minimum_alignment, bz->size = cursize; bz->umazone = uma_zcreate(bz->name, bz->size, NULL, NULL, NULL, NULL, bz->size - 1, zcreate_flags); - if (bz->umazone == NULL) { - busdma_bufalloc_destroy(ba); - return (NULL); - } if (alloc_func != NULL) uma_zone_set_allocf(bz->umazone, alloc_func); if (free_func != NULL) From nobody Thu May 2 13:26:47 2024 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 4VVZTh0N6Kz5JJTD; Thu, 2 May 2024 13:26: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 4VVZTg62gHz49kl; Thu, 2 May 2024 13:26:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714656407; 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=eouMGWdh2IrOhhiPc15/vHW8yDgjlJePDaDzo2Bv51g=; b=nneD7XA/dixh8lf+GOZz/8EhkkCy7QO+Qj0MGSkoJiD2nvdcaURLHtBan6dRhstQtBGnKC oXxbgwYsn29WgIZNTUhHEMHhnkXGyS1b2GywIdP75nURe/4+ZNY2MltUDgZRIaU0bVOkDX vpvk0D/P+sNQ5KrV9RGG9CojoI9FgA/F0ZdEVfuvQT+3ZjV2fUinCsMvmY80dZ+SB6GHDC nAZsWQkj+TMr45RZ8E7zwLm3PcUdEqyL7vlq4srB+aXfQQV03hsGwQMduxvbIN/HLuHFzj 5WHocXgIaZ2lD6w3I6raIqMk03JE4Beg2BenPr2da+GfL7XSnEjuAJ0DsoI09A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714656407; a=rsa-sha256; cv=none; b=Rp/gX2XIKJDSiIqS6FFBlq/8Ps2Gq/A8b7ptbUE1ht7rHyPZEaGfY8NQ7ulBiqzQU9t8zS lZYgwY6gATuitemV+3mymcYNLMr5ql4XNLV52wHxtq/Can6ojqnEdYdvi8vOmyX13IN/vW 4h7Lm0/hXJJUIj0jqU6Hp1S3BeX6gVX/vP14nTLFNR8nfu5JkU4J/GhvBgM3Srtfyxmk1c sGo//jRKU6KORiB8zAsQk8DhEtLQhbxvspAPlIY6DmbOlBWo0Mf0jwb/Q6X756Lfm4bL7z jRr1xD48GJ4eIqrIQ/6UAlYeQ8hA4mS6RVgE+t7WDcB7FgRkyVm9kxD9a2flaA== 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=1714656407; 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=eouMGWdh2IrOhhiPc15/vHW8yDgjlJePDaDzo2Bv51g=; b=tZrQiu8ntjlGwzWrgEdRTOzWHpi9uzj3o5W1B60Sxa/TA5UyXA+fwEPzRTeY+qs7TTXlx2 C2OxcYP4Kn3ZGUqUnkyab/w6eCQeYNkGC+wPSJVI0GNPLbgeVbLD5Yox+AtdFL3diMzhlb X/Rxch4H3E82g+TGMvv/sJ+Lp+J1uHFSDKoYtBIqN8ZXt1LAWrbKWkGrwxgwmDlKd0N5at l3fZ5A6WEMtqkMxv8aOS0idjOfAxv1bTQG3FnGtfFBHTOidtcuMBIGtZpUUaOSwmUE4vOZ 0e1CbL0wzg3VKatWgiZrIX2PFvz5rTOCFYTAfY1EBFcazX0PqRXkFpd/oZvsjQ== 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 4VVZTg5b1gz14HQ; Thu, 2 May 2024 13:26: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 442DQlpY080823; Thu, 2 May 2024 13:26:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 442DQlZY080820; Thu, 2 May 2024 13:26:47 GMT (envelope-from git) Date: Thu, 2 May 2024 13:26:47 GMT Message-Id: <202405021326.442DQlZY080820@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: b6a2ce76d6b6 - stable/14 - udf: uma_zcreate() does not fail List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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: b6a2ce76d6b60bb363f6b83559c0d5e19027cad9 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=b6a2ce76d6b60bb363f6b83559c0d5e19027cad9 commit b6a2ce76d6b60bb363f6b83559c0d5e19027cad9 Author: Mark Johnston AuthorDate: 2024-04-23 16:20:50 +0000 Commit: Mark Johnston CommitDate: 2024-05-02 13:25:08 +0000 udf: uma_zcreate() does not fail While here remove an old comment regarding preallocation; it appears to refer to an optimization that is almost certainly irrelevant at this point. No functional change intended. MFC after: 1 week (cherry picked from commit 78c51db3c4927db2437ec616b33ba1faf73f08ee) --- sys/fs/udf/udf_vfsops.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/sys/fs/udf/udf_vfsops.c b/sys/fs/udf/udf_vfsops.c index e844a4e540f4..866d0172f745 100644 --- a/sys/fs/udf/udf_vfsops.c +++ b/sys/fs/udf/udf_vfsops.c @@ -140,11 +140,6 @@ static int udf_init(struct vfsconf *foo) { - /* - * This code used to pre-allocate a certain number of pages for each - * pool, reducing the need to grow the zones later on. UMA doesn't - * advertise any such functionality, unfortunately =-< - */ udf_zone_trans = uma_zcreate("UDF translation buffer, zone", MAXNAMLEN * sizeof(unicode_t), NULL, NULL, NULL, NULL, 0, 0); @@ -154,12 +149,6 @@ udf_init(struct vfsconf *foo) udf_zone_ds = uma_zcreate("UDF Dirstream zone", sizeof(struct udf_dirstream), NULL, NULL, NULL, NULL, 0, 0); - if ((udf_zone_node == NULL) || (udf_zone_trans == NULL) || - (udf_zone_ds == NULL)) { - printf("Cannot create allocation zones.\n"); - return (ENOMEM); - } - return 0; } From nobody Thu May 2 13:26:48 2024 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 4VVZTj45mRz5JJfr; Thu, 2 May 2024 13:26: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 4VVZTj08Yjz49yw; Thu, 2 May 2024 13:26:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714656409; 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=HcH3TwMFSvHOfBYB1QCvh0T2vOHHVf9dnRMYngrZse8=; b=iOixDyo3IH9P07mF+Z60yqCbBKLw8i9ZEVBGBc+UKNAPCph8flvRZ6QH1uwcvPkMnTz7GH 2418AxkTjpWZzxO1gKzBdmLXNlA0tGPy0h2EqOn3ujkw9EsQveW/dI7W2PB+yZgZhOg62l tavr65Y3nbHthcYIqXkIqESZl1nnJ/syFnR5c2mJomtr5ZszN7qzdRG22Fqp4S4FCiYRpH 9NP3wTPgbqQhJ47OPp5JKNPoDnFOHtyLgB4fhfR6KZkq+H0rO3+pjdwkdjjQQlA9I4Og/K mAb+gDT02zqFOYjdmSGiyltq2IBQBkggSn4z2mBOKHF9VxCxiMYgFFAlHMGtSA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714656409; a=rsa-sha256; cv=none; b=vK3nA85O+OfNIThSn9dZVNlB8B38kT50Fu7Jnx6wf+/3qstXLXFvh2HjM7wDz10AjtSK12 sySRL64zfaoKq8MyiqffsdlDHAuZs1UoDOfvc1O9xusyryJku2jCrdGXX3QttIh6ioxvW5 Npt71Hol/8v0eaqdMUHcZdI+IaLGxw03b4K8udcvZ141OYzjnTYl0ht9YlFTsG1sjcncZx qs3sjRkQSnPIC0/spuCBoqlJQvc8O8JJmDmTDzveyLOQ+49nHG8b5tXRkFAZDJ5980Pfb9 oeuARg3T22zz4bQvaT1/wjFA6K1g+UXC0fktNdqICA0WPXyCs6J+f8s5uY0C/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=1714656409; 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=HcH3TwMFSvHOfBYB1QCvh0T2vOHHVf9dnRMYngrZse8=; b=hfN/lp170RPGrwsikedVJbJoW5m7t0ZtqB9uDItc8jFzY6g6RgmeDs5uug/eVPtQpZuqQj evS1lrGQV6aUBFtHMAy3YcPqZIBCEK02VZ17NnEnuGxKZL4JuAojmhjIq7DxdaWhm8naCG Z2AxdMWFNfgguXVE+rNhQEZlA/OYYLYK7Llpuog39mDNnuCs9hoySiWKEH3w85LLYWuyaV NbzlV5ZRlzvwARbdLSH4pM1vmGijk4pgGz5LoIRUDT8MVHIb2RafXW5HXwMBORzJExCVpt n4Cfhbz6RXzkavAL374l7Gm972Qw4vaCTTaFS4r2SMzfdR8a5UqJPWIvvKRyIg== 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 4VVZTh6tYMz14HR; Thu, 2 May 2024 13:26: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 442DQmsg080875; Thu, 2 May 2024 13:26:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 442DQml0080872; Thu, 2 May 2024 13:26:48 GMT (envelope-from git) Date: Thu, 2 May 2024 13:26:48 GMT Message-Id: <202405021326.442DQml0080872@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: 19e335596658 - stable/14 - kthread: Set *tdptr earlier in kproc_kthread_add() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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: 19e335596658bf1ced262f769a0ed2d72f847766 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=19e335596658bf1ced262f769a0ed2d72f847766 commit 19e335596658bf1ced262f769a0ed2d72f847766 Author: Mark Johnston AuthorDate: 2024-04-25 13:35:38 +0000 Commit: Mark Johnston CommitDate: 2024-05-02 13:25:10 +0000 kthread: Set *tdptr earlier in kproc_kthread_add() See commit ae77041e0714 ("kthread: Set *newtdp earlier in kthread_add1()") for details. That commit was incomplete since g_init()'s first call to kproc_kthread_add() will cause kproc_kthread_add() to take the `*procptr == NULL` branch, which avoids kthread_create(). To ensure that the thread pointer is initialized before the thread starts running, we have to start the kernel process with RFSTOPPED. We could perhaps go further and use RFSTOPPED only when tdptr != NULL, but it's probably better to have consistent behaviour. Reviewed by: olce, kib Reported by: syzbot+e91e798f3c088215ace6@syzkaller.appspotmail.com MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D44927 (cherry picked from commit d66399326cb4f89d1565fb62c1c07974886893c5) --- sys/kern/kern_kthread.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/sys/kern/kern_kthread.c b/sys/kern/kern_kthread.c index 9cbc74658432..00a264d57a21 100644 --- a/sys/kern/kern_kthread.c +++ b/sys/kern/kern_kthread.c @@ -496,13 +496,21 @@ kproc_kthread_add(void (*func)(void *), void *arg, struct thread *td; if (*procptr == NULL) { + /* + * Use RFSTOPPED to ensure that *tdptr is initialized before the + * thread starts running. + */ error = kproc_create(func, arg, - procptr, flags, pages, "%s", procname); + procptr, flags | RFSTOPPED, pages, "%s", procname); if (error) return (error); td = FIRST_THREAD_IN_PROC(*procptr); if (tdptr) *tdptr = td; + if ((flags & RFSTOPPED) == 0) { + thread_lock(td); + sched_add(td, SRQ_BORING); + } va_start(ap, fmt); vsnprintf(td->td_name, sizeof(td->td_name), fmt, ap); va_end(ap); From nobody Thu May 2 20:11:12 2024 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 4VVlSK0D37z5JyQy; Thu, 2 May 2024 20:11:13 +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 4VVlSJ6v9Zz4rsj; Thu, 2 May 2024 20:11:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714680673; 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=ikvFGuzg3IGsX3H6uR62jXovOyv4K6MwvhWX5Y65ojU=; b=axT/1y3h/6lCWKWUTgu/MQNpn8ed05A6S7aY7dq4992CyMVwF9QHdLMyDGmAm9rsDaG60q 2IfEF4r0+7dG5Zai+ph3DLsPaqOzoQ2mv3UbL400VE/lIftbEqNaIPgUnO5BclEgwCYObe N8VE+i5Udn48VWMqtYVWxKIFYEweRmjBnf40Z8zXut3RjHFcxiPs3hmnWV0d3LU5SjvFAM 34p2yoIWtCgpki0BGinn+AbJCTTJZlN6DOMrAGHOcIl5I+zqyN1mCeishYYlFW9GNrwFzT SphlLfbyf/xhf5L+3WUCQMe7h87sGBAj8mvA2HA2LgnCBAsduh9RyOdpcrQLaw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714680673; a=rsa-sha256; cv=none; b=YXHsYeTNPXFnx8gt9AoKQkuivTxG2QsQG7NxPdbVOar0Q5+7XDr9CLn91GKQBgPq+LnRVk +QIGmcUOXUYyUFjHWuLVFnXI/tQm/OBtfT7bw7ZbdeCdEEOYex6ZxtM3uq/JXoRypxTYd0 uzYt8BZfEEqmlKoIBjG9kotHnaKNTbVu+dRIx3FxFL9WC+OCMiCRJNaWdtkhMCJBRddGYb 8Q+UyaOp5ZmgMXYcn7MnMzmu/W8XRa7x+Vp1Jt3nLwq8zenD6GlnW/ir9rOoQQMu3aMQYI zxWzBPRPDb02TvgRcPDSoOSCTEfPfprEWXLYgv17enpu7cJD2xOUVUjp+CPXZg== 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=1714680673; 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=ikvFGuzg3IGsX3H6uR62jXovOyv4K6MwvhWX5Y65ojU=; b=aCZ5axIa/6pczVjiUnRS0Cqv0Na5VCoRWZGkbrvuX3Jmq3PI/0s43K+DLnHUd1B+HJyK2s nlb4m7uQCOsuqMI2Huz00PafL4CT6YL4JwpANxFKYap6QM/R2JXZV8RB0QEoHUc8U+4bG0 vuTSXEMgBJMsixN1eQkJk5Br8k6YyTSBUaVGjkcRuhZrkMbnqvTVn/a/02eWVj6DnP7UcF E8QFfUwR/PxvJrNFMu3yoOonGp2KZjyw7zd2QfKzzoZSRv8RcnY7BTTgDVJ5o0354uB6oy 29HeEnKVqyMSFwlwm2tGSTftclQhvvrIa+Nk5axyQkUMgl8Kk1AERwSgXYShhg== 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 4VVlSJ6VjtzH17; Thu, 2 May 2024 20:11:12 +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 442KBCpn069875; Thu, 2 May 2024 20:11:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 442KBC3l069872; Thu, 2 May 2024 20:11:12 GMT (envelope-from git) Date: Thu, 2 May 2024 20:11:12 GMT Message-Id: <202405022011.442KBC3l069872@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: 9bfc9ea2e18e - stable/14 - mandoc: fix bootstrapping on Linux with Clang 16 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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: 9bfc9ea2e18eed1067e5d99dc5fce368b9dfc993 Auto-Submitted: auto-generated The branch stable/14 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=9bfc9ea2e18eed1067e5d99dc5fce368b9dfc993 commit 9bfc9ea2e18eed1067e5d99dc5fce368b9dfc993 Author: Alex Richardson AuthorDate: 2023-12-12 05:08:38 +0000 Commit: Jessica Clarke CommitDate: 2024-05-02 20:10:13 +0000 mandoc: fix bootstrapping on Linux with Clang 16 It appears that Clang 16 errors by default for the mismatched function pointer types that are triggered by the fts callback (since glibc has a callback type without the second const qualifier). Fortunately, there is already code to handle glibc inside mandoc, we just have to edit the checked-in config.h. Reviewed By: imp, emaste Differential Revision: https://reviews.freebsd.org/D42999 (cherry picked from commit 0156465c6d11e1ef064d104443047e4146e5b925) --- contrib/mandoc/config.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/contrib/mandoc/config.h b/contrib/mandoc/config.h index 553c4c8b7400..213513f1c87e 100644 --- a/contrib/mandoc/config.h +++ b/contrib/mandoc/config.h @@ -13,7 +13,11 @@ #define HAVE_ENDIAN 0 #define HAVE_ERR 1 #define HAVE_FTS 1 +#ifdef __GLIBC__ +#define HAVE_FTS_COMPARE_CONST 0 +#else #define HAVE_FTS_COMPARE_CONST 1 +#endif #define HAVE_GETLINE 1 #define HAVE_GETSUBOPT 1 #define HAVE_ISBLANK 1 From nobody Thu May 2 20:11:13 2024 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 4VVlSL1MCrz5JyFb; Thu, 2 May 2024 20:11: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 4VVlSL0r6Lz4rwG; Thu, 2 May 2024 20:11:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714680674; 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=kC8xJ0OrfSMeLSZ/1ev0pYEP9ARTVre64euptPzYUnQ=; b=quO1gwwQM2gpD8ffykqybGj9Aeo5DHOpPA8Fsps5Lc8FYKWbAyxhLWuw7LBwXF4vIeIRS6 BbZXnXFsCWG7pptPFodf14h/8NA4ptlt0rO5wXE0Vod4z6ni70Ms10Oraq9Y0uwmo7I++d YiPwfJyUHZR3aRqmY6hMRhLF+5opdvppohfb0v9+cfvyP5yBjZ7CHNYp7zOZ+EcksIz+nZ M15xaqYo0rY6W7L6Uf0ogdU5wAr8UkWNZdKSHixVrq/7MfN8tX556QhfYdMj/DDVvRjzSu +u4EIsQJFGqwbwwkUuHsXf6cebWd5S8KqmRFB8jb2qnaaDRRp8iAbo2T9DFbNA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714680674; a=rsa-sha256; cv=none; b=P6E7NuoDGdwZ0VCLyjga4FAbo8evR3YswMbt7Q3baP3m81AWfcTZ7fnlBq8t2guTvg6qC2 U/Y7PXPn/i+/wWN5vaQLc+Xm8oNpG4onICFLIdyo7lQSBd9VySJ2dDi+sWhlwxEV9cuLi2 nrM93VZ2L6jyGEFpeWodij3qOJdoFck0eSLV0HCmTnze+K8TxoCfhTdjaBH2Qh+p0ov0dZ 0PHIWdad0v5f0I1K7EANRcvteqRjg49JqdNApeLst+qu2SfCPkwZ7ht/z+4hPsvPjaxh/5 8yRNOMuDX4meBLGHeKd/zlb0C0fA0bQcnZSpPCVCHdys17gQPckKaKiwHBPB6g== 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=1714680674; 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=kC8xJ0OrfSMeLSZ/1ev0pYEP9ARTVre64euptPzYUnQ=; b=NMiCZ80+UcK1Dd9qzEqQAK7GeXS9T5K45StQELrlk0Z7Ra0jomtbnLlzb7RExPpKDNVWEi LK9UsiMjgznnn1kUool9hGX0YgnJCpz+3hkSIbgO7GFrxjvQkflxxkDwLY0dGuwcOQDfYl hV/JFS4zwf0ihgsEBuuxpGTWjHRXAXQjC8T1uXepBoBCzRWH3IFfIMVQJoLQR6Uo9PGmXR x9BqrzWSD0ytjchMyWABk1RVmH1c5fxbgOKTPQf4sGXJO86+v8pkNj352p6mH+h4tqE3De r7WZm9pYSPDjxPrCh2GVKIG1RyY0BgNGkkQ3bHqEBpQO348w82gt2RxLg7GFjg== 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 4VVlSL0QcBzGxW; Thu, 2 May 2024 20:11: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 442KBD7e069930; Thu, 2 May 2024 20:11:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 442KBDWR069927; Thu, 2 May 2024 20:11:13 GMT (envelope-from git) Date: Thu, 2 May 2024 20:11:13 GMT Message-Id: <202405022011.442KBDWR069927@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: 8cb8aca83f6c - stable/14 - jevents: fix bootstrapping on Linux with Clang 16 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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: 8cb8aca83f6c3d5a28910c1dc66861232e6ccada Auto-Submitted: auto-generated The branch stable/14 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=8cb8aca83f6c3d5a28910c1dc66861232e6ccada commit 8cb8aca83f6c3d5a28910c1dc66861232e6ccada Author: Alex Richardson AuthorDate: 2023-12-12 05:10:14 +0000 Commit: Jessica Clarke CommitDate: 2024-05-02 20:10:13 +0000 jevents: fix bootstrapping on Linux with Clang 16 The glibc fts_open() callback type does not have the second const qualifier and it appears that Clang 16 errors by default for mismatched function pointer types. Add an ifdef to handle this case. Reviewed By: imp, emaste Differential Revision: https://reviews.freebsd.org/D43000 (cherry picked from commit 60e845ceef25533bfb60450549bea56a17b1e467) --- lib/libpmc/pmu-events/jevents.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/libpmc/pmu-events/jevents.c b/lib/libpmc/pmu-events/jevents.c index ff7d3b226932..590b465af400 100644 --- a/lib/libpmc/pmu-events/jevents.c +++ b/lib/libpmc/pmu-events/jevents.c @@ -1355,7 +1355,11 @@ err_out: #include static int +#ifdef __GLIBC__ +fts_compare(const FTSENT **a, const FTSENT **b) +#else fts_compare(const FTSENT * const *a, const FTSENT * const *b) +#endif { return (strcmp((*a)->fts_name, (*b)->fts_name)); } From nobody Thu May 2 20:11:15 2024 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 4VVlSM5264z5JyNS; Thu, 2 May 2024 20:11: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 4VVlSM1zsjz4rwT; Thu, 2 May 2024 20:11:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714680675; 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=8U1BPAtePnq48nsD6lu3ZaZPJicgL/g6HlGWkgfZrBU=; b=mF94Pvi0H9Qj7SHQYeZRPXGPcPZjh3ZhX0pZhmyL2FBHRkzGhxzPYDEIdjEjrjimRCiBLD wf9nBtZeBpepbjjk+CQYIxhY9W7Y7u+jyn383jEqp6aw5NsYj6/ajOu1MLgaIJFxlnP4sn hmqYo0d/VtbsnMFCJtQd5Qnv2JtfGi2wryBEpplVSk5QHdGSm8EDoBh/ElDfSjyOxHsbss 8hklkfyVCzMx5bjn0lIBFtKYpK7EEKjWte3g2M7EiwcqkYqNhPichMkWIgY32wryoQXngS cg1uT6ZnbYu7Wm0FThV9Ppfo8hhsZZCYe5nS9ANTsqAMYXyiLfF8Ic4PTtuVyA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714680675; a=rsa-sha256; cv=none; b=LLiftOwgiQdtF8fxRHoQ79DmxLqvcY85+FSRpEUBfoIk30s12aFN0TUzf7siqbntz2k7je 5kaViLsS7BKw7fdAxkvpBSzoZIeAZDkjw3Ni8rWbLYx8ElyUNU4KlcjZzyBkGsLN//ectu gF3pRw8uArcKT2V/uoktYA5Vm4gXE0InO9AK42wn4/nbc8Hb1RljY3MswI2J2Ptq2zBUzr 77BRrXUmwG/uLiC/I+88SZmqKFB15+Nk8b5ju4goqpwh+T+5bno/Tj8KsH/wfHc4Zexy0X qIf8zfdbZZ8RSMP7x2QYuP7dmlUnTh8py7wH478RGZHatO19nVqxM30DhgPBJQ== 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=1714680675; 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=8U1BPAtePnq48nsD6lu3ZaZPJicgL/g6HlGWkgfZrBU=; b=rimS26BuEXp+TPXjJzC8LiOzxTDcrxEwN8+oSAwNFI4bqyGLb+3786zt1tM5PsR+KyYEbu I6I7wE9xUNNLMOzj+xjG+5ViOw//m4pFiQhLuO4Ity1xNPE0HVl60ZTEB9b3v0273g/oMB W7wNB81801brba7+o5Kp7wufj0UjnFFNCXgUCD9UoHZ1dH/lLHrVH107eqEXs1v2wv7/gK XzK7+IGn/aE4CWc2M6XelW6glpcfKnojqLBT7VOGhhgmRsYCBvEpO1tEugvU4jDVniFdzA H90wGY28I1SYD/8otih157Nkb5blR+ET2Eiu2SWdiUldnD4zPtQ5exh3eECPJQ== 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 4VVlSM1MhKzH19; Thu, 2 May 2024 20:11: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 442KBFs1069994; Thu, 2 May 2024 20:11:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 442KBFcH069991; Thu, 2 May 2024 20:11:15 GMT (envelope-from git) Date: Thu, 2 May 2024 20:11:15 GMT Message-Id: <202405022011.442KBFcH069991@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: ef6935581e62 - stable/14 - mandoc: Fix bootstrapping on macOS with Clang 16 / Apple Clang 15 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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: ef6935581e6294b2728a493aee5a30101a90bea2 Auto-Submitted: auto-generated The branch stable/14 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=ef6935581e6294b2728a493aee5a30101a90bea2 commit ef6935581e6294b2728a493aee5a30101a90bea2 Author: Jessica Clarke AuthorDate: 2024-03-16 01:50:20 +0000 Commit: Jessica Clarke CommitDate: 2024-05-02 20:10:13 +0000 mandoc: Fix bootstrapping on macOS with Clang 16 / Apple Clang 15 macOS, like Linux, does not include an outer const qualifier for its fts_open callback arguments, so -Wincompatible-function-pointer-types also picks this up and breaks the build now Clang 16 makes it an error by default. Extend the existing Linux support to fix this. MFC after: 1 week (cherry picked from commit ce312ef72d91888d332f7f042298001794b66914) --- contrib/mandoc/config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/mandoc/config.h b/contrib/mandoc/config.h index 213513f1c87e..91957717b3fc 100644 --- a/contrib/mandoc/config.h +++ b/contrib/mandoc/config.h @@ -13,7 +13,7 @@ #define HAVE_ENDIAN 0 #define HAVE_ERR 1 #define HAVE_FTS 1 -#ifdef __GLIBC__ +#if defined(__GLIBC__) || defined(__APPLE__) #define HAVE_FTS_COMPARE_CONST 0 #else #define HAVE_FTS_COMPARE_CONST 1 From nobody Thu May 2 20:11:16 2024 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 4VVlSN4fL8z5JyNW; Thu, 2 May 2024 20:11: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 4VVlSN2sPQz4sBp; Thu, 2 May 2024 20:11:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714680676; 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=rMt+mlN3JNonQLGu07uNUQ7KSLgp8+O4caHUfkFE0ck=; b=Vg6v+sRUM4/aLSMoNwKdAcDuy/qtS+zTc/hT5N/b4z53xdj3C43GxOGcX928crBIPoP/Xh BTm50DN/A171vdE4cCBn6+WgQGyJvjGCOni3wVHjQ011AEElvuwGjs6lWHnQhruF9IFWrn RfFuHqiMAIu97GwlBtALFky1xIgAsNSP9gi1pPTwnRiusZ+2YDBVKRM2kyBIQ5OW7Urrlk Zoc+X77SzOI+jMO09tMuNavpWvXDTDjJKO5fQeW/VVqg2aWlBpmm1rniugdnrd6cMERQDK lFw9Ir7u3QBokWLhyNwf4GhFzvxbyxksz92cIiTnAAJnx1pUzxRYkHYaoSM4kg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714680676; a=rsa-sha256; cv=none; b=Luz1c31p6ke1aARmOhEqsm8wnlSUsoOZTat3aUBPmrTXcuAYMZGoSI2EWmAnXzUkP2jHSB ZkzFIaHn2y72ddt7FKMTlFS3SfFH/BKt4uSObTixa2XBI9sNqDXccPrIzqPRfFmGFSR1uB qNHrhqQg0GUf2CW128P3JozTYBx9zFXaBS8kyZB7E0oQniPibuHX9DyeYQoPi8JkeEZZTc 7GsCBTMeeDlMsxFRkiUT93WjxosU5PltGQtDuix0IqrsG7x6wVyHAlbP39CLsjnve7AGbw c2Iqen3TKcWz4OZVx2x1jz5pHQ6IauhbeUFBIaHN6PF/7RD7vxvrYP1c0N2rWA== 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=1714680676; 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=rMt+mlN3JNonQLGu07uNUQ7KSLgp8+O4caHUfkFE0ck=; b=N00ZwtvwA7OCP6Ps8tyOQjQibupy/kMhInM3ufh2a7tigd0HzFzO6qLn7LnvdqXxkVothB 7sUUYiyxeNpO5+Nkj/NJEkyJwLUU5dkQsRqrM8VJQf8efjjwvao3BBc1b4Eg3aYiL2Wcon GRdiKvpob3i7Ow/evz+/6caxw0gY8qkyg90K7ykO6IKIxXF2O9tTrh60ibA/cVj87dgof6 h5hfXjYQdaKTrhIHcQn4RDNisfakA9OTsyqOvgyQgJ5/3WrJNKvg9nDivq0efHKtQWOmw+ eKs9UJKidZpcvcS1o/WbNMByE/dNthbZn55XqBpS5uGnsVt/GZLMGx95hgXPMA== 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 4VVlSN2TlWzGrd; Thu, 2 May 2024 20:11: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 442KBGH9070061; Thu, 2 May 2024 20:11:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 442KBGIi070058; Thu, 2 May 2024 20:11:16 GMT (envelope-from git) Date: Thu, 2 May 2024 20:11:16 GMT Message-Id: <202405022011.442KBGIi070058@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: 9019baf667c7 - stable/14 - jevents: Fix bootstrapping on macOS with Clang 16 / Apple Clang 15 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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: 9019baf667c77a85ae3e23bac127a3e99411b401 Auto-Submitted: auto-generated The branch stable/14 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=9019baf667c77a85ae3e23bac127a3e99411b401 commit 9019baf667c77a85ae3e23bac127a3e99411b401 Author: Jessica Clarke AuthorDate: 2024-03-16 01:50:20 +0000 Commit: Jessica Clarke CommitDate: 2024-05-02 20:10:13 +0000 jevents: Fix bootstrapping on macOS with Clang 16 / Apple Clang 15 macOS, like Linux, does not include an outer const qualifier for its fts_open callback arguments, so -Wincompatible-function-pointer-types also picks this up and breaks the build now Clang 16 makes it an error by default. Extend the existing Linux support to fix this. MFC after: 1 week (cherry picked from commit d8c84215d7675b7940412122b6d7026bd193c9b5) --- lib/libpmc/pmu-events/jevents.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libpmc/pmu-events/jevents.c b/lib/libpmc/pmu-events/jevents.c index 590b465af400..7059b31da2ba 100644 --- a/lib/libpmc/pmu-events/jevents.c +++ b/lib/libpmc/pmu-events/jevents.c @@ -1355,7 +1355,7 @@ err_out: #include static int -#ifdef __GLIBC__ +#if defined(__GLIBC__) || defined(__APPLE__) fts_compare(const FTSENT **a, const FTSENT **b) #else fts_compare(const FTSENT * const *a, const FTSENT * const *b) From nobody Thu May 2 20:11:17 2024 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 4VVlSS02b5z5JyWd; Thu, 2 May 2024 20:11: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 4VVlSP48GVz4s94; Thu, 2 May 2024 20:11:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714680677; 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=gMmfQjfLg3BBUi1yoDUkqMmmzdB0rrR3Nw6l1gIBfeQ=; b=xiJi0ItS6V7m/bSglpGoAHExOalKtnEwtV/AlqU2mNGOG9muR/oYgrOdnhttIY0Hv1jDsf tF3WIyZhQCMyz9+VHGop9v6z7S8C6O/VwJdK/8IMd4+qCPB42RsKgts4aNI8nATUrGVtbd GsLIFUI4FIDfrOC16dpn8PpwXsB9NCri8aSfE6x3vT61AyXNyfvUviiSMZN3WqvlngTvUg 8WMaoMsXu0fC4IrGsOwY72LC0GQIcTHTJiiQozheo3VoabdYSKEXr8w3dKZBy/W60QrFp8 vZTcUXRNhTHUPWhxHoYYUrV9WB9Fz9A47+aVO3CfJieNkr9vN4VcAzeKYx7/Nw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714680677; a=rsa-sha256; cv=none; b=oZNx8gwwTARFPXSnxKYK8qECMd9McJj7kGu2sk2quhMJgeZw7ZM2MVH0J9fQp/efUNkwC8 nzXgyYOdwgCVFrbhWzEJZGSzDl5rAWS8DKsV0ZIuDJ5KcH0Hp6VgK13Zp/7Q+oVKalEyZ9 dUGo3TGA5/p9/2Dj0ANW5N1K+z1PVsizBgMR08YUpX2THMyMVAOu0vpcg508WptCohE/gi TWm/9S037t9u1D5qToXwCU8S3SWf5dyAnSsaOFTFPiGY4bBx8zu/sJjTOgw750SQQxNS6z N6T7Uqs6uCpvYMEbR+SgPTbIKuo8sCzT2JU9JCV6PQ/yTI7vBgZELZj5rgy6rQ== 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=1714680677; 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=gMmfQjfLg3BBUi1yoDUkqMmmzdB0rrR3Nw6l1gIBfeQ=; b=oCcpoiUvl6JrRSX1fUwmrqbn6szI5HI0m7gGg0cBZz00hdDZ7fRGqRpMv3noMd9q5FGnv+ dv4oKhnqPCLEHeIJZ/ha68egmO1cVh4xwwsj4wO3ftVLf6i1lbSObPDs1s3yR+qZFcvb+S viZNgsgAS2sxxIfYSoz/PkSlxQI+epGak6bBjz+Cr5o5qsBULpWHfUaWaIOGI+QtUOqTN0 tmDHtAU+wCnHniOx1rDjzWBWCA7M+HHWnTwIYZAM12tf2US+dfw/mb6uHx3jtZoj9mxXTP ab8hQJkrgnmlwIOXTGRWdRe8BwzBToEz9XyVPU1Ml7VsGg8P/w5e+g3CgoppDg== 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 4VVlSP3XBwzGxX; Thu, 2 May 2024 20:11: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 442KBH1Y070126; Thu, 2 May 2024 20:11:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 442KBHtL070123; Thu, 2 May 2024 20:11:17 GMT (envelope-from git) Date: Thu, 2 May 2024 20:11:17 GMT Message-Id: <202405022011.442KBHtL070123@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: b2d59a3afb7c - stable/14 - kldxref: Fix bootstrapping on macOS with Clang 16 / Apple Clang 15 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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: b2d59a3afb7c3734eed7fa5a809d1326f096f80c Auto-Submitted: auto-generated The branch stable/14 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=b2d59a3afb7c3734eed7fa5a809d1326f096f80c commit b2d59a3afb7c3734eed7fa5a809d1326f096f80c Author: Jessica Clarke AuthorDate: 2024-03-16 01:50:21 +0000 Commit: Jessica Clarke CommitDate: 2024-05-02 20:10:13 +0000 kldxref: Fix bootstrapping on macOS with Clang 16 / Apple Clang 15 macOS, like Linux, does not include an outer const qualifier for its fts_open callback arguments, so -Wincompatible-function-pointer-types also picks this up and breaks the build now Clang 16 makes it an error by default. Extend the existing Linux support to fix this. MFC after: 1 week (cherry picked from commit 75464941dc17876af2e99ea90c687bd7df873d73) --- usr.sbin/kldxref/kldxref.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/kldxref/kldxref.c b/usr.sbin/kldxref/kldxref.c index 1694f069564b..38f4e87f6ed9 100644 --- a/usr.sbin/kldxref/kldxref.c +++ b/usr.sbin/kldxref/kldxref.c @@ -748,7 +748,7 @@ usage(void) } static int -#ifdef __GLIBC__ +#if defined(__GLIBC__) || defined(__APPLE__) compare(const FTSENT **a, const FTSENT **b) #else compare(const FTSENT *const *a, const FTSENT *const *b) From nobody Thu May 2 20:12:10 2024 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 4VVlTQ1yKHz5JyL1; Thu, 2 May 2024 20:12:10 +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 4VVlTQ1Vdnz4tJ6; Thu, 2 May 2024 20:12:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714680730; 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=g7UwjwY+/3SDLNzfwnwtex9AFT8lz/kRACoA6VbR++8=; b=o6A+0qg12TwZngT5M0dzOh8XwZLGl9g4v4A44+chpNwG6B6VdMfud6p56BA7ab1yOe5Dc4 MpuJxGjgaxBL+CWqSg8dw0RrZ7UOPP+iKdAlrTBvrs3qZF85u1nISjspP1IL3nv1zNvHZd kwS0rlyd6bxTVJxBsImpgqJfI3AfTr8kobyqYhnTNXvw8uQKMfi5rv6hPEbU9hQEdB+8LF bU1YgckIeiPEvGByfTvmz3mSfqCFOzi/hPXTwrmYOG+xyJCHAiZ8zSENbQrKQsCQSfBToz LIYtQXTOBeQjCUOaXgqYSdufLbkgFPzBcQ8nkUrOqsR/N3yG/W/tVsVjA193yg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714680730; a=rsa-sha256; cv=none; b=x7mbb+qia/PUB8K2hanG93fsbOE+zsUmBmCB7DmUD46cM17XllrpXX0li536CQyCinUEJv ZKx27vDhxjZ6/m27I7q8fPQOOpcaqwf+/RHm5b4UYo/MBagT310t+MzEViltRQBHsOXj/m gxyj+s+SZnRlSC6FrAa0t7GCqfMVT8QditCMb9enqH/7cukpLKzLTytXwc/RXH7v7pZ5vF /aoiAeRSCwrhrg7ZTuTCh3Q3KlVKDPeef6oEGXz17oEjp7S+Kt09HKokJ2cHMp1G4CCgPk rZ8c0QZGtxfDA6+Oq0OL9u4n9bBOAwOgIF95RJ0c/f1H1HNjkl5JmqW0AE7n7w== 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=1714680730; 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=g7UwjwY+/3SDLNzfwnwtex9AFT8lz/kRACoA6VbR++8=; b=QkVlyegRvc1P+WbeYDspoiW9IrAQ3XO7pRt0gxXyCi8QZvGm76pEc36tt5elhosNgcESbz XH2+PO6VjV9b4yPLu4APCc5MlI7tGmoG+RufA1ekh82+xkQav4uGtCPRSvXOJMTFVw9kWc CV0GdfzTAojQg7MuIKRLCeyh5g39fl7OlH3Pgs4aj0C+yNXqCu9e2zPt/wefIz3wA5KLDI rbcn1+FUVV0w9InXoqYjtuBWlfoy0lOam2YVgwaSTi3BIHFd3vh+80Zormyv1iyybyrOKG NtaEgavKR/bdyopLjsOAUJ7nOe7FBeUrZ14gOLBmmGHjB2yHvkWCSefjExlbVw== 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 4VVlTQ16FBzHCc; Thu, 2 May 2024 20:12:10 +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 442KCAdw072339; Thu, 2 May 2024 20:12:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 442KCA0n072336; Thu, 2 May 2024 20:12:10 GMT (envelope-from git) Date: Thu, 2 May 2024 20:12:10 GMT Message-Id: <202405022012.442KCA0n072336@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: dbbbe6f393dd - stable/13 - mandoc: fix bootstrapping on Linux with Clang 16 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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: dbbbe6f393ddc1a6366bc3a24bc9c358b9eb9732 Auto-Submitted: auto-generated The branch stable/13 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=dbbbe6f393ddc1a6366bc3a24bc9c358b9eb9732 commit dbbbe6f393ddc1a6366bc3a24bc9c358b9eb9732 Author: Alex Richardson AuthorDate: 2023-12-12 05:08:38 +0000 Commit: Jessica Clarke CommitDate: 2024-05-02 20:11:52 +0000 mandoc: fix bootstrapping on Linux with Clang 16 It appears that Clang 16 errors by default for the mismatched function pointer types that are triggered by the fts callback (since glibc has a callback type without the second const qualifier). Fortunately, there is already code to handle glibc inside mandoc, we just have to edit the checked-in config.h. Reviewed By: imp, emaste Differential Revision: https://reviews.freebsd.org/D42999 (cherry picked from commit 0156465c6d11e1ef064d104443047e4146e5b925) --- contrib/mandoc/config.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/contrib/mandoc/config.h b/contrib/mandoc/config.h index 553c4c8b7400..213513f1c87e 100644 --- a/contrib/mandoc/config.h +++ b/contrib/mandoc/config.h @@ -13,7 +13,11 @@ #define HAVE_ENDIAN 0 #define HAVE_ERR 1 #define HAVE_FTS 1 +#ifdef __GLIBC__ +#define HAVE_FTS_COMPARE_CONST 0 +#else #define HAVE_FTS_COMPARE_CONST 1 +#endif #define HAVE_GETLINE 1 #define HAVE_GETSUBOPT 1 #define HAVE_ISBLANK 1 From nobody Thu May 2 20:12:11 2024 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 4VVlTR2mGVz5JyL3; Thu, 2 May 2024 20:12:11 +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 4VVlTR2Dspz4tG9; Thu, 2 May 2024 20:12:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714680731; 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=O3+t3LcCec4bwFdhBOWbWpvABZMdSiyzdrV6wOrhe8w=; b=P/GCKUC2OCScG6IsEcyF/TWseMDjnQS74mqdnnwbbkLTN2W/lQgnbwI0uCPcYmkuuPTkqP 51Ls3XnasT6O4silIGua93Kk133JJiGR2bZK1BbnS+mBcZO5ziW9kyQuWU01tQgc9U/lQr SIpJczvyHF2goegxrmJ7rQzqKGmram2AusrPt1GZN+lrS1pU3+PGNaEreqbF9Ssc2t6hMR tQHoy3gsH4DszfD4hnG4CBL998Gt+GUCFm/1DeO8JoKC8B1Dy12xbXI59Hp1eN4DF6umU3 LLNdHDt1xr0e0Y7oF/5RMiBqDp3tYsjjqlYGcqDD6k2+QIH37YVafTnrnmql9g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714680731; a=rsa-sha256; cv=none; b=PBwquleL8P5ZDWqCNAmVROjXpN0DrvHFrNbZJ5aOgFVRfZWR+bGBPv0qn60f210eTV8472 j/IF5HLXSzk8ZTOIgaqx716TBW698uxYWuMCSSZTajOshaC2Bt8dze8PfyH8SyKKlCsB5/ sEwYdvtihj3x6P9fy0GVqPN+n6i2WdcIAdOhLRblfBsRiUl/mz0Olbx+OAF358o6yhu7Pt RM1elqqbMm+IPyqCuk0ig+6I3dShtkVD05SadkVNaq1C5o71xlsorF3FdUWmcU8tMdhE7F pjxA0tWm2v5dEjDcPvXFs3HsDz9LjvHe+yRQj9mVdXZrifMWTxOmKR+vcJxyMQ== 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=1714680731; 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=O3+t3LcCec4bwFdhBOWbWpvABZMdSiyzdrV6wOrhe8w=; b=PwzB5JN1mScGrVLPboAvefAfXTBi/8H+dBPskopzN4cnv31fJVFYn1FDq+hXmc3MmC0z89 7BPM8DaCsNRf5Vg1/cxTJuoSUBx338rNQ51EfMlBjWmU0RITcPi3MwEyDoExflMtBr5eLT wHf7J6rCR+6wkjEsmKVS8O39UT6Y+C/6lorg0fNeZ3dxVWBII8w7cKjxPt1X/R0C0GyzuX /fKc8k9lhWDgJa4ZRu1XUdF9h3k2A4EZB985TwlqU5wiO4+nx74ViaFPfnpnA1lnE+4nR0 hYrE63z2w8BsumCxPh8aOMYaoagcwRKTArNpZEsBztQLqq2/oPQfqim8GOSHkA== 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 4VVlTR1qsYzH6F; Thu, 2 May 2024 20:12:11 +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 442KCBk7072390; Thu, 2 May 2024 20:12:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 442KCBWo072387; Thu, 2 May 2024 20:12:11 GMT (envelope-from git) Date: Thu, 2 May 2024 20:12:11 GMT Message-Id: <202405022012.442KCBWo072387@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: f16e205c6fb9 - stable/13 - jevents: fix bootstrapping on Linux with Clang 16 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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: f16e205c6fb913b4bca4495bde46a1bdf6339a8c Auto-Submitted: auto-generated The branch stable/13 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=f16e205c6fb913b4bca4495bde46a1bdf6339a8c commit f16e205c6fb913b4bca4495bde46a1bdf6339a8c Author: Alex Richardson AuthorDate: 2023-12-12 05:10:14 +0000 Commit: Jessica Clarke CommitDate: 2024-05-02 20:11:52 +0000 jevents: fix bootstrapping on Linux with Clang 16 The glibc fts_open() callback type does not have the second const qualifier and it appears that Clang 16 errors by default for mismatched function pointer types. Add an ifdef to handle this case. Reviewed By: imp, emaste Differential Revision: https://reviews.freebsd.org/D43000 (cherry picked from commit 60e845ceef25533bfb60450549bea56a17b1e467) --- lib/libpmc/pmu-events/jevents.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/libpmc/pmu-events/jevents.c b/lib/libpmc/pmu-events/jevents.c index ff7d3b226932..590b465af400 100644 --- a/lib/libpmc/pmu-events/jevents.c +++ b/lib/libpmc/pmu-events/jevents.c @@ -1355,7 +1355,11 @@ err_out: #include static int +#ifdef __GLIBC__ +fts_compare(const FTSENT **a, const FTSENT **b) +#else fts_compare(const FTSENT * const *a, const FTSENT * const *b) +#endif { return (strcmp((*a)->fts_name, (*b)->fts_name)); } From nobody Thu May 2 20:12:12 2024 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 4VVlTS5r9Fz5JyTG; Thu, 2 May 2024 20:12:12 +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 4VVlTS3cKMz4tRM; Thu, 2 May 2024 20:12:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714680732; 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=teBKT1laUmFl40+Up0SAB05M4MSQF38R1mIBlbu7BPA=; b=pPslw0kDOUuwL720gJgdso8E+kokvccv5+WrrtxgUTUjnmTwrDTj1TqLSagycPdwrTDHJU DWsXISG8nsGKvXF9yoZkU3yirH4sIWhXwMlM/i5DuBDluWH05bw2gN4L2gM86dPIAQOzg0 Dyk2a09lGts/+XHVw6NrRt7Lx83VAFnqbXbh/MQKQFAsmhLntBeZDNnsQrPYnXgsDNYDq0 VFwaevWVjOnIKRj3Gsd5kVmPSmHKFlngCaF63B4lCjnRqAjO0DYGh0Y+po3vMTVB91KGGc TGHGoaboeh0bjU4YKPkMdM7lUoJ5daJvmpwrk5pAW4LpHcWzL/1g19EUXTk8Lw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714680732; a=rsa-sha256; cv=none; b=sZLVTW1KWOtPUl9ecXypS8xSE8muJaRlomNa54edluyBTnM6GskTCD0gACRP5h0HNRYouO lea4urslsprRVQ4qTEDGOK3ho5jtOZFdBMsXvxEl7iVZK9e4tVr3czbVSmErdQFsaXnaHS iUqMHIRHSvD4H0UBzQdkguo7KgQbPay5Lo+ztf8q8zeyvnwcvKLq2gXjnwOhhqTSUZI36x q0AXwI+QX5CRqRxRGsDJPT+/OykRA0FMiAxNqETynqWjGQGfeskd7WNWtAclHUgfsspBNd 0seYLsgTSJzHJ5ShYvqq7LwrXS50odygKD0+y0/b+yGvZ/UEj/KpnM+N0Fe37Q== 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=1714680732; 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=teBKT1laUmFl40+Up0SAB05M4MSQF38R1mIBlbu7BPA=; b=OzYB9pBquS88Bd1rXbvb75vwl/elUAFn0xNkZE9UIvNaS6NVJWWQh+uZEh9bSn7tgbguev PSa6hHdd7ae8b7NJAUuqeDcJq6M+blAHEecnenzaKc78sSx3HzqcGAHoDQkf1CY2Spf8WZ PDoojIvCZKGhYuZQ4+R7ViwaPwx1VBhQgeTWmnSua2LdBWyTlMXVj/446fFa34CJKibqBk rz0hoJ6sKaf1+v5hMehO0KPGtFTpSCU8niiEuov5k4YG+vKKdTy7zVakJaSbXPCJrr5Eyi 5lobwOH04Lgre72ONgJo/NCsAbr/bCvhDl7ZnDpjhtIrdDyL4NoV8PCM7JZMyQ== 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 4VVlTS3Bw2zGxv; Thu, 2 May 2024 20:12:12 +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 442KCCWk072453; Thu, 2 May 2024 20:12:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 442KCCKk072450; Thu, 2 May 2024 20:12:12 GMT (envelope-from git) Date: Thu, 2 May 2024 20:12:12 GMT Message-Id: <202405022012.442KCCKk072450@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: 2714c4d3280b - stable/13 - mandoc: Fix bootstrapping on macOS with Clang 16 / Apple Clang 15 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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: 2714c4d3280b7b4609706e59b82bd9df64b37561 Auto-Submitted: auto-generated The branch stable/13 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=2714c4d3280b7b4609706e59b82bd9df64b37561 commit 2714c4d3280b7b4609706e59b82bd9df64b37561 Author: Jessica Clarke AuthorDate: 2024-03-16 01:50:20 +0000 Commit: Jessica Clarke CommitDate: 2024-05-02 20:11:52 +0000 mandoc: Fix bootstrapping on macOS with Clang 16 / Apple Clang 15 macOS, like Linux, does not include an outer const qualifier for its fts_open callback arguments, so -Wincompatible-function-pointer-types also picks this up and breaks the build now Clang 16 makes it an error by default. Extend the existing Linux support to fix this. MFC after: 1 week (cherry picked from commit ce312ef72d91888d332f7f042298001794b66914) --- contrib/mandoc/config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/mandoc/config.h b/contrib/mandoc/config.h index 213513f1c87e..91957717b3fc 100644 --- a/contrib/mandoc/config.h +++ b/contrib/mandoc/config.h @@ -13,7 +13,7 @@ #define HAVE_ENDIAN 0 #define HAVE_ERR 1 #define HAVE_FTS 1 -#ifdef __GLIBC__ +#if defined(__GLIBC__) || defined(__APPLE__) #define HAVE_FTS_COMPARE_CONST 0 #else #define HAVE_FTS_COMPARE_CONST 1 From nobody Thu May 2 20:12:13 2024 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 4VVlTT6HTHz5JyNm; Thu, 2 May 2024 20:12:13 +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 4VVlTT4z8nz4tMR; Thu, 2 May 2024 20:12:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714680733; 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=IIy61CACIbM7jhfLa1JxDShzTqEe24a6ATg8IG1/Ck8=; b=JEAsvL0rpABsaY0r/FH49CU2nzd4oHYy9lJchK5bAechSijeCTIB9DqjmAmaMzjRkvelEb eoihOn7RcoyzTrutnOmFj8iNBnVpmaz33tDINbgCvoQvFc4urMJrvK3RteeLw5MGIiTx6W aPASfliEvPnJPVKxBuUAkZDdvrPuhg4ZIsFwaxZtrg4rL9Yx5WWxByz9DWLhOzI1mQ7Hkw vinUikTI4rObpoa8oYtQJ92sOjx2C7nwg31rboBbUH2YBj5NNvIX0Lp/qZr3bnZMnY5jde IAZPoSTRWX47qkYNNy83quUQN3e8C68pDKrVOy9UeVatnSL1jgDj59dHnp5K/g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714680733; a=rsa-sha256; cv=none; b=ZSSd+JTEtpJQiDEhesDtsQ2eCY5RwnP7shica6NjQ1uVTw+I6aVNyu+AZ4VF7U1/cfRMr9 hEQZUQ7ZcQhs6HfN19cMj0glKOx7JfbCR7akR6dh8jR2sNEJ1MAbJvQiQPx7gQ5LPfZ5Jw CCU6pt0mgY9q0rvx1KysHrI90KF7/3aYBNi8Zfzz5vC87CRvevju3WjSZ64+9CTEtLn0N/ ykwdpHA3aBfd+8gQID/FY6dfc3GAvuWJp/TvfcKyfaT/jOw8NhOmi315ewfsCwrpVuKpj7 lw8prYzeCXT5o5fCA8a+ElDIWFcExBMkPatl7ztwLbmEwMWL4Bx/74FuDfjnBQ== 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=1714680733; 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=IIy61CACIbM7jhfLa1JxDShzTqEe24a6ATg8IG1/Ck8=; b=RK3Q0mgSzKsKRNyFUDJnBSOtrRSfApNpbc22xBJv1GPTUxv1v5JISs3UzL5F/dxWRB2d42 MSUXOHQ7FdvboVry6A1Q9EEYZY/lDAR1MHjpcQBc7qrpKuuef8MaKFD3lp3AVcaZ4U6OZu Hp8dCla9MWojnvXVDYjUhsUna0MjYHOPH4EU1Sm/CqabbGv5bvEJ96YgtBNMgrbd19W5+b GNkkbzN+kieXwT1n86+bB2mmfOu9lbqtqtK9wRItXesfy5/jqwi+8D4gg9oWUIsPWdeXKx mAAlRZm5zjg9TUst5iKaISzhFF2MJyEv7qD/ASgBDXtM9Ad3K04pUspn5NzeUA== 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 4VVlTT428SzHF2; Thu, 2 May 2024 20:12: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 442KCD57072516; Thu, 2 May 2024 20:12:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 442KCDYI072513; Thu, 2 May 2024 20:12:13 GMT (envelope-from git) Date: Thu, 2 May 2024 20:12:13 GMT Message-Id: <202405022012.442KCDYI072513@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: 89342dba7dbe - stable/13 - jevents: Fix bootstrapping on macOS with Clang 16 / Apple Clang 15 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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: 89342dba7dbead47677ea82522174010697b17bc Auto-Submitted: auto-generated The branch stable/13 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=89342dba7dbead47677ea82522174010697b17bc commit 89342dba7dbead47677ea82522174010697b17bc Author: Jessica Clarke AuthorDate: 2024-03-16 01:50:20 +0000 Commit: Jessica Clarke CommitDate: 2024-05-02 20:11:52 +0000 jevents: Fix bootstrapping on macOS with Clang 16 / Apple Clang 15 macOS, like Linux, does not include an outer const qualifier for its fts_open callback arguments, so -Wincompatible-function-pointer-types also picks this up and breaks the build now Clang 16 makes it an error by default. Extend the existing Linux support to fix this. MFC after: 1 week (cherry picked from commit d8c84215d7675b7940412122b6d7026bd193c9b5) --- lib/libpmc/pmu-events/jevents.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libpmc/pmu-events/jevents.c b/lib/libpmc/pmu-events/jevents.c index 590b465af400..7059b31da2ba 100644 --- a/lib/libpmc/pmu-events/jevents.c +++ b/lib/libpmc/pmu-events/jevents.c @@ -1355,7 +1355,7 @@ err_out: #include static int -#ifdef __GLIBC__ +#if defined(__GLIBC__) || defined(__APPLE__) fts_compare(const FTSENT **a, const FTSENT **b) #else fts_compare(const FTSENT * const *a, const FTSENT * const *b) From nobody Thu May 2 20:12:14 2024 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 4VVlTW0q79z5JyRF; Thu, 2 May 2024 20:12: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 4VVlTV5PzCz4td2; Thu, 2 May 2024 20:12:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714680734; 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=trQgC0ZbmlbcMDw+6vEN8p2bYmchYe/xWtQN5qrEtjY=; b=T/bh69qfMwpYEa97jtb5WITL7H36ahljZTSv9jrhHtuvo8Z5RU+j4XMVafjDBQeHHCgDEx qTW0cqmYrrvqDvHq0bbS5LcJsbc8ZYp627jd82m7ILLhUD30e76m+v5GECxva4l/eRvTBp 5oa+11j/Iw9vJnTLJ8uswloOyynQZmpFNAjMZCbXUYx+YaIkthNXesAGZIMOYFs3QhDWuv Cr7uFkxbLzG/TgDoJzYZi/87DWt7hfz4LeqEmH5f/5hXBc6xuwWXF6niSL1wctFd0mwgkP gWpQoXNEX1nuV+SkGtmj/+8rHj7/82qFWtHtN2aci0S179ZblbJNaEwR4LhJFQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714680734; a=rsa-sha256; cv=none; b=RZNJ4+FjobXfz5XPrTQXtY7bL+a5nS3t0SXpXyvILj5coJT6NUZmd/p4DcdzZ34aHnChMd o9VrLLN50o1U4vjyCW0Yu96imHkoxa9Q+V49Zz69KfNUBb/RcNwwSJao5cBqical2Mr49R OdkaurhALTUYedTd5j8MUdx6eoNGro3nqKCLioNuVrsz1myvOAhmiRfDWBJnlMinH7o9j7 Lf66OFRFOJ6o/WOmvBDW3m+S9s3Uy+nSRIIfLlc/fjjQl+zbGc0pNWRSABdAjXSvsRXCRw Vt25lO/R0H5Qydo5WVqILiwpBPXKfw+MbX20C2WEvM1w1jR5TFj8E8ITaPHMVg== 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=1714680734; 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=trQgC0ZbmlbcMDw+6vEN8p2bYmchYe/xWtQN5qrEtjY=; b=nZf2ZKzp7cgVH/gTbm0gh7CqChrq5DdCFH+k741wEisTic5oNzZDKxJVlirjiur1wR+WbA JWCzJjVUTrTwRA75QmAkT413ILzIn8GUe3QG3XJYWPWCNjjZphuuFpI/B0/nhHJ1jkHlAO QHOWcNLFsDNGz//sOGYppRfmIyfEifo7zKmf7U/0EMKk3sy8KeONkW6Zck7+hONW5Z+MKN lXFy2G4ttcpwypyb7UM4nRUanLf0gyevc0nTO0QPnw1wx6iAf0TyGLyyh7XQO9Kcn3+9YK vwxGgrd3uVC0ms93bfM5LVLBcD/RcIymZuvjYD5S5AjBDeGCYue+b6mZ38s6RQ== 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 4VVlTV4yRzzHF3; Thu, 2 May 2024 20:12: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 442KCEms072579; Thu, 2 May 2024 20:12:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 442KCEwW072576; Thu, 2 May 2024 20:12:14 GMT (envelope-from git) Date: Thu, 2 May 2024 20:12:14 GMT Message-Id: <202405022012.442KCEwW072576@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: 91e0b44c159f - stable/13 - kldxref: Fix bootstrapping on macOS with Clang 16 / Apple Clang 15 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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: 91e0b44c159f71ea3d27297b250bdcd318c0fe89 Auto-Submitted: auto-generated The branch stable/13 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=91e0b44c159f71ea3d27297b250bdcd318c0fe89 commit 91e0b44c159f71ea3d27297b250bdcd318c0fe89 Author: Jessica Clarke AuthorDate: 2024-03-16 01:50:21 +0000 Commit: Jessica Clarke CommitDate: 2024-05-02 20:11:52 +0000 kldxref: Fix bootstrapping on macOS with Clang 16 / Apple Clang 15 macOS, like Linux, does not include an outer const qualifier for its fts_open callback arguments, so -Wincompatible-function-pointer-types also picks this up and breaks the build now Clang 16 makes it an error by default. Extend the existing Linux support to fix this. MFC after: 1 week (cherry picked from commit 75464941dc17876af2e99ea90c687bd7df873d73) --- usr.sbin/kldxref/kldxref.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/kldxref/kldxref.c b/usr.sbin/kldxref/kldxref.c index c4e65b7e679b..c044b92c7423 100644 --- a/usr.sbin/kldxref/kldxref.c +++ b/usr.sbin/kldxref/kldxref.c @@ -748,7 +748,7 @@ usage(void) } static int -#ifdef __GLIBC__ +#if defined(__GLIBC__) || defined(__APPLE__) compare(const FTSENT **a, const FTSENT **b) #else compare(const FTSENT *const *a, const FTSENT *const *b) From nobody Thu May 2 20:53:06 2024 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 4VVmNg0yqMz5K2KS; Thu, 2 May 2024 20:53: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 4VVmNg0LKpz437g; Thu, 2 May 2024 20:53:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714683187; 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=0Y8y5rLtenOoPat+QbQhciT4sgmRv9iG3ASZNbkMr74=; b=D5oyciV7oAz9QaNxss8WgHRMd88CWmCKDw/MoBW8KO9mi+IXByUARY67Rkv/eFyBgjrAEc akIE3zMsP5k4MX0Kja4YQfGGJk08EKAmCojgk5WKtrNfSGHot78uyNyXEvPWxnC0ctMkfJ dj+3mwYhL0ZXVVyNa5UMoEmNfglylsp9BJlVIl9Zda5UirlzXQ3w9zIPSZbQr6nAsgPNb6 mX8kk0aS85A0UI9i+e3/9tkG/tIyb9smWzQdba1/G8W4YzBM946OTb3BlUNHzo7M8BkSOd k/hD2bvekReqEGSMhC/WtVzey0SXQk2f5QKW34WSU0N1SkDhEFcTQmFM+lYsjw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714683187; a=rsa-sha256; cv=none; b=Sk1GnOCOJbVj7oFMYK3EspB8Dn73/OIOoOmgMdQSDoSjhTmWuUhWU7RVuj+FvIi15gbEKN 085lY2aL1Hzv7O4F9s7UeoqnCPLDD2l8qF+dBoikQo3OI+JcusMHEkQP31ZAPJREORppsE b/jc5pIIVOtet5FKG1tO+6p3bX5YZ63p//3PuqhuoJcUfx1u/J2FZHJfjxLswNFcpwg7LN 9B35hxISr4a8VtQwWu1Bvn15ILlraCsZFUubGcSoFdP8JzshsXKl6RBmSOU51UO6ZeQwks 7QjtN57TxgJP1wG0dgnfjyjZpAinGpsu4CSs6CV/tkPGC3se23/+FxuxEwGdEw== 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=1714683187; 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=0Y8y5rLtenOoPat+QbQhciT4sgmRv9iG3ASZNbkMr74=; b=rc7Rz7hpX6EwcFn/ipJGwrsjgiTu6vqs1OZb0LttbjezdO/qWTRjX5JYJWbV60HBIT7LRO oSi/vZ/xEFmmAwwoDc3auxf+EvySWovChliQkM9Av5gsItKwhHjB1N/Gwp4G5DnnSwnqj8 RTxtVocv05Ci2kki1sAv3+U5cRz3/zPgq/VuFu1ybTn0PEH57Oq1ZVHIcVwI38i84JhYJ4 azeD/AQFdomjMR9EpBnKOPjfrl6D3VqnS4boZwIoyw+SGjvlYz3ok7CPwUAfgwcAS+OIsN 4xwYG8isqhqAKDMaZ2n/tma5/hJhhlX2D0b9y9rQk3YyNryWr0Ao325sufzDFA== 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 4VVmNf7398zHr0; Thu, 2 May 2024 20:53: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 442Kr6qQ039954; Thu, 2 May 2024 20:53:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 442Kr6Ih039951; Thu, 2 May 2024 20:53:06 GMT (envelope-from git) Date: Thu, 2 May 2024 20:53:06 GMT Message-Id: <202405022053.442Kr6Ih039951@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: a7096a69efcd - stable/14 - date(1): Grammar 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a7096a69efcda1451112cd2a65e75bc9e19ef5e5 Auto-Submitted: auto-generated The branch stable/14 has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=a7096a69efcda1451112cd2a65e75bc9e19ef5e5 commit a7096a69efcda1451112cd2a65e75bc9e19ef5e5 Author: Chia-Jung Chang AuthorDate: 2024-01-12 01:58:35 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2024-05-02 20:52:37 +0000 date(1): Grammar fixes Event: Advanced UNIX programming course (Fall'23) at NTHU Pull Request: https://github.com/freebsd/freebsd-src/pull/1035 (cherry picked from commit 8e9fc2d9f657f99ae368524868dd04080bc390bf) --- bin/date/date.1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/date/date.1 b/bin/date/date.1 index 90e8c1bda81b..bf7c961314a2 100644 --- a/bin/date/date.1 +++ b/bin/date/date.1 @@ -225,8 +225,8 @@ day, week day, month or year according to .Ar val . If .Ar val -is preceded with a plus or minus sign, -the date is adjusted forwards or backwards according to the remaining string, +is preceded by a plus or minus sign, +the date is adjusted forward or backward according to the remaining string, otherwise the relevant part of the date is set. The date can be adjusted as many times as required using these flags. Flags are processed in the order given. @@ -286,7 +286,7 @@ will be necessary to reach October 29, 2:30. .Pp When the date is adjusted to a specific value that does not actually exist (for example March 26, 1:30 BST 2000 in the Europe/London timezone), -the date will be silently adjusted forwards in units of one hour until it +the date will be silently adjusted forward in units of one hour until it reaches a valid time. When the date is adjusted to a specific value that occurs twice (for example October 29, 1:30 2000), From nobody Thu May 2 20:53:08 2024 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 4VVmNh24xkz5K2QB; Thu, 2 May 2024 20:53: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 4VVmNh1MPJz43D5; Thu, 2 May 2024 20:53:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714683188; 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=QtdLGnKsJoj5VV3Pmwr8TMmXXxxvTw9p28P4Cx/AHCk=; b=aREadJoKZmzpDJtZFS0SqO66qi5MDSbWW4TyWC1jwgSnEYzjtc8FmoFbqpc6oYjBotOXGB W+gd5FsIZx6mdp5/UQ06gC86YbAJoutQLReh9usbTklQ3qla7UQGRc8eyBqAbehSCZq+nd uj6CLkzXw2CBmphEimTbkoPJnzOC4DMAfnaaSovmHkjuIdaxsz9sxv8BJztdRuTb97VJtC 4P3YsK3AKBQwCbhKU4Hz7wQiyd0TeSGuZjPassP4YM9n9TsCcQttf8dlIRM++PmdePz6Jv IC2JZ2iNMbLolz/wUfxOeSC+/v/JwDcQ04eNhCcqKRFw9iQxH0NyoDdDAG7/3Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714683188; a=rsa-sha256; cv=none; b=o+J8L0f7yP3UFYLr8TeTanFKiZUyzBwy/EpCZXCJkSt0jEUk+QjDWrRyUj5ecexkUhABWz 0ZkQ2xn6A1Z1XKgwRICKqwJ+vDzC0JxFSl/VHXrH83I39xCwQzGKOMJS+eCkQnV+aYFQVP CjyCpjRtiCoGWb5Xyz8wthOaKd7xqH8buaZuMJm3cvL3JswHZb6hio/HXMYmZPvTk9tvHs zD6LRsyqb1ZlfAim9937eiEmsORoW8jJxINoAvHJ4dPN5Q93MCr3zeSGd9Y+n6+aWcS1p7 rRdvj2aRFLvDTr2x7tv+GQ1SgFhoDlI49Xpr3GNcbVCCG3PjJHQM8PWx3qGrNw== 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=1714683188; 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=QtdLGnKsJoj5VV3Pmwr8TMmXXxxvTw9p28P4Cx/AHCk=; b=dv7LqTVh+QRLFF06M6DeGXAODG3GdKJlKnTyv72jCyBgxR7m6G3qdZxTaOeHUTG58mwt8J FmzwX6WnRBIUrYekZAWGyjWe1lOtXUf8/u02Sfy29f93+eXEhNXvTuDc/rSd3naucXTX+E h+MSUac9un13N7tym5J9gcv4qcyBwRx3zd5RSpkUPfyKQ16aNXAJQxD+7ntN3hlU3D2Qin 7CLcDma+gBhdHXvobpbAaogts5dTWjl4O1a3Bydgh6KCon5zDtSDytklgp6xyC3VPuvR9f SeC3FNG4OF5ieYtLrG+PuCJmxGu6rhsM/tD/1j9nKoAUaiinaacySxqlc5FsxA== 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 4VVmNh0yyczHSh; Thu, 2 May 2024 20:53: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 442Kr8ep039999; Thu, 2 May 2024 20:53:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 442Kr8bI039996; Thu, 2 May 2024 20:53:08 GMT (envelope-from git) Date: Thu, 2 May 2024 20:53:08 GMT Message-Id: <202405022053.442Kr8bI039996@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 10c4885f368e - stable/14 - date: Add support for nanoseconds List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 10c4885f368ec70c688e2088c3840245ec27d958 Auto-Submitted: auto-generated The branch stable/14 has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=10c4885f368ec70c688e2088c3840245ec27d958 commit 10c4885f368ec70c688e2088c3840245ec27d958 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2024-04-21 21:25:32 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2024-05-02 20:52:37 +0000 date: Add support for nanoseconds This patch introduces support for a conversion specification for nanoseconds. The format of %N is meant to be compatible with that of GNU date. The nanoseconds conversion specification is implemented directly in date(1) instead of libc (in strftime(3)) to avoid introducing non-standard functions to libc at this time and modifying struct tm. Apart from introducing the nanoseconds conversion specification, this patch brings the following changes: - The "ns" format for ISO 8061 dates is now unlocked. E.g., date -Ins prints: 2024-04-22T12:20:28,763742224+02:00 - The -r flag when fed a file is now aware of the nanosecond part of the last modification time. - date(1) is now able to set the time with nanosecond precision. It is not possible as of now to do that by specifying nanoseconds directly via the command-line arguments. Instead, the -r flag can be used. - date(1) is now using the clock_gettime(3) family of functions instead of ctime(3) family of functions where possible. Reviewed by: des, markj Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D44905 (cherry picked from commit eeb04a736cb9c07d191af886e25d5f198824658e) --- bin/date/date.1 | 28 ++++++-- bin/date/date.c | 132 ++++++++++++++++++++++++++++------- bin/date/tests/format_string_test.sh | 17 ++++- 3 files changed, 142 insertions(+), 35 deletions(-) diff --git a/bin/date/date.1 b/bin/date/date.1 index bf7c961314a2..88974e27d5a4 100644 --- a/bin/date/date.1 +++ b/bin/date/date.1 @@ -31,7 +31,7 @@ .\" .\" @(#)date.1 8.3 (Berkeley) 4/28/95 .\" -.Dd May 19, 2023 +.Dd April 26, 2024 .Dt DATE 1 .Os .Sh NAME @@ -143,17 +143,19 @@ values are .Cm date , .Cm hours , .Cm minutes , +.Cm seconds , and -.Cm seconds . +.Cm ns No Pq for nanoseconds . The date and time is formatted to the specified precision. When .Ar FMT is .Cm hours -(or the more precise -.Cm minutes +.Po or the more precise +.Cm minutes , +.Cm seconds , or -.Cm seconds ) , +.Cm ns Pc , the .St -iso8601 format includes the timezone. @@ -327,7 +329,9 @@ which specifies the format in which to display the date and time. The format string may contain any of the conversion specifications described in the .Xr strftime 3 -manual page, as well as any arbitrary text. +manual page and +.Ql %N +for nanoseconds, as well as any arbitrary text. A newline .Pq Ql \en character is always output after the characters specified by @@ -553,6 +557,7 @@ prints: and exits with status 1. .Sh SEE ALSO .Xr locale 1 , +.Xr clock_gettime 2 , .Xr gettimeofday 2 , .Xr getutxent 3 , .Xr strftime 3 , @@ -583,6 +588,12 @@ The format selected by the .Fl I flag is compatible with .St -iso8601 . +.Pp +The +.Ql %N +conversion specification for nanoseconds is a non-standard extension. +It is compatible with GNU date's +.Ql %N . .Sh HISTORY A .Nm @@ -601,3 +612,8 @@ The .Fl I flag was added in .Fx 12.0 . +.Pp +The +.Ql %N +conversion specification was added in +.Fx 15.0 . diff --git a/bin/date/date.c b/bin/date/date.c index 74e8c82c5304..c153ec215b61 100644 --- a/bin/date/date.c +++ b/bin/date/date.c @@ -48,6 +48,7 @@ static char sccsid[] = "@(#)date.c 8.2 (Berkeley) 4/28/95"; #include #include +#include #include #include #include @@ -63,14 +64,14 @@ static char sccsid[] = "@(#)date.c 8.2 (Berkeley) 4/28/95"; #define TM_YEAR_BASE 1900 #endif -static time_t tval; - static void badformat(void); static void iso8601_usage(const char *) __dead2; static void multipleformats(void); static void printdate(const char *); -static void printisodate(struct tm *); -static void setthetime(const char *, const char *, int); +static void printisodate(struct tm *, long); +static void setthetime(const char *, const char *, int, struct timespec *); +static size_t strftime_ns(char * __restrict, size_t, const char * __restrict, + const struct tm * __restrict, long); static void usage(void) __dead2; static const struct iso8601_fmt { @@ -81,6 +82,7 @@ static const struct iso8601_fmt { { "hours", "T%H" }, { "minutes", ":%M" }, { "seconds", ":%S" }, + { "ns", ",%N" }, }; static const struct iso8601_fmt *iso8601_selected; @@ -89,6 +91,7 @@ static const char *rfc2822_format = "%a, %d %b %Y %T %z"; int main(int argc, char *argv[]) { + struct timespec ts; int ch, rflag; bool Iflag, jflag, Rflag; const char *format; @@ -139,11 +142,12 @@ main(int argc, char *argv[]) break; case 'r': /* user specified seconds */ rflag = 1; - tval = strtoq(optarg, &tmp, 0); + ts.tv_sec = strtoq(optarg, &tmp, 0); if (*tmp != 0) { - if (stat(optarg, &sb) == 0) - tval = sb.st_mtim.tv_sec; - else + if (stat(optarg, &sb) == 0) { + ts.tv_sec = sb.st_mtim.tv_sec; + ts.tv_nsec = sb.st_mtim.tv_nsec; + } else usage(); } break; @@ -162,8 +166,8 @@ main(int argc, char *argv[]) argc -= optind; argv += optind; - if (!rflag && time(&tval) == -1) - err(1, "time"); + if (!rflag && clock_gettime(CLOCK_REALTIME, &ts) == -1) + err(1, "clock_gettime"); format = "%+"; @@ -179,7 +183,7 @@ main(int argc, char *argv[]) } if (*argv) { - setthetime(fmt, *argv, jflag); + setthetime(fmt, *argv, jflag, &ts); ++argv; } else if (fmt != NULL) usage(); @@ -192,7 +196,7 @@ main(int argc, char *argv[]) if (outzone != NULL && setenv("TZ", outzone, 1) != 0) err(1, "setenv(TZ)"); - lt = localtime(&tval); + lt = localtime(&ts.tv_sec); if (lt == NULL) errx(1, "invalid time"); badv = vary_apply(v, lt); @@ -205,7 +209,7 @@ main(int argc, char *argv[]) vary_destroy(v); if (Iflag) - printisodate(lt); + printisodate(lt, ts.tv_nsec); if (format == rfc2822_format) /* @@ -215,7 +219,7 @@ main(int argc, char *argv[]) setlocale(LC_TIME, "C"); - (void)strftime(buf, sizeof(buf), format, lt); + (void)strftime_ns(buf, sizeof(buf), format, lt, ts.tv_nsec); printdate(buf); } @@ -229,19 +233,19 @@ printdate(const char *buf) } static void -printisodate(struct tm *lt) +printisodate(struct tm *lt, long nsec) { const struct iso8601_fmt *it; - char fmtbuf[32], buf[32], tzbuf[8]; + char fmtbuf[64], buf[64], tzbuf[8]; fmtbuf[0] = 0; for (it = iso8601_fmts; it <= iso8601_selected; it++) strlcat(fmtbuf, it->format_string, sizeof(fmtbuf)); - (void)strftime(buf, sizeof(buf), fmtbuf, lt); + (void)strftime_ns(buf, sizeof(buf), fmtbuf, lt, nsec); if (iso8601_selected > iso8601_fmts) { - (void)strftime(tzbuf, sizeof(tzbuf), "%z", lt); + (void)strftime_ns(tzbuf, sizeof(tzbuf), "%z", lt, nsec); memmove(&tzbuf[4], &tzbuf[3], 3); tzbuf[3] = ':'; strlcat(buf, tzbuf, sizeof(buf)); @@ -253,15 +257,14 @@ printisodate(struct tm *lt) #define ATOI2(s) ((s) += 2, ((s)[-2] - '0') * 10 + ((s)[-1] - '0')) static void -setthetime(const char *fmt, const char *p, int jflag) +setthetime(const char *fmt, const char *p, int jflag, struct timespec *ts) { struct utmpx utx; struct tm *lt; - struct timeval tv; const char *dot, *t; int century; - lt = localtime(&tval); + lt = localtime(&ts->tv_sec); if (lt == NULL) errx(1, "invalid time"); lt->tm_isdst = -1; /* divine correct DST */ @@ -342,18 +345,17 @@ setthetime(const char *fmt, const char *p, int jflag) } /* convert broken-down time to GMT clock time */ - if ((tval = mktime(lt)) == -1) + if ((ts->tv_sec = mktime(lt)) == -1) errx(1, "nonexistent time"); + ts->tv_nsec = 0; if (!jflag) { utx.ut_type = OLD_TIME; memset(utx.ut_id, 0, sizeof(utx.ut_id)); (void)gettimeofday(&utx.ut_tv, NULL); pututxline(&utx); - tv.tv_sec = tval; - tv.tv_usec = 0; - if (settimeofday(&tv, NULL) != 0) - err(1, "settimeofday (timeval)"); + if (clock_settime(CLOCK_REALTIME, ts) != 0) + err(1, "clock_settime"); utx.ut_type = NEW_TIME; (void)gettimeofday(&utx.ut_tv, NULL); pututxline(&utx); @@ -364,6 +366,82 @@ setthetime(const char *fmt, const char *p, int jflag) } } +/* + * The strftime_ns function is a wrapper around strftime(3), which adds support + * for features absent from strftime(3). Currently, the only extra feature is + * support for %N, the nanosecond conversion specification. + * + * The functions scans the format string for the non-standard conversion + * specifications and replaces them with the date and time values before + * passing the format string to strftime(3). The handling of the non-standard + * conversion specifications happens before the call to strftime(3) to handle + * cases like "%%N" correctly ("%%N" should yield "%N" instead of nanoseconds). + */ +static size_t +strftime_ns(char * __restrict s, size_t maxsize, const char * __restrict format, + const struct tm * __restrict t, long nsec) +{ + size_t prefixlen; + size_t ret; + char *newformat; + char *oldformat; + const char *prefix; + const char *suffix; + const char *tok; + bool seen_percent; + + seen_percent = false; + if (asprintf(&newformat, "%s", format) < 0) + err(1, "asprintf"); + tok = newformat; + for (tok = newformat; *tok != '\0'; tok++) { + switch (*tok) { + case '%': + /* + * If the previous token was a percent sign, + * then there are two percent tokens in a row. + */ + if (seen_percent) + seen_percent = false; + else + seen_percent = true; + break; + case 'N': + if (seen_percent) { + oldformat = newformat; + prefix = oldformat; + prefixlen = tok - oldformat - 1; + suffix = tok + 1; + /* + * Construct a new format string from the + * prefix (i.e., the part of the old fromat + * from its beginning to the currently handled + * "%N" conversion specification, the + * nanoseconds, and the suffix (i.e., the part + * of the old format from the next token to the + * end). + */ + if (asprintf(&newformat, "%.*s%.9ld%s", + (int)prefixlen, prefix, nsec, + suffix) < 0) { + err(1, "asprintf"); + } + free(oldformat); + tok = newformat + prefixlen + 9; + } + seen_percent = false; + break; + default: + seen_percent = false; + break; + } + } + + ret = strftime(s, maxsize, newformat, t); + free(newformat); + return (ret); +} + static void badformat(void) { @@ -387,7 +465,7 @@ static void usage(void) { (void)fprintf(stderr, "%s\n%s\n%s\n", - "usage: date [-jnRu] [-I[date|hours|minutes|seconds]] [-f input_fmt]", + "usage: date [-jnRu] [-I[date|hours|minutes|seconds|ns]] [-f input_fmt]", " " "[ -z output_zone ] [-r filename|seconds] [-v[+|-]val[y|m|w|d|H|M|S]]", " " diff --git a/bin/date/tests/format_string_test.sh b/bin/date/tests/format_string_test.sh index a3e2939bfe5c..c2fe2111373f 100755 --- a/bin/date/tests/format_string_test.sh +++ b/bin/date/tests/format_string_test.sh @@ -30,6 +30,17 @@ check() date -r ${TEST2} +%${format_string} } +atf_test_case flag_r_file_test +flag_r_file_test_body() +{ + local file + + file="./testfile" + touch "$file" + atf_check -o "inline:$(stat -f '%9Fm' "$file")\n" \ + date -r "$file" +%s.%N +} + format_string_test() { local desc exp_output_1 exp_output_2 flag @@ -98,6 +109,8 @@ iso8601_${desc}_parity_body() { atf_init_test_cases() { + atf_add_test_case flag_r_file_test + format_string_test A A Saturday Monday format_string_test a a Sat Mon format_string_test B B February November @@ -118,6 +131,7 @@ atf_init_test_cases() format_string_test l l " 7" " 9" format_string_test M M 04 20 format_string_test m m 02 11 + format_string_test N N 000000000 000000000 format_string_test p p AM PM format_string_test R R 07:04 21:20 format_string_test r r "07:04:03 AM" "09:20:00 PM" @@ -143,6 +157,5 @@ atf_init_test_cases() iso8601_string_test hours hours "" "1970-02-07T07+00:00" "2001-11-12T21+00:00" iso8601_string_test minutes minutes "" "1970-02-07T07:04+00:00" "2001-11-12T21:20+00:00" iso8601_string_test seconds seconds "" "1970-02-07T07:04:03+00:00" "2001-11-12T21:20:00+00:00" - # BSD date(1) does not support fractional seconds at this time. - #iso8601_string_test ns ns "" "1970-02-07T07:04:03,000000000+00:00" "2001-11-12T21:20:00,000000000+00:00" + iso8601_string_test ns ns "" "1970-02-07T07:04:03,000000000+00:00" "2001-11-12T21:20:00,000000000+00:00" } From nobody Thu May 2 20:53:09 2024 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 4VVmNj545Pz5K2s8; Thu, 2 May 2024 20:53:09 +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 4VVmNj24Tlz43DB; Thu, 2 May 2024 20:53:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714683189; 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=WEqv7EL1IyCp3Yb59/H5vPkRyEl2IRE/WbsJIZbE4yU=; b=nheyQYT/Ry3afSXd+8/KmXgH+rrjwaYQZ7jgpCZrvnsnrrAYkith03UniT33/OFtPrbO7R Y84e8+wiiH9mfu4N66JeglKQOu+QF/a6FeYCRLVwhJDi27ul38WHYwoZ4FIhM1bL21GMAM g4umf89qkSMiaRKxK7gHtrBffiEbbJIUQJyDNDQWWFQiobwK2cuu0YEO2OGwxl2YkZxXsW Juq8WsuIPu/j6kQEDQmilIvr/N6YmxkxeaFxlrIsyrBniPwD+lGInpaSc8EmyZi5Ob4Ex2 6sKtjKzLOZXQo5oXhFBUmzGE/r0mukuWry+kgILWuyIE+NpiyH9oIXtbEuBeyw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714683189; a=rsa-sha256; cv=none; b=l17irDrBbiFbnY+Tm2ZctXvigTXszu+TliawCHacFEE9HozQyEgy5irne2KoMPSJKJ/Uv6 42D97ZDLKshqM/inl8FOfxqs7rXaGbJK6jdBYjtRpjTG9NUq3vWtJaYPpWl3li/n2ugzQk z5RV2VHykkQWXT7DLFzyyrflFulWhnPgo1tmzz8R8Jy68Sg3dF8ZN9IcAVreyY6gduOr1/ wskWH+MUIjjlm6knCujY1JPmuaG8kV1ddCxBZljUOmPE/Y1ZW/bo3RKkh8XhDsGF5aDKw+ ZbVpVSdmVdblRYEK73ehemVTkwJKrOcqWvHB0kKKuBlsdnZiy8DQoMaVWNj0sQ== 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=1714683189; 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=WEqv7EL1IyCp3Yb59/H5vPkRyEl2IRE/WbsJIZbE4yU=; b=GZECoqUEm9FV31131pOTH++/vkWEb7QnxepA6PN4dcKFznQgqI84lbqWB96AVRQSvlYttp E/zBg407hmiP4XPVhSzgiKDIbc6kZn33VkfAkr+4f4Wgb1tjS7mNur/KmPE/gIuDLmHhk3 DOXn0Zcn3pWhEpG6siQnxZzxa2P3XtNS/fzy5j6GbrSEIxmBiP0T8EXrHYcrpBj/uNOh5Q WFQLrPax5Xpb4eGvf5t7v8koC9TeaL2zYsD6O3eAqxYmsDDNz5BxfSnIIfhp0OzA6D171j ODNs9i8oPFAJY0e8PSTEGCd+1pRSUZx9gEPg4FQvkP4tjPfBdaukj0kN+s3qDA== 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 4VVmNj1hvTzHSj; Thu, 2 May 2024 20:53:09 +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 442Kr9jN040053; Thu, 2 May 2024 20:53:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 442Kr9hD040050; Thu, 2 May 2024 20:53:09 GMT (envelope-from git) Date: Thu, 2 May 2024 20:53:09 GMT Message-Id: <202405022053.442Kr9hD040050@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 4fd988e652e5 - stable/14 - date: Fix tests by initializing timespec structure List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4fd988e652e5045f73df0794bfba870c04d39830 Auto-Submitted: auto-generated The branch stable/14 has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=4fd988e652e5045f73df0794bfba870c04d39830 commit 4fd988e652e5045f73df0794bfba870c04d39830 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2024-04-26 15:19:18 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2024-05-02 20:52:37 +0000 date: Fix tests by initializing timespec structure The tests related to nanosecond support were failing on amd64 due to uninitialized timespec structure. Fixes: eeb04a736cb9 date: Add support for nanoseconds Reviewed by: markj Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D44975 (cherry picked from commit 7b390cb636899582243e4daa8edbdb30d686d9fb) --- bin/date/date.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bin/date/date.c b/bin/date/date.c index c153ec215b61..62703c6d70ac 100644 --- a/bin/date/date.c +++ b/bin/date/date.c @@ -109,6 +109,8 @@ main(int argc, char *argv[]) (void) setlocale(LC_TIME, ""); rflag = 0; Iflag = jflag = Rflag = 0; + ts.tv_sec = 0; + ts.tv_nsec = 0; while ((ch = getopt(argc, argv, "f:I::jnRr:uv:z:")) != -1) switch((char)ch) { case 'f': From nobody Thu May 2 20:53:10 2024 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 4VVmNk58dCz5K2Xr; Thu, 2 May 2024 20:53:10 +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 4VVmNk35Gbz43SR; Thu, 2 May 2024 20:53:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714683190; 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=SwBS+RHwjjBxWmxfyrGovSW3cQ3+xVWemdh4qBKjpKU=; b=O/B71bMptfwJeeSecwgrmRHH0rEUbwX7Uaq3nefIFhUr0KZkz0fBxSty1lL9N9zgCQS+bJ +QD/o71bJB8S3yJf4hod06CFv3RvMcaoqhGMxKMrOs86eRsZftz0rHAIh0NaqrvO77sarO K1WbLam5bNleleDv2as6nsuP29AivUz6Azg9rUfnhIUtJfEYHZMFdWbchbdOydIew5DlhV hH/5UTWE6e5bScyUD5imfuyxuzG9CnQ7Kfq1lvREPxQnDx0sGZcy1zTBNVDGOmJoKwYePO eaZcUTL/6jSWzCtIxqk67bzwMtvO/BtoZhphqlwLwynmyqNnHSQZcN0bfDJi+A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714683190; a=rsa-sha256; cv=none; b=IWIzzfqpGUUV69NXwV6lplwifgIdJqct20uSfexRCTqjpZO3R956O/kHv+fHhMwjx4XtmK RcEl40Q32ya3vIbxHWhx+8+vF2eEOpD/E510UcMQO6vhNTDW5/DjBmdGVBx+9wUOjIuFSl vsj4JfKMlB0IWPNMSrnn7hUY2zlK+gsS0eGf7m/wrRB+hi9iD/Otc0iYu1dQSABd8ovhj8 4VqCNzIvQMvDwpu7bHjACMiCE/tgAqnoSFBgEZPSSUU8CXIbQlI1WPWYh2/JdHHbqwpTzx iGN0mWdYsUk2HbA713EfKhvXmnfUiGhECFId6zwWboV+3MM4NBsHzZjL+OrhFg== 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=1714683190; 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=SwBS+RHwjjBxWmxfyrGovSW3cQ3+xVWemdh4qBKjpKU=; b=EZR+j19LiB0zq6VaPWT/2WrPa0o6+KfWtLmn89SPIgx5Hm43r/MhKjslQQF9f3xwlLDqC1 KxiKZPZ7FQYFVBoLbZmFsoC/JTaPosfphkt0t2/PH4RP0kpQwGFtJCcfLYUxLGqn8JwjAt kjlafOn25QWlZ1pc4ns2VKJoI87NUj3K/PA0iez/mUL3Jv2ZJiY3C/1Cj4kb2u2Ttsvtf/ u/WEE4Eh+EdqsB94nFbDL5GI10DixZHXf8KQFDx9C9RbNSfxeK+bPFoFbOClFb9sQWVt9t HdosNAGMgY84gBmqM1nllLWQMaBUR39bzG11aGmLI1DA9TLQ5FRJpKv6SQ07Yw== 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 4VVmNk2jddzHlq; Thu, 2 May 2024 20:53:10 +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 442KrAAH040099; Thu, 2 May 2024 20:53:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 442KrAnj040096; Thu, 2 May 2024 20:53:10 GMT (envelope-from git) Date: Thu, 2 May 2024 20:53:10 GMT Message-Id: <202405022053.442KrAnj040096@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: f2ec4bd306ac - stable/14 - date: Correctly check outcome of mktime(). List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f2ec4bd306ac786222bd5a6522b45e762e968b31 Auto-Submitted: auto-generated The branch stable/14 has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=f2ec4bd306ac786222bd5a6522b45e762e968b31 commit f2ec4bd306ac786222bd5a6522b45e762e968b31 Author: Dag-Erling Smørgrav AuthorDate: 2024-04-28 17:12:58 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2024-05-02 20:52:37 +0000 date: Correctly check outcome of mktime(). X-MFC-With: 7b390cb63689 Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D44982 (cherry picked from commit dafb424b8d44c7fdc9cfe876a79aad05c438def0) --- bin/date/date.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/date/date.c b/bin/date/date.c index 62703c6d70ac..6b6e1f69cabc 100644 --- a/bin/date/date.c +++ b/bin/date/date.c @@ -347,7 +347,9 @@ setthetime(const char *fmt, const char *p, int jflag, struct timespec *ts) } /* convert broken-down time to GMT clock time */ - if ((ts->tv_sec = mktime(lt)) == -1) + lt->tm_yday = -1; + ts->tv_sec = mktime(lt); + if (lt->tm_yday == -1) errx(1, "nonexistent time"); ts->tv_nsec = 0; From nobody Thu May 2 20:53:11 2024 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 4VVmNl6YTMz5K2Xs; Thu, 2 May 2024 20:53:11 +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 4VVmNl4CZNz43HN; Thu, 2 May 2024 20:53:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714683191; 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=PnWMous9jnLTjr6z9HvXF1/xAInaxARMKOyBJ5Zk3JQ=; b=t0OAVy9RsL1Sl2pwn5zaub6TyvCQlwRbaKYCp85ACx/Xsg/YAV7WymXvCRoW8XApYfV4nV yguXAnVK5chP7O3fh1naoCdCKBb1M0IwVf1pVXWx8T1Du9tLFY4HVaRSE/3Q8dDWNxUztF 7vRovTyfg1sXPSjroepdOyyIbXOlCPNfFm35PA/e5stuSZZ6wk+3+or/I2rQ6t7+6m32hw IvBjP4cfqzV7MoXsPdpwFE97JVcXr6VWjGB4OZkZk5ZMOl+mwDO/by8T9nQ1+aZ3bQ18de xg68/Oo7lyZs6dkuN4MjtVPE5XI/aLV1ogrVr3z1yoW6pECHePyhC3w25F3x+g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714683191; a=rsa-sha256; cv=none; b=UlXIyfZkoWp76JXyKHGlMancsvXyAlwi2cCggHoY57EZzV9E5OV1ZHEkqWKOkq7Km5rorr PiOHgRIwWQmknYJCk2OelVh96HXFERPpUIZcuRlfSFoIjfluOInAKRCNGvmi5enrxdCPwD kzuDJeu6RJMR3yQ78hFhelHcN/Lz0qUjTtNQmXLpSHMFhWRd8X3RmSB0fGSWhigQfC5gJa 94LYKzl+af3zsVKtrYTYdLQVqkbAK0htiv3QwdoO/r5XwWgZGOvXrddBm48twg+Q0bLYJR MXNsaUinzXcd6Jfpbv+JEOKDxJGdvtvOTX3rfQKm39uNArS7qRxRnJJX6eTKKA== 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=1714683191; 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=PnWMous9jnLTjr6z9HvXF1/xAInaxARMKOyBJ5Zk3JQ=; b=G5r61feZUvloEkkaz+Jr2uouTu7jvrWoM4+px4wkolzkbuKyWUwXkXrfFPs841qc0HwGt7 ixOSTX7DY5JD7LJL8R3WlBMBipkGySgLurFhsaZVMhJQCDmEJ1k7RTHsPlSVXRqz0Tdq5p nN2GBYAN271meeaQ9Kj6YFsQUhqQrBOKi3eoGAEmxCoWSWZKB2Syj38lbL1dVHJahHO6wk 3g4Jl/wEaEqM4OKLxoXr8Fc8RBgW+yBDJKwpv9WDy5f7COhzSsZ2yoLj0xjfGKmwIR4TYK RvCHp2tmz50tMAxgERMHhiy1WbMDgudY/jFjvRiK3fXhnDFgIbqxG30+Tsi30g== 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 4VVmNl3pmHzHZ9; Thu, 2 May 2024 20:53:11 +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 442KrBRZ040159; Thu, 2 May 2024 20:53:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 442KrBlp040156; Thu, 2 May 2024 20:53:11 GMT (envelope-from git) Date: Thu, 2 May 2024 20:53:11 GMT Message-Id: <202405022053.442KrBlp040156@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: f609ff5a499a - stable/14 - date.1: Note that nanosecond support is to appear first in 14.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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f609ff5a499a4cf43658e0758866957463fb6fe8 Auto-Submitted: auto-generated The branch stable/14 has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=f609ff5a499a4cf43658e0758866957463fb6fe8 commit f609ff5a499a4cf43658e0758866957463fb6fe8 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2024-05-02 20:45:25 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2024-05-02 20:52:38 +0000 date.1: Note that nanosecond support is to appear first in 14.1 Sponsored by: Klara, Inc. (cherry picked from commit c40e0bff7257e6d239779a5106dc67429941f63f) --- bin/date/date.1 | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/bin/date/date.1 b/bin/date/date.1 index 88974e27d5a4..29cde37ca904 100644 --- a/bin/date/date.1 +++ b/bin/date/date.1 @@ -29,9 +29,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" @(#)date.1 8.3 (Berkeley) 4/28/95 -.\" -.Dd April 26, 2024 +.Dd May 2, 2024 .Dt DATE 1 .Os .Sh NAME @@ -616,4 +614,4 @@ flag was added in The .Ql %N conversion specification was added in -.Fx 15.0 . +.Fx 14.1 . From nobody Thu May 2 20:53:12 2024 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 4VVmNn1KY1z5K2SZ; Thu, 2 May 2024 20:53:13 +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 4VVmNm5GxBz43L0; Thu, 2 May 2024 20:53:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714683192; 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=DvWxjbFS31YMslYdfPL0C5eBRykhlDnQkxJWhj7XUSw=; b=lMcog3GR3obHZCzWOxfZr6+q4Q3c0FXqEWekhU0WSJyMKBw9aPHhxc6qaDfDtgsjjEbrSW p8w4Do5tstv2/Bcn0pMVb5CY2xYbXxmRL/IHChH4TCIqo0ZvdCz+uDghwQl7KzVzarA4B3 SFTrKlv2ary3TW1jIQgOHRq6DRNy+QpP+bYbcAZiqL5EI4VcU5NycyNFhhHUFff/DTkp91 OJk+/r5m50OPGbLrNn8b6CoI1atAHclpvIRMtgH2lGYMX/l5ZKqCSrKBizZYKZu7P644g4 7MjzbhpSJlkeG2piCORasJnunc3bEmjb+VUvXFC2w4t/YcDoEmg8ft8+2BBkBg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714683192; a=rsa-sha256; cv=none; b=XCQ+JdVyX4dIdG4y42o/1uXhuA1u/ssu0Joa+4ELPxMkMAYtuVGtT1LO8Z3Ubnexf/7G8S uvWlxHGEvYKj64dH1jvv0nPHCSSq29FROrdzNYc+56dG+iGl7INpVj21WAGA3aU7GOheIX B3V3InVUG6bcQ1QqVoZb0W7xP81wcn19sqKtUASnzgjvXK9zQbpItCPeMr2r6rHRYdcxRz 0DGmnlm5PhXZ1jcDPpkOpmFbG6r2Z3h5Llpcv3YLDKAOKv3Wu4JTagYNp8f01pAah0GvOD zEBplWCllmaML3Ldyq8l+aXQ8rF8GUqrO/CzyBqmaaEjTPB+2O9pNYcK1Ng/ug== 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=1714683192; 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=DvWxjbFS31YMslYdfPL0C5eBRykhlDnQkxJWhj7XUSw=; b=tSqqFksfnq8HwqTUu/kb5pQI0N24l8F9qDRwI5SPRHylB0bYVY4JVB49TIaVjpnKiwY+/t nSvD8lXxvVAS78ldB8TxbB5bcq3UiAeZGwHHsB8A0ug9cqAVLVBkDv70SahZU/au4UsxPs hzurg+0vWeqzLDow4K0oyE1pCu1zb2MxaHJ5XaCECb/cWwLfsRNS/CPU/rYPEqx5QmSUpW +6ehfJ3jP9ZK+JlXPrRvyOxxX9SfKHu1fGZlgin5RRwBLBTEGLcO8Tmg6v/W7fkaAfXCH1 RD5KkXt1qwRpWCuK4T8ScV83Qa872fVdRy/p6uzb2Q4cmgx69LYT1P2+asEaWw== 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 4VVmNm4tPZzHSk; Thu, 2 May 2024 20:53:12 +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 442KrCeP040201; Thu, 2 May 2024 20:53:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 442KrC5A040198; Thu, 2 May 2024 20:53:12 GMT (envelope-from git) Date: Thu, 2 May 2024 20:53:12 GMT Message-Id: <202405022053.442KrC5A040198@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 78c209d49d4b - stable/14 - RELNOTES: Mention date(1)'s nanosecond support List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 78c209d49d4b51ad5c2b36898e3c23afcadb26c6 Auto-Submitted: auto-generated The branch stable/14 has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=78c209d49d4b51ad5c2b36898e3c23afcadb26c6 commit 78c209d49d4b51ad5c2b36898e3c23afcadb26c6 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2024-05-02 20:51:45 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2024-05-02 20:52:38 +0000 RELNOTES: Mention date(1)'s nanosecond support This is a direct commit to stable/14. Sponsored by: Klara, Inc. --- RELNOTES | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/RELNOTES b/RELNOTES index 31abd2c7845d..1ec11c872d77 100644 --- a/RELNOTES +++ b/RELNOTES @@ -10,6 +10,11 @@ newline. Entries should be separated by a newline. Changes to this file should not be MFCed. +eeb04a736cb9: + date(1) now supports nanoseconds. For example: + `date -Ins` prints "2024-04-22T12:20:28,763742224+02:00" and + `date +%N` prints "415050400". + 7b9a772f9f64: usbconfig(8) now reads the descriptions of the usb vendor and products from usb.ids when available, similarly to what pciconf(8) does. From nobody Thu May 2 21:09:41 2024 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 4VVmln2FLLz5K3fG; Thu, 2 May 2024 21:09:41 +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 4VVmln1PZsz465N; Thu, 2 May 2024 21:09:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714684181; 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=QGc+Oc/l4ZHUnDycga2I9FoQqZvuuSRda+m7+YnTdZc=; b=arhB8h2Hj9dc2izRhmnjabvwCP+sGaSuAd5kQF5lJAlwvCSasL7zDRlgKSO2tq3ERfCt9C WXf6CEfgxzu2g9IAhje4LBUKuWsXi44WZKIErdeQgnGLvWcfa9eQl7mY/I10is3HYkK64Q wbrwN7tgiZrxMEGKhvBO2kqhVwoFHe7+katwMFZHL10cw3Txy0kXBY2kHAYxH5BfskeooL f6Geou8YiU0a819WJVpPm0hcsUuH0bH55x8h7rfI+6FYuHKL9yIP054hZeADCgAVnha7AH 4ILG/NArMiumkK646X9XfTJaKivW3E1N3drKmkmsyRgUTgroADDif7pvhiRvKQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714684181; a=rsa-sha256; cv=none; b=JRN0/ctPm/D+JopUt8gN5foLtwCCjqNanyaJo3i9Fu17YBAVAtGBKkB2Dpgu7A3cPQmjw2 7a9WJeFgsYnLCdNXGBafX5TNjTYJiFBwTkPpKB/WZTFY6rgfigiLtTW1nW3S3Q9S5TY6ig XVxeGZyXKMIIJYzALwDBXcNChgFp9C1o1lbdGuXOUS3JP2WuL61Xa9qCHrZeCQSZ/C7erO mLWtMolyzs8kD9yodb+eGLc7OiVyW5WZ1WCzfvwNAuUeJ/3rqM+oneuBDMJuBe94tb1vAZ io1Krt5iVR+rdpEUzyAzRX+m0QAxLghwMWOjU3vwI1Aanu6viVNmixRVpHlS/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=1714684181; 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=QGc+Oc/l4ZHUnDycga2I9FoQqZvuuSRda+m7+YnTdZc=; b=PQQT2qcMZkR948ci6bZLEWWWpD6p9Redz/yxmrT2XneE44HKkXFyWskeZe1Db3tUv3m1zO eS24zicBpRqdUPDza0hAQt0pAOqgoa9epaD88lGg/jSv0q7v3v6lbiNPy8/mZGOKYCnirl /XPaqC3I+JxcUvQyA5UKU6VPlgDiwgM+3vD9aQHW61i7da2KC4BvDQNQrtRS1D0aVow+b5 a/efcTEKy+Uem9R9LKuNadq2/K+GymMn9J0eHM/hD0tTIbbMw2BNPhNmewYAp70rSNty8u +IgrpIMqT2SCPtQsxy4ckfJMTonhxjOfraKrBnoMOrfKlmApa5ImE6J7dMGMww== 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 4VVmln0xDczJSN; Thu, 2 May 2024 21:09:41 +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 442L9fnC059289; Thu, 2 May 2024 21:09:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 442L9fmN059286; Thu, 2 May 2024 21:09:41 GMT (envelope-from git) Date: Thu, 2 May 2024 21:09:41 GMT Message-Id: <202405022109.442L9fmN059286@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: eadd4eae929b - stable/14 - bsdinstall: update comment related to pkg List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: eadd4eae929bfc1c09a04a36612681b58e08926d Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=eadd4eae929bfc1c09a04a36612681b58e08926d commit eadd4eae929bfc1c09a04a36612681b58e08926d Author: Bjoern A. Zeeb AuthorDate: 2024-04-25 14:47:30 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-05-02 21:07:33 +0000 bsdinstall: update comment related to pkg pkg_add has been gone since 2013(?). Refer to pkg(8) instead. Sponsored by: The FreeBSD Foundation Reviewed by: jrtc27 Differential Revision: https://reviews.freebsd.org/D44946 (cherry picked from commit ad31d4764255c0848f1f0fa10760d16b5a2922aa) --- usr.sbin/bsdinstall/scripts/docsinstall | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/bsdinstall/scripts/docsinstall b/usr.sbin/bsdinstall/scripts/docsinstall index 8d22fdaa07b6..68a5798b0493 100755 --- a/usr.sbin/bsdinstall/scripts/docsinstall +++ b/usr.sbin/bsdinstall/scripts/docsinstall @@ -148,7 +148,7 @@ f_mustberoot_init dialog_menu_main || f_die f_dialog_menutag_fetch selected -# Let pkg_add be able to use name servers +# Let pkg(8) be able to use name servers f_quietly cp -f $BSDINSTALL_TMPETC/resolv.conf $BSDINSTALL_CHROOT/etc/ # From nobody Fri May 3 00:26:05 2024 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 4VVs6P5kX3z5KL02; Fri, 3 May 2024 00:26: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 4VVs6P5DR7z4f9m; Fri, 3 May 2024 00:26:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714695965; 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=xV4ysH7GOT02QApN9FWzEdCieG0BSr4EadVTGbU8JWc=; b=CqYQBZnYEzZ4El/ssa/BfrN4T0EL4880KiW1Q+yqVR6h72OZMQNzjMDHtuOSpky/MSG5DY QlY0ZNmV/3hH2pG67c8HVMddH4/9B/0aZ66HN8SCw5tGYOsGUXggUGkjj2xJjGq/IVDe1V BMVbcCIKL2AfGx6lmvbjErxlCx5DairvTj/dwGePAUbdQL5MPQzauBc0VWlOLJE/vaVYHh Szu1gFh1K5QV5HdTfokpBtj78TsmGX7cVcPttrI6V5u0NEgCfymVdeibQtdo4jWYXWvTww OZtKAy/ZVb3GfSOLwkwcumH1KrLD6lk6RpVkFWPmU+pMjprIoWRyhZ0InuOyFQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714695965; a=rsa-sha256; cv=none; b=G5BTyEv2D1pE8PFJFRhmQEAs0G9ZoIKgxLJhBJj9iKwN9qehDZLooiImul/sYep3PfK+Us RfOI2nJERd+MURq8HXxeQuSjJk6l7wUoz8QIdj+ysWrFfWWFBj3ZNiuOdCeL52RHAtE3eP RvJZScZMiF6md1MxbpCImHKiCTm44pwy62eEULss0re+HHtpBWwwaaSeVe381OkfBDwEBq 5rTJuha+zcFGcpmlymPWXhnM+mU8GSjjME+UiRy+PODfdPdcJuB3sLsLC4NgunV68Q26TM 82pf6Zj2sZsOcnMHvL/YJ/ehk6cQ1qC0BvzB125ycCi2ufFtx5z1ksmB2kkYvQ== 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=1714695965; 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=xV4ysH7GOT02QApN9FWzEdCieG0BSr4EadVTGbU8JWc=; b=koX4TrV3eTirJX7EAtagFZ1Hm8S92TawUpPEDzcirEt08DVy0biAa34ybb/hSPy/92WZD8 V3bSg+fs4I8hqw8yh6tGdA7xa6FaD5IYXxQHqGNZxFxNQMYBRXwebZrzriBwy3byNduxET wyvtsYIxa8w5ZQNZQNBmB/0g5sf6TRqRJ+Val8jPZoT5B71bPOHQjDItrDXKGeeuVUp0cB Mz1GRM8CoXm0OsWMy14SMWUju8dKY5HU0enhhiBTRzSp27EmjcgPPX6ReMYgth2bgtLKiO eBKtO2sDeTlA7UoT3EGQ1qNLyMao6h/HczYElsg5P4pCaKB7EHinVF/UBuITdQ== 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 4VVs6P4qbHzP1h; Fri, 3 May 2024 00:26: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 4430Q51k097396; Fri, 3 May 2024 00:26:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4430Q5Cd097393; Fri, 3 May 2024 00:26:05 GMT (envelope-from git) Date: Fri, 3 May 2024 00:26:05 GMT Message-Id: <202405030026.4430Q5Cd097393@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: 66e0bf766854 - stable/14 - kcmp_pget(): add an assert that we did not hold the current process List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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: 66e0bf7668548f3bb98dfaf92938b7ebf953b5d2 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=66e0bf7668548f3bb98dfaf92938b7ebf953b5d2 commit 66e0bf7668548f3bb98dfaf92938b7ebf953b5d2 Author: Konstantin Belousov AuthorDate: 2024-04-29 18:51:53 +0000 Commit: Konstantin Belousov CommitDate: 2024-05-03 00:25:33 +0000 kcmp_pget(): add an assert that we did not hold the current process (cherry picked from commit 1e01650a787028fd558e8cb709c232e335fc2cd9) --- sys/kern/sys_generic.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c index f3fd39079a82..dd845e653929 100644 --- a/sys/kern/sys_generic.c +++ b/sys/kern/sys_generic.c @@ -2094,11 +2094,15 @@ kcmp_cmp(uintptr_t a, uintptr_t b) static int kcmp_pget(struct thread *td, pid_t pid, struct proc **pp) { + int error; + if (pid == td->td_proc->p_pid) { *pp = td->td_proc; return (0); } - return (pget(pid, PGET_CANDEBUG | PGET_NOTWEXIT | PGET_HOLD, pp)); + error = pget(pid, PGET_CANDEBUG | PGET_NOTWEXIT | PGET_HOLD, pp); + MPASS(*pp != td->td_proc); + return (error); } int From nobody Fri May 3 00:26:06 2024 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 4VVs6Q6gp9z5KL2X; Fri, 3 May 2024 00:26: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 4VVs6Q6B8bz4f7d; Fri, 3 May 2024 00:26:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714695966; 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=8nYqqT16D6PAwux7yiwzLWsXaWnRMref+nNpv1e2pOc=; b=U6/OI+/1UhYyC6RiH2WXVruIXjugijejjWDRV6kFTPmeFoGQhmTXz45NnPR4fP8QNC+VoS SYFTixZes6X0jVp2gqvTiagDcVMRXi0n4B2wU0uzcipBDdtvRO6xHS/ZaiH9w2LtymNIBR AcSv6Qfv2TW097/dQ5t/LckT1O6NJ0oqNwQJxw4F/1Az23eXAYKXIDbIoNdRtpNMdelL7N 8PBIGPjtJgn0qld41yx0t07ByC69QUMGZCnXhKBjbbyRJjhyk/RQcF6d7xBqxfWZx478SR y6YPeajnQ2Edu5A2vSaCRlOO760ybVChjuaIrSFdwpVUNQnOM0i3dywe/oo5FQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714695966; a=rsa-sha256; cv=none; b=o3ukD96R69s7SKksTx0TXn9Yg4fW3JUn2AlusFE4or9OTG/pDA+1tpz5ytGEWa+A3vXcki n1agfcuvqCqYdC03BwBCuITthM/n2X7X5Wr0xMy5u70JVe1Q7A5+Yg51+qaWxzW4C7D0cu JjfCGGt4hKpO+u0ewkPLUc/8sYm9ap7UUEHTQYQupeKNVinwCQzYJueAgzwGBdODoWg2BU +jv6DD98RI9WjVcDkCujpcyRdW0eixmv9LWOlrgulLM66HF7gVTXVp7VXZQxn1XylIXW7B ZhlcD4edGPGU5WEA2Scinq+jfw+ykeMrcQSsv0BzyBgVbY+tABbp+M0WiKnvzA== 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=1714695966; 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=8nYqqT16D6PAwux7yiwzLWsXaWnRMref+nNpv1e2pOc=; b=N3SmyuT5jH09L9Dz9jDCaQqX0XQUhsqG00xp5TVyobvd1ltlyhJ6O2Z/PeN66z7tsrUtIN //NRdYe+UhvAE9hSCAzmvrsmCQ72tTEJCSydB1b83dtWE9wL91EHlxrntgOnC2d9CmsK/C HrSQL1gZQXroPl0smkLms0ZUSLozXemM7s1wnx61dVt4bJaUyVqJUuYIU+hDQIWM5+iI5P fpsRp0dQdmQz3stcdMMzGoWQsWiYhB7afrlm6KuVOP0ZHVP+7LWkjTmhjSCfKZgdnn+bZV l9vRvjNtXH7KGpR/aj4ZBojmXFsF24ZBaW8sCvNMr5azsY5NA/2EEAmoV9rSYA== 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 4VVs6Q5n76zP1j; Fri, 3 May 2024 00:26: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 4430Q6A5097438; Fri, 3 May 2024 00:26:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4430Q6tu097435; Fri, 3 May 2024 00:26:06 GMT (envelope-from git) Date: Fri, 3 May 2024 00:26:06 GMT Message-Id: <202405030026.4430Q6tu097435@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: 33cac296a266 - stable/14 - kcmp_pget(): do not accept TIDs List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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: 33cac296a2668ffe142950238baac2aea6fad709 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=33cac296a2668ffe142950238baac2aea6fad709 commit 33cac296a2668ffe142950238baac2aea6fad709 Author: Konstantin Belousov AuthorDate: 2024-04-29 21:04:25 +0000 Commit: Konstantin Belousov CommitDate: 2024-05-03 00:25:33 +0000 kcmp_pget(): do not accept TIDs (cherry picked from commit 5b3e5c6ce3e552dae3e84d6bc781bc9f53c22d71) --- sys/kern/sys_generic.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c index dd845e653929..77e4c13d4390 100644 --- a/sys/kern/sys_generic.c +++ b/sys/kern/sys_generic.c @@ -2100,7 +2100,8 @@ kcmp_pget(struct thread *td, pid_t pid, struct proc **pp) *pp = td->td_proc; return (0); } - error = pget(pid, PGET_CANDEBUG | PGET_NOTWEXIT | PGET_HOLD, pp); + error = pget(pid, PGET_NOTID | PGET_CANDEBUG | PGET_NOTWEXIT | + PGET_HOLD, pp); MPASS(*pp != td->td_proc); return (error); } From nobody Fri May 3 00:26:07 2024 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 4VVs6S23l0z5KKxf; Fri, 3 May 2024 00:26: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 4VVs6S08Z5z4f9x; Fri, 3 May 2024 00:26:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714695968; 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=f4sdZ0wHWeKgu+847qW00l7m1tmuU1+/fir5SfXb+sc=; b=yLajQgkDMcqWeAGc9eO2dWzFwlbmmVW0JdBkOepvhMYHbBzuAJ1Sd6siOvkMAVFnTav80p tjTF+PakTWxHncCjw9waluqIy+BHNaPnM5pgH8IMUYiCZzA9MH0887KPz7AeUJei6hJSm5 tsvZ2VWW6c2EM1RhHNfh9CNJOiK1mFMnTfXA08NUhhw20tQCZ9K6Iez1+feSOQB/cZ5/pA 6FJ4NLNIR0DBI5yOUSB7YYDOirmRan67SUgBi5ds8sDLlhfeWWK9IfLTupe93RG02NmWjr 6EwmNG6GA8mjpyhS4yPS55vka2Qaed32AtBCy5HkjAmbBPNYAtiimaw5pFVbvQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714695968; a=rsa-sha256; cv=none; b=egihpsBx3Pb3xatX786FUQqnV47lNYjIbjLIGxMc/svCcTK/vKHae5dxJHn9BB6IASUNHQ xsu6t+Yi/gOXhmPSMEEbAMGo8HFPo6tE8LZXmECK4cDipsuBgFopXgw7jc9T+9Yq224X/U 43PQXGB/CYCeCCGfmhqIj72EZKugYidi+D3SAKDR3/6CCAnn7fXgMK5bY/BO0YbS73HnAS 8BUvah1LezlSH8ldkcFCD88Ulnuk3OfQ4akAA7A6n9DaqoXZ8AC8hAFNPrCobDkHtybxXk +8WaKt06eCbzYxKQMCLHz90tqy2cOc/toTVWVZC70IHjVbpZ1yoQ5VSA8In/oA== 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=1714695968; 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=f4sdZ0wHWeKgu+847qW00l7m1tmuU1+/fir5SfXb+sc=; b=U0pfUTEqle5N9kbIRO7fri5WhPRg+qQ02Cv2ZkRHu+37IZK7n+ygAHW9q0W+6eulAmxe9l F7p5IJq1CcHnbxUrK+BSF2xoNq63Dg55I//R+SMzB7n3ragbAnF2QlBZ13GNWx6CzUnDEN pLMLis0Us5V+2Dd+yJWDq1fCHmo3bjOHQfkcdo7KOdHbOXWBj9qdjpKluU61q67T71C15S 8yGXpirkDcKvpeoWaDSkQf76gj+DMG0MwHnR2o6PDIxnaQqjzdVl2sME2OdMg5ydfr/gBj MqRfA29w2oXtQrSYgsmibjqWVS0aJT9j+9gcXKXMx7ENLjOaVrAHd7GWl3TUEg== 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 4VVs6R6s6NzPHQ; Fri, 3 May 2024 00:26:07 +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 4430Q7OZ097501; Fri, 3 May 2024 00:26:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4430Q72T097498; Fri, 3 May 2024 00:26:07 GMT (envelope-from git) Date: Fri, 3 May 2024 00:26:07 GMT Message-Id: <202405030026.4430Q72T097498@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: 44debee9fc1f - stable/14 - rtld snprintf: do not erronously skip a char at the buffer boundary List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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: 44debee9fc1fc795b928f75b5d894c3212d73893 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=44debee9fc1fc795b928f75b5d894c3212d73893 commit 44debee9fc1fc795b928f75b5d894c3212d73893 Author: Konstantin Belousov AuthorDate: 2024-04-28 06:37:24 +0000 Commit: Konstantin Belousov CommitDate: 2024-05-03 00:25:33 +0000 rtld snprintf: do not erronously skip a char at the buffer boundary (cherry picked from commit 56ee5fc43c40479e2651b21862e299bcf73017ae) --- libexec/rtld-elf/rtld_printf.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/libexec/rtld-elf/rtld_printf.c b/libexec/rtld-elf/rtld_printf.c index 07598c73c6d4..befac1c547b7 100644 --- a/libexec/rtld-elf/rtld_printf.c +++ b/libexec/rtld-elf/rtld_printf.c @@ -81,11 +81,10 @@ snprintf_func(int ch, struct snprintf_arg *const info) } break; case PRINT_METHOD_WRITE: - if (info->remain > 0) { - *info->str++ = ch; - info->remain--; - } else + if (info->remain == 0) printf_out(info); + *info->str++ = ch; + info->remain--; break; } } From nobody Fri May 3 00:26:43 2024 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 4VVs781Zn5z5KKxl; Fri, 3 May 2024 00:26: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 4VVs7816LCz4fxV; Fri, 3 May 2024 00:26:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714696004; 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=/EhhDBZsQBHKtjk87XjkdSRuTcti77GY0RYsbPWBMUc=; b=i3bst8l+OQKaL9cWU8aGTgRViZXuzO7LXk4xE+YmAM/0qsWHe0iCyCMebd7WAgUmKPIeoD WASXL/jscGmC4WrRGZ0C4GBBX6JtQUE5hy98dG8CkMjQEwty4zgKtM0D0eYSAJ6eFHW8DT eSzUDOqYr79Y6DI8cviq8l1Hmp7UWAQylqGhGJagzHfXYaX7wf1if8Sa3nIqb2kZOZUO8a iwOjjl9jHvzzXbAyMZuD/AkFfrl+m3gRyjGXhOWccj9W0i+zj/P78Pd2D5y55NY8pQDIoQ nQIbHGzecT5s3BlEqmJEJUrRtAQpshuSkxukGiPIyG39uS42W12EkULMtV3kxw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714696004; a=rsa-sha256; cv=none; b=sm3V9RvKTvyRpmetTb0q0V7tV+VpIKEjnFUw4aFbXGEGnYQaKlsKyJfn236nhWiKZyHyh6 jaVBgAiesrGQd/wfJIayG6w69sNMAFVbfbWzeMA+dvNiT0TWYmwcGV3Cai67dRzPvs2XmS M5sznmcepUvpMC3hRvFhZkRJsyjToAnBc7odAxO5HW1W+U5HA7/0lw/dmR15KhcN2MEaH+ 0T5o5xYyh9UB9XyAwW4e51uuB5CbipfOevhXRDjoqmFUINKZ8Iik4NxSC1/X1cKQMNpLwl p+90w1oUbD8PijRnTL5rul6fk0+N+DyeZ10pH7dnd4bNK6rlVUtFsz+BWafnHg== 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=1714696004; 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=/EhhDBZsQBHKtjk87XjkdSRuTcti77GY0RYsbPWBMUc=; b=xi+qXf+wVcw0PlLK+65c5LZAzrTgR7DmiK2zpT7VoxLeUgP/XMHP3lMtPYUHel4lBAYwdc TpTMLftuFpl993tuXscQFTQb35E10olWqa32lW42U6lXoE0KZCdEWCVyX3tiAfihKm8/uy J0kjIrjMgRB06OkAST9yqLp5orYwFHs7gRqyVrSW2Vp2LhtTIGGty93Xtu4S/GaH7KCqUb UoANLrPNXRmKjXxrdP8XJtv3aPgpmgoTnQXA2SpZmd572itRFBNxXpH88Nbw5s4Ka/QJgz /XXk201SjwHkpTKj1WD8ZliJv1HtPbcQqzPIZ5w4hZ2x18C1aLduFoyt41byOg== 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 4VVs780jxLzP8r; Fri, 3 May 2024 00:26: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 4430QhDO097744; Fri, 3 May 2024 00:26:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4430QhtP097741; Fri, 3 May 2024 00:26:43 GMT (envelope-from git) Date: Fri, 3 May 2024 00:26:43 GMT Message-Id: <202405030026.4430QhtP097741@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: 6b667b46ab19 - stable/13 - kcmp_pget(): add an assert that we did not hold the current process List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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: 6b667b46ab192d00a280ffdab60ff523a88495e4 Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=6b667b46ab192d00a280ffdab60ff523a88495e4 commit 6b667b46ab192d00a280ffdab60ff523a88495e4 Author: Konstantin Belousov AuthorDate: 2024-04-29 18:51:53 +0000 Commit: Konstantin Belousov CommitDate: 2024-05-03 00:26:25 +0000 kcmp_pget(): add an assert that we did not hold the current process (cherry picked from commit 1e01650a787028fd558e8cb709c232e335fc2cd9) --- sys/kern/sys_generic.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c index 32f137f0cb4c..f2d099f7a0c4 100644 --- a/sys/kern/sys_generic.c +++ b/sys/kern/sys_generic.c @@ -2018,11 +2018,15 @@ kcmp_cmp(uintptr_t a, uintptr_t b) static int kcmp_pget(struct thread *td, pid_t pid, struct proc **pp) { + int error; + if (pid == td->td_proc->p_pid) { *pp = td->td_proc; return (0); } - return (pget(pid, PGET_CANDEBUG | PGET_NOTWEXIT | PGET_HOLD, pp)); + error = pget(pid, PGET_CANDEBUG | PGET_NOTWEXIT | PGET_HOLD, pp); + MPASS(*pp != td->td_proc); + return (error); } int From nobody Fri May 3 00:26:45 2024 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 4VVs792b11z5KL2f; Fri, 3 May 2024 00:26:45 +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 4VVs791x2gz4g1w; Fri, 3 May 2024 00:26:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714696005; 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=NqWF66lTSzQ431hEUus+rJyDs27DXQbHgxtX4amoTyY=; b=Actczap42HRBakZlHzs5beGp4gwVcsPfA6hQwtbudcY+lqpGs/vd97n85ME3DAvJRu2iCe ZtCJt3oiaNeOe/pM0nT1O4bfz/mtmegCr1yD6IEl9SkZIOFkJFOHa+OeKkUqzXi9s9yTSh YG91cOHP5c3eWv5YnVQIz8DKfjJa4rlImuA4DVI5r4d1J5pfJxwKkHj+jXEpqa81Jt5eOr pWpi64oMqJ5zLxjzMBRVw365N6M4AjnmvFPCIorAWu08RhHihk2ydLfz038BJ3NOhrkZD9 6M7wm3QuDnEOnZXsRuCGCk9KkZHjf5hWw8zzS8ayeoRLMe40vX/TbCTMpCaIQw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714696005; a=rsa-sha256; cv=none; b=CqJn5UPkrRW+8n3ilzmf3jIfwEaxDG3C3KQeDR4G3MfkmUhEH5c0rJLUQ40sAbK3WhFhZv M7bDumf20cexVwgabSo4Zp6P1vKn8AzLcw4AqzEcoa2VDa2/eD07sCzld6fzD3E+67mYG3 kdaq6MhOvc9pklu3feoCq1w2qmd8FrgW9Fr7yGpf7o87Ify7cOXgFUjpYiwXWlYkY+az5B NuFY0eSGiOPeH4Zc9euV/SMdR99zZ9xJfTAHNvlVpMvpEZvc/Sg/GOlJVBEtOQTbZX1OiW y0usLp1OZA6I2i3Hzhr3fHNWqH0MJ0BvSP6gkFaLsdGpYTAWVUrD+J3vMeXCJg== 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=1714696005; 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=NqWF66lTSzQ431hEUus+rJyDs27DXQbHgxtX4amoTyY=; b=ScRrT8BLbXxh140ZlQ7WJSuSSUJy2XDMXNkbTE+UwYyCer6Np9X8psBhLID536yA0PBRbS bFYFJhoA3VLiCcf397gd3b6FjRGMA2OyIKzdV5mObusb3bhbbBXwjDCDhKJzYbAYELFXOh 7eM4rN+VKqcBnvsFgGEPyqgCnpVSUijA5qZkKX/GVt2ewGW/800vNpo+Ox6PSk9/ZN0XAN XwlOzytnbhlZkOsXMgeDtopdpwO0SzOYo9idziGxW3tKlEHjrdJuG4heE7bUFE28P6GZI6 UU1pynVr/AW+7eofHRPYI3utAQ+KHD1jd/c49QKtQoitzpYl0Ejstm5kKa39nQ== 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 4VVs791W5SzNdZ; Fri, 3 May 2024 00:26: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 4430Qj8w097790; Fri, 3 May 2024 00:26:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4430Qjca097787; Fri, 3 May 2024 00:26:45 GMT (envelope-from git) Date: Fri, 3 May 2024 00:26:45 GMT Message-Id: <202405030026.4430Qjca097787@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: cf2750be9e32 - stable/13 - kcmp_pget(): do not accept TIDs List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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: cf2750be9e3234f7fd8b1534118a562e4128d222 Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=cf2750be9e3234f7fd8b1534118a562e4128d222 commit cf2750be9e3234f7fd8b1534118a562e4128d222 Author: Konstantin Belousov AuthorDate: 2024-04-29 21:04:25 +0000 Commit: Konstantin Belousov CommitDate: 2024-05-03 00:26:26 +0000 kcmp_pget(): do not accept TIDs (cherry picked from commit 5b3e5c6ce3e552dae3e84d6bc781bc9f53c22d71) --- sys/kern/sys_generic.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c index f2d099f7a0c4..a0a13e77131b 100644 --- a/sys/kern/sys_generic.c +++ b/sys/kern/sys_generic.c @@ -2024,7 +2024,8 @@ kcmp_pget(struct thread *td, pid_t pid, struct proc **pp) *pp = td->td_proc; return (0); } - error = pget(pid, PGET_CANDEBUG | PGET_NOTWEXIT | PGET_HOLD, pp); + error = pget(pid, PGET_NOTID | PGET_CANDEBUG | PGET_NOTWEXIT | + PGET_HOLD, pp); MPASS(*pp != td->td_proc); return (error); } From nobody Fri May 3 00:26:46 2024 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 4VVs7B6Klsz5KKcm; Fri, 3 May 2024 00:26: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 4VVs7B30trz4g91; Fri, 3 May 2024 00:26:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714696006; 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=LjRO6hlEb13mvPWc+FLLTILqK7/y0zkjtd8Ge1YTUuw=; b=Q4TPeK8jUthcNWIPJTYWo1CqGJp/Oc+8aI24WfFl6UVQ6062vGjGG/IzpE3ZxV4fFpfApZ IpcnajJK9r0uduSadrbQlDgrjk+yC7/xLH7bB2IQYG8yHBCmCOEVQOezVfEAsCJ31DbeJO LuQQkoyRDk0VtkEWiIma5u4EnYzolDtC/DTmfrTEm7/21JT0wg266cBYAsedaFQtUXfWx3 IgiTqjKsnDK9PE5NMZViDb8a/6me9pUipCzXGlrQlKEUEkuwIzgrEATU/QpEZOW8TFDqOl +pLdrX2bd9XRf3XkOhPGeHNkHdJL/urqjns4BSflbraWQiCpkxbAKsDauqRYtg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714696006; a=rsa-sha256; cv=none; b=Dns97O1kFwfL4MZdgyOxIhRlQAQl2/Hx1B4KfSgur2sbrJSY5Xe+RX8PsG/rRILmkoKOsU rCKgXOqfZ9bNKUVTq56NCTomCQPSTF8L95m6/TZLkWR/OVC1Zlore3aArU27qHvsG8Pat7 gW6GrtudQfJSXW95gva506qGkYgxvKIRTqzxA7kXD7CrHkGWuOdUlNUth74zklxo5kj/Xu tpZeenRWujUgSIMh3BqmiSqznF9OLNovHSu6cOJWmxWNSYswebeEy/E7DZD5dgPciHF/Zh XE8wGLCXRBYLEDK7wBRLCtm3azgBQWjIzcl3CbMRSbVX9Plz/RCly8i056XzFg== 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=1714696006; 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=LjRO6hlEb13mvPWc+FLLTILqK7/y0zkjtd8Ge1YTUuw=; b=WDcRApd5P7wiPu6sx9U58P9MBaWLjnQn7WRVoRCEXOg3W4+X/xXxAG5mGvpNeFzt9L+HAe DJQP6mZeN1I4LoMLWF+ERYm05J4EfRCBWqVm6CbkdXW9K6gu3IZYo60fQHe3rLk9jgKh3d NzyRIx63D6zNoRX5DGXcKYJF7KJSJqooQr0ltc1il4i2xuHA6k2TCwWj/GkgtpXV/D8ALC nh0Yw7qIxcxvQywqpHIlXJipOMDbRo19DIVX/ctIctjavh1INKX5+X61klBnpVZnzOYLh9 Mli/iNZWk5/MhD5DNLgpEJRjzaWz3tM1/rRSNN5cQERRGVrkzgTFR3tMa/mevw== 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 4VVs7B2bFXzPHR; Fri, 3 May 2024 00:26: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 4430QkFe097857; Fri, 3 May 2024 00:26:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4430Qkxk097854; Fri, 3 May 2024 00:26:46 GMT (envelope-from git) Date: Fri, 3 May 2024 00:26:46 GMT Message-Id: <202405030026.4430Qkxk097854@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: d9ec850bde3c - stable/13 - rtld snprintf: do not erronously skip a char at the buffer boundary List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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: d9ec850bde3c8695bebfdfeea72deb1d060cd183 Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=d9ec850bde3c8695bebfdfeea72deb1d060cd183 commit d9ec850bde3c8695bebfdfeea72deb1d060cd183 Author: Konstantin Belousov AuthorDate: 2024-04-28 06:37:24 +0000 Commit: Konstantin Belousov CommitDate: 2024-05-03 00:26:26 +0000 rtld snprintf: do not erronously skip a char at the buffer boundary (cherry picked from commit 56ee5fc43c40479e2651b21862e299bcf73017ae) --- libexec/rtld-elf/rtld_printf.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/libexec/rtld-elf/rtld_printf.c b/libexec/rtld-elf/rtld_printf.c index 07598c73c6d4..befac1c547b7 100644 --- a/libexec/rtld-elf/rtld_printf.c +++ b/libexec/rtld-elf/rtld_printf.c @@ -81,11 +81,10 @@ snprintf_func(int ch, struct snprintf_arg *const info) } break; case PRINT_METHOD_WRITE: - if (info->remain > 0) { - *info->str++ = ch; - info->remain--; - } else + if (info->remain == 0) printf_out(info); + *info->str++ = ch; + info->remain--; break; } } From nobody Fri May 3 04:52:16 2024 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 4VVz1X4wR1z5JFqk; Fri, 3 May 2024 04:52: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 4VVz1X4RYWz427n; Fri, 3 May 2024 04:52:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714711936; 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=dF2gBfH2YxQTgzIZEAlpy8CTJbcXNVArfy1tkI1HkuQ=; b=cuPcWF+2mL6x+D2OCTKvCZTD04L0IAIlBBCl396971NusWMbQ96ykHEBS8lvuUeq1EnZtB oB0h9Yud74GG/eJ/bMqnYhjBZkO4UvjqrTyWvxwN1kwwD2FY0M1VT6Vp5px7cE7qZd33UT CcvZ819BWwg/F/+TVtIhUHmqu6GtiKR0F+clK3KL81Mmh248Qto5myQoIMs4JhO8anh7rO nFN5Bz1854nKW6pic+qddbpSa3dtIj4be+fi2cfGkSiWrGrt1/3mNo2UYO645m8Q+QMJj4 DRC15konBieQA5gt7k4XpVLJ1LPiZhdYLyg3A+C88hGnw84TAXwLsZTmt6NssA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714711936; a=rsa-sha256; cv=none; b=MK3EZfsGhtW9lmwuTBhzb+FW4FnZ0FZFqw7O0z6J4TaT/w3LQPLbgBXV9ttb/ETUlO5cl9 8Xut3uvI7VY0fTdgXoyhWnI3y5qSIqDekfzjbaZncsmuUOtrETQ2R7bb1+LuGOSpd9geVm 41fIZiEExfxNFwxR1MmkgsenPz8kN8h/AIDE+B2qtnJa1O/FYjGG/ngcIHcgB4VBA0guuC GBvT6Q5kZ5QRoVFZLkalE2E0RZSKfX34oRz4JEIE2mV6EJoa0IiCOOEs5GCUeLHOgj/OPh +0HbAQLE+xDCZfH8lHZzvOds01qtlcC3U9/RchBVj8WlC2gePUlY8461WjBPPg== 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=1714711936; 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=dF2gBfH2YxQTgzIZEAlpy8CTJbcXNVArfy1tkI1HkuQ=; b=gtIZCLEDx3BXrc6tItnEA7EZqJtBkx1vuqQ072sV+7oBbriE4p3R21KdN8dYL2/BNJvkJD b7lkMceHbkSTCj+S90lv7sElXmJylkdbwLEKV+6l4LVNHPQPnbLeh+trt16cPjKBve+S88 iLdOQDed336fmqsGfM0f2c8iZ2YWU/BZQ6kvzRZoDYiWXEAJM6RUjth4JM4FqYJUcJvmb+ sF0wwtimCUqqqC2c8mNyhOQeCVYtO4AaprMhGbnzokosZa3SYXKp9sEaP12/eX3YBYGPGo GwSqsFbWt7/6Ahv+bq5cZ8mn1xatx/5KSTi7rZNetgAAb6MBMVoMBp9GQXrLFg== 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 4VVz1X42h6zY2H; Fri, 3 May 2024 04:52: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 4434qGMC053928; Fri, 3 May 2024 04:52:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4434qG0u053925; Fri, 3 May 2024 04:52:16 GMT (envelope-from git) Date: Fri, 3 May 2024 04:52:16 GMT Message-Id: <202405030452.4434qG0u053925@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Martin Matuska Subject: git: c4d0e1f6214d - stable/14 - libarchive: merge bugfixes from vendor branch List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c4d0e1f6214d2a072654f641f81b3eee71a699f2 Auto-Submitted: auto-generated The branch stable/14 has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=c4d0e1f6214d2a072654f641f81b3eee71a699f2 commit c4d0e1f6214d2a072654f641f81b3eee71a699f2 Author: Martin Matuska AuthorDate: 2024-04-30 09:53:06 +0000 Commit: Martin Matuska CommitDate: 2024-05-03 04:51:37 +0000 libarchive: merge bugfixes from vendor branch #2147 archive_string: clean up strncat_from_utf8_to_utf8 (36047967a) #2153 archive_match: check archive_read_support_format_raw() return value (0ce1b4c38) #2154 archive_match: turn counter into flag (287e05d53) #2155 lha: Do not allow negative file sizes (93b11caed) #2156 tests: setenv LANG to en_US.UTF-8 in bsdunzip test_I.c (83e8b0ea8) (cherry picked from commit c0b58e65deca1e5e2c434ede7e64f03af6044be8) --- contrib/libarchive/libarchive/archive_match.c | 18 ++-- .../libarchive/archive_read_support_format_lha.c | 2 + contrib/libarchive/libarchive/archive_string.c | 96 ++++++++++------------ contrib/libarchive/unzip/test/test_I.c | 8 ++ 4 files changed, 61 insertions(+), 63 deletions(-) diff --git a/contrib/libarchive/libarchive/archive_match.c b/contrib/libarchive/libarchive/archive_match.c index fc8a4ce8127b..3ab8eda36038 100644 --- a/contrib/libarchive/libarchive/archive_match.c +++ b/contrib/libarchive/libarchive/archive_match.c @@ -46,7 +46,7 @@ struct match { struct match *next; - int matches; + int matched; struct archive_mstring pattern; }; @@ -605,7 +605,8 @@ add_pattern_from_file(struct archive_match *a, struct match_list *mlist, return (ARCHIVE_FATAL); } r = archive_read_support_format_raw(ar); - r = archive_read_support_format_empty(ar); + if (r == ARCHIVE_OK) + r = archive_read_support_format_empty(ar); if (r != ARCHIVE_OK) { archive_copy_error(&(a->archive), ar); archive_read_free(ar); @@ -724,12 +725,12 @@ path_excluded(struct archive_match *a, int mbs, const void *pathname) matched = NULL; for (match = a->inclusions.first; match != NULL; match = match->next){ - if (match->matches == 0 && + if (!match->matched && (r = match_path_inclusion(a, match, mbs, pathname)) != 0) { if (r < 0) return (r); a->inclusions.unmatched_count--; - match->matches++; + match->matched = 1; matched = match; } } @@ -752,11 +753,10 @@ path_excluded(struct archive_match *a, int mbs, const void *pathname) for (match = a->inclusions.first; match != NULL; match = match->next){ /* We looked at previously-unmatched inclusions already. */ - if (match->matches > 0 && + if (match->matched && (r = match_path_inclusion(a, match, mbs, pathname)) != 0) { if (r < 0) return (r); - match->matches++; return (0); } } @@ -879,7 +879,7 @@ match_list_unmatched_inclusions_next(struct archive_match *a, for (m = list->unmatched_next; m != NULL; m = m->next) { int r; - if (m->matches) + if (m->matched) continue; if (mbs) { const char *p; @@ -1793,7 +1793,7 @@ match_owner_name_mbs(struct archive_match *a, struct match_list *list, < 0 && errno == ENOMEM) return (error_nomem(a)); if (p != NULL && strcmp(p, name) == 0) { - m->matches++; + m->matched = 1; return (1); } } @@ -1814,7 +1814,7 @@ match_owner_name_wcs(struct archive_match *a, struct match_list *list, < 0 && errno == ENOMEM) return (error_nomem(a)); if (p != NULL && wcscmp(p, name) == 0) { - m->matches++; + m->matched = 1; return (1); } } diff --git a/contrib/libarchive/libarchive/archive_read_support_format_lha.c b/contrib/libarchive/libarchive/archive_read_support_format_lha.c index 4d6290ac33bb..ae5a1d7d668e 100644 --- a/contrib/libarchive/libarchive/archive_read_support_format_lha.c +++ b/contrib/libarchive/libarchive/archive_read_support_format_lha.c @@ -1347,6 +1347,8 @@ lha_read_file_extended_header(struct archive_read *a, struct lha *lha, lha->compsize = archive_le64dec(extdheader); extdheader += sizeof(uint64_t); lha->origsize = archive_le64dec(extdheader); + if (lha->compsize < 0 || lha->origsize < 0) + goto invalid; } break; case EXT_CODEPAGE: diff --git a/contrib/libarchive/libarchive/archive_string.c b/contrib/libarchive/libarchive/archive_string.c index f39677ad7a26..be6c39600d72 100644 --- a/contrib/libarchive/libarchive/archive_string.c +++ b/contrib/libarchive/libarchive/archive_string.c @@ -2640,81 +2640,69 @@ unicode_to_utf16le(char *p, size_t remaining, uint32_t uc) } /* - * Copy UTF-8 string in checking surrogate pair. - * If any surrogate pair are found, it would be canonicalized. + * Append new UTF-8 string to existing UTF-8 string. + * Existing string is assumed to already be in proper form; + * the new string will have invalid sequences replaced and + * surrogate pairs canonicalized. */ static int -strncat_from_utf8_to_utf8(struct archive_string *as, const void *_p, +strncat_from_utf8_to_utf8(struct archive_string *as, const void *_src, size_t len, struct archive_string_conv *sc) { - const char *s; - char *p, *endp; - int n, ret = 0; - + int ret = 0; + const char *src = _src; (void)sc; /* UNUSED */ + /* Pre-extend the destination */ if (archive_string_ensure(as, as->length + len + 1) == NULL) return (-1); - s = (const char *)_p; - p = as->s + as->length; - endp = as->s + as->buffer_length -1; - do { + /* Invariant: src points to the first UTF8 byte that hasn't + * been copied to the destination `as`. */ + for (;;) { + int n; uint32_t uc; - const char *ss = s; - size_t w; + const char *e = src; - /* - * Forward byte sequence until a conversion of that is needed. - */ - while ((n = utf8_to_unicode(&uc, s, len)) > 0) { - s += n; + /* Skip UTF-8 sequences until we reach end-of-string or + * a code point that needs conversion. */ + while ((n = utf8_to_unicode(&uc, e, len)) > 0) { + e += n; len -= n; } - if (ss < s) { - if (p + (s - ss) > endp) { - as->length = p - as->s; - if (archive_string_ensure(as, - as->buffer_length + len + 1) == NULL) - return (-1); - p = as->s + as->length; - endp = as->s + as->buffer_length -1; - } - - memcpy(p, ss, s - ss); - p += s - ss; + /* Copy the part that doesn't need conversion */ + if (e > src) { + if (archive_string_append(as, src, e - src) == NULL) + return (-1); + src = e; } - /* - * If n is negative, current byte sequence needs a replacement. - */ - if (n < 0) { + if (n == 0) { + /* We reached end-of-string */ + return (ret); + } else { + /* Next code point needs conversion */ + char t[4]; + size_t w; + + /* Try decoding a surrogate pair */ if (n == -3 && IS_SURROGATE_PAIR_LA(uc)) { - /* Current byte sequence may be CESU-8. */ - n = cesu8_to_unicode(&uc, s, len); + n = cesu8_to_unicode(&uc, src, len); } + /* Not a (valid) surrogate, so use a replacement char */ if (n < 0) { - ret = -1; - n *= -1;/* Use a replaced unicode character. */ - } - - /* Rebuild UTF-8 byte sequence. */ - while ((w = unicode_to_utf8(p, endp - p, uc)) == 0) { - as->length = p - as->s; - if (archive_string_ensure(as, - as->buffer_length + len + 1) == NULL) - return (-1); - p = as->s + as->length; - endp = as->s + as->buffer_length -1; + ret = -1; /* Return -1 if we used any replacement */ + n *= -1; } - p += w; - s += n; + /* Consume converted code point */ + src += n; len -= n; + /* Convert and append new UTF-8 sequence. */ + w = unicode_to_utf8(t, sizeof(t), uc); + if (archive_string_append(as, t, w) == NULL) + return (-1); } - } while (n > 0); - as->length = p - as->s; - as->s[as->length] = '\0'; - return (ret); + } } static int diff --git a/contrib/libarchive/unzip/test/test_I.c b/contrib/libarchive/unzip/test/test_I.c index 5d31ce8d1611..d189edca1a5c 100644 --- a/contrib/libarchive/unzip/test/test_I.c +++ b/contrib/libarchive/unzip/test/test_I.c @@ -33,6 +33,7 @@ DEFINE_TEST(test_I) { const char *reffile = "test_I.zip"; + const char *lang; int r; #if HAVE_SETLOCALE @@ -44,6 +45,8 @@ DEFINE_TEST(test_I) skipping("setlocale() not available on this system."); #endif + lang = getenv("LANG"); + setenv("LANG", "en_US.UTF-8", 1); extract_reference_file(reffile); r = systemf("%s -I UTF-8 %s >test.out 2>test.err", testprog, reffile); assertEqualInt(0, r); @@ -51,4 +54,9 @@ DEFINE_TEST(test_I) assertEmptyFile("test.err"); assertTextFileContents("Hello, World!\n", "Γειά σου Κόσμε.txt"); + + if (lang == NULL) + unsetenv("LANG"); + else + setenv("LANG", lang, 1); } From nobody Fri May 3 06:18:31 2024 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 4VW0x40BN6z5JNj5; Fri, 3 May 2024 06:18: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 4VW0x36nRkz48vK; Fri, 3 May 2024 06:18:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714717112; 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=GsybnLeUx4xQMwyIlEHUkWsn83I6FOluL2rbHep1bRk=; b=NyH2uk97hArBZw03w0GZ7rCnMHzklYn3gGQNAjybS6U5/FbxmCtCCG1ozo/r+Jw3H0vDuD eoHDK3joraHBFVPiFOD6I2TS1lBA3XIZwckcxGgQldVy8y+75bD9YZRTVwsaLyfE0p0muQ OovTntPsPQjuRSA881Omd6LbpkNw/WaK9WmtIWas5CL620olkY5aygmItbhncnzG5J3wKV T45pj9wK6n61HYmwx3QL6LR8FVMmMWtubj4kFYGlsGBlAXAvD00CR2CNmdoNvQ+6qBSvv0 9uYfvGg6GlY1LUKH0iNszzkCx8/qmU3CszPVHZHO6dvyDAXi5SSfZqcnpE5+Zg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714717112; a=rsa-sha256; cv=none; b=YpzcZsNGZbppYQUmxLA3SfaYcHF2CN60imwL1FVTDjTEbsKZZ0ZTxnQfAlkAPgN7x+wckU X0L97ra+3z6lNEhYAyMFeOCwe+YVilPtxJCX96FIU8rFK6nhAh08OZUv8vdljc3TEMrA05 T0h2hCqk5n/Hrr6WwWzd8L4iFdJt9H7qBpuHYovckNrtGgVCWmwIuxK574N1IxDzhLInvi yY3tV9BFZ0P5ETZstb0GNNiYotUcBruDvHxV9YI7oor7/SMwZ29t73HiFbxPY58otYHGpx ptxi29YHEfms14SQfItPjQPSaVeprOjDvE2DFTViiJ4vXrFPztL+24qaA5xipA== 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=1714717112; 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=GsybnLeUx4xQMwyIlEHUkWsn83I6FOluL2rbHep1bRk=; b=NgBcfv8kWfdjZBJOg+9cVCzmE0ob5b4unLejFZKwkE03nPVDa5MH+iqkbXzBFk8lNNVyTD XX0AVmOzpZaiZkJiMIGP8V7Po5VLPhrlkJnTJd5ojdhsnYVByf44Lt6Y8Pat8ufs6qB9x3 CE10ww13D6DaAh1aGbn1Te+jVbYrC7f935Snfthgo4YkXlegj1FwtONNH2w+Iu/p3CUDZm tbAMzH69xVM61i7QdZ96+JggcTeTkQXXkjB0GTgiW9mwcrXwhjdSv0iULxP2EXZ51DGBHT 2urlsxzdKDa31uruzG/xnBCHYibbe/bq68fmUL6slySPmIVGUMmpHA+Qg/6ZBQ== 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 4VW0x36BQjzb4R; Fri, 3 May 2024 06:18: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 4436IVfS090460; Fri, 3 May 2024 06:18:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4436IViV090457; Fri, 3 May 2024 06:18:31 GMT (envelope-from git) Date: Fri, 3 May 2024 06:18:31 GMT Message-Id: <202405030618.4436IViV090457@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: 7b082bdf72e6 - stable/14 - Post-14.1-branch updates List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7b082bdf72e65f94b9b17d9fa1d0c1c202e4eb49 Auto-Submitted: auto-generated The branch stable/14 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=7b082bdf72e65f94b9b17d9fa1d0c1c202e4eb49 commit 7b082bdf72e65f94b9b17d9fa1d0c1c202e4eb49 Author: Colin Percival AuthorDate: 2024-05-03 06:16:57 +0000 Commit: Colin Percival CommitDate: 2024-05-03 06:16:57 +0000 Post-14.1-branch updates Rename stable/14 to -STABLE Bump __FreeBSD_version Approved by: re (implicit) Sponsored by: https://www.patreon.com/cperciva --- sys/conf/newvers.sh | 2 +- sys/sys/param.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index 144584e90147..d5ea53664606 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -53,7 +53,7 @@ TYPE="FreeBSD" REVISION="14.1" -BRANCH="PRERELEASE" +BRANCH="STABLE" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi diff --git a/sys/sys/param.h b/sys/sys/param.h index 46f0cf211cff..bc22f975991b 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -75,7 +75,7 @@ * cannot include sys/param.h and should only be updated here. */ #undef __FreeBSD_version -#define __FreeBSD_version 1400511 +#define __FreeBSD_version 1401500 /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From nobody Fri May 3 06:18:32 2024 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 4VW0x508P6z5JNcl; Fri, 3 May 2024 06:18: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 4VW0x46h4sz48jm; Fri, 3 May 2024 06:18:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714717112; 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=0b1zK/aRRMjKZ9jaz7cYPd1kvtiQYMwwxE/CFve5IYQ=; b=OZRbHntktCjaUj9T1Ir7kzUmEXTYKNXsbYa/nwhnSxio5NvAei3urq/vLn/o8BN7WHhvWJ tx4j2sfVy9kD8a0l2UcDwg8UQZR0zl7QUNIDgZHz4ALVeS3/B14Oy699jdJbm0tMlS8mbR BPPY3wIgSn8ypk5mE7FPsca3DM7FVX532SGK+9SNREvfxaII6rRmpZior1U3DsexZ10gVw kv7i2T9x2DwtvhtOX+OT9KU9Y3enZ70oQ4XqOAb8NPzcaEmhDp4NdfR+/mw6CrumwEMuS6 WkQvJ1rGLbqryw425D2UjLpGq9S1oJI7mxCsOn9F9RQp1mBNg5NS8+T+nbyLig== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714717112; a=rsa-sha256; cv=none; b=NURFQFaLkIBN3x1JZ+IPZ/WmP3AcwuogkIMePD3wv3KpxryN8Pd3vGLQNunThU6Gwrlq5A dJHimtaFqZGWg7oVq6F8q5pQ5YlnLEpAqB6MAD8huO43U2F39xnQAbHYNBG6J2fAuzn09Q dV1owodjT3ePjwAEf4SHhBXVewl1V9fyW3BALEyVEwfVbR9LrpSYpryIqvEM1hRorwu20C xAPqlDQvwQUN6uqbjAmJS1Mfy7WDrH6lVqk37Gjg7torDOpcrKclQY1+bvFi2cGx0tXXaP zu/ULDFFbv7l7FCp6eQWKRJqKL3Wzyxxl5+ivYxgmv6TR2CqF5gpb6Vm1nn0KA== 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=1714717112; 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=0b1zK/aRRMjKZ9jaz7cYPd1kvtiQYMwwxE/CFve5IYQ=; b=GPPLM0fqttczFzfizIZj6YEQe86XsabrPdUwqcTw5xIsddUy/AaPenCtz2O6T7Tl1bI7nm fkqUncEC77YSOvc+1uICHfslLcxSVnrhsbx8WUUk/I3qixZFcC12c8K2JGUlzET7fu4aAJ LpCUk/ug1KvzENKTs5EGFeqP8JIpdip1GQs2fRuffvfHr8ezIbKh2QSThUGyjT0XHIiuSv BdFOW79roAp2z+PXB7E6ucBQ4eDr8NnYsoWWVbSQ+Sy9GjeDO+n0mU5UV8jeJr3mqvd0/Z InM2n0LH3aF10paaU/6HQWZk3lA+E/7lUjP/I1e8k+D4BZtSswVsg7+hkPorQQ== 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 4VW0x46HdSzb4S; Fri, 3 May 2024 06:18: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 4436IWF0090517; Fri, 3 May 2024 06:18:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4436IWAO090514; Fri, 3 May 2024 06:18:32 GMT (envelope-from git) Date: Fri, 3 May 2024 06:18:32 GMT Message-Id: <202405030618.4436IWAO090514@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: 3f5f38755b8f - releng/14.1 - 14.1: create releng/14.1 branch List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 3f5f38755b8f521401283370770bc375fe71a725 Auto-Submitted: auto-generated The branch releng/14.1 has been created by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=3f5f38755b8f521401283370770bc375fe71a725 commit 3f5f38755b8f521401283370770bc375fe71a725 Author: Colin Percival AuthorDate: 2024-05-03 06:13:50 +0000 Commit: Colin Percival CommitDate: 2024-05-03 06:13:50 +0000 14.1: create releng/14.1 branch Update from PRERELEASE to BETA1 Switch pkg(8) configuration to use the quarterly repository Bump __FreeBSD_version Approved by: re (implicit) Sponsored by: https://www.patreon.com/cperciva --- release/pkg_repos/release-dvd.conf | 2 +- sys/conf/newvers.sh | 2 +- sys/sys/param.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/release/pkg_repos/release-dvd.conf b/release/pkg_repos/release-dvd.conf index c2e64c43a56f..600c309d5979 100644 --- a/release/pkg_repos/release-dvd.conf +++ b/release/pkg_repos/release-dvd.conf @@ -1,5 +1,5 @@ release: { - url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest", + url: "pkg+http://pkg.FreeBSD.org/${ABI}/quarterly", mirror_type: "srv", signature_type: "fingerprints", fingerprints: "/usr/share/keys/pkg", diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index 144584e90147..ff68b4d3f474 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -53,7 +53,7 @@ TYPE="FreeBSD" REVISION="14.1" -BRANCH="PRERELEASE" +BRANCH="BETA1" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi diff --git a/sys/sys/param.h b/sys/sys/param.h index 46f0cf211cff..716ea8af959e 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -75,7 +75,7 @@ * cannot include sys/param.h and should only be updated here. */ #undef __FreeBSD_version -#define __FreeBSD_version 1400511 +#define __FreeBSD_version 1401000 /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From nobody Fri May 3 20:25:55 2024 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 4VWMkq70W3z5JSBM; Fri, 3 May 2024 20:25: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 4VWMkq66K2z4PwH; Fri, 3 May 2024 20:25:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714767955; 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=IG0DdJfnk5YZ0GsZKrmWr86fgEoByfe6+GqmuFA5R3U=; b=D64aK14hXErdpDrbx2qs8twKgoexwWfpYih+1h/SSuLvJjAT732EI5Kdr2saU1vQqe42l3 sam2wlL9LuQPh91OFSavF340YRNQx8y3KC6gUHgHjWC6H3Qi39VpRX/IRNivsIirm5JEj3 CGP192X3OsVGgh7EJEj6WwNA7nBSHMi0iYpcKF5bnv4/87adpNoKG5ohBI+pC4E4Dv9Z+f ibZttOCXGJ3nXyc7YqAOwvYNMC62nDPBNVxDWbgu5av5WD9O88BeLtV/lEWZTe1WZ5vQcj q4SZ4CUfpQ5Fbs9gwW+xDngKDZlUQTK8B/VrGjivxBnqcbE4UN82cjIHux8jDA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714767955; a=rsa-sha256; cv=none; b=FFFs8a1OjMZ2lWBa6FQpI3EXLxYnHx+uBqzy48snfSbwEYIuTpLFWrw3mmPKQNNKscVR1u HLL5mwoOjtwIi3ga5kS124FSYK+41Qk3ybZYWEnSfuBA9ZUfRtiDHPjXsdv2MpXJSOBJTS pvYo9lNEigCX3chSnUhQRqmahNon1FEWeQV8uaydG8qePVl57i/wXvb11/ABk2V366xc3d czXVJC2dzKciPWHDjQKDOwiazGqczkfgXpufjOUdMKFWg9xAbVdRrYCSDlbfDQiBvJ1PCQ EVv1RerKCfpka4zsF1n0HZfsk/p2efTOl9wWzvAovOEg9syO6Pq522fATEbJEg== 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=1714767955; 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=IG0DdJfnk5YZ0GsZKrmWr86fgEoByfe6+GqmuFA5R3U=; b=O0Pog3UJSsnu4MEI0xjEDXx/7N0VXFB4Rr6fUqVtgAwjJWoCSxGEq2QfdT3Hpm2ayj9flZ mIgRxsk5pKe2D1C9Uyxj+lRcwL/0Up2oyZqNM7HYz3StZ3+tFi1JcQBz0w0oXkJhS6NOhu ntm7v7dACRkClLT2ooAArNyb7/QQOi7T6Pg1KUV3xZz383EVtUJhcjZb+CWs2t7SQkBL89 QUkOVDmQBvvlaa2IEFhbIh27yst6apob5aJAJc7Cx9U1hZ+VhzyZWBKFg+CYF5lfAIx8mx v9JFs4ne9SIfOCVQlRCmc29/aj1B/NQNPx6du0aYWzZQW4vFMzGAHXkN7cCmwg== 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 4VWMkq5b9mz111f; Fri, 3 May 2024 20:25: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 443KPt2a029105; Fri, 3 May 2024 20:25:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 443KPtr3029102; Fri, 3 May 2024 20:25:55 GMT (envelope-from git) Date: Fri, 3 May 2024 20:25:55 GMT Message-Id: <202405032025.443KPtr3029102@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 227f81c8bd0f - stable/14 - save-entropy: Add manual page List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 227f81c8bd0f60176519276839b24b468afce0bc Auto-Submitted: auto-generated The branch stable/14 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=227f81c8bd0f60176519276839b24b468afce0bc commit 227f81c8bd0f60176519276839b24b468afce0bc Author: Fernando Apesteguía AuthorDate: 2023-09-07 08:28:43 +0000 Commit: Mitchell Horne CommitDate: 2024-05-03 20:25:24 +0000 save-entropy: Add manual page Succinct manual page for save-entropy(8). PR: 223998 Reported by: AJ Jordan Reviewed by: carlavilla@, delphij@, lwhsu@, pauamma_gundo.com Approved by: delphi, lwhsu (src) Differential Revision: https://reviews.freebsd.org/D41768 (cherry picked from commit 8dc9b10e388da19d63b3dd718a8243e8e969091d) --- libexec/save-entropy/Makefile | 1 + libexec/save-entropy/save-entropy.8 | 97 +++++++++++++++++++++++++++++++++++++ 2 files changed, 98 insertions(+) diff --git a/libexec/save-entropy/Makefile b/libexec/save-entropy/Makefile index 1c7eabf36c7f..0c541606411f 100644 --- a/libexec/save-entropy/Makefile +++ b/libexec/save-entropy/Makefile @@ -1,4 +1,5 @@ SCRIPTS= save-entropy.sh +MAN= save-entropy.8 .include diff --git a/libexec/save-entropy/save-entropy.8 b/libexec/save-entropy/save-entropy.8 new file mode 100644 index 000000000000..f7a93c8866fc --- /dev/null +++ b/libexec/save-entropy/save-entropy.8 @@ -0,0 +1,97 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.\" Copyright (c) 2023 Fernando Apesteguia +.\" +.\" 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. +.\" +.Dd September 18, 2023 +.Dt SAVE-ENTROPY 8 +.Os +.Sh NAME +.Nm save-entropy +.Nd Save bits of entropy to feed /dev/random at startup +.Sh SYNOPSIS +.Nm save-entropy +.Sh DESCRIPTION +The +.Nm +command is used to save entropy data from +.Pa /dev/random +to files in a specified output location. +The files saved are used at startup to provide additional entropy for +.Pa /dev/random . +The output file will be different in every invocation until the maximum number +of different files is reached. +(See +.Em entropy_save_num +for details). +By default this script is invoked via +.Xr cron 8 +every eleven minutes approximately. +.Pp +This command does nothing if executed inside a +.Xr jail 8 . +.Pp +Three variables in +.Pa /etc/rc.conf +regulate the behavior of the script: +.Bl -tag -width Ds +.It Va entropy_dir +Specify the directory for saved entropy files. +Defaults to +.Pa /var/db/entropy . +If set to "NO" it disables caching entropy via +.Xr cron 8 . +This setting is shared with +.Pa /etc/rc.d/random . +.It Va entropy_save_sz +Size of the entropy cache files. +Defaults to 4096. +.It Va entropy_save_num +Number of entropy cache files to save. +Defaults to 8. +.El +.Sh FILES +.Bl -tag -width Ds +.It Pa /etc/rc.conf +.El +.Sh EXIT STATUS +.Ex -std +Errors will be recorded in the system log. +.Sh SEE ALSO +.Xr syslog 3 , +.Xr random 4 , +.Xr rc.conf 5 , +.Xr cron 8 +.Sh HISTORY +The +.Nm +command first appeared in +.Fx 5.0 . +.Sh AUTHORS +The +.Nm +command was originally written by +.An Doug Barton . +This manual page was written by +.An Fernando Apesteguia . From nobody Fri May 3 22:00:51 2024 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 4VWPrR11wbz5JcL1; Fri, 3 May 2024 22:00: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 4VWPrR0gqYz4Ztd; Fri, 3 May 2024 22:00:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714773655; 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=cYYszvbWweCRwAPPDdKp6yBdiJY97jZt8tmp/+SFexg=; b=r1hhQwg356vHH6FYigP4y1jeK4Siu13ui+cGewgYNM+StMcfqdMpM6XJyvHE9ChZIrV687 hvg3pNCLVpW0k6nksbrP1kmzKP2uy8BKZHBBBWGkjtT2LjAmY+6suRVQMEGhgxJI0EXc3d yjPhbxZcMphgzP5t3EGXM3apu9vHuS/yQFkw91U55PXbaWW3Iy3LdJrFUaiMnXiTOfwnAD a41taJAQ3QHoak67E9zbNMURTtVNeI8Gg4Tcl2wdFDwa2bVA6D/RScOcH+zPeBYQSaGKjn wxNe5dHsIECSAVMYowtHysq5iIbPRkO5aRxRo+0JH1iaB+iNLM0jFAW66LyAog== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714773655; a=rsa-sha256; cv=none; b=rz/F3HB0ydRu8rvPmQns0Up/GAM91DnhWJudMHpZGlCX7nMXdHvnSmkngLJ4xOrTymEiHE b7lt1dOGf7kcJu+qLi3D6luUNLtgwYFgll0WhtTQm5zkxnxRoq7Q4wRaZ2B1JYnjTUXtZs WXmnl4NPWdTxtOQ2suSkjG3rSdGwdmtstNcNTOIXpVOS+oXcGMLGv58vu5bSvVcBePoZTZ 4GpmGrg+oF6ZDzFfOvXRBfZdBwCEbLD2WKVx73A9x6b3H7HZrPW8SClMr4rf0sFjFXE4zj TiKwxwzTycyWvgiGrKlXkOVPDAmlBAdLMrzuSrgwkudGSEthY99Nm626IgqP1g== 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=1714773655; 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=cYYszvbWweCRwAPPDdKp6yBdiJY97jZt8tmp/+SFexg=; b=Opw6zYZrXWqlybCCi74qnxK8yrFPZTd3vCbcETP0huY8IU+4xJVISFh/0mnKydurGMpk6R vjp/gA7CrsIJwUUxKMsEiWXAOaM58W8fjweCXyRrNy70hVNyYIa0CteC0uWhPyy4lgB8e+ 147DCdDe9kltVh1aa6tlnXM38v68S53KzcZohlYumcStBa2nYoGRW6gt2WObUTiutXtzmq h6DR0EfnoptYeNiALwvcjlMqx8OStsGGHoHQ/KBQKwjVMlfHnoL7ahDudApmpvhmwoEIeY QVSs84uS2r6+4ZRg+IwTY1SpFjwDxWXNuTmD/Vd4dPqvJm08EfP+oqkGRP3aRQ== 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 4VWPrR0H3Fz13Sh; Fri, 3 May 2024 22:00: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 443M0sWT093211; Fri, 3 May 2024 22:00:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 443M0pLs092172; Fri, 3 May 2024 22:00:51 GMT (envelope-from git) Date: Fri, 3 May 2024 22:00:51 GMT Message-Id: <202405032200.443M0pLs092172@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Martin Matuska Subject: git: 9a5f0cb5b639 - stable/14 - zfs: merge openzfs/zfs@256659204 (zfs-2.2-release) into stable/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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9a5f0cb5b639f8e0435103d44b17eb8a352af990 Auto-Submitted: auto-generated The branch stable/14 has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=9a5f0cb5b639f8e0435103d44b17eb8a352af990 commit 9a5f0cb5b639f8e0435103d44b17eb8a352af990 Merge: 227f81c8bd0f 256659204578 Author: Martin Matuska AuthorDate: 2024-05-03 21:51:01 +0000 Commit: Martin Matuska CommitDate: 2024-05-03 21:52:01 +0000 zfs: merge openzfs/zfs@256659204 (zfs-2.2-release) into stable/14 OpenZFS release 2.2.4 Notable upstream pull request merges: #15076 fdd97e009 Refactor dmu_prefetch() #15225 5972bb856 Use ASSERT0P() to check that a pointer is NULL #15381 7ea833100 ZIL: Detect single-threaded workloads #15515 8b1a132de ZIO: Optimize zio_flush() #15225 d6da6cbd7 Clean up existing VERIFY*() macros #15225 5dda8c091 Add VERIFY0P() and ASSERT0P() macros #15436 61f3638a3 Add prefetch property #15509 6f323353d Add ashift validation when adding devices to a pool #15539 ea3f7c12a Extend import_progress kstat with a notes field #15635 25ea8ce94 ZIL: Improve next log block size prediction #15784 16c223eec Do no use .cfi_negate_ra_state within the assembly on Arm64 #15839 706307445 vdev probe to slow disk can stall mmp write checker #15879 86b39b41a zpool: Fix locale-specific time #15927 fa5de0c5c Update resume token at object receive #15941 fdd8c0aea BRT: Skip duplicate BRT prefetches #15942 889152ce4 Give better message from 'zpool get' with invalid pool name #15950 3e91a9c52 BRT: Skip getting length in brt_entry_lookup() #15951 19bf54b76 ZAP: Massively switch to _by_dnode() interfaces #15954 f7c1db636 BRT: Change brt_pending_tree sorting order #15955 457e62d7c BRT: Relax brt_pending_apply() locking #15967 c94f73007 BRT: Make BRT block sizes configurable #15976 dced953b6 ZAP: Some cleanups/micro-optimizations #15983 531572b59 Fix panics when truncating/deleting files #15992 5fc134ff2 zvol: use multiple taskq #16007 2ea370a4e BRT: Fix holes cloning #16008 67995229a zpool: Fix option string, adding -e and fixing order #16015 8a5604713 Add support for zfs mount -R #16022 026fe7964 Speculative prefetch for reordered requests #16040 575872cc3 L2ARC: Relax locking during write #16042 d5fb6abd3 Improve dbuf_read() error reporting #16051 5d859a2e2 xdr: header cleanup #16052 602b5dca7 Fix read errors race after block cloning #16057 97d7228f4 Remove db_state DB_NOFILL checks from syncing context #16072 f4ce02ae4 Small fix to prefetch ranges aggregation #16074 97889c037 return NULL at end of send_progress_thread #16086 7aaf6ce9d Add the BTI elf note to the AArch64 SHA2 assembly #16094 4d17e200d Add zfetch stats in arcstats #16128 3d4d61988 Fix updating the zvol_htable when renaming a zvol #16141 b3b37b84e Fix arcstats for FreeBSD after zfetch support Obtained from: OpenZFS OpenZFS commit: 2566592045780e7be7afc899c2496b1ae3af4f4d OpenZFS tag: zfs-2.2.4 cddl/lib/libnvpair/Makefile | 2 - sys/contrib/openzfs/.mailmap | 18 + sys/contrib/openzfs/AUTHORS | 35 + sys/contrib/openzfs/META | 4 +- sys/contrib/openzfs/cmd/arc_summary | 11 +- sys/contrib/openzfs/cmd/arcstat.in | 57 +- sys/contrib/openzfs/cmd/zed/agents/fmd_api.c | 57 +- sys/contrib/openzfs/cmd/zed/agents/fmd_api.h | 3 +- sys/contrib/openzfs/cmd/zed/agents/fmd_serd.c | 3 +- sys/contrib/openzfs/cmd/zed/agents/fmd_serd.h | 2 +- sys/contrib/openzfs/cmd/zed/agents/zfs_diagnosis.c | 143 +++- sys/contrib/openzfs/cmd/zed/agents/zfs_retire.c | 3 + sys/contrib/openzfs/cmd/zfs/zfs_main.c | 75 +- sys/contrib/openzfs/cmd/zinject/zinject.c | 16 + .../openzfs/cmd/zpool/os/linux/zpool_vdev_os.c | 4 +- sys/contrib/openzfs/cmd/zpool/zpool_main.c | 146 ++-- sys/contrib/openzfs/cmd/ztest.c | 8 +- sys/contrib/openzfs/config/Substfiles.am | 3 +- sys/contrib/openzfs/config/always-pyzfs.m4 | 9 +- sys/contrib/openzfs/config/ax_python_devel.m4 | 341 +++++--- sys/contrib/openzfs/config/kernel-blk-queue.m4 | 15 + sys/contrib/openzfs/config/kernel-blkdev.m4 | 159 +++- sys/contrib/openzfs/config/kernel-filemap.m4 | 1 + .../openzfs/config/kernel-make-request-fn.m4 | 33 + sys/contrib/openzfs/config/kernel-mm-page-size.m4 | 17 + .../openzfs/config/kernel-vfs-file_range.m4 | 27 + sys/contrib/openzfs/config/kernel.m4 | 4 + sys/contrib/openzfs/config/zfs-build.m4 | 8 +- sys/contrib/openzfs/contrib/debian/control | 2 +- sys/contrib/openzfs/etc/init.d/README.md | 6 +- sys/contrib/openzfs/etc/init.d/zfs-import.in | 2 +- sys/contrib/openzfs/etc/init.d/zfs-load-key.in | 2 +- sys/contrib/openzfs/etc/init.d/zfs-mount.in | 2 +- sys/contrib/openzfs/etc/init.d/zfs-share.in | 3 +- sys/contrib/openzfs/etc/init.d/zfs-zed.in | 3 +- sys/contrib/openzfs/include/libzfs.h | 6 +- sys/contrib/openzfs/include/os/freebsd/Makefile.am | 4 +- .../openzfs/include/os/freebsd/spl/rpc/xdr.h | 71 -- .../openzfs/include/os/freebsd/spl/sys/debug.h | 40 +- sys/contrib/openzfs/include/os/linux/Makefile.am | 2 + .../include/os/linux/kernel/linux/blkdev_compat.h | 6 +- .../include/os/linux/kernel/linux/mm_compat.h | 36 + .../include/os/linux/kernel/linux/mod_compat.h | 1 + .../openzfs/include/os/linux/spl/rpc/types.h | 30 + sys/contrib/openzfs/include/os/linux/spl/rpc/xdr.h | 2 - .../openzfs/include/os/linux/spl/sys/debug.h | 38 +- .../openzfs/include/os/linux/spl/sys/taskq.h | 2 +- .../openzfs/include/os/linux/zfs/sys/trace_zil.h | 14 +- sys/contrib/openzfs/include/sys/abd.h | 9 + sys/contrib/openzfs/include/sys/abd_impl.h | 26 +- sys/contrib/openzfs/include/sys/dmu.h | 5 +- sys/contrib/openzfs/include/sys/dmu_objset.h | 1 + sys/contrib/openzfs/include/sys/dmu_zfetch.h | 16 +- sys/contrib/openzfs/include/sys/fm/fs/zfs.h | 2 + sys/contrib/openzfs/include/sys/fs/zfs.h | 14 +- sys/contrib/openzfs/include/sys/multilist.h | 5 +- sys/contrib/openzfs/include/sys/spa.h | 12 +- sys/contrib/openzfs/include/sys/uberblock_impl.h | 16 +- sys/contrib/openzfs/include/sys/vdev_impl.h | 7 +- sys/contrib/openzfs/include/sys/zap.h | 8 + sys/contrib/openzfs/include/sys/zap_impl.h | 1 + sys/contrib/openzfs/include/sys/zap_leaf.h | 10 +- sys/contrib/openzfs/include/sys/zil_impl.h | 10 +- sys/contrib/openzfs/lib/libspl/include/assert.h | 15 +- sys/contrib/openzfs/lib/libuutil/uu_list.c | 14 +- sys/contrib/openzfs/lib/libzfs/libzfs.abi | 84 +- sys/contrib/openzfs/lib/libzfs/libzfs_pool.c | 13 +- sys/contrib/openzfs/lib/libzfs/libzfs_sendrecv.c | 1 + sys/contrib/openzfs/lib/libzfs/libzfs_util.c | 12 +- .../openzfs/lib/libzfs/os/linux/libzfs_pool_os.c | 10 + sys/contrib/openzfs/man/Makefile.am | 4 +- sys/contrib/openzfs/man/man4/spl.4 | 18 +- sys/contrib/openzfs/man/man4/zfs.4 | 83 +- sys/contrib/openzfs/man/man7/vdevprops.7 | 12 +- sys/contrib/openzfs/man/man7/zfsprops.7 | 17 + sys/contrib/openzfs/man/man7/zpoolconcepts.7 | 4 +- sys/contrib/openzfs/man/man8/zfs-mount.8 | 6 +- sys/contrib/openzfs/man/man8/zinject.8 | 1 + sys/contrib/openzfs/man/man8/zpool-add.8 | 18 +- sys/contrib/openzfs/man/man8/zpool-clear.8 | 7 +- sys/contrib/openzfs/man/man8/zpool-status.8 | 18 +- .../icp/asm-aarch64/blake3/b3_aarch64_sse2.S | 14 +- .../icp/asm-aarch64/blake3/b3_aarch64_sse41.S | 12 +- .../module/icp/asm-aarch64/sha2/sha256-armv8.S | 10 + .../module/icp/asm-aarch64/sha2/sha512-armv8.S | 10 + sys/contrib/openzfs/module/nvpair/nvpair.c | 1 + sys/contrib/openzfs/module/os/freebsd/zfs/abd_os.c | 4 +- .../openzfs/module/os/freebsd/zfs/zfs_vnops_os.c | 4 +- .../openzfs/module/os/freebsd/zfs/zvol_os.c | 2 +- .../openzfs/module/os/linux/spl/spl-taskq.c | 85 +- sys/contrib/openzfs/module/os/linux/spl/spl-xdr.c | 1 + sys/contrib/openzfs/module/os/linux/zfs/abd_os.c | 123 ++- .../openzfs/module/os/linux/zfs/vdev_disk.c | 913 ++++++++++++++++----- .../openzfs/module/os/linux/zfs/zfs_vnops_os.c | 12 +- sys/contrib/openzfs/module/os/linux/zfs/zpl_file.c | 8 +- .../openzfs/module/os/linux/zfs/zpl_file_range.c | 16 +- sys/contrib/openzfs/module/os/linux/zfs/zvol_os.c | 140 +++- sys/contrib/openzfs/module/zcommon/zfs_prop.c | 11 + sys/contrib/openzfs/module/zcommon/zpool_prop.c | 6 + sys/contrib/openzfs/module/zfs/abd.c | 42 + sys/contrib/openzfs/module/zfs/arc.c | 179 ++-- sys/contrib/openzfs/module/zfs/brt.c | 147 +--- sys/contrib/openzfs/module/zfs/dbuf.c | 160 ++-- sys/contrib/openzfs/module/zfs/dmu.c | 149 ++-- sys/contrib/openzfs/module/zfs/dmu_objset.c | 29 +- sys/contrib/openzfs/module/zfs/dmu_recv.c | 17 +- sys/contrib/openzfs/module/zfs/dmu_zfetch.c | 296 +++++-- sys/contrib/openzfs/module/zfs/dsl_deadlist.c | 8 +- sys/contrib/openzfs/module/zfs/metaslab.c | 8 +- sys/contrib/openzfs/module/zfs/mmp.c | 5 +- sys/contrib/openzfs/module/zfs/multilist.c | 26 +- sys/contrib/openzfs/module/zfs/spa.c | 149 +++- sys/contrib/openzfs/module/zfs/spa_log_spacemap.c | 16 +- sys/contrib/openzfs/module/zfs/spa_misc.c | 74 +- sys/contrib/openzfs/module/zfs/txg.c | 9 + sys/contrib/openzfs/module/zfs/vdev.c | 52 +- sys/contrib/openzfs/module/zfs/vdev_label.c | 4 +- sys/contrib/openzfs/module/zfs/vdev_raidz.c | 5 +- sys/contrib/openzfs/module/zfs/zap.c | 43 +- sys/contrib/openzfs/module/zfs/zap_leaf.c | 77 +- sys/contrib/openzfs/module/zfs/zap_micro.c | 206 +++-- sys/contrib/openzfs/module/zfs/zfs_fm.c | 26 + sys/contrib/openzfs/module/zfs/zfs_ioctl.c | 13 +- sys/contrib/openzfs/module/zfs/zfs_vnops.c | 6 +- sys/contrib/openzfs/module/zfs/zil.c | 352 +++++--- sys/contrib/openzfs/module/zfs/zio.c | 42 +- sys/contrib/openzfs/module/zfs/zio_inject.c | 6 + sys/contrib/openzfs/module/zfs/zvol.c | 2 +- sys/contrib/openzfs/rpm/redhat/zfs-kmod.spec.in | 2 +- sys/contrib/openzfs/tests/runfiles/common.run | 8 +- sys/contrib/openzfs/tests/runfiles/linux.run | 5 +- sys/contrib/openzfs/tests/runfiles/sanity.run | 3 +- .../openzfs/tests/zfs-tests/tests/Makefile.am | 5 + .../tests/functional/bclone/bclone_common.kshlib | 47 +- .../functional/bclone/bclone_corner_cases.kshlib | 20 +- .../functional/cli_root/zfs_mount/zfs_mount.cfg | 1 + .../cli_root/zfs_mount/zfs_mount_recursive.ksh | 146 ++++ .../functional/cli_root/zpool_add/add-o_ashift.ksh | 17 +- .../cli_root/zpool_add/add_prop_ashift.ksh | 16 +- .../zpool_add/zpool_add--allow-ashift-mismatch.ksh | 0 .../cli_root/zpool_add/zpool_add_002_pos.ksh | 11 + .../cli_root/zpool_add/zpool_add_004_pos.ksh | 2 +- .../cli_root/zpool_add/zpool_add_005_pos.ksh | 2 + .../cli_root/zpool_add/zpool_add_009_neg.ksh | 2 + .../cli_root/zpool_add/zpool_add_010_pos.ksh | 2 +- .../functional/cli_root/zpool_get/vdev_get.cfg | 2 + .../cli_root/zpool_import/zpool_import_status.ksh | 132 +++ .../tests/functional/cp_files/cp_files_002_pos.ksh | 6 +- .../zfs-tests/tests/functional/events/cleanup.ksh | 4 +- .../tests/functional/events/zed_slow_io.ksh | 205 +++++ .../functional/events/zed_slow_io_many_vdevs.ksh | 177 ++++ .../zfs-tests/tests/functional/fault/cleanup.ksh | 1 + .../zfs-tests/tests/functional/fault/setup.ksh | 1 + .../tests/functional/mmp/mmp_write_slow_disk.ksh | 97 +++ .../user_namespace/user_namespace_004.ksh | 4 +- sys/contrib/openzfs/udev/zvol_id.c | 9 +- sys/modules/zfs/zfs_config.h | 50 +- sys/modules/zfs/zfs_gitrev.h | 2 +- 158 files changed, 4808 insertions(+), 1646 deletions(-) diff --cc cddl/lib/libnvpair/Makefile index fb80d7c22ea5,000000000000..a93ffcbd00de mode 100644,000000..100644 --- a/cddl/lib/libnvpair/Makefile +++ b/cddl/lib/libnvpair/Makefile @@@ -1,32 -1,0 +1,30 @@@ + +.PATH: ${SRCTOP}/sys/contrib/openzfs/module/nvpair +.PATH: ${SRCTOP}/sys/contrib/openzfs/lib/libnvpair +.PATH: ${SRCTOP}/sys/contrib/openzfs/include + +LIB= nvpair +LIBADD= spl + +PACKAGE= zfs +# user +INCS= libnvpair.h +SRCS= libnvpair.c \ + libnvpair_json.c \ + nvpair_alloc_system.c +# kernel +SRCS+= nvpair_alloc_fixed.c \ + nvpair.c \ + fnvpair.c + +WARNS?= 2 +CFLAGS+= -DIN_BASE -DHAVE_RPC_TYPES +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/ +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/os/freebsd +CFLAGS+= -I${SRCTOP}/sys +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include +CFLAGS+= -include ${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h +CFLAGS+= -DHAVE_ISSETUGID -DHAVE_CONFIG_H -DHAVE_XDR_BYTESREC + - - CFLAGS.nvpair.c+= -UHAVE_RPC_TYPES +.include diff --cc sys/contrib/openzfs/config/kernel-mm-page-size.m4 index 000000000000,d5ebd926986a..d5ebd926986a mode 000000,100644..100644 --- a/sys/contrib/openzfs/config/kernel-mm-page-size.m4 +++ b/sys/contrib/openzfs/config/kernel-mm-page-size.m4 diff --cc sys/contrib/openzfs/include/os/linux/kernel/linux/mm_compat.h index 000000000000,40056c68d6dd..40056c68d6dd mode 000000,100644..100644 --- a/sys/contrib/openzfs/include/os/linux/kernel/linux/mm_compat.h +++ b/sys/contrib/openzfs/include/os/linux/kernel/linux/mm_compat.h diff --cc sys/contrib/openzfs/include/os/linux/spl/rpc/types.h index 000000000000,5bbb4f2dec46..5bbb4f2dec46 mode 000000,100644..100644 --- a/sys/contrib/openzfs/include/os/linux/spl/rpc/types.h +++ b/sys/contrib/openzfs/include/os/linux/spl/rpc/types.h diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_recursive.ksh index 000000000000,0e5cc5d6955e..0e5cc5d6955e mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_recursive.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount_recursive.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add--allow-ashift-mismatch.ksh index 000000000000,000000000000..e69de29bb2d1 new file mode 100755 --- /dev/null +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add--allow-ashift-mismatch.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_status.ksh index 000000000000,c96961bf6419..c96961bf6419 mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_status.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_status.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/events/zed_slow_io.ksh index 000000000000,d9fabb2c3bc9..d9fabb2c3bc9 mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/events/zed_slow_io.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/events/zed_slow_io.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/events/zed_slow_io_many_vdevs.ksh index 000000000000,3357ae2e3510..3357ae2e3510 mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/events/zed_slow_io_many_vdevs.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/events/zed_slow_io_many_vdevs.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/mmp/mmp_write_slow_disk.ksh index 000000000000,8b118684aa7f..8b118684aa7f mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/mmp/mmp_write_slow_disk.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/mmp/mmp_write_slow_disk.ksh diff --cc sys/modules/zfs/zfs_config.h index fe8580263185,000000000000..35e6b4655832 mode 100644,000000..100644 --- a/sys/modules/zfs/zfs_config.h +++ b/sys/modules/zfs/zfs_config.h @@@ -1,1191 -1,0 +1,1215 @@@ +/* + */ + +/* zfs_config.h. Generated from zfs_config.h.in by configure. */ +/* zfs_config.h.in. Generated from configure.ac by autoheader. */ + +/* Define to 1 if translation of program messages to the user's native + language is requested. */ +/* #undef ENABLE_NLS */ + +/* bio_end_io_t wants 1 arg */ +/* #undef HAVE_1ARG_BIO_END_IO_T */ + +/* lookup_bdev() wants 1 arg */ +/* #undef HAVE_1ARG_LOOKUP_BDEV */ + +/* submit_bio() wants 1 arg */ +/* #undef HAVE_1ARG_SUBMIT_BIO */ + +/* bdi_setup_and_register() wants 2 args */ +/* #undef HAVE_2ARGS_BDI_SETUP_AND_REGISTER */ + +/* vfs_getattr wants 2 args */ +/* #undef HAVE_2ARGS_VFS_GETATTR */ + +/* zlib_deflate_workspacesize() wants 2 args */ +/* #undef HAVE_2ARGS_ZLIB_DEFLATE_WORKSPACESIZE */ + +/* bdi_setup_and_register() wants 3 args */ +/* #undef HAVE_3ARGS_BDI_SETUP_AND_REGISTER */ + +/* vfs_getattr wants 3 args */ +/* #undef HAVE_3ARGS_VFS_GETATTR */ + +/* vfs_getattr wants 4 args */ +/* #undef HAVE_4ARGS_VFS_GETATTR */ + +/* kernel has access_ok with 'type' parameter */ +/* #undef HAVE_ACCESS_OK_TYPE */ + +/* posix_acl has refcount_t */ +/* #undef HAVE_ACL_REFCOUNT */ + +/* add_disk() returns int */ +/* #undef HAVE_ADD_DISK_RET */ + +/* Define if host toolchain supports AES */ +#define HAVE_AES 1 + +/* Define if you have [rt] */ +#define HAVE_AIO_H 1 + +#ifdef __amd64__ +#ifndef RESCUE +/* Define if host toolchain supports AVX */ +#define HAVE_AVX 1 +#endif + +/* Define if host toolchain supports AVX2 */ +#define HAVE_AVX2 1 + +/* Define if host toolchain supports AVX512BW */ +#define HAVE_AVX512BW 1 + +/* Define if host toolchain supports AVX512CD */ +#define HAVE_AVX512CD 1 + +/* Define if host toolchain supports AVX512DQ */ +#define HAVE_AVX512DQ 1 + +/* Define if host toolchain supports AVX512ER */ +#define HAVE_AVX512ER 1 + +/* Define if host toolchain supports AVX512F */ +#define HAVE_AVX512F 1 + +/* Define if host toolchain supports AVX512IFMA */ +#define HAVE_AVX512IFMA 1 + +/* Define if host toolchain supports AVX512PF */ +#define HAVE_AVX512PF 1 + +/* Define if host toolchain supports AVX512VBMI */ +#define HAVE_AVX512VBMI 1 + +/* Define if host toolchain supports AVX512VL */ +#define HAVE_AVX512VL 1 +#endif + +/* bdevname() is available */ +/* #undef HAVE_BDEVNAME */ + +/* bdev_check_media_change() exists */ +/* #undef HAVE_BDEV_CHECK_MEDIA_CHANGE */ + ++/* bdev_file_open_by_path() exists */ ++/* #undef HAVE_BDEV_FILE_OPEN_BY_PATH */ ++ +/* bdev_*_io_acct() available */ +/* #undef HAVE_BDEV_IO_ACCT_63 */ + +/* bdev_*_io_acct() available */ +/* #undef HAVE_BDEV_IO_ACCT_OLD */ + +/* bdev_kobj() exists */ +/* #undef HAVE_BDEV_KOBJ */ + +/* bdev_max_discard_sectors() is available */ +/* #undef HAVE_BDEV_MAX_DISCARD_SECTORS */ + +/* bdev_max_secure_erase_sectors() is available */ +/* #undef HAVE_BDEV_MAX_SECURE_ERASE_SECTORS */ + +/* bdev_open_by_path() exists */ +/* #undef HAVE_BDEV_OPEN_BY_PATH */ + +/* bdev_release() exists */ +/* #undef HAVE_BDEV_RELEASE */ + +/* block_device_operations->submit_bio() returns void */ +/* #undef HAVE_BDEV_SUBMIT_BIO_RETURNS_VOID */ + +/* bdev_whole() is available */ +/* #undef HAVE_BDEV_WHOLE */ + +/* bio_alloc() takes 4 arguments */ +/* #undef HAVE_BIO_ALLOC_4ARG */ + +/* bio->bi_bdev->bd_disk exists */ +/* #undef HAVE_BIO_BDEV_DISK */ + +/* bio->bi_opf is defined */ +/* #undef HAVE_BIO_BI_OPF */ + +/* bio->bi_status exists */ +/* #undef HAVE_BIO_BI_STATUS */ + +/* bio has bi_iter */ +/* #undef HAVE_BIO_BVEC_ITER */ + +/* bio_*_io_acct() available */ +/* #undef HAVE_BIO_IO_ACCT */ + +/* bio_max_segs() is implemented */ +/* #undef HAVE_BIO_MAX_SEGS */ + +/* bio_set_dev() is available */ +/* #undef HAVE_BIO_SET_DEV */ + +/* bio_set_dev() GPL-only */ +/* #undef HAVE_BIO_SET_DEV_GPL_ONLY */ + +/* bio_set_dev() is a macro */ +/* #undef HAVE_BIO_SET_DEV_MACRO */ + +/* bio_set_op_attrs is available */ +/* #undef HAVE_BIO_SET_OP_ATTRS */ + +/* blkdev_get_by_path() exists and takes 4 args */ +/* #undef HAVE_BLKDEV_GET_BY_PATH_4ARG */ + +/* blkdev_get_by_path() handles ERESTARTSYS */ +/* #undef HAVE_BLKDEV_GET_ERESTARTSYS */ + - /* blkdev_issue_discard() is available */ - /* #undef HAVE_BLKDEV_ISSUE_DISCARD */ ++/* __blkdev_issue_discard(flags) is available */ ++/* #undef HAVE_BLKDEV_ISSUE_DISCARD_ASYNC_FLAGS */ + +/* __blkdev_issue_discard() is available */ - /* #undef HAVE_BLKDEV_ISSUE_DISCARD_ASYNC */ ++/* #undef HAVE_BLKDEV_ISSUE_DISCARD_ASYNC_NOFLAGS */ ++ ++/* blkdev_issue_discard(flags) is available */ ++/* #undef HAVE_BLKDEV_ISSUE_DISCARD_FLAGS */ ++ ++/* blkdev_issue_discard() is available */ ++/* #undef HAVE_BLKDEV_ISSUE_DISCARD_NOFLAGS */ + +/* blkdev_issue_secure_erase() is available */ +/* #undef HAVE_BLKDEV_ISSUE_SECURE_ERASE */ + ++/* blkdev_put() exists */ ++/* #undef HAVE_BLKDEV_PUT */ ++ +/* blkdev_put() accepts void* as arg 2 */ +/* #undef HAVE_BLKDEV_PUT_HOLDER */ + +/* blkdev_reread_part() exists */ +/* #undef HAVE_BLKDEV_REREAD_PART */ + +/* blkg_tryget() is available */ +/* #undef HAVE_BLKG_TRYGET */ + +/* blkg_tryget() GPL-only */ +/* #undef HAVE_BLKG_TRYGET_GPL_ONLY */ + +/* blk_alloc_disk() exists */ +/* #undef HAVE_BLK_ALLOC_DISK */ + ++/* blk_alloc_disk() exists and takes 2 args */ ++/* #undef HAVE_BLK_ALLOC_DISK_2ARG */ ++ +/* blk_alloc_queue() expects request function */ +/* #undef HAVE_BLK_ALLOC_QUEUE_REQUEST_FN */ + +/* blk_alloc_queue_rh() expects request function */ +/* #undef HAVE_BLK_ALLOC_QUEUE_REQUEST_FN_RH */ + +/* blk_cleanup_disk() exists */ +/* #undef HAVE_BLK_CLEANUP_DISK */ + +/* blk_mode_t is defined */ +/* #undef HAVE_BLK_MODE_T */ + +/* block multiqueue is available */ +/* #undef HAVE_BLK_MQ */ + ++/* block multiqueue hardware context is cached in struct request */ ++/* #undef HAVE_BLK_MQ_RQ_HCTX */ ++ +/* blk queue backing_dev_info is dynamic */ +/* #undef HAVE_BLK_QUEUE_BDI_DYNAMIC */ + +/* blk_queue_discard() is available */ +/* #undef HAVE_BLK_QUEUE_DISCARD */ + +/* blk_queue_flag_clear() exists */ +/* #undef HAVE_BLK_QUEUE_FLAG_CLEAR */ + +/* blk_queue_flag_set() exists */ +/* #undef HAVE_BLK_QUEUE_FLAG_SET */ + +/* blk_queue_flush() is available */ +/* #undef HAVE_BLK_QUEUE_FLUSH */ + +/* blk_queue_flush() is GPL-only */ +/* #undef HAVE_BLK_QUEUE_FLUSH_GPL_ONLY */ + +/* blk_queue_secdiscard() is available */ +/* #undef HAVE_BLK_QUEUE_SECDISCARD */ + +/* blk_queue_secure_erase() is available */ +/* #undef HAVE_BLK_QUEUE_SECURE_ERASE */ + +/* blk_queue_update_readahead() exists */ +/* #undef HAVE_BLK_QUEUE_UPDATE_READAHEAD */ + +/* blk_queue_write_cache() exists */ +/* #undef HAVE_BLK_QUEUE_WRITE_CACHE */ + +/* blk_queue_write_cache() is GPL-only */ +/* #undef HAVE_BLK_QUEUE_WRITE_CACHE_GPL_ONLY */ + +/* BLK_STS_RESV_CONFLICT is defined */ +/* #undef HAVE_BLK_STS_RESV_CONFLICT */ + +/* Define if release() in block_device_operations takes 1 arg */ +/* #undef HAVE_BLOCK_DEVICE_OPERATIONS_RELEASE_1ARG */ + +/* Define if revalidate_disk() in block_device_operations */ +/* #undef HAVE_BLOCK_DEVICE_OPERATIONS_REVALIDATE_DISK */ + +/* Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the + CoreFoundation framework. */ +/* #undef HAVE_CFLOCALECOPYCURRENT */ + +/* Define to 1 if you have the Mac OS X function + CFLocaleCopyPreferredLanguages in the CoreFoundation framework. */ +/* #undef HAVE_CFLOCALECOPYPREFERREDLANGUAGES */ + +/* Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in + the CoreFoundation framework. */ +/* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */ + +/* check_disk_change() exists */ +/* #undef HAVE_CHECK_DISK_CHANGE */ + +/* clear_inode() is available */ +/* #undef HAVE_CLEAR_INODE */ + +/* dentry uses const struct dentry_operations */ +/* #undef HAVE_CONST_DENTRY_OPERATIONS */ + +/* copy_from_iter() is available */ +/* #undef HAVE_COPY_FROM_ITER */ + +/* copy_splice_read exists */ +/* #undef HAVE_COPY_SPLICE_READ */ + +/* copy_to_iter() is available */ +/* #undef HAVE_COPY_TO_ITER */ + +/* cpu_has_feature() is GPL-only */ +/* #undef HAVE_CPU_HAS_FEATURE_GPL_ONLY */ + +/* yes */ +/* #undef HAVE_CPU_HOTPLUG */ + +/* current_time() exists */ +/* #undef HAVE_CURRENT_TIME */ + +/* Define if the GNU dcgettext() function is already present or preinstalled. + */ +/* #undef HAVE_DCGETTEXT */ + +/* DECLARE_EVENT_CLASS() is available */ +/* #undef HAVE_DECLARE_EVENT_CLASS */ + +/* dentry aliases are in d_u member */ +/* #undef HAVE_DENTRY_D_U_ALIASES */ + +/* dequeue_signal() takes 4 arguments */ +/* #undef HAVE_DEQUEUE_SIGNAL_4ARG */ + +/* lookup_bdev() wants dev_t arg */ +/* #undef HAVE_DEVT_LOOKUP_BDEV */ + +/* sops->dirty_inode() wants flags */ +/* #undef HAVE_DIRTY_INODE_WITH_FLAGS */ + +/* disk_check_media_change() exists */ +/* #undef HAVE_DISK_CHECK_MEDIA_CHANGE */ + +/* disk_*_io_acct() available */ +/* #undef HAVE_DISK_IO_ACCT */ + +/* disk_update_readahead() exists */ +/* #undef HAVE_DISK_UPDATE_READAHEAD */ + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* d_make_root() is available */ +/* #undef HAVE_D_MAKE_ROOT */ + +/* d_prune_aliases() is available */ +/* #undef HAVE_D_PRUNE_ALIASES */ + +/* dops->d_revalidate() operation takes nameidata */ +/* #undef HAVE_D_REVALIDATE_NAMEIDATA */ + +/* eops->encode_fh() wants child and parent inodes */ +/* #undef HAVE_ENCODE_FH_WITH_INODE */ + +/* sops->evict_inode() exists */ +/* #undef HAVE_EVICT_INODE */ + +/* FALLOC_FL_ZERO_RANGE is defined */ +/* #undef HAVE_FALLOC_FL_ZERO_RANGE */ + +/* fault_in_iov_iter_readable() is available */ +/* #undef HAVE_FAULT_IN_IOV_ITER_READABLE */ + +/* filemap_range_has_page() is available */ +/* #undef HAVE_FILEMAP_RANGE_HAS_PAGE */ + +/* fops->aio_fsync() exists */ +/* #undef HAVE_FILE_AIO_FSYNC */ + +/* file_dentry() is available */ +/* #undef HAVE_FILE_DENTRY */ + +/* fops->fadvise() exists */ +/* #undef HAVE_FILE_FADVISE */ + +/* file_inode() is available */ +/* #undef HAVE_FILE_INODE */ + +/* flush_dcache_page() is GPL-only */ +/* #undef HAVE_FLUSH_DCACHE_PAGE_GPL_ONLY */ + +/* iops->follow_link() cookie */ +/* #undef HAVE_FOLLOW_LINK_COOKIE */ + +/* iops->follow_link() nameidata */ +/* #undef HAVE_FOLLOW_LINK_NAMEIDATA */ + +/* Define if compiler supports -Wformat-overflow */ +/* #undef HAVE_FORMAT_OVERFLOW */ + +/* fsync_bdev() is declared in include/blkdev.h */ +/* #undef HAVE_FSYNC_BDEV */ + +/* fops->fsync() with range */ +/* #undef HAVE_FSYNC_RANGE */ + +/* fops->fsync() without dentry */ +/* #undef HAVE_FSYNC_WITHOUT_DENTRY */ + +/* yes */ +/* #undef HAVE_GENERIC_FADVISE */ + +/* generic_fillattr requires struct mnt_idmap* */ +/* #undef HAVE_GENERIC_FILLATTR_IDMAP */ + +/* generic_fillattr requires struct mnt_idmap* and u32 request_mask */ +/* #undef HAVE_GENERIC_FILLATTR_IDMAP_REQMASK */ + +/* generic_fillattr requires struct user_namespace* */ +/* #undef HAVE_GENERIC_FILLATTR_USERNS */ + +/* generic_*_io_acct() 3 arg available */ +/* #undef HAVE_GENERIC_IO_ACCT_3ARG */ + +/* generic_*_io_acct() 4 arg available */ +/* #undef HAVE_GENERIC_IO_ACCT_4ARG */ + +/* generic_readlink is global */ +/* #undef HAVE_GENERIC_READLINK */ + +/* generic_setxattr() exists */ +/* #undef HAVE_GENERIC_SETXATTR */ + +/* generic_write_checks() takes kiocb */ +/* #undef HAVE_GENERIC_WRITE_CHECKS_KIOCB */ + +/* Define if the GNU gettext() function is already present or preinstalled. */ +/* #undef HAVE_GETTEXT */ + +/* iops->get_acl() exists */ +/* #undef HAVE_GET_ACL */ + +/* iops->get_acl() takes rcu */ +/* #undef HAVE_GET_ACL_RCU */ + +/* has iops->get_inode_acl() */ +/* #undef HAVE_GET_INODE_ACL */ + +/* iops->get_link() cookie */ +/* #undef HAVE_GET_LINK_COOKIE */ + +/* iops->get_link() delayed */ +/* #undef HAVE_GET_LINK_DELAYED */ + +/* group_info->gid exists */ +/* #undef HAVE_GROUP_INFO_GID */ + +/* has_capability() is available */ +/* #undef HAVE_HAS_CAPABILITY */ + +/* iattr->ia_vfsuid and iattr->ia_vfsgid exist */ +/* #undef HAVE_IATTR_VFSID */ + +/* Define if you have the iconv() function and it works. */ +#define HAVE_ICONV 1 + +/* iops->getattr() takes struct mnt_idmap* */ +/* #undef HAVE_IDMAP_IOPS_GETATTR */ + +/* iops->setattr() takes struct mnt_idmap* */ +/* #undef HAVE_IDMAP_IOPS_SETATTR */ + +/* APIs for idmapped mount are present */ +/* #undef HAVE_IDMAP_MNT_API */ + +/* mnt_idmap does not have user_namespace */ +/* #undef HAVE_IDMAP_NO_USERNS */ + +/* Define if compiler supports -Wimplicit-fallthrough */ +/* #undef HAVE_IMPLICIT_FALLTHROUGH */ + +/* Define if compiler supports -Winfinite-recursion */ +/* #undef HAVE_INFINITE_RECURSION */ + +/* inode_get_atime() exists in linux/fs.h */ +/* #undef HAVE_INODE_GET_ATIME */ + +/* inode_get_ctime() exists in linux/fs.h */ +/* #undef HAVE_INODE_GET_CTIME */ + +/* inode_get_mtime() exists in linux/fs.h */ +/* #undef HAVE_INODE_GET_MTIME */ + +/* yes */ +/* #undef HAVE_INODE_LOCK_SHARED */ + +/* inode_owner_or_capable() exists */ +/* #undef HAVE_INODE_OWNER_OR_CAPABLE */ + +/* inode_owner_or_capable() takes mnt_idmap */ +/* #undef HAVE_INODE_OWNER_OR_CAPABLE_IDMAP */ + +/* inode_owner_or_capable() takes user_ns */ +/* #undef HAVE_INODE_OWNER_OR_CAPABLE_USERNS */ + +/* inode_set_atime_to_ts() exists in linux/fs.h */ +/* #undef HAVE_INODE_SET_ATIME_TO_TS */ + +/* inode_set_ctime_to_ts() exists in linux/fs.h */ +/* #undef HAVE_INODE_SET_CTIME_TO_TS */ + +/* inode_set_flags() exists */ +/* #undef HAVE_INODE_SET_FLAGS */ + +/* inode_set_iversion() exists */ +/* #undef HAVE_INODE_SET_IVERSION */ + +/* inode_set_mtime_to_ts() exists in linux/fs.h */ +/* #undef HAVE_INODE_SET_MTIME_TO_TS */ + +/* inode->i_*time's are timespec64 */ +/* #undef HAVE_INODE_TIMESPEC64_TIMES */ + +/* timestamp_truncate() exists */ +/* #undef HAVE_INODE_TIMESTAMP_TRUNCATE */ + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* in_compat_syscall() is available */ +/* #undef HAVE_IN_COMPAT_SYSCALL */ + +/* iops->create() takes struct mnt_idmap* */ +/* #undef HAVE_IOPS_CREATE_IDMAP */ + +/* iops->create() takes struct user_namespace* */ +/* #undef HAVE_IOPS_CREATE_USERNS */ + +/* iops->mkdir() takes struct mnt_idmap* */ +/* #undef HAVE_IOPS_MKDIR_IDMAP */ + +/* iops->mkdir() takes struct user_namespace* */ +/* #undef HAVE_IOPS_MKDIR_USERNS */ + +/* iops->mknod() takes struct mnt_idmap* */ +/* #undef HAVE_IOPS_MKNOD_IDMAP */ + +/* iops->mknod() takes struct user_namespace* */ +/* #undef HAVE_IOPS_MKNOD_USERNS */ + +/* iops->permission() takes struct mnt_idmap* */ +/* #undef HAVE_IOPS_PERMISSION_IDMAP */ + +/* iops->permission() takes struct user_namespace* */ +/* #undef HAVE_IOPS_PERMISSION_USERNS */ + +/* iops->rename() takes struct mnt_idmap* */ +/* #undef HAVE_IOPS_RENAME_IDMAP */ + +/* iops->rename() takes struct user_namespace* */ +/* #undef HAVE_IOPS_RENAME_USERNS */ + +/* iops->setattr() exists */ +/* #undef HAVE_IOPS_SETATTR */ + +/* iops->symlink() takes struct mnt_idmap* */ +/* #undef HAVE_IOPS_SYMLINK_IDMAP */ + +/* iops->symlink() takes struct user_namespace* */ +/* #undef HAVE_IOPS_SYMLINK_USERNS */ + +/* iov_iter_advance() is available */ +/* #undef HAVE_IOV_ITER_ADVANCE */ + +/* iov_iter_count() is available */ +/* #undef HAVE_IOV_ITER_COUNT */ + +/* iov_iter_fault_in_readable() is available */ +/* #undef HAVE_IOV_ITER_FAULT_IN_READABLE */ + +/* iov_iter_revert() is available */ +/* #undef HAVE_IOV_ITER_REVERT */ + +/* iov_iter_type() is available */ +/* #undef HAVE_IOV_ITER_TYPE */ + +/* iov_iter types are available */ +/* #undef HAVE_IOV_ITER_TYPES */ + +/* yes */ +/* #undef HAVE_IO_SCHEDULE_TIMEOUT */ + - /* Define to 1 if you have the `issetugid' function. */ ++/* Define to 1 if you have the 'issetugid' function. */ +#define HAVE_ISSETUGID 1 + +/* iter_iov() is available */ +/* #undef HAVE_ITER_IOV */ + +/* kernel has kernel_fpu_* functions */ +/* #undef HAVE_KERNEL_FPU */ + +/* kernel has asm/fpu/api.h */ +/* #undef HAVE_KERNEL_FPU_API_HEADER */ + +/* kernel fpu internal */ +/* #undef HAVE_KERNEL_FPU_INTERNAL */ + +/* kernel has asm/fpu/internal.h */ +/* #undef HAVE_KERNEL_FPU_INTERNAL_HEADER */ + +/* uncached_acl_sentinel() exists */ +/* #undef HAVE_KERNEL_GET_ACL_HANDLE_CACHE */ + +/* Define if compiler supports -Winfinite-recursion */ +/* #undef HAVE_KERNEL_INFINITE_RECURSION */ + +/* kernel has kernel_neon_* functions */ +/* #undef HAVE_KERNEL_NEON */ + +/* kernel does stack verification */ +/* #undef HAVE_KERNEL_OBJTOOL */ + +/* kernel has linux/objtool.h */ +/* #undef HAVE_KERNEL_OBJTOOL_HEADER */ + +/* kernel_read() take loff_t pointer */ +/* #undef HAVE_KERNEL_READ_PPOS */ + +/* strlcpy() exists */ +/* #undef HAVE_KERNEL_STRLCPY */ + +/* strscpy() exists */ +/* #undef HAVE_KERNEL_STRSCPY */ + +/* timer_list.function gets a timer_list */ +/* #undef HAVE_KERNEL_TIMER_FUNCTION_TIMER_LIST */ + +/* struct timer_list has a flags member */ +/* #undef HAVE_KERNEL_TIMER_LIST_FLAGS */ + +/* timer_setup() is available */ +/* #undef HAVE_KERNEL_TIMER_SETUP */ + +/* kernel_write() take loff_t pointer */ +/* #undef HAVE_KERNEL_WRITE_PPOS */ + +/* kmem_cache_create_usercopy() exists */ +/* #undef HAVE_KMEM_CACHE_CREATE_USERCOPY */ + +/* kstrtoul() exists */ +/* #undef HAVE_KSTRTOUL */ + +/* ktime_get_coarse_real_ts64() exists */ +/* #undef HAVE_KTIME_GET_COARSE_REAL_TS64 */ + +/* ktime_get_raw_ts64() exists */ +/* #undef HAVE_KTIME_GET_RAW_TS64 */ + +/* kvmalloc exists */ +/* #undef HAVE_KVMALLOC */ + +/* Define if you have [aio] */ +/* #undef HAVE_LIBAIO */ + +/* Define if you have [blkid] */ +/* #undef HAVE_LIBBLKID */ + +/* Define if you have [crypto] */ +#define HAVE_LIBCRYPTO 1 + +/* Define if you have [tirpc] */ +/* #undef HAVE_LIBTIRPC */ + +/* Define if you have [udev] */ +/* #undef HAVE_LIBUDEV */ + +/* Define if you have [uuid] */ +/* #undef HAVE_LIBUUID */ + +/* linux/blk-cgroup.h exists */ +/* #undef HAVE_LINUX_BLK_CGROUP_HEADER */ + +/* lseek_execute() is available */ +/* #undef HAVE_LSEEK_EXECUTE */ + +/* makedev() is declared in sys/mkdev.h */ +/* #undef HAVE_MAKEDEV_IN_MKDEV */ + +/* makedev() is declared in sys/sysmacros.h */ +/* #undef HAVE_MAKEDEV_IN_SYSMACROS */ + +/* Noting that make_request_fn() returns blk_qc_t */ +/* #undef HAVE_MAKE_REQUEST_FN_RET_QC */ *** 561 LINES SKIPPED *** From nobody Fri May 3 22:22:43 2024 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 4VWQKb6yKXz5JdqF; Fri, 3 May 2024 22:22: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 4VWQKb6QK8z4cYG; Fri, 3 May 2024 22:22:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714774963; 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=k4qqqKKVu1JXzdhPNsOURNbAyS+9QcWZZsymzoCZ/cs=; b=i4nxLr1BWgzfAhFTY+uOvGj5EaFvevYUAoTVTMc7M/jl7XFBdlUUWVtZdiRh7Nh6oIiY+M Uc4463VE5kufmBiZskID4ibMq3PMmkrlzTS1mzKiXCHROkdeB5ToCbRpJPHg6kpH7xTZLg ZvIy2E4dCHbbvVsDsFrLq+bqDqDiMBG/yNE1cUy6DHqxzOhlB/hgJ+MSiQsYut4Wp7oWrH h8Mg+m03io28+b0IJyo+boRKkrpqA04Phb2wgQfh/i+y4LlcaCNPtQOYjlX0/3ES+lOJeR 8WD+9BU6aOPLrlwHSoXmR9hV6kix1TPEvYFGh3VEkb8G/BTFp66fsKqoj7+KpQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714774963; a=rsa-sha256; cv=none; b=pyrOW0hsq2dmg9EuyT0Pigao0Zg3y2aGXrP2Nn6FVap4QIqaDkK8aspCTg1tdwbFe8JhSe tH5KNoC7P6eR/FF03Rkl1LUXkI34iq/s/X1aerTRvNUgBzuIe0P7//gAP2K8q8CGqcKCVB TDKBEOm52uHqKqp7E6wAHsvCxVW5M3MgdH4HByLOrgsiKvSHgx485+g3AjqvuaF+il4whD Z+ZDQnBCXXZQuwZZK34FIQStO3PZzYcvzua8AJuEMsXAGfd6Ib5TtqjSrNltYhbv0jBLVC NNpdCrrb8S5naUq/anO1RSQf48MB31SR/EufdDVyO2P3KZIIW3dH0a++66g6ig== 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=1714774963; 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=k4qqqKKVu1JXzdhPNsOURNbAyS+9QcWZZsymzoCZ/cs=; b=uz0rRdNcoztB9zlZRylP+y2bz46NJwl/iQFoqeHbRXd0/+DpFOOqKRxmizqFuZy3khWT9y 7wNJiWG5Ikr6HrpN9mrPonBPvCoMElTGv/pW7Le1/PoXsif3O7DRbR4mOPg+W/0dIVRkmU AQrOYoo0S8j85SZ9x2sK07cKAzbZ38VTmoo1Jh4KCY/bZgpJwdFDTzAYB3EoBRCbIjgdeZ cfpClC+GMf66iwFcdwfwElJfn//IaVY53Mg9W9Z7gmz4/B7/+OH7xpYqnk3+Mh1ASgOK3s 0jNm0Tqx/cKBMIf5TlcKe/QP4jfpPAAWJbwNKCh34Nl3XbCf5mP9wft8Aole8Q== 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 4VWQKb5vjPz13Fk; Fri, 3 May 2024 22:22: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 443MMhMq031812; Fri, 3 May 2024 22:22:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 443MMhRa031809; Fri, 3 May 2024 22:22:43 GMT (envelope-from git) Date: Fri, 3 May 2024 22:22:43 GMT Message-Id: <202405032222.443MMhRa031809@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: 3a8e15354ec5 - stable/14 - Enable kernel reproducible builds on stable branch List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 3a8e15354ec58abeec2ee2fe96cbabb46083d183 Auto-Submitted: auto-generated The branch stable/14 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=3a8e15354ec58abeec2ee2fe96cbabb46083d183 commit 3a8e15354ec58abeec2ee2fe96cbabb46083d183 Author: Ed Maste AuthorDate: 2023-03-06 13:38:17 +0000 Commit: Colin Percival CommitDate: 2024-05-03 22:22:16 +0000 Enable kernel reproducible builds on stable branch When the stable/13 branch was created the userland knob (in share/mk/src.opts.mk) was changed to default to yes, but the kernel default was not changed. These two should always have the same default. Regenerate src.conf.5, as the differing defaults previously confused `makeman`. Fixes: bfd15705156b ("Create the stable/13 branch") Sponsored by: The FreeBSD Foundation MFS from: stable/13 MFS to: releng/14.1 (cherry picked from commit d8644a5d2458588dd7d8e44bd23c6cacaead19b7) --- share/man/man5/src.conf.5 | 8 ++++---- sys/conf/kern.opts.mk | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5 index 4bb38fe61a77..3a7789a95a07 100644 --- a/share/man/man5/src.conf.5 +++ b/share/man/man5/src.conf.5 @@ -1506,10 +1506,10 @@ Do not apply the Relocation Read-Only (RELRO) vulnerability mitigation. See also the .Va BIND_NOW option. -.It Va WITH_REPRODUCIBLE_BUILD -Exclude build metadata (such as the build time, user, or host) -from the kernel, boot loaders, and uname output, so that builds produce -bit-for-bit identical output. +.It Va WITHOUT_REPRODUCIBLE_BUILD +Include build metadata (such as the build time, user, and host) +in the kernel, boot loaders, and uname output. +Successive builds will not be bit-for-bit identical. .It Va WITHOUT_RESCUE Do not build .Xr rescue 8 . diff --git a/sys/conf/kern.opts.mk b/sys/conf/kern.opts.mk index f8bedab700b4..de32da2acebb 100644 --- a/sys/conf/kern.opts.mk +++ b/sys/conf/kern.opts.mk @@ -46,6 +46,7 @@ __DEFAULT_YES_OPTIONS = \ NETGRAPH \ OFED \ PF \ + REPRODUCIBLE_BUILD \ SCTP_SUPPORT \ SOURCELESS_HOST \ SOURCELESS_UCODE \ @@ -60,7 +61,6 @@ __DEFAULT_NO_OPTIONS = \ INIT_ALL_ZERO \ KERNEL_RETPOLINE \ RATELIMIT \ - REPRODUCIBLE_BUILD \ VERIEXEC # Some options are totally broken on some architectures. We disable From nobody Fri May 3 22:24:32 2024 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 4VWQMh5yLhz5JfRd; Fri, 3 May 2024 22:24: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 4VWQMh5Sj7z4cdT; Fri, 3 May 2024 22:24:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714775072; 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=iQP7rrRaK+3ALi3D4yztrG8IroS7wXBworHhfRmdov8=; b=u1dmR6u4FVj/EvvnVY+U8W8BoJQ5O77WcAkp3hP1rlYNs/wLB8aUkvtE3cesavb7L+khHm xRTFPK6B26qOYVEicLgm78FNhFYi5m4+pszuOG6ydUXYtwiHMoW+VPFDdtnNubAFQ8pooA IRnr2dmaqe9vCdHJ7h9iRAYwlxZmKQy3+OudPtwQzpqCfyyuHDKYCIuuXJKzxtvLttE4WF YmnyIuB4K/u4teaO7CoWHDwVxuOAg3FUaIjFSlXHTRxmC3IkjET3ywyzrxvBeFkKsGCQKY S0nm0QuB/Is4zPArp/QfBJR9weV9w8SSXehMzR26PP5ExqOXnltI9p1MjJQWfg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714775072; a=rsa-sha256; cv=none; b=WTT3KIYtn7jRN1i0Y3clLc3qsuXB+BqHHhp1mgQbLoa6iGnOTd43TxJ+YS0nPrMQ416KYD U4wFJDz1xIsqSO8bHy95nPY2geLy7SdFjvtxnYgFTDQm6p53kwvZwStJg7aqkXRHhdvpqL sYqslSCfbe4ZEU75Jm59pNiCXGxCMqQesb29/nb/+xbnf5RRKcX2r18ezy/VHe+2ELbsE6 e3GcmX7Rv3k9WdXjGmlsgvumkusVzqskUI6JVLKZE02Bxcp07s65hBpCwFGSCqBqu7Rkhm Vq76V1/Ft3tQP47Z6V/caXhPFfSsb5tk4dV8Uo7M+WmcWFCflUqFsvKGa12d4Q== 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=1714775072; 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=iQP7rrRaK+3ALi3D4yztrG8IroS7wXBworHhfRmdov8=; b=lgRfRdxQtdiO5WjKhYMJzvCZVtNIWn7R8EdEa7OlPkkHxFDvgOhALYPG0CbV0c0ZA33nGo Hcb7azBs0NZqancmlj1TohR+h//w85G6hiKd8BccV/B1carLv7WSqeqNeZIPGThbf9riUs QDSOnblJN2NiVS3j+PEpnlYw/3QA+jW+NE+wzHMquYkFHPcvAP0A0lAlEIXTathV0fZGX6 122Q2gbxpd0nyl56MfolebPFPqclJkooHcL2xovLnZRIk6v20zFfsDVhvK5CLVtB16WhGy k4Wtwb7sa41jQ6cOo60HBNcpttE/EnKsvFi+MoYNwGCuSWnIQ3AGL53AFG5APg== 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 4VWQMh53wBz1464; Fri, 3 May 2024 22:24: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 443MOWsn032201; Fri, 3 May 2024 22:24:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 443MOWSM032198; Fri, 3 May 2024 22:24:32 GMT (envelope-from git) Date: Fri, 3 May 2024 22:24:32 GMT Message-Id: <202405032224.443MOWSM032198@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: 25c2d762af7a - releng/14.1 - Enable kernel reproducible builds on stable branch List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 25c2d762af7a47bcc2291145f096bf316893159c Auto-Submitted: auto-generated The branch releng/14.1 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=25c2d762af7a47bcc2291145f096bf316893159c commit 25c2d762af7a47bcc2291145f096bf316893159c Author: Ed Maste AuthorDate: 2023-03-06 13:38:17 +0000 Commit: Colin Percival CommitDate: 2024-05-03 22:23:27 +0000 Enable kernel reproducible builds on stable branch When the stable/13 branch was created the userland knob (in share/mk/src.opts.mk) was changed to default to yes, but the kernel default was not changed. These two should always have the same default. Regenerate src.conf.5, as the differing defaults previously confused `makeman`. Fixes: bfd15705156b ("Create the stable/13 branch") Sponsored by: The FreeBSD Foundation Approved by: re (cperciva) (cherry picked from commit d8644a5d2458588dd7d8e44bd23c6cacaead19b7) (cherry picked from commit 3a8e15354ec58abeec2ee2fe96cbabb46083d183) --- share/man/man5/src.conf.5 | 8 ++++---- sys/conf/kern.opts.mk | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5 index 4bb38fe61a77..3a7789a95a07 100644 --- a/share/man/man5/src.conf.5 +++ b/share/man/man5/src.conf.5 @@ -1506,10 +1506,10 @@ Do not apply the Relocation Read-Only (RELRO) vulnerability mitigation. See also the .Va BIND_NOW option. -.It Va WITH_REPRODUCIBLE_BUILD -Exclude build metadata (such as the build time, user, or host) -from the kernel, boot loaders, and uname output, so that builds produce -bit-for-bit identical output. +.It Va WITHOUT_REPRODUCIBLE_BUILD +Include build metadata (such as the build time, user, and host) +in the kernel, boot loaders, and uname output. +Successive builds will not be bit-for-bit identical. .It Va WITHOUT_RESCUE Do not build .Xr rescue 8 . diff --git a/sys/conf/kern.opts.mk b/sys/conf/kern.opts.mk index f8bedab700b4..de32da2acebb 100644 --- a/sys/conf/kern.opts.mk +++ b/sys/conf/kern.opts.mk @@ -46,6 +46,7 @@ __DEFAULT_YES_OPTIONS = \ NETGRAPH \ OFED \ PF \ + REPRODUCIBLE_BUILD \ SCTP_SUPPORT \ SOURCELESS_HOST \ SOURCELESS_UCODE \ @@ -60,7 +61,6 @@ __DEFAULT_NO_OPTIONS = \ INIT_ALL_ZERO \ KERNEL_RETPOLINE \ RATELIMIT \ - REPRODUCIBLE_BUILD \ VERIEXEC # Some options are totally broken on some architectures. We disable From nobody Fri May 3 23:49:37 2024 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 4VWSFs27y3z5JmjT; Fri, 3 May 2024 23:49: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 4VWSFs1hZBz4m96; Fri, 3 May 2024 23:49:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714780177; 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=2HYb0QQsPL+bwTLeqSJ2nXIZZ+Tluv0Ws07acVibDog=; b=R3NrvLOWW5JTk56WYSov4dUIVi6Okzk26jk3I0Wuig8ii+VvZOHVPdlkxkCW8c8dxSkCAN Sq54XZluhky8eb2ltk2XTFk8MR0Iy3NJIo/hg2ShFVSGinTGb/0A7UoTh7BUpK8lyZyk5h kGDn3dhJOKkIroJ6plNUA0oG/MMrvvTleTk+1P3CbS8l3WsRyG9M3cZB+uDZsNneCNONl/ lvD9FFnL+v6nP4keqL87AUoVcBPv+xzGyBbz8PJQzJQ9NsGP1mCXOzK8c+h8dZAddVYzeg xwuk5pUd5gDf1iXYihgqzNH1iw8vjFt1Pc7UbG3L0pw1+u0QMqEBXOteQna2qg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714780177; a=rsa-sha256; cv=none; b=cqmem6T11MVVohn37deqS5GVFKQUdyrbmJ+8xYZcNZASpHYc36//Vbp0tjHKo0yTBsrW9Y UYVU6Y8D1FsO+3x9sQHqwEeQlL2idWoeGTNb4byvGaVweX8mLY2gTOa91XudvSgQsvpIb4 iJxU8ebUT/nYc5TR3z3hqMzmv01ahEUZmbw9lTIn8JD02zb3rqTvNZKODn6yAwUSZeGl6x yAvede0CeQUwUsyzcvPzPXprLzXxPOOVNlBqFm1ZXBMLcA+J05+4F4luGax7gbBRF2bByN rjkuT01xvd0iKyHyiUs6ZiQlehrGK1kFxEXmCqadZ/X1DHCfjPkDcJSrxUMjkQ== 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=1714780177; 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=2HYb0QQsPL+bwTLeqSJ2nXIZZ+Tluv0Ws07acVibDog=; b=Om2mLrnWPrauKNu80IVaiBFcx12oFaBoktD9Y2nHG1kcClXcWIqFwSNFlbusPJKeumzrZU cMsp8N7DQIe5oXw7WfDlJPGZXpfCTcRkr++L902PXO5ywlhOchTJfTiepQ9ZE8ldF+HxCP 7n/9WECop4ZU+qvu5JgiF2LW6ZGyeA6qeNwh9565XsED4kX7SRcv+/Tf2hT4TGkV9gs7NO Sad872LT06fhQJ/EJkPPMCSXqa2FL2nBzFHCTZd0pzbtMOitoAnd2o2WdFcBpKrDjDObYf dkXg32hluoVJu88MPdDshrnnXRXK7qOo7SAO3txIiCR71pQ8z81GVjNCfc3UFA== 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 4VWSFs1HT1z15YZ; Fri, 3 May 2024 23:49: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 443Nnb7W068822; Fri, 3 May 2024 23:49:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 443Nnbu1068819; Fri, 3 May 2024 23:49:37 GMT (envelope-from git) Date: Fri, 3 May 2024 23:49:37 GMT Message-Id: <202405032349.443Nnbu1068819@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Martin Matuska Subject: git: 7e10c2d27a53 - stable/14 - zfs: unbreak aarch64 build with non-gcc compilers List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7e10c2d27a538aa3f5afcafe48801a9316e30027 Auto-Submitted: auto-generated The branch stable/14 has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=7e10c2d27a538aa3f5afcafe48801a9316e30027 commit 7e10c2d27a538aa3f5afcafe48801a9316e30027 Author: Martin Matuska AuthorDate: 2024-04-16 23:34:25 +0000 Commit: Martin Matuska CommitDate: 2024-05-03 23:49:05 +0000 zfs: unbreak aarch64 build with non-gcc compilers Vendor did not backport this fix into zfs-2.2-release yet. OpenZFS PR: #16103 35bf25848 Fix: FreeBSD Arm64 does not build currently (cherry picked from commit b9dee1dca2d74e12e867fd29d2d584fc385078eb) --- sys/contrib/openzfs/module/icp/asm-aarch64/blake3/b3_aarch64_sse2.S | 4 ++-- sys/contrib/openzfs/module/icp/asm-aarch64/blake3/b3_aarch64_sse41.S | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/contrib/openzfs/module/icp/asm-aarch64/blake3/b3_aarch64_sse2.S b/sys/contrib/openzfs/module/icp/asm-aarch64/blake3/b3_aarch64_sse2.S index e66bb4bc7f26..b0af629066ea 100644 --- a/sys/contrib/openzfs/module/icp/asm-aarch64/blake3/b3_aarch64_sse2.S +++ b/sys/contrib/openzfs/module/icp/asm-aarch64/blake3/b3_aarch64_sse2.S @@ -34,7 +34,7 @@ #if defined(__aarch64__) /* make gcc <= 9 happy */ -#if LD_VERSION >= 233010000 +#if !defined(LD_VERSION) || LD_VERSION >= 233010000 #define CFI_NEGATE_RA_STATE .cfi_negate_ra_state #else #define CFI_NEGATE_RA_STATE @@ -2066,4 +2066,4 @@ zfs_blake3_hash_many_sse2: .size zfs_blake3_hash_many_sse2, .Lfunc_end3-zfs_blake3_hash_many_sse2 .cfi_endproc .section ".note.GNU-stack","",@progbits -#endif \ No newline at end of file +#endif diff --git a/sys/contrib/openzfs/module/icp/asm-aarch64/blake3/b3_aarch64_sse41.S b/sys/contrib/openzfs/module/icp/asm-aarch64/blake3/b3_aarch64_sse41.S index b9fb28dfcf03..0b719761dd4c 100644 --- a/sys/contrib/openzfs/module/icp/asm-aarch64/blake3/b3_aarch64_sse41.S +++ b/sys/contrib/openzfs/module/icp/asm-aarch64/blake3/b3_aarch64_sse41.S @@ -34,7 +34,7 @@ #if defined(__aarch64__) /* make gcc <= 9 happy */ -#if LD_VERSION >= 233010000 +#if !defined(LD_VERSION) || LD_VERSION >= 233010000 #define CFI_NEGATE_RA_STATE .cfi_negate_ra_state #else #define CFI_NEGATE_RA_STATE @@ -2403,4 +2403,4 @@ zfs_blake3_hash_many_sse41: .size zfs_blake3_hash_many_sse41, .Lfunc_end3-zfs_blake3_hash_many_sse41 .cfi_endproc .section ".note.GNU-stack","",@progbits -#endif \ No newline at end of file +#endif From nobody Sat May 4 12:37:30 2024 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 4VWnHt5873z5KVLQ; Sat, 4 May 2024 12:37: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 4VWnHt4hz1z440s; Sat, 4 May 2024 12:37:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714826250; 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=3fdBwDQhAtnFFQx5Ctg11zVLSff185EfmuueaMbIaAY=; b=fBc/P82FvldA1eTnKcNdi7OiY8cN+E9xzV0ZAnm3ElKV/m7dtY+sfE8CgL+z8aaKuEXhC0 gR7RUnGw8pIrrs4ia+Fq3xkDGWIMOovTNBYsY9+Y9vNyMoobwgJc5ngVpQvKsH3q2exMjS NXPfqutirGrmyq4l0eVAi0GDYavZ+T5VO+XPsL0MpR6mXrTaTJ4fcOiyrumj2jCapHoK9I 4/pq46bSGUimjutxPTjjazH7YFHu4vVSGC70S3pETxXfWSY2gD+JuzelyN3NeqiwqHVq9v QS+FsoSTS/m4vGyoK/XiHd6D7mpQK0xRWhTMXDJuiocohq/ZTDOe9vGwO18I9Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714826250; a=rsa-sha256; cv=none; b=Dovfkhj4OBobZ5g3oty6xW3bOU5Zr9i383TnP0ID98cJ7kSGvpTNchHdPWT23tArdIsAw9 NTNb9CsZv5TiQOVIshx7x7yUklNchXJaI5F7FSf+RK7g/PPN1IFFG2G47n7Kb4r8Uhui2Q 05uCnxGDP0aSSDxRVsnbb8WxAq5h7ttpGBg49lDvBhU1mHr0MIO/eIVkyiMLIdAlgEsvKO EE1T3ZFP53GPNwngPDxxVBf7RqIoAIz0Q7VHyCJmlLayZOAtQs7+My1szOXhs2P7twBoky jcHtOQCR2WCOqb92+qG/31yHKHIo70FNKYVbQsk0uy6S/JEHNK4mfRltCt+RfQ== 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=1714826250; 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=3fdBwDQhAtnFFQx5Ctg11zVLSff185EfmuueaMbIaAY=; b=WZTpcG1+sURTG1DmMoiX0V6ylnbX1+mu6jfFXODbYmSiLEq3tzwnT+Sd4Z/oIS+Eie4uDN EX1fmcCnCyIZ64/sYo2bWQ8zoKVNSBgUjYtMDsqwTF9JS5WdAHaNKapv1FQPvFCokvFnRQ b6c4aruouZIyRsBqhE7l2uCX7fr/d3jYTtYsD3mZ4vKwaeK6SCi3VYDw1B1E+ZBWMNYeyU rsoz71NNzmIxO4+Pcm/e+IO9oY/qMqkKOI91ocawnZKL2HsbowCunIf5+BY8Wyt2XD1OHb QGV86kohv0FMXPwZ3co6RILlecw98oa+yzMK6+2hfBhcm9OJWMNMeiEsLVNVkg== 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 4VWnHt4JmKzVT9; Sat, 4 May 2024 12:37: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 444CbUTK072135; Sat, 4 May 2024 12:37:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 444CbUlu072132; Sat, 4 May 2024 12:37:30 GMT (envelope-from git) Date: Sat, 4 May 2024 12:37:30 GMT Message-Id: <202405041237.444CbUlu072132@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Martin Matuska Subject: git: ffd190f2236d - stable/13 - libarchive: Remove MIPS build glue. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ffd190f2236d4b61abfede673b57f539ceb17d4a Auto-Submitted: auto-generated The branch stable/13 has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=ffd190f2236d4b61abfede673b57f539ceb17d4a commit ffd190f2236d4b61abfede673b57f539ceb17d4a Author: John Baldwin AuthorDate: 2023-03-29 22:05:53 +0000 Commit: Martin Matuska CommitDate: 2024-05-04 11:53:07 +0000 libarchive: Remove MIPS build glue. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D39329 (cherry picked from commit f40b617e153991d70ee6628357dd08a0606418d6) --- lib/libarchive/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/libarchive/Makefile b/lib/libarchive/Makefile index 562b78879df5..de7eef14c34b 100644 --- a/lib/libarchive/Makefile +++ b/lib/libarchive/Makefile @@ -13,8 +13,7 @@ CFLAGS+= -I${.OBJDIR} CFLAGS+= -I${SRCTOP}/sys/contrib/zstd/lib .include "Makefile.inc" -.if ${MACHINE_ARCH:Marm*} != "" || ${MACHINE_ARCH:Mmips*} != "" || \ - ${MACHINE_ARCH:Mpowerpc*} != "" +.if ${MACHINE_ARCH:Marm*} != "" || ${MACHINE_ARCH:Mpowerpc*} != "" NO_WCAST_ALIGN= yes .if ${MACHINE_ARCH:M*64*} == "" CFLAGS+= -DPPMD_32BIT From nobody Sat May 4 12:37:31 2024 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 4VWnHv709lz5KVP0; Sat, 4 May 2024 12:37: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 4VWnHv5g8hz44RW; Sat, 4 May 2024 12:37:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714826251; 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=NlCABvkqm/MfBd3Zj+M0HtnZJAJN0Di9Rl42pu3hfYM=; b=AtrHdCJzzQ/RcBEx5t8guo7sIMqFDlihetpO7RixYQ+frKH1rtYVxKQpA+0kI0OVYEP5Uo 9XLUJTt/2TozOwPu+f2f6YAUneQ8zU55q699zLhmgKrWxVtLwk7ykvwdoBDdpYETACkEsF l7wuVt0w9rCh0xsocCD+x6iQiTE+yk2GPuVzJHeWDgoKXA+3FNGcrlGtqEdrcvwQQVqAhg w78dgvqbVhSdB5ZGgT3l92sQqcDl3jyem7uN3oEo+td66YgbvgADqo9SijqtkVnGaUX98l xQNsHs5ft/4wD9KCANSBWpKmqruNDXhLhgbXPN2qSAKfgpvTmoMaSTVROshb5w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714826251; a=rsa-sha256; cv=none; b=fg2Ey+J8N0uF6qEtGArIbGKKsYwQzNOzjC+ntKERWfDUwLSvEt0+XfhnNLuo7IN/BZF51u PC1glVzeHdypSu12mH2L9WtfBtBf7mIVN3RCHZPOE/e+b4LmtYOOlCskkBSBE9swJspmpW 7kZrTbr/s03AJdfmxdn4CS/0y6HTvOKMd7b4XCpmK75Ln9RyCg20SEWsqthCQyah0dXvYa F40PYHDuzY04o8hJINpBLm5IqNLctPUSeLjdC874KCFqVwSvz8o10gaPijtjamjwIlZ268 r/X9pT3PbTLwYrkj4bDuUNsUUMWrXEhjlFoxdz+OCVWb6+mws7gUnBfopFl+Yg== 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=1714826251; 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=NlCABvkqm/MfBd3Zj+M0HtnZJAJN0Di9Rl42pu3hfYM=; b=Y218uD83MUAF8OnIkAkhIuQobirDeXFZIL9008tbsPwt3Z9qz6Jx/ax048YIgE5n6Tq9jY 0hbFcMSAwBBOoa29QUSbJ/6QWAZvC9qTukOAViKfX8tefVze3tmd/7Pik3AtELVL+nzHbI +HV0wHeKyYwt78G1UovbYUPhKWGeNzTITo4Ng7JTrcOqpMmQ11hKtZ+ZijzxFWL66cM8k9 B8JFVpPujBVuqNOEL32safa5AjNQcNtlfA8v8vgte603/SdOxMTLIw69Ct4jYnIbcH+WiO wDedSTnLhf8s7ZmzrLC8wcdrCCpNVp1njYJQG3ZNV4cJZYAaIYso2bUqje9sWA== 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 4VWnHv5GRpzVJ7; Sat, 4 May 2024 12:37: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 444CbVhv072180; Sat, 4 May 2024 12:37:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 444CbVq5072177; Sat, 4 May 2024 12:37:31 GMT (envelope-from git) Date: Sat, 4 May 2024 12:37:31 GMT Message-Id: <202405041237.444CbVq5072177@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Martin Matuska Subject: git: 9377240725d2 - stable/13 - libarchive: Request the OpenSSL 1.1 API List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 9377240725d2d04dbbfa4758828982d25782c923 Auto-Submitted: auto-generated The branch stable/13 has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=9377240725d2d04dbbfa4758828982d25782c923 commit 9377240725d2d04dbbfa4758828982d25782c923 Author: Pierre Pronchery AuthorDate: 2023-05-25 07:26:58 +0000 Commit: Martin Matuska CommitDate: 2024-05-04 11:53:07 +0000 libarchive: Request the OpenSSL 1.1 API OPENSSL_API_COMPAT can be used to specify the OpenSSL API version in use for the purpose of hiding deprecated interfaces and enabling the appropriate deprecation notices. This change is a NFC while we're still using OpenSSL 1.1.1 but will avoid deprecation warnings upon the switch to OpenSSL 3.0. A future update should migrate to use the OpenSSL 3.0 APIs. PR: 271615 Reviewed by: emaste Event: Kitchener-Waterloo Hackathon 202305 Sponsored by: The FreeBSD Foundation (cherry picked from commit 5a7500dab9b8480dacd5a9b70bad1541391342e4) --- lib/libarchive/Makefile.inc | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/libarchive/Makefile.inc b/lib/libarchive/Makefile.inc index 6d4668faf7ba..c98249519fa4 100644 --- a/lib/libarchive/Makefile.inc +++ b/lib/libarchive/Makefile.inc @@ -9,6 +9,7 @@ CFLAGS+= -DPLATFORM_CONFIG_H=\"${.CURDIR}/config_freebsd.h\" .if ${MK_OPENSSL} != "no" CFLAGS+= -DWITH_OPENSSL +CFLAGS+= -DOPENSSL_API_COMPAT=0x10100000L LIBADD+= crypto .else LIBADD+= md From nobody Sat May 4 12:37:32 2024 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 4VWnHx1XBWz5KVPQ; Sat, 4 May 2024 12:37: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 4VWnHw6hPTz44V8; Sat, 4 May 2024 12:37:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714826252; 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=+c8t5ivZU8s7ySSfUiR9xHijyNwc3lqv2VtEKyfxTjQ=; b=GCn9jevVAamQP9Brc+NS/6VMDXSINDC/mEeA2X1elF97+Y79/na1iBhf8sF1CH80vIjXzT 06HqTtkF8lKJ2zqaLGGJCogklWuhtnfaN9Cx12BETaUyxphhs/IgEl+lxgJiLKqPMH0ixi XZZnWMqo5I+mv6aKqnUFAIpn0yhYneohJJ00q7TzU0hQoCTO8dtKVO5BvjjFjq5QsP5ec8 sEOsVjANwIImTzqUqhxcVx0QdA1SqsLzJeS6hA5z9dF4T0ixQ6Uo2gwzBATmvTwi/b+pHb ZSjpZ9qfQzrh2EgRwWYP/wME5ynSD2T9QAUKt6YGwMBkADymO2TaiB35TUTxMg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714826252; a=rsa-sha256; cv=none; b=oxC5JoIGxHd1kSJHos8B78P3FPl5nILDYuNgwpCB14rzZcSFfp2A68h8dYSmKtCne/y97W RbffmFYKwb/AZTtKkps8AbTUA0xKdrvfsMv7L33hJRxGADJ3+d1IBDWaQW1Xa3XvHF9Msc KA48VWb/POGIQZZBorgBOtxuFebKGYy3pgQZdrBG+tOEeg7bxLu4doUbD4L5QY8obiXBe4 Z53wsJi/OVSLU2KYWr/QshWXK/FUDQLol25aVwKMShfBF8p4QAqHedVtT+7DrWR6wQLzDL SZcls6wFQrrWVLm6AqsObr2PFj847kMOhJG9QSZ7sIPolY5WttwisFBopp543w== 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=1714826252; 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=+c8t5ivZU8s7ySSfUiR9xHijyNwc3lqv2VtEKyfxTjQ=; b=GOC3uDblcTHDdZSovJRWjVwkuU0OFG7dpzhD+y2ORNxw1sdLHFlPh8RJWAqXsVl0tTo7IU 735YwAa6FKTcEXSAn4nsvK/3qOUeXrksPcc5Fe940wMQbW1oq2/00E+0+/YaeVgr2s/2ui SR1Zwigr0Y7L5bvZ2r4YbVWCQKJ4AkHZ/jWiVIXMoNFvtHizYjSyv2Xma31z+OcmUxrBCz PcR1QVp2G+YdLSIrmgLplgYiy0Luea9ckgGE059v3LrmtBWUz18ag96gSZxK6HEKHaIOnO jPCEUeVEIS5AJiEzWQkVxYWQdQ1WEmVLVad1vnijtle0hRgfoKmYA384RhUbjg== 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 4VWnHw6HXbzT2S; Sat, 4 May 2024 12:37: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 444CbW8B072231; Sat, 4 May 2024 12:37:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 444CbWbu072228; Sat, 4 May 2024 12:37:32 GMT (envelope-from git) Date: Sat, 4 May 2024 12:37:32 GMT Message-Id: <202405041237.444CbWbu072228@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Martin Matuska Subject: git: d2291dbb3ccb - stable/13 - libarchive: Avoid a build failure with OpenSSL 3.0 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d2291dbb3ccbb772fdeb9fdae88602771564e607 Auto-Submitted: auto-generated The branch stable/13 has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=d2291dbb3ccbb772fdeb9fdae88602771564e607 commit d2291dbb3ccbb772fdeb9fdae88602771564e607 Author: Pierre Pronchery AuthorDate: 2023-06-01 18:17:10 +0000 Commit: Martin Matuska CommitDate: 2024-05-04 11:53:07 +0000 libarchive: Avoid a build failure with OpenSSL 3.0 This is a minimal workaround; a proper fix will come via a future update from upstream. Sponsored by: The FreeBSD Foundation (cherry picked from commit e23d45187b287ee7a5c49c8b993daa9e6bb3ad97) --- contrib/libarchive/libarchive/archive_hmac.c | 2 +- lib/libarchive/Makefile.inc | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/contrib/libarchive/libarchive/archive_hmac.c b/contrib/libarchive/libarchive/archive_hmac.c index 012fe1596211..0914f38e3670 100644 --- a/contrib/libarchive/libarchive/archive_hmac.c +++ b/contrib/libarchive/libarchive/archive_hmac.c @@ -238,7 +238,7 @@ __hmac_sha1_init(archive_hmac_sha1_ctx *ctx, const uint8_t *key, size_t key_len) if (*ctx == NULL) return -1; EVP_MAC_free(mac); - params[0] = OSSL_PARAM_construct_utf8_string("digest", "SHA1", 0); + params[0] = OSSL_PARAM_construct_utf8_string("digest", (char *)"SHA1", 0); params[1] = OSSL_PARAM_construct_end(); EVP_MAC_init(*ctx, key, key_len, params); #else diff --git a/lib/libarchive/Makefile.inc b/lib/libarchive/Makefile.inc index c98249519fa4..95d96df24eef 100644 --- a/lib/libarchive/Makefile.inc +++ b/lib/libarchive/Makefile.inc @@ -11,6 +11,7 @@ CFLAGS+= -DPLATFORM_CONFIG_H=\"${.CURDIR}/config_freebsd.h\" CFLAGS+= -DWITH_OPENSSL CFLAGS+= -DOPENSSL_API_COMPAT=0x10100000L LIBADD+= crypto +CFLAGS.archive_hmac.c+=-Wno-error=cast-qual .else LIBADD+= md .endif From nobody Sat May 4 12:37:33 2024 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 4VWnHy5J32z5KVN1; Sat, 4 May 2024 12:37: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 4VWnHy1JB3z44MN; Sat, 4 May 2024 12:37:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714826254; 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=LYibiRLeNgXu2GxXn4KcAdU2Z/OXYDa/6ECM7lkOx38=; b=vYyN4V1tvtXQCcUgnec2oejyRccwqG1F7KxPGXcJ4gqU4zmtF1CV8WJDKhakSMsLkFQRoj NTOZoQMdidTjSVv8E43V3u33qByWE1tJOLSXfsyGU1GkFdETysoOVbBg7QptH1Rm2owRb7 /Rr2/Oacm1dnvfY5piJOcJPApEbVUVhsZcrfghXRB+63PwAnfXNwr9r4Iv/BBMCdyWA90W iKStX5H36yAiEg8bcslwSo+8LTXaAeD9vejglaCUApbFDEU+c0FeW8YkA9Aba/oZwl5zfK yVCT1Oy6BpIpSvKU8IVI/0+tzCQ/3sSb3QSTX1bVk3ncnjPeo990uhr7PxxaPQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714826254; a=rsa-sha256; cv=none; b=r51zWMFJOCXpvyWJjf2y/F90z8zMuNkk2SsEqxWlAOuh7og8ZmhYdHurpcvVSNvK2lM2C3 lMAwRXZCEH8W9kRGlWjuEYPz2GAxxTPEOMtP7HB19BbFYYrFf3HIjGZlBkzW7sM+O9EyZK cwPkvLw7DTwPSzCTdRRmf+EmqIiqs0cwQUgvDRHd1IxZjRvi0V3JP+fDHR3Fr4ypPt7cg4 84GvpPFdZlfOe1lY61IOeZHL4uR+u+xB9tonMhLZN4CFkwgOSnM8sTAje0OVMTcbceplVE ZsOP7A9NK4lMleIkEkwpgQbsnhJoBgpmbqTCE4NjRHJIUx0EsKkQtdmZ8WL3sA== 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=1714826254; 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=LYibiRLeNgXu2GxXn4KcAdU2Z/OXYDa/6ECM7lkOx38=; b=hvekziJJbUX/wViOqyZj1tDljwnw4KtEjwgf1DErNQNdoJfcmfAb9JJG4VZCFl09U7m2xI QnGNhRznlUT91IRasthZaOF6I4A0z/JrNziDadGftS3IEvWqJ63SdbDv89tQIpjmuKHm3x J8X6gXjmn7xhfVI7qbdJrZbB8YEWgCBBEcDv49GiePVQjCPsXZr0iTX9JLw0tmh+A6gc7S MDVm9ml+VuAAlISegBSQz1Ken4KODusAe6I2lLCkdr555dSRz3i8VrOTIk6HfPGhMoNP27 mpIBy1mYiApeX6xVNySF1LKjxHuD5g+GEZm8bfCdeWqDi5PaHKMDMk2qUC2GTQ== 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 4VWnHy0nGNzVW2; Sat, 4 May 2024 12:37: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 444CbYJT072273; Sat, 4 May 2024 12:37:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 444CbXs6072270; Sat, 4 May 2024 12:37:33 GMT (envelope-from git) Date: Sat, 4 May 2024 12:37:33 GMT Message-Id: <202405041237.444CbXs6072270@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Martin Matuska Subject: git: cd09ca5e71a5 - stable/13 - libarchive: merge from vendor branch List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: cd09ca5e71a541c47752782d0b710bc95d97cbef Auto-Submitted: auto-generated The branch stable/13 has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=cd09ca5e71a541c47752782d0b710bc95d97cbef commit cd09ca5e71a541c47752782d0b710bc95d97cbef Author: Martin Matuska AuthorDate: 2023-07-24 05:42:43 +0000 Commit: Martin Matuska CommitDate: 2024-05-04 11:53:07 +0000 libarchive: merge from vendor branch Libarchive 3.7.0 Important changes (relevant to FreeBSD): #1814 Do not account for NULL terminator when comparing with "TRAILER!!!" #1818 Add ability to produce multi-frame zstd archives #1840 year 2038 fix for pax archives on platforms with 64-bit time_t #1860 Make single bit bitfields unsigned to avoid clang 16 warning #1869 Fix FreeBSD builds with WARNS=6 #1873 bsdunzip ported to libarchive from FreeBSD #1894 read support for zstd compression in 7zip archives #1918 ARM64 filter support in 7zip archives (cherry picked from commit e64fe029e9d3ce476e77a478318e0c3cd201ff08) --- contrib/libarchive/NEWS | 6 +- contrib/libarchive/README.md | 16 +- contrib/libarchive/SECURITY.md | 19 + contrib/libarchive/cpio/cpio.c | 19 +- contrib/libarchive/cpio/test/test_option_J_upper.c | 1 + contrib/libarchive/cpio/test/test_option_c.c | 6 +- contrib/libarchive/cpio/test/test_option_t.c | 17 +- contrib/libarchive/libarchive/archive.h | 4 +- contrib/libarchive/libarchive/archive_digest.c | 60 + .../libarchive/libarchive/archive_digest_private.h | 10 + contrib/libarchive/libarchive/archive_entry.h | 2 +- contrib/libarchive/libarchive/archive_getdate.c | 119 +- contrib/libarchive/libarchive/archive_hmac.c | 15 +- .../libarchive/libarchive/archive_hmac_private.h | 2 + .../libarchive/archive_openssl_evp_private.h | 3 +- contrib/libarchive/libarchive/archive_random.c | 35 +- .../libarchive/archive_read_data_into_fd.c | 7 +- .../libarchive/archive_read_disk_posix.c | 28 + .../libarchive/libarchive/archive_read_open_file.c | 4 +- .../libarchive/archive_read_set_options.3 | 21 + .../libarchive/archive_read_support_filter_zstd.c | 14 +- .../libarchive/archive_read_support_format_7zip.c | 196 +++- .../libarchive/archive_read_support_format_cab.c | 8 +- .../libarchive/archive_read_support_format_cpio.c | 6 +- .../archive_read_support_format_iso9660.c | 12 +- .../libarchive/archive_read_support_format_lha.c | 16 +- .../libarchive/archive_read_support_format_mtree.c | 8 +- .../libarchive/archive_read_support_format_rar.c | 17 +- .../libarchive/archive_read_support_format_warc.c | 6 +- .../libarchive/archive_read_support_format_xar.c | 8 +- .../libarchive/archive_read_support_format_zip.c | 2 +- contrib/libarchive/libarchive/archive_string.c | 4 + contrib/libarchive/libarchive/archive_util.c | 57 +- contrib/libarchive/libarchive/archive_write.c | 31 + .../libarchive/archive_write_add_filter_compress.c | 2 +- .../libarchive/archive_write_add_filter_zstd.c | 233 ++-- .../libarchive/archive_write_disk_posix.c | 65 +- .../libarchive/libarchive/archive_write_private.h | 1 + .../libarchive/archive_write_set_format_iso9660.c | 18 +- .../libarchive/archive_write_set_format_pax.c | 27 +- .../libarchive/archive_write_set_format_warc.c | 25 +- .../libarchive/archive_write_set_format_xar.c | 10 +- .../libarchive/archive_write_set_format_zip.c | 19 +- contrib/libarchive/libarchive/test/test_fuzz.c | 5 +- .../test/test_read_disk_directory_traversals.c | 9 +- .../libarchive/test/test_read_format_7zip.c | 346 ++++++ .../test/test_read_format_7zip_deflate_arm64.7z.uu | 64 ++ .../test/test_read_format_7zip_lzma2_arm.7z.uu | 50 + .../test/test_read_format_7zip_lzma2_arm64.7z.uu | 54 + .../test/test_read_format_7zip_solid_zstd.7z.uu | 9 + .../test/test_read_format_7zip_zstd.7z.uu | 12 + .../test/test_read_format_7zip_zstd_arm.7z.uu | 61 + .../test/test_read_format_7zip_zstd_bcj.7z.uu | 56 + .../test/test_read_format_7zip_zstd_nobcj.7z.uu | 56 + .../libarchive/test/test_read_format_rar5.c | 2 + .../libarchive/test/test_read_format_zip.c | 5 + .../libarchive/libarchive/test/test_short_writes.c | 2 + .../libarchive/test/test_write_filter_zstd.c | 27 + .../test/test_write_format_zip_compression_store.c | 17 +- .../libarchive/test/test_write_format_zip_file.c | 17 +- .../test/test_write_format_zip_file_zip64.c | 17 +- contrib/libarchive/libarchive/xxhash.c | 4 + contrib/libarchive/libarchive_fe/passphrase.c | 6 + contrib/libarchive/tar/bsdtar.1 | 15 +- contrib/libarchive/tar/test/test_option_lzma.c | 1 + contrib/libarchive/tar/util.c | 17 +- contrib/libarchive/test_utils/test_main.c | 29 +- contrib/libarchive/unzip/CMakeLists.txt | 37 + contrib/libarchive/unzip/bsdunzip.1 | 216 ++++ contrib/libarchive/unzip/bsdunzip.c | 1186 ++++++++++++++++++++ contrib/libarchive/unzip/bsdunzip_platform.h | 83 ++ contrib/libarchive/unzip/test/CMakeLists.txt | 80 ++ contrib/libarchive/unzip/test/test.h | 40 + contrib/libarchive/unzip/test/test_0.c | 58 + contrib/libarchive/unzip/test/test_C.c | 41 + contrib/libarchive/unzip/test/test_L.c | 44 + contrib/libarchive/unzip/test/test_P_encryption.c | 41 + contrib/libarchive/unzip/test/test_Z1.c | 40 + contrib/libarchive/unzip/test/test_basic.c | 44 + contrib/libarchive/unzip/test/test_basic.zip.uu | 25 + contrib/libarchive/unzip/test/test_d.c | 44 + .../libarchive/unzip/test/test_encrypted.zip.uu | 13 + contrib/libarchive/unzip/test/test_glob.c | 44 + contrib/libarchive/unzip/test/test_j.c | 44 + contrib/libarchive/unzip/test/test_n.c | 48 + contrib/libarchive/unzip/test/test_not_exist.c | 36 + contrib/libarchive/unzip/test/test_o.c | 47 + contrib/libarchive/unzip/test/test_p.c | 39 + contrib/libarchive/unzip/test/test_q.c | 44 + contrib/libarchive/unzip/test/test_singlefile.c | 41 + .../libarchive/unzip/test/test_singlefile.zip.uu | 8 + contrib/libarchive/unzip/test/test_t.c | 39 + contrib/libarchive/unzip/test/test_t_bad.c | 39 + contrib/libarchive/unzip/test/test_t_bad.zip.uu | 25 + contrib/libarchive/unzip/test/test_x.c | 44 + lib/libarchive/tests/Makefile | 8 + 96 files changed, 4122 insertions(+), 436 deletions(-) diff --git a/contrib/libarchive/NEWS b/contrib/libarchive/NEWS index d6324487691b..61d1ca47340e 100644 --- a/contrib/libarchive/NEWS +++ b/contrib/libarchive/NEWS @@ -1,4 +1,8 @@ -Wed 07, 2022: libarchive 3.6.2 released +Jul 18, 2023: libarchive 3.7.0 released + +Jul 14, 2023: bsdunzip port from FreeBSD + +Dec 07, 2022: libarchive 3.6.2 released Apr 08, 2022: libarchive 3.6.1 released diff --git a/contrib/libarchive/README.md b/contrib/libarchive/README.md index 404076237871..727ed49856b6 100644 --- a/contrib/libarchive/README.md +++ b/contrib/libarchive/README.md @@ -7,7 +7,7 @@ command-line tools that use the libarchive library. ## Questions? Issues? -* http://www.libarchive.org is the home for ongoing +* https://www.libarchive.org is the home for ongoing libarchive development, including documentation, and links to the libarchive mailing lists. * To report an issue, use the issue tracker at @@ -23,6 +23,7 @@ This distribution bundle includes the following major components: * **tar**: the 'bsdtar' program is a full-featured 'tar' implementation built on libarchive * **cpio**: the 'bsdcpio' program is a different interface to essentially the same functionality * **cat**: the 'bsdcat' program is a simple replacement tool for zcat, bzcat, xzcat, and such +* **unzip**: the 'bsdunzip' program is a simple replacement tool for Info-ZIP's unzip * **examples**: Some small example programs that you may find useful. * **examples/minitar**: a compact sample demonstrating use of libarchive. * **contrib**: Various items sent to me by third parties; please contact the authors with any questions. @@ -87,7 +88,7 @@ Currently, the library automatically detects and reads the following formats: * ZIPX archives (with support for bzip2, ppmd8, lzma and xz compressed entries) * GNU and BSD 'ar' archives * 'mtree' format - * 7-Zip archives + * 7-Zip archives (including archives that use zstandard compression) * Microsoft CAB format * LHA and LZH archives * RAR and RAR 5.0 archives (with some limitations due to RAR's proprietary status) @@ -192,6 +193,17 @@ questions we are asked about libarchive: functions. On those platforms, libarchive will use the non-thread-safe functions. Patches to improve this are of great interest to us. +* The function `archive_write_disk_header()` is _not_ thread safe on + POSIX machines and could lead to security issue resulting in world + writeable directories. Thus it must be mutexed by the calling code. + This is due to calling `umask(oldumask = umask(0))`, which sets the + umask for the whole process to 0 for a short time frame. + In case other thread calls the same function in parallel, it might + get interrupted by it and cause the executable to use umask=0 for the + remaining execution. + This will then lead to implicitely created directories to have 777 + permissions without sticky bit. + * In particular, libarchive's modules to read or write a directory tree do use `chdir()` to optimize the directory traversals. This can cause problems for programs that expect to do disk access from diff --git a/contrib/libarchive/SECURITY.md b/contrib/libarchive/SECURITY.md new file mode 100644 index 000000000000..6ca188b603fe --- /dev/null +++ b/contrib/libarchive/SECURITY.md @@ -0,0 +1,19 @@ +# Security Policy + +If you have discovered a security vulnerability in this project, please report it +privately. **Do not disclose it as a public issue.** This gives us time to work with you +to fix the issue before public exposure, reducing the chance that the exploit will be +used before a patch is released. + +You may submit the report in the following ways: + +- send an email to security@libarchive.de; and/or +- send us a [private vulnerability report](https://github.com/libarchive/libarchive/security/advisories/new) + +Please provide the following information in your report: + +- A description of the vulnerability and its impact +- How to reproduce the issue + +This project is maintained by volunteers on a reasonable-effort basis. As such, we ask +that you give me 90 days to work on a fix before public exposure. diff --git a/contrib/libarchive/cpio/cpio.c b/contrib/libarchive/cpio/cpio.c index 847c92d31449..fbeae4133091 100644 --- a/contrib/libarchive/cpio/cpio.c +++ b/contrib/libarchive/cpio/cpio.c @@ -442,6 +442,8 @@ main(int argc, char *argv[]) archive_match_free(cpio->matching); free_cache(cpio->gname_cache); free_cache(cpio->uname_cache); + archive_read_close(cpio->archive_read_disk); + archive_read_free(cpio->archive_read_disk); free(cpio->destdir); passphrase_free(cpio->ppbuff); return (cpio->return_value); @@ -1151,13 +1153,9 @@ list_item_verbose(struct cpio *cpio, struct archive_entry *entry) time_t mtime; static time_t now; struct tm *ltime; -#if defined(HAVE_LOCALTIME_R) || defined(HAVE__LOCALTIME64_S) +#if defined(HAVE_LOCALTIME_R) || defined(HAVE_LOCALTIME_S) struct tm tmbuf; #endif -#if defined(HAVE__LOCALTIME64_S) - errno_t terr; - __time64_t tmptime; -#endif if (!now) time(&now); @@ -1205,15 +1203,10 @@ list_item_verbose(struct cpio *cpio, struct archive_entry *entry) else fmt = cpio->day_first ? "%e %b %H:%M" : "%b %e %H:%M"; #endif -#if defined(HAVE_LOCALTIME_R) +#if defined(HAVE_LOCALTIME_S) + ltime = localtime_s(&tmbuf, &mtime) ? NULL : &tmbuf; +#elif defined(HAVE_LOCALTIME_R) ltime = localtime_r(&mtime, &tmbuf); -#elif defined(HAVE__LOCALTIME64_S) - tmptime = mtime; - terr = _localtime64_s(&tmbuf, &tmptime); - if (terr) - ltime = NULL; - else - ltime = &tmbuf; #else ltime = localtime(&mtime); #endif diff --git a/contrib/libarchive/cpio/test/test_option_J_upper.c b/contrib/libarchive/cpio/test/test_option_J_upper.c index 1d7d05131b3d..e19d599e1ec7 100644 --- a/contrib/libarchive/cpio/test/test_option_J_upper.c +++ b/contrib/libarchive/cpio/test/test_option_J_upper.c @@ -43,6 +43,7 @@ DEFINE_TEST(test_option_J_upper) if (strstr(p, "compression not available") != NULL) { skipping("This version of bsdcpio was compiled " "without xz support"); + free(p); return; } failure("-J option is broken"); diff --git a/contrib/libarchive/cpio/test/test_option_c.c b/contrib/libarchive/cpio/test/test_option_c.c index 013caed56030..dfa62c13b13e 100644 --- a/contrib/libarchive/cpio/test/test_option_c.c +++ b/contrib/libarchive/cpio/test/test_option_c.c @@ -37,10 +37,10 @@ is_octal(const char *p, size_t l) return (1); } -static int +static long long int from_octal(const char *p, size_t l) { - int r = 0; + long long int r = 0; while (l > 0) { r *= 8; @@ -161,7 +161,7 @@ DEFINE_TEST(test_option_c) assertEqualInt(from_octal(e + 24, 6), uid); /* uid */ assertEqualInt(gid, from_octal(e + 30, 6)); /* gid */ assertEqualMem(e + 36, "000001", 6); /* nlink */ - failure("file entries should have rdev == 0 (dev was 0%o)", + failure("file entries should have rdev == 0 (dev was 0%llo)", from_octal(e + 6, 6)); assertEqualMem(e + 42, "000000", 6); /* rdev */ t = from_octal(e + 48, 11); /* mtime */ diff --git a/contrib/libarchive/cpio/test/test_option_t.c b/contrib/libarchive/cpio/test/test_option_t.c index 0f2dda27cc20..9eef0da571c4 100644 --- a/contrib/libarchive/cpio/test/test_option_t.c +++ b/contrib/libarchive/cpio/test/test_option_t.c @@ -37,13 +37,9 @@ DEFINE_TEST(test_option_t) char date[32]; char date2[32]; struct tm *tmptr; -#if defined(HAVE_LOCALTIME_R) || defined(HAVE__LOCALTIME64_S) +#if defined(HAVE_LOCALTIME_R) || defined(HAVE_LOCALTIME_S) struct tm tmbuf; #endif -#if defined(HAVE__LOCALTIME64_S) - errno_t terr; - __time64_t tmptime; -#endif /* List reference archive, make sure the TOC is correct. */ extract_reference_file("test_option_t.cpio"); @@ -95,15 +91,10 @@ DEFINE_TEST(test_option_t) #ifdef HAVE_LOCALE_H setlocale(LC_ALL, ""); #endif -#if defined(HAVE_LOCALTIME_R) +#if defined(HAVE_LOCALTIME_S) + tmptr = localtime_s(&tmbuf, &mtime) ? NULL : &tmbuf; +#elif defined(HAVE_LOCALTIME_R) tmptr = localtime_r(&mtime, &tmbuf); -#elif defined(HAVE__LOCALTIME64_S) - tmptime = mtime; - terr = _localtime64_s(&tmbuf, &tmptime); - if (terr) - tmptr = NULL; - else - tmptr = &tmbuf; #else tmptr = localtime(&mtime); #endif diff --git a/contrib/libarchive/libarchive/archive.h b/contrib/libarchive/libarchive/archive.h index 5fa56de6c9fd..4182cc55d4a4 100644 --- a/contrib/libarchive/libarchive/archive.h +++ b/contrib/libarchive/libarchive/archive.h @@ -36,7 +36,7 @@ * assert that ARCHIVE_VERSION_NUMBER >= 2012108. */ /* Note: Compiler will complain if this does not match archive_entry.h! */ -#define ARCHIVE_VERSION_NUMBER 3006002 +#define ARCHIVE_VERSION_NUMBER 3007000 #include #include /* for wchar_t */ @@ -157,7 +157,7 @@ __LA_DECL int archive_version_number(void); /* * Textual name/version of the library, useful for version displays. */ -#define ARCHIVE_VERSION_ONLY_STRING "3.6.2" +#define ARCHIVE_VERSION_ONLY_STRING "3.7.0" #define ARCHIVE_VERSION_STRING "libarchive " ARCHIVE_VERSION_ONLY_STRING __LA_DECL const char * archive_version_string(void); diff --git a/contrib/libarchive/libarchive/archive_digest.c b/contrib/libarchive/libarchive/archive_digest.c index 3361b19ada82..08a9aeb02320 100644 --- a/contrib/libarchive/libarchive/archive_digest.c +++ b/contrib/libarchive/libarchive/archive_digest.c @@ -36,6 +36,11 @@ #error Cannot use both OpenSSL and libmd. #endif +/* Common in other bcrypt implementations, but missing from VS2008. */ +#ifndef BCRYPT_SUCCESS +#define BCRYPT_SUCCESS(r) ((NTSTATUS)(r) == STATUS_SUCCESS) +#endif + /* * Message digest functions for Windows platform. */ @@ -48,6 +53,26 @@ /* * Initialize a Message digest. */ +#if defined(HAVE_BCRYPT_H) && _WIN32_WINNT >= _WIN32_WINNT_VISTA +static int +win_crypto_init(Digest_CTX *ctx, const WCHAR *algo) +{ + NTSTATUS status; + ctx->valid = 0; + + status = BCryptOpenAlgorithmProvider(&ctx->hAlg, algo, NULL, 0); + if (!BCRYPT_SUCCESS(status)) + return (ARCHIVE_FAILED); + status = BCryptCreateHash(ctx->hAlg, &ctx->hHash, NULL, 0, NULL, 0, 0); + if (!BCRYPT_SUCCESS(status)) { + BCryptCloseAlgorithmProvider(ctx->hAlg, 0); + return (ARCHIVE_FAILED); + } + + ctx->valid = 1; + return (ARCHIVE_OK); +} +#else static int win_crypto_init(Digest_CTX *ctx, DWORD prov, ALG_ID algId) { @@ -70,6 +95,7 @@ win_crypto_init(Digest_CTX *ctx, DWORD prov, ALG_ID algId) ctx->valid = 1; return (ARCHIVE_OK); } +#endif /* * Update a Message digest. @@ -81,23 +107,37 @@ win_crypto_Update(Digest_CTX *ctx, const unsigned char *buf, size_t len) if (!ctx->valid) return (ARCHIVE_FAILED); +#if defined(HAVE_BCRYPT_H) && _WIN32_WINNT >= _WIN32_WINNT_VISTA + BCryptHashData(ctx->hHash, + (PUCHAR)(uintptr_t)buf, + len, 0); +#else CryptHashData(ctx->hash, (unsigned char *)(uintptr_t)buf, (DWORD)len, 0); +#endif return (ARCHIVE_OK); } static int win_crypto_Final(unsigned char *buf, size_t bufsize, Digest_CTX *ctx) { +#if !(defined(HAVE_BCRYPT_H) && _WIN32_WINNT >= _WIN32_WINNT_VISTA) DWORD siglen = (DWORD)bufsize; +#endif if (!ctx->valid) return (ARCHIVE_FAILED); +#if defined(HAVE_BCRYPT_H) && _WIN32_WINNT >= _WIN32_WINNT_VISTA + BCryptFinishHash(ctx->hHash, buf, (ULONG)bufsize, 0); + BCryptDestroyHash(ctx->hHash); + BCryptCloseAlgorithmProvider(ctx->hAlg, 0); +#else CryptGetHashParam(ctx->hash, HP_HASHVAL, buf, &siglen, 0); CryptDestroyHash(ctx->hash); CryptReleaseContext(ctx->cryptProv, 0); +#endif ctx->valid = 0; return (ARCHIVE_OK); } @@ -276,7 +316,11 @@ __archive_md5final(archive_md5_ctx *ctx, void *md) static int __archive_md5init(archive_md5_ctx *ctx) { +#if defined(HAVE_BCRYPT_H) && _WIN32_WINNT >= _WIN32_WINNT_VISTA + return (win_crypto_init(ctx, BCRYPT_MD5_ALGORITHM)); +#else return (win_crypto_init(ctx, PROV_RSA_FULL, CALG_MD5)); +#endif } static int @@ -659,7 +703,11 @@ __archive_sha1final(archive_sha1_ctx *ctx, void *md) static int __archive_sha1init(archive_sha1_ctx *ctx) { +#if defined(HAVE_BCRYPT_H) && _WIN32_WINNT >= _WIN32_WINNT_VISTA + return (win_crypto_init(ctx, BCRYPT_SHA1_ALGORITHM)); +#else return (win_crypto_init(ctx, PROV_RSA_FULL, CALG_SHA1)); +#endif } static int @@ -919,7 +967,11 @@ __archive_sha256final(archive_sha256_ctx *ctx, void *md) static int __archive_sha256init(archive_sha256_ctx *ctx) { +#if defined(HAVE_BCRYPT_H) && _WIN32_WINNT >= _WIN32_WINNT_VISTA + return (win_crypto_init(ctx, BCRYPT_SHA256_ALGORITHM)); +#else return (win_crypto_init(ctx, PROV_RSA_AES, CALG_SHA_256)); +#endif } static int @@ -1155,7 +1207,11 @@ __archive_sha384final(archive_sha384_ctx *ctx, void *md) static int __archive_sha384init(archive_sha384_ctx *ctx) { +#if defined(HAVE_BCRYPT_H) && _WIN32_WINNT >= _WIN32_WINNT_VISTA + return (win_crypto_init(ctx, BCRYPT_SHA384_ALGORITHM)); +#else return (win_crypto_init(ctx, PROV_RSA_AES, CALG_SHA_384)); +#endif } static int @@ -1415,7 +1471,11 @@ __archive_sha512final(archive_sha512_ctx *ctx, void *md) static int __archive_sha512init(archive_sha512_ctx *ctx) { +#if defined(HAVE_BCRYPT_H) && _WIN32_WINNT >= _WIN32_WINNT_VISTA + return (win_crypto_init(ctx, BCRYPT_SHA512_ALGORITHM)); +#else return (win_crypto_init(ctx, PROV_RSA_AES, CALG_SHA_512)); +#endif } static int diff --git a/contrib/libarchive/libarchive/archive_digest_private.h b/contrib/libarchive/libarchive/archive_digest_private.h index 9b3bd6621bf3..339b4edca48d 100644 --- a/contrib/libarchive/libarchive/archive_digest_private.h +++ b/contrib/libarchive/libarchive/archive_digest_private.h @@ -164,6 +164,15 @@ defined(ARCHIVE_CRYPTO_SHA256_WIN) ||\ defined(ARCHIVE_CRYPTO_SHA384_WIN) ||\ defined(ARCHIVE_CRYPTO_SHA512_WIN) +#if defined(HAVE_BCRYPT_H) && _WIN32_WINNT >= _WIN32_WINNT_VISTA +/* don't use bcrypt when XP needs to be supported */ +#include +typedef struct { + int valid; + BCRYPT_ALG_HANDLE hAlg; + BCRYPT_HASH_HANDLE hHash; +} Digest_CTX; +#else #include #include typedef struct { @@ -172,6 +181,7 @@ typedef struct { HCRYPTHASH hash; } Digest_CTX; #endif +#endif /* typedefs */ #if defined(ARCHIVE_CRYPTO_MD5_LIBC) diff --git a/contrib/libarchive/libarchive/archive_entry.h b/contrib/libarchive/libarchive/archive_entry.h index ff64a4712a56..74033564396d 100644 --- a/contrib/libarchive/libarchive/archive_entry.h +++ b/contrib/libarchive/libarchive/archive_entry.h @@ -30,7 +30,7 @@ #define ARCHIVE_ENTRY_H_INCLUDED /* Note: Compiler will complain if this does not match archive.h! */ -#define ARCHIVE_VERSION_NUMBER 3006002 +#define ARCHIVE_VERSION_NUMBER 3007000 /* * Note: archive_entry.h is for use outside of libarchive; the diff --git a/contrib/libarchive/libarchive/archive_getdate.c b/contrib/libarchive/libarchive/archive_getdate.c index 39e224cb9010..20ab1b1588fe 100644 --- a/contrib/libarchive/libarchive/archive_getdate.c +++ b/contrib/libarchive/libarchive/archive_getdate.c @@ -698,13 +698,9 @@ Convert(time_t Month, time_t Day, time_t Year, time_t Julian; int i; struct tm *ltime; -#if defined(HAVE_LOCALTIME_R) || defined(HAVE__LOCALTIME64_S) +#if defined(HAVE_LOCALTIME_R) || defined(HAVE_LOCALTIME_S) struct tm tmbuf; #endif -#if defined(HAVE__LOCALTIME64_S) - errno_t terr; - __time64_t tmptime; -#endif if (Year < 69) Year += 2000; @@ -731,15 +727,10 @@ Convert(time_t Month, time_t Day, time_t Year, Julian *= DAY; Julian += Timezone; Julian += Hours * HOUR + Minutes * MINUTE + Seconds; -#if defined(HAVE_LOCALTIME_R) +#if defined(HAVE_LOCALTIME_S) + ltime = localtime_s(&tmbuf, &Julian) ? NULL : &tmbuf; +#elif defined(HAVE_LOCALTIME_R) ltime = localtime_r(&Julian, &tmbuf); -#elif defined(HAVE__LOCALTIME64_S) - tmptime = Julian; - terr = _localtime64_s(&tmbuf, &tmptime); - if (terr) - ltime = NULL; - else - ltime = &tmbuf; #else ltime = localtime(&Julian); #endif @@ -755,36 +746,21 @@ DSTcorrect(time_t Start, time_t Future) time_t StartDay; time_t FutureDay; struct tm *ltime; -#if defined(HAVE_LOCALTIME_R) || defined(HAVE__LOCALTIME64_S) +#if defined(HAVE_LOCALTIME_R) || defined(HAVE_LOCALTIME_S) struct tm tmbuf; #endif -#if defined(HAVE__LOCALTIME64_S) - errno_t terr; - __time64_t tmptime; -#endif - -#if defined(HAVE_LOCALTIME_R) +#if defined(HAVE_LOCALTIME_S) + ltime = localtime_s(&tmbuf, &Start) ? NULL : &tmbuf; +#elif defined(HAVE_LOCALTIME_R) ltime = localtime_r(&Start, &tmbuf); -#elif defined(HAVE__LOCALTIME64_S) - tmptime = Start; - terr = _localtime64_s(&tmbuf, &tmptime); - if (terr) - ltime = NULL; - else - ltime = &tmbuf; #else ltime = localtime(&Start); #endif StartDay = (ltime->tm_hour + 1) % 24; -#if defined(HAVE_LOCALTIME_R) +#if defined(HAVE_LOCALTIME_S) + ltime = localtime_s(&tmbuf, &Future) ? NULL : &tmbuf; +#elif defined(HAVE_LOCALTIME_R) ltime = localtime_r(&Future, &tmbuf); -#elif defined(HAVE__LOCALTIME64_S) - tmptime = Future; - terr = _localtime64_s(&tmbuf, &tmptime); - if (terr) - ltime = NULL; - else - ltime = &tmbuf; #else ltime = localtime(&Future); #endif @@ -799,24 +775,15 @@ RelativeDate(time_t Start, time_t zone, int dstmode, { struct tm *tm; time_t t, now; -#if defined(HAVE_GMTIME_R) || defined(HAVE__GMTIME64_S) +#if defined(HAVE_GMTIME_R) || defined(HAVE_GMTIME_S) struct tm tmbuf; #endif -#if defined(HAVE__GMTIME64_S) - errno_t terr; - __time64_t tmptime; -#endif t = Start - zone; -#if defined(HAVE_GMTIME_R) +#if defined(HAVE_GMTIME_S) + tm = gmtime_s(&tmbuf, &t) ? NULL : &tmbuf; +#elif defined(HAVE_GMTIME_R) tm = gmtime_r(&t, &tmbuf); -#elif defined(HAVE__GMTIME64_S) - tmptime = t; - terr = _gmtime64_s(&tmbuf, &tmptime); - if (terr) - tm = NULL; - else - tm = &tmbuf; #else tm = gmtime(&t); #endif @@ -835,25 +802,16 @@ RelativeMonth(time_t Start, time_t Timezone, time_t RelMonth) struct tm *tm; time_t Month; time_t Year; -#if defined(HAVE_LOCALTIME_R) || defined(HAVE__LOCALTIME64_S) +#if defined(HAVE_LOCALTIME_R) || defined(HAVE_LOCALTIME_S) struct tm tmbuf; #endif -#if defined(HAVE__LOCALTIME64_S) - errno_t terr; - __time64_t tmptime; -#endif if (RelMonth == 0) return 0; -#if defined(HAVE_LOCALTIME_R) +#if defined(HAVE_LOCALTIME_S) + tm = localtime_s(&tmbuf, &Start) ? NULL : &tmbuf; +#elif defined(HAVE_LOCALTIME_R) tm = localtime_r(&Start, &tmbuf); -#elif defined(HAVE__LOCALTIME64_S) - tmptime = Start; - terr = _localtime64_s(&tmbuf, &tmptime); - if (terr) - tm = NULL; - else - tm = &tmbuf; #else tm = localtime(&Start); #endif @@ -993,10 +951,6 @@ __archive_get_date(time_t now, const char *p) time_t Start; time_t tod; long tzone; -#if defined(HAVE__LOCALTIME64_S) || defined(HAVE__GMTIME64_S) - errno_t terr; - __time64_t tmptime; -#endif /* Clear out the parsed token array. */ memset(tokens, 0, sizeof(tokens)); @@ -1005,36 +959,26 @@ __archive_get_date(time_t now, const char *p) gds = &_gds; /* Look up the current time. */ -#if defined(HAVE_LOCALTIME_R) +#if defined(HAVE_LOCALTIME_S) + tm = localtime_s(&local, &now) ? NULL : &local; +#elif defined(HAVE_LOCALTIME_R) tm = localtime_r(&now, &local); -#elif defined(HAVE__LOCALTIME64_S) - tmptime = now; - terr = _localtime64_s(&local, &tmptime); - if (terr) - tm = NULL; - else - tm = &local; #else memset(&local, 0, sizeof(local)); tm = localtime(&now); #endif if (tm == NULL) return -1; -#if !defined(HAVE_LOCALTIME_R) && !defined(HAVE__LOCALTIME64_S) +#if !defined(HAVE_LOCALTIME_R) && !defined(HAVE_LOCALTIME_S) local = *tm; #endif /* Look up UTC if we can and use that to determine the current * timezone offset. */ -#if defined(HAVE_GMTIME_R) +#if defined(HAVE_GMTIME_S) + gmt_ptr = gmtime_s(&gmt, &now) ? NULL : &gmt; +#elif defined(HAVE_GMTIME_R) gmt_ptr = gmtime_r(&now, &gmt); -#elif defined(HAVE__GMTIME64_S) - tmptime = now; - terr = _gmtime64_s(&gmt, &tmptime); - if (terr) - gmt_ptr = NULL; - else - gmt_ptr = &gmt; #else memset(&gmt, 0, sizeof(gmt)); gmt_ptr = gmtime(&now); @@ -1076,15 +1020,10 @@ __archive_get_date(time_t now, const char *p) * time components instead of the local timezone. */ if (gds->HaveZone && gmt_ptr != NULL) { now -= gds->Timezone; -#if defined(HAVE_GMTIME_R) +#if defined(HAVE_GMTIME_S) + gmt_ptr = gmtime_s(&gmt, &now) ? NULL : &gmt; +#elif defined(HAVE_GMTIME_R) gmt_ptr = gmtime_r(&now, &gmt); -#elif defined(HAVE__GMTIME64_S) - tmptime = now; - terr = _gmtime64_s(&gmt, &tmptime); - if (terr) - gmt_ptr = NULL; - else - gmt_ptr = &gmt; #else gmt_ptr = gmtime(&now); #endif diff --git a/contrib/libarchive/libarchive/archive_hmac.c b/contrib/libarchive/libarchive/archive_hmac.c index 0914f38e3670..edb3bf5abd42 100644 --- a/contrib/libarchive/libarchive/archive_hmac.c +++ b/contrib/libarchive/libarchive/archive_hmac.c @@ -231,15 +231,20 @@ static int __hmac_sha1_init(archive_hmac_sha1_ctx *ctx, const uint8_t *key, size_t key_len) { #if OPENSSL_VERSION_NUMBER >= 0x30000000L - OSSL_PARAM params[2]; + EVP_MAC *mac; - EVP_MAC *mac = EVP_MAC_fetch(NULL, "HMAC", NULL); + char sha1[] = "SHA1"; + OSSL_PARAM params[] = { + OSSL_PARAM_utf8_string("digest", sha1, sizeof(sha1) - 1), + OSSL_PARAM_END + }; + + mac = EVP_MAC_fetch(NULL, "HMAC", NULL); *ctx = EVP_MAC_CTX_new(mac); + EVP_MAC_free(mac); if (*ctx == NULL) return -1; - EVP_MAC_free(mac); - params[0] = OSSL_PARAM_construct_utf8_string("digest", (char *)"SHA1", 0); - params[1] = OSSL_PARAM_construct_end(); + EVP_MAC_init(*ctx, key, key_len, params); #else *ctx = HMAC_CTX_new(); diff --git a/contrib/libarchive/libarchive/archive_hmac_private.h b/contrib/libarchive/libarchive/archive_hmac_private.h index 50044a045e37..d0fda7f9667a 100644 --- a/contrib/libarchive/libarchive/archive_hmac_private.h +++ b/contrib/libarchive/libarchive/archive_hmac_private.h @@ -77,6 +77,8 @@ typedef struct hmac_sha1_ctx archive_hmac_sha1_ctx; #include #include #if OPENSSL_VERSION_NUMBER >= 0x30000000L +#include + typedef EVP_MAC_CTX *archive_hmac_sha1_ctx; #else diff --git a/contrib/libarchive/libarchive/archive_openssl_evp_private.h b/contrib/libarchive/libarchive/archive_openssl_evp_private.h index ebb06702d0c5..8ac4772808e6 100644 --- a/contrib/libarchive/libarchive/archive_openssl_evp_private.h +++ b/contrib/libarchive/libarchive/archive_openssl_evp_private.h @@ -33,7 +33,8 @@ #include #include -#if OPENSSL_VERSION_NUMBER < 0x10100000L +#if OPENSSL_VERSION_NUMBER < 0x10100000L || \ + (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x2070000fL) #include /* malloc, free */ #include /* memset */ static inline EVP_MD_CTX *EVP_MD_CTX_new(void) diff --git a/contrib/libarchive/libarchive/archive_random.c b/contrib/libarchive/libarchive/archive_random.c index 9d1aa493f0c8..301765acd830 100644 --- a/contrib/libarchive/libarchive/archive_random.c +++ b/contrib/libarchive/libarchive/archive_random.c @@ -51,16 +51,27 @@ __FBSDID("$FreeBSD$"); #include #endif -static void arc4random_buf(void *, size_t); +static void la_arc4random_buf(void *, size_t); #endif /* HAVE_ARC4RANDOM_BUF */ #include "archive.h" #include "archive_random_private.h" -#if defined(HAVE_WINCRYPT_H) && !defined(__CYGWIN__) +#if defined(_WIN32) && !defined(__CYGWIN__) +#if defined(HAVE_BCRYPT_H) && _WIN32_WINNT >= _WIN32_WINNT_VISTA +/* don't use bcrypt when XP needs to be supported */ +#include + +/* Common in other bcrypt implementations, but missing from VS2008. */ +#ifndef BCRYPT_SUCCESS +#define BCRYPT_SUCCESS(r) ((NTSTATUS)(r) == STATUS_SUCCESS) +#endif + +#elif defined(HAVE_WINCRYPT_H) #include #endif +#endif #ifndef O_CLOEXEC #define O_CLOEXEC 0 @@ -75,6 +86,20 @@ int archive_random(void *buf, size_t nbytes) { #if defined(_WIN32) && !defined(__CYGWIN__) +# if defined(HAVE_BCRYPT_H) && _WIN32_WINNT >= _WIN32_WINNT_VISTA + NTSTATUS status; + BCRYPT_ALG_HANDLE hAlg; + + status = BCryptOpenAlgorithmProvider(&hAlg, BCRYPT_RNG_ALGORITHM, NULL, 0); + if (!BCRYPT_SUCCESS(status)) + return ARCHIVE_FAILED; + status = BCryptGenRandom(hAlg, buf, nbytes, 0); + BCryptCloseAlgorithmProvider(hAlg, 0); + if (!BCRYPT_SUCCESS(status)) + return ARCHIVE_FAILED; + + return ARCHIVE_OK; +# else HCRYPTPROV hProv; BOOL success; @@ -92,6 +117,10 @@ archive_random(void *buf, size_t nbytes) } /* TODO: Does this case really happen? */ return ARCHIVE_FAILED; +# endif +#elif !defined(HAVE_ARC4RANDOM_BUF) && (!defined(_WIN32) || defined(__CYGWIN__)) + la_arc4random_buf(buf, nbytes); + return ARCHIVE_OK; #else arc4random_buf(buf, nbytes); return ARCHIVE_OK; @@ -256,7 +285,7 @@ arc4_getbyte(void) } static void -arc4random_buf(void *_buf, size_t n) +la_arc4random_buf(void *_buf, size_t n) { uint8_t *buf = (uint8_t *)_buf; _ARC4_LOCK(); diff --git a/contrib/libarchive/libarchive/archive_read_data_into_fd.c b/contrib/libarchive/libarchive/archive_read_data_into_fd.c index 1f210fce146f..81a36125a4ba 100644 --- a/contrib/libarchive/libarchive/archive_read_data_into_fd.c +++ b/contrib/libarchive/libarchive/archive_read_data_into_fd.c @@ -95,8 +95,13 @@ archive_read_data_into_fd(struct archive *a, int fd) "archive_read_data_into_fd"); can_lseek = (fstat(fd, &st) == 0) && S_ISREG(st.st_mode); - if (!can_lseek) + if (!can_lseek) { nulls = calloc(1, nulls_size); + if (!nulls) { + r = ARCHIVE_FATAL; + goto cleanup; + } + } while ((r = archive_read_data_block(a, &buff, &size, &target_offset)) == ARCHIVE_OK) { diff --git a/contrib/libarchive/libarchive/archive_read_disk_posix.c b/contrib/libarchive/libarchive/archive_read_disk_posix.c index 5a94ec5d4399..e9657f6a72e8 100644 --- a/contrib/libarchive/libarchive/archive_read_disk_posix.c +++ b/contrib/libarchive/libarchive/archive_read_disk_posix.c @@ -1670,6 +1670,11 @@ setup_current_filesystem(struct archive_read_disk *a) else t->current_filesystem->name_max = nm; #endif + if (t->current_filesystem->name_max == 0) { + archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, + "Cannot determine name_max"); + return (ARCHIVE_FAILED); + } #endif /* USE_READDIR_R */ return (ARCHIVE_OK); } @@ -1860,7 +1865,16 @@ setup_current_filesystem(struct archive_read_disk *a) #if defined(USE_READDIR_R) /* Set maximum filename length. */ +#if defined(HAVE_STATVFS) + t->current_filesystem->name_max = svfs.f_namelen; +#else t->current_filesystem->name_max = sfs.f_namelen; +#endif + if (t->current_filesystem->name_max == 0) { + archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, + "Cannot determine name_max"); + return (ARCHIVE_FAILED); + } #endif return (ARCHIVE_OK); } @@ -1942,6 +1956,11 @@ setup_current_filesystem(struct archive_read_disk *a) #if defined(USE_READDIR_R) /* Set maximum filename length. */ t->current_filesystem->name_max = svfs.f_namemax; + if (t->current_filesystem->name_max == 0) { + archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, + "Cannot determine name_max"); + return (ARCHIVE_FAILED); + } #endif return (ARCHIVE_OK); } @@ -1996,6 +2015,11 @@ setup_current_filesystem(struct archive_read_disk *a) else t->current_filesystem->name_max = nm; # endif /* _PC_NAME_MAX */ + if (t->current_filesystem->name_max == 0) { + archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, + "Cannot determine name_max"); + return (ARCHIVE_FAILED); + } #endif /* USE_READDIR_R */ return (ARCHIVE_OK); } @@ -2543,7 +2567,11 @@ tree_current_lstat(struct tree *t) #else if (tree_enter_working_dir(t) != 0) return NULL; +#ifdef HAVE_LSTAT if (lstat(tree_current_access_path(t), &t->lst) != 0) +#else + if (la_stat(tree_current_access_path(t), &t->lst) != 0) +#endif #endif return NULL; t->flags |= hasLstat; diff --git a/contrib/libarchive/libarchive/archive_read_open_file.c b/contrib/libarchive/libarchive/archive_read_open_file.c index 6001dfd47780..c9dcbb1cfec1 100644 --- a/contrib/libarchive/libarchive/archive_read_open_file.c +++ b/contrib/libarchive/libarchive/archive_read_open_file.c @@ -154,10 +154,10 @@ file_skip(struct archive *a, void *client_data, int64_t request) *** 5576 LINES SKIPPED *** From nobody Sat May 4 12:37:35 2024 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 4VWnHz5Q4Yz5KVXk; Sat, 4 May 2024 12:37: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 4VWnHz2600z44HM; Sat, 4 May 2024 12:37:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714826255; 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=G5iGhW9uhMCCOHETw5+nTLIxJaBf3qXcI/U4KB4q5kU=; b=TgP466znEJdpyQeheTwFzyoinpqlZs7wc+n0exEcRFiMRD6mx21Httm7NwYPyiu52mvE48 HaB6ZPb8fwie4LPf0v39whKuWeb8W9bg7Yi9X0LVKR3ERLKilFKBLPK36e2VS9+A6UWYzD VhaN5jJoligjT9ggCKLtPAlDGyu74Vh7887JIBt72JgrTj4tFY+Yc7L0aqMobE0zJEjEbu JgnZJL1qNGwiz2frKAN3Xjs7IRtyiaH1jNSYQPVHeYeuRsu3P/X0wbf/hEvAnxBhyS1vXk XypFJrNNf20QkLdXPIgf9lSMyLP5wc4iMnqK3n0W/GiRpoGbqQ4KUzLj+xumpw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714826255; a=rsa-sha256; cv=none; b=DdG5+CVTIG5vAx1rwRUmz5b3EbEVP2/+flCGe56R8Xt6mkf5hEKfZDP7IVvad34B+DjH4f B2evkpnXLeVSbadBk4gZftVXPF1CDO95JKMy3DZL4Syuc5zOzEXzZHld9v3JGfvlLP0NOV tpzprdpOuCt0gqOxtY9ckNRvBmkxvBidsjrzA51miYTsBi0qyah/9XKfI3MW8C/zUmV3YZ iAZGCtk2xZksyArZsvkP2IC65mhX4JL1w8wucRAtJOesr2S0hojLC5WjQy4FjmFQFl4G7W W37xK2nsT3kFLC6Ha6u/a6xxbID0uBB8xY+iusPDy4nl36LpncD+BnkHNj8myA== 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=1714826255; 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=G5iGhW9uhMCCOHETw5+nTLIxJaBf3qXcI/U4KB4q5kU=; b=QbP3JHHRP1bfZzlGAHtsDhPM3TYeHMtE/Zd3U5nWAqTUydVCS2jnmUgf+W41vwcdRQrSon gw43BAGlDXraoN9xnYw5WoqBwy9cNkC5VV+oUzyPlXb6/EtUvkcbzfI0bql018d0oxZ+QI oaJRqY3yzEb7pg4ZgTJlC3OGYv4QH8vOymNydnpTBwRejr7i5qn/tTR1BrSciqEfoXFUB8 BZiAXptffAGj60DQt/0J+iRT9qjdKvRDov/VmWJZ9CDKUmjFi5YlYCWJhKo0LEL4DwjEf5 VDvDWZkqseQyVkJekrpHsEyNyRUuVAHo0qDrwkTl2ovyzyzmFzNiKnz54wK3kw== 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 4VWnHz1bZMzVxh; Sat, 4 May 2024 12:37: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 444CbZVR072327; Sat, 4 May 2024 12:37:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 444CbZuV072324; Sat, 4 May 2024 12:37:35 GMT (envelope-from git) Date: Sat, 4 May 2024 12:37:35 GMT Message-Id: <202405041237.444CbZuV072324@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Martin Matuska Subject: git: 2cb0ab6bc177 - stable/13 - libarchive: merge from vendor branch List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2cb0ab6bc1772f2bc0d296d45b49d89f256febee Auto-Submitted: auto-generated The branch stable/13 has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=2cb0ab6bc1772f2bc0d296d45b49d89f256febee commit 2cb0ab6bc1772f2bc0d296d45b49d89f256febee Author: Martin Matuska AuthorDate: 2023-07-29 20:43:36 +0000 Commit: Martin Matuska CommitDate: 2024-05-04 11:53:07 +0000 libarchive: merge from vendor branch Libarchive 3.7.1 Important changes (relevant to FreeBSD): ISSUE #1934: stack buffer overflow in cpio verbose mode ISSUE #1935: SEGV in cpio verbose mode PR #1731 tar: respect --strip-components and -s patterns in cru modes (cherry picked from commit 64884e0d4ce7ed57c970e1b34f93e3754c656900) --- contrib/libarchive/NEWS | 2 + contrib/libarchive/cpio/cpio.c | 7 +- contrib/libarchive/libarchive/archive.h | 4 +- contrib/libarchive/libarchive/archive_entry.h | 2 +- .../libarchive/archive_read_disk_posix.c | 2 +- .../libarchive/archive_read_support_filter_bzip2.c | 4 +- .../libarchive/archive_read_support_filter_lz4.c | 2 +- .../libarchive/archive_read_support_format_7zip.c | 8 +- .../libarchive/archive_read_support_format_lha.c | 7 +- .../libarchive/archive_read_support_format_rar.c | 4 +- .../libarchive/archive_read_support_format_rar5.c | 2 +- .../libarchive/archive_read_support_format_zip.c | 4 +- .../libarchive/archive_write_add_filter_bzip2.c | 6 +- .../libarchive/archive_write_add_filter_lz4.c | 8 +- .../libarchive/archive_write_add_filter_zstd.c | 4 +- .../libarchive/archive_write_disk_posix.c | 7 +- .../libarchive/archive_write_set_format_7zip.c | 8 +- contrib/libarchive/tar/write.c | 2 + contrib/libarchive/unzip/CMakeLists.txt | 37 - contrib/libarchive/unzip/bsdunzip.1 | 8 +- contrib/libarchive/unzip/bsdunzip.c | 56 +- contrib/libarchive/unzip/bsdunzip_platform.h | 8 - contrib/libarchive/unzip/la_getline.c | 99 +++ contrib/libarchive/unzip/la_queue.h | 840 +++++++++++++++++++++ contrib/libarchive/unzip/test/CMakeLists.txt | 80 -- 25 files changed, 1044 insertions(+), 167 deletions(-) diff --git a/contrib/libarchive/NEWS b/contrib/libarchive/NEWS index 61d1ca47340e..7509c9ce5fa1 100644 --- a/contrib/libarchive/NEWS +++ b/contrib/libarchive/NEWS @@ -1,3 +1,5 @@ +Jul 29, 2023: libarchive 3.7.1 released + Jul 18, 2023: libarchive 3.7.0 released Jul 14, 2023: bsdunzip port from FreeBSD diff --git a/contrib/libarchive/cpio/cpio.c b/contrib/libarchive/cpio/cpio.c index fbeae4133091..7bd6a782b5b2 100644 --- a/contrib/libarchive/cpio/cpio.c +++ b/contrib/libarchive/cpio/cpio.c @@ -1146,7 +1146,7 @@ list_item_verbose(struct cpio *cpio, struct archive_entry *entry) { char size[32]; char date[32]; - char uids[16], gids[16]; + char uids[22], gids[22]; const char *uname, *gname; FILE *out = stdout; const char *fmt; @@ -1210,7 +1210,10 @@ list_item_verbose(struct cpio *cpio, struct archive_entry *entry) #else ltime = localtime(&mtime); #endif - strftime(date, sizeof(date), fmt, ltime); + if (ltime != NULL) + strftime(date, sizeof(date), fmt, ltime); + else + strcpy(date, "invalid mtime"); fprintf(out, "%s%3d %-8s %-8s %8s %12s %s", archive_entry_strmode(entry), diff --git a/contrib/libarchive/libarchive/archive.h b/contrib/libarchive/libarchive/archive.h index 4182cc55d4a4..25e47e96c058 100644 --- a/contrib/libarchive/libarchive/archive.h +++ b/contrib/libarchive/libarchive/archive.h @@ -36,7 +36,7 @@ * assert that ARCHIVE_VERSION_NUMBER >= 2012108. */ /* Note: Compiler will complain if this does not match archive_entry.h! */ -#define ARCHIVE_VERSION_NUMBER 3007000 +#define ARCHIVE_VERSION_NUMBER 3007001 #include #include /* for wchar_t */ @@ -157,7 +157,7 @@ __LA_DECL int archive_version_number(void); /* * Textual name/version of the library, useful for version displays. */ -#define ARCHIVE_VERSION_ONLY_STRING "3.7.0" +#define ARCHIVE_VERSION_ONLY_STRING "3.7.1" #define ARCHIVE_VERSION_STRING "libarchive " ARCHIVE_VERSION_ONLY_STRING __LA_DECL const char * archive_version_string(void); diff --git a/contrib/libarchive/libarchive/archive_entry.h b/contrib/libarchive/libarchive/archive_entry.h index 74033564396d..f6860ec9afcb 100644 --- a/contrib/libarchive/libarchive/archive_entry.h +++ b/contrib/libarchive/libarchive/archive_entry.h @@ -30,7 +30,7 @@ #define ARCHIVE_ENTRY_H_INCLUDED /* Note: Compiler will complain if this does not match archive.h! */ -#define ARCHIVE_VERSION_NUMBER 3007000 +#define ARCHIVE_VERSION_NUMBER 3007001 /* * Note: archive_entry.h is for use outside of libarchive; the diff --git a/contrib/libarchive/libarchive/archive_read_disk_posix.c b/contrib/libarchive/libarchive/archive_read_disk_posix.c index e9657f6a72e8..8d5c32f0385e 100644 --- a/contrib/libarchive/libarchive/archive_read_disk_posix.c +++ b/contrib/libarchive/libarchive/archive_read_disk_posix.c @@ -1866,7 +1866,7 @@ setup_current_filesystem(struct archive_read_disk *a) #if defined(USE_READDIR_R) /* Set maximum filename length. */ #if defined(HAVE_STATVFS) - t->current_filesystem->name_max = svfs.f_namelen; + t->current_filesystem->name_max = svfs.f_namemax; #else t->current_filesystem->name_max = sfs.f_namelen; #endif diff --git a/contrib/libarchive/libarchive/archive_read_support_filter_bzip2.c b/contrib/libarchive/libarchive/archive_read_support_filter_bzip2.c index 793d605c8725..9158e668eb42 100644 --- a/contrib/libarchive/libarchive/archive_read_support_filter_bzip2.c +++ b/contrib/libarchive/libarchive/archive_read_support_filter_bzip2.c @@ -230,7 +230,7 @@ bzip2_filter_read(struct archive_read_filter *self, const void **p) /* Empty our output buffer. */ state->stream.next_out = state->out_block; - state->stream.avail_out = state->out_block_size; + state->stream.avail_out = (uint32_t)state->out_block_size; /* Try to fill the output buffer. */ for (;;) { @@ -288,7 +288,7 @@ bzip2_filter_read(struct archive_read_filter *self, const void **p) return (ARCHIVE_FATAL); } state->stream.next_in = (char *)(uintptr_t)read_buf; - state->stream.avail_in = ret; + state->stream.avail_in = (uint32_t)ret; /* There is no more data, return whatever we have. */ if (ret == 0) { state->eof = 1; diff --git a/contrib/libarchive/libarchive/archive_read_support_filter_lz4.c b/contrib/libarchive/libarchive/archive_read_support_filter_lz4.c index 1e99542d7b7b..d0fc1a83e462 100644 --- a/contrib/libarchive/libarchive/archive_read_support_filter_lz4.c +++ b/contrib/libarchive/libarchive/archive_read_support_filter_lz4.c @@ -584,7 +584,7 @@ lz4_filter_read_data_block(struct archive_read_filter *self, const void **p) state->out_block + prefix64k, (int)compressed_size, state->flags.block_maximum_size, state->out_block, - prefix64k); + (int)prefix64k); #else uncompressed_size = LZ4_decompress_safe_withPrefix64k( read_buf + 4, diff --git a/contrib/libarchive/libarchive/archive_read_support_format_7zip.c b/contrib/libarchive/libarchive/archive_read_support_format_7zip.c index bb595b3e4b07..b171bea01a2f 100644 --- a/contrib/libarchive/libarchive/archive_read_support_format_7zip.c +++ b/contrib/libarchive/libarchive/archive_read_support_format_7zip.c @@ -1477,9 +1477,9 @@ decompress(struct archive_read *a, struct _7zip *zip, #if defined(HAVE_BZLIB_H) && defined(BZ_CONFIG_ERROR) case _7Z_BZ2: zip->bzstream.next_in = (char *)(uintptr_t)t_next_in; - zip->bzstream.avail_in = t_avail_in; + zip->bzstream.avail_in = (uint32_t)t_avail_in; zip->bzstream.next_out = (char *)(uintptr_t)t_next_out; - zip->bzstream.avail_out = t_avail_out; + zip->bzstream.avail_out = (uint32_t)t_avail_out; r = BZ2_bzDecompress(&(zip->bzstream)); switch (r) { case BZ_STREAM_END: /* Found end of stream. */ @@ -3833,7 +3833,7 @@ arm_Convert(struct _7zip *zip, uint8_t *buf, size_t size) } } - zip->bcj_ip += i; + zip->bcj_ip += (uint32_t)i; return i; } @@ -3896,7 +3896,7 @@ arm64_Convert(struct _7zip *zip, uint8_t *buf, size_t size) } } - zip->bcj_ip += i; + zip->bcj_ip += (uint32_t)i; return i; } diff --git a/contrib/libarchive/libarchive/archive_read_support_format_lha.c b/contrib/libarchive/libarchive/archive_read_support_format_lha.c index fa907a346408..1c64b2900b8e 100644 --- a/contrib/libarchive/libarchive/archive_read_support_format_lha.c +++ b/contrib/libarchive/libarchive/archive_read_support_format_lha.c @@ -1818,13 +1818,16 @@ lha_crc16(uint16_t crc, const void *pp, size_t len) /* This if statement expects compiler optimization will * remove the statement which will not be executed. */ #undef bswap16 +#ifndef __has_builtin +#define __has_builtin(x) 0 +#endif #if defined(_MSC_VER) && _MSC_VER >= 1400 /* Visual Studio */ # define bswap16(x) _byteswap_ushort(x) #elif defined(__GNUC__) && ((__GNUC__ == 4 && __GNUC_MINOR__ >= 8) || __GNUC__ > 4) /* GCC 4.8 and later has __builtin_bswap16() */ # define bswap16(x) __builtin_bswap16(x) -#elif defined(__clang__) -/* All clang versions have __builtin_bswap16() */ +#elif defined(__clang__) && __has_builtin(__builtin_bswap16) +/* Newer clang versions have __builtin_bswap16() */ # define bswap16(x) __builtin_bswap16(x) #else # define bswap16(x) ((((x) >> 8) & 0xff) | ((x) << 8)) diff --git a/contrib/libarchive/libarchive/archive_read_support_format_rar.c b/contrib/libarchive/libarchive/archive_read_support_format_rar.c index 8f239da9b39d..16b6e6eed8df 100644 --- a/contrib/libarchive/libarchive/archive_read_support_format_rar.c +++ b/contrib/libarchive/libarchive/archive_read_support_format_rar.c @@ -1062,7 +1062,7 @@ archive_read_format_rar_read_header(struct archive_read *a, return (ARCHIVE_FATAL); } p = h; - crc32_val = crc32(crc32_val, (const unsigned char *)p, to_read); + crc32_val = crc32(crc32_val, (const unsigned char *)p, (unsigned int)to_read); __archive_read_consume(a, to_read); skip -= to_read; } @@ -3437,7 +3437,7 @@ compile_program(const uint8_t *bytes, size_t length) prog = calloc(1, sizeof(*prog)); if (!prog) return NULL; - prog->fingerprint = crc32(0, bytes, length) | ((uint64_t)length << 32); + prog->fingerprint = crc32(0, bytes, (unsigned int)length) | ((uint64_t)length << 32); if (membr_bits(&br, 1)) { diff --git a/contrib/libarchive/libarchive/archive_read_support_format_rar5.c b/contrib/libarchive/libarchive/archive_read_support_format_rar5.c index 38979cbe91a8..1f9099439412 100644 --- a/contrib/libarchive/libarchive/archive_read_support_format_rar5.c +++ b/contrib/libarchive/libarchive/archive_read_support_format_rar5.c @@ -2475,7 +2475,7 @@ static void update_crc(struct rar5* rar, const uint8_t* p, size_t to_read) { * `stored_crc32` info filled in. */ if(rar->file.stored_crc32 > 0) { rar->file.calculated_crc32 = - crc32(rar->file.calculated_crc32, p, to_read); + crc32(rar->file.calculated_crc32, p, (unsigned int)to_read); } /* Check if the file uses an optional BLAKE2sp checksum diff --git a/contrib/libarchive/libarchive/archive_read_support_format_zip.c b/contrib/libarchive/libarchive/archive_read_support_format_zip.c index 0e05ea59ce67..5ba1085857bb 100644 --- a/contrib/libarchive/libarchive/archive_read_support_format_zip.c +++ b/contrib/libarchive/libarchive/archive_read_support_format_zip.c @@ -2186,11 +2186,11 @@ zip_read_data_zipx_bzip2(struct archive_read *a, const void **buff, /* Setup buffer boundaries. */ zip->bzstream.next_in = (char*)(uintptr_t) compressed_buff; - zip->bzstream.avail_in = in_bytes; + zip->bzstream.avail_in = (uint32_t)in_bytes; zip->bzstream.total_in_hi32 = 0; zip->bzstream.total_in_lo32 = 0; zip->bzstream.next_out = (char*) zip->uncompressed_buffer; - zip->bzstream.avail_out = zip->uncompressed_buffer_size; + zip->bzstream.avail_out = (uint32_t)zip->uncompressed_buffer_size; zip->bzstream.total_out_hi32 = 0; zip->bzstream.total_out_lo32 = 0; diff --git a/contrib/libarchive/libarchive/archive_write_add_filter_bzip2.c b/contrib/libarchive/libarchive/archive_write_add_filter_bzip2.c index 7001e9c6b309..3e5c0891ae85 100644 --- a/contrib/libarchive/libarchive/archive_write_add_filter_bzip2.c +++ b/contrib/libarchive/libarchive/archive_write_add_filter_bzip2.c @@ -190,7 +190,7 @@ archive_compressor_bzip2_open(struct archive_write_filter *f) memset(&data->stream, 0, sizeof(data->stream)); data->stream.next_out = data->compressed; - data->stream.avail_out = data->compressed_buffer_size; + data->stream.avail_out = (uint32_t)data->compressed_buffer_size; f->write = archive_compressor_bzip2_write; /* Initialize compression library */ @@ -244,7 +244,7 @@ archive_compressor_bzip2_write(struct archive_write_filter *f, /* Compress input data to output buffer */ SET_NEXT_IN(data, buff); - data->stream.avail_in = length; + data->stream.avail_in = (uint32_t)length; if (drive_compressor(f, data, 0)) return (ARCHIVE_FATAL); return (ARCHIVE_OK); @@ -313,7 +313,7 @@ drive_compressor(struct archive_write_filter *f, return (ARCHIVE_FATAL); } data->stream.next_out = data->compressed; - data->stream.avail_out = data->compressed_buffer_size; + data->stream.avail_out = (uint32_t)data->compressed_buffer_size; } /* If there's nothing to do, we're done. */ diff --git a/contrib/libarchive/libarchive/archive_write_add_filter_lz4.c b/contrib/libarchive/libarchive/archive_write_add_filter_lz4.c index cf19fadd5633..6ac450357d28 100644 --- a/contrib/libarchive/libarchive/archive_write_add_filter_lz4.c +++ b/contrib/libarchive/libarchive/archive_write_add_filter_lz4.c @@ -518,10 +518,10 @@ drive_compressor_independence(struct archive_write_filter *f, const char *p, } else { /* The buffer is not compressed. The compressed size was * bigger than its uncompressed size. */ - archive_le32enc(data->out, length | 0x80000000); + archive_le32enc(data->out, (uint32_t)(length | 0x80000000)); data->out += 4; memcpy(data->out, p, length); - outsize = length; + outsize = (uint32_t)length; } data->out += outsize; if (data->block_checksum) { @@ -603,10 +603,10 @@ drive_compressor_dependence(struct archive_write_filter *f, const char *p, } else { /* The buffer is not compressed. The compressed size was * bigger than its uncompressed size. */ - archive_le32enc(data->out, length | 0x80000000); + archive_le32enc(data->out, (uint32_t)(length | 0x80000000)); data->out += 4; memcpy(data->out, p, length); - outsize = length; + outsize = (uint32_t)length; } data->out += outsize; if (data->block_checksum) { diff --git a/contrib/libarchive/libarchive/archive_write_add_filter_zstd.c b/contrib/libarchive/libarchive/archive_write_add_filter_zstd.c index f32258b460eb..584cfb668f05 100644 --- a/contrib/libarchive/libarchive/archive_write_add_filter_zstd.c +++ b/contrib/libarchive/libarchive/archive_write_add_filter_zstd.c @@ -214,7 +214,7 @@ archive_compressor_zstd_options(struct archive_write_filter *f, const char *key, if (level < minimum || level > maximum) { return (ARCHIVE_WARN); } - data->compression_level = level; + data->compression_level = (int)level; return (ARCHIVE_OK); } else if (strcmp(key, "threads") == 0) { intmax_t threads; @@ -224,7 +224,7 @@ archive_compressor_zstd_options(struct archive_write_filter *f, const char *key, if (threads < 0) { return (ARCHIVE_WARN); } - data->threads = threads; + data->threads = (int)threads; return (ARCHIVE_OK); #if HAVE_ZSTD_H && HAVE_LIBZSTD_COMPRESSOR } else if (strcmp(key, "frame-per-file") == 0) { diff --git a/contrib/libarchive/libarchive/archive_write_disk_posix.c b/contrib/libarchive/libarchive/archive_write_disk_posix.c index 9d52dbfb3941..aeefe93b38ef 100644 --- a/contrib/libarchive/libarchive/archive_write_disk_posix.c +++ b/contrib/libarchive/libarchive/archive_write_disk_posix.c @@ -1611,12 +1611,12 @@ hfs_write_data_block(struct archive_write_disk *a, const char *buff, "Seek failed"); return (ARCHIVE_FATAL); } else if (a->offset > a->fd_offset) { - int64_t skip = a->offset - a->fd_offset; + uint64_t skip = a->offset - a->fd_offset; char nullblock[1024]; memset(nullblock, 0, sizeof(nullblock)); while (skip > 0) { - if (skip > (int64_t)sizeof(nullblock)) + if (skip > sizeof(nullblock)) bytes_written = hfs_write_decmpfs_block( a, nullblock, sizeof(nullblock)); else @@ -1731,9 +1731,10 @@ _archive_write_disk_finish_entry(struct archive *_a) else r = hfs_write_data_block( a, null_d, a->file_remaining_bytes); - if (r < 0) + if (r < 0) { close_file_descriptor(a); return ((int)r); + } } #endif } else { diff --git a/contrib/libarchive/libarchive/archive_write_set_format_7zip.c b/contrib/libarchive/libarchive/archive_write_set_format_7zip.c index f4b34685d3d0..a5919061673d 100644 --- a/contrib/libarchive/libarchive/archive_write_set_format_7zip.c +++ b/contrib/libarchive/libarchive/archive_write_set_format_7zip.c @@ -1809,11 +1809,11 @@ compression_init_encoder_bzip2(struct archive *a, * of ugly hackery to convert a const * pointer to * a non-const pointer. */ strm->next_in = (char *)(uintptr_t)(const void *)lastrm->next_in; - strm->avail_in = lastrm->avail_in; + strm->avail_in = (uint32_t)lastrm->avail_in; strm->total_in_lo32 = (uint32_t)(lastrm->total_in & 0xffffffff); strm->total_in_hi32 = (uint32_t)(lastrm->total_in >> 32); strm->next_out = (char *)lastrm->next_out; - strm->avail_out = lastrm->avail_out; + strm->avail_out = (uint32_t)lastrm->avail_out; strm->total_out_lo32 = (uint32_t)(lastrm->total_out & 0xffffffff); strm->total_out_hi32 = (uint32_t)(lastrm->total_out >> 32); if (BZ2_bzCompressInit(strm, level, 0, 30) != BZ_OK) { @@ -1842,11 +1842,11 @@ compression_code_bzip2(struct archive *a, * of ugly hackery to convert a const * pointer to * a non-const pointer. */ strm->next_in = (char *)(uintptr_t)(const void *)lastrm->next_in; - strm->avail_in = lastrm->avail_in; + strm->avail_in = (uint32_t)lastrm->avail_in; strm->total_in_lo32 = (uint32_t)(lastrm->total_in & 0xffffffff); strm->total_in_hi32 = (uint32_t)(lastrm->total_in >> 32); strm->next_out = (char *)lastrm->next_out; - strm->avail_out = lastrm->avail_out; + strm->avail_out = (uint32_t)lastrm->avail_out; strm->total_out_lo32 = (uint32_t)(lastrm->total_out & 0xffffffff); strm->total_out_hi32 = (uint32_t)(lastrm->total_out >> 32); r = BZ2_bzCompress(strm, diff --git a/contrib/libarchive/tar/write.c b/contrib/libarchive/tar/write.c index b1ec470e8a30..ac35c6f7c60e 100644 --- a/contrib/libarchive/tar/write.c +++ b/contrib/libarchive/tar/write.c @@ -694,6 +694,8 @@ append_archive(struct bsdtar *bsdtar, struct archive *a, struct archive *ina) while (ARCHIVE_OK == (e = archive_read_next_header(ina, &in_entry))) { if (archive_match_excluded(bsdtar->matching, in_entry)) continue; + if(edit_pathname(bsdtar, in_entry)) + continue; if ((bsdtar->flags & OPTFLAG_INTERACTIVE) && !yes("copy '%s'", archive_entry_pathname(in_entry))) continue; diff --git a/contrib/libarchive/unzip/CMakeLists.txt b/contrib/libarchive/unzip/CMakeLists.txt deleted file mode 100644 index 13b983d89db7..000000000000 --- a/contrib/libarchive/unzip/CMakeLists.txt +++ /dev/null @@ -1,37 +0,0 @@ -############################################ -# -# How to build bsdunzip -# -############################################ -IF(ENABLE_UNZIP) - - SET(bsdunzip_SOURCES - bsdunzip.c - bsdunzip_platform.h - ../libarchive_fe/err.c - ../libarchive_fe/err.h - ../libarchive_fe/lafe_platform.h - ../libarchive_fe/passphrase.c - ../libarchive_fe/passphrase.h - ) - INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../libarchive_fe) - - # bsdunzip documentation - SET(bsdunzip_MANS bsdunzip.1) - - # How to build bsdunzip - ADD_EXECUTABLE(bsdunzip ${bsdunzip_SOURCES}) - IF(ENABLE_UNZIP_SHARED) - TARGET_LINK_LIBRARIES(bsdunzip archive ${ADDITIONAL_LIBS}) - ELSE(ENABLE_UNZIP_SHARED) - TARGET_LINK_LIBRARIES(bsdunzip archive_static ${ADDITIONAL_LIBS}) - SET_TARGET_PROPERTIES(bsdunzip PROPERTIES COMPILE_DEFINITIONS - LIBARCHIVE_STATIC) - ENDIF(ENABLE_UNZIP_SHARED) - - # Installation rules - INSTALL(TARGETS bsdunzip RUNTIME DESTINATION bin) - INSTALL_MAN(${bsdunzip_MANS}) -ENDIF(ENABLE_UNZIP) - -add_subdirectory(test) diff --git a/contrib/libarchive/unzip/bsdunzip.1 b/contrib/libarchive/unzip/bsdunzip.1 index 3c656ebc46e2..dda01e7b84d7 100644 --- a/contrib/libarchive/unzip/bsdunzip.1 +++ b/contrib/libarchive/unzip/bsdunzip.1 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 2, 2023 +.Dd June 27, 2023 .Dt BSDUNZIP 1 .Os .Sh NAME @@ -34,6 +34,7 @@ .Sh SYNOPSIS .Nm .Op Fl aCcfjLlnopqtuvy +.Op { Fl O | Fl I No } Ar encoding .Op Fl d Ar dir .Op Fl x Ar pattern .Op Fl P Ar password @@ -62,6 +63,9 @@ Update existing. Extract only files from the zipfile if a file with the same name already exists on disk and is older than the former. Otherwise, the file is silently skipped. +.It Fl I Ar encoding +.It Fl O Ar encoding +Convert filenames from the specified encoding. .It Fl j Ignore directories stored in the zipfile; instead, extract all files directly into the extraction directory. @@ -123,7 +127,7 @@ Currently only mode 1 is supported, which lists the file names one per line. .It Ar [member ...] Optional list of members to extract from the zipfile. -Can include patterns, e.g. +Can include patterns, e.g., .Ar 'memberdir/*' will extract all files and dirs below memberdir. .El diff --git a/contrib/libarchive/unzip/bsdunzip.c b/contrib/libarchive/unzip/bsdunzip.c index 469c69fd6efb..0b6506a18adc 100644 --- a/contrib/libarchive/unzip/bsdunzip.c +++ b/contrib/libarchive/unzip/bsdunzip.c @@ -40,6 +40,8 @@ #ifdef HAVE_SYS_QUEUE_H #include +#else +#include "la_queue.h" #endif #ifdef HAVE_SYS_STAT_H #include @@ -70,6 +72,12 @@ #ifdef HAVE_UNISTD_H #include #endif +#if ((!defined(HAVE_UTIMENSAT) && defined(HAVE_LUTIMES)) || \ + (!defined(HAVE_FUTIMENS) && defined(HAVE_FUTIMES))) +#ifdef HAVE_SYS_TIME_H +#include +#endif +#endif #include #include @@ -82,6 +90,7 @@ static int C_opt; /* match case-insensitively */ static int c_opt; /* extract to stdout */ static const char *d_arg; /* directory */ static int f_opt; /* update existing files only */ +static char *O_arg; /* encoding */ static int j_opt; /* junk directories */ static int L_opt; /* lowercase names */ static int n_opt; /* never overwrite */ @@ -628,9 +637,15 @@ extract_file(struct archive *a, struct archive_entry *e, char **path) int mode; struct timespec mtime; struct stat sb; - struct timespec ts[2]; int fd, check, text; const char *linkname; +#if defined(HAVE_UTIMENSAT) || defined(HAVE_FUTIMENS) + struct timespec ts[2]; +#endif +#if ((!defined(HAVE_UTIMENSAT) && defined(HAVE_LUTIMES)) || \ + (!defined(HAVE_FUTIMENS) && defined(HAVE_FUTIMES))) + struct timeval times[2]; +#endif mode = archive_entry_mode(e) & 0777; if (mode == 0) @@ -684,9 +699,18 @@ recheck: return; } +#if defined(HAVE_UTIMENSAT) || defined(HAVE_FUTIMENS) ts[0].tv_sec = 0; ts[0].tv_nsec = UTIME_NOW; ts[1] = mtime; +#endif +#if ((!defined(HAVE_UTIMENSAT) && defined(HAVE_LUTIMES)) || \ + (!defined(HAVE_FUTIMENS) && defined(HAVE_FUTIMES))) + times[0].tv_sec = 0; + times[0].tv_usec = -1; + times[1].tv_sec = mtime.tv_sec; + times[1].tv_usec = mtime.tv_nsec / 1000; +#endif /* process symlinks */ linkname = archive_entry_symlink(e); @@ -694,11 +718,19 @@ recheck: if (symlink(linkname, *path) != 0) error("symlink('%s')", *path); info(" extracting: %s -> %s\n", *path, linkname); +#ifdef HAVE_LCHMOD if (lchmod(*path, mode) != 0) warning("Cannot set mode for '%s'", *path); +#endif /* set access and modification time */ +#if defined(HAVE_UTIMENSAT) if (utimensat(AT_FDCWD, *path, ts, AT_SYMLINK_NOFOLLOW) != 0) warning("utimensat('%s')", *path); +#elif defined(HAVE_LUTIMES) + gettimeofday(×[0], NULL); + if (lutimes(*path, times) != 0) + warning("lutimes('%s')", *path); +#endif return; } @@ -716,8 +748,14 @@ recheck: info("\n"); /* set access and modification time */ +#if defined(HAVE_FUTIMENS) if (futimens(fd, ts) != 0) error("futimens('%s')", *path); +#elif defined(HAVE_FUTIMES) + gettimeofday(×[0], NULL); + if (futimes(fd, times) != 0) + error("futimes('%s')", *path); +#endif if (close(fd) != 0) error("close('%s')", *path); } @@ -961,6 +999,9 @@ unzip(const char *fn) ac(archive_read_support_format_zip(a)); + if (O_arg) + ac(archive_read_set_format_option(a, "zip", "hdrcharset", O_arg)); + if (P_arg) archive_read_add_passphrase(a, P_arg); else @@ -1043,7 +1084,7 @@ usage(void) { fprintf(stderr, -"Usage: unzip [-aCcfjLlnopqtuvyZ1] [-d dir] [-x pattern] [-P password] zipfile\n" +"Usage: unzip [-aCcfjLlnopqtuvyZ1] [{-O|-I} encoding] [-d dir] [-x pattern] [-P password] zipfile\n" " [member ...]\n"); exit(EXIT_FAILURE); } @@ -1053,8 +1094,11 @@ getopts(int argc, char *argv[]) { int opt; - optreset = optind = 1; - while ((opt = getopt(argc, argv, "aCcd:fjLlnopP:qtuvx:yZ1")) != -1) + optind = 1; +#ifdef HAVE_GETOPT_OPTRESET + optreset = 1; +#endif + while ((opt = getopt(argc, argv, "aCcd:fI:jLlnO:opP:qtuvx:yZ1")) != -1) switch (opt) { case '1': Z1_opt = 1; @@ -1074,6 +1118,10 @@ getopts(int argc, char *argv[]) case 'f': f_opt = 1; break; + case 'I': + case 'O': + O_arg = optarg; + break; case 'j': j_opt = 1; break; diff --git a/contrib/libarchive/unzip/bsdunzip_platform.h b/contrib/libarchive/unzip/bsdunzip_platform.h index 5aff5f208eab..76eca4f90902 100644 --- a/contrib/libarchive/unzip/bsdunzip_platform.h +++ b/contrib/libarchive/unzip/bsdunzip_platform.h @@ -62,14 +62,6 @@ #include "archive_entry.h" #endif -#ifndef HAVE_GETOPT_OPTRESET -/* - * If platform doesn't use optreset for resetting getopt, declare it so - * C source doesn't have to know this platform-specific difference - */ -int optreset; -#endif - /* How to mark functions that don't return. */ /* This facilitates use of some newer static code analysis tools. */ #undef __LA_DEAD diff --git a/contrib/libarchive/unzip/la_getline.c b/contrib/libarchive/unzip/la_getline.c new file mode 100644 index 000000000000..79a6bc010214 --- /dev/null +++ b/contrib/libarchive/unzip/la_getline.c @@ -0,0 +1,99 @@ +/* $NetBSD: getline.c,v 1.2 2014/09/16 17:23:50 christos Exp $ */ + +/*- + * Copyright (c) 2011 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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 "bsdunzip_platform.h" +#ifndef HAVE_GETLINE + +#ifdef HAVE_STDLIB_H +#include +#endif +#ifdef HAVE_STDIO_H +#include +#endif +#ifdef HAVE_UNISTD_H +#include +#endif +#ifdef HAVE_ERRNO_H +#include +#endif +#ifdef HAVE_STRING_H +#include +#endif + +static ssize_t +la_getdelim(char **buf, size_t *bufsiz, int delimiter, FILE *fp) +{ + char *ptr, *eptr; + + + if (*buf == NULL || *bufsiz == 0) { + *bufsiz = BUFSIZ; + if ((*buf = malloc(*bufsiz)) == NULL) + return -1; + } + + for (ptr = *buf, eptr = *buf + *bufsiz;;) { + int c = fgetc(fp); + if (c == -1) { + if (feof(fp)) { + ssize_t diff = (ssize_t)(ptr - *buf); + if (diff != 0) { + *ptr = '\0'; + return diff; + } + } + return -1; + } + *ptr++ = c; + if (c == delimiter) { + *ptr = '\0'; + return ptr - *buf; + } + if (ptr + 2 >= eptr) { + char *nbuf; + size_t nbufsiz = *bufsiz * 2; + ssize_t d = ptr - *buf; + if ((nbuf = realloc(*buf, nbufsiz)) == NULL) + return -1; + *buf = nbuf; + *bufsiz = nbufsiz; + eptr = nbuf + nbufsiz; + ptr = nbuf + d; + } + } +} + +ssize_t +getline(char **buf, size_t *bufsiz, FILE *fp) +{ + return la_getdelim(buf, bufsiz, '\n', fp); +} +#endif diff --git a/contrib/libarchive/unzip/la_queue.h b/contrib/libarchive/unzip/la_queue.h new file mode 100644 index 000000000000..917526531b2a --- /dev/null +++ b/contrib/libarchive/unzip/la_queue.h @@ -0,0 +1,840 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright (c) 1991, 1993 + * The Regents of the University of California. All rights reserved. + */ + +#ifndef _SYS_QUEUE_H_ +#define _SYS_QUEUE_H_ + +/* + * This file defines four types of data structures: singly-linked lists, + * singly-linked tail queues, lists and tail queues. + * + * A singly-linked list is headed by a single forward pointer. The elements + * are singly linked for minimum space and pointer manipulation overhead at + * the expense of O(n) removal for arbitrary elements. New elements can be + * added to the list after an existing element or at the head of the list. + * Elements being removed from the head of the list should use the explicit + * macro for this purpose for optimum efficiency. A singly-linked list may + * only be traversed in the forward direction. Singly-linked lists are ideal + * for applications with large datasets and few or no removals or for + * implementing a LIFO queue. + * + * A singly-linked tail queue is headed by a pair of pointers, one to the + * head of the list and the other to the tail of the list. The elements are + * singly linked for minimum space and pointer manipulation overhead at the + * expense of O(n) removal for arbitrary elements. New elements can be added + * to the list after an existing element, at the head of the list, or at the + * end of the list. Elements being removed from the head of the tail queue + * should use the explicit macro for this purpose for optimum efficiency. + * A singly-linked tail queue may only be traversed in the forward direction. + * Singly-linked tail queues are ideal for applications with large datasets + * and few or no removals or for implementing a FIFO queue. + * + * A list is headed by a single forward pointer (or an array of forward + * pointers for a hash table header). The elements are doubly linked + * so that an arbitrary element can be removed without a need to + * traverse the list. New elements can be added to the list before + * or after an existing element or at the head of the list. A list + * may be traversed in either direction. + * + * A tail queue is headed by a pair of pointers, one to the head of the + * list and the other to the tail of the list. The elements are doubly + * linked so that an arbitrary element can be removed without a need to + * traverse the list. New elements can be added to the list before or + * after an existing element, at the head of the list, or at the end of + * the list. A tail queue may be traversed in either direction. + * + * For details on the use of these macros, see the queue(3) manual page. + * + * Below is a summary of implemented functions where: + * + means the macro is available + * - means the macro is not available + * s means the macro is available but is slow (runs in O(n) time) + * + * SLIST LIST STAILQ TAILQ + * _HEAD + + + + + * _CLASS_HEAD + + + + + * _HEAD_INITIALIZER + + + + + * _ENTRY + + + + + * _CLASS_ENTRY + + + + + * _INIT + + + + + * _EMPTY + + + + + * _FIRST + + + + + * _NEXT + + + + + * _PREV - + - + + * _LAST - - + + + * _LAST_FAST - - - + + * _FOREACH + + + + + * _FOREACH_FROM + + + + + * _FOREACH_SAFE + + + + + * _FOREACH_FROM_SAFE + + + + + * _FOREACH_REVERSE - - - + + * _FOREACH_REVERSE_FROM - - - + + * _FOREACH_REVERSE_SAFE - - - + + * _FOREACH_REVERSE_FROM_SAFE - - - + + * _INSERT_HEAD + + + + + * _INSERT_BEFORE - + - + + * _INSERT_AFTER + + + + + * _INSERT_TAIL - - + + + * _CONCAT s s + + + * _REMOVE_AFTER + - + - + * _REMOVE_HEAD + - + - + * _REMOVE s + s + + * _SWAP + + + + + */ +#ifdef QUEUE_MACRO_DEBUG +#warn Use QUEUE_MACRO_DEBUG_TRACE and/or QUEUE_MACRO_DEBUG_TRASH +#define QUEUE_MACRO_DEBUG_TRACE +#define QUEUE_MACRO_DEBUG_TRASH +#endif + +#ifdef QUEUE_MACRO_DEBUG_TRACE +/* Store the last 2 places the queue element or head was altered */ +struct qm_trace { + unsigned long lastline; + unsigned long prevline; + const char *lastfile; + const char *prevfile; +}; + +#define TRACEBUF struct qm_trace trace; +#define TRACEBUF_INITIALIZER { __LINE__, 0, __FILE__, NULL } , + +#define QMD_TRACE_HEAD(head) do { \ + (head)->trace.prevline = (head)->trace.lastline; \ + (head)->trace.prevfile = (head)->trace.lastfile; \ + (head)->trace.lastline = __LINE__; \ + (head)->trace.lastfile = __FILE__; \ +} while (0) + +#define QMD_TRACE_ELEM(elem) do { \ + (elem)->trace.prevline = (elem)->trace.lastline; \ + (elem)->trace.prevfile = (elem)->trace.lastfile; \ + (elem)->trace.lastline = __LINE__; \ + (elem)->trace.lastfile = __FILE__; \ +} while (0) + +#else /* !QUEUE_MACRO_DEBUG_TRACE */ +#define QMD_TRACE_ELEM(elem) +#define QMD_TRACE_HEAD(head) +#define TRACEBUF +#define TRACEBUF_INITIALIZER +#endif /* QUEUE_MACRO_DEBUG_TRACE */ + +#ifdef QUEUE_MACRO_DEBUG_TRASH +#define QMD_SAVELINK(name, link) void **name = (void *)&(link) +#define TRASHIT(x) do {(x) = (void *)-1;} while (0) +#define QMD_IS_TRASHED(x) ((x) == (void *)(intptr_t)-1) +#else /* !QUEUE_MACRO_DEBUG_TRASH */ +#define QMD_SAVELINK(name, link) +#define TRASHIT(x) +#define QMD_IS_TRASHED(x) 0 +#endif /* QUEUE_MACRO_DEBUG_TRASH */ + +#ifdef __cplusplus +/* + * In C++ there can be structure lists and class lists: + */ +#define QUEUE_TYPEOF(type) type +#else +#define QUEUE_TYPEOF(type) struct type +#endif + +/* + * Singly-linked List declarations. + */ +#define SLIST_HEAD(name, type) \ +struct name { \ + struct type *slh_first; /* first element */ \ +} + +#define SLIST_CLASS_HEAD(name, type) \ +struct name { \ + class type *slh_first; /* first element */ \ +} + +#define SLIST_HEAD_INITIALIZER(head) \ + { NULL } + +#define SLIST_ENTRY(type) \ +struct { \ + struct type *sle_next; /* next element */ \ +} + +#define SLIST_CLASS_ENTRY(type) \ +struct { \ + class type *sle_next; /* next element */ \ +} + +/* + * Singly-linked List functions. + */ +#if (defined(_KERNEL) && defined(INVARIANTS)) +#define QMD_SLIST_CHECK_PREVPTR(prevp, elm) do { \ + if (*(prevp) != (elm)) \ + panic("Bad prevptr *(%p) == %p != %p", \ + (prevp), *(prevp), (elm)); \ +} while (0) +#else +#define QMD_SLIST_CHECK_PREVPTR(prevp, elm) +#endif + +#define SLIST_CONCAT(head1, head2, type, field) do { \ + QUEUE_TYPEOF(type) *curelm = SLIST_FIRST(head1); \ + if (curelm == NULL) { \ + if ((SLIST_FIRST(head1) = SLIST_FIRST(head2)) != NULL) \ + SLIST_INIT(head2); \ + } else if (SLIST_FIRST(head2) != NULL) { \ *** 737 LINES SKIPPED *** From nobody Sat May 4 12:37:36 2024 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 4VWnJ05l01z5KVQ1; Sat, 4 May 2024 12:37: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 4VWnJ02dklz44HQ; Sat, 4 May 2024 12:37:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714826256; 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=1FKJphqn3VhfcMEI6o/sP/t3A1rgiKBDEEMVdNxu+DI=; b=rvOB2kahidaA0Au7EDWh+rSb9/t7NqPRRWnrCaFQKsPzSWqBgh7SBYGB3CpYUcrNLH61Zv JNj2yirE7eF0geQSc9fjcD25WYLFezAK9tV7Fvb9Wuijg+Pv+WCTobYEZHAagQkM6GJQC6 ePbL7g2X5nfeoWKrcjlDS4d+NX8ZM3FqERu+2vGPsB+OolUC5XQFB7MHw7gYNu2sorUxtk gSR8ILYSYIu0wftiyzRQkmQS8WezECB2PQN+qrAyJjKrA+BJZie1aQmZo2+DscvLbhB+8k y5adxEelaVQx1M4Mrt0pZphp/iQPBTWL+5fHVyLbVGVOPkupeLrgH3M8Z3vRgw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714826256; a=rsa-sha256; cv=none; b=lPChTg7vO1RnOh3pWzwk9DEwXcU1nVFTrhiXEJ1CGfYdKednOAkR4LKtLo3RwFlk9xQ+VE /qptqEAtfpmKJMbnlRjq4LpO4m4jkiOEqKN+AHku/ONnL4Pcjo5ryngFazwpEPjk+hdPHb 9+MZY68Ra2N/HtrrGLHgNtwt62q8Et7YM6kEb3g1kpBlks8lXJ/A2q9IzU4Wwxc48kqhKU 8lr2Ek6J9VEh0lsUFe0OP++DTqG+WKjuAabHVU2suG5ErSaTp3gt/LIkOAk1d7eLV8T0CR R0sW6Sft4EuiVWwM02KaYTRDglNWDw74DvCX693OE8btZ3S83ypBhilpEFrhxQ== 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=1714826256; 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=1FKJphqn3VhfcMEI6o/sP/t3A1rgiKBDEEMVdNxu+DI=; b=IhIHeq2TFQDp0Qh1vbsNMtFBwyFt7JwXhhE2SmGWkWmfgg5om/CReE4bNbHcJfZI7CDGNy dqBcHeSISL1EOZzoTcc33929rm5ypFODNbkQJ7Q/HBBvhiCe7ClfTYsTHO1tl1cWIcRDIQ wpVDqrmDTiwcwzwVowROZ7NCSFTwzPdZcRGnB9570yL7WYHl2IzLhz8imh63bfW6lgSOkd 3e+v44JvWepSLPHP8bNkYdjpSvwLDlwEAHnyasmlRFJGBAFBB6BNdC4QiBWuSqwghJrbgP dw2gO+NYSbBdwrUrOfnQaf1htUMjOZEtqlAARvv9jf/rykit+pxqWC8ZwTiv4Q== 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 4VWnJ02FM4zVPD; Sat, 4 May 2024 12:37: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 444Cbad8072372; Sat, 4 May 2024 12:37:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 444Cba2c072369; Sat, 4 May 2024 12:37:36 GMT (envelope-from git) Date: Sat, 4 May 2024 12:37:36 GMT Message-Id: <202405041237.444Cba2c072369@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Martin Matuska Subject: git: 0db84579ce20 - stable/13 - libarchive: merge from vendor branch List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0db84579ce2024b674062d961f1e3e26a253ffdd Auto-Submitted: auto-generated The branch stable/13 has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=0db84579ce2024b674062d961f1e3e26a253ffdd commit 0db84579ce2024b674062d961f1e3e26a253ffdd Author: Martin Matuska AuthorDate: 2023-07-31 11:13:30 +0000 Commit: Martin Matuska CommitDate: 2024-05-04 11:53:07 +0000 libarchive: merge from vendor branch Changes to not yet connected unzip only. (cherry picked from commit d91bfe0fb7faab2e1f0b8e160b0cf59afb8576c4) --- contrib/libarchive/cat/cmdline.c | 12 +- contrib/libarchive/unzip/bsdunzip.c | 66 +++++-- contrib/libarchive/unzip/bsdunzip.h | 63 +++++++ contrib/libarchive/unzip/cmdline.c | 250 +++++++++++++++++++++++++++ contrib/libarchive/unzip/test/test.h | 2 +- contrib/libarchive/unzip/test/test_version.c | 34 ++++ 6 files changed, 402 insertions(+), 25 deletions(-) diff --git a/contrib/libarchive/cat/cmdline.c b/contrib/libarchive/cat/cmdline.c index cae19beb7d4c..3c4b7a8c4b9e 100644 --- a/contrib/libarchive/cat/cmdline.c +++ b/contrib/libarchive/cat/cmdline.c @@ -24,7 +24,7 @@ */ /* - * Command line parser for tar. + * Command line parser for bsdcat. */ #include "bsdcat_platform.h" @@ -44,12 +44,12 @@ __FBSDID("$FreeBSD$"); #include "err.h" /* - * Short options for tar. Please keep this sorted. + * Short options for bsdcat. Please keep this sorted. */ static const char *short_options = "h"; /* - * Long options for tar. Please keep this list sorted. + * Long options for bsdcat. Please keep this list sorted. * * The symbolic names for options that lack a short equivalent are * defined in bsdcat.h. Also note that so far I've found no need @@ -61,7 +61,7 @@ static const struct bsdcat_option { const char *name; int required; /* 1 if this option requires an argument. */ int equivalent; /* Equivalent short option. */ -} tar_longopts[] = { +} bsdcat_longopts[] = { { "help", 0, 'h' }, { "version", 0, OPTION_VERSION }, { NULL, 0, 0 } @@ -90,7 +90,7 @@ static const struct bsdcat_option { * -W long options: There's an obscure GNU convention (only rarely * supported even there) that allows "-W option=argument" as an * alternative way to support long options. This was supported in - * early bsdcat as a way to access long options on platforms that did + * early bsdtar as a way to access long options on platforms that did * not support getopt_long() and is preserved here for backwards * compatibility. (Of course, if I'd started with a custom * command-line parser from the beginning, I would have had normal @@ -223,7 +223,7 @@ bsdcat_getopt(struct bsdcat *bsdcat) } /* Search the table for an unambiguous match. */ - for (popt = tar_longopts; popt->name != NULL; popt++) { + for (popt = bsdcat_longopts; popt->name != NULL; popt++) { /* Short-circuit if first chars don't match. */ if (popt->name[0] != bsdcat->getopt_word[0]) continue; diff --git a/contrib/libarchive/unzip/bsdunzip.c b/contrib/libarchive/unzip/bsdunzip.c index 0b6506a18adc..b8f6ff4bbf95 100644 --- a/contrib/libarchive/unzip/bsdunzip.c +++ b/contrib/libarchive/unzip/bsdunzip.c @@ -79,8 +79,7 @@ #endif #endif -#include -#include +#include "bsdunzip.h" #include "passphrase.h" #include "err.h" @@ -90,19 +89,20 @@ static int C_opt; /* match case-insensitively */ static int c_opt; /* extract to stdout */ static const char *d_arg; /* directory */ static int f_opt; /* update existing files only */ -static char *O_arg; /* encoding */ +static const char *O_arg; /* encoding */ static int j_opt; /* junk directories */ static int L_opt; /* lowercase names */ static int n_opt; /* never overwrite */ static int o_opt; /* always overwrite */ static int p_opt; /* extract to stdout, quiet */ -static char *P_arg; /* passphrase */ +static const char *P_arg; /* passphrase */ static int q_opt; /* quiet */ static int t_opt; /* test */ static int u_opt; /* update */ static int v_opt; /* verbose/list */ static const char *y_str = ""; /* 4 digit year */ static int Z1_opt; /* zipinfo mode list files only */ +static int version_opt; /* version string */ /* debug flag */ static int unzip_debug; @@ -113,6 +113,8 @@ static int zipinfo_mode; /* running on tty? */ static int tty; +int bsdunzip_optind; + /* convenience macro */ /* XXX should differentiate between ARCHIVE_{WARN,FAIL,RETRY} */ #define ac(call) \ @@ -1089,20 +1091,30 @@ usage(void) exit(EXIT_FAILURE); } +static void +version(void) +{ + printf("bsdunzip %s - %s \n", + BSDUNZIP_VERSION_STRING, + archive_version_details()); + exit(0); +} + static int getopts(int argc, char *argv[]) { + struct bsdunzip *bsdunzip, bsdunzip_storage; int opt; + bsdunzip_optind = 1; - optind = 1; -#ifdef HAVE_GETOPT_OPTRESET - optreset = 1; -#endif - while ((opt = getopt(argc, argv, "aCcd:fI:jLlnO:opP:qtuvx:yZ1")) != -1) + bsdunzip = &bsdunzip_storage; + memset(bsdunzip, 0, sizeof(*bsdunzip)); + + bsdunzip->argv = argv; + bsdunzip->argc = argc; + + while ((opt = bsdunzip_getopt(bsdunzip)) != -1) { switch (opt) { - case '1': - Z1_opt = 1; - break; case 'a': a_opt = 1; break; @@ -1113,14 +1125,14 @@ getopts(int argc, char *argv[]) c_opt = 1; break; case 'd': - d_arg = optarg; + d_arg = bsdunzip->argument; break; case 'f': f_opt = 1; break; case 'I': case 'O': - O_arg = optarg; + O_arg = bsdunzip->argument; break; case 'j': j_opt = 1; @@ -1143,7 +1155,7 @@ getopts(int argc, char *argv[]) p_opt = 1; break; case 'P': - P_arg = optarg; + P_arg = bsdunzip->argument; break; case 'q': q_opt = 1; @@ -1158,19 +1170,30 @@ getopts(int argc, char *argv[]) v_opt = 2; break; case 'x': - add_pattern(&exclude, optarg); + add_pattern(&exclude, bsdunzip->argument); break; case 'y': y_str = " "; break; case 'Z': zipinfo_mode = 1; + if (bsdunzip->argument != NULL && + strcmp(bsdunzip->argument, "1") == 0) { + Z1_opt = 1; + } + break; + case OPTION_VERSION: + version_opt = 1; + break; + case OPTION_NONE: break; default: usage(); } - - return (optind); + if (opt == OPTION_NONE) + break; + } + return (bsdunzip_optind); } int @@ -1179,6 +1202,8 @@ main(int argc, char *argv[]) const char *zipfile; int nopts; + lafe_setprogname(*argv, "bsdunzip"); + if (isatty(STDOUT_FILENO)) tty = 1; @@ -1199,6 +1224,11 @@ main(int argc, char *argv[]) */ nopts = getopts(argc, argv); + if (version_opt == 1) { + version(); + exit(EXIT_SUCCESS); + } + /* * When more of the zipinfo mode options are implemented, this * will need to change. diff --git a/contrib/libarchive/unzip/bsdunzip.h b/contrib/libarchive/unzip/bsdunzip.h new file mode 100644 index 000000000000..12b65cefb466 --- /dev/null +++ b/contrib/libarchive/unzip/bsdunzip.h @@ -0,0 +1,63 @@ +/*- + * Copyright (c) 2023, Martin Matuska + * All rights reserved. + * + * 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(S) ``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(S) 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 BSDUNZIP_H_INCLUDED +#define BSDUNZIP_H_INCLUDED + +#if defined(PLATFORM_CONFIG_H) +/* Use hand-built config.h in environments that need it. */ +#include PLATFORM_CONFIG_H +#else +/* Not having a config.h of some sort is a serious problem. */ +#include "config.h" +#endif + +#include +#include + +struct bsdunzip { + /* Option parser state */ + int getopt_state; + char *getopt_word; + + /* Miscellaneous state information */ + int argc; + char **argv; + const char *argument; +}; + +struct bsdunzip_getopt_ret { + int index; + int opt; +}; + +enum { + OPTION_NONE, + OPTION_VERSION +}; + +int bsdunzip_getopt(struct bsdunzip *); + +#endif diff --git a/contrib/libarchive/unzip/cmdline.c b/contrib/libarchive/unzip/cmdline.c new file mode 100644 index 000000000000..95d4f99b8242 --- /dev/null +++ b/contrib/libarchive/unzip/cmdline.c @@ -0,0 +1,250 @@ +/*- + * Copyright (c) 2003-2008 Tim Kientzle + * All rights reserved. + * + * 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(S) ``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(S) 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. + */ + +/* + * Command line parser for bsdunzip. + */ + +#include "bsdunzip_platform.h" +__FBSDID("$FreeBSD$"); + +#ifdef HAVE_ERRNO_H +#include +#endif +#ifdef HAVE_STDLIB_H +#include +#endif +#ifdef HAVE_STRING_H +#include +#endif + +#include "bsdunzip.h" +#include "err.h" + +extern int bsdunzip_optind; + +/* + * Short options for bsdunzip. Please keep this sorted. + */ +static const char *short_options + = "aCcd:fI:jLlnO:opP:qtuvx:yZ:"; + +/* + * Long options for bsdunzip. Please keep this list sorted. + * + * The symbolic names for options that lack a short equivalent are + * defined in bsdunzip.h. Also note that so far I've found no need + * to support optional arguments to long options. That would be + * a small change to the code below. + */ + +static const struct bsdunzip_option { + const char *name; + int required; /* 1 if this option requires an argument. */ + int equivalent; /* Equivalent short option. */ +} bsdunzip_longopts[] = { + { "version", 0, OPTION_VERSION }, + { NULL, 0, 0 } +}; + +/* + * This getopt implementation has two key features that common + * getopt_long() implementations lack. Apart from those, it's a + * straightforward option parser, considerably simplified by not + * needing to support the wealth of exotic getopt_long() features. It + * has, of course, been shamelessly tailored for bsdunzip. (If you're + * looking for a generic getopt_long() implementation for your + * project, I recommend Gregory Pietsch's public domain getopt_long() + * implementation.) The two additional features are: + */ + +int +bsdunzip_getopt(struct bsdunzip *bsdunzip) +{ + enum { state_start = 0, state_next_word, state_short, state_long }; + + const struct bsdunzip_option *popt, *match = NULL, *match2 = NULL; + const char *p, *long_prefix = "--"; + size_t optlength; + int opt = OPTION_NONE; + int required = 0; + + bsdunzip->argument = NULL; + + /* First time through, initialize everything. */ + if (bsdunzip->getopt_state == state_start) { + /* Skip program name. */ + ++bsdunzip->argv; + --bsdunzip->argc; + if (*bsdunzip->argv == NULL) + return (-1); + bsdunzip->getopt_state = state_next_word; + } + + /* + * We're ready to look at the next word in argv. + */ + if (bsdunzip->getopt_state == state_next_word) { + /* No more arguments, so no more options. */ + if (bsdunzip->argv[0] == NULL) + return (-1); + /* Doesn't start with '-', so no more options. */ + if (bsdunzip->argv[0][0] != '-') + return (-1); + /* "--" marks end of options; consume it and return. */ + if (strcmp(bsdunzip->argv[0], "--") == 0) { + ++bsdunzip->argv; + --bsdunzip->argc; + return (-1); + } + /* Get next word for parsing. */ + bsdunzip->getopt_word = *bsdunzip->argv++; + --bsdunzip->argc; + bsdunzip_optind++; + if (bsdunzip->getopt_word[1] == '-') { + /* Set up long option parser. */ + bsdunzip->getopt_state = state_long; + bsdunzip->getopt_word += 2; /* Skip leading '--' */ + } else { + /* Set up short option parser. */ + bsdunzip->getopt_state = state_short; + ++bsdunzip->getopt_word; /* Skip leading '-' */ + } + } + + /* + * We're parsing a group of POSIX-style single-character options. + */ + if (bsdunzip->getopt_state == state_short) { + /* Peel next option off of a group of short options. */ + opt = *bsdunzip->getopt_word++; + if (opt == '\0') { + /* End of this group; recurse to get next option. */ + bsdunzip->getopt_state = state_next_word; + return bsdunzip_getopt(bsdunzip); + } + + /* Does this option take an argument? */ + p = strchr(short_options, opt); + if (p == NULL) + return ('?'); + if (p[1] == ':') + required = 1; + + /* If it takes an argument, parse that. */ + if (required) { + /* If arg is run-in, bsdunzip->getopt_word already points to it. */ + if (bsdunzip->getopt_word[0] == '\0') { + /* Otherwise, pick up the next word. */ + bsdunzip->getopt_word = *bsdunzip->argv; + if (bsdunzip->getopt_word == NULL) { + lafe_warnc(0, + "Option -%c requires an argument", + opt); + return ('?'); + } + ++bsdunzip->argv; + --bsdunzip->argc; + bsdunzip_optind++; + } + bsdunzip->getopt_state = state_next_word; + bsdunzip->argument = bsdunzip->getopt_word; + } + } + + /* We're reading a long option */ + if (bsdunzip->getopt_state == state_long) { + /* After this long option, we'll be starting a new word. */ + bsdunzip->getopt_state = state_next_word; + + /* Option name ends at '=' if there is one. */ + p = strchr(bsdunzip->getopt_word, '='); + if (p != NULL) { + optlength = (size_t)(p - bsdunzip->getopt_word); + bsdunzip->argument = (char *)(uintptr_t)(p + 1); + } else { + optlength = strlen(bsdunzip->getopt_word); + } + + /* Search the table for an unambiguous match. */ + for (popt = bsdunzip_longopts; popt->name != NULL; popt++) { + /* Short-circuit if first chars don't match. */ + if (popt->name[0] != bsdunzip->getopt_word[0]) + continue; + /* If option is a prefix of name in table, record it.*/ + if (strncmp(bsdunzip->getopt_word, popt->name, optlength) == 0) { + match2 = match; /* Record up to two matches. */ + match = popt; + /* If it's an exact match, we're done. */ + if (strlen(popt->name) == optlength) { + match2 = NULL; /* Forget the others. */ + break; + } + } + } + + /* Fail if there wasn't a unique match. */ + if (match == NULL) { + lafe_warnc(0, + "Option %s%s is not supported", + long_prefix, bsdunzip->getopt_word); + return ('?'); + } + if (match2 != NULL) { + lafe_warnc(0, + "Ambiguous option %s%s (matches --%s and --%s)", + long_prefix, bsdunzip->getopt_word, match->name, match2->name); + return ('?'); + } + + /* We've found a unique match; does it need an argument? */ + if (match->required) { + /* Argument required: get next word if necessary. */ + if (bsdunzip->argument == NULL) { + bsdunzip->argument = *bsdunzip->argv; + if (bsdunzip->argument == NULL) { + lafe_warnc(0, + "Option %s%s requires an argument", + long_prefix, match->name); + return ('?'); + } + ++bsdunzip->argv; + --bsdunzip->argc; + bsdunzip_optind++; + } + } else { + /* Argument forbidden: fail if there is one. */ + if (bsdunzip->argument != NULL) { + lafe_warnc(0, + "Option %s%s does not allow an argument", + long_prefix, match->name); + return ('?'); + } + } + return (match->equivalent); + } + + return (opt); +} diff --git a/contrib/libarchive/unzip/test/test.h b/contrib/libarchive/unzip/test/test.h index 8da017f68e16..ba876afd8e24 100644 --- a/contrib/libarchive/unzip/test/test.h +++ b/contrib/libarchive/unzip/test/test.h @@ -35,6 +35,6 @@ #undef EXTRA_DUMP /* How to dump extra data */ #undef EXTRA_ERRNO /* How to dump errno */ /* How to generate extra version info. */ -#define EXTRA_VERSION (systemf("%s -v", testprog) ? "" : "") +#define EXTRA_VERSION (systemf("%s --version", testprog) ? "" : "") #include "test_common.h" diff --git a/contrib/libarchive/unzip/test/test_version.c b/contrib/libarchive/unzip/test/test_version.c new file mode 100644 index 000000000000..efa797982d57 --- /dev/null +++ b/contrib/libarchive/unzip/test/test_version.c @@ -0,0 +1,34 @@ +/*- + * Copyright (c) 2003-2017 Tim Kientzle + * All rights reserved. + * + * 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(S) ``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(S) 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 "test.h" + +/* + * Test that --version option works and generates reasonable output. + */ + +DEFINE_TEST(test_version) +{ + assertVersion(testprog, "bsdunzip"); +} From nobody Sat May 4 12:37:37 2024 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 4VWnJ206qyz5KVVS; Sat, 4 May 2024 12:37: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 4VWnJ13cg1z44Xl; Sat, 4 May 2024 12:37:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714826257; 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=ZSPiU1AdlgJ1v993/d2X2M7aGCLn0MGZsSQTCtK1iqM=; b=e0UuZpaDCKG0JedJBTFTa3jOi0KC3wl2WQ7p2m0v9mbfzNMdmAbmHkn1J+5NULT198FNNZ OAJGCoWxY7cWbXAw5SMwl3nv4rlhYFTI3LLUxhwPtRkyjdkBD3dUSgQcTpFP/pKg93Vmtv j01FO3fxg1ojkj4hkB792XuMi6Y70OQU4k1MB3XwX/m1Vip934n7qEmvhNucKT3k7PN1QS EEA4N4ejbGc5GucwwicvnO8lhtRWRVq600UWz+rm7BXjRxPA4M9GcGwEbnf4yuH5LDK0XH bq3NmqQMvmrGWuYWig3sZmTxdjJphdS4nR7bZY+K68Z0d+7hCtb+KOwPvOV2tQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714826257; a=rsa-sha256; cv=none; b=wcQt12PIyuVdqbrE74FTwYEBoFZ2jl6jb71qbYmkKj9zfBIKWoFT4wCooOvhU1QSsLLIwL VAC/mMQCJJFYjnR2T8uuE+7Ct3d6M62bgrjqR18LhoaKRuvXQ+hUHBA2rJSkYAkH+Z+xwW WGliT6G727iRRU0LbBnJ7ZP4VrixWVvGny8Hv4dw/ep0UkTU+6QY8OCMAG/6lZVdA/IKtQ YYs1Kszn0cgJZdYyPk4WCNAcjl62jTpVKUExBBYD7l38Sgaqe82KaWhQe9x4ba7k1tqs06 ghCW1M8Qry0VakYYchMJwm7UHkazUX7IwIplXhiMsbPteVngYCqXXe7yiNH+BQ== 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=1714826257; 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=ZSPiU1AdlgJ1v993/d2X2M7aGCLn0MGZsSQTCtK1iqM=; b=FPffzQgr8U6PmTCInPjd0ih9sBYfnAbJxbeEvfWeTFpg42gkBuBNBLTaBPR99ozZTT1edp cUYKE/DkivTHvSO9AQh1vOK04fOUuD1bHTDl64jjS2st4JaMW9zJACw+efWsxjTw7plXT5 GaBgyrz2xn4RBLBMvRnL4GvJrBuDct1mjqwquKM2lx0fislZH0sCrkH2tL05Kk/gICmcRe 8jNMwy1g/p6zRT9GcbaIOHkKg1hXE/yfXmYkXg5QUvaChhAVwrdTca03dBOrieZaZ2B4Q9 3zKLOIsrkzumHxliYJtTewTVUCs4pGjQfr4XCKP3qKo/Fzm00U8t7iOZ9sECrA== 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 4VWnJ139lNzVxj; Sat, 4 May 2024 12:37: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 444CbbNq072414; Sat, 4 May 2024 12:37:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 444CbbPi072411; Sat, 4 May 2024 12:37:37 GMT (envelope-from git) Date: Sat, 4 May 2024 12:37:37 GMT Message-Id: <202405041237.444CbbPi072411@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Martin Matuska Subject: git: db2cc817faf9 - stable/13 - libarchive: merge from vendor branch List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: db2cc817faf924bd898046547dde984162f806ec Auto-Submitted: auto-generated The branch stable/13 has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=db2cc817faf924bd898046547dde984162f806ec commit db2cc817faf924bd898046547dde984162f806ec Author: Martin Matuska AuthorDate: 2023-08-03 23:04:14 +0000 Commit: Martin Matuska CommitDate: 2024-05-04 11:53:07 +0000 libarchive: merge from vendor branch Changes to not yet connected unzip only. (cherry picked from commit 058ab969fd2f7a8d04240d1e9bc9d63918480226) --- contrib/libarchive/unzip/bsdunzip.c | 19 ++++++++++++++++ contrib/libarchive/unzip/bsdunzip.h | 7 ++---- contrib/libarchive/unzip/cmdline.c | 2 -- contrib/libarchive/unzip/test/test_d.c | 22 +++++++++++++++++-- contrib/libarchive/unzip/test/test_x.c | 40 ++++++++++++++++++++++++++++++++-- 5 files changed, 79 insertions(+), 11 deletions(-) diff --git a/contrib/libarchive/unzip/bsdunzip.c b/contrib/libarchive/unzip/bsdunzip.c index b8f6ff4bbf95..29c3a1670483 100644 --- a/contrib/libarchive/unzip/bsdunzip.c +++ b/contrib/libarchive/unzip/bsdunzip.c @@ -113,6 +113,9 @@ static int zipinfo_mode; /* running on tty? */ static int tty; +/* processing exclude list */ +static int unzip_exclude_mode = 0; + int bsdunzip_optind; /* convenience macro */ @@ -1114,6 +1117,7 @@ getopts(int argc, char *argv[]) bsdunzip->argc = argc; while ((opt = bsdunzip_getopt(bsdunzip)) != -1) { + unzip_exclude_mode = 0; switch (opt) { case 'a': a_opt = 1; @@ -1171,6 +1175,7 @@ getopts(int argc, char *argv[]) break; case 'x': add_pattern(&exclude, bsdunzip->argument); + unzip_exclude_mode = 1; break; case 'y': y_str = " "; @@ -1245,12 +1250,26 @@ main(int argc, char *argv[]) if (strcmp(zipfile, "-") == 0) zipfile = NULL; /* STDIN */ + unzip_exclude_mode = 0; + while (nopts < argc && *argv[nopts] != '-') add_pattern(&include, argv[nopts++]); nopts--; /* fake argv[0] */ nopts += getopts(argc - nopts, argv + nopts); + /* + * For compatibility with Info-ZIP's unzip(1) we need to treat + * non-option arguments following an -x after the zipfile as + * exclude list members. + */ + if (unzip_exclude_mode) { + while (nopts < argc && *argv[nopts] != '-') + add_pattern(&exclude, argv[nopts++]); + nopts--; /* fake argv[0] */ + nopts += getopts(argc - nopts, argv + nopts); + } + /* There may be residual arguments if we encountered -- */ while (nopts < argc) add_pattern(&include, argv[nopts++]); diff --git a/contrib/libarchive/unzip/bsdunzip.h b/contrib/libarchive/unzip/bsdunzip.h index 12b65cefb466..ab81e3930ec2 100644 --- a/contrib/libarchive/unzip/bsdunzip.h +++ b/contrib/libarchive/unzip/bsdunzip.h @@ -48,11 +48,6 @@ struct bsdunzip { const char *argument; }; -struct bsdunzip_getopt_ret { - int index; - int opt; -}; - enum { OPTION_NONE, OPTION_VERSION @@ -60,4 +55,6 @@ enum { int bsdunzip_getopt(struct bsdunzip *); +extern int bsdunzip_optind; + #endif diff --git a/contrib/libarchive/unzip/cmdline.c b/contrib/libarchive/unzip/cmdline.c index 95d4f99b8242..76eb423de116 100644 --- a/contrib/libarchive/unzip/cmdline.c +++ b/contrib/libarchive/unzip/cmdline.c @@ -43,8 +43,6 @@ __FBSDID("$FreeBSD$"); #include "bsdunzip.h" #include "err.h" -extern int bsdunzip_optind; - /* * Short options for bsdunzip. Please keep this sorted. */ diff --git a/contrib/libarchive/unzip/test/test_d.c b/contrib/libarchive/unzip/test/test_d.c index 64950cbbe165..01ab9b8caaa3 100644 --- a/contrib/libarchive/unzip/test/test_d.c +++ b/contrib/libarchive/unzip/test/test_d.c @@ -25,8 +25,8 @@ */ #include "test.h" -/* Test d arg - extract to target dir */ -DEFINE_TEST(test_d) +/* Test d arg - extract to target dir - before zipfile argument */ +DEFINE_TEST(test_d_before_zipfile) { const char *reffile = "test_basic.zip"; int r; @@ -42,3 +42,21 @@ DEFINE_TEST(test_d) assertTextFileContents("contents c\n", "foobar/test_basic/c"); assertTextFileContents("contents CAPS\n", "foobar/test_basic/CAPS"); } + +/* Test d arg - extract to target dir - after zipfile argument */ +DEFINE_TEST(test_d_after_zipfile) +{ + const char *reffile = "test_basic.zip"; + int r; + + extract_reference_file(reffile); + r = systemf("%s %s -d foobar >test.out 2>test.err", testprog, reffile); + assertEqualInt(0, r); + assertNonEmptyFile("test.out"); + assertEmptyFile("test.err"); + + assertTextFileContents("contents a\n", "foobar/test_basic/a"); + assertTextFileContents("contents b\n", "foobar/test_basic/b"); + assertTextFileContents("contents c\n", "foobar/test_basic/c"); + assertTextFileContents("contents CAPS\n", "foobar/test_basic/CAPS"); +} diff --git a/contrib/libarchive/unzip/test/test_x.c b/contrib/libarchive/unzip/test/test_x.c index 21f01bf65da8..d55376849ce9 100644 --- a/contrib/libarchive/unzip/test/test_x.c +++ b/contrib/libarchive/unzip/test/test_x.c @@ -25,8 +25,8 @@ */ #include "test.h" -/* Test x arg - Exclude paths */ -DEFINE_TEST(test_x) +/* Test x arg with single exclude path */ +DEFINE_TEST(test_x_single) { const char *reffile = "test_basic.zip"; int r; @@ -42,3 +42,39 @@ DEFINE_TEST(test_x) assertFileNotExists("test_basic/c"); assertTextFileContents("contents CAPS\n", "test_basic/CAPS"); } + +/* Test x arg with multiple exclude paths */ +DEFINE_TEST(test_x_multiple) +{ + const char *reffile = "test_basic.zip"; + int r; + + extract_reference_file(reffile); + r = systemf("%s %s -x test_basic/c test_basic/b >test.out 2>test.err", testprog, reffile); + assertEqualInt(0, r); + assertNonEmptyFile("test.out"); + assertEmptyFile("test.err"); + + assertTextFileContents("contents a\n", "test_basic/a"); + assertFileNotExists("test_basic/b"); + assertFileNotExists("test_basic/c"); + assertTextFileContents("contents CAPS\n", "test_basic/CAPS"); +} + +/* Test x arg with multiple exclude paths and a d arg afterwards */ +DEFINE_TEST(test_x_multiple_with_d) +{ + const char *reffile = "test_basic.zip"; + int r; + + extract_reference_file(reffile); + r = systemf("%s %s -x test_basic/c test_basic/b -d foobar >test.out 2>test.err", testprog, reffile); + assertEqualInt(0, r); + assertNonEmptyFile("test.out"); + assertEmptyFile("test.err"); + + assertTextFileContents("contents a\n", "foobar/test_basic/a"); + assertFileNotExists("foobar/test_basic/b"); + assertFileNotExists("foobar/test_basic/c"); + assertTextFileContents("contents CAPS\n", "foobar/test_basic/CAPS"); +} From nobody Sat May 4 12:37:38 2024 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 4VWnJ26sCrz5KVL0; Sat, 4 May 2024 12:37: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 4VWnJ24YQ0z44L7; Sat, 4 May 2024 12:37:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714826258; 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=Mkgy0HAWgxeYxbpJx6TUZTKuJuqxrMj+CnU1Fhi0AhY=; b=VenaUPkikD2T7+7UbZ8KJHxcOLGMJ9L5a3mosGh8mpRhB/N1JcKFBW98m8WaKG6bL4cN5Y K8ICmqfb3iJfBsXR7pDUrRhqTq1QLHCTxkHAoH9Cyp80h/KaaCoUEsYBa8MmK2dMn/ZTRq NsvFJeL++GonGNWbBzfNYDpDvhWYEcGK8hymsdlfR8dI+6m3q/W91hyjHPBkv3KFbbvj5s S80Md6kMzFiHuZTRCt9euMcaBmzG+JTtZSg76oBC0Qtbpt9ztLW6tryLr3QsWtBPSXwQTS adcah4MGqhiqse8rTzInyGa9XRO6Odqz/7QnVl7sIucC5U/CmsghRhaRkiDMeQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714826258; a=rsa-sha256; cv=none; b=FKWnqIMjKlsD3MAqcf+wvFFUwDVdVF0Bzfl9rOMJtLBZAnk4x79aFRnoLOc+DZroPrFQ4r Sqpb8m8cP2TQh3tI2QyBzSeg//5FQKEvEvuM5Hd2v+GHGpxMY8be2uGShOPAC4z9OmEA4Y wuXR95CV3dyYbEekyxrdx/rIW05wZdrCYc/0kRmGureIZQgUC9fPbvbo3SKKwk7PmyaSna eTlJ37GAfIayRvvdZPGgYvpKUY/XIybYyhQLmNJ7vxUpLFdwZwH5W5WX66ILT+dti58K3U qvH81gBVeDBv8uK4Ypk+T5OPrQvVcOtUdlGaGrhsTgXxewaFPOzYaDutqMaYSQ== 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=1714826258; 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=Mkgy0HAWgxeYxbpJx6TUZTKuJuqxrMj+CnU1Fhi0AhY=; b=i1tFpekLvWO/dB/+5b0YPrcVmCz1BsiuP/XrTukW+niby2i7fI+VbH8Yp7myMVg1s+VgO0 zuScUwTrrchmOyLY36mIoXD4ai8HQzqiUCVC+cQvy1z3qwQo1L0j7jmdxSKS+KGm2qab2V hex9uwgjLF8Vizev5Vp3A3CEXUYKguO4nqgnkrbO/k0B5R3hbVJloyRAMSvf7qVZvbefgX woaJZED3MiWk7+1LcDoIL4jDyrc8TXQ9rl7dUCWocf0sef+EvtiZVy2tiabreiPdeWhrLS 5BvK0lvK2BXwIA/6nCNfFLmhhx58JkfncktbPEMqwq8zNYh3TwJp5/Fi4Htzxg== 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 4VWnJ241sDzVPF; Sat, 4 May 2024 12:37: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 444Cbc8x072465; Sat, 4 May 2024 12:37:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 444CbcHj072462; Sat, 4 May 2024 12:37:38 GMT (envelope-from git) Date: Sat, 4 May 2024 12:37:38 GMT Message-Id: <202405041237.444CbcHj072462@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Martin Matuska Subject: git: 277283585540 - stable/13 - unzip: swtich to bsdunzip from libarchive List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 277283585540b41170373730d54e3d1917b0bb18 Auto-Submitted: auto-generated The branch stable/13 has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=277283585540b41170373730d54e3d1917b0bb18 commit 277283585540b41170373730d54e3d1917b0bb18 Author: Martin Matuska AuthorDate: 2023-07-31 11:54:58 +0000 Commit: Martin Matuska CommitDate: 2024-05-04 11:53:07 +0000 unzip: swtich to bsdunzip from libarchive Unzip from FreeBSD has been ported to libarchive. Change usr.bin/unzip to use bsdunzip from libarchive. Differential Revision: https://reviews.freebsd.org/D41239 PR: 272845 (exp-run) (cherry picked from commit b5a3a89c50671a1ad29e7c43fe15e7b16feac239) --- etc/mtree/BSD.tests.dist | 2 + lib/libarchive/config_freebsd.h | 5 + usr.bin/unzip/Makefile | 28 +- usr.bin/unzip/tests/Makefile | 74 +++ usr.bin/unzip/tests/Makefile.depend | 24 + usr.bin/unzip/tests/functional_test.sh | 56 ++ usr.bin/unzip/unzip.1 | 201 ------ usr.bin/unzip/unzip.c | 1132 -------------------------------- 8 files changed, 188 insertions(+), 1334 deletions(-) diff --git a/etc/mtree/BSD.tests.dist b/etc/mtree/BSD.tests.dist index 98450e1cafbd..5d31c374166d 100644 --- a/etc/mtree/BSD.tests.dist +++ b/etc/mtree/BSD.tests.dist @@ -1123,6 +1123,8 @@ .. uniq .. + unzip + .. vmstat .. xargs diff --git a/lib/libarchive/config_freebsd.h b/lib/libarchive/config_freebsd.h index aefbcd4b46bd..49b212c2204c 100644 --- a/lib/libarchive/config_freebsd.h +++ b/lib/libarchive/config_freebsd.h @@ -109,6 +109,8 @@ #define HAVE_FCNTL 1 #define HAVE_FCNTL_H 1 #define HAVE_FDOPENDIR 1 +#define HAVE_FNMATCH 1 +#define HAVE_FNMATCH_H 1 #define HAVE_FORK 1 #define HAVE_FSEEKO 1 #define HAVE_FSTAT 1 @@ -121,6 +123,8 @@ #define HAVE_GETEUID 1 #define HAVE_GETGRGID_R 1 #define HAVE_GETGRNAM_R 1 +#define HAVE_GETLINE 1 +#define HAVE_GETOPT_OPTRESET 1 #define HAVE_GETPID 1 #define HAVE_GETPWNAM_R 1 #define HAVE_GETPWUID_R 1 @@ -199,6 +203,7 @@ #define HAVE_SYS_MOUNT_H 1 #define HAVE_SYS_PARAM_H 1 #define HAVE_SYS_POLL_H 1 +#define HAVE_SYS_QUEUE_H 1 #define HAVE_SYS_SELECT_H 1 #define HAVE_SYS_STATVFS_H 1 #define HAVE_SYS_STAT_H 1 diff --git a/usr.bin/unzip/Makefile b/usr.bin/unzip/Makefile index 3204a0741389..7193ab58b5a3 100644 --- a/usr.bin/unzip/Makefile +++ b/usr.bin/unzip/Makefile @@ -1,5 +1,31 @@ -PROG = unzip +.include + +_LIBARCHIVEDIR= ${SRCTOP}/contrib/libarchive +_LIBARCHIVECONFDIR= ${SRCTOP}/lib/libarchive + +PROG= bsdunzip + +BSDUNZIP_VERSION_STRING!= sed -n '/define.*ARCHIVE_VERSION_ONLY_STRING/{s,[^0-9.],,gp;q;}' \ + ${_LIBARCHIVEDIR}/libarchive/archive.h + +.PATH: ${_LIBARCHIVEDIR}/unzip +SRCS= bsdunzip.c + +.PATH: ${_LIBARCHIVEDIR}/libarchive_fe +SRCS+= cmdline.c err.c passphrase.c + +CFLAGS+= -DBSDUNZIP_VERSION_STRING=\"${BSDUNZIP_VERSION_STRING}\" +CFLAGS+= -DPLATFORM_CONFIG_H=\"${_LIBARCHIVECONFDIR}/config_freebsd.h\" +CFLAGS+= -I${_LIBARCHIVEDIR}/unzip -I${_LIBARCHIVEDIR}/libarchive_fe + LIBADD= archive +SYMLINKS=bsdunzip ${BINDIR}/unzip +MLINKS= bsdunzip.1 unzip.1 + +HAS_TESTS= +SUBDIR.${MK_TESTS}+= tests + .include +# DO NOT DELETE diff --git a/usr.bin/unzip/tests/Makefile b/usr.bin/unzip/tests/Makefile new file mode 100644 index 000000000000..577c0936a151 --- /dev/null +++ b/usr.bin/unzip/tests/Makefile @@ -0,0 +1,74 @@ +# $FreeBSD$ + +PACKAGE= tests + +_LIBARCHIVEDIR= ${SRCTOP}/contrib/libarchive + +ATF_TESTS_SH+= functional_test + +BINDIR= ${TESTSDIR} + +PROGS+= bsdunzip_test + +CFLAGS+= -DPLATFORM_CONFIG_H=\"${SRCTOP}/lib/libarchive/config_freebsd.h\" +CFLAGS+= -I${SRCTOP}/lib/libarchive -I${.OBJDIR} + +CFLAGS+= -I${.OBJDIR} +CFLAGS+= -I${_LIBARCHIVEDIR}/unzip -I${_LIBARCHIVEDIR}/unzip/test +CFLAGS+= -I${_LIBARCHIVEDIR}/libarchive +CFLAGS+= -I${_LIBARCHIVEDIR}/libarchive_fe -I${_LIBARCHIVEDIR}/test_utils + +# Uncomment to link against dmalloc +#LDADD+= -L/usr/local/lib -ldmalloc +#CFLAGS+= -I/usr/local/include -DUSE_DMALLOC + +CFLAGS.test_utils.c+= -Wno-cast-align + +.PATH: ${_LIBARCHIVEDIR}/libarchive_fe +UNZIP_SRCS+= err.c + +.PATH: ${_LIBARCHIVEDIR}/unzip/test +TESTS_SRCS= \ + test_0.c \ + test_C.c \ + test_L.c \ + test_P_encryption.c \ + test_Z1.c \ + test_basic.c \ + test_d.c \ + test_glob.c \ + test_j.c \ + test_n.c \ + test_not_exist.c \ + test_o.c \ + test_p.c \ + test_q.c \ + test_singlefile.c \ + test_t.c \ + test_t_bad.c \ + test_version.c \ + test_x.c + +SRCS.bsdunzip_test= list.h \ + ${UNZIP_SRCS} \ + ${TESTS_SRCS} + +.PATH: ${_LIBARCHIVEDIR}/test_utils +SRCS.bsdunzip_test+= test_main.c \ + test_utils.c + +LIBADD.bsdunzip_test= archive + +list.h: ${TESTS_SRCS} Makefile + @(cd ${_LIBARCHIVEDIR}/unzip/test && \ + grep -h DEFINE_TEST ${.ALLSRC:N*Makefile}) > ${.TARGET}.tmp + @mv ${.TARGET}.tmp ${.TARGET} + +CLEANFILES+= list.h list.h.tmp + +${PACKAGE}FILES+= test_basic.zip.uu +${PACKAGE}FILES+= test_encrypted.zip.uu +${PACKAGE}FILES+= test_singlefile.zip.uu +${PACKAGE}FILES+= test_t_bad.zip.uu + +.include diff --git a/usr.bin/unzip/tests/Makefile.depend b/usr.bin/unzip/tests/Makefile.depend new file mode 100644 index 000000000000..138ae4120671 --- /dev/null +++ b/usr.bin/unzip/tests/Makefile.depend @@ -0,0 +1,24 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + gnu/lib/csu \ + include \ + include/xlocale \ + lib/${CSU_DIR} \ + lib/libarchive \ + lib/libbz2 \ + lib/libc \ + lib/libcompiler_rt \ + lib/libexpat \ + lib/liblzma \ + lib/libthr \ + lib/libz \ + secure/lib/libcrypto \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif diff --git a/usr.bin/unzip/tests/functional_test.sh b/usr.bin/unzip/tests/functional_test.sh new file mode 100755 index 000000000000..1b39e057d538 --- /dev/null +++ b/usr.bin/unzip/tests/functional_test.sh @@ -0,0 +1,56 @@ +# +# Copyright 2015 EMC Corp. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * 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 COPYRIGHT HOLDERS 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 COPYRIGHT +# OWNER 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. +# +# $FreeBSD$ + +SRCDIR=$(atf_get_srcdir) +TESTER="${SRCDIR}/bsdunzip_test" +export BSDUNZIP=$(which bsdunzip) + +check() +{ + local testcase=${1}; shift + + # For some odd reason /bin/sh spuriously writes + # "write error on stdout" with some of the testcases + # + # Probably an issue with how they're written as it calls system(3) to + # clean up directories.. + atf_check -e ignore -o ignore -s exit:0 ${TESTER} -d -r "${SRCDIR}" -v "${testcase}" +} + +atf_init_test_cases() +{ + # Redirect stderr to stdout for the usage message because if you don't + # kyua list/kyua test will break: + # https://github.com/jmmv/kyua/issues/149 + testcases=$(${TESTER} -h 2>&1 | awk 'p != 0 && $1 ~ /^[0-9]+:/ { print $NF } /Available tests:/ { p=1 }') + for testcase in ${testcases}; do + atf_test_case ${testcase} + eval "${testcase}_body() { check ${testcase}; }" + atf_add_test_case ${testcase} + done +} diff --git a/usr.bin/unzip/unzip.1 b/usr.bin/unzip/unzip.1 deleted file mode 100644 index 6b808b3ad9f9..000000000000 --- a/usr.bin/unzip/unzip.1 +++ /dev/null @@ -1,201 +0,0 @@ -.\"- -.\" Copyright (c) 2007-2008 Dag-Erling Smørgrav -.\" All rights reserved. -.\" -.\" 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. -.\" -.Dd January 2, 2023 -.Dt UNZIP 1 -.Os -.Sh NAME -.Nm unzip -.Nd extract files from a ZIP archive -.Sh SYNOPSIS -.Nm -.Op Fl aCcfjLlnopqtuvy -.Op Fl d Ar dir -.Op Fl x Ar pattern -.Op Fl P Ar password -.Ar zipfile -.Op Ar member ... -.Sh DESCRIPTION -.\" ... -The following options are available: -.Bl -tag -width Fl -.It Fl a -When extracting a text file, convert DOS-style line endings to -Unix-style line endings. -.It Fl C -Match file names case-insensitively. -.It Fl c -Extract to stdout/screen. -When extracting files from the zipfile, they are written to stdout. -This is similar to -.Fl p , -but does not suppress normal output. -.It Fl d Ar dir -Extract files into the specified directory rather than the current -directory. -.It Fl f -Update existing. -Extract only files from the zipfile if a file with the same name -already exists on disk and is older than the former. -Otherwise, the file is silently skipped. -.It Fl j -Ignore directories stored in the zipfile; instead, extract all files -directly into the extraction directory. -.It Fl L -Convert the names of the extracted files and directories to lowercase. -.It Fl l -List, rather than extract, the contents of the zipfile. -.It Fl n -No overwrite. -When extracting a file from the zipfile, if a file with the same name -already exists on disk, the file is silently skipped. -.It Fl o -Overwrite. -When extracting a file from the zipfile, if a file with the same name -already exists on disk, the existing file is replaced with the file -from the zipfile. -.It Fl p -Extract to stdout. -When extracting files from the zipfile, they are written to stdout. -The normal output is suppressed as if -.Fl q -was specified. -.It Fl P Ar password -Extract encrypted files using a password. -Putting a password on the command line using this option can be -insecure. -.It Fl q -Quiet: print less information while extracting. -.It Fl t -Test: do not extract anything, but verify the checksum of every file -in the archive. -.It Fl u -Update. -When extracting a file from the zipfile, if a file with the same name -already exists on disk, the existing file is replaced with the file -from the zipfile if and only if the latter is newer than the former. -Otherwise, the file is silently skipped. -.It Fl v -List verbosely, rather than extract, the contents of the zipfile. -This differs from -.Fl l -by using the long listing. -Note that most of the data is currently fake and does not reflect the -content of the archive. -.It Fl x Ar pattern -Exclude files matching the pattern -.Ar pattern . -.It Fl y -Print four digit years in listings instead of two. -.It Fl Z Ar mode -Emulate -.Xr zipinfo 1L -mode. -Enabling -.Xr zipinfo 1L -mode changes the way in which additional arguments are parsed. -Currently only -.Xr zipinfo 1L -mode 1 is supported, which lists the file names one per line. -.It Ar [member ...] -Optional list of members to extract from the zipfile. -Can include patterns, e.g. -.Ar 'memberdir/*' -will extract all files and dirs below memberdir. -.El -.Pp -Note that only one of -.Fl n , -.Fl o , -and -.Fl u -may be specified. -If specified filename is -.Qq - , -then data is read from -.Va stdin . -.Sh ENVIRONMENT -If the -.Ev UNZIP_DEBUG -environment variable is defined, the -.Fl q -command-line option has no effect, and additional debugging -information will be printed to -.Va stderr . -.Sh COMPATIBILITY -The -.Nm -utility aims to be sufficiently compatible with other implementations -to serve as a drop-in replacement in the context of the -.Xr ports 7 -system. -No attempt has been made to replicate functionality which is not -required for that purpose. -.Pp -For compatibility reasons, command-line options will be recognized if -they are listed not only before but also after the name of the -zipfile. -.Pp -Normally, the -.Fl a -option should only affect files which are marked as text files in the -zipfile's central directory. -Since the -.Xr archive 3 -library does not provide access to that information, it is not available -to the -.Nm -utility. -Instead, the -.Nm -utility will assume that a file is a text file if no non-ASCII -characters are present within the first block of data decompressed for -that file. -If non-ASCII characters appear in subsequent blocks of data, a warning -will be issued. -.Pp -The -.Nm -utility is only able to process ZIP archives handled by -.Xr libarchive 3 . -Depending on the installed version of -.Xr libarchive 3 , -this may or may not include self-extracting or ZIPX archives. -.Sh SEE ALSO -.Xr libarchive 3 -.Sh HISTORY -The -.Nm -utility appeared in -.Fx 8.0 . -.Sh AUTHORS -The -.Nm -utility and this manual page were written by -.An Dag-Erling Sm\(/orgrav Aq Mt des@FreeBSD.org . -It uses the -.Xr archive 3 -library developed by -.An Tim Kientzle Aq Mt kientzle@FreeBSD.org . diff --git a/usr.bin/unzip/unzip.c b/usr.bin/unzip/unzip.c deleted file mode 100644 index c0036e71b5b7..000000000000 --- a/usr.bin/unzip/unzip.c +++ /dev/null @@ -1,1132 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause - * - * Copyright (c) 2009, 2010 Joerg Sonnenberger - * Copyright (c) 2007-2008 Dag-Erling Smørgrav - * All rights reserved. - * - * 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 - * in this position and unchanged. - * 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. - * - * This file would be much shorter if we didn't care about command-line - * compatibility with Info-ZIP's UnZip, which requires us to duplicate - * parts of libarchive in order to gain more detailed control of its - * behaviour for the purpose of implementing the -n, -o, -L and -a - * options. - */ - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -/* command-line options */ -static int a_opt; /* convert EOL */ -static int C_opt; /* match case-insensitively */ -static int c_opt; /* extract to stdout */ -static const char *d_arg; /* directory */ -static int f_opt; /* update existing files only */ -static int j_opt; /* junk directories */ -static int L_opt; /* lowercase names */ -static int n_opt; /* never overwrite */ -static int o_opt; /* always overwrite */ -static int p_opt; /* extract to stdout, quiet */ -static char *P_arg; /* passphrase */ -static int q_opt; /* quiet */ -static int t_opt; /* test */ -static int u_opt; /* update */ -static int v_opt; /* verbose/list */ -static const char *y_str = ""; /* 4 digit year */ -static int Z1_opt; /* zipinfo mode list files only */ - -/* debug flag */ -static int unzip_debug; - -/* zipinfo mode */ -static int zipinfo_mode; - -/* running on tty? */ -static int tty; - -/* convenience macro */ -/* XXX should differentiate between ARCHIVE_{WARN,FAIL,RETRY} */ -#define ac(call) \ - do { \ - int acret = (call); \ - if (acret != ARCHIVE_OK) \ - errorx("%s", archive_error_string(a)); \ - } while (0) - -/* - * Indicates that last info() did not end with EOL. This helps error() et - * al. avoid printing an error message on the same line as an incomplete - * informational message. - */ -static int noeol; - -/* for an interactive passphrase input */ -static char *passphrase_buf; - -/* fatal error message + errno */ -static void -error(const char *fmt, ...) -{ - va_list ap; - - if (noeol) - fprintf(stdout, "\n"); - fflush(stdout); - fprintf(stderr, "unzip: "); - va_start(ap, fmt); - vfprintf(stderr, fmt, ap); - va_end(ap); - fprintf(stderr, ": %s\n", strerror(errno)); - exit(EXIT_FAILURE); -} - -/* fatal error message, no errno */ -static void -errorx(const char *fmt, ...) -{ - va_list ap; - - if (noeol) - fprintf(stdout, "\n"); - fflush(stdout); - fprintf(stderr, "unzip: "); - va_start(ap, fmt); - vfprintf(stderr, fmt, ap); - va_end(ap); - fprintf(stderr, "\n"); - exit(EXIT_FAILURE); -} - -/* non-fatal error message + errno */ -static void -warning(const char *fmt, ...) -{ - va_list ap; - - if (noeol) - fprintf(stdout, "\n"); - fflush(stdout); - fprintf(stderr, "unzip: "); - va_start(ap, fmt); - vfprintf(stderr, fmt, ap); - va_end(ap); - fprintf(stderr, ": %s\n", strerror(errno)); -} - -/* non-fatal error message, no errno */ -static void -warningx(const char *fmt, ...) -{ - va_list ap; - - if (noeol) - fprintf(stdout, "\n"); - fflush(stdout); - fprintf(stderr, "unzip: "); - va_start(ap, fmt); - vfprintf(stderr, fmt, ap); - va_end(ap); - fprintf(stderr, "\n"); -} - -/* informational message (if not -q) */ -static void -info(const char *fmt, ...) -{ - va_list ap; - - if (q_opt && !unzip_debug) - return; - va_start(ap, fmt); - vfprintf(stdout, fmt, ap); - va_end(ap); - fflush(stdout); - - if (*fmt == '\0') - noeol = 1; - else - noeol = fmt[strlen(fmt) - 1] != '\n'; -} - -/* debug message (if unzip_debug) */ -static void -debug(const char *fmt, ...) -{ - va_list ap; - - if (!unzip_debug) - return; - va_start(ap, fmt); - vfprintf(stderr, fmt, ap); - va_end(ap); - fflush(stderr); - - if (*fmt == '\0') - noeol = 1; - else - noeol = fmt[strlen(fmt) - 1] != '\n'; -} - -/* duplicate a path name, possibly converting to lower case */ -static char * -pathdup(const char *path) -{ - char *str; - size_t i, len; - - if (path == NULL || path[0] == '\0') - return (NULL); - - len = strlen(path); - while (len && path[len - 1] == '/') - len--; - if ((str = malloc(len + 1)) == NULL) { - errno = ENOMEM; - error("malloc()"); - } - if (L_opt) { - for (i = 0; i < len; ++i) - str[i] = tolower((unsigned char)path[i]); - } else { - memcpy(str, path, len); - } - str[len] = '\0'; - - return (str); -} - -/* concatenate two path names */ -static char * -pathcat(const char *prefix, const char *path) -{ - char *str; - size_t prelen, len; - - prelen = prefix ? strlen(prefix) + 1 : 0; - len = strlen(path) + 1; - if ((str = malloc(prelen + len)) == NULL) { - errno = ENOMEM; - error("malloc()"); - } - if (prefix) { - memcpy(str, prefix, prelen); /* includes zero */ - str[prelen - 1] = '/'; /* splat zero */ - } - memcpy(str + prelen, path, len); /* includes zero */ - - return (str); -} - -/* - * Pattern lists for include / exclude processing - */ -struct pattern { - STAILQ_ENTRY(pattern) link; - char pattern[]; -}; - -STAILQ_HEAD(pattern_list, pattern); -static struct pattern_list include = STAILQ_HEAD_INITIALIZER(include); -static struct pattern_list exclude = STAILQ_HEAD_INITIALIZER(exclude); - -/* - * Add an entry to a pattern list - */ -static void -add_pattern(struct pattern_list *list, const char *pattern) -{ - struct pattern *entry; - size_t len; - - debug("adding pattern '%s'\n", pattern); - len = strlen(pattern); - if ((entry = malloc(sizeof *entry + len + 1)) == NULL) { - errno = ENOMEM; - error("malloc()"); - } - memcpy(entry->pattern, pattern, len + 1); - STAILQ_INSERT_TAIL(list, entry, link); -} - -/* - * Match a string against a list of patterns - */ -static int -match_pattern(struct pattern_list *list, const char *str) -{ - struct pattern *entry; - - STAILQ_FOREACH(entry, list, link) { - if (fnmatch(entry->pattern, str, C_opt ? FNM_CASEFOLD : 0) == 0) - return (1); - } - return (0); -} - -/* - * Verify that a given pathname is in the include list and not in the - * exclude list. - */ -static int -accept_pathname(const char *pathname) -{ - - if (!STAILQ_EMPTY(&include) && !match_pattern(&include, pathname)) - return (0); - if (!STAILQ_EMPTY(&exclude) && match_pattern(&exclude, pathname)) - return (0); - return (1); -} - -/* - * Create the specified directory with the specified mode, taking certain - * precautions on they way. - */ -static void -make_dir(const char *path, int mode) -{ - struct stat sb; - - if (lstat(path, &sb) == 0) { - if (S_ISDIR(sb.st_mode)) - return; - /* - * Normally, we should either ask the user about removing - * the non-directory of the same name as a directory we - * wish to create, or respect the -n or -o command-line - * options. However, this may lead to a later failure or - * even compromise (if this non-directory happens to be a - * symlink to somewhere unsafe), so we don't. - */ - - /* - * Don't check unlink() result; failure will cause mkdir() - * to fail later, which we will catch. - */ - (void)unlink(path); - } - if (mkdir(path, mode) != 0 && errno != EEXIST) - error("mkdir('%s')", path); -} - -/* - * Ensure that all directories leading up to (but not including) the - * specified path exist. - * - * XXX inefficient + modifies the file in-place - */ -static void -make_parent(char *path) -{ - struct stat sb; - char *sep; - - sep = strrchr(path, '/'); - if (sep == NULL || sep == path) - return; - *sep = '\0'; - if (lstat(path, &sb) == 0) { - if (S_ISDIR(sb.st_mode)) { - *sep = '/'; - return; - } - unlink(path); - } - make_parent(path); - mkdir(path, 0755); - *sep = '/'; - -#if 0 - for (sep = path; (sep = strchr(sep, '/')) != NULL; sep++) { - /* root in case of absolute d_arg */ - if (sep == path) - continue; - *sep = '\0'; - make_dir(path, 0755); - *sep = '/'; - } -#endif -} - -/* - * Extract a directory. - */ -static void -extract_dir(struct archive *a, struct archive_entry *e, const char *path) -{ - int mode; - - /* - * Dropbox likes to create '/' directory entries, just ignore - * such junk. - */ - if (*path == '\0') - return; - - mode = archive_entry_mode(e) & 0777; - if (mode == 0) - mode = 0755; - - /* - * Some zipfiles contain directories with weird permissions such - * as 0644 or 0444. This can cause strange issues such as being - * unable to extract files into the directory we just created, or - * the user being unable to remove the directory later without - * first manually changing its permissions. Therefore, we whack - * the permissions into shape, assuming that the user wants full - * access and that anyone who gets read access also gets execute - * access. - */ - mode |= 0700; - if (mode & 0040) - mode |= 0010; - if (mode & 0004) - mode |= 0001; - - info(" creating: %s/\n", path); - make_dir(path, mode); - ac(archive_read_data_skip(a)); -} - -static unsigned char buffer[8192]; -static char spinner[] = { '|', '/', '-', '\\' }; - -static int -handle_existing_file(char **path) -{ - size_t alen; - ssize_t len; - char buf[4]; - - for (;;) { - fprintf(stderr, - "replace %s? [y]es, [n]o, [A]ll, [N]one, [r]ename: ", - *path); - if (fgets(buf, sizeof(buf), stdin) == NULL) { - clearerr(stdin); - printf("NULL\n(EOF or read error, " - "treating as \"[N]one\"...)\n"); - n_opt = 1; - return -1; - } - switch (*buf) { - case 'A': - o_opt = 1; - /* FALLTHROUGH */ - case 'y': - case 'Y': - (void)unlink(*path); - return 1; - case 'N': - n_opt = 1; - /* FALLTHROUGH */ - case 'n': - return -1; - case 'r': - case 'R': - printf("New name: "); - fflush(stdout); - free(*path); - *path = NULL; - alen = 0; - len = getline(path, &alen, stdin); - if ((*path)[len - 1] == '\n') - (*path)[len - 1] = '\0'; - return 0; - default: - break; - } - } -} - -/* - * Detect binary files by a combination of character white list and - * black list. NUL bytes and other control codes without use in text files - * result directly in switching the file to binary mode. Otherwise, at least - * one white-listed byte has to be found. - * - * Black-listed: 0..6, 14..25, 28..31 - * 0xf3ffc07f = 11110011111111111100000001111111b - * White-listed: 9..10, 13, >= 32 - * 0x00002600 = 00000000000000000010011000000000b - * - * See the proginfo/txtvsbin.txt in the zip sources for a detailed discussion. - */ -#define BYTE_IS_BINARY(x) ((x) < 32 && (0xf3ffc07fU & (1U << (x)))) -#define BYTE_IS_TEXT(x) ((x) >= 32 || (0x00002600U & (1U << (x)))) *** 641 LINES SKIPPED *** From nobody Sat May 4 12:37:39 2024 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 4VWnJ43p8Kz5KVNM; Sat, 4 May 2024 12:37: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 4VWnJ40zG2z44LQ; Sat, 4 May 2024 12:37:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714826260; 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=vLbBJIYRFXV7tYuDyDHTT4UWeI72U5B4Qv1sRCSHEBo=; b=r2d+vvElfwdRUNx7ln9IuPWsiI69fwQJJ0WKg5EN2u2N18dEJeHVkwGa4YFPYyyR/RJuP8 J34wFM5Rgs9Ykgzy8QrlTvxKEpRlpseeDBbN8h0ogywdF7Yy/UABjSAU0z0khm7QU6gRB8 S9vvSei86CP+0ZRqDIKvkOlFsuu2PLlhFLQyv1rYCyP43b3PJhbGtmW+0cJj9B5+IL2iyK ijkwoPp5hX8mkkLpz2k4x5lgyZK3xzZSTh2CPOLbvYj4S8fQD1nUrlQvWJrFiDZYySj5hD 1cCGlGyw0RT29HOUh0x+C8m4wzWwduhbcuWnIwxhOJadbeWrIytGXOmvkU50OQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714826260; a=rsa-sha256; cv=none; b=BkyA+SQ09A6b6hhk7Hcpej12a6VSFeX0X68gE1zAlkqAoqsYmqxZH1jdn/N8kpLzVrpjGw TYNx+SN8eWifoEWlqtaRjKS527DU2vNjb57KByHz0EqUkteUL3Ht7+zzSTb2+11qSLz1iI Twdjodub7hqVM3zitZk/LGAVXDvi9VED/xj/sAcHma7v+oTLkj43uh6X+WYO26hw5kyfRw b1RxjorqNUj6Rbin/uv5R4fuzAKtiRQiCBKgZUYklJO79CBHpS79T0QzDxNh1dUvoJ80IU q/7RkpMs/2ha/0Lmt/edVNOPxC3iFiW1fLJEB5BTvIl+sEhJ0MHhNoOb33sinQ== 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=1714826260; 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=vLbBJIYRFXV7tYuDyDHTT4UWeI72U5B4Qv1sRCSHEBo=; b=CSAXwtE4+veI/E7UCcMxyEwjRlhJ5UszypwU/IsE/0wP5jIcn6LiYbjlpj5X3D+phGR+Je zqGjPlbgv45M8tZYQwBdUQE2ksSxEZSUlteuphEtAt1JQavwHyN7pmBmOJOJ5KNKMNWZuX IqW5b9c9gEH5ZwoTD9FPlTxRifaErE6WxYHZ1anapGhdi6ElsOvlnAQYrI4ytObJtMLDEg 8T+clc4IVwzZtA1lKBoP636sAwxuHdTaSgHs82OmskM0AT8XI+EPOtRWeW09b32JhuObOx 0jZ7Ow06h0P/i3132L+p+pLOI+7FDnEvAWNzrbU7DYcGj7cR50gPjtS1g/xQ+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 4VWnJ40DqNzVTQ; Sat, 4 May 2024 12:37: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 444Cbdwc072507; Sat, 4 May 2024 12:37:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 444CbdvX072504; Sat, 4 May 2024 12:37:39 GMT (envelope-from git) Date: Sat, 4 May 2024 12:37:39 GMT Message-Id: <202405041237.444CbdvX072504@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Martin Matuska Subject: git: aa2aad0492d8 - stable/13 - libarchive: merge from vendor branch List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: aa2aad0492d822c85186348244642107be4c911a Auto-Submitted: auto-generated The branch stable/13 has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=aa2aad0492d822c85186348244642107be4c911a commit aa2aad0492d822c85186348244642107be4c911a Author: Martin Matuska AuthorDate: 2024-04-16 21:39:31 +0000 Commit: Martin Matuska CommitDate: 2024-05-04 11:53:07 +0000 libarchive: merge from vendor branch Libarchive 3.7.3 New features: #1941 uudecode filter: support file name and file mode in raw mode #1943 7-zip reader: translate Windows permissions into UNIX permissions #1962 zstd filter now supports the "long" write option #2012 add trailing letter b to bsdtar(1) substitute pattern #2031 PCRE2 support #2054 add support for long options "--group" and "--owner" to tar(1) Security fixes: #2101 Fix possible vulnerability in tar error reporting introduced in f27c173 Important bugfixes: #1974 ISO9660: preserve the natural order of links #2105 rar5: fix infinite loop if during rar5 decompression the last block produced no data #2027 xz filter: fix incorrect eof at the end of an lzip member #2043 zip: fix end-of-data marker processing when decompressing zip archives (cherry picked from commit b9128a37faafede823eb456aa65a11ac69997284) --- contrib/libarchive/.editorconfig | 18 - contrib/libarchive/.github/workflows/cifuzz.yml | 24 - contrib/libarchive/NEWS | 4 + .../build/autoconf/m4_ax_compile_check_sizeof.m4 | 115 -- contrib/libarchive/cat/bsdcat.1 | 2 - contrib/libarchive/cat/bsdcat.c | 36 +- contrib/libarchive/cat/bsdcat.h | 7 - contrib/libarchive/cat/bsdcat_platform.h | 24 +- contrib/libarchive/cat/cmdline.c | 1 - contrib/libarchive/cat/test/test.h | 2 - contrib/libarchive/cpio/bsdcpio.1 | 2 - contrib/libarchive/cpio/cmdline.c | 1 - contrib/libarchive/cpio/cpio.c | 17 +- contrib/libarchive/cpio/cpio.h | 2 - contrib/libarchive/cpio/cpio_platform.h | 18 +- contrib/libarchive/cpio/test/test.h | 2 - contrib/libarchive/cpio/test/test_0.c | 1 - contrib/libarchive/cpio/test/test_basic.c | 1 - contrib/libarchive/cpio/test/test_cmdline.c | 1 - contrib/libarchive/cpio/test/test_extract_cpio_Z.c | 1 - .../libarchive/cpio/test/test_extract_cpio_bz2.c | 1 - .../libarchive/cpio/test/test_extract_cpio_grz.c | 1 - .../libarchive/cpio/test/test_extract_cpio_gz.c | 1 - .../libarchive/cpio/test/test_extract_cpio_lrz.c | 1 - .../libarchive/cpio/test/test_extract_cpio_lz.c | 1 - .../libarchive/cpio/test/test_extract_cpio_lz4.c | 1 - .../libarchive/cpio/test/test_extract_cpio_lzma.c | 1 - .../libarchive/cpio/test/test_extract_cpio_lzo.c | 1 - .../libarchive/cpio/test/test_extract_cpio_xz.c | 1 - .../libarchive/cpio/test/test_extract_cpio_zstd.c | 1 - contrib/libarchive/cpio/test/test_format_newc.c | 1 - contrib/libarchive/cpio/test/test_gcpio_compat.c | 1 - .../cpio/test/test_gcpio_compat_ref.bin.uu | 1 - .../cpio/test/test_gcpio_compat_ref.crc.uu | 1 - .../cpio/test/test_gcpio_compat_ref.newc.uu | 1 - .../cpio/test/test_gcpio_compat_ref.ustar.uu | 1 - contrib/libarchive/cpio/test/test_missing_file.c | 1 - contrib/libarchive/cpio/test/test_option_0.c | 1 - contrib/libarchive/cpio/test/test_option_B_upper.c | 2 - contrib/libarchive/cpio/test/test_option_C_upper.c | 2 - contrib/libarchive/cpio/test/test_option_J_upper.c | 1 - contrib/libarchive/cpio/test/test_option_L_upper.c | 1 - contrib/libarchive/cpio/test/test_option_Z_upper.c | 1 - contrib/libarchive/cpio/test/test_option_a.c | 1 - .../libarchive/cpio/test/test_option_b64encode.c | 1 - contrib/libarchive/cpio/test/test_option_c.c | 1 - contrib/libarchive/cpio/test/test_option_d.c | 2 - contrib/libarchive/cpio/test/test_option_f.c | 1 - contrib/libarchive/cpio/test/test_option_f.cpio.uu | 1 - contrib/libarchive/cpio/test/test_option_grzip.c | 1 - contrib/libarchive/cpio/test/test_option_help.c | 1 - contrib/libarchive/cpio/test/test_option_l.c | 1 - contrib/libarchive/cpio/test/test_option_lrzip.c | 1 - contrib/libarchive/cpio/test/test_option_lz4.c | 1 - contrib/libarchive/cpio/test/test_option_lzma.c | 1 - contrib/libarchive/cpio/test/test_option_lzop.c | 1 - contrib/libarchive/cpio/test/test_option_m.c | 2 - contrib/libarchive/cpio/test/test_option_m.cpio.uu | 1 - .../libarchive/cpio/test/test_option_passphrase.c | 1 - contrib/libarchive/cpio/test/test_option_t.c | 1 - contrib/libarchive/cpio/test/test_option_t.cpio.uu | 1 - .../libarchive/cpio/test/test_option_t.stdout.uu | 1 - .../libarchive/cpio/test/test_option_tv.stdout.uu | 1 - contrib/libarchive/cpio/test/test_option_u.c | 1 - .../libarchive/cpio/test/test_option_uuencode.c | 1 - contrib/libarchive/cpio/test/test_option_xz.c | 1 - contrib/libarchive/cpio/test/test_option_y.c | 1 - contrib/libarchive/cpio/test/test_option_z.c | 1 - contrib/libarchive/cpio/test/test_option_zstd.c | 1 - contrib/libarchive/cpio/test/test_owner_parse.c | 1 - .../libarchive/cpio/test/test_passthrough_dotdot.c | 1 - .../cpio/test/test_passthrough_reverse.c | 1 - contrib/libarchive/libarchive/archive.h | 10 +- contrib/libarchive/libarchive/archive_acl.c | 1 - .../libarchive/libarchive/archive_acl_private.h | 2 - .../libarchive/libarchive/archive_check_magic.c | 20 +- contrib/libarchive/libarchive/archive_cmdline.c | 2 - .../libarchive/archive_cmdline_private.h | 2 - contrib/libarchive/libarchive/archive_crc32.h | 2 - contrib/libarchive/libarchive/archive_cryptor.c | 4 +- contrib/libarchive/libarchive/archive_digest.c | 2 +- contrib/libarchive/libarchive/archive_endian.h | 2 - contrib/libarchive/libarchive/archive_entry.3 | 2 - contrib/libarchive/libarchive/archive_entry.c | 30 +- contrib/libarchive/libarchive/archive_entry.h | 8 +- .../libarchive/archive_entry_copy_stat.c | 1 - .../libarchive/archive_entry_link_resolver.c | 1 - .../libarchive/libarchive/archive_entry_locale.h | 2 - .../libarchive/libarchive/archive_entry_private.h | 6 +- .../libarchive/libarchive/archive_entry_sparse.c | 1 - contrib/libarchive/libarchive/archive_entry_stat.c | 1 - .../libarchive/libarchive/archive_entry_strmode.c | 1 - contrib/libarchive/libarchive/archive_entry_time.3 | 2 - .../libarchive/libarchive/archive_entry_xattr.c | 1 - contrib/libarchive/libarchive/archive_getdate.c | 4 - contrib/libarchive/libarchive/archive_getdate.h | 2 - contrib/libarchive/libarchive/archive_match.c | 1 - contrib/libarchive/libarchive/archive_options.c | 1 - .../libarchive/archive_options_private.h | 2 - contrib/libarchive/libarchive/archive_pack_dev.c | 7 - contrib/libarchive/libarchive/archive_pathmatch.c | 1 - contrib/libarchive/libarchive/archive_pathmatch.h | 2 - contrib/libarchive/libarchive/archive_platform.h | 15 - .../libarchive/libarchive/archive_platform_acl.h | 2 - .../libarchive/libarchive/archive_platform_xattr.h | 2 - contrib/libarchive/libarchive/archive_private.h | 12 +- contrib/libarchive/libarchive/archive_random.c | 3 +- contrib/libarchive/libarchive/archive_read.3 | 2 - contrib/libarchive/libarchive/archive_read.c | 1 - .../libarchive/archive_read_add_passphrase.3 | 2 - .../libarchive/archive_read_add_passphrase.c | 1 - .../libarchive/archive_read_append_filter.c | 1 - contrib/libarchive/libarchive/archive_read_data.3 | 2 - .../libarchive/archive_read_data_into_fd.c | 1 - contrib/libarchive/libarchive/archive_read_disk.3 | 2 - .../libarchive/archive_read_disk_entry_from_file.c | 1 - .../libarchive/archive_read_disk_posix.c | 1 - .../libarchive/archive_read_disk_private.h | 2 - .../archive_read_disk_set_standard_lookup.c | 1 - .../libarchive/libarchive/archive_read_extract.3 | 2 - .../libarchive/libarchive/archive_read_extract.c | 1 - .../libarchive/libarchive/archive_read_extract2.c | 1 - .../libarchive/libarchive/archive_read_filter.3 | 2 - .../libarchive/libarchive/archive_read_format.3 | 2 - contrib/libarchive/libarchive/archive_read_free.3 | 2 - .../libarchive/libarchive/archive_read_header.3 | 2 - contrib/libarchive/libarchive/archive_read_new.3 | 2 - contrib/libarchive/libarchive/archive_read_open.3 | 2 - .../libarchive/libarchive/archive_read_open_fd.c | 1 - .../libarchive/libarchive/archive_read_open_file.c | 1 - .../libarchive/archive_read_open_filename.c | 112 +- .../libarchive/archive_read_open_memory.c | 1 - .../libarchive/libarchive/archive_read_private.h | 2 - .../libarchive/archive_read_set_format.c | 1 - .../libarchive/archive_read_set_options.3 | 2 - .../libarchive/archive_read_set_options.c | 1 - .../libarchive/archive_read_support_filter_all.c | 1 - .../archive_read_support_filter_by_code.c | 1 - .../libarchive/archive_read_support_filter_bzip2.c | 4 +- .../archive_read_support_filter_compress.c | 3 +- .../libarchive/archive_read_support_filter_grzip.c | 3 - .../libarchive/archive_read_support_filter_gzip.c | 5 +- .../libarchive/archive_read_support_filter_lrzip.c | 3 - .../libarchive/archive_read_support_filter_lz4.c | 8 +- .../libarchive/archive_read_support_filter_lzop.c | 6 +- .../libarchive/archive_read_support_filter_none.c | 1 - .../archive_read_support_filter_program.c | 1 - .../libarchive/archive_read_support_filter_rpm.c | 2 +- .../libarchive/archive_read_support_filter_uu.c | 53 +- .../libarchive/archive_read_support_filter_xz.c | 20 +- .../libarchive/archive_read_support_filter_zstd.c | 4 +- .../libarchive/archive_read_support_format_7zip.c | 83 +- .../libarchive/archive_read_support_format_all.c | 1 - .../libarchive/archive_read_support_format_ar.c | 1 - .../archive_read_support_format_by_code.c | 1 - .../libarchive/archive_read_support_format_cpio.c | 1 - .../libarchive/archive_read_support_format_empty.c | 1 - .../archive_read_support_format_iso9660.c | 6 +- .../libarchive/archive_read_support_format_mtree.c | 1 - .../libarchive/archive_read_support_format_rar.c | 2 +- .../libarchive/archive_read_support_format_rar5.c | 12 +- .../libarchive/archive_read_support_format_raw.c | 1 - .../libarchive/archive_read_support_format_tar.c | 1 - .../libarchive/archive_read_support_format_warc.c | 1 - .../libarchive/archive_read_support_format_xar.c | 3 +- .../libarchive/archive_read_support_format_zip.c | 499 ++++--- contrib/libarchive/libarchive/archive_string.c | 16 +- contrib/libarchive/libarchive/archive_string.h | 3 - .../libarchive/archive_string_composition.h | 2 - .../libarchive/libarchive/archive_string_sprintf.c | 1 - contrib/libarchive/libarchive/archive_util.3 | 2 - contrib/libarchive/libarchive/archive_util.c | 1 - .../libarchive/archive_version_details.c | 1 - contrib/libarchive/libarchive/archive_virtual.c | 1 - contrib/libarchive/libarchive/archive_write.3 | 2 - contrib/libarchive/libarchive/archive_write.c | 3 +- .../libarchive/archive_write_add_filter.c | 1 - .../archive_write_add_filter_b64encode.c | 2 - .../libarchive/archive_write_add_filter_by_name.c | 1 - .../libarchive/archive_write_add_filter_bzip2.c | 2 - .../libarchive/archive_write_add_filter_compress.c | 2 - .../libarchive/archive_write_add_filter_grzip.c | 2 - .../libarchive/archive_write_add_filter_gzip.c | 2 - .../libarchive/archive_write_add_filter_lrzip.c | 2 - .../libarchive/archive_write_add_filter_lz4.c | 2 - .../libarchive/archive_write_add_filter_lzop.c | 1 - .../libarchive/archive_write_add_filter_none.c | 1 - .../libarchive/archive_write_add_filter_program.c | 1 - .../libarchive/archive_write_add_filter_uuencode.c | 2 - .../libarchive/archive_write_add_filter_xz.c | 2 - .../libarchive/archive_write_add_filter_zstd.c | 149 +- .../libarchive/archive_write_blocksize.3 | 2 - contrib/libarchive/libarchive/archive_write_data.3 | 2 - contrib/libarchive/libarchive/archive_write_disk.3 | 2 - .../libarchive/archive_write_disk_posix.c | 1 - .../libarchive/archive_write_disk_private.h | 2 - .../archive_write_disk_set_standard_lookup.c | 1 - .../libarchive/libarchive/archive_write_filter.3 | 2 - .../libarchive/archive_write_finish_entry.3 | 2 - .../libarchive/libarchive/archive_write_format.3 | 2 - contrib/libarchive/libarchive/archive_write_free.3 | 2 - .../libarchive/libarchive/archive_write_header.3 | 2 - contrib/libarchive/libarchive/archive_write_new.3 | 2 - contrib/libarchive/libarchive/archive_write_open.3 | 2 - .../libarchive/libarchive/archive_write_open_fd.c | 1 - .../libarchive/archive_write_open_file.c | 1 - .../libarchive/archive_write_open_filename.c | 1 - .../libarchive/archive_write_open_memory.c | 1 - .../libarchive/libarchive/archive_write_private.h | 2 - .../libarchive/archive_write_set_format.c | 1 - .../libarchive/archive_write_set_format_7zip.c | 34 +- .../libarchive/archive_write_set_format_ar.c | 1 - .../libarchive/archive_write_set_format_by_name.c | 1 - .../archive_write_set_format_cpio_binary.c | 1 - .../archive_write_set_format_cpio_newc.c | 1 - .../libarchive/archive_write_set_format_cpio_odc.c | 1 - .../archive_write_set_format_filter_by_ext.c | 1 - .../libarchive/archive_write_set_format_gnutar.c | 2 - .../libarchive/archive_write_set_format_mtree.c | 1 - .../libarchive/archive_write_set_format_pax.c | 1 - .../libarchive/archive_write_set_format_private.h | 2 - .../libarchive/archive_write_set_format_shar.c | 1 - .../libarchive/archive_write_set_format_ustar.c | 2 - .../libarchive/archive_write_set_format_v7tar.c | 2 - .../libarchive/archive_write_set_format_warc.c | 1 - .../libarchive/archive_write_set_format_xar.c | 1 - .../libarchive/archive_write_set_format_zip.c | 189 ++- .../libarchive/archive_write_set_options.3 | 20 +- .../libarchive/archive_write_set_options.c | 1 - .../libarchive/archive_write_set_passphrase.3 | 2 - .../libarchive/archive_write_set_passphrase.c | 1 - contrib/libarchive/libarchive/cpio.5 | 2 - contrib/libarchive/libarchive/filter_fork.h | 2 - contrib/libarchive/libarchive/filter_fork_posix.c | 2 - contrib/libarchive/libarchive/libarchive-formats.5 | 2 - contrib/libarchive/libarchive/libarchive.3 | 2 - contrib/libarchive/libarchive/libarchive_changes.3 | 2 - .../libarchive/libarchive/libarchive_internals.3 | 2 - contrib/libarchive/libarchive/tar.5 | 2 - contrib/libarchive/libarchive/test/README | 2 - .../libarchive/libarchive/test/read_open_memory.c | 1 - contrib/libarchive/libarchive/test/test_acl_nfs4.c | 1 - contrib/libarchive/libarchive/test/test_acl_pax.c | 1 - .../libarchive/test/test_acl_platform_nfs4.c | 1 - .../libarchive/test/test_acl_platform_posix1e.c | 1 - .../libarchive/libarchive/test/test_acl_posix1e.c | 1 - contrib/libarchive/libarchive/test/test_acl_text.c | 1 - .../libarchive/test/test_archive_api_feature.c | 1 - .../libarchive/test/test_archive_clear_error.c | 1 - .../libarchive/test/test_archive_cmdline.c | 1 - .../libarchive/test/test_archive_getdate.c | 1 - .../libarchive/test/test_archive_match_owner.c | 1 - .../libarchive/test/test_archive_match_path.c | 1 - .../libarchive/test/test_archive_match_time.c | 1 - .../libarchive/test/test_archive_pathmatch.c | 1 - .../test/test_archive_read_add_passphrase.c | 1 - .../test/test_archive_read_close_twice.c | 2 - .../test/test_archive_read_close_twice_open_fd.c | 1 - .../test_archive_read_close_twice_open_filename.c | 1 - .../test/test_archive_read_multiple_data_objects.c | 5 +- .../test/test_archive_read_next_header_empty.c | 1 - .../test/test_archive_read_next_header_raw.c | 1 - .../libarchive/test/test_archive_read_open2.c | 1 - .../test/test_archive_read_set_filter_option.c | 1 - .../test/test_archive_read_set_format_option.c | 1 - .../libarchive/test/test_archive_read_set_option.c | 1 - .../test/test_archive_read_set_options.c | 1 - .../libarchive/test/test_archive_read_support.c | 1 - .../libarchive/test/test_archive_set_error.c | 1 - .../libarchive/test/test_archive_string.c | 3 +- .../test/test_archive_string_conversion.c | 4 +- .../test/test_archive_string_conversion.txt.Z.uu | 1 - .../test/test_archive_write_add_filter_by_name.c | 4 +- .../test/test_archive_write_set_filter_option.c | 1 - .../test/test_archive_write_set_format_by_name.c | 2 - .../test_archive_write_set_format_filter_by_ext.c | 2 - .../test/test_archive_write_set_format_option.c | 1 - .../test/test_archive_write_set_option.c | 1 - .../test/test_archive_write_set_options.c | 1 - .../test/test_archive_write_set_passphrase.c | 1 - contrib/libarchive/libarchive/test/test_bad_fd.c | 1 - .../libarchive/libarchive/test/test_compat_bzip2.c | 1 - .../libarchive/test/test_compat_bzip2_1.tbz.uu | 2 - .../libarchive/test/test_compat_bzip2_2.tbz.uu | 2 - .../libarchive/libarchive/test/test_compat_cpio.c | 1 - .../libarchive/test/test_compat_cpio_1.cpio.uu | 2 - .../libarchive/libarchive/test/test_compat_gtar.c | 1 - .../libarchive/test/test_compat_gtar_1.tar.uu | 1 - .../libarchive/test/test_compat_gtar_2.tar.uu | 2 +- .../libarchive/libarchive/test/test_compat_gzip.c | 1 - .../libarchive/test/test_compat_gzip_1.tgz.uu | 2 - .../libarchive/test/test_compat_gzip_2.tgz.uu | 2 - .../libarchive/libarchive/test/test_compat_lz4.c | 1 - .../libarchive/libarchive/test/test_compat_lzip.c | 85 +- .../libarchive/test/test_compat_lzip_3.lz.uu | 1461 +++++++++++++++++++ .../libarchive/test/test_compat_lzip_4.tlz.uu | 1474 ++++++++++++++++++++ .../libarchive/libarchive/test/test_compat_lzma.c | 1 - .../libarchive/test/test_compat_lzma_1.tlz.uu | 2 - .../libarchive/test/test_compat_lzma_2.tlz.uu | 2 - .../libarchive/test/test_compat_lzma_3.tlz.uu | 2 - .../libarchive/libarchive/test/test_compat_lzop.c | 1 - .../libarchive/libarchive/test/test_compat_mac.c | 1 - .../libarchive/test/test_compat_perl_archive_tar.c | 1 - .../test/test_compat_plexus_archiver_tar.c | 1 - .../test/test_compat_solaris_pax_sparse.c | 2 - .../libarchive/test/test_compat_solaris_tar_acl.c | 1 - .../libarchive/test/test_compat_star_acl.c | 1 - .../libarchive/test/test_compat_tar_directory.c | 1 - .../test/test_compat_tar_directory_1.tar.uu | 1 - .../libarchive/test/test_compat_tar_hardlink.c | 1 - .../test/test_compat_tar_hardlink_1.tar.uu | 1 - .../libarchive/test/test_compat_uudecode.c | 1 - .../libarchive/test/test_compat_uudecode_large.c | 1 - .../libarchive/libarchive/test/test_compat_xz.c | 1 - .../libarchive/test/test_compat_xz_1.txz.uu | 3 +- .../libarchive/libarchive/test/test_compat_zip.c | 1 - .../libarchive/test/test_compat_zip_1.zip.uu | 1 - .../libarchive/test/test_compat_zip_8.zip.uu | 12 +- .../libarchive/libarchive/test/test_compat_zstd.c | 2 - .../libarchive/libarchive/test/test_empty_write.c | 1 - contrib/libarchive/libarchive/test/test_entry.c | 1 - .../libarchive/test/test_entry_strmode.c | 1 - .../libarchive/test/test_extattr_freebsd.c | 1 - .../libarchive/libarchive/test/test_filter_count.c | 1 - contrib/libarchive/libarchive/test/test_fuzz.c | 1 - .../libarchive/test/test_fuzz_1.iso.Z.uu | 2 - .../test/test_gnutar_filename_encoding.c | 2 - .../libarchive/test/test_link_resolver.c | 1 - .../libarchive/libarchive/test/test_open_failure.c | 1 - contrib/libarchive/libarchive/test/test_open_fd.c | 1 - .../libarchive/libarchive/test/test_open_file.c | 1 - .../libarchive/test/test_open_filename.c | 1 - .../libarchive/test/test_pax_filename_encoding.c | 1 - .../test/test_pax_filename_encoding.tar.uu | 1 - .../libarchive/test/test_pax_xattr_header.c | 1 - .../test_rar_multivolume_single_file.part1.rar.uu | 2 +- .../test_rar_multivolume_single_file.part2.rar.uu | 2 +- .../test_rar_multivolume_single_file.part3.rar.uu | 2 +- ...ar_multivolume_uncompressed_files.part01.rar.uu | 2 +- ...ar_multivolume_uncompressed_files.part02.rar.uu | 2 +- ...ar_multivolume_uncompressed_files.part03.rar.uu | 2 +- ...ar_multivolume_uncompressed_files.part04.rar.uu | 2 +- ...ar_multivolume_uncompressed_files.part05.rar.uu | 2 +- ...ar_multivolume_uncompressed_files.part06.rar.uu | 2 +- ...ar_multivolume_uncompressed_files.part07.rar.uu | 2 +- ...ar_multivolume_uncompressed_files.part08.rar.uu | 2 +- ...ar_multivolume_uncompressed_files.part09.rar.uu | 2 +- ...ar_multivolume_uncompressed_files.part10.rar.uu | 2 +- .../libarchive/test/test_read_data_large.c | 1 - .../libarchive/libarchive/test/test_read_disk.c | 1 - .../test/test_read_disk_directory_traversals.c | 1 - .../test/test_read_disk_entry_from_file.c | 1 - .../libarchive/libarchive/test/test_read_extract.c | 1 - .../libarchive/test/test_read_file_nonexistent.c | 1 - .../test/test_read_filter_lrzip.tar.lrz.uu | 2 +- .../libarchive/test/test_read_filter_program.c | 1 - .../test/test_read_filter_program_signature.c | 1 - .../libarchive/test/test_read_filter_uudecode.c | 1 - .../test/test_read_filter_uudecode_base64_raw.uu | 11 + .../test/test_read_filter_uudecode_raw.c | 67 + .../test/test_read_filter_uudecode_raw.uu | 14 + .../libarchive/test/test_read_format_7zip.c | 81 +- .../test/test_read_format_7zip_copy.7z.uu | 2 +- .../test/test_read_format_7zip_deflate_arm64.7z.uu | 2 +- .../test/test_read_format_7zip_encryption_data.c | 1 - .../test/test_read_format_7zip_encryption_header.c | 2 - .../test_read_format_7zip_encryption_partially.c | 1 - .../test/test_read_format_7zip_lzma2_arm64.7z.uu | 2 +- .../test/test_read_format_7zip_malformed.c | 1 - .../test/test_read_format_7zip_packinfo_digests.c | 5 +- .../test/test_read_format_7zip_win_attrib.7z.uu | 10 + .../libarchive/test/test_read_format_ar.ar.uu | 2 - .../libarchive/test/test_read_format_ar.c | 2 - .../libarchive/test/test_read_format_cab.c | 1 - .../test/test_read_format_cab_filename.c | 1 - .../test_read_format_cab_filename_cp932.cab.uu | 2 +- .../libarchive/test/test_read_format_cpio_afio.c | 1 - .../libarchive/test/test_read_format_cpio_bin.c | 1 - .../libarchive/test/test_read_format_cpio_bin_Z.c | 1 - .../libarchive/test/test_read_format_cpio_bin_be.c | 1 - .../test/test_read_format_cpio_bin_be.cpio.uu | 1 - .../test/test_read_format_cpio_bin_bz2.c | 1 - .../libarchive/test/test_read_format_cpio_bin_gz.c | 1 - .../libarchive/test/test_read_format_cpio_bin_le.c | 1 - .../test/test_read_format_cpio_bin_lzip.c | 1 - .../test/test_read_format_cpio_bin_lzma.c | 1 - .../libarchive/test/test_read_format_cpio_bin_xz.c | 1 - .../test/test_read_format_cpio_filename.c | 13 +- .../test_read_format_cpio_filename_cp866.cpio.uu | 2 +- .../test_read_format_cpio_filename_eucjp.cpio.uu | 2 +- .../test_read_format_cpio_filename_koi8r.cpio.uu | 2 +- .../test_read_format_cpio_filename_utf8_jp.cpio.uu | 2 +- .../test_read_format_cpio_filename_utf8_ru.cpio.uu | 2 +- .../libarchive/test/test_read_format_cpio_odc.c | 1 - .../test/test_read_format_cpio_svr4_gzip.c | 1 - .../test/test_read_format_cpio_svr4c_Z.c | 1 - .../libarchive/test/test_read_format_empty.c | 1 - .../test/test_read_format_gtar_filename.c | 1 - .../test_read_format_gtar_filename_cp866.tar.Z.uu | 2 +- .../test_read_format_gtar_filename_eucjp.tar.Z.uu | 2 +- .../test_read_format_gtar_filename_koi8r.tar.Z.uu | 2 +- .../libarchive/test/test_read_format_gtar_gz.c | 1 - .../libarchive/test/test_read_format_gtar_lzma.c | 1 - .../libarchive/test/test_read_format_gtar_sparse.c | 2 - .../test/test_read_format_gtar_sparse_1_13.tar.uu | 1 - .../test/test_read_format_gtar_sparse_1_17.tar.uu | 1 - ...est_read_format_gtar_sparse_1_17_posix00.tar.uu | 1 - ...est_read_format_gtar_sparse_1_17_posix01.tar.uu | 1 - ...est_read_format_gtar_sparse_1_17_posix10.tar.uu | 1 - ...format_gtar_sparse_1_17_posix10_modified.tar.uu | 1 - .../test/test_read_format_gtar_sparse_skip_entry.c | 1 - ...est_read_format_gtar_sparse_skip_entry.tar.Z.uu | 2 +- .../libarchive/test/test_read_format_iso.iso.Z.uu | 2 - .../libarchive/test/test_read_format_iso_Z.c | 1 - .../test/test_read_format_iso_joliet.iso.Z.uu | 2 - .../test/test_read_format_iso_joliet_long.iso.Z.uu | 2 - .../test_read_format_iso_joliet_rockridge.iso.Z.uu | 2 - .../test/test_read_format_iso_multi_extent.c | 1 - .../test_read_format_iso_multi_extent.iso.Z.uu | 2 - .../test/test_read_format_iso_rockridge.iso.Z.uu | 2 - .../test_read_format_iso_rockridge_ce.iso.Z.uu | 2 - .../test_read_format_iso_rockridge_new.iso.Z.uu | 2 - ...est_read_format_iso_rockridge_rr_moved.iso.Z.uu | 2 - .../libarchive/test/test_read_format_iso_xorriso.c | 2 - .../test/test_read_format_iso_zisofs.iso.Z.uu | 2 - .../test/test_read_format_isojoliet_bz2.c | 1 - .../test/test_read_format_isojoliet_long.c | 7 +- .../test/test_read_format_isojoliet_rr.c | 1 - .../test/test_read_format_isojoliet_versioned.c | 1 - .../libarchive/test/test_read_format_isorr_bz2.c | 1 - .../libarchive/test/test_read_format_isorr_ce.c | 1 - .../test/test_read_format_isorr_new_bz2.c | 2 - .../test/test_read_format_isorr_rr_moved.c | 1 - .../test/test_read_format_isozisofs_bz2.c | 1 - .../libarchive/test/test_read_format_lha.c | 1 - .../test/test_read_format_lha_bugfix_0.c | 1 - .../test/test_read_format_lha_filename.c | 1 - .../test_read_format_lha_filename_cp932.lzh.uu | 2 +- .../test/test_read_format_lha_filename_utf16.c | 1 - .../test_read_format_lha_filename_utf16.lzh.uu | 38 +- .../libarchive/test/test_read_format_mtree.c | 1 - .../libarchive/test/test_read_format_pax_bz2.c | 1 - .../libarchive/test/test_read_format_rar.c | 85 +- .../libarchive/test/test_read_format_rar.rar.uu | 2 +- .../libarchive/test/test_read_format_rar5.c | 30 + ...format_rar5_bad_window_sz_in_mltarc_file.rar.uu | 2 +- .../test/test_read_format_rar5_compressed.rar.uu | 2 +- ...d_format_rar5_different_winsize_on_merge.rar.uu | 2 +- ...est_read_format_rar5_multiarchive.part01.rar.uu | 2 +- ...est_read_format_rar5_multiarchive.part02.rar.uu | 2 +- ...est_read_format_rar5_multiarchive.part03.rar.uu | 2 +- ...est_read_format_rar5_multiarchive.part04.rar.uu | 2 +- ...est_read_format_rar5_multiarchive.part05.rar.uu | 2 +- ...est_read_format_rar5_multiarchive.part06.rar.uu | 2 +- ...est_read_format_rar5_multiarchive.part07.rar.uu | 2 +- ...est_read_format_rar5_multiarchive.part08.rar.uu | 2 +- .../test_read_format_rar5_multiple_files.rar.uu | 2 +- ...st_read_format_rar5_multiple_files_solid.rar.uu | 2 +- .../test/test_read_format_rar5_sfx.exe.uu | 2 +- .../test/test_read_format_rar5_stored.rar.uu | 2 +- .../test/test_read_format_rar5_unicode.rar.uu | 9 + .../test/test_read_format_rar_binary_data.rar.uu | 2 +- .../test/test_read_format_rar_compress_best.rar.uu | 2 +- .../test_read_format_rar_compress_normal.rar.uu | 2 +- .../test/test_read_format_rar_encryption_data.c | 1 - .../test/test_read_format_rar_encryption_header.c | 1 - .../test_read_format_rar_encryption_partially.c | 1 - .../libarchive/test/test_read_format_rar_filter.c | 1 - .../test/test_read_format_rar_invalid1.c | 1 - .../test_read_format_rar_multi_lzss_blocks.rar.uu | 2 +- ...est_read_format_rar_multivolume.part0001.rar.uu | 2 +- ...est_read_format_rar_multivolume.part0002.rar.uu | 2 +- ...est_read_format_rar_multivolume.part0003.rar.uu | 2 +- ...est_read_format_rar_multivolume.part0004.rar.uu | 2 +- .../test/test_read_format_rar_noeof.rar.uu | 2 +- ...est_read_format_rar_ppmd_lzss_conversion.rar.uu | 2 +- .../test/test_read_format_rar_sfx.exe.uu | 2 +- .../test/test_read_format_rar_subblock.rar.uu | 2 +- .../test/test_read_format_rar_windows.rar.uu | 2 +- .../libarchive/test/test_read_format_raw.bufr.uu | 2 +- .../libarchive/test/test_read_format_raw.c | 1 - .../libarchive/test/test_read_format_raw.data.Z.uu | 1 - .../libarchive/test/test_read_format_raw.data.uu | 1 - .../libarchive/test/test_read_format_tar.c | 1 - .../test/test_read_format_tar_concatenated.c | 1 - .../test/test_read_format_tar_empty_filename.c | 1 - .../test_read_format_tar_empty_filename.tar.uu | 3 +- .../test/test_read_format_tar_empty_pax.c | 1 - .../test/test_read_format_tar_empty_pax.tar.Z.uu | 2 +- .../test_read_format_tar_empty_with_gnulabel.c | 1 - .../test/test_read_format_tar_filename.c | 1 - .../test/test_read_format_tar_invalid_pax_size.c | 1 - .../test_read_format_tar_invalid_pax_size.tar.uu | 2 +- .../libarchive/test/test_read_format_tbz.c | 1 - .../libarchive/test/test_read_format_tgz.c | 1 - .../libarchive/test/test_read_format_tlz.c | 1 - .../libarchive/test/test_read_format_txz.c | 1 - .../libarchive/test/test_read_format_tz.c | 1 - .../test/test_read_format_ustar_filename.c | 1 - .../libarchive/test/test_read_format_warc.c | 2 - .../libarchive/test/test_read_format_xar.c | 1 - .../libarchive/test/test_read_format_zip.c | 3 +- .../test/test_read_format_zip_7075_utf8_paths.c | 1 - .../test/test_read_format_zip_bzip2.zipx.uu | 2 +- .../test/test_read_format_zip_comment_stored.c | 1 - .../test/test_read_format_zip_encryption_data.c | 1 - .../test/test_read_format_zip_encryption_header.c | 1 - .../test_read_format_zip_encryption_partially.c | 1 - .../test/test_read_format_zip_filename.c | 7 +- .../test_read_format_zip_filename_cp866.zip.uu | 2 +- .../test_read_format_zip_filename_cp932.zip.uu | 2 +- .../test_read_format_zip_filename_koi8r.zip.uu | 2 +- .../test_read_format_zip_filename_utf8_jp.zip.uu | 2 +- .../test_read_format_zip_filename_utf8_ru.zip.uu | 2 +- .../test_read_format_zip_filename_utf8_ru2.zip.uu | 2 +- .../test/test_read_format_zip_high_compression.c | 2 - .../libarchive/test/test_read_format_zip_jar.c | 1 - .../test/test_read_format_zip_lzma.zipx.uu | 2 +- .../test/test_read_format_zip_mac_metadata.c | 1 - .../test/test_read_format_zip_malformed.c | 1 - .../libarchive/test/test_read_format_zip_nested.c | 3 +- .../test/test_read_format_zip_nofiletype.c | 1 - .../libarchive/test/test_read_format_zip_padded.c | 1 - .../test/test_read_format_zip_ppmd8.zipx.uu | 2 +- .../libarchive/test/test_read_format_zip_sfx.c | 1 - ...t_read_format_zip_traditional_encryption_data.c | 1 - .../test/test_read_format_zip_winzip_aes.c | 1 - .../test/test_read_format_zip_winzip_aes128.zip.uu | 2 +- .../test/test_read_format_zip_winzip_aes256.zip.uu | 2 +- ...est_read_format_zip_winzip_aes256_stored.zip.uu | 2 +- .../test/test_read_format_zip_winzip_aes_large.c | 1 - ...read_format_zip_with_invalid_traditional_eocd.c | 2 - ...format_zip_with_invalid_traditional_eocd.zip.uu | 2 +- .../libarchive/test/test_read_format_zip_zip64.c | 1 - .../libarchive/libarchive/test/test_read_large.c | 1 - .../test/test_read_large_splitted_rar_aa.uu | 2 +- .../test/test_read_large_splitted_rar_ab.uu | 2 +- .../test/test_read_large_splitted_rar_ac.uu | 2 +- .../test/test_read_large_splitted_rar_ad.uu | 2 +- .../test/test_read_large_splitted_rar_ae.uu | 2 +- .../libarchive/test/test_read_pax_truncated.c | 1 - .../test/test_read_pax_xattr_schily.tar.uu | 2 +- .../libarchive/test/test_read_position.c | 1 - .../libarchive/test/test_read_splitted_rar_aa.uu | 2 +- .../libarchive/test/test_read_splitted_rar_ab.uu | 2 +- .../libarchive/test/test_read_splitted_rar_ac.uu | 2 +- .../libarchive/test/test_read_splitted_rar_ad.uu | 2 +- .../libarchive/test/test_read_truncated.c | 1 - .../libarchive/test/test_read_truncated_filter.c | 1 - .../libarchive/libarchive/test/test_sparse_basic.c | 3 +- .../test/test_splitted_rar_seek_support_aa.uu | 2 +- .../test/test_splitted_rar_seek_support_ab.uu | 2 +- .../test/test_splitted_rar_seek_support_ac.uu | 2 +- .../libarchive/test/test_tar_filenames.c | 1 - .../libarchive/libarchive/test/test_tar_large.c | 1 - .../libarchive/test/test_ustar_filename_encoding.c | 1 - .../libarchive/test/test_ustar_filenames.c | 1 - .../libarchive/libarchive/test/test_write_disk.c | 1 - .../libarchive/test/test_write_disk_appledouble.c | 1 - .../libarchive/test/test_write_disk_failures.c | 1 - .../libarchive/test/test_write_disk_hardlink.c | 1 - .../test/test_write_disk_hfs_compression.c | 1 - .../libarchive/test/test_write_disk_lookup.c | 1 - .../libarchive/test/test_write_disk_mac_metadata.c | 1 - .../test/test_write_disk_no_hfs_compression.c | 1 - .../libarchive/test/test_write_disk_perms.c | 1 - .../libarchive/test/test_write_disk_secure.c | 1 - .../libarchive/test/test_write_disk_secure744.c | 1 - .../libarchive/test/test_write_disk_secure745.c | 1 - .../libarchive/test/test_write_disk_secure746.c | 1 - .../libarchive/test/test_write_disk_sparse.c | 1 - .../libarchive/test/test_write_disk_symlink.c | 1 - .../libarchive/test/test_write_disk_times.c | 1 - .../libarchive/test/test_write_filter_b64encode.c | 1 - .../libarchive/test/test_write_filter_bzip2.c | 1 - .../libarchive/test/test_write_filter_compress.c | 1 - .../libarchive/test/test_write_filter_gzip.c | 1 - .../test/test_write_filter_gzip_timestamp.c | 1 - .../libarchive/test/test_write_filter_lz4.c | 5 +- .../libarchive/test/test_write_filter_lzip.c | 1 - .../libarchive/test/test_write_filter_lzma.c | 1 - .../libarchive/test/test_write_filter_lzop.c | 4 +- .../libarchive/test/test_write_filter_program.c | 1 - .../libarchive/test/test_write_filter_uuencode.c | 1 - .../libarchive/test/test_write_filter_xz.c | 1 - .../libarchive/test/test_write_filter_zstd.c | 107 +- .../libarchive/test/test_write_format_7zip.c | 1 - .../libarchive/test/test_write_format_7zip_empty.c | 1 - .../libarchive/test/test_write_format_7zip_large.c | 1 - .../libarchive/test/test_write_format_ar.c | 1 - .../libarchive/test/test_write_format_cpio.c | 1 - .../libarchive/test/test_write_format_cpio_empty.c | 1 - .../libarchive/test/test_write_format_cpio_newc.c | 2 - .../libarchive/test/test_write_format_cpio_odc.c | 2 - .../libarchive/test/test_write_format_gnutar.c | 1 - .../test/test_write_format_gnutar_filenames.c | 1 - .../libarchive/test/test_write_format_iso9660.c | 21 +- .../libarchive/test/test_write_format_mtree.c | 1 - .../test/test_write_format_mtree_absolute_path.c | 1 - .../test/test_write_format_mtree_classic.c | 1 - .../test/test_write_format_mtree_classic_indent.c | 1 - .../test/test_write_format_mtree_fflags.c | 2 +- .../test/test_write_format_mtree_no_separator.c | 2 +- .../test/test_write_format_mtree_quoted_filename.c | 1 - .../libarchive/test/test_write_format_pax.c | 1 - .../libarchive/test/test_write_format_shar_empty.c | 1 - .../libarchive/test/test_write_format_tar.c | 1 - .../libarchive/test/test_write_format_tar_empty.c | 1 - .../libarchive/test/test_write_format_tar_sparse.c | 1 - .../libarchive/test/test_write_format_tar_ustar.c | 1 - .../libarchive/test/test_write_format_tar_v7tar.c | 1 - .../libarchive/test/test_write_format_warc.c | 1 - .../libarchive/test/test_write_format_warc_empty.c | 1 - .../libarchive/test/test_write_format_xar.c | 1 - .../libarchive/test/test_write_format_xar_empty.c | 1 - .../libarchive/test/test_write_format_zip.c | 50 +- .../test/test_write_format_zip64_stream.c | 276 ++++ .../test/test_write_format_zip_compression_store.c | 66 +- .../libarchive/test/test_write_format_zip_empty.c | 1 - .../test/test_write_format_zip_empty_zip64.c | 1 - .../test/test_write_format_zip_entry_size_unset.c | 13 +- .../libarchive/test/test_write_format_zip_file.c | 43 +- .../test/test_write_format_zip_file_zip64.c | 47 +- .../libarchive/test/test_write_format_zip_large.c | 31 +- .../libarchive/test/test_write_format_zip_stream.c | 247 ++++ .../libarchive/test/test_write_format_zip_zip64.c | 1 - .../libarchive/test/test_write_open_memory.c | 1 - .../libarchive/test/test_write_read_format_zip.c | 56 +- .../libarchive/test/test_xattr_platform.c | 1 - .../libarchive/test/test_zip_filename_encoding.c | 4 +- contrib/libarchive/libarchive_fe/err.c | 2 - contrib/libarchive/libarchive_fe/err.h | 11 +- contrib/libarchive/libarchive_fe/lafe_platform.h | 12 - contrib/libarchive/libarchive_fe/line_reader.c | 2 - contrib/libarchive/libarchive_fe/passphrase.c | 4 +- contrib/libarchive/tar/bsdtar.1 | 77 +- contrib/libarchive/tar/bsdtar.c | 82 +- contrib/libarchive/tar/bsdtar.h | 8 +- contrib/libarchive/tar/bsdtar_platform.h | 24 +- contrib/libarchive/tar/cmdline.c | 3 +- contrib/libarchive/tar/creation_set.c | 1 - contrib/libarchive/tar/read.c | 1 - contrib/libarchive/tar/subst.c | 28 +- contrib/libarchive/tar/test/test.h | 2 - contrib/libarchive/tar/test/test_0.c | 1 - contrib/libarchive/tar/test/test_basic.c | 1 - contrib/libarchive/tar/test/test_copy.c | 1 - contrib/libarchive/tar/test/test_empty_mtree.c | 1 - contrib/libarchive/tar/test/test_extract_tar_Z.c | 1 - contrib/libarchive/tar/test/test_extract_tar_bz2.c | 1 - contrib/libarchive/tar/test/test_extract_tar_grz.c | 1 - contrib/libarchive/tar/test/test_extract_tar_gz.c | 1 - contrib/libarchive/tar/test/test_extract_tar_lrz.c | 1 - contrib/libarchive/tar/test/test_extract_tar_lz.c | 1 - contrib/libarchive/tar/test/test_extract_tar_lz4.c | 1 - .../libarchive/tar/test/test_extract_tar_lzma.c | 1 - contrib/libarchive/tar/test/test_extract_tar_lzo.c | 1 - contrib/libarchive/tar/test/test_extract_tar_xz.c | 1 - .../libarchive/tar/test/test_extract_tar_zstd.c | 1 - contrib/libarchive/tar/test/test_format_newc.c | 1 - contrib/libarchive/tar/test/test_help.c | 1 - contrib/libarchive/tar/test/test_leading_slash.c | 1 - contrib/libarchive/tar/test/test_missing_file.c | 1 - contrib/libarchive/tar/test/test_option_C_mtree.c | 1 - contrib/libarchive/tar/test/test_option_C_upper.c | 1 - contrib/libarchive/tar/test/test_option_H_upper.c | 1 - contrib/libarchive/tar/test/test_option_L_upper.c | 1 - contrib/libarchive/tar/test/test_option_O_upper.c | 1 - contrib/libarchive/tar/test/test_option_T_upper.c | 1 - contrib/libarchive/tar/test/test_option_U_upper.c | 1 - contrib/libarchive/tar/test/test_option_X_upper.c | 1 - contrib/libarchive/tar/test/test_option_a.c | 1 - contrib/libarchive/tar/test/test_option_acls.c | 1 - contrib/libarchive/tar/test/test_option_b.c | 1 - .../libarchive/tar/test/test_option_b64encode.c | 1 - contrib/libarchive/tar/test/test_option_exclude.c | 1 - .../libarchive/tar/test/test_option_exclude_vcs.c | 2 +- contrib/libarchive/tar/test/test_option_fflags.c | 1 - .../libarchive/tar/test/test_option_gid_gname.c | 1 - contrib/libarchive/tar/test/test_option_group.c | 84 ++ contrib/libarchive/tar/test/test_option_grzip.c | 1 - .../libarchive/tar/test/test_option_ignore_zeros.c | 1 - contrib/libarchive/tar/test/test_option_j.c | 1 - contrib/libarchive/tar/test/test_option_k.c | 1 - .../tar/test/test_option_keep_newer_files.c | 1 - contrib/libarchive/tar/test/test_option_lrzip.c | 1 - contrib/libarchive/tar/test/test_option_lz4.c | 1 - contrib/libarchive/tar/test/test_option_lzma.c | 1 - contrib/libarchive/tar/test/test_option_lzop.c | 1 - contrib/libarchive/tar/test/test_option_n.c | 1 - .../libarchive/tar/test/test_option_newer_than.c | 1 - contrib/libarchive/tar/test/test_option_nodump.c | 1 - .../libarchive/tar/test/test_option_older_than.c | 1 - contrib/libarchive/tar/test/test_option_owner.c | 84 ++ .../libarchive/tar/test/test_option_passphrase.c | 1 - contrib/libarchive/tar/test/test_option_q.c | 1 - contrib/libarchive/tar/test/test_option_r.c | 1 - contrib/libarchive/tar/test/test_option_s.c | 12 +- .../libarchive/tar/test/test_option_safe_writes.c | 1 - .../libarchive/tar/test/test_option_uid_uname.c | 1 - contrib/libarchive/tar/test/test_option_uuencode.c | 1 - contrib/libarchive/tar/test/test_option_xattrs.c | 1 - contrib/libarchive/tar/test/test_option_xz.c | 1 - contrib/libarchive/tar/test/test_option_z.c | 1 - contrib/libarchive/tar/test/test_option_zstd.c | 1 - contrib/libarchive/tar/test/test_patterns.c | 1 - contrib/libarchive/tar/test/test_print_longpath.c | 1 - contrib/libarchive/tar/test/test_stdio.c | 1 - .../libarchive/tar/test/test_strip_components.c | 1 - contrib/libarchive/tar/test/test_symlink_dir.c | 1 - contrib/libarchive/tar/util.c | 3 +- contrib/libarchive/tar/write.c | 1 - contrib/libarchive/test_utils/test_common.h | 15 +- contrib/libarchive/test_utils/test_main.c | 18 +- contrib/libarchive/unzip/bsdunzip.1 | 2 - contrib/libarchive/unzip/bsdunzip.c | 17 +- contrib/libarchive/unzip/bsdunzip_platform.h | 24 +- contrib/libarchive/unzip/cmdline.c | 3 +- contrib/libarchive/unzip/test/test.h | 2 - contrib/libarchive/unzip/test/test_I.c | 41 + contrib/libarchive/unzip/test/test_I.zip.uu | 8 + contrib/libarchive/unzip/test/test_doubledash.c | 44 + lib/libarchive/Makefile.inc | 2 +- lib/libarchive/tests/Makefile | 7 + usr.bin/unzip/tests/Makefile | 3 + 725 files changed, 5735 insertions(+), 1735 deletions(-) diff --git a/contrib/libarchive/.editorconfig b/contrib/libarchive/.editorconfig deleted file mode 100644 index 2b797a039e97..000000000000 --- a/contrib/libarchive/.editorconfig +++ /dev/null @@ -1,18 +0,0 @@ -# To use this config on you editor, follow the instructions at: -# http://editorconfig.org - -root = true - -[*] -charset = utf-8 -indent_style = tab -insert_final_newline = true -trim_trailing_whitespace = true - -[*.sh] -indent_style = space -indent_size = 4 - -[CMakeLists.txt] -indent_style = space -indent_size = 2 diff --git a/contrib/libarchive/.github/workflows/cifuzz.yml b/contrib/libarchive/.github/workflows/cifuzz.yml deleted file mode 100644 index e5c60e4b0de2..000000000000 --- a/contrib/libarchive/.github/workflows/cifuzz.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: CIFuzz -on: [pull_request] -jobs: - Fuzzing: - runs-on: ubuntu-latest - steps: - - name: Build Fuzzers - id: build - uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master - with: - oss-fuzz-project-name: 'libarchive' - dry-run: false - - name: Run Fuzzers - uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master - with: - oss-fuzz-project-name: 'libarchive' - fuzz-seconds: 600 - dry-run: false - - name: Upload Crash - uses: actions/upload-artifact@v1 - if: failure() && steps.build.outcome == 'success' - with: - name: artifacts - path: ./out/artifacts diff --git a/contrib/libarchive/NEWS b/contrib/libarchive/NEWS index 7509c9ce5fa1..f4395fd1c979 100644 --- a/contrib/libarchive/NEWS +++ b/contrib/libarchive/NEWS @@ -1,3 +1,7 @@ +Apr 08, 2024: libarchive 3.7.3 released + +Sep 12, 2023: libarchive 3.7.2 released + Jul 29, 2023: libarchive 3.7.1 released Jul 18, 2023: libarchive 3.7.0 released diff --git a/contrib/libarchive/build/autoconf/m4_ax_compile_check_sizeof.m4 b/contrib/libarchive/build/autoconf/m4_ax_compile_check_sizeof.m4 deleted file mode 100644 index f834df6346c9..000000000000 --- a/contrib/libarchive/build/autoconf/m4_ax_compile_check_sizeof.m4 +++ /dev/null @@ -1,115 +0,0 @@ -# ============================================================================ -# https://www.gnu.org/software/autoconf-archive/ax_compile_check_sizeof.html -# ============================================================================ -# -# SYNOPSIS -# -# AX_COMPILE_CHECK_SIZEOF(TYPE [, HEADERS [, EXTRA_SIZES...]]) -# -# DESCRIPTION -# -# This macro checks for the size of TYPE using compile checks, not run -# checks. You can supply extra HEADERS to look into. the check will cycle -# through 1 2 4 8 16 and any EXTRA_SIZES the user supplies. If a match is -# found, it will #define SIZEOF_`TYPE' to that value. Otherwise it will -# emit a configure time error indicating the size of the type could not be -# determined. -# -# The trick is that C will not allow duplicate case labels. While this is -# valid C code: -# -# switch (0) case 0: case 1:; -# -# The following is not: -# -# switch (0) case 0: case 0:; -# -# Thus, the AC_COMPILE_IFELSE will fail if the currently tried size does -# not match. -# -# Here is an example skeleton configure.in script, demonstrating the -# macro's usage: -# -# AC_PROG_CC -# AC_CHECK_HEADERS(stddef.h unistd.h) -# AC_TYPE_SIZE_T -# AC_CHECK_TYPE(ssize_t, int) -# -# headers='#ifdef HAVE_STDDEF_H -# #include -# #endif -# #ifdef HAVE_UNISTD_H -# #include -# #endif -# ' -# -# AX_COMPILE_CHECK_SIZEOF(char) -# AX_COMPILE_CHECK_SIZEOF(short) -# AX_COMPILE_CHECK_SIZEOF(int) -# AX_COMPILE_CHECK_SIZEOF(long) -# AX_COMPILE_CHECK_SIZEOF(unsigned char *) -# AX_COMPILE_CHECK_SIZEOF(void *) -# AX_COMPILE_CHECK_SIZEOF(size_t, $headers) -# AX_COMPILE_CHECK_SIZEOF(ssize_t, $headers) -# AX_COMPILE_CHECK_SIZEOF(ptrdiff_t, $headers) -# AX_COMPILE_CHECK_SIZEOF(off_t, $headers) -# -# LICENSE -# -# Copyright (c) 2008 Kaveh Ghazi -# Copyright (c) 2017 Reini Urban -# -# This program is free software: you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the -# Free Software Foundation, either version 3 of the License, or (at your -# option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -# Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see . -# -# As a special exception, the respective Autoconf Macro's copyright owner -# gives unlimited permission to copy, distribute and modify the configure -# scripts that are the output of Autoconf when processing the Macro. You -# need not follow the terms of the GNU General Public License when using -# or distributing such scripts, even though portions of the text of the -# Macro appear in them. The GNU General Public License (GPL) does govern -# all other use of the material that constitutes the Autoconf Macro. -# -# This special exception to the GPL applies to versions of the Autoconf -# Macro released by the Autoconf Archive. When you make and distribute a -# modified version of the Autoconf Macro, you may extend this special -# exception to the GPL to apply to your modified version as well. - -#serial 8 - -AU_ALIAS([AC_COMPILE_CHECK_SIZEOF], [AX_COMPILE_CHECK_SIZEOF]) -AC_DEFUN([AX_COMPILE_CHECK_SIZEOF], -[changequote(<<, >>)dnl -dnl The name to #define. -define(<>, translit(sizeof_$1, [a-z *], [A-Z_P]))dnl -dnl The cache variable name. -define(<>, translit(ac_cv_sizeof_$1, [ *], [_p]))dnl -changequote([, ])dnl -AC_MSG_CHECKING(size of $1) -AC_CACHE_VAL(AC_CV_NAME, -[for ac_size in 4 8 1 2 16 $3 ; do # List sizes in rough order of prevalence. - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ -#include -$2 -]], [[switch (0) case 0: case (sizeof ($1) == $ac_size):;]])], [AC_CV_NAME=$ac_size]) - if test x$AC_CV_NAME != x ; then break; fi -done -]) -if test x$AC_CV_NAME = x ; then - AC_MSG_ERROR([cannot determine a size for $1]) -fi -AC_MSG_RESULT($AC_CV_NAME) -AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME, [The number of bytes in type $1]) -undefine([AC_TYPE_NAME])dnl -undefine([AC_CV_NAME])dnl -]) diff --git a/contrib/libarchive/cat/bsdcat.1 b/contrib/libarchive/cat/bsdcat.1 index 036623e4e4d6..9fa66d60e1e6 100644 --- a/contrib/libarchive/cat/bsdcat.1 +++ b/contrib/libarchive/cat/bsdcat.1 @@ -22,8 +22,6 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $FreeBSD$ -.\" .Dd March 1, 2014 .Dt BSDCAT 1 .Os diff --git a/contrib/libarchive/cat/bsdcat.c b/contrib/libarchive/cat/bsdcat.c index bdb9c40b9150..19d3de65cea4 100644 --- a/contrib/libarchive/cat/bsdcat.c +++ b/contrib/libarchive/cat/bsdcat.c @@ -24,7 +24,6 @@ */ #include "bsdcat_platform.h" -__FBSDID("$FreeBSD$"); #include #ifdef HAVE_STDLIB_H @@ -37,6 +36,9 @@ __FBSDID("$FreeBSD$"); #include #endif +#include +#include + #include "bsdcat.h" #include "err.h" *** 16950 LINES SKIPPED *** From nobody Sat May 4 12:37:43 2024 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 4VWnJ85gWBz5KVQC; Sat, 4 May 2024 12:37: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 4VWnJ82SXfz44Yq; Sat, 4 May 2024 12:37:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714826264; 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=pgb66LOUQF7uE0wUMdADCyw8VhxtKlRSIUbhE4+7gdI=; b=MsCWG/V1FXJf+rwx84Xeg0bQu/mqRRXKFaFCLWabI6pARWW9lkFPDE9iL4gRykSadRuI6g bjKsXPkyCHHMVL9PKKO5wTHJPjklkoaOZlZhTxIK6vK8OvyTgJlLWIMOAh19RordRoTs0e gJqCn40eOXdLVz+0puKC0y3A2KFSwKnvv89SFvOKDPc5UoTuhSyQ0Ey4wy6TkCuMXb3Wwc WiQRVkvd+0nZ39k9Rc+alm+czvMXqGucfNuTqYdTfI5F7iH/C7KiAdgL5mZIX6+kix30WR dc/Pc2mzokk6/wmWFY7FfhFd8JQwoaKB+tTFFmT8m7kaWuRdx7RVN9gqYfsIwg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714826264; a=rsa-sha256; cv=none; b=mWsjIPPWf2p8p9t9kCA0dXtqL0VTJnJlboeg6dGbtzHDemokMJUPn7ncIzRfhAQC/5I/io ExcqpR+yZ67b2fFFTk62dZ4RDMR2YmRkcRYOIJ6yJbNtB73j6/PEHVDFaJ0p49Z5TH5Heq TPtUROABh6UiDC4SoY7b4EzhStrq7/Ab6aJ7BPtd/O0PEigBka6/UjmayhmV4WTxwGXzZM Mld/zbeyR3gwZkAp2wKc1wJugQg1tTqnBBureobQ0wcPpFtbz7LbJ/HRZmuaJwWfhMiZiR 5v8cAeXQHD1bzfStND3vu0FGhC7OJKjKiWoPGiDL05J0zG+41B6KG1vpp/J9aA== 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=1714826264; 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=pgb66LOUQF7uE0wUMdADCyw8VhxtKlRSIUbhE4+7gdI=; b=HcEj/OZ+AYVwWgyxbGUFVmC9JyTIkhcZsXx3vFjQAy27KRXTC3yDIW35ui7PGTdJpY0Jme FSAvnHgDDzpS57wVLS1anG84NU04d2NHQt+Ha+LMI3hiz/zJ00Bcop3g+zvFqH56vMvsBq 1EUebqa12v6ArfcyEaLaw5QTK3I2mmD/vzSQhvCpAkxcNXiVTciR/G5zHC/faa6kzqso5N GfsR2kS1FOUKUTPcug+ao4gn60mZCrRW5BQkY/uTcUU2yYr3nVZodOPRxHuX/jYg7aJae5 OPaHdUihyXVccyEgzNxF9Qa+IKqyGeErYe0ZFuR7hPZ9RtY8D5cA1RXWQ2palg== 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 4VWnJ72qbqzVx0; Sat, 4 May 2024 12:37: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 444Cbhcj072669; Sat, 4 May 2024 12:37:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 444CbhdS072666; Sat, 4 May 2024 12:37:43 GMT (envelope-from git) Date: Sat, 4 May 2024 12:37:43 GMT Message-Id: <202405041237.444CbhdS072666@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Martin Matuska Subject: git: 3a77c21a25e1 - stable/13 - libarchive: merge from vendor branch List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3a77c21a25e12fd60cc6093c74d4ad1a7f247319 Auto-Submitted: auto-generated The branch stable/13 has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=3a77c21a25e12fd60cc6093c74d4ad1a7f247319 commit 3a77c21a25e12fd60cc6093c74d4ad1a7f247319 Author: Martin Matuska AuthorDate: 2024-04-29 08:15:04 +0000 Commit: Martin Matuska CommitDate: 2024-05-04 11:54:42 +0000 libarchive: merge from vendor branch Libarchive 3.7.4 + three fixes from master Security fixes: #2135 rar: Fix OOB in rar e8 filter (CVE-2024-26256) #2145 zip: Fix out of boundary access #2148 rar: Fix OOB in rar delta filter #2149 rar: Fix OOB in rar audio filter Important bugfixes: #2131 7zip: Limit amount of properties #2110 bsdtar: Fix error handling around strtol() usages #2116 passphrase: Never allow empty passwords #2124 rar: Fix "File CRC Error" when extracting specific rar4 archives #2123 xar: Avoid infinite link loop #2150 xar: Fix another infinite loop and expat error handling #2108 zip: Update AppleDouble support for directories #2071 zstd: Implement core detectiongit PR: 278662 (exp-run) (cherry picked from commit 13d826ff947d9026f98e317e7385b22abfc0eace) --- contrib/libarchive/NEWS | 2 + contrib/libarchive/README.md | 2 +- contrib/libarchive/cat/cmdline.c | 16 +++-- contrib/libarchive/cpio/cmdline.c | 16 +++-- contrib/libarchive/libarchive/archive.h | 6 +- contrib/libarchive/libarchive/archive_entry.h | 2 +- contrib/libarchive/libarchive/archive_entry_acl.3 | 2 +- contrib/libarchive/libarchive/archive_read_disk.3 | 4 +- .../libarchive/archive_read_support_format_7zip.c | 2 + .../libarchive/archive_read_support_format_all.c | 2 +- .../libarchive/archive_read_support_format_ar.c | 4 +- .../libarchive/archive_read_support_format_lha.c | 4 +- .../libarchive/archive_read_support_format_mtree.c | 8 +-- .../libarchive/archive_read_support_format_rar.c | 30 +++++++- .../libarchive/archive_read_support_format_warc.c | 10 ++- .../libarchive/archive_read_support_format_xar.c | 9 +++ .../libarchive/archive_read_support_format_zip.c | 15 +++- contrib/libarchive/libarchive/archive_util.c | 3 +- .../libarchive/archive_write_add_filter_zstd.c | 23 +++++- .../libarchive/archive_write_disk_posix.c | 3 +- .../libarchive/libarchive/archive_write_private.h | 2 +- .../libarchive/archive_write_set_format_gnutar.c | 2 +- .../libarchive/archive_write_set_passphrase.c | 35 ++++----- .../libarchive/libarchive/libarchive_internals.3 | 2 +- .../test/test_read_format_xar_doublelink.c | 55 ++++++++++++++ .../test/test_read_format_xar_doublelink.xar.uu | 12 ++++ .../libarchive/test/test_write_disk_appledouble.c | 84 ++++++++++++++++++++++ .../test/test_write_disk_appledouble_zip.zip.uu | 27 +++++++ contrib/libarchive/libarchive_fe/passphrase.c | 4 +- contrib/libarchive/tar/bsdtar.1 | 15 ++-- contrib/libarchive/tar/bsdtar.c | 63 ++++++++-------- contrib/libarchive/tar/cmdline.c | 16 +++-- contrib/libarchive/unzip/cmdline.c | 18 +++-- contrib/libarchive/unzip/test/test_I.c | 13 ++++ lib/libarchive/tests/Makefile | 3 + 35 files changed, 404 insertions(+), 110 deletions(-) diff --git a/contrib/libarchive/NEWS b/contrib/libarchive/NEWS index f4395fd1c979..ebdbb2a978ec 100644 --- a/contrib/libarchive/NEWS +++ b/contrib/libarchive/NEWS @@ -1,3 +1,5 @@ +Apr 26, 2024: libarchive 3.7.4 released + Apr 08, 2024: libarchive 3.7.3 released Sep 12, 2023: libarchive 3.7.2 released diff --git a/contrib/libarchive/README.md b/contrib/libarchive/README.md index 727ed49856b6..933de6986425 100644 --- a/contrib/libarchive/README.md +++ b/contrib/libarchive/README.md @@ -201,7 +201,7 @@ questions we are asked about libarchive: In case other thread calls the same function in parallel, it might get interrupted by it and cause the executable to use umask=0 for the remaining execution. - This will then lead to implicitely created directories to have 777 + This will then lead to implicitly created directories to have 777 permissions without sticky bit. * In particular, libarchive's modules to read or write a directory diff --git a/contrib/libarchive/cat/cmdline.c b/contrib/libarchive/cat/cmdline.c index ea1e0eed6d0a..851b63de06e5 100644 --- a/contrib/libarchive/cat/cmdline.c +++ b/contrib/libarchive/cat/cmdline.c @@ -114,12 +114,18 @@ bsdcat_getopt(struct bsdcat *bsdcat) enum { state_start = 0, state_old_tar, state_next_word, state_short, state_long }; - const struct bsdcat_option *popt, *match = NULL, *match2 = NULL; - const char *p, *long_prefix = "--"; + const struct bsdcat_option *popt, *match, *match2; + const char *p, *long_prefix; size_t optlength; - int opt = '?'; - int required = 0; + int opt; + int required; +again: + match = NULL; + match2 = NULL; + long_prefix = "--"; + opt = '?'; + required = 0; bsdcat->argument = NULL; /* First time through, initialize everything. */ @@ -172,7 +178,7 @@ bsdcat_getopt(struct bsdcat *bsdcat) if (opt == '\0') { /* End of this group; recurse to get next option. */ bsdcat->getopt_state = state_next_word; - return bsdcat_getopt(bsdcat); + goto again; } /* Does this option take an argument? */ diff --git a/contrib/libarchive/cpio/cmdline.c b/contrib/libarchive/cpio/cmdline.c index 312d762c8f46..ab25492ede48 100644 --- a/contrib/libarchive/cpio/cmdline.c +++ b/contrib/libarchive/cpio/cmdline.c @@ -114,12 +114,18 @@ cpio_getopt(struct cpio *cpio) static int state = state_start; static char *opt_word; - const struct option *popt, *match = NULL, *match2 = NULL; - const char *p, *long_prefix = "--"; + const struct option *popt, *match, *match2; + const char *p, *long_prefix; size_t optlength; - int opt = '?'; - int required = 0; + int opt; + int required; +again: + match = NULL; + match2 = NULL; + long_prefix = "--"; + opt = '?'; + required = 0; cpio->argument = NULL; /* First time through, initialize everything. */ @@ -169,7 +175,7 @@ cpio_getopt(struct cpio *cpio) if (opt == '\0') { /* End of this group; recurse to get next option. */ state = state_next_word; - return cpio_getopt(cpio); + goto again; } /* Does this option take an argument? */ diff --git a/contrib/libarchive/libarchive/archive.h b/contrib/libarchive/libarchive/archive.h index 2e3a9f31cd33..fd4dd20fad13 100644 --- a/contrib/libarchive/libarchive/archive.h +++ b/contrib/libarchive/libarchive/archive.h @@ -34,7 +34,7 @@ * assert that ARCHIVE_VERSION_NUMBER >= 2012108. */ /* Note: Compiler will complain if this does not match archive_entry.h! */ -#define ARCHIVE_VERSION_NUMBER 3007003 +#define ARCHIVE_VERSION_NUMBER 3007004 #include #include /* for wchar_t */ @@ -155,7 +155,7 @@ __LA_DECL int archive_version_number(void); /* * Textual name/version of the library, useful for version displays. */ -#define ARCHIVE_VERSION_ONLY_STRING "3.7.3" +#define ARCHIVE_VERSION_ONLY_STRING "3.7.4" #define ARCHIVE_VERSION_STRING "libarchive " ARCHIVE_VERSION_ONLY_STRING __LA_DECL const char * archive_version_string(void); @@ -895,7 +895,7 @@ __LA_DECL int archive_write_set_options(struct archive *_a, const char *opts); /* - * Set a encryption passphrase. + * Set an encryption passphrase. */ __LA_DECL int archive_write_set_passphrase(struct archive *_a, const char *p); __LA_DECL int archive_write_set_passphrase_callback(struct archive *, diff --git a/contrib/libarchive/libarchive/archive_entry.h b/contrib/libarchive/libarchive/archive_entry.h index df9cb765f7e8..1c59ded7c911 100644 --- a/contrib/libarchive/libarchive/archive_entry.h +++ b/contrib/libarchive/libarchive/archive_entry.h @@ -28,7 +28,7 @@ #define ARCHIVE_ENTRY_H_INCLUDED /* Note: Compiler will complain if this does not match archive.h! */ -#define ARCHIVE_VERSION_NUMBER 3007003 +#define ARCHIVE_VERSION_NUMBER 3007004 /* * Note: archive_entry.h is for use outside of libarchive; the diff --git a/contrib/libarchive/libarchive/archive_entry_acl.3 b/contrib/libarchive/libarchive/archive_entry_acl.3 index 50dd642c20c6..4d0d8b50ed07 100644 --- a/contrib/libarchive/libarchive/archive_entry_acl.3 +++ b/contrib/libarchive/libarchive/archive_entry_acl.3 @@ -383,7 +383,7 @@ Prefix each default ACL entry with the word The mask and other ACLs don not contain a double colon. .El .Pp -The following flags are effecive only on NFSv4 ACL: +The following flags are effective only on NFSv4 ACL: .Bl -tag -offset indent -compact -width ARCHIV .It Dv ARCHIVE_ENTRY_ACL_STYLE_COMPACT Do not output minus characters for unset permissions and flags in NFSv4 ACL diff --git a/contrib/libarchive/libarchive/archive_read_disk.3 b/contrib/libarchive/libarchive/archive_read_disk.3 index 7cde3c232713..990c1514c4d5 100644 --- a/contrib/libarchive/libarchive/archive_read_disk.3 +++ b/contrib/libarchive/libarchive/archive_read_disk.3 @@ -288,11 +288,11 @@ calls. If matched based on calls to .Tn archive_match_time_excluded , or .Tn archive_match_owner_excluded , -then the callback function specified by the _excluded_func parameter will execute. This function will recieve data provided to the fourth parameter, void *_client_data. +then the callback function specified by the _excluded_func parameter will execute. This function will receive data provided to the fourth parameter, void *_client_data. .It Fn archive_read_disk_set_metadata_filter_callback Allows the caller to set a callback function during calls to .Xr archive_read_header 3 -to filter out metadata for each entry. The callback function recieves the +to filter out metadata for each entry. The callback function receives the .Tn struct archive object, void* custom filter data, and the .Tn struct archive_entry . diff --git a/contrib/libarchive/libarchive/archive_read_support_format_7zip.c b/contrib/libarchive/libarchive/archive_read_support_format_7zip.c index 92495e628f9a..7e465935c902 100644 --- a/contrib/libarchive/libarchive/archive_read_support_format_7zip.c +++ b/contrib/libarchive/libarchive/archive_read_support_format_7zip.c @@ -2037,6 +2037,8 @@ read_Folder(struct archive_read *a, struct _7z_folder *f) if (parse_7zip_uint64( a, &(f->coders[i].propertiesSize)) < 0) return (-1); + if (UMAX_ENTRY < f->coders[i].propertiesSize) + return (-1); if ((p = header_bytes( a, (size_t)f->coders[i].propertiesSize)) == NULL) return (-1); diff --git a/contrib/libarchive/libarchive/archive_read_support_format_all.c b/contrib/libarchive/libarchive/archive_read_support_format_all.c index 5a4e1ab675a5..3b53c9ad5f57 100644 --- a/contrib/libarchive/libarchive/archive_read_support_format_all.c +++ b/contrib/libarchive/libarchive/archive_read_support_format_all.c @@ -67,7 +67,7 @@ archive_read_support_format_all(struct archive *a) * increase the chance that a high bid from someone else will * make it unnecessary for these to do anything at all. */ - /* These three have potentially large look-ahead. */ + /* These have potentially large look-ahead. */ archive_read_support_format_7zip(a); archive_read_support_format_cab(a); archive_read_support_format_rar(a); diff --git a/contrib/libarchive/libarchive/archive_read_support_format_ar.c b/contrib/libarchive/libarchive/archive_read_support_format_ar.c index ca8effb0b0ee..6f1be8591fef 100644 --- a/contrib/libarchive/libarchive/archive_read_support_format_ar.c +++ b/contrib/libarchive/libarchive/archive_read_support_format_ar.c @@ -270,7 +270,7 @@ _ar_read_header(struct archive_read *a, struct archive_entry *entry, } if (ar->strtab != NULL) { archive_set_error(&a->archive, EINVAL, - "More than one string tables exist"); + "More than one string table exists"); return (ARCHIVE_FATAL); } @@ -515,7 +515,7 @@ archive_read_format_ar_read_data(struct archive_read *a, if (ar->entry_padding) { if (skipped >= 0) { archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, - "Truncated ar archive- failed consuming padding"); + "Truncated ar archive - failed consuming padding"); } return (ARCHIVE_FATAL); } diff --git a/contrib/libarchive/libarchive/archive_read_support_format_lha.c b/contrib/libarchive/libarchive/archive_read_support_format_lha.c index 1c64b2900b8e..4d6290ac33bb 100644 --- a/contrib/libarchive/libarchive/archive_read_support_format_lha.c +++ b/contrib/libarchive/libarchive/archive_read_support_format_lha.c @@ -1693,7 +1693,7 @@ archive_read_format_lha_cleanup(struct archive_read *a) * example. * 1. a symbolic-name is 'aaa/bb/cc' * 2. a filename is 'xxx/bbb' - * then a archived pathname is 'xxx/bbb|aaa/bb/cc' + * then an archived pathname is 'xxx/bbb|aaa/bb/cc' */ static int lha_parse_linkname(struct archive_wstring *linkname, @@ -2385,7 +2385,7 @@ lzh_decode_blocks(struct lzh_stream *strm, int last) return (100); } - /* lzh_br_read_ahead() always try to fill the + /* lzh_br_read_ahead() always tries to fill the * cache buffer up. In specific situation we * are close to the end of the data, the cache * buffer will not be full and thus we have to diff --git a/contrib/libarchive/libarchive/archive_read_support_format_mtree.c b/contrib/libarchive/libarchive/archive_read_support_format_mtree.c index 630cff6e3999..6971228eefad 100644 --- a/contrib/libarchive/libarchive/archive_read_support_format_mtree.c +++ b/contrib/libarchive/libarchive/archive_read_support_format_mtree.c @@ -416,8 +416,8 @@ next_line(struct archive_read *a, } /* - * Compare characters with a mtree keyword. - * Returns the length of a mtree keyword if matched. + * Compare characters with an mtree keyword. + * Returns the length of an mtree keyword if matched. * Returns 0 if not matched. */ static int @@ -515,7 +515,7 @@ bid_keyword(const char *p, ssize_t len) /* * Test whether there is a set of mtree keywords. - * Returns the number of keyword. + * Returns the number of keywords. * Returns -1 if we got incorrect sequence. * This function expects a set of "keyword=value". * When "unset" is specified, expects a set of "keyword". @@ -760,7 +760,7 @@ detect_form(struct archive_read *a, int *is_form_d) multiline = 1; else { /* We've got plenty of correct lines - * to assume that this file is a mtree + * to assume that this file is an mtree * format. */ if (++entry_cnt >= MAX_BID_ENTRY) break; diff --git a/contrib/libarchive/libarchive/archive_read_support_format_rar.c b/contrib/libarchive/libarchive/archive_read_support_format_rar.c index 99a11d170074..4fc6626cacfd 100644 --- a/contrib/libarchive/libarchive/archive_read_support_format_rar.c +++ b/contrib/libarchive/libarchive/archive_read_support_format_rar.c @@ -2176,6 +2176,19 @@ read_data_compressed(struct archive_read *a, const void **buff, size_t *size, { start = rar->offset; end = start + rar->dictionary_size; + + /* We don't want to overflow the window and overwrite data that we write + * at 'start'. Therefore, reduce the end length by the maximum match size, + * which is 260 bytes. You can compute this maximum by looking at the + * definition of 'expand', in particular when 'symbol >= 271'. */ + /* NOTE: It's possible for 'dictionary_size' to be less than this 260 + * value, however that will only be the case when 'unp_size' is small, + * which should only happen when the entry size is small and there's no + * risk of overflowing the buffer */ + if (rar->dictionary_size > 260) { + end -= 260; + } + if (rar->filters.filterstart < end) { end = rar->filters.filterstart; } @@ -3599,7 +3612,15 @@ execute_filter_delta(struct rar_filter *filter, struct rar_virtual_machine *vm) { uint8_t lastbyte = 0; for (idx = i; idx < length; idx += numchannels) + { + /* + * The src block should not overlap with the dst block. + * If so it would be better to consider this archive is broken. + */ + if (src >= dst) + return 0; lastbyte = dst[idx] = lastbyte - *src++; + } } filter->filteredblockaddress = length; @@ -3615,7 +3636,7 @@ execute_filter_e8(struct rar_filter *filter, struct rar_virtual_machine *vm, siz uint32_t filesize = 0x1000000; uint32_t i; - if (length > PROGRAM_WORK_SIZE || length < 4) + if (length > PROGRAM_WORK_SIZE || length <= 4) return 0; for (i = 0; i <= length - 5; i++) @@ -3701,6 +3722,13 @@ execute_filter_audio(struct rar_filter *filter, struct rar_virtual_machine *vm) memset(&state, 0, sizeof(state)); for (j = i; j < length; j += numchannels) { + /* + * The src block should not overlap with the dst block. + * If so it would be better to consider this archive is broken. + */ + if (src >= dst) + return 0; + int8_t delta = (int8_t)*src++; uint8_t predbyte, byte; int prederror; diff --git a/contrib/libarchive/libarchive/archive_read_support_format_warc.c b/contrib/libarchive/libarchive/archive_read_support_format_warc.c index c49d44eba5e5..fcec5bc4cbb9 100644 --- a/contrib/libarchive/libarchive/archive_read_support_format_warc.c +++ b/contrib/libarchive/libarchive/archive_read_support_format_warc.c @@ -215,6 +215,7 @@ _warc_rdhdr(struct archive_read *a, struct archive_entry *entry) const char *buf; ssize_t nrd; const char *eoh; + char *tmp; /* for the file name, saves some strndup()'ing */ warc_string_t fnam; /* warc record type, not that we really use it a lot */ @@ -321,7 +322,14 @@ start_over: * malloc()+free() roundtrip */ if (fnam.len + 1U > w->pool.len) { w->pool.len = ((fnam.len + 64U) / 64U) * 64U; - w->pool.str = realloc(w->pool.str, w->pool.len); + tmp = realloc(w->pool.str, w->pool.len); + if (tmp == NULL) { + archive_set_error( + &a->archive, ENOMEM, + "Out of memory"); + return (ARCHIVE_FATAL); + } + w->pool.str = tmp; } memcpy(w->pool.str, fnam.str, fnam.len); w->pool.str[fnam.len] = '\0'; diff --git a/contrib/libarchive/libarchive/archive_read_support_format_xar.c b/contrib/libarchive/libarchive/archive_read_support_format_xar.c index fd63594373cb..cefb36410e77 100644 --- a/contrib/libarchive/libarchive/archive_read_support_format_xar.c +++ b/contrib/libarchive/libarchive/archive_read_support_format_xar.c @@ -2055,6 +2055,12 @@ xml_start(struct archive_read *a, const char *name, struct xmlattr_list *list) attr = attr->next) { if (strcmp(attr->name, "link") != 0) continue; + if (xar->file->hdnext != NULL || xar->file->link != 0 || + xar->file == xar->hdlink_orgs) { + archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, + "File with multiple link attributes"); + return (ARCHIVE_FATAL); + } if (strcmp(attr->value, "original") == 0) { xar->file->hdnext = xar->hdlink_orgs; xar->hdlink_orgs = xar->file; @@ -3251,6 +3257,9 @@ expat_start_cb(void *userData, const XML_Char *name, const XML_Char **atts) struct xmlattr_list list; int r; + if (ud->state != ARCHIVE_OK) + return; + r = expat_xmlattr_setup(a, &list, atts); if (r == ARCHIVE_OK) r = xml_start(a, (const char *)name, &list); diff --git a/contrib/libarchive/libarchive/archive_read_support_format_zip.c b/contrib/libarchive/libarchive/archive_read_support_format_zip.c index 212bfff9fa7b..c9759eaf9a89 100644 --- a/contrib/libarchive/libarchive/archive_read_support_format_zip.c +++ b/contrib/libarchive/libarchive/archive_read_support_format_zip.c @@ -1393,7 +1393,7 @@ check_authentication_code(struct archive_read *a, const void *_p) * [CRC32] [compressed low] [compressed high] [uncompressed low] [uncompressed high] [other PK marker] * ``` * Since the 32-bit and 64-bit compressed sizes both match, the - * actualy size must fit in 32 bits, which implies the high-order + * actual size must fit in 32 bits, which implies the high-order * word of the compressed size is zero. So we know the uncompressed * low word is zero, which again implies that if we accept the shorter * format, there will not be a valid PK marker following it. @@ -4083,6 +4083,17 @@ slurp_central_directory(struct archive_read *a, struct archive_entry* entry, } else { /* Generate resource fork name to find its * resource file at zip->tree_rsrc. */ + + /* If this is an entry ending with slash, + * make the resource for name slash-less + * as the actual resource fork doesn't end with '/'. + */ + size_t tmp_length = filename_length; + if (tmp_length > 0 && name[tmp_length - 1] == '/') { + tmp_length--; + r = rsrc_basename(name, tmp_length); + } + archive_strcpy(&(zip_entry->rsrcname), "__MACOSX/"); archive_strncat(&(zip_entry->rsrcname), @@ -4090,7 +4101,7 @@ slurp_central_directory(struct archive_read *a, struct archive_entry* entry, archive_strcat(&(zip_entry->rsrcname), "._"); archive_strncat(&(zip_entry->rsrcname), name + (r - name), - filename_length - (r - name)); + tmp_length - (r - name)); /* Register an entry to RB tree to sort it by * file offset. */ __archive_rb_tree_insert_node(&zip->tree, diff --git a/contrib/libarchive/libarchive/archive_util.c b/contrib/libarchive/libarchive/archive_util.c index 32d4bd40988c..7b918fef04b8 100644 --- a/contrib/libarchive/libarchive/archive_util.c +++ b/contrib/libarchive/libarchive/archive_util.c @@ -255,10 +255,9 @@ __archive_mktempx(const char *tmpdir, wchar_t *template) #endif fd = -1; ws = NULL; + archive_string_init(&temp_name); if (template == NULL) { - archive_string_init(&temp_name); - /* Get a temporary directory. */ if (tmpdir == NULL) { size_t l; diff --git a/contrib/libarchive/libarchive/archive_write_add_filter_zstd.c b/contrib/libarchive/libarchive/archive_write_add_filter_zstd.c index 94249accd08b..7ea3d18c9b76 100644 --- a/contrib/libarchive/libarchive/archive_write_add_filter_zstd.c +++ b/contrib/libarchive/libarchive/archive_write_add_filter_zstd.c @@ -29,6 +29,9 @@ #ifdef HAVE_ERRNO_H #include #endif +#ifdef HAVE_LIMITS_H +#include +#endif #ifdef HAVE_STDINT_H #include #endif @@ -38,6 +41,9 @@ #ifdef HAVE_STRING_H #include #endif +#ifdef HAVE_UNISTD_H +#include +#endif #ifdef HAVE_ZSTD_H #include #endif @@ -190,6 +196,7 @@ string_to_number(const char *string, intmax_t *numberp) return (ARCHIVE_OK); } +#if HAVE_ZSTD_H && HAVE_ZSTD_compressStream static int string_to_size(const char *string, size_t *numberp) { @@ -224,6 +231,7 @@ string_to_size(const char *string, size_t *numberp) *numberp = (size_t)(number << shift); return (ARCHIVE_OK); } +#endif /* * Set write options. @@ -264,7 +272,20 @@ archive_compressor_zstd_options(struct archive_write_filter *f, const char *key, if (string_to_number(value, &threads) != ARCHIVE_OK) { return (ARCHIVE_WARN); } - if (threads < 0) { + +#if defined(HAVE_SYSCONF) && defined(_SC_NPROCESSORS_ONLN) + if (threads == 0) { + threads = sysconf(_SC_NPROCESSORS_ONLN); + } +#elif !defined(__CYGWIN__) && defined(_WIN32_WINNT) && \ + _WIN32_WINNT >= 0x0601 /* _WIN32_WINNT_WIN7 */ + if (threads == 0) { + DWORD winCores = GetActiveProcessorCount( + ALL_PROCESSOR_GROUPS); + threads = (intmax_t)winCores; + } +#endif + if (threads < 0 || threads > INT_MAX) { return (ARCHIVE_WARN); } data->threads = (int)threads; diff --git a/contrib/libarchive/libarchive/archive_write_disk_posix.c b/contrib/libarchive/libarchive/archive_write_disk_posix.c index f671bc6db747..d69c77ea0517 100644 --- a/contrib/libarchive/libarchive/archive_write_disk_posix.c +++ b/contrib/libarchive/libarchive/archive_write_disk_posix.c @@ -4427,7 +4427,8 @@ fixup_appledouble(struct archive_write_disk *a, const char *pathname) #else la_stat(datafork.s, &st) == -1 || #endif - (st.st_mode & AE_IFMT) != AE_IFREG) + (((st.st_mode & AE_IFMT) != AE_IFREG) && + ((st.st_mode & AE_IFMT) != AE_IFDIR))) goto skip_appledouble; /* diff --git a/contrib/libarchive/libarchive/archive_write_private.h b/contrib/libarchive/libarchive/archive_write_private.h index abd5a8ddcd85..f259ccb16546 100644 --- a/contrib/libarchive/libarchive/archive_write_private.h +++ b/contrib/libarchive/libarchive/archive_write_private.h @@ -158,7 +158,7 @@ int __archive_write_program_write(struct archive_write_filter *, struct archive_write_program_data *, const void *, size_t); /* - * Get a encryption passphrase. + * Get an encryption passphrase. */ const char * __archive_write_get_passphrase(struct archive_write *a); #endif diff --git a/contrib/libarchive/libarchive/archive_write_set_format_gnutar.c b/contrib/libarchive/libarchive/archive_write_set_format_gnutar.c index 92b06c5f5fb4..a88350b87411 100644 --- a/contrib/libarchive/libarchive/archive_write_set_format_gnutar.c +++ b/contrib/libarchive/libarchive/archive_write_set_format_gnutar.c @@ -387,7 +387,7 @@ archive_write_gnutar_header(struct archive_write *a, if (r != 0) { if (errno == ENOMEM) { archive_set_error(&a->archive, ENOMEM, - "Can't allocate memory for Pathame"); + "Can't allocate memory for pathname"); ret = ARCHIVE_FATAL; goto exit_write_header; } diff --git a/contrib/libarchive/libarchive/archive_write_set_passphrase.c b/contrib/libarchive/libarchive/archive_write_set_passphrase.c index 977fc4a9ee6b..f871c8e2f810 100644 --- a/contrib/libarchive/libarchive/archive_write_set_passphrase.c +++ b/contrib/libarchive/libarchive/archive_write_set_passphrase.c @@ -30,14 +30,9 @@ #endif #include "archive_write_private.h" -int -archive_write_set_passphrase(struct archive *_a, const char *p) +static int +set_passphrase(struct archive_write *a, const char *p) { - struct archive_write *a = (struct archive_write *)_a; - - archive_check_magic(_a, ARCHIVE_WRITE_MAGIC, ARCHIVE_STATE_NEW, - "archive_write_set_passphrase"); - if (p == NULL || p[0] == '\0') { archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Empty passphrase is unacceptable"); @@ -54,6 +49,18 @@ archive_write_set_passphrase(struct archive *_a, const char *p) } +int +archive_write_set_passphrase(struct archive *_a, const char *p) +{ + struct archive_write *a = (struct archive_write *)_a; + + archive_check_magic(_a, ARCHIVE_WRITE_MAGIC, ARCHIVE_STATE_NEW, + "archive_write_set_passphrase"); + + return (set_passphrase(a, p)); +} + + int archive_write_set_passphrase_callback(struct archive *_a, void *client_data, archive_passphrase_callback *cb) @@ -80,15 +87,9 @@ __archive_write_get_passphrase(struct archive_write *a) const char *p; p = a->passphrase_callback(&a->archive, a->passphrase_client_data); - if (p != NULL) { - a->passphrase = strdup(p); - if (a->passphrase == NULL) { - archive_set_error(&a->archive, ENOMEM, - "Can't allocate data for passphrase"); - return (NULL); - } - return (a->passphrase); - } + set_passphrase(a, p); + a->passphrase_callback = NULL; + a->passphrase_client_data = NULL; } - return (NULL); + return (a->passphrase); } diff --git a/contrib/libarchive/libarchive/libarchive_internals.3 b/contrib/libarchive/libarchive/libarchive_internals.3 index d4696f648292..2978b48c3e97 100644 --- a/contrib/libarchive/libarchive/libarchive_internals.3 +++ b/contrib/libarchive/libarchive/libarchive_internals.3 @@ -124,7 +124,7 @@ to read the entire file into memory at once and return the entire file to libarchive as a single block; other clients may begin asynchronous I/O operations for the next block on each request. -.Ss Decompresssion Layer +.Ss Decompression Layer The decompression layer not only handles decompression, it also buffers data so that the format handlers see a much nicer I/O model. diff --git a/contrib/libarchive/libarchive/test/test_read_format_xar_doublelink.c b/contrib/libarchive/libarchive/test/test_read_format_xar_doublelink.c new file mode 100644 index 000000000000..78d6626a09bf --- /dev/null +++ b/contrib/libarchive/libarchive/test/test_read_format_xar_doublelink.c @@ -0,0 +1,55 @@ +/*- + * Copyright (c) 2024 Martin Matuska + * All rights reserved. + * + * 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(S) ``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(S) 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 "test.h" + +#define __LIBARCHIVE_BUILD + +DEFINE_TEST(test_read_format_xar_doublelink) +{ + const char *refname = "test_read_format_xar_doublelink.xar"; + struct archive *a; + struct archive_entry *ae; + + extract_reference_file(refname); + + /* Verify with seeking reader. */ + assert((a = archive_read_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a)); + if(ARCHIVE_OK != archive_read_support_format_xar(a)) { + skipping("XAR format unsupported"); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); + return; + } + assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, refname, + 10240)); + + assertA(ARCHIVE_FATAL == archive_read_next_header(a, &ae)); + assertEqualString(archive_error_string(a), + "File with multiple link attributes"); + assert(archive_errno(a) != 0); + + assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); +} diff --git a/contrib/libarchive/libarchive/test/test_read_format_xar_doublelink.xar.uu b/contrib/libarchive/libarchive/test/test_read_format_xar_doublelink.xar.uu new file mode 100644 index 000000000000..7aa638a86e7c --- /dev/null +++ b/contrib/libarchive/libarchive/test/test_read_format_xar_doublelink.xar.uu @@ -0,0 +1,12 @@ +begin 664 test_read_format_xar_doublelink.xar +M>&%R(0`<``$````````!0`````````/7`````7B<[9/!D3&``]'1?GT!-1U;;:=[5[G<=WB0=P>^..@![<%Y94V# +M\R>*$9C6=LKT#7Y;OF8O>"%F_""=F"$^VC9\$&\=R#'LR$:E03#*RHR6&2N6 +MM*KIO,YS3JZ1M&D-[<;O-/+C<8`&^[7,<:P@;E:;52`R#5A6N?VQ@9CHIN.#_IY(['+:!!F4V#K5.],G+`8BU=%SU.8OF? +MH#*V`U%5K"@9)Z=5*G2P5RT8*YY+3J9%*ND(T?D\%/3$[U0GJ=W6T3=E+);&^E4=0%?0^#N\00;G(;8U7`]! #include static char * @@ -113,8 +114,7 @@ readpassphrase(const char *prompt, char *buf, size_t bufsiz, int flags) WriteFile(hStdout, "\r\n", 2, NULL, NULL); buf[rbytes] = '\0'; /* Remove trailing carriage return(s). */ - if (rbytes > 2 && buf[rbytes - 2] == '\r' && buf[rbytes - 1] == '\n') - buf[rbytes - 2] = '\0'; + buf[strcspn(buf, "\r\n")] = '\0'; return (buf); } diff --git a/contrib/libarchive/tar/bsdtar.1 b/contrib/libarchive/tar/bsdtar.1 index e570d2a48a01..fe9ec9504674 100644 --- a/contrib/libarchive/tar/bsdtar.1 +++ b/contrib/libarchive/tar/bsdtar.1 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd March 1, 2024 +.Dd April 23, 2024 .Dt TAR 1 .Os .Sh NAME @@ -644,14 +644,13 @@ A decimal integer from 4 to 7 specifying the lz4 compression block size .It Cm lz4:block-dependence Use the previous block of the block being compressed for a compression dictionary to improve compression ratio. -.It Cm zstd:compression-level -A decimal integer specifying the zstd compression level. Supported values depend +.It Cm zstd:compression-level Ns = Ns Ar N +A decimal integer specifying the zstd compression level. +Supported values depend on the library version, common values are from 1 to 22. -.It Cm zstd:threads -Specify the number of worker threads to use. -Setting threads to a special value 0 makes -.Xr zstd 1 -use as many threads as there are CPU cores on the system. +.It Cm zstd:threads Ns = Ns Ar N +Specify the number of worker threads to use, or 0 to use as many +threads as there are CPU cores in the system. .It Cm zstd:frame-per-file Start a new compression frame at the beginning of each file in the archive. diff --git a/contrib/libarchive/tar/bsdtar.c b/contrib/libarchive/tar/bsdtar.c index b070e0faeb66..42baab2861bd 100644 --- a/contrib/libarchive/tar/bsdtar.c +++ b/contrib/libarchive/tar/bsdtar.c @@ -157,6 +157,7 @@ main(int argc, char **argv) char *tptr, *uptr; char possible_help_request; char buff[16]; + long l; /* * Use a pointer for consistency, but stack-allocated storage @@ -301,16 +302,15 @@ main(int argc, char **argv) /* libarchive doesn't need this; just ignore it. */ break; case 'b': /* SUSv2 */ - errno = 0; tptr = NULL; - t = (int)strtol(bsdtar->argument, &tptr, 10); - if (errno || t <= 0 || t > 8192 || + l = strtol(bsdtar->argument, &tptr, 10); + if (l <= 0 || l > 8192L || *(bsdtar->argument) == '\0' || tptr == NULL || *tptr != '\0') { lafe_errc(1, 0, "Invalid or out of range " "(1..8192) argument to -b"); } - bsdtar->bytes_per_block = 512 * t; + bsdtar->bytes_per_block = 512 * (int)l; /* Explicit -b forces last block size. */ bsdtar->bytes_in_last_block = bsdtar->bytes_per_block; break; @@ -369,44 +369,42 @@ main(int argc, char **argv) *** 263 LINES SKIPPED *** From nobody Sat May 4 12:37:42 2024 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 4VWnJ83sw1z5KVZs; Sat, 4 May 2024 12:37: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 4VWnJ81Pcbz44cS; Sat, 4 May 2024 12:37:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714826264; 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=8v8fMEBEIr6LqMflWgQHT9I7/bcDrYIKor8yLg4X0Bc=; b=x41v86gICUBPhk08kgVz/op6rLVNI9cEqY0Dj0+oxgpet3o4bqYAZTgcLD1bvqW+7eWutt 3+/Z8uWm6Gq9APiSfkK3p3V1qWTY54fAc2LWNRrUgz1CQOT6gnqpcDWjkG+xgIULixNj1m F54ssyZb5WfkLFY5DRqTkyn/pTdnRzZPy+qxN7flHG4XpDZtm10Jl2MrhD8JXXXostnBcs +Jbvks61sBKSEKe/XZs0HVeLlVD6gXjiQJSRZlTcnbTdyySb6B1yNxoA0Tn2WFT51rSg9i dtt/mJyDxaJa16Ffs26WLev/GLNDtGdvsyGSiu9FMSfjOh7MS17sQ3OCteaH9w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714826264; a=rsa-sha256; cv=none; b=is0htzRsv4A2yibD86ghQyEG4wh2/KmveJwT4F5JBl0SuJ2Cm3l/8eRBFF9X9hQw2ShygC u2OGnSLspjftYWRkJeEppxodTa/yjHx/xzqwPiiwq9fF3oGQ2K+mIOUM5coMlbgbOGRtPa vnF0ya1+n67WrfuakREMnz5dbBbMAYRd1rQS0Xn2VhwcLGZ7lgS42O4OCf7SmlV0oyzhnD TLhoS69KGg6VKlxR2LE2x3X/4ZTwzcPeU30t6cZOv9btKfbjzBLiWQzqtsPF5O4boHQ1kW rtzo5Qd2CUkXRTfw03toXWUbTad0SKaqzTQdDoBeTsT+V2g0/2TsbQpeZNzQlQ== 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=1714826264; 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=8v8fMEBEIr6LqMflWgQHT9I7/bcDrYIKor8yLg4X0Bc=; b=TghlSyQRWCVRygvNk3lPaYU0SFWCOHr92csdhbTCMmjckArLuLW1asSwXA8Sv9ZFjtr70Q KWk3DoRRms1jZr31LyNJFbKvAG6v8Bb6qpxrUwAwIN3Kv3l3vzvrExpA+MmpyKVh1p4+Gc p9pDiJ/dAy3c88HpAy21lGU98pPZKq6F6noIMUq/hqFLnQUoB5udTSbRNEHBRuMzEFA3d/ bX3kUNpM67H/XHtvCz/D2NIXVtLYuzs3esu2ITn1IxY0IrbJ12/a+0sqXV1YiypRjUC7ha IzF6/5OwyS/OniFzcVRpYbC2ineUHmEB6ix6vImXvQmj6W52igrkOsWfSqo6HQ== 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 4VWnJ61vfzzVxk; Sat, 4 May 2024 12:37:42 +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 444Cbgv5072627; Sat, 4 May 2024 12:37:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 444CbgCw072624; Sat, 4 May 2024 12:37:42 GMT (envelope-from git) Date: Sat, 4 May 2024 12:37:42 GMT Message-Id: <202405041237.444CbgCw072624@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Martin Matuska Subject: git: 43a6a8b07758 - stable/13 - libarchive: add two missing package files to libarchive 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 43a6a8b07758c76576d1c505e770b937f84ad713 Auto-Submitted: auto-generated The branch stable/13 has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=43a6a8b07758c76576d1c505e770b937f84ad713 commit 43a6a8b07758c76576d1c505e770b937f84ad713 Author: Martin Matuska AuthorDate: 2024-04-17 07:58:32 +0000 Commit: Martin Matuska CommitDate: 2024-05-04 11:53:07 +0000 libarchive: add two missing package files to libarchive tests (cherry picked from commit 7d03ec330684a4e82e6113df3f40305849e5fb6c) --- lib/libarchive/tests/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/libarchive/tests/Makefile b/lib/libarchive/tests/Makefile index 0d47e1a5ed3c..e14b37621e5c 100644 --- a/lib/libarchive/tests/Makefile +++ b/lib/libarchive/tests/Makefile @@ -373,6 +373,8 @@ ${PACKAGE}FILES+= test_compat_lz4_B7.tar.lz4.uu ${PACKAGE}FILES+= test_compat_lz4_B7BD.tar.lz4.uu ${PACKAGE}FILES+= test_compat_lzip_1.tlz.uu ${PACKAGE}FILES+= test_compat_lzip_2.tlz.uu +${PACKAGE}FILES+= test_compat_lzip_3.lz.uu +${PACKAGE}FILES+= test_compat_lzip_4.tlz.uu ${PACKAGE}FILES+= test_compat_lzma_1.tlz.uu ${PACKAGE}FILES+= test_compat_lzma_2.tlz.uu ${PACKAGE}FILES+= test_compat_lzma_3.tlz.uu From nobody Sat May 4 12:37:44 2024 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 4VWnJ86PHVz5KVY4; Sat, 4 May 2024 12:37: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 4VWnJ84DQ3z44j5; Sat, 4 May 2024 12:37:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714826264; 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=SxTJ5uwEaVsEMI7Vy3iKk/hYR9GAL+Vz8dytWdDLg2Q=; b=qUKfChB8s+5/hDArqoxeDKnZ27TOTitfHY7l4+xZ29O+meTnxxg8tclAtUK8iDOWGkE5Ko VKcvAvKbBYaN5wzg8BKXl6WCg0bk1QIRNk1weP+48EnwmWE4zvlxUS3GbTd8ttLtd0BPO2 NHk8BlZ5jrG8+l8tJJmGAMC+1EsXfW6wzCodYNDxEVyaFiCVmIgyFEWbvXUQE2pG3YGGYT ym8vPGdplIDKTmH6om20CZI4UKysPxNbQG4a1ccQK5JHgh/qUTtEo8EOAdZ+6ZkTli/N33 dTohKav/Mm+WQX1jAm9rtvP5uaaxmeYWOAVSbV5Wu121UlMMXoptgsdU/LSGoA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714826264; a=rsa-sha256; cv=none; b=cmwDARmyzyOle9qzcdGFREKfNRwDDfukcWaw8nkNYRgtZ0zT+mYRFITU8D58I/kUwRETzX ZI6Qa6niaqxNt7Wb6WaSMjDSXcNab1eDmrx/1WyimT6gtOfmNYLFFJ2kY/rczjF59d/WKr AleA/6g20pDgcm9EuXn9Valjt/hznga01hJOSIAiAjnszg6/vVMIltfThj2AKuV9mnFK9e NKPn5emlLPUM+KiRd9aRJ4wsNkWJqJMeKMtflMEAExu3QOhtzq9SLBlac6xkjUpFcCenHK IrjbdYFfzMJvnhr1sD8tPkAS+8oxCea/HpqGo+bJV4fgM4OdyRInZuMafiEEVg== 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=1714826264; 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=SxTJ5uwEaVsEMI7Vy3iKk/hYR9GAL+Vz8dytWdDLg2Q=; b=iwI0OadWFsWD/o1OO0ZStxKX3yPShzAT9z/JhHgtlaFths1E5qk1mBT95cPiKQmgn5rH3f AhwTsEQicNn8sV/3K/8pZZHePTqBAqpZjFwTGw6wrxHra5gqwbUjW29pvheEex7dWMLR3O byHMrx8bEg4blV6GL8SfeRuOk/syfZmQiels+fAVFDk1BzniH3lIeUP4mMPBP31mdCoj9e eHFVfbxFwSMaDv8LV2qYdSrHU03V/wTcCFoHmKr1plgTlcbfbOBJdwWnef0L08sVjxKSea qVUj8Sck+bwpCZgT1IYDU0ReA7qeWj8T+NctuNkHK6UCBZ01JfLKxkPPXZoMdQ== 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 4VWnJ83rCDzV5s; Sat, 4 May 2024 12:37: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 444Cbiic072714; Sat, 4 May 2024 12:37:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 444Cbi68072711; Sat, 4 May 2024 12:37:44 GMT (envelope-from git) Date: Sat, 4 May 2024 12:37:44 GMT Message-Id: <202405041237.444Cbi68072711@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Martin Matuska Subject: git: c923dda75a23 - stable/13 - libarchive: merge bugfixes from vendor branch List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c923dda75a2324283d6dbdc6c8ae132767e83086 Auto-Submitted: auto-generated The branch stable/13 has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=c923dda75a2324283d6dbdc6c8ae132767e83086 commit c923dda75a2324283d6dbdc6c8ae132767e83086 Author: Martin Matuska AuthorDate: 2024-04-30 09:53:06 +0000 Commit: Martin Matuska CommitDate: 2024-05-04 11:55:21 +0000 libarchive: merge bugfixes from vendor branch #2147 archive_string: clean up strncat_from_utf8_to_utf8 (36047967a) #2153 archive_match: check archive_read_support_format_raw() return value (0ce1b4c38) #2154 archive_match: turn counter into flag (287e05d53) #2155 lha: Do not allow negative file sizes (93b11caed) #2156 tests: setenv LANG to en_US.UTF-8 in bsdunzip test_I.c (83e8b0ea8) (cherry picked from commit c0b58e65deca1e5e2c434ede7e64f03af6044be8) --- contrib/libarchive/libarchive/archive_match.c | 18 ++-- .../libarchive/archive_read_support_format_lha.c | 2 + contrib/libarchive/libarchive/archive_string.c | 96 ++++++++++------------ contrib/libarchive/unzip/test/test_I.c | 8 ++ 4 files changed, 61 insertions(+), 63 deletions(-) diff --git a/contrib/libarchive/libarchive/archive_match.c b/contrib/libarchive/libarchive/archive_match.c index fc8a4ce8127b..3ab8eda36038 100644 --- a/contrib/libarchive/libarchive/archive_match.c +++ b/contrib/libarchive/libarchive/archive_match.c @@ -46,7 +46,7 @@ struct match { struct match *next; - int matches; + int matched; struct archive_mstring pattern; }; @@ -605,7 +605,8 @@ add_pattern_from_file(struct archive_match *a, struct match_list *mlist, return (ARCHIVE_FATAL); } r = archive_read_support_format_raw(ar); - r = archive_read_support_format_empty(ar); + if (r == ARCHIVE_OK) + r = archive_read_support_format_empty(ar); if (r != ARCHIVE_OK) { archive_copy_error(&(a->archive), ar); archive_read_free(ar); @@ -724,12 +725,12 @@ path_excluded(struct archive_match *a, int mbs, const void *pathname) matched = NULL; for (match = a->inclusions.first; match != NULL; match = match->next){ - if (match->matches == 0 && + if (!match->matched && (r = match_path_inclusion(a, match, mbs, pathname)) != 0) { if (r < 0) return (r); a->inclusions.unmatched_count--; - match->matches++; + match->matched = 1; matched = match; } } @@ -752,11 +753,10 @@ path_excluded(struct archive_match *a, int mbs, const void *pathname) for (match = a->inclusions.first; match != NULL; match = match->next){ /* We looked at previously-unmatched inclusions already. */ - if (match->matches > 0 && + if (match->matched && (r = match_path_inclusion(a, match, mbs, pathname)) != 0) { if (r < 0) return (r); - match->matches++; return (0); } } @@ -879,7 +879,7 @@ match_list_unmatched_inclusions_next(struct archive_match *a, for (m = list->unmatched_next; m != NULL; m = m->next) { int r; - if (m->matches) + if (m->matched) continue; if (mbs) { const char *p; @@ -1793,7 +1793,7 @@ match_owner_name_mbs(struct archive_match *a, struct match_list *list, < 0 && errno == ENOMEM) return (error_nomem(a)); if (p != NULL && strcmp(p, name) == 0) { - m->matches++; + m->matched = 1; return (1); } } @@ -1814,7 +1814,7 @@ match_owner_name_wcs(struct archive_match *a, struct match_list *list, < 0 && errno == ENOMEM) return (error_nomem(a)); if (p != NULL && wcscmp(p, name) == 0) { - m->matches++; + m->matched = 1; return (1); } } diff --git a/contrib/libarchive/libarchive/archive_read_support_format_lha.c b/contrib/libarchive/libarchive/archive_read_support_format_lha.c index 4d6290ac33bb..ae5a1d7d668e 100644 --- a/contrib/libarchive/libarchive/archive_read_support_format_lha.c +++ b/contrib/libarchive/libarchive/archive_read_support_format_lha.c @@ -1347,6 +1347,8 @@ lha_read_file_extended_header(struct archive_read *a, struct lha *lha, lha->compsize = archive_le64dec(extdheader); extdheader += sizeof(uint64_t); lha->origsize = archive_le64dec(extdheader); + if (lha->compsize < 0 || lha->origsize < 0) + goto invalid; } break; case EXT_CODEPAGE: diff --git a/contrib/libarchive/libarchive/archive_string.c b/contrib/libarchive/libarchive/archive_string.c index f39677ad7a26..be6c39600d72 100644 --- a/contrib/libarchive/libarchive/archive_string.c +++ b/contrib/libarchive/libarchive/archive_string.c @@ -2640,81 +2640,69 @@ unicode_to_utf16le(char *p, size_t remaining, uint32_t uc) } /* - * Copy UTF-8 string in checking surrogate pair. - * If any surrogate pair are found, it would be canonicalized. + * Append new UTF-8 string to existing UTF-8 string. + * Existing string is assumed to already be in proper form; + * the new string will have invalid sequences replaced and + * surrogate pairs canonicalized. */ static int -strncat_from_utf8_to_utf8(struct archive_string *as, const void *_p, +strncat_from_utf8_to_utf8(struct archive_string *as, const void *_src, size_t len, struct archive_string_conv *sc) { - const char *s; - char *p, *endp; - int n, ret = 0; - + int ret = 0; + const char *src = _src; (void)sc; /* UNUSED */ + /* Pre-extend the destination */ if (archive_string_ensure(as, as->length + len + 1) == NULL) return (-1); - s = (const char *)_p; - p = as->s + as->length; - endp = as->s + as->buffer_length -1; - do { + /* Invariant: src points to the first UTF8 byte that hasn't + * been copied to the destination `as`. */ + for (;;) { + int n; uint32_t uc; - const char *ss = s; - size_t w; + const char *e = src; - /* - * Forward byte sequence until a conversion of that is needed. - */ - while ((n = utf8_to_unicode(&uc, s, len)) > 0) { - s += n; + /* Skip UTF-8 sequences until we reach end-of-string or + * a code point that needs conversion. */ + while ((n = utf8_to_unicode(&uc, e, len)) > 0) { + e += n; len -= n; } - if (ss < s) { - if (p + (s - ss) > endp) { - as->length = p - as->s; - if (archive_string_ensure(as, - as->buffer_length + len + 1) == NULL) - return (-1); - p = as->s + as->length; - endp = as->s + as->buffer_length -1; - } - - memcpy(p, ss, s - ss); - p += s - ss; + /* Copy the part that doesn't need conversion */ + if (e > src) { + if (archive_string_append(as, src, e - src) == NULL) + return (-1); + src = e; } - /* - * If n is negative, current byte sequence needs a replacement. - */ - if (n < 0) { + if (n == 0) { + /* We reached end-of-string */ + return (ret); + } else { + /* Next code point needs conversion */ + char t[4]; + size_t w; + + /* Try decoding a surrogate pair */ if (n == -3 && IS_SURROGATE_PAIR_LA(uc)) { - /* Current byte sequence may be CESU-8. */ - n = cesu8_to_unicode(&uc, s, len); + n = cesu8_to_unicode(&uc, src, len); } + /* Not a (valid) surrogate, so use a replacement char */ if (n < 0) { - ret = -1; - n *= -1;/* Use a replaced unicode character. */ - } - - /* Rebuild UTF-8 byte sequence. */ - while ((w = unicode_to_utf8(p, endp - p, uc)) == 0) { - as->length = p - as->s; - if (archive_string_ensure(as, - as->buffer_length + len + 1) == NULL) - return (-1); - p = as->s + as->length; - endp = as->s + as->buffer_length -1; + ret = -1; /* Return -1 if we used any replacement */ + n *= -1; } - p += w; - s += n; + /* Consume converted code point */ + src += n; len -= n; + /* Convert and append new UTF-8 sequence. */ + w = unicode_to_utf8(t, sizeof(t), uc); + if (archive_string_append(as, t, w) == NULL) + return (-1); } - } while (n > 0); - as->length = p - as->s; - as->s[as->length] = '\0'; - return (ret); + } } static int diff --git a/contrib/libarchive/unzip/test/test_I.c b/contrib/libarchive/unzip/test/test_I.c index 5d31ce8d1611..d189edca1a5c 100644 --- a/contrib/libarchive/unzip/test/test_I.c +++ b/contrib/libarchive/unzip/test/test_I.c @@ -33,6 +33,7 @@ DEFINE_TEST(test_I) { const char *reffile = "test_I.zip"; + const char *lang; int r; #if HAVE_SETLOCALE @@ -44,6 +45,8 @@ DEFINE_TEST(test_I) skipping("setlocale() not available on this system."); #endif + lang = getenv("LANG"); + setenv("LANG", "en_US.UTF-8", 1); extract_reference_file(reffile); r = systemf("%s -I UTF-8 %s >test.out 2>test.err", testprog, reffile); assertEqualInt(0, r); @@ -51,4 +54,9 @@ DEFINE_TEST(test_I) assertEmptyFile("test.err"); assertTextFileContents("Hello, World!\n", "Γειά σου Κόσμε.txt"); + + if (lang == NULL) + unsetenv("LANG"); + else + setenv("LANG", lang, 1); } From nobody Sat May 4 12:37:41 2024 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 4VWnJ83tgWz5KVST; Sat, 4 May 2024 12:37: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 4VWnJ81LXWz44hw; Sat, 4 May 2024 12:37:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714826264; 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=ctKk1aRjqKJIn/F9okh7h5C+Lg1Sh2506mCvnTvnc84=; b=u8Iw2i7iOACF/ZEgy50FFK6iOPp22nwHQ3iKnogEno/dydIi8wzNOY38lr9YObQo4t3FEL 7JvX5LvOQEj4dRP0XcpYxRJw5oDlPAI4uJK20LKII4QFMskPIkHSUg/FAOaWy9rJxjGj9L r+cnTqRxHQQLDyQ/0gu5a2QMzI4AEwAJ4mpw6yR5J9LYRMPRg4d7tHHq5ZM0ESrlirZZBL hdKP0dP12CbEPZFIWoqVKOzvxyLVMw4JlavnzJe6+/6/bQ0zjl6xaw/bJ2MIWgF3ySIwrf lfK5330P26m1sntR/Xh4ZFMkGJsakHOwz0lOfcOzCqVfNOsoEGAIwy7R1rJSeQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714826264; a=rsa-sha256; cv=none; b=DwX1wt+J0xlBXPKqKU8vNpghyMZ5QnjgcyGMSOU+cI0AvEMuZnbP34UPe17RLPdAHmfpYT ARhidggoaKSVeYiHAilGVr3QhYtWvKMh4okPZlgP3fms5fxb+IpEz0t1Tc4ZhXkFwSUyai DvEB7I2QjHxfEQnrDZHFsH1D7TTbVDbBVcQvLXgAi/T13nSo23R9aJpvb2fUpxbnX7NeGR UHwbf7pAHlqmcdojIOdYqPfFPaQvxTF3NoPiEGgHPBU1Z0YhogNR3qiPRj5FaPLQwYExgf SvXjR+wbhPHTuMWhCVNiERBMzTuAQ4TofGT6d745u/iWjUawwTmhT2jRJRTWgQ== 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=1714826264; 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=ctKk1aRjqKJIn/F9okh7h5C+Lg1Sh2506mCvnTvnc84=; b=n1dPDlmeogBN3/MD1wIdp/MloP1dUa5IP9bqPDliVDLZ5k/wRMdm+/EHu9LLk/zscu5HgN eprdnaIvzdvEA50lDTnAS9JFitLzUeMDBYbrxI5pzfR4QzCeFNSDI+FG9erneA2YOCSxmg A15DXCAOqNl1PBnLUSzRM8P8AbpIxz5+52mXTCO+hDnzBSht9JGNb/8Av4SgLqUkgCTBDu MV0T3pVkFgImegxFCpVnhrOsxYdxHBsrVz7451ZOnICOzmHP45WhG20Qx56m4NNtvdItfw a2dAGJz4YM9y5TkMj3QBi/p4PbbBzqP5MgvAvQMBaimuzaZJnh9A8urzTsH0WA== 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 4VWnJ50blczVPG; Sat, 4 May 2024 12:37:41 +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 444CbfGt072573; Sat, 4 May 2024 12:37:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 444CbfYE072570; Sat, 4 May 2024 12:37:41 GMT (envelope-from git) Date: Sat, 4 May 2024 12:37:41 GMT Message-Id: <202405041237.444CbfYE072570@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Martin Matuska Subject: git: 4217cc09bdbd - stable/13 - libarchive: fix null format string error in tests (unbreaks gcc13 build) List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4217cc09bdbd0649d28ad8e0c8899e140085d05d Auto-Submitted: auto-generated The branch stable/13 has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=4217cc09bdbd0649d28ad8e0c8899e140085d05d commit 4217cc09bdbd0649d28ad8e0c8899e140085d05d Author: Martin Matuska AuthorDate: 2024-04-17 07:33:13 +0000 Commit: Martin Matuska CommitDate: 2024-05-04 11:53:07 +0000 libarchive: fix null format string error in tests (unbreaks gcc13 build) Obtained from: libarchive (d43c39247) (cherry picked from commit 701d0666c03dacba9b73d91dff2a6140e157bdc4) --- contrib/libarchive/libarchive/test/test_compat_lzip.c | 1 - 1 file changed, 1 deletion(-) diff --git a/contrib/libarchive/libarchive/test/test_compat_lzip.c b/contrib/libarchive/libarchive/test/test_compat_lzip.c index d3b8b118322b..1420e5bb9ac0 100644 --- a/contrib/libarchive/libarchive/test/test_compat_lzip.c +++ b/contrib/libarchive/libarchive/test/test_compat_lzip.c @@ -195,7 +195,6 @@ compat_lzip_4(const char *name) assertEqualString("test.bin", archive_entry_pathname(ae)); /* Verify the end-of-archive. */ - archive_set_error(a, ARCHIVE_OK, NULL); assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); /* Verify that the format detection worked. */ From nobody Sat May 4 13:05:33 2024 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 4VWnwF3sXyz5KXSL; Sat, 4 May 2024 13:05: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 4VWnwF2qsvz4CbZ; Sat, 4 May 2024 13:05:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714827933; 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=rJJb1RK6iHgYG0Sx1fxF0gTuHww10AtFvGWWFFcdEhs=; b=yRewN3+fI9t/LngY7mA0JcrecYoiUIRlAVxZ/pkHGHeCgvpn3BdgSPfXH/jrzhgy8qke8a uikqfVAdx+ZJrQanbL4ylyJCpDSOwvmsqUoubYmB09O7p62UErTCAhc9r/OOop+p1LZZnx tCaXmmN9CadXElzNYohrS0aaXHPsb9Lci0Sa0IfavvLkGoRsaLXo6mv2Hb9N77gK8Vys+v NAIXm3Nkno+o9JpEgBbwDiLD8H4zO6QxoiykyuTTGfxpwl8NcRgw5MBREq3ydsqlwqhqSl xpuhl2KLlcFmiNdyGmuwDud7aUvAzInFeRL2ljkXvaJWdMjONY/tMzX9G1h36w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714827933; a=rsa-sha256; cv=none; b=mTNs1Gj4gtGqXkjBA8IYrtTiUlHEUqvXpSgdZ7kgwScDTLRL1EqvuaP6FR0NxQ035GNqoL 0FzXA/cqor5tx5rWGbuX4MMjdx3K+H9laTXh9QpXkP4OLSoIyuUkSD/tIxEgu+dNM350/G Dqi+cavCIlOODjrRBN9ZR1oebDJS/inqmc4Mh2AiTpMGcm1dg9c2c1U1Sco9mKV2Brdzat 4YWyG/eMBSIqV0d+l1gKAhxKZPUHmw3ntgGBb1nekxU0Ppx3RyNnHsn6QxbBzBlQZ4kuXt dQjvunR7dIHr/sCobuXr9HQOfMRTZSk3EHuXjAPYUdzFd6vg+lFQSL0+VzjXAQ== 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=1714827933; 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=rJJb1RK6iHgYG0Sx1fxF0gTuHww10AtFvGWWFFcdEhs=; b=OHwqPhcH5DtuFu04j4qwxA+8ciueYhXEnzXvGBnGNYexV2Bj0PvOHfe7+o0YoalFRyQ0ZY T1AbjoYlvj5vpjU35iPn4H1dwqklCAhudXx4fMj1y14nfygvJmzx2/hDnwZz4tjOZURznS S1zaBbiYSmIy+XQ4amk3pPCMkNM/MIrBxQ7pKeJLUvV4X8sViFWj0KdXDsMFFHdlP0vY6B FtRV68Lib2T5QTtQQC7RovTn6LZRGNxJ8m+UTLUQnhUG6pRGxJ90+k4Ut8pY+cYt7XG17S 3H/ni48z1aNsHUPYixgqDlQ5wbziDsFIsCuHCddD3hXjENOnDp71CMoPlvaAsA== 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 4VWnwF29QmzWNb; Sat, 4 May 2024 13:05: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 444D5Xfu024284; Sat, 4 May 2024 13:05:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 444D5XF2024281; Sat, 4 May 2024 13:05:33 GMT (envelope-from git) Date: Sat, 4 May 2024 13:05:33 GMT Message-Id: <202405041305.444D5XF2024281@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: c32f8e613e57 - stable/14 - Document that gettimeofday() is obsolescent List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c32f8e613e5795239359ca53f7a4dfe30ed1933a Auto-Submitted: auto-generated The branch stable/14 has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=c32f8e613e5795239359ca53f7a4dfe30ed1933a commit c32f8e613e5795239359ca53f7a4dfe30ed1933a Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2024-04-24 11:31:54 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2024-05-04 13:04:47 +0000 Document that gettimeofday() is obsolescent Reported by: kaktus Reviewed by: kaktus, pstef MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D23942 (cherry picked from commit 4395d3ced5cfa46df400b5bb9996f9d74476997e) --- lib/libc/sys/gettimeofday.2 | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/lib/libc/sys/gettimeofday.2 b/lib/libc/sys/gettimeofday.2 index a27aecba3fc7..27149dcbeb1d 100644 --- a/lib/libc/sys/gettimeofday.2 +++ b/lib/libc/sys/gettimeofday.2 @@ -27,7 +27,7 @@ .\" .\" @(#)gettimeofday.2 8.2 (Berkeley) 5/26/95 .\" -.Dd May 13, 2021 +.Dd April 24, 2024 .Dt GETTIMEOFDAY 2 .Os .Sh NAME @@ -43,6 +43,17 @@ .Ft int .Fn settimeofday "const struct timeval *tp" "const struct timezone *tzp" .Sh DESCRIPTION +.Em Note : +The +.Nm gettimeofday +function +.Po but not +.Nm settimeofday Pc +is obsolescent. +See the +.Sx STANDARDS +section for more details. +.Pp The system's notion of the current Greenwich time and the current time zone is obtained with the .Fn gettimeofday @@ -123,6 +134,18 @@ A user other than the super-user attempted to set the time. .Xr ctime 3 , .Xr timeradd 3 , .Xr clocks 7 +.Sh STANDARDS +The +.Nm gettimeofday +function is considered obsolescent and its usage discouraged by +.\" XXX: This should be replaced in the future when an appropriate argument to +.\" the St macro is available: -p1003.1-2017 +.No IEEE Std 1003.1-2008, 2017 Edition (\\(LqPOSIX.1\\(Rq) . +Application should use the +.Xr clock_gettime 2 +function instead as +.Nm gettimeofday +might be removed in the future. .Sh HISTORY The .Fn gettimeofday From nobody Sat May 4 13:05:34 2024 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 4VWnwG4B53z5KXKQ; Sat, 4 May 2024 13:05: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 4VWnwG30GPz4Cdl; Sat, 4 May 2024 13:05:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714827934; 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=3N6sYRBMa8RFfOzdZUex0s/ABUAgRALf4W3o1XV0DDw=; b=bHdAsTVW35CcmdEHMPUX27zrC5k7M86Fx4WL1+s495qknTBTMDte8ahTePg5Btitk1kDU1 Oe82LQdmoYkeoK3lvQQ7w1u11W7cOzev6mN+7C4jqu+Hhgi4ah8e5KMxGvtU5BgQja3pnu Me9eROAdxYJp6FlPWId1u9b5yd6aBWSewTTn7b/KhT9LsEgRJCT+muxBWJWWQOk9e0Df1P fHcVVoFVS0b3Jb+cHbv9AD1GwuBhk8N7C6/ks5kOhlPyn5vLYHs61VjXO44hoI6H6DD7oQ LLqbx740ZGPSezhVeXdqHRfpmf53i7Cs2ajtv3FY3UQcgVb6pfcFhh5cJJfoLw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714827934; a=rsa-sha256; cv=none; b=bYtQKmk8ajjtMezwDVls+jlZyvYi6OC3wPw64cPcGNLX0ary+/5zD+GuPoZCJ/UJrNDJqj YAlOUJvqu30VxIW0+na8ITdght3u7CL6O5t9EhQAfZ+QSO74OkcCp3nKSsXFWrSqoME98F CLk1vgTH2miYT4e3du8ubPIS7CTRRINoTRRinUJOlccKRSkOjZ10WleQ+B21mioGX+OnBh MgWILOuUmVtTXBg9uxhzRrZ3QddvWXnItf7V2n0QudK02Npp2ygBg4wx+7ogYhyAUbdROj nBlc3Q5zv0PpIMt2cqOKvm6070X2ikZfiYNiPU2l03bWHyY4KfPcX52Nniko4Q== 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=1714827934; 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=3N6sYRBMa8RFfOzdZUex0s/ABUAgRALf4W3o1XV0DDw=; b=ag50zVgct9+SU93le25n1lLvCMsLac5/9ptg3Lhq1323WVJKVBOkKskTCIQ3Hp0kMmIN8/ ZwV7xWzfetK9+sDLhbwx0EiUJe+IXyd7e8uq6qnTwLxyLhZpAcDkga/XRN3weKd3J5/kP2 iSyaqFMR4VtlBNSN0D7ZO5pp69Iun0e2ukAUtlF+THC9tLp5Zg0GPsBgIJDpr89bOCWC3Q nmPBJcxr01wa6Wt1JvOuxPj6F51ttja+3of/YXFGx6TZKVRoJ7nIpU6Wdd+Io7/XfeaJ4J vk83SoSMJ5LF+mh/GIEnMTe4TmtxcM0TXH3qELv0Ag8XkObUpGBdK1wZSKZ0bA== 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 4VWnwG2c5rzW2D; Sat, 4 May 2024 13:05: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 444D5YKN024331; Sat, 4 May 2024 13:05:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 444D5YXN024328; Sat, 4 May 2024 13:05:34 GMT (envelope-from git) Date: Sat, 4 May 2024 13:05:34 GMT Message-Id: <202405041305.444D5YXN024328@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: ba13e6546d8b - stable/14 - gettimeofday.2: Do mention improbable future removal List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ba13e6546d8b95b76966cb4640bed64745a4d566 Auto-Submitted: auto-generated The branch stable/14 has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=ba13e6546d8b95b76966cb4640bed64745a4d566 commit ba13e6546d8b95b76966cb4640bed64745a4d566 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2024-04-28 18:06:05 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2024-05-04 13:05:09 +0000 gettimeofday.2: Do mention improbable future removal As kib@ noted: > Obviously gettimeofday(2) is not going to be removed > even in the far future. Reported by: kib Fixes: 4395d3ced5cf Document that gettimeofday() is obsolescent MFC after: 3 days (cherry picked from commit 6662c2312e956439652ce2d06b42753b6a78fc61) --- lib/libc/sys/gettimeofday.2 | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/libc/sys/gettimeofday.2 b/lib/libc/sys/gettimeofday.2 index 27149dcbeb1d..8412af6da5cf 100644 --- a/lib/libc/sys/gettimeofday.2 +++ b/lib/libc/sys/gettimeofday.2 @@ -27,7 +27,7 @@ .\" .\" @(#)gettimeofday.2 8.2 (Berkeley) 5/26/95 .\" -.Dd April 24, 2024 +.Dd April 28, 2024 .Dt GETTIMEOFDAY 2 .Os .Sh NAME @@ -141,11 +141,9 @@ function is considered obsolescent and its usage discouraged by .\" XXX: This should be replaced in the future when an appropriate argument to .\" the St macro is available: -p1003.1-2017 .No IEEE Std 1003.1-2008, 2017 Edition (\\(LqPOSIX.1\\(Rq) . -Application should use the +Applications should use the .Xr clock_gettime 2 -function instead as -.Nm gettimeofday -might be removed in the future. +function instead. .Sh HISTORY The .Fn gettimeofday From nobody Sat May 4 13:07:05 2024 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 4VWny21kN1z5KXKV; Sat, 4 May 2024 13: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 4VWny20s7Kz4Cvs; Sat, 4 May 2024 13:07:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714828026; 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=AyXc3HDaPUHEJMWU0xy5JNDKBXJnsxym9c1jC9RkHDI=; b=JdNsx+uppOuGTCD2fUQuIiIQTvtpbcgiqJIzQ1N+uPtcaso91hGneeHXKndR3xkR2hManU APKaDnymI3+bDrnqSJpaido+WaiLP79eXf7vePVuJGIBUwcZok3O4+NGzLbPEK89Ud3Q8x mLXrLhaeP9Ff6FMyv615+Poc8yLjpNWI2O3XFFIg6ayz/fz9mV1ffMJRxpl6AeoL7DXBKR pmqG/gDy7fxoLmaeJ4yUB4KlejVuTtkgP+v3s2zDKy1MxnLsMdFnaJVAnMthrMijzZTqkI 7b6DDyTZ7PAEh9v2JWgOrZOXRGJgAhXNjG5EElHnV7cob4RYUjVZV/Rwjn9DJw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714828026; a=rsa-sha256; cv=none; b=Q2/IfKLn/l4av9ZEOrpEzUHSwRLhsg07kWvD+yUEBj2RQUsUChYS7pNICIFMk2U+0orPjl hx6E/kEILEag/Hk+0mur83Lb3fqlVtpeuJ3YE8aYIISOjNJixsMZAqJCIEetCOzDYlsacZ KncKdpkjGIi+Xef/FDpGJO4oLmw4IP0rECqq1qfQZIG/uwdxvG6Cp1Jqf4csJXLAojypIU pbWKNrNSaL+cy1rHQZ0jwSfDUCY2xK/ES7ZMnjb8aAUdYF4tRRTs77S+69xKEGLUt0jE2p jh2WEM2iCIwkhnFeh/3k7bw6zHIZP83naPmcjaYBG1fHfVZuy5hxeQvBY0Oumw== 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=1714828026; 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=AyXc3HDaPUHEJMWU0xy5JNDKBXJnsxym9c1jC9RkHDI=; b=NyJydc19kbHh2aprWoWlpJj+TBkBRRAbzW7M2E7sfGAwQ3VPk489K4hh1xe3foKsq+TpbR 9H8rvwf4JWVbEoMolleP1DaCOTkSu7aPkzM+u2zUT+kQTglS0dBTsJqlJoUXxe1m/J6OpH lYPqGa9okJG4fTRVTfHAJH/Cq4QK/sKgDyDum/JpgHzDW0ik37a+qksN78+neQFKqqkrrw QQIdUVq+dY+QMYCOKzNcxpSexZYV8PRfa7ks4c8Z4ivavpkJh1UrRyjF81bgWNpFh8fNIG WVmBzWD6V6fC+E1TywkT3dhpn0gnUfNc0asgwwPkTlYeVMGETjx/7iBJZlMTCQ== 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 4VWny20P3TzWNc; Sat, 4 May 2024 13: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 444D75q8024673; Sat, 4 May 2024 13: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 444D75kA024670; Sat, 4 May 2024 13:07:05 GMT (envelope-from git) Date: Sat, 4 May 2024 13:07:05 GMT Message-Id: <202405041307.444D75kA024670@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: f7659ab23590 - stable/13 - Document that gettimeofday() is obsolescent List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f7659ab23590a46d148bf47db9eb4719f3c0aeed Auto-Submitted: auto-generated The branch stable/13 has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=f7659ab23590a46d148bf47db9eb4719f3c0aeed commit f7659ab23590a46d148bf47db9eb4719f3c0aeed Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2024-04-24 11:31:54 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2024-05-04 13:06:40 +0000 Document that gettimeofday() is obsolescent Reported by: kaktus Reviewed by: kaktus, pstef MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D23942 (cherry picked from commit 4395d3ced5cfa46df400b5bb9996f9d74476997e) --- lib/libc/sys/gettimeofday.2 | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/lib/libc/sys/gettimeofday.2 b/lib/libc/sys/gettimeofday.2 index a27aecba3fc7..27149dcbeb1d 100644 --- a/lib/libc/sys/gettimeofday.2 +++ b/lib/libc/sys/gettimeofday.2 @@ -27,7 +27,7 @@ .\" .\" @(#)gettimeofday.2 8.2 (Berkeley) 5/26/95 .\" -.Dd May 13, 2021 +.Dd April 24, 2024 .Dt GETTIMEOFDAY 2 .Os .Sh NAME @@ -43,6 +43,17 @@ .Ft int .Fn settimeofday "const struct timeval *tp" "const struct timezone *tzp" .Sh DESCRIPTION +.Em Note : +The +.Nm gettimeofday +function +.Po but not +.Nm settimeofday Pc +is obsolescent. +See the +.Sx STANDARDS +section for more details. +.Pp The system's notion of the current Greenwich time and the current time zone is obtained with the .Fn gettimeofday @@ -123,6 +134,18 @@ A user other than the super-user attempted to set the time. .Xr ctime 3 , .Xr timeradd 3 , .Xr clocks 7 +.Sh STANDARDS +The +.Nm gettimeofday +function is considered obsolescent and its usage discouraged by +.\" XXX: This should be replaced in the future when an appropriate argument to +.\" the St macro is available: -p1003.1-2017 +.No IEEE Std 1003.1-2008, 2017 Edition (\\(LqPOSIX.1\\(Rq) . +Application should use the +.Xr clock_gettime 2 +function instead as +.Nm gettimeofday +might be removed in the future. .Sh HISTORY The .Fn gettimeofday From nobody Sat May 4 13:07:07 2024 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 4VWny34fdgz5KXSR; Sat, 4 May 2024 13: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 4VWny331MYz4D84; Sat, 4 May 2024 13: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=1714828027; 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=zsxJbd9QmEj2TS0PA7kCcE4fUqwswRGMl4xu456uV88=; b=Iw8Xyg8nfkJUrWbvLAvk8A5prqhZX8bjZsHqGhaKiyAuBfp4jShftC5T77IlaKZxvcHx33 P2vOc7+LZ7aGdZlfrCyZJhNPsEoCUp56OlMw4CUMoXYEB17JOgebfDAGs4z7poAROzq1Do gTMbbjQ0TwxnS2Wyfp+IYjM4pHmdmovaVGS8BP0YcDhAV2mwU0hf/bz/djd6Jr2BZpNo+7 nrPXzYhmEN8PBZhJBzDH5fA5efS/c0g38XcKLNWT/AC6PbOo/tX0iOPp2PmTfL7XOwkhqm 84QDrzu0DnT1xiOiHWyEtJNRiTN/v9tjqWEPvQRNoSaQ7CaLxGG3tFtyfdXKNA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714828027; a=rsa-sha256; cv=none; b=rAOqkYLgcn0pky9NCM657wVXQ+v2etoP6LMajo8BxpR4uWdYLQruZVkQzUqfiCF3rQveDL /9APlQWOh1IQI5beDuuwpZSb2Aj7MfSuSxWCdrEWGRgEJoF7MhtcK7LwLl4tO7IPtgsscH ZCDJ+YUzoFo9QJ1X8for1Ou18cZzYh62zcZtlur+/WKPGqGW/3254+e4LEYmRROyQd6ThX QZ0EQZAXogCLS7kGVx18uFwcGvpKSMBMNN55i2JYvUdlVeCYMYdD6pnY3R/1wHazG30ZSC SH6rjZaeARGtY4LxuOm9raYpanP3cO8tH9g1R2XMgE6G4mpmDMuWMRjucZzVdA== 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=1714828027; 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=zsxJbd9QmEj2TS0PA7kCcE4fUqwswRGMl4xu456uV88=; b=BddnnSnMvEtKyx+6gHEiYfQeeOqvFK8dKt4QqU3nL/I6U/r+pWyBjegyR/ONOzSZ1Z1eP7 8pROixjTpC5xD3tlMqw9oHQ9wrQO3xhZxor90+FurzKWacON8pvUCOk8PTE13eFwd7MVrv CMKy9uqv3597qptGqVnGoFTv/QYhUcOIZazPcpUvxsk2oeE+7bfYtg20MkomNuhAmZ/RJF bXL8eL02EVQfbyTOC6X19A3tWbu2MAF/rt4m7/KbjHWkZni/v6hEdtfLE2a1a2d3fM6rnX yYF5fpI0Na3XPqdeYMBU2boVL7TEBdA1L4m31btFw5R1LG45SklML+/1RQZ2oA== 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 4VWny31gsbzX5x; Sat, 4 May 2024 13:07:07 +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 444D77SU024718; Sat, 4 May 2024 13:07:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 444D77BA024715; Sat, 4 May 2024 13:07:07 GMT (envelope-from git) Date: Sat, 4 May 2024 13:07:07 GMT Message-Id: <202405041307.444D77BA024715@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 64f6c5fd9bea - stable/13 - gettimeofday.2: Do mention improbable future removal List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 64f6c5fd9bea2f25d0459347c6626f5b51989e73 Auto-Submitted: auto-generated The branch stable/13 has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=64f6c5fd9bea2f25d0459347c6626f5b51989e73 commit 64f6c5fd9bea2f25d0459347c6626f5b51989e73 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2024-04-28 18:06:05 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2024-05-04 13:06:55 +0000 gettimeofday.2: Do mention improbable future removal As kib@ noted: > Obviously gettimeofday(2) is not going to be removed > even in the far future. Reported by: kib Fixes: 4395d3ced5cf Document that gettimeofday() is obsolescent MFC after: 3 days (cherry picked from commit 6662c2312e956439652ce2d06b42753b6a78fc61) --- lib/libc/sys/gettimeofday.2 | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/libc/sys/gettimeofday.2 b/lib/libc/sys/gettimeofday.2 index 27149dcbeb1d..8412af6da5cf 100644 --- a/lib/libc/sys/gettimeofday.2 +++ b/lib/libc/sys/gettimeofday.2 @@ -27,7 +27,7 @@ .\" .\" @(#)gettimeofday.2 8.2 (Berkeley) 5/26/95 .\" -.Dd April 24, 2024 +.Dd April 28, 2024 .Dt GETTIMEOFDAY 2 .Os .Sh NAME @@ -141,11 +141,9 @@ function is considered obsolescent and its usage discouraged by .\" XXX: This should be replaced in the future when an appropriate argument to .\" the St macro is available: -p1003.1-2017 .No IEEE Std 1003.1-2008, 2017 Edition (\\(LqPOSIX.1\\(Rq) . -Application should use the +Applications should use the .Xr clock_gettime 2 -function instead as -.Nm gettimeofday -might be removed in the future. +function instead. .Sh HISTORY The .Fn gettimeofday From nobody Sat May 4 13:08:41 2024 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 4VWnzs47wrz5KXcd; Sat, 4 May 2024 13:08:41 +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 4VWnzs3dcvz4Dk2; Sat, 4 May 2024 13:08:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714828121; 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=bAp25YQmL/qYFx8krgFL6Z4RlD8L0rUzDFc9f8SPb8A=; b=FyiDrWkkmraL+6a5LWDS3hnH80FR1gjsY0JO6Mic55XCdo6ZUSh95TGIuY4pYrYzAmtZAl eMvSC7ZveezFVXfCLnZBAXaaO+smf1L3zlb8MEUp37+qDl75lrYOpE4Mp7MbRiidQyVoCZ VBDvNgStxbO8YcyO0+gewiP7WZgDKQXZYQgXNwITb+XA9k8gphveWXThRzhWA+Md2Ka8+t lp3HhsVShJG7MnpX3m60JoluAnbPKY2grnLsSVSBcglfDLRL/KXY81CeM+67L+HnWzgqfU LxIcCJID6cTztmOldGCvnCS0+Lvfc7qtSkN4iVdHKFag3ifUkPGu3ry5HZaRvw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714828121; a=rsa-sha256; cv=none; b=eO0HYf37XaFjW5sziwRFBK+9Lynre+8ZHFZ6iTyB57u9hqjnk1/LTUrMXVB9YUm4b5pmQN tGPCRaIvbQJIJHU69ILr0NpZwhYHlIL0/KJglqY2DFm1b8fTMiiZx/CxkKx0OjyUIEZGJh PbNCHNoFlkQQesDodRu2EJak3xtwlwSjvZ0CN5FEOX7rRhhCRHdkiSa2S7kFq5+pQ+dBve J0dW0R5IotYLxDc/Fil3uqMju3PW6wiE4gnxo86xUjTySLRLqPaSjdsPlbAvrGOcBYARCo GQG6El5YWjUQ1J+diEFhRghHPkJMdk1Yz4rUtMXiPHwguG5gbibsGqIaJXUl5w== 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=1714828121; 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=bAp25YQmL/qYFx8krgFL6Z4RlD8L0rUzDFc9f8SPb8A=; b=HthoE7TqvPCyBhhuHKfKPSksmGTWVWSYIZ0maZQZinmf0IKrWDpkuCTqnoClUwluNK27aW N82Fh3H+Y0CYkkAT0nTZ1O371VITH+pORqqFsQH1au9w+Awn+m0uKyc2vwGfiKtn9n5DFQ 4oVay6DzMiU128mTl+meJGvygtucEb8xSs5gVKN50ECJnogp+MIeiU2B39hj2IjVU9I2iO cenP2A0+HonzEzAXVFrA+z4ho9qt8NNlm2pddxyW932RVT3NjRneUMk3xCepbJPX4c6ATn yFZcNHxmVY+KBjB7w8qlIUAL0qFdfMcMDhj4PUGhnQJwysZ22XwGN21aFfSZ0g== 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 4VWnzs35xlzW2F; Sat, 4 May 2024 13:08:41 +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 444D8f7N025087; Sat, 4 May 2024 13:08:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 444D8fFk025084; Sat, 4 May 2024 13:08:41 GMT (envelope-from git) Date: Sat, 4 May 2024 13:08:41 GMT Message-Id: <202405041308.444D8fFk025084@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 1d28a8566f33 - stable/14 - style.9: Document the existence of tools/build/checkstyle9.pl List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1d28a8566f33b1e1915f6162f98ffdbd8d3dc001 Auto-Submitted: auto-generated The branch stable/14 has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=1d28a8566f33b1e1915f6162f98ffdbd8d3dc001 commit 1d28a8566f33b1e1915f6162f98ffdbd8d3dc001 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2024-04-26 09:37:01 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2024-05-04 13:08:31 +0000 style.9: Document the existence of tools/build/checkstyle9.pl MFC after: 3 days Sponsored by: Klara, Inc. (cherry picked from commit 5626f9e790901999def12040a60746b0ceeb9b95) --- share/man/man9/style.9 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/share/man/man9/style.9 b/share/man/man9/style.9 index 25a501884026..f00286ba9c48 100644 --- a/share/man/man9/style.9 +++ b/share/man/man9/style.9 @@ -24,7 +24,7 @@ .\" .\" From: @(#)style 1.14 (Berkeley) 4/28/95 .\" -.Dd July 28, 2022 +.Dd April 26, 2024 .Dt STYLE 9 .Os .Sh NAME @@ -915,6 +915,10 @@ instead of the older .Fn CTASSERT . .Sh FILES .Bl -tag -width indent +.It Pa /usr/src/tools/build/checkstyle9.pl +A script to check for violations of +.Nm +in a source file. .It Pa /usr/src/tools/tools/editing/freebsd.el An Emacs plugin to follow the .Fx From nobody Sat May 4 13:09:07 2024 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 4VWp0M3g38z5KXM8; Sat, 4 May 2024 13:09: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 4VWp0M31Gzz4Dyy; Sat, 4 May 2024 13:09:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714828147; 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=34a0N4grWhhHuwL9bl8637OFv3euT5yd7CUWYHWntsk=; b=bH5kPPEI2TAsei5BMB527h7ESlVuUJ3R5rfjesOQ1QHvlrHSUxZlFotzQAOKiUS8O7wdFn qgjUDc2d2oWbtpyEnJCsgpWdsFPu+UF5N13JV171NA376X8ZFirKJxFO2EVXLYyiH190Q6 jXNEpucioXn0Cv9xAkEh3EZ8laUCiniltPJfVnG4ic0/9p8ORAljETcocU7q99UtUvw5Ng RP7gPWlrvBRsK2+oeOXVLJG5ibvSQW6KJ/uxgbe/mdUanabcBn6itAm27OhM0w/AxCxSqN 1WzRbYmvbjz0lFjWxeT+vtt/nYq1idSLyvml7Qd3R/eAoeL8NRNpDyKteX0rog== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714828147; a=rsa-sha256; cv=none; b=Jv3TuUPvMx/lySrn0Zglza0LKV9VnUzoH5lUssp3ykMKN36hlxoKSpJwJ7I6jqqbWdN7rX w6PdPWkCMtBKLUUaybyiI2lZau+HC6ZzHfuQRt9rtisGBQqhMylaq1I62Omo/Sp/23wPPq H23FfEKGRZFCUFCTupBqd7+hJUsJdVR2uCR9vNF+QdwI/WfWhObUfahyrn3n4wM2MgOZFE V0majcI97CDd8Z4LzumRgxn/5+58nl+yUnS+5tPKaEB7WSq/VTbHnVMjcr79FN6nOnsmpW GrLLO7UL0+MQfbxJy5M3qvtvnh/+YXY8d4CaJYj7jqSh5bMr6Z7QGSGwOottOA== 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=1714828147; 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=34a0N4grWhhHuwL9bl8637OFv3euT5yd7CUWYHWntsk=; b=Hu6H6p3uM9dL793OKbsFxjOZAry81PloC4J9X1FDpjnBY+GIyRrVNjKeT4oi9OXXOEZvUw QmAdY1zeal4aCHXVSVLHdJuSR1mbpSJGvdy67RubwJhA1cMdoBtrOBOZBpN7kel411464f kDrFoePAmtFJPEi9+JXItK0JrNiU0ZVTYIdiVq5+nF5LbAmVXfGNPua1ras/CvvjZbyv8I HQIfcbKPQcwHFxqjXwS1Ik+3A2BNYOrFO+cJFSpczxRyvJzAbr1Q+BaxUSVTWFLjLUuH8f 8f9QLSFdwcSB4XviDtKC7mU+8+O5bybyfnuEd2VxYuN3MYclAExYeb6A8prjLg== 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 4VWp0M2WgNzW2G; Sat, 4 May 2024 13:09:07 +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 444D97Ta025273; Sat, 4 May 2024 13:09:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 444D97MG025271; Sat, 4 May 2024 13:09:07 GMT (envelope-from git) Date: Sat, 4 May 2024 13:09:07 GMT Message-Id: <202405041309.444D97MG025271@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: cecda19fd6bf - stable/13 - style.9: Document the existence of tools/build/checkstyle9.pl List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: cecda19fd6bf54f0d009b54ea8b092745d607443 Auto-Submitted: auto-generated The branch stable/13 has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=cecda19fd6bf54f0d009b54ea8b092745d607443 commit cecda19fd6bf54f0d009b54ea8b092745d607443 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2024-04-26 09:37:01 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2024-05-04 13:09:01 +0000 style.9: Document the existence of tools/build/checkstyle9.pl MFC after: 3 days Sponsored by: Klara, Inc. (cherry picked from commit 5626f9e790901999def12040a60746b0ceeb9b95) --- share/man/man9/style.9 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/share/man/man9/style.9 b/share/man/man9/style.9 index 2b8fb1cd5654..8e654570fc20 100644 --- a/share/man/man9/style.9 +++ b/share/man/man9/style.9 @@ -24,7 +24,7 @@ .\" .\" From: @(#)style 1.14 (Berkeley) 4/28/95 .\" -.Dd October 28, 2020 +.Dd April 26, 2024 .Dt STYLE 9 .Os .Sh NAME @@ -906,6 +906,10 @@ instead of the older .Fn CTASSERT . .Sh FILES .Bl -tag -width indent +.It Pa /usr/src/tools/build/checkstyle9.pl +A script to check for violations of +.Nm +in a source file. .It Pa /usr/src/tools/tools/editing/freebsd.el An Emacs plugin to follow the .Fx From nobody Sat May 4 13:18:28 2024 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 4VWpC975ZMz5KYCr; Sat, 4 May 2024 13:18: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 4VWpC90k2Wz4G2y; Sat, 4 May 2024 13:18:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714828709; 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=jvuYTHRDTydH8zyxOBrgqEcfkZZr+cznJhFzT3xwf6c=; b=Fnth3UC2pJSgnuIROtNmRg2F7BiNuViYrkqaARQgfycnJ2giD7CftVamgWlK3/Gq5wxci0 UgPOX+hZsz5bw7/CtjIpS2JGpHrP+ytL1VqCRhLvO91UhuaQ8bdYJwBaixtSVbjyPy+B7s 5hDiRhynqNDSnjFJqdTfSZeN9+zdy0ud/IF4deXkEaeLKIz7doH2ONxMCpWC8+3AE+/J9C ZlO2xytIAwZfTKsikSuc9y4SUk4XxyLCJMZSiIT3oulfE5lLM2WY9FnHPaLk+WFs5hDm/y gJ6MsrbGrE6F2xXIinus55rxydESblWBBkpFMRi+RJSiGN9Xxekr+aZK+G7Rww== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714828709; a=rsa-sha256; cv=none; b=ES85T0x5L44wTEgimOK57yxq1+rQfRZLpSowYBzINz4QOsa9SMEB03K4CuU1aVDu3sBvfC VM8FmZqyfOpazAGAOHNpQVqRTaJN3BVhmmd58bHLiy7uMu8EV/13cr3U9aRz1t/jPNEAAt cqMNO0WOoIvYW//7X0+fXhwajH88DBNZoKjqBq4+ov4bGzlu2szPL6Lx/aNZYT/kiV581q 6iYVUikinjlijzMJsRBqs+L9KKDDqNd8ixU8hxZwj+S/AfEd2PxNEn+wdSKZvST46iSuBx RMmSI19QhZw/+RB00Gj/Vc9lmhVy6nxGz6cPG72kGVwneZ6XvEgiNP1wkztqog== 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=1714828709; 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=jvuYTHRDTydH8zyxOBrgqEcfkZZr+cznJhFzT3xwf6c=; b=va5eKqK4Cv7geWShEjWxssByW7oZCU6frbaU6/I25e6jSb+eAepGduBzPYgeoUU4sR6iBe m7KUl1PrtGAay75U5dj3z65uZJp4uaLDLZAcxDQVNyJnaj8SpawliXkdxtSs2RQeGvee8x tz1DzhODUuW+7Ll/l+jENDoRVTk8LKb/M6BRhvsytbIyWG8dEKdr5XUVOPO7jf4eAw7NO+ RMeAaAzJX7iJfCKzpJz2ecZqy/NoFameq5mqQ2LMHoXur42/lVi1Iq8OC8g6tEkFu8lHI4 O9rgga0NbTSlmqkh6Iw5NEzUpRXpjDJpFG6HEYel0bqx4Yo9rIelPZSRMMeEmg== 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 4VWpC86LNPzX3x; Sat, 4 May 2024 13:18: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 444DISAc042266; Sat, 4 May 2024 13:18:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 444DISaE042263; Sat, 4 May 2024 13:18:28 GMT (envelope-from git) Date: Sat, 4 May 2024 13:18:28 GMT Message-Id: <202405041318.444DISaE042263@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 7de39f926cd0 - stable/14 - vmm.4: Add verbiage about need to load module from loader.conf List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7de39f926cd0aac52f292a5e8bb7b065c891cd6d Auto-Submitted: auto-generated The branch stable/14 has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=7de39f926cd0aac52f292a5e8bb7b065c891cd6d commit 7de39f926cd0aac52f292a5e8bb7b065c891cd6d Author: Michael Galassi AuthorDate: 2024-03-06 14:49:21 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2024-05-04 13:18:05 +0000 vmm.4: Add verbiage about need to load module from loader.conf PR: 277530 MFC after: 1 week Co-authored-by: Mateusz Piotrowski <0mp@FreeBSD.org> (cherry picked from commit d0168b32bc67033414e43f07eff2a4e850652c29) --- share/man/man4/vmm.4 | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/share/man/man4/vmm.4 b/share/man/man4/vmm.4 index cb3276a7d8f1..dfd7ad26fb98 100644 --- a/share/man/man4/vmm.4 +++ b/share/man/man4/vmm.4 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd October 12, 2023 +.Dd March 6, 2024 .Dt VMM 4 .Os .Sh NAME @@ -70,6 +70,19 @@ See the .Sx EXAMPLES section below for sample usage. .Pp +Note that +.Nm vmm +must be given first the right of refusal to all +.Xr pci 4 +devices it may need to claim. +As a result, the +.Nm vmm +kernel module almost certainly needs to be loaded from +.Xr loader.conf 5 +rather than by adding it to +.Va kld_list in +.Xr rc.conf 5 . +.Pp A large number of PCI device entries may require a string longer than the 128-character limit of .Xr loader.conf 5 From nobody Sat May 4 13:18:31 2024 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 4VWpCD4lqTz5KYPM; Sat, 4 May 2024 13:18: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 4VWpCD02ZPz4G0c; Sat, 4 May 2024 13:18:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714828712; 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=d78X0VsS+YBpI3Y2BeAV4HVIWd1ZSWtg/9Kggx84034=; b=oqqY/yrfYQoEWa97TMKzeCrHcj/lh/TgjouUvcxoev7gIM5SrrgOGv75rz/BQM9PSrd566 6OUREnf+4wV8+iBCfKBN1LA5Z9htg+XXt5O0lz/PqIpGD5gv3tRVsF///x+vLnWAz279JA OTtTEaNhXASYYaKPbLMWsaYcWEG2tsupiwK831qAgf0sRLU5hW8afdFfp/wvYm4HUXS54K X7nq1Xk6XrwKBqjMh/Gm8OqgIvoP4noQ+HMSMZZNF73hjuiuEzu36F1G+EJtyYEhTRQZ3Q PzcCY3omC/DAQWKfiWJxPZytaRxNxJPV35ri1S8iW19FtXNF/5r46Kt1qDc2bg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714828712; a=rsa-sha256; cv=none; b=ubRZPjFVlO1ztPiHsT/il2lDOqrPQGekJJpcwx/TJuEerCawUHedFKFyQa4ouRiD+ok5d7 tlmw0V5Wmao4IkLZgEY1jH31cEYN63p9uqkkTdYlzTMEK2p75g5cfEna0OrO03nAxQmpYG EXRAUDGJRqKhLovVVRt1okL1dP5+Rh1/CS7e/AqpjfHA5+VWGVIUPUaZb1XI/Z7uRfSvMn yiEEtJg8UQqhiCWno8BO9CgM3KvUxRtw3A6nyNm19EBP9qKLb50c8AzKYdGj4AAYLxCeag 9q73hMU9+8ogxyDEfrvYT6Dx778+/vTg40vPeEVjyk1BEcRgaVvJeZTg0SPqRw== 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=1714828712; 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=d78X0VsS+YBpI3Y2BeAV4HVIWd1ZSWtg/9Kggx84034=; b=sor9d8eprCV8EbEB5OAZJ2wb4l2A4Sog6NkUTEj30uAoNxSi3EfwtySpwMBs8VcCYwKp+t EioY3Nf3X1ODZZNHOLSju0zFCgAg50yxZdaBexAKzrwCrmJUmSkZDwn/juqVsD70nVu3tb L3eqPwkFN7GFLpDGFt8weVkhFaQCWCSKRpjAqBsOSxvN3LL/UasGJTKT4y7KXkwtVF8XT3 Ctq3AHTrWyMl2aPPQVcUL+aMmJUUn+fv4tLQAAfgrjsoATVNWPK/4v4Kwmux4LA9d7Olh3 DlUndXo8CyAfXYKnKfnoHYnpqXOjzUOCx6Y4MSehiroifmbsTT1jIcy7TGiCnA== 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 4VWpCC6SJ2zX40; Sat, 4 May 2024 13:18: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 444DIVie042427; Sat, 4 May 2024 13:18:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 444DIVYM042424; Sat, 4 May 2024 13:18:31 GMT (envelope-from git) Date: Sat, 4 May 2024 13:18:31 GMT Message-Id: <202405041318.444DIVYM042424@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 76f866f0f696 - stable/13 - vmm.4: Add verbiage about need to load module from loader.conf List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 76f866f0f696e784b2c01711da2e8fa3f35264fe Auto-Submitted: auto-generated The branch stable/13 has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=76f866f0f696e784b2c01711da2e8fa3f35264fe commit 76f866f0f696e784b2c01711da2e8fa3f35264fe Author: Michael Galassi AuthorDate: 2024-03-06 14:49:21 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2024-05-04 13:18:15 +0000 vmm.4: Add verbiage about need to load module from loader.conf PR: 277530 MFC after: 1 week Co-authored-by: Mateusz Piotrowski <0mp@FreeBSD.org> (cherry picked from commit d0168b32bc67033414e43f07eff2a4e850652c29) --- share/man/man4/vmm.4 | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/share/man/man4/vmm.4 b/share/man/man4/vmm.4 index fbbd5fc8b300..11c2d4bb0ed4 100644 --- a/share/man/man4/vmm.4 +++ b/share/man/man4/vmm.4 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd October 12, 2023 +.Dd March 6, 2024 .Dt VMM 4 .Os .Sh NAME @@ -70,6 +70,19 @@ See the .Sx EXAMPLES section below for sample usage. .Pp +Note that +.Nm vmm +must be given first the right of refusal to all +.Xr pci 4 +devices it may need to claim. +As a result, the +.Nm vmm +kernel module almost certainly needs to be loaded from +.Xr loader.conf 5 +rather than by adding it to +.Va kld_list in +.Xr rc.conf 5 . +.Pp A large number of PCI device entries may require a string longer than the 128-character limit of .Xr loader.conf 5 From nobody Sun May 5 06:40:16 2024 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 4VXFKD59PQz5JBK9; Sun, 05 May 2024 06:40: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 4VXFKD4TZmz3ypH; Sun, 5 May 2024 06:40:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714891216; 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=Fw0atGa0Dcz4k4Iv+ow2X4+D0ZaKbZQomjiue1potvo=; b=ylfRwQkFmneKZRa+evrap5/big3G5LIlsOPBpD7PNVezyMY4xI8Z5OwfAGvJeRm1h/zH8v hgqrF9BSJnWe7BgIuUvQFtiWN7MHPxLtFkAnsHDfQtcv9dNOzdg4Y42ckSkZIXhh1DkAAR Kg9S+7KrYoVwyGpojWQ1Tz0XNV3x7MN7yfiIJGrWbT4f0XZnRHVbahyTfWXKKb6ZKCc/AQ pBvcO6DXN4hRaPuUEnu7itm+T+IIIzaxPLmdNxApbBtixpQ0875w9+dI22d1TeAuOoZ5WT NRWIOcihph41l+d4toJQJvm9ZfM3A/y+GwdKFb7V2La4HnqEDv09hPbIAgUJpQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714891216; a=rsa-sha256; cv=none; b=jTuow778jXMrOr7/53SHIrffBaipn++8YE+5fthgFB0VbeuBBQLMGB917N0VjHZd00aPxN Yc4gfXey/7PWIuIvYGIasrrMjRalyGcameX9aEtxqqPQBZdk1O0IY4CIH+ZniBLPscgVaE PWk38gSVLrdjhEh2zqoMw0EVHBOPOzmf2n28C1AYXq31dELPtgZAnkKnEX0n+z7UV5CClv DRnL7mTuLyXGNGgM+YW5ppsZjF5xDL6bNPCwwzbgmwXoxjqgDQviB/AnxfxIsa0mQyqf4Z e2rQyPaX7qBynNBpPd8d6pXz/xiB17kM7g5PLTPd/eB7iqjNFWVTC03CtaQfVw== 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=1714891216; 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=Fw0atGa0Dcz4k4Iv+ow2X4+D0ZaKbZQomjiue1potvo=; b=LNIoBpMuewfeBF5Oq+e26Inyqciwa4+YC3SRoLqRd943Ro7QohhGkkOFdv3Rkqzit/RNov yQQGqxBGc38xDE2RcBF2vgOygyHtMN/+iRCTqXEZvcur7kK2vsb/ILtd/jMFyBve8z7JwO Sz4bSMxrhc8r00xDlKchC9NiSVkxuipoJ2yHKKgb+bjlx6CbK8j8h2Cb9R5SuRJ4Mnn/tj zTWfLn2lxKf8MeRodKOsPF8Nn8M41kOtSmBVwFbPo/LIxpZKWcEET3OoC//UOSSwShy9z3 8x7Gpl5VN77pyrBol6zCCaMMgUR3VIbrRNagrs0x1xPQcVBjqcMD5MNQITZpmA== 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 4VXFKD3yYdz137D; Sun, 5 May 2024 06:40: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 4456eGC1009969; Sun, 5 May 2024 06:40:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4456eGR0009960; Sun, 5 May 2024 06:40:16 GMT (envelope-from git) Date: Sun, 5 May 2024 06:40:16 GMT Message-Id: <202405050640.4456eGR0009960@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: b7e312c5abad - stable/14 - in_pcb: don't leak credential refcounts on 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: b7e312c5abad2fbae469f434cc0c36257c6bb3b8 Auto-Submitted: auto-generated The branch stable/14 has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=b7e312c5abad2fbae469f434cc0c36257c6bb3b8 commit b7e312c5abad2fbae469f434cc0c36257c6bb3b8 Author: Richard Scheffenegger AuthorDate: 2024-05-01 06:40:40 +0000 Commit: Richard Scheffenegger CommitDate: 2024-05-02 23:02:55 +0000 in_pcb: don't leak credential refcounts on error In the error path during allocating an in_pcb, the credentials associated with the new struct get their reference count increased early on, but not decremented when the allocation fails. Reported by: cmiller_netapp.com MFC after: 3 days Reviewed by: jhb, tuexen Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D45033 (cherry picked from commit 30cf0fbf26243f23631739f406959ce5aaba9f5c) --- sys/netinet/in_pcb.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index 95e162e60f53..0fffd285fb17 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -657,6 +657,10 @@ in_pcballoc(struct socket *so, struct inpcbinfo *pcbinfo) #if defined(IPSEC) || defined(IPSEC_SUPPORT) || defined(MAC) out: + crfree(inp->inp_cred); +#ifdef INVARIANTS + inp->inp_cred = NULL; +#endif uma_zfree_smr(pcbinfo->ipi_zone, inp); return (error); #endif From nobody Sun May 5 11:42:05 2024 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 4VXN1l2XtHz5Jjph for ; Sun, 05 May 2024 11:42:19 +0000 (UTC) (envelope-from freebsd@oldach.net) Received: from nuc.oldach.net (hmo.in-vpn.de [IPv6:2001:67c:1407:60::1]) (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 (2048 bits) client-digest SHA256) (Client CN "hmo.in-vpn.de", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VXN1k0rmZz4T6x for ; Sun, 5 May 2024 11:42:17 +0000 (UTC) (envelope-from freebsd@oldach.net) Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of freebsd@oldach.net designates 2001:67c:1407:60::1 as permitted sender) smtp.mailfrom=freebsd@oldach.net Received: from nuc.oldach.net (localhost [127.0.0.1]) by nuc.oldach.net (8.18.1/8.18.1) with ESMTPS id 445Bg5PV007938 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sun, 5 May 2024 13:42:06 +0200 (CEST) (envelope-from freebsd@oldach.net) Received: (from hmo@localhost) by nuc.oldach.net (8.18.1/8.18.1) id 445Bg53g007937; Sun, 5 May 2024 13:42:05 +0200 (CEST) (envelope-from freebsd@oldach.net) Message-Id: <202405051142.445Bg53g007937@nuc.oldach.net> Subject: Re: git: cecda19fd6bf - stable/13 - style.9: Document the existence of tools/build/checkstyle9.pl In-Reply-To: <202405041309.444D97MG025271@gitrepo.freebsd.org> from Mateusz Piotrowski at "4 May 2024 13:09:07" To: 0mp@FreeBSD.org (Mateusz Piotrowski) Date: Sun, 5 May 2024 13:42:05 +0200 (CEST) Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: freebsd@oldach.net (Helge Oldach) X-No-Archive: Yes List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Greylist: inspected by milter-greylist-4.6.4 (nuc.oldach.net [0.0.0.0]); Sun, 05 May 2024 13:42:06 +0200 (CEST) for IP:127.0.0.1 DOMAIN:localhost HELO:nuc.oldach.net FROM:freebsd@oldach.net RCPT: X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.30 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.998]; R_SPF_ALLOW(-0.20)[+mx]; MIME_GOOD(-0.10)[text/plain]; ARC_NA(0.00)[]; FROM_NO_DN(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:29670, ipnet:2001:67c:1400::/45, country:DE]; MISSING_XM_UA(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; MLMMJ_DEST(0.00)[dev-commits-src-branches@FreeBSD.org]; MID_RHS_MATCH_FROMTLD(0.00)[]; TO_DN_NONE(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DMARC_NA(0.00)[oldach.net]; RCVD_TLS_LAST(0.00)[]; RCPT_COUNT_THREE(0.00)[4] X-Rspamd-Queue-Id: 4VXN1k0rmZz4T6x Mateusz Piotrowski wrote on Sat, 04 May 2024 15:09:07 +0200 (CEST): > The branch stable/13 has been updated by 0mp: > > URL: https://cgit.FreeBSD.org/src/commit/?id=cecda19fd6bf54f0d009b54ea8b092745d607443 > > commit cecda19fd6bf54f0d009b54ea8b092745d607443 > Author: Mateusz Piotrowski <0mp@FreeBSD.org> > AuthorDate: 2024-04-26 09:37:01 +0000 > Commit: Mateusz Piotrowski <0mp@FreeBSD.org> > CommitDate: 2024-05-04 13:09:01 +0000 > > style.9: Document the existence of tools/build/checkstyle9.pl > > MFC after: 3 days > Sponsored by: Klara, Inc. > > (cherry picked from commit 5626f9e790901999def12040a60746b0ceeb9b95) There is no checkstyle9.pl in stable/13 yet. Pending for MFC? Kind regards Helge From nobody Sun May 5 20:43:25 2024 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 4VXc254GKwz5KhPB; Sun, 05 May 2024 20:43: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 4VXc253p5Bz4Vr6; Sun, 5 May 2024 20:43:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714941805; 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=sFKAxnWZpPB3r+FkfrYLEIzlYnyvnd8gXAp71gnCFH8=; b=Lxt7tS/kKPTRpCjWOEf961VY8bBp+52+/PGTr0ePhjrmW5Bc+2qsaAChdmtuvDkjKptGxV fUGVjAyNhnFX2N39r6479mijSNhXSARO7iCwaa1wgDHbllmkocMvLVi2Ar+QsUOG2qtMbF 2mzFNqM9vREz4R1s909cu48Tf2JzDr9WsLpuahRHRamRPBaWrvjgII40NNJDjns1dOxnuk alAZ33UdxqICm8zBhXIIKbYjKEgZEDoS8RXFdHnD+1kYP9Mo8X/tTs7XLRI5bF6ledQpCA Mcscd95Y/2dv+GYGoiWE0l5l+lLjQMCsymJ++NQxelomDO8S3VwRlnyO0NKOYg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714941805; a=rsa-sha256; cv=none; b=wrYnfCgr3V885JYzYIU/vgGyYnpM4ooRMYAldxvxaxLRnL1vpLmOuiLSwMU0TatshYoeaQ nLTtyFNZdgTeVHkupX+samssWrB6U1KaKONbbD+TJJnQxSO9vZpUUlfJn5yVUoHceU1wS9 aUi15+KrGC/QhJ4rodUQaL5UXORLCuTOI7ITN+RKz28ulBIiEKsiBk/Bj4jyPhDyXd45ra UrSVQTl8QfGCVazrKsYrR5j11lDRIq8byivpBi8sEWXBlRwR6t6ijCc2pEnRwmHVnkg1Wq FoCzPwZCC7cukcgPuS2fiDs3ko+qruLibi0TecAVQgmsViFIF+1TQU97TDx7eQ== 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=1714941805; 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=sFKAxnWZpPB3r+FkfrYLEIzlYnyvnd8gXAp71gnCFH8=; b=NTuqEa6uwS1dJAMiAMWe5XjnI45qZV2y068774/C2qRudqW0sTSz3MbmN18uwP1K3YFUFr e2Ymov1yqVJvoUiJVoG0p9iluX+VpYj93wvbv+v9/XPesr92MNeTdvD6z5rSF+h08/MO8s 0QSDeiylol+LVanZJ+4ZxXCVrHqTx5hlrgB7MlsMYa6JEHiB+AMclhhA6jpFSEX6Tf3LeK A7safm+0JL6qfKsUX2QfbP38v6hvPq+UCdW3EVjw5+meXnmKTnHkEtrXl4Z6xVC1NX4y/X e6hKtSFj6lTfGXOohcSx30byE42aXEIONZSoseVx+IANyfrES2wsexwhMEAvFQ== 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 4VXc253Pw4zSW5; Sun, 5 May 2024 20:43: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 445KhPl0037602; Sun, 5 May 2024 20:43:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 445KhPpn037599; Sun, 5 May 2024 20:43:25 GMT (envelope-from git) Date: Sun, 5 May 2024 20:43:25 GMT Message-Id: <202405052043.445KhPpn037599@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: 22b231a84646 - stable/14 - bsd-family-tree: QCU: ISBN and EAN numbers List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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: 22b231a846463b988044df113493890c98a8f0fe Auto-Submitted: auto-generated The branch stable/14 has been updated by osa: URL: https://cgit.FreeBSD.org/src/commit/?id=22b231a846463b988044df113493890c98a8f0fe commit 22b231a846463b988044df113493890c98a8f0fe Author: Graham Perrin AuthorDate: 2023-12-27 23:36:25 +0000 Commit: Sergey A. Osokin CommitDate: 2024-05-05 20:38:14 +0000 bsd-family-tree: QCU: ISBN and EAN numbers ISBN 0201547775 and International Article Number (EAN) 9780201547771 for 'A Quarter Century of UNIX' by Peter H. Salus. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/812 (cherry picked from commit 3dfb39ef1d66e8370c302b158173ed8065887c2a) --- share/misc/bsd-family-tree | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/share/misc/bsd-family-tree b/share/misc/bsd-family-tree index d81c8829f4e8..46f271342346 100644 --- a/share/misc/bsd-family-tree +++ b/share/misc/bsd-family-tree @@ -479,7 +479,8 @@ was the announcement in Usenet or if it was available as tape. Distribution UNIX Version 2.9, July, 1983. [NBD] NetBSD Project, The. [OBD] OpenBSD Project, The. -[QCU] Salus, Peter H. A quarter century of UNIX. +[QCU] Salus, Peter H. A quarter century of UNIX. ISBN 0201547775, + EAN 9780201547771 [SMS] Steven M. Schultz. 2.11BSD, UNIX for the PDP-11. [TUHS] The Unix Historical Society. https://minnie.tuhs.org/Unix_History/. [USE] Usenet announcement. From nobody Sun May 5 20:43:26 2024 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 4VXc26584Rz5KhRg; Sun, 05 May 2024 20:43: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 4VXc264TQFz4Vr9; Sun, 5 May 2024 20:43:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714941806; 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=TbNQ/fG/we6h99pj0BBs+BVO3tU9cUbF1gUZdUSNUNI=; b=a9ZMFNilkPTEIGcHrZgF+3rde54RtVmJfXz7F/qRIUe0AXlPPFfe+ixytKGNFgvirBPoVn EKD/cCxVw867JSPH6e8RUk0Aw7zzjJimhoeS3NmMp3wpubPulPuyPOC3+kusJxS1RQ/WhO 5bCn/9KvQuRR973yvjbiFNf5UKa9FrEXNrmgiDwzhL8LrUmpYKLowfj6b75JmjOPWRSIcz F1M5Q27yjA5fg/BiwIsZN3U7EuuTa44UnS0+fG1MjE8mYZkxbcjVOywZeI4LhQp2Nvwi8a TYAaU8qD/8ziBlQbaHrsjI4Q3Kw+xnWfuNSvSc2Qpfv2i88uxtAKsnF/c3KZbg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714941806; a=rsa-sha256; cv=none; b=sMNEMfFKUQ20ZH83dRe60hekheI85uo5c6JGhszjAmSTZZnqqdnAZvtU1lAOM2UIGDHWfG C+N24SWR7OMMBIpyLbLHWtrWPvoggclHpS40mVgtyj2Ge2dDPfHX7BYMz8Xcg3PRRoueG2 84ZFRuHpuyPAPywce7SG/mF5wabS/TzX3xrwCUM1/70llNARe/mAhZ0HxyBnDwI+czAU4b 3uEPKYE/bDJj9OO830jbRvDvsSPJyuORMT08hJf6proyDP9t+nZnFB5O/Od5I5hKJIlTul 1mwngpVytMetiDmdGGGscmeJDhr7beHzbFFZ77Puta/qazBxkcRiRyxloHB85A== 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=1714941806; 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=TbNQ/fG/we6h99pj0BBs+BVO3tU9cUbF1gUZdUSNUNI=; b=wdeQz2mJpDEKwFCY7xtbmbpKKkD09Tg8oLa7YX7ScJWVeYSOE2+GD0u7NpkhjC9c9e/5vH maVPkxa3UyrSPSb0aQz4AjLeg+et1NN00SJ3y38MgM95Lq/DOW7DL5FDCq4oe5EZpNdQpY mPS3G4JZAm9oPmVOdIZXbGYYfKRdSerOfm/YxIjmEpsHoh0GB4B3IgKJ6PWKmvHJBQRJzs s+GZ/VRUda3IiJobzDIPivF1FFAe4wPWTz4V6EoUHOtpHJDDQeqN4IFyPxsn/Imn06z1MK 6l6rFr08b0RyqWHVmL2uZA9X7mgUUk/J4vF1MyUQNMI7O1j4/oFJN0XBd/TWww== 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 4VXc26467rzSr7; Sun, 5 May 2024 20:43: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 445KhQ02037647; Sun, 5 May 2024 20:43:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 445KhQJI037644; Sun, 5 May 2024 20:43:26 GMT (envelope-from git) Date: Sun, 5 May 2024 20:43:26 GMT Message-Id: <202405052043.445KhQJI037644@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: 0cff58e34dd6 - stable/14 - bsd-family-tree: add FreeBSD 13.3 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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: 0cff58e34dd6ba4874f8d9f04e96b2ed6047e251 Auto-Submitted: auto-generated The branch stable/14 has been updated by osa: URL: https://cgit.FreeBSD.org/src/commit/?id=0cff58e34dd6ba4874f8d9f04e96b2ed6047e251 commit 0cff58e34dd6ba4874f8d9f04e96b2ed6047e251 Author: Sergey A. Osokin AuthorDate: 2024-03-05 13:38:09 +0000 Commit: Sergey A. Osokin CommitDate: 2024-05-05 20:40:04 +0000 bsd-family-tree: add FreeBSD 13.3 MFC after: 3 days (cherry picked from commit 885590b4f1ad218995df0fc127601e0f59bcc57f) --- share/misc/bsd-family-tree | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/share/misc/bsd-family-tree b/share/misc/bsd-family-tree index 46f271342346..7781e3d62282 100644 --- a/share/misc/bsd-family-tree +++ b/share/misc/bsd-family-tree @@ -446,11 +446,16 @@ FreeBSD 5.2 | | | | | | | | OpenBSD 7.3 | | FreeBSD | | | | | 13.2 | | | | - | macOS | | | - | 14 | | | - | | | OpenBSD 7.4 | - *--FreeBSD | | | | - | 14.0 | | | | + | | | | | | + | `------. | | | | + | | macOS | | | + | | 14 | | | + | | | | OpenBSD 7.4 | + *--FreeBSD | | | | | + | 14.0 | | | | | + | | | | | | + | FreeBSD | | | | + | 13.3 | | | | | | | | | FreeBSD 15 -current | NetBSD -current OpenBSD -current DragonFly -current | | | | | @@ -881,6 +886,7 @@ 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] +FreeBSD 13.3 2024-03-05 [FBD] Bibliography ------------------------ From nobody Sun May 5 20:43:27 2024 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 4VXc281XfQz5KhJc; Sun, 05 May 2024 20:43: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 4VXc275Vp9z4Vgh; Sun, 5 May 2024 20:43:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714941807; 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=d+HIwmo/X8o2CaQ8VVpBQkFq4uuoQNs1Fo6VzmyV4cM=; b=UqyVtzYRt9SVrDfw6Lmt8W0sklu2GqCP4hPVC3WpJ0VfvBkxeJgeawBCOpkhBIjGYt2WLV 28DrVkAuK1rAKKF9Xuadm8A0JjSW65TPQNs4j04FtjuqM60A+Wu0+fK9ssUACMwYJEp+FT ZFMlH9lJH7TYcgTsfIj/dK3B1rIdvPSs+pW7N5Yv+iJAQD0a89yYAf8oQN2/JCNK3W5H2C N+Wkduzgy2isD9cs2baGaoc/zQhLG/fNGuF24uS2SOpyvhjcSEQmUMqgcM0F2mUTVpfP3J TfTWUpH+xUKmI8Rj3/OgxvtQJQoA4ah8VCXvOAhWQYIMyZZDN3pFNOTlUWTyrQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714941807; a=rsa-sha256; cv=none; b=isqcTtH7T2itgqS6VFIcec19hzJrU69LxX1Ssswx97gpAyeqhBInP7sQoLgfKdxlSh0Q/3 DGDhRX56nlEuvQHnjBw1NrY3ffAD0MPqron8JgU8uRyXKihzhHUhBSe32H/dPEl9U+0nyp 0R9ADSDOF0zc9/PS0pATCkSUVLgHs8vjAfJk+be+t6G2+KLkwqktsY7TmmmNF3zM59Bfpf wb7cAJcW6FtASy4gn+C9FjHprIt+0HIgLHcrusZ3dsVcy7yr52yuMbTinDud5zKftkJAg5 nkh4s7ujgJS9r70j75Uk0TKVAtocqyYjeAcI0XAgaaJv3bBZnJz1kAqGjjL/Sw== 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=1714941807; 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=d+HIwmo/X8o2CaQ8VVpBQkFq4uuoQNs1Fo6VzmyV4cM=; b=cwwgcig+mF8ux+E/RM7QiJ1dlrB9BMqhsOygmhkl/3iaZopWOkzF3+nKKgw7Js/Pkl2FLX o2WLh/q8PCPPzh0uHdTYPE2MM/RHw89FNGdO6Po8wXcpXvfocqjcgI1bksuc6+8lGkVoDS yGlGzuqpXQzkr0dNJ3yYJ/WnkjaqitT8bXrVdBy1o2OkVMDFLkWm9AUHipcTyfcM+UPDKZ EvFWPw237q9NG7eAY8yZ9hvDx4+Hdka69i68oNxiG6g10JeRdfZD8J0Up7Hc1OYMoN+kdl y0CeutdEVvCDHz9bvA9WNScqw2TePh1AByxHGJiu++cwwYDqC9SnQFScI7fu/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 4VXc27552kzSW6; Sun, 5 May 2024 20:43: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 445KhR1M037698; Sun, 5 May 2024 20:43:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 445KhRDj037695; Sun, 5 May 2024 20:43:27 GMT (envelope-from git) Date: Sun, 5 May 2024 20:43:27 GMT Message-Id: <202405052043.445KhRDj037695@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: 5c060d96b769 - stable/14 - bsd-family-tree: add NetBSD 10.0 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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: 5c060d96b76941384fd3cfb356efe58b191ea136 Auto-Submitted: auto-generated The branch stable/14 has been updated by osa: URL: https://cgit.FreeBSD.org/src/commit/?id=5c060d96b76941384fd3cfb356efe58b191ea136 commit 5c060d96b76941384fd3cfb356efe58b191ea136 Author: Maxim Konovalov AuthorDate: 2024-03-31 18:35:02 +0000 Commit: Sergey A. Osokin CommitDate: 2024-05-05 20:40:36 +0000 bsd-family-tree: add NetBSD 10.0 (cherry picked from commit 07b17a1692a3c067e8f3e2dad31441ae441c5387) --- 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 7781e3d62282..46e6053a50c4 100644 --- a/share/misc/bsd-family-tree +++ b/share/misc/bsd-family-tree @@ -456,6 +456,8 @@ FreeBSD 5.2 | | | | | | | | | | | FreeBSD | | | | | 13.3 | | | | + | | *--NetBSD | | + | | | 10.0 | | | | | | | FreeBSD 15 -current | NetBSD -current OpenBSD -current DragonFly -current | | | | | @@ -887,6 +889,7 @@ macOS 14 2023-09-26 [APL] OpenBSD 7.4 2023-10-16 [OBD] FreeBSD 14.0 2023-11-20 [FBD] FreeBSD 13.3 2024-03-05 [FBD] +NetBSD 10.0 2024-03-28 [NBD] Bibliography ------------------------ From nobody Sun May 5 20:43:28 2024 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 4VXc291B0sz5KhPJ; Sun, 05 May 2024 20:43: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 4VXc286T0fz4W3F; Sun, 5 May 2024 20:43:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714941808; 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=dYanj8j/E1Dhge3pV9Fs48pek7KJQRlJX2uBwhqa+n8=; b=g3gCJuWGFRh2ocpJt4VvRPSOI++5ofb3xMgqxgxAZSwdeqUdCG1Q91wht3mU29ylBdkSKr 6RJRDJPty8MyKxd/6h6N7ifdCtKR20xdTuTGaXYLWrZnEV0nvgnjkqQWoU4pH6UvcvbzPL cW3j7wEMc5RdfDrpYDJWT08ENO+0usoJbfsEVdCUaEupbXYMXv4iIjDCV9I6EHoKZED2+y IbZ1YBVxStLMfMu/RSppKbJ1bC3TJiCQGY18RAZlavjVG1J/9IVG9avm3UtaD0vnwXNlX5 bAvuGuvLfBKeJwCznp30INCW/kRAFpH9NRLbij3/uzhNOQ6Zoqw7XY226j1yeQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714941808; a=rsa-sha256; cv=none; b=Gid+ulZxlIc+liXcc0C98u0FOt2dAOvF0+oj6siMmKkAhUkip0jJ907MxmbxZ8dV4hpluF yhPs0Ee2dq/osNIe5jKOsdW4En/EsgLAc5P5A+cH8LT5OTpQ2BJ7CPulp0tU2nYM1IkztQ IQIxdT2j5jYjOvtJgiBv8n4/0bbpXFsyrmT35JRiNmE1yfJEC4eEF4BcnfAxleVWnSTi3T eRRuF8hjXadEfRuWtfYp6bauXTZITIoGB3iLVgLlpd/8IOq3JjhQf2lCA0g4SfzviGSs9L EMQrjjm0CcHfUs0jnnsyEbPRBDA7pEDJhnt70M7OPaeMNjJucZ4FkhoX15pWZw== 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=1714941808; 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=dYanj8j/E1Dhge3pV9Fs48pek7KJQRlJX2uBwhqa+n8=; b=RAuh0h64CJhJlpQdIiPZZvmIoHa2EIBwRjG3/xHTnzGBFKiO5+q04KZygqleuAZojfxRBA fHsmXQW2gax9wVbe7gROkdxxHU7+7KbAtxHySvb5GfomaQjfV0xeu0FjY+caj+fx/hkGV2 Yqk+0lBk2Lt9vfZwzYhiVtGLz7f+2czlXwXbsps+vETaTqSksqi/6gXkhadd49jZ2edYLq auKdVeNJHY/RkxrAplFgDPqrrmm+fG1T0kLT+5JjlShi+98cyYkVgtRF8isusgexVUMIDm GMQjacESAuHRVH7L9lzliXijx53LF8CBS3OdPEH7Ri/XxgGRwYc//GdUG8ociA== 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 4VXc2863xHzScc; Sun, 5 May 2024 20:43: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 445KhSld037746; Sun, 5 May 2024 20:43:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 445KhSK7037743; Sun, 5 May 2024 20:43:28 GMT (envelope-from git) Date: Sun, 5 May 2024 20:43:28 GMT Message-Id: <202405052043.445KhSK7037743@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: 613633c6a0a9 - stable/14 - Add OpenBSD 7.5 to bsd-family-tree List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org 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: 613633c6a0a91c3543c6a069a3b3465266e7e4d7 Auto-Submitted: auto-generated The branch stable/14 has been updated by osa: URL: https://cgit.FreeBSD.org/src/commit/?id=613633c6a0a91c3543c6a069a3b3465266e7e4d7 commit 613633c6a0a91c3543c6a069a3b3465266e7e4d7 Author: Juraj Lutter AuthorDate: 2024-04-05 06:27:12 +0000 Commit: Sergey A. Osokin CommitDate: 2024-05-05 20:41:29 +0000 Add OpenBSD 7.5 to bsd-family-tree Summary: Add OpenBSD 7.5 to bsd-family-tree Subscribers: imp Differential Revision: https://reviews.freebsd.org/D44643 (cherry picked from commit bb4e55242ecb03b3f6876114b0708b0efa85044a) --- 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 46e6053a50c4..ed18b96cb39a 100644 --- a/share/misc/bsd-family-tree +++ b/share/misc/bsd-family-tree @@ -459,6 +459,8 @@ FreeBSD 5.2 | | | | | | *--NetBSD | | | | | 10.0 | | | | | | | + | | | OpenBSD 7.5 | + | | | | | FreeBSD 15 -current | NetBSD -current OpenBSD -current DragonFly -current | | | | | v v v v v @@ -890,6 +892,7 @@ OpenBSD 7.4 2023-10-16 [OBD] FreeBSD 14.0 2023-11-20 [FBD] FreeBSD 13.3 2024-03-05 [FBD] NetBSD 10.0 2024-03-28 [NBD] +OpenBSD 7.5 2024-04-05 [OBD] Bibliography ------------------------