From nobody Mon Dec 16 00:39: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 4YBLg50nyNz5gZFc; Mon, 16 Dec 2024 00:39: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YBLg50Dxsz3wZk; Mon, 16 Dec 2024 00:39:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734309569; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jrcj6n8Wq1Z+4x8V4UoQSx8U7J2WVjrurC6AnOIaxIw=; b=dIz0PT5Tfjvm+uAfDRETRwEj2OoEhohhhGxhpleGqopwZKY4xAOAAHk76qwlMTtOdZrE7z gjjOMgC4AE7ioc/e/+IBOChbhRJviduSyaZU2x4hywvozQyHSlxBfzIWu0I/Keu5W8V3If e2cSultiweDTH0icyt2+2030TEE/b3pM0J3AtaxTWKlvgMUP8gd+rXUD1S2AQkd9hji9Vd nstO3f/7jzn1quCuLgqM8aNaCeHV/2pGTIW/PVMWHtJ+ZLpFV2NwkGiisCX8/wIrINUTiV DXM7FOhXbIurx/pCsk1R50vipqnqnR2l26s2239Wi3BbCdm9xF9xbdnm3BEPKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734309569; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jrcj6n8Wq1Z+4x8V4UoQSx8U7J2WVjrurC6AnOIaxIw=; b=x/1biG4Uj71YoAOtnoAN3i4l5vnzbEGMF0Wl6yYFFuIneNqippltQjgx9moAL27Mhadlow N9AewJE5RqV0CXjNGWAgvmpcbGxq1fqjPOdDlf+NvW24qIrXeN2EfiEHrY1tejgTqGUEnv em47sEL+JM9Sf2uQB+HGV83/PzpbaLdwgQbva4uRMTmWcTzlaWSA8sypTvSjuQjT+qHr8e sRHtpKYpkFY6UzeJgj6oqwe8/L/Aw07k7vEdqiptvT5vJPkLWO5aVfUmd00XYCdUeVjMJs hBUBeuQmNoQePIdukIx6kt7BePtx41hmTZtNx8v35IZn3VIVgqkckLxQrPXLFA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734309569; a=rsa-sha256; cv=none; b=XhHH112GeVn9Rh1+u9bVGCQIbY5wHCx/KKTeVL9y68MHk8rwblR14BoJ7mg4gR/vf0xVKj 3WvqOYgxvVRc5P/2Qj26YMvyk/TCWiHy3Za1rCcrjEIB+b/V5BKTjwf7JvPLVQzsIm+koo wCPA2JsawtqiGhiMx+QMEBdD8c+tegn2NK4pZnEMpR0/5B8sPFSysUSM6pUx3BkFnwRh6f EhpvkQTE7IBspt114rzmhM7OocNfa1W/TvV27XFU9bOpeNiNH/vcITnpsBLcUJrme7g5Eb PQlLcjZ/9zR6DnM27PhJwvP4JN5hRfZPbpaY7tphkGPJUAox30QWCSylRcMpMg== 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 4YBLg46X9KzWxg; Mon, 16 Dec 2024 00:39:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BG0dSHr066428; Mon, 16 Dec 2024 00:39:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BG0dSvs066425; Mon, 16 Dec 2024 00:39:28 GMT (envelope-from git) Date: Mon, 16 Dec 2024 00:39:28 GMT Message-Id: <202412160039.4BG0dSvs066425@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: d6b36d1c83fb - stable/14 - newvers: Set explicit git revision length 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: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d6b36d1c83fbfc8046efa7acb32b676824f6bc8f Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=d6b36d1c83fbfc8046efa7acb32b676824f6bc8f commit d6b36d1c83fbfc8046efa7acb32b676824f6bc8f Author: Pat Maddox AuthorDate: 2024-12-13 05:28:18 +0000 Commit: Ed Maste CommitDate: 2024-12-16 00:39:08 +0000 newvers: Set explicit git revision length The --short flag is configurable. Setting an explicit length supports reproducible builds. Signed-off-by: Pat Maddox Reviewed by: emaste, imp Differential Revision: https://github.com/freebsd/freebsd-src/pull/1547 (cherry picked from commit a1097094c4c5d810287aca092f4ab5f9f86a426a) --- sys/conf/newvers.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index c77c3818c566..3ff993bdd2ab 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -257,7 +257,7 @@ if [ -n "$svnversion" ] ; then fi if [ -n "$git_cmd" ] ; then - git=$($git_cmd rev-parse --verify --short HEAD 2>/dev/null) + git=$($git_cmd rev-parse --verify --short=12 HEAD 2>/dev/null) if [ "$($git_cmd rev-parse --is-shallow-repository)" = false ] ; then git_cnt=$($git_cmd rev-list --first-parent --count HEAD 2>/dev/null) if [ -n "$git_cnt" ] ; then From nobody Mon Dec 16 00:39: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 4YBLgW5k3jz5gYpW; Mon, 16 Dec 2024 00:39: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YBLgW4zrlz3wv9; Mon, 16 Dec 2024 00:39:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734309591; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ktyMx8SX5qPydGTV1e/SOWoRSgBMyONMGttC2yKir4Q=; b=V6RW1jBm7zWqm33jhEZoY0Cf3xfk1bqW2FtttdLwwv6aGAk6QrqnmUocc+8uQTcNF1UPga B3MH9OWLuvXIHtlTcT3oHh8A+6AlEI12QJdtX9HI+PZAbKEcS1Bb7X8cSOQj9cV40mkdmY v8bHfHdTFKE5VNzETvUiVoaVXfc0shNPSXdhK+IC2f9EyUNh/LtLrYA5JQAbC7NJ+UrDsP 0iQcmx7yIOdkxVmByV9T+2zY8oARLO//ku7Fmswi8vjnB7SZqC9f0Lxi6jSadhIVa5AAXx Wj7kGSwbD0ueSAwhnDc1r5e7hhxgQxOBH5v7Y0aVsCC614863I2XRVYBU6CXgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734309591; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ktyMx8SX5qPydGTV1e/SOWoRSgBMyONMGttC2yKir4Q=; b=Bm4cp6vlhSV2I+dMCJ4csWQu6/pPqSENTGib+GpVHsNrdZ35FkJnD5wm6jDufEew5MFNOC f1Bgg5exIWWmfEuxMfHnf5slD5PmAkXHf1XQPE4+JYx2/0fxAs+Ho06GXnt/PHL960LNaK 7dHWWrzHCqJR5XULnVsgtj4xo/bOO0DHmr1j8jRqTnMXEBqiE5pGEQinfibi4BUo6Y6dfl 4Xp5Kfzb0cZEo6B9+CCYcnQeTZcjeW0ey0YJ6wOhjd4pp8yGokugy9J1CzgHg97C91F69W 8Ixe8OMO+q/H5zAWwTeKYHudFUfrgDXyxBeB9qMbM5hX7S9KlOd9w39Pnz8PRA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734309591; a=rsa-sha256; cv=none; b=IO1vIgBLLi6q715nOJs1p+tytx4nEtUmDfNuyOfP14NrVTzLVf84e/1Mq5te0B1sMyLRZo M/Oo0dZ/gWrkefHUNSNWj9SIkJ5KME+izGzZohb5mfUuw9ndbYQ4HkJcyUMGQAZEqRoAVn Omg2MsiI9V/tZ2YJ0ricU0iLn1TJmSYE0uVlOtRFZ99d/C9rVeoh2r2ZPvMM96zcAVwo91 A+DIc6y8XcYgScS/5xP1GR4o/rPVnYyD3X7v0hEQRo2Sz28FZwdNCWVkLaOPn/BbdrSzb0 ZWuwHFWNLWaZ9xlWUzmm29IDkuMdMzrp/ECsCIz/by33nHk3CXp9TPgtBIf7qA== 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 4YBLgW4L1yzXNL; Mon, 16 Dec 2024 00:39:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BG0dpUq066665; Mon, 16 Dec 2024 00:39:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BG0dpvQ066662; Mon, 16 Dec 2024 00:39:51 GMT (envelope-from git) Date: Mon, 16 Dec 2024 00:39:51 GMT Message-Id: <202412160039.4BG0dpvQ066662@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 6d1d5577ce10 - stable/14 - Makefile.inc1: Require DISTDIR be set for `make distributeworld` 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: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 6d1d5577ce1076ea2080bf243611d0f76c646a35 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=6d1d5577ce1076ea2080bf243611d0f76c646a35 commit 6d1d5577ce1076ea2080bf243611d0f76c646a35 Author: Ed Maste AuthorDate: 2024-12-11 15:53:42 +0000 Commit: Ed Maste CommitDate: 2024-12-16 00:39:08 +0000 Makefile.inc1: Require DISTDIR be set for `make distributeworld` distributeworld is the target used to stage world for building dist sets for release targets, and is not really intended for end-user use. If DISTDIR is not set we would attempt to write to the root directory. Error out in this case, serving as an assertion that an internal target is not being used incorrectly. Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48030 (cherry picked from commit f6575ed0deb08026c5ee261495e000831688e5a2) --- Makefile.inc1 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile.inc1 b/Makefile.inc1 index 1927a69ef732..d4ec63091e5a 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -979,6 +979,9 @@ IMAKE_INSTALL= INSTALL="${INSTALL_CMD} ${INSTALLFLAGS}" IMAKE_MTREE= MTREE_CMD="${MTREE_CMD} ${MTREEFLAGS}" .endif .if make(distributeworld) +.if ${DISTDIR:U/} == / +.error DISTDIR must be set for make distributeworld and may not be the root directory. +.endif CERTCTLDESTDIR= ${DESTDIR}/${DISTDIR} CERTCTLFLAGS+= -d /base .else From nobody Mon Dec 16 01:35: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 4YBMw072Hzz5gf07; Mon, 16 Dec 2024 01:35: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YBMw06Lh5z41bj; Mon, 16 Dec 2024 01:35:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734312944; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AHLUvTbvR+IZM4yIRj7Pq3paj+Mv5p2SRTXRkmZYxIw=; b=qO5QxWfhX+fhO9IwwTzlOGqJTmsjyjxcY1qKEBr3rKJjCT7XLI89ETiPLzBv/VQYWm5awB REXDBWY8Ywg7cZgYrUJYPfAUeAownmxGkR8i8Ioq4yOJBejv+k7VlXy8icSZ8+Il4ars73 /tPMkZFbMAINncNr6pLiGGzFH5v/HLM8nvGdBeI5s58qpuMpoTqxtS5d+xAaPXu/cboFoX LuKSw4Fh6dga+zueINtlhYYcMlAy8khv9J1x1YV6KLtCxd6YtsCTOZtZWdSmcx828X41xK +r9FW7dwPwSOgR11BePXTEohXTxM7QdQIGjflOsU4iJGX04Amqcds4nVa1NokA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734312944; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AHLUvTbvR+IZM4yIRj7Pq3paj+Mv5p2SRTXRkmZYxIw=; b=Wpk3fs4mfvwURa6JrHstKrp1rT8xFIWAv3UnuHl1mjqEvyJhzn0SaHK3m+cb5XKc0617ba DwzEpQVejL1cKdR3SMwxf0nivqDv+QWzqjk5CK9eTMNOE/Xc1OZbsYjk33NHjhSRDWyCCW PvWvS4E9f8mCu8Bc5MM00Xgzpmrr4za74jgieR3mL+fkSK/Qeg41VdRwOtl6u0UqYj9iIL S4Exn4LgzFGWHUENdlbcSir7/vhV61yYv7XRrCzlHQJJJnvDZDKA9KsZ6MMiK0dA+Dhi9W MZu0AtLGM9KA5NOe02MqM+zYapIeE9EgigMDrRgxei2tMEAdKSkZCdhjcTGd9w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734312944; a=rsa-sha256; cv=none; b=mvraaAIbLVX3cbRycAdCC/pUPalyDfzz1bS+9AksuVRuhe2uc+k4zPn//fw87YNk/r/EMe sUUc7oSrVFxWMgzVZgqTrZvk+rWtO4EsFaSe5r39F/PQj7GXj2uzBrIXYJi0zBEZg4Ecef Apdt75jC5TCpBX9xCIrStbsbJY0e+uj9Ivm8MYEHpa75HA8DEwilB08ju9G2/2I/JmWs3c +zzPSpOeDnNnpzZaEaokYX93Va20DNfMvok9IBk9mm5tgGK9t7E7PupQXQVDYA6492hv17 7VeR1qO1UIXZMC8DjXRwwaXOY/FIWf5wjXiBcnuj1awTuJ4VqePbrFWqOqJy8A== 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 4YBMw05gDXzYZf; Mon, 16 Dec 2024 01:35:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BG1Zi0g077352; Mon, 16 Dec 2024 01:35:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BG1Zi4Q077349; Mon, 16 Dec 2024 01:35:44 GMT (envelope-from git) Date: Mon, 16 Dec 2024 01:35:44 GMT Message-Id: <202412160135.4BG1Zi4Q077349@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 453f6aa42842 - stable/14 - Cirrus-CI: Switch default job to llvm19-amd64 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: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 453f6aa428429b36030492ddbb1f9eb6498638cf Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=453f6aa428429b36030492ddbb1f9eb6498638cf commit 453f6aa428429b36030492ddbb1f9eb6498638cf Author: Ed Maste AuthorDate: 2024-12-10 01:58:57 +0000 Commit: Ed Maste CommitDate: 2024-12-16 00:39:08 +0000 Cirrus-CI: Switch default job to llvm19-amd64 Clang/LLVM19 matches the default in-tree toolchain. Sponsored by: The FreeBSD Foundation (cherry picked from commit 5e310866c3733cbf2e38e15c3f16cba16136829e) --- .cirrus.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 62766904de2b..2a1a8b6cbf3b 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -31,15 +31,15 @@ task: TOOLCHAIN: llvm17 TOOLCHAIN_PKG: ${TOOLCHAIN}-lite - name: amd64-llvm18 World and kernel build and boot smoke test - only_if: $CIRRUS_REPO_FULL_NAME != 'freebsd/freebsd-src' || $CIRRUS_BRANCH =~ 'pull/.*' + only_if: $CIRRUS_REPO_FULL_NAME != 'freebsd/freebsd-src' + trigger_type: manual env: TARGET: amd64 TARGET_ARCH: amd64 TOOLCHAIN: llvm18 TOOLCHAIN_PKG: ${TOOLCHAIN}-lite - name: amd64-llvm19 World and kernel build and boot smoke test - only_if: $CIRRUS_REPO_FULL_NAME != 'freebsd/freebsd-src' - trigger_type: manual + only_if: $CIRRUS_REPO_FULL_NAME != 'freebsd/freebsd-src' || $CIRRUS_BRANCH =~ 'pull/.*' env: TARGET: amd64 TARGET_ARCH: amd64 From nobody Mon Dec 16 13:35: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 4YBgtD3WTpz5hRHl; Mon, 16 Dec 2024 13:35: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YBgtD2fKwz4GH1; Mon, 16 Dec 2024 13:35:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734356116; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FhlLILiMd8//CuyWdR+NeJ8cdRHHVDEdu9oChhZkoXo=; b=avDWFxh24gRlBP4uxm9Rg33RDblylV4t3hiTh7JLila2m1bxg6kHy2Wa3IsDdm8CAxR7JG PElLKNJoDmc/JnSJyz/TjveaaklAG+bFpRQMYqhoDiPJ2r3xLuGtVK7LTlgAa9562kdVKM y2BRnTEf/vysEoz0KfSJMmMgFlxLXE/O6/8p8Fx4mTF1G/LhUtprNb1DNKvBtoSGfCFVnb 5MYr2W9+PJ3BtQcxs+vW32c9iRSVIzkO56w5dv1+8+HiLAr8Y3Vn+G0fZ3+2lxn6JItejZ tQbksLrdfn+ODhJjeNmMlJVjtmeDMfr7v5ue+k7u7+iZJ4W/J8wErsQ408Msjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734356116; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FhlLILiMd8//CuyWdR+NeJ8cdRHHVDEdu9oChhZkoXo=; b=eP2sGgeyLT4nV2+SKpj2f2GUCSURuyJ7M0hyGof3MF0PdLMz0dKjzYDX39nRvKXrLDanov JVdiQbe5bmkRK2dGK/ri2uhevHDE5f0mj7ThWABvJvDLMsjV+ZOBNhhSVhW1gFnIHnmSu5 evWb2aw4bW/2Ho/yqZdlOMWgKZ8XzBTHt0dDEVuwwpsq2B+7Q7KpOE01k206A2x+74GmE5 ES4ZXtKA+O6pclCMaegFeFd7dfGImjmLNm1oUEBM/5dLrZvCaXlYMBAwtKmp+jURpZTGud wRv9pcva63ZqQr6PFxXK13lOOFocrDv5NqxiCq6acEIeTel4M5R5T1Zo+UUQnw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734356116; a=rsa-sha256; cv=none; b=sTyXypsnxLftW2h1nS2RoXd5j/ttiZKJSA6DBOkAMFLRadUE0m8/SdpIFCisDNHCpOK3JI 56K+LAEUh4ICCAeqMZAgfOMGzxEqwcaRgnGsPaq9neXmtuni1U0qMaWtOmAh4Ngp8RoWk6 QClIp0IkM506VO93SlFPhgUyw30aj7lnqBIFHa3MmshBM1bntvsGfoHWIdqkAoo4sEEocE lVTP2tKuElFsimGIYIrk8A8yitWEGEXc4g+CUdEV7GJrTKOYkDm4byAxFKCZ6AYR3iGBhV tGDmoG88Nr+fbvSxw1g5/wYdTPVuNwGenBDN8LmvuEio1b6YyKUEJ/oYanm45w== 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 4YBgtD1xbBzw28; Mon, 16 Dec 2024 13:35:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BGDZGAN019983; Mon, 16 Dec 2024 13:35:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BGDZGG9019980; Mon, 16 Dec 2024 13:35:16 GMT (envelope-from git) Date: Mon, 16 Dec 2024 13:35:16 GMT Message-Id: <202412161335.4BGDZGG9019980@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: 259dcedc4ade - stable/14 - strptime: Fix day-of-week calculation. 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: 259dcedc4ade538c35100d364e5cfe30b89c9a95 Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=259dcedc4ade538c35100d364e5cfe30b89c9a95 commit 259dcedc4ade538c35100d364e5cfe30b89c9a95 Author: Dag-Erling Smørgrav AuthorDate: 2024-12-09 12:37:45 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-12-16 10:37:08 +0000 strptime: Fix day-of-week calculation. The day-of-week calculation used the raw year value without adjusting for TM_YEAR_BASE, so it was off by one for 300 years out of every 400; it just happened to be correct for 1901 through 2000. It also used a loop where a simple addition would have sufficed. While here, simplify our version of Gauss's algorithm, and document that we assume the Gregorian calendar. MFC after: 1 week PR: 282916 Reviewed by: imp, allanjude, philip Differential Revision: https://reviews.freebsd.org/D47977 (cherry picked from commit 4285e024baa80f81d13cdcc016fdf0721fe57862) --- etc/mtree/BSD.tests.dist | 2 ++ lib/libc/stdtime/strptime.3 | 7 ++++- lib/libc/stdtime/strptime.c | 22 ++++++--------- lib/libc/tests/Makefile | 1 + lib/libc/tests/stdtime/Makefile | 7 +++++ lib/libc/tests/stdtime/strptime_test.c | 50 ++++++++++++++++++++++++++++++++++ 6 files changed, 74 insertions(+), 15 deletions(-) diff --git a/etc/mtree/BSD.tests.dist b/etc/mtree/BSD.tests.dist index 7fa7ed24f897..f8088894e6f4 100644 --- a/etc/mtree/BSD.tests.dist +++ b/etc/mtree/BSD.tests.dist @@ -364,6 +364,8 @@ .. stdlib .. + stdtime + .. string .. sys diff --git a/lib/libc/stdtime/strptime.3 b/lib/libc/stdtime/strptime.3 index 0dfa33aa29cb..7df73d2d080a 100644 --- a/lib/libc/stdtime/strptime.3 +++ b/lib/libc/stdtime/strptime.3 @@ -23,7 +23,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" " -.Dd October 2, 2014 +.Dd December 9, 2024 .Dt STRPTIME 3 .Os .Sh NAME @@ -135,6 +135,11 @@ function has been contributed by Powerdog Industries. .Pp This man page was written by .An J\(:org Wunsch . +.Sh CAVEATS +The +.Fn strptime +function assumes the Gregorian calendar and will produce incorrect +results for dates prior to its introduction. .Sh BUGS Both the .Fa %e diff --git a/lib/libc/stdtime/strptime.c b/lib/libc/stdtime/strptime.c index 848b94545dd2..e9ffe7180916 100644 --- a/lib/libc/stdtime/strptime.c +++ b/lib/libc/stdtime/strptime.c @@ -70,17 +70,16 @@ static char * _strptime(const char *, const char *, struct tm *, int *, locale_t #define FLAG_WDAY (1 << 5) /* - * Calculate the week day of the first day of a year. Valid for - * the Gregorian calendar, which began Sept 14, 1752 in the UK - * and its colonies. Ref: - * http://en.wikipedia.org/wiki/Determination_of_the_day_of_the_week + * Gauss's algorithm for the day of the week of the first day of any year + * in the Gregorian calendar. */ - static int first_wday_of(int year) { - return (((2 * (3 - (year / 100) % 4)) + (year % 100) + - ((year % 100) / 4) + (isleap(year) ? 6 : 0) + 1) % 7); + return ((1 + + 5 * ((year - 1) % 4) + + 4 * ((year - 1) % 100) + + 6 * ((year - 1) % 400)) % 7); } static char * @@ -682,13 +681,8 @@ label: flags |= FLAG_MDAY; } if (!(flags & FLAG_WDAY)) { - i = 0; - wday_offset = first_wday_of(tm->tm_year); - while (i++ <= tm->tm_yday) { - if (wday_offset++ >= 6) - wday_offset = 0; - } - tm->tm_wday = wday_offset; + wday_offset = first_wday_of(tm->tm_year + TM_YEAR_BASE); + tm->tm_wday = (wday_offset + tm->tm_yday) % 7; flags |= FLAG_WDAY; } } diff --git a/lib/libc/tests/Makefile b/lib/libc/tests/Makefile index 7b262ea646fb..20238b376752 100644 --- a/lib/libc/tests/Makefile +++ b/lib/libc/tests/Makefile @@ -16,6 +16,7 @@ TESTS_SUBDIRS+= rpc TESTS_SUBDIRS+= setjmp TESTS_SUBDIRS+= stdio TESTS_SUBDIRS+= stdlib +TESTS_SUBDIRS+= stdtime TESTS_SUBDIRS+= string TESTS_SUBDIRS+= sys TESTS_SUBDIRS+= termios diff --git a/lib/libc/tests/stdtime/Makefile b/lib/libc/tests/stdtime/Makefile new file mode 100644 index 000000000000..c7a7f5b9436f --- /dev/null +++ b/lib/libc/tests/stdtime/Makefile @@ -0,0 +1,7 @@ +.include + +ATF_TESTS_C+= strptime_test + +TESTSDIR:= ${TESTSBASE}/${RELDIR:C/libc\/tests/libc/} + +.include diff --git a/lib/libc/tests/stdtime/strptime_test.c b/lib/libc/tests/stdtime/strptime_test.c new file mode 100644 index 000000000000..79a97764999c --- /dev/null +++ b/lib/libc/tests/stdtime/strptime_test.c @@ -0,0 +1,50 @@ +/*- + * Copyright (c) 2024 Dag-Erling Smørgrav + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#include + +#include + +ATF_TC_WITHOUT_HEAD(dayofweek); +ATF_TC_BODY(dayofweek, tc) +{ + static const struct { + const char *str; + int wday; + } cases[] = { + { "1582-12-20", 1 }, + { "1700-03-01", 1 }, + { "1752-09-14", 4 }, + { "1800-12-31", 3 }, + { "1801-01-01", 4 }, + { "1900-12-31", 1 }, + { "1901-01-01", 2 }, + { "2000-12-31", 0 }, + { "2001-01-01", 1 }, + { "2100-12-31", 5 }, + { "2101-01-01", 6 }, + { "2200-12-31", 3 }, + { "2201-01-01", 4 }, + { }, + }; + struct tm tm; + + for (unsigned int i = 0; cases[i].str != NULL; i++) { + if (strptime(cases[i].str, "%Y-%m-%d", &tm) == NULL) { + atf_tc_fail_nonfatal("failed to parse %s", + cases[i].str); + } else if (tm.tm_wday != cases[i].wday) { + atf_tc_fail_nonfatal("expected %d for %s, got %d", + cases[i].wday, cases[i].str, tm.tm_wday); + } + } +} + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, dayofweek); + return (atf_no_error()); +} From nobody Mon Dec 16 13:35: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 4YBgtF4mJqz5hRHp; Mon, 16 Dec 2024 13:35: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YBgtF3F4Mz4GN6; Mon, 16 Dec 2024 13:35:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734356117; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=z76UToJqW1fycl4b31ULrSUB9/wQxROtUruqXU/wS2I=; b=OY9pZubaaiy0xPxR8Ve+ODajTzkyJ7bI19D6uPe/hveiZ1DrPXv1Y0y4wrkdPkS4qthAwR v6DPYV9Zh68YHGGvc9J4pz8ZlgWLehZ8Lm7Sg9PNveDBQELg105FnuFY5bZDYrd8FmknLd YJdU/7ymcPpTuMUlwOVPCcJDB1eTn1Sa1QOZiNGG0lSB0aj7VNfrBY9GPFYRuNyuJ1QpRY L4HYdvxAb4jjjm3U0BgnC6WZ+HBNwCR0lMpUXVttIuKheLdRO6GoL7o6iJyJ0dwdGXk4yN uFuuNskraVLG6k0KQtW44dugdqNDhPFEC7pbUQcLDgGgXbiUxc981+QX0igymQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734356117; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=z76UToJqW1fycl4b31ULrSUB9/wQxROtUruqXU/wS2I=; b=vqRY/1+OWb/PG7CeiVQnsQVejI/Sk6bup+VMJsOKBCtNfiGQkn9kGKbnUqsBEqveZq/Tey UvycnYQCGKZsVdBVDJTSvEXgyPsaxfIZtUs8QzKYB7CMReZXCaBFfzWaNYzUZR+XbvJ/et /aUTJ3APDYjrXpuwevBfm/AcbgOLx8QO21WqYrjRW9Vq+de8wOcKzpSbv6y47tkW0JYrAa EjB/2il+W+p491KkpzpGUlDGouRa4KXKbPrlbPJWgd0+xFZZjT7OU/gLZ5E2JTV6iS4WZo uayq5jKNdfPUztxJAS86FRsYGplM3Avo2ML37qu+/bu4rv1crLlhngg9tcfCdg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734356117; a=rsa-sha256; cv=none; b=ONV58cmlTsTscIgGRhlLPCd069k502IcdneOOWL/3B998eNQbSE7GKR9u7FfHF3SD/7DWF G5OtRDTKDRbw/QYPhsfW83+GbED+txP+Tyo2Dw6aHAEqGbPN3k/k3atQ6+k7Qh01TjPZXu iXaAq0sygt1wglYjBFBrFOJZ58Kj2w9zT0QGe4WA1WBF9ZFEePFfufvdzW0BIRdiCuaFta I68PPW+ARpCgwrTidt+XIIuWpfhuR/ixBVhZqNjex26Lduf7GMXKca2z5pED5yLaG/xkR/ M5aXdWygnz6qNFZod6hZGmRie/bh9eNwdP45uHbw3c1Jn9T50GUbxEti0dxz6w== 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 4YBgtF2rTGzwBM; Mon, 16 Dec 2024 13:35:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BGDZHGL020040; Mon, 16 Dec 2024 13:35:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BGDZHmH020037; Mon, 16 Dec 2024 13:35:17 GMT (envelope-from git) Date: Mon, 16 Dec 2024 13:35:17 GMT Message-Id: <202412161335.4BGDZHmH020037@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: efefeefd4383 - stable/14 - uniq: Correctly document the -D 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: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: efefeefd43837e24c1ccb42eb67dd8906b7852ad Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=efefeefd43837e24c1ccb42eb67dd8906b7852ad commit efefeefd43837e24c1ccb42eb67dd8906b7852ad Author: Dag-Erling Smørgrav AuthorDate: 2024-12-09 19:44:34 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-12-16 10:38:06 +0000 uniq: Correctly document the -D option. The -D option takes an optional argument; modify the usage message and the manual page's synopsis to correctly reflect this. Also update the tests to exercise -D with and without an argument. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: asomers Differential Revision: https://reviews.freebsd.org/D47999 (cherry picked from commit b93791f5e7b0246b121dd98c10d6563298d6b2b0) uniq: Fix off-by-one bug in -cD case. When printing only duplicated lines, the first line of each set is not printed until we encounter the second. When that happens, we need to increment the repetition count between printing the first and the second line, so that if we are also printing counts, we don't print the same (pre-increment) count twice. MFC after: 1 week PR: 275764 Reported by: Yu-Sheng Ma Submitted by: Daniel Tameling (original patch) Sponsored by: Klara, Inc. Reviewed by: tamelingdaniel_gmail.com, asomers, emaste Differential Revision: https://reviews.freebsd.org/D48000 (cherry picked from commit c3f8900e696998c410dc16f9bd9d45c24c413e6b) --- usr.bin/uniq/tests/uniq_test.sh | 33 +++++++++++++++++++++++++++++++++ usr.bin/uniq/uniq.1 | 6 +++--- usr.bin/uniq/uniq.c | 7 ++++--- 3 files changed, 40 insertions(+), 6 deletions(-) diff --git a/usr.bin/uniq/tests/uniq_test.sh b/usr.bin/uniq/tests/uniq_test.sh index 9d37245dee4e..fc143632bdd2 100755 --- a/usr.bin/uniq/tests/uniq_test.sh +++ b/usr.bin/uniq/tests/uniq_test.sh @@ -53,7 +53,12 @@ count_repeated_head() { count_repeated_body() { printf "a\na\nb\nb\na\n" >input printf " 2 a\n 2 b\n" >expected + atf_check_uniq -cd + atf_check_uniq -c -d + atf_check_uniq -dc + atf_check_uniq -d -c atf_check_uniq --count --repeated + atf_check_uniq --repeated --count } atf_test_case all_repeated @@ -64,7 +69,34 @@ all_repeated_body() { printf "a\na\nb\na\na\n" >input printf "a\na\na\na\n" >expected atf_check_uniq -D + atf_check_uniq -Dnone atf_check_uniq --all-repeated + atf_check_uniq --all-repeated=none + printf "\na\na\n\na\na\n" >expected + atf_check_uniq -Dprepend + atf_check_uniq --all-repeated=prepend + printf "a\na\n\na\na\n" >expected + atf_check_uniq -Dseparate + atf_check_uniq --all-repeated=separate +} + +atf_test_case count_all_repeated +count_all_repeated_head() { + atf_set descr "count and print every instance of repeated lines" +} +count_all_repeated_body() { + printf "a\na\nb\na\na\n" >input + printf " 1 a\n 2 a\n 1 a\n 2 a\n" >expected + atf_check_uniq -D -c + atf_check_uniq -Dnone -c + atf_check_uniq -cD + atf_check_uniq -cDnone + atf_check_uniq -c -D + atf_check_uniq -c -Dnone + atf_check_uniq --all-repeated --count + atf_check_uniq --all-repeated=none --count + atf_check_uniq --count --all-repeated + atf_check_uniq --count --all-repeated=none } atf_test_case skip_fields @@ -183,6 +215,7 @@ atf_init_test_cases() atf_add_test_case repeated atf_add_test_case count_repeated atf_add_test_case all_repeated + atf_add_test_case count_all_repeated atf_add_test_case skip_fields atf_add_test_case skip_fields_tab atf_add_test_case ignore_case diff --git a/usr.bin/uniq/uniq.1 b/usr.bin/uniq/uniq.1 index 3fc1d26774ca..19d167ddc4cc 100644 --- a/usr.bin/uniq/uniq.1 +++ b/usr.bin/uniq/uniq.1 @@ -30,7 +30,7 @@ .\" .\" From: @(#)uniq.1 8.1 (Berkeley) 6/6/93 .\" -.Dd January 12, 2024 +.Dd December 9, 2024 .Dt UNIQ 1 .Os .Sh NAME @@ -38,8 +38,8 @@ .Nd report or filter out repeated lines in a file .Sh SYNOPSIS .Nm -.Op Fl c | Fl d | Fl D | Fl u -.Op Fl i +.Op Fl cdiu +.Op Fl D Ns Op Ar septype .Op Fl f Ar num .Op Fl s Ar chars .Oo diff --git a/usr.bin/uniq/uniq.c b/usr.bin/uniq/uniq.c index 5b675600e56c..17c5da6e952d 100644 --- a/usr.bin/uniq/uniq.c +++ b/usr.bin/uniq/uniq.c @@ -237,12 +237,13 @@ main (int argc, char *argv[]) fputc('\n', ofp); show(ofp, prevline); } - show(ofp, thisline); } else if (dflag && !cflag) { if (repeats == 0) show(ofp, prevline); } ++repeats; + if (Dflag) + show(ofp, thisline); } } if (ferror(ifp)) @@ -378,7 +379,7 @@ obsolete(char *argv[]) static void usage(void) { - (void)fprintf(stderr, -"usage: uniq [-c | -d | -D | -u] [-i] [-f fields] [-s chars] [input [output]]\n"); + (void)fprintf(stderr, "usage: uniq [-cdiu] [-D[septype]] " + "[-f fields] [-s chars] [input [output]]\n"); exit(1); } From nobody Mon Dec 16 13:35: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 4YBgtJ5d1kz5hRT1; Mon, 16 Dec 2024 13:35: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YBgtJ58nbz4Gdb; Mon, 16 Dec 2024 13:35:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734356120; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=km0EtuXdmGT5z1nXEwC+vSE5VdSVMts942itWlkUwdc=; b=iIPWpQrGKZRfILUib0MjttZUfDP5WkMIdRYzpKZUIDmPaARLOX7Krdv9ZXaMVT8JFoj60r pC163tjFKZmq4W2oU/Gd1P1cU12Y027Da0vJTNXd0KF0lLQ7mrVDiDkV6RIzNVSMfWsAS5 jxZLVcxGz6oQJq3ONMTsJPXUZEkZXBlQ5kN1Q1cy3GtSEka87oRsB+eXlMg7uA0KCOVbcb 7ypiJryUVOEuenviJs3bPnx8173o7oPz3Ez9aKpaut0c48fEwnl2CmF9Wb/Ho/NWjThNBs rRL+Bmyy3/AYw7qz4M+jheFBitkkKyOt4Z46NoVQP9C7Ksx0K+juDBDKf36ghw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734356120; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=km0EtuXdmGT5z1nXEwC+vSE5VdSVMts942itWlkUwdc=; b=Qcrx9+1/axLQDmJ/depWd7DOcgFpSdj9/nbJjF7R0CEN+/lBwObiPDoiFWL1ReGZyhj+G3 riaC5KFjpH2tCfwQl6t+JIVI+S6VBXVi7m/7vyjdl1pU6S7fkMBe0hq39Ss8Z3xOlgYoSl 4BEK8EDUuHAMo+BwRskSz+sk8FAdxBVPzbCfTC+1UkwEkL/xHTwtKaYKYoTM46Ygnr3hlk gZlPJswhuvCex0gaWaJWr3PSO0wR8dXcu5xC7D5ofe0lcICbuvZJ+yK7O1t7Uw+UaycFuk qQSrQ+rsp32suLgQ1FT1lkWR7SY9Z35tuHuEvR5qI8/QFHTJhxea9Hy0ycdHJg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734356120; a=rsa-sha256; cv=none; b=GdvH/aAfOCyxpWvLKsf2CiCQlkdWqmOBgkC7SFzZTW2sO4LMBYYUDzEhOq7y4yWM5DLBwl NYtcAcEXF17YytH3OlyV6MMIquibq2qEeI5+eav5xMWZ4dwApaJJQvC4Ow+GdzO0r4W+OU 99EUlBNcjArymO/eNmq8PHS0uDT1C1hZ8iqeeOSBolU1p7kH94ubvA2CM/HXLQ3N6iuUdm GQh6XOndWhUS+V8Fpzw4N96igCoz5KGsyObE0MJJUzRsBD0zypqPC9MUyKjPEChN0l1Yzv DdrQIN8ofYzpHjiDBxuAqRsctKJJk0ogOPwKscOIfskZ56zouPvNohRhowpDdA== 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 4YBgtJ4l8jzw29; Mon, 16 Dec 2024 13:35:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BGDZKh8020202; Mon, 16 Dec 2024 13:35:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BGDZKJR020199; Mon, 16 Dec 2024 13:35:20 GMT (envelope-from git) Date: Mon, 16 Dec 2024 13:35:20 GMT Message-Id: <202412161335.4BGDZKJR020199@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: 48d21d15a8f2 - stable/13 - strptime: Fix day-of-week calculation. 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: 48d21d15a8f22c766f1651c0a244554f6b5d7af7 Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=48d21d15a8f22c766f1651c0a244554f6b5d7af7 commit 48d21d15a8f22c766f1651c0a244554f6b5d7af7 Author: Dag-Erling Smørgrav AuthorDate: 2024-12-09 12:37:45 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-12-16 10:38:57 +0000 strptime: Fix day-of-week calculation. The day-of-week calculation used the raw year value without adjusting for TM_YEAR_BASE, so it was off by one for 300 years out of every 400; it just happened to be correct for 1901 through 2000. It also used a loop where a simple addition would have sufficed. While here, simplify our version of Gauss's algorithm, and document that we assume the Gregorian calendar. MFC after: 1 week PR: 282916 Reviewed by: imp, allanjude, philip Differential Revision: https://reviews.freebsd.org/D47977 (cherry picked from commit 4285e024baa80f81d13cdcc016fdf0721fe57862) --- etc/mtree/BSD.tests.dist | 2 ++ lib/libc/stdtime/strptime.3 | 7 ++++- lib/libc/stdtime/strptime.c | 22 ++++++--------- lib/libc/tests/Makefile | 1 + lib/libc/tests/stdtime/Makefile | 7 +++++ lib/libc/tests/stdtime/strptime_test.c | 50 ++++++++++++++++++++++++++++++++++ 6 files changed, 74 insertions(+), 15 deletions(-) diff --git a/etc/mtree/BSD.tests.dist b/etc/mtree/BSD.tests.dist index c2d99ae33e30..4315fe9657c9 100644 --- a/etc/mtree/BSD.tests.dist +++ b/etc/mtree/BSD.tests.dist @@ -358,6 +358,8 @@ .. stdlib .. + stdtime + .. string .. sys diff --git a/lib/libc/stdtime/strptime.3 b/lib/libc/stdtime/strptime.3 index 0dfa33aa29cb..7df73d2d080a 100644 --- a/lib/libc/stdtime/strptime.3 +++ b/lib/libc/stdtime/strptime.3 @@ -23,7 +23,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" " -.Dd October 2, 2014 +.Dd December 9, 2024 .Dt STRPTIME 3 .Os .Sh NAME @@ -135,6 +135,11 @@ function has been contributed by Powerdog Industries. .Pp This man page was written by .An J\(:org Wunsch . +.Sh CAVEATS +The +.Fn strptime +function assumes the Gregorian calendar and will produce incorrect +results for dates prior to its introduction. .Sh BUGS Both the .Fa %e diff --git a/lib/libc/stdtime/strptime.c b/lib/libc/stdtime/strptime.c index 848b94545dd2..e9ffe7180916 100644 --- a/lib/libc/stdtime/strptime.c +++ b/lib/libc/stdtime/strptime.c @@ -70,17 +70,16 @@ static char * _strptime(const char *, const char *, struct tm *, int *, locale_t #define FLAG_WDAY (1 << 5) /* - * Calculate the week day of the first day of a year. Valid for - * the Gregorian calendar, which began Sept 14, 1752 in the UK - * and its colonies. Ref: - * http://en.wikipedia.org/wiki/Determination_of_the_day_of_the_week + * Gauss's algorithm for the day of the week of the first day of any year + * in the Gregorian calendar. */ - static int first_wday_of(int year) { - return (((2 * (3 - (year / 100) % 4)) + (year % 100) + - ((year % 100) / 4) + (isleap(year) ? 6 : 0) + 1) % 7); + return ((1 + + 5 * ((year - 1) % 4) + + 4 * ((year - 1) % 100) + + 6 * ((year - 1) % 400)) % 7); } static char * @@ -682,13 +681,8 @@ label: flags |= FLAG_MDAY; } if (!(flags & FLAG_WDAY)) { - i = 0; - wday_offset = first_wday_of(tm->tm_year); - while (i++ <= tm->tm_yday) { - if (wday_offset++ >= 6) - wday_offset = 0; - } - tm->tm_wday = wday_offset; + wday_offset = first_wday_of(tm->tm_year + TM_YEAR_BASE); + tm->tm_wday = (wday_offset + tm->tm_yday) % 7; flags |= FLAG_WDAY; } } diff --git a/lib/libc/tests/Makefile b/lib/libc/tests/Makefile index 7b262ea646fb..20238b376752 100644 --- a/lib/libc/tests/Makefile +++ b/lib/libc/tests/Makefile @@ -16,6 +16,7 @@ TESTS_SUBDIRS+= rpc TESTS_SUBDIRS+= setjmp TESTS_SUBDIRS+= stdio TESTS_SUBDIRS+= stdlib +TESTS_SUBDIRS+= stdtime TESTS_SUBDIRS+= string TESTS_SUBDIRS+= sys TESTS_SUBDIRS+= termios diff --git a/lib/libc/tests/stdtime/Makefile b/lib/libc/tests/stdtime/Makefile new file mode 100644 index 000000000000..c7a7f5b9436f --- /dev/null +++ b/lib/libc/tests/stdtime/Makefile @@ -0,0 +1,7 @@ +.include + +ATF_TESTS_C+= strptime_test + +TESTSDIR:= ${TESTSBASE}/${RELDIR:C/libc\/tests/libc/} + +.include diff --git a/lib/libc/tests/stdtime/strptime_test.c b/lib/libc/tests/stdtime/strptime_test.c new file mode 100644 index 000000000000..79a97764999c --- /dev/null +++ b/lib/libc/tests/stdtime/strptime_test.c @@ -0,0 +1,50 @@ +/*- + * Copyright (c) 2024 Dag-Erling Smørgrav + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#include + +#include + +ATF_TC_WITHOUT_HEAD(dayofweek); +ATF_TC_BODY(dayofweek, tc) +{ + static const struct { + const char *str; + int wday; + } cases[] = { + { "1582-12-20", 1 }, + { "1700-03-01", 1 }, + { "1752-09-14", 4 }, + { "1800-12-31", 3 }, + { "1801-01-01", 4 }, + { "1900-12-31", 1 }, + { "1901-01-01", 2 }, + { "2000-12-31", 0 }, + { "2001-01-01", 1 }, + { "2100-12-31", 5 }, + { "2101-01-01", 6 }, + { "2200-12-31", 3 }, + { "2201-01-01", 4 }, + { }, + }; + struct tm tm; + + for (unsigned int i = 0; cases[i].str != NULL; i++) { + if (strptime(cases[i].str, "%Y-%m-%d", &tm) == NULL) { + atf_tc_fail_nonfatal("failed to parse %s", + cases[i].str); + } else if (tm.tm_wday != cases[i].wday) { + atf_tc_fail_nonfatal("expected %d for %s, got %d", + cases[i].wday, cases[i].str, tm.tm_wday); + } + } +} + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, dayofweek); + return (atf_no_error()); +} From nobody Mon Dec 16 13:35:21 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 4YBgtL0zDDz5hRHt; Mon, 16 Dec 2024 13:35: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YBgtK66r1z4GYc; Mon, 16 Dec 2024 13:35:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734356121; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=98haQMvLH3cFbTRrESUw7g9cxEqP8fjlm22l2qGixRE=; b=Ip+zxpMi8Y7HMkEsUMzyYzx0CUHGr2RN7SctnvxLPAZAxHKaONTYUz7p/qlqYOxRExiRye EYMC5EdM4JeJc+XUhqJU7OM5ht5R1wws1hrgvj6FYwlcLSIEccenNAQcyUCkF+ojfxWaGo j0i9Hxaf/yghaEwtP6vS5ktwW/GdIquKjf5U6U6cez6N1lEfiHdVc83pxzJTlRerYOSTP8 OH63MiFTG95AHqfiWKsosmUwsA0qGZrkMXFV8sjk74JTMglC4LcKVMKBEqYA7HUUiRQWkk mPCoE7QBd4Cgmg9R6Fv2I1ro8+7Voy0j55LUDSSSUUzYJMX5jg3ijo09DxkLkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734356121; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=98haQMvLH3cFbTRrESUw7g9cxEqP8fjlm22l2qGixRE=; b=ExRvYFNyMq6ji9me8VsGxEQabZkS/TL2TSuhSq2aMBNVmjTWgL3zAwqoXy2sp4c3SAT77C Uga6CJJ7qbEiJEr1DYOj/bGQ8C0vvhEifbqQO27vh3MnzOwD8VBUmymR/bYiEukC1Z2FLO iJBpCdNnxWUJHEru0KsDUOaPvln/0Ex3mrUdTSSfAGcHkUlDBJFZbNojY0qGdypPtL3mQj tI+erekAR/9aGQmd189A32ZZReptz5Ub4lOzEIEpXkzzl6v/ffd0IYmx4ob870mbCBGK+L 0u0A008IuxQazRrjYOOs6dVB4b0IULNCI9UbV+XeEl0rBiHWnWbTMczxalxLaw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734356121; a=rsa-sha256; cv=none; b=s40gRb466MLQfCgAFu4DAFcvR1k0D1kFO+9AJ9ZRWDVWdc/2lcV/3Fi22ioN9gjY6vxsNW 5WI5u4NWSNFMELiwLszeGSjB5sWJVup8UGs6oFzo208guAA2G+gmcHro+opXOYEl/kkzxd h0/f2SEBjfNTbrn1XnswKs75CAXJo5dtRlUGGUNxa3tbuwmqXN7G5r91tt/sg8KP+Xd8aA gRoX/5Yw0kNnutSNLekMaX+Dd29mm4408+qdyR81KqF+k7HK7BUqKpGCOtRjtL/FPi+2x+ jjn49+SnOnI4eCoTojdHuJfta4mrNbDhg6KLAyh1dWI2dF2LB96lMx1XCQEwfg== 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 4YBgtK5l3Fzw2B; Mon, 16 Dec 2024 13:35:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BGDZLKK020258; Mon, 16 Dec 2024 13:35:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BGDZLxJ020255; Mon, 16 Dec 2024 13:35:21 GMT (envelope-from git) Date: Mon, 16 Dec 2024 13:35:21 GMT Message-Id: <202412161335.4BGDZLxJ020255@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: 3a052d2d36ba - stable/13 - uniq: Correctly document the -D 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: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3a052d2d36ba46e842fe3aaed4d069e647f45ae7 Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=3a052d2d36ba46e842fe3aaed4d069e647f45ae7 commit 3a052d2d36ba46e842fe3aaed4d069e647f45ae7 Author: Dag-Erling Smørgrav AuthorDate: 2024-12-09 19:44:34 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-12-16 10:38:58 +0000 uniq: Correctly document the -D option. The -D option takes an optional argument; modify the usage message and the manual page's synopsis to correctly reflect this. Also update the tests to exercise -D with and without an argument. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: asomers Differential Revision: https://reviews.freebsd.org/D47999 (cherry picked from commit b93791f5e7b0246b121dd98c10d6563298d6b2b0) uniq: Fix off-by-one bug in -cD case. When printing only duplicated lines, the first line of each set is not printed until we encounter the second. When that happens, we need to increment the repetition count between printing the first and the second line, so that if we are also printing counts, we don't print the same (pre-increment) count twice. MFC after: 1 week PR: 275764 Reported by: Yu-Sheng Ma Submitted by: Daniel Tameling (original patch) Sponsored by: Klara, Inc. Reviewed by: tamelingdaniel_gmail.com, asomers, emaste Differential Revision: https://reviews.freebsd.org/D48000 (cherry picked from commit c3f8900e696998c410dc16f9bd9d45c24c413e6b) --- usr.bin/uniq/tests/uniq_test.sh | 33 +++++++++++++++++++++++++++++++++ usr.bin/uniq/uniq.1 | 6 +++--- usr.bin/uniq/uniq.c | 7 ++++--- 3 files changed, 40 insertions(+), 6 deletions(-) diff --git a/usr.bin/uniq/tests/uniq_test.sh b/usr.bin/uniq/tests/uniq_test.sh index 804e82ce7766..b1d7a94ae60a 100755 --- a/usr.bin/uniq/tests/uniq_test.sh +++ b/usr.bin/uniq/tests/uniq_test.sh @@ -53,7 +53,12 @@ count_repeated_head() { count_repeated_body() { printf "a\na\nb\nb\na\n" >input printf " 2 a\n 2 b\n" >expected + atf_check_uniq -cd + atf_check_uniq -c -d + atf_check_uniq -dc + atf_check_uniq -d -c atf_check_uniq --count --repeated + atf_check_uniq --repeated --count } atf_test_case all_repeated @@ -64,7 +69,34 @@ all_repeated_body() { printf "a\na\nb\na\na\n" >input printf "a\na\na\na\n" >expected atf_check_uniq -D + atf_check_uniq -Dnone atf_check_uniq --all-repeated + atf_check_uniq --all-repeated=none + printf "\na\na\n\na\na\n" >expected + atf_check_uniq -Dprepend + atf_check_uniq --all-repeated=prepend + printf "a\na\n\na\na\n" >expected + atf_check_uniq -Dseparate + atf_check_uniq --all-repeated=separate +} + +atf_test_case count_all_repeated +count_all_repeated_head() { + atf_set descr "count and print every instance of repeated lines" +} +count_all_repeated_body() { + printf "a\na\nb\na\na\n" >input + printf " 1 a\n 2 a\n 1 a\n 2 a\n" >expected + atf_check_uniq -D -c + atf_check_uniq -Dnone -c + atf_check_uniq -cD + atf_check_uniq -cDnone + atf_check_uniq -c -D + atf_check_uniq -c -Dnone + atf_check_uniq --all-repeated --count + atf_check_uniq --all-repeated=none --count + atf_check_uniq --count --all-repeated + atf_check_uniq --count --all-repeated=none } atf_test_case skip_fields @@ -181,6 +213,7 @@ atf_init_test_cases() atf_add_test_case repeated atf_add_test_case count_repeated atf_add_test_case all_repeated + atf_add_test_case count_all_repeated atf_add_test_case skip_fields atf_add_test_case skip_fields_tab atf_add_test_case ignore_case diff --git a/usr.bin/uniq/uniq.1 b/usr.bin/uniq/uniq.1 index 3fc1d26774ca..19d167ddc4cc 100644 --- a/usr.bin/uniq/uniq.1 +++ b/usr.bin/uniq/uniq.1 @@ -30,7 +30,7 @@ .\" .\" From: @(#)uniq.1 8.1 (Berkeley) 6/6/93 .\" -.Dd January 12, 2024 +.Dd December 9, 2024 .Dt UNIQ 1 .Os .Sh NAME @@ -38,8 +38,8 @@ .Nd report or filter out repeated lines in a file .Sh SYNOPSIS .Nm -.Op Fl c | Fl d | Fl D | Fl u -.Op Fl i +.Op Fl cdiu +.Op Fl D Ns Op Ar septype .Op Fl f Ar num .Op Fl s Ar chars .Oo diff --git a/usr.bin/uniq/uniq.c b/usr.bin/uniq/uniq.c index 5b675600e56c..17c5da6e952d 100644 --- a/usr.bin/uniq/uniq.c +++ b/usr.bin/uniq/uniq.c @@ -237,12 +237,13 @@ main (int argc, char *argv[]) fputc('\n', ofp); show(ofp, prevline); } - show(ofp, thisline); } else if (dflag && !cflag) { if (repeats == 0) show(ofp, prevline); } ++repeats; + if (Dflag) + show(ofp, thisline); } } if (ferror(ifp)) @@ -378,7 +379,7 @@ obsolete(char *argv[]) static void usage(void) { - (void)fprintf(stderr, -"usage: uniq [-c | -d | -D | -u] [-i] [-f fields] [-s chars] [input [output]]\n"); + (void)fprintf(stderr, "usage: uniq [-cdiu] [-D[septype]] " + "[-f fields] [-s chars] [input [output]]\n"); exit(1); } From nobody Mon Dec 16 15:14: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 4YBk4r4wz1z5hY9F; Mon, 16 Dec 2024 15:14: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YBk4r44Tpz45s5; Mon, 16 Dec 2024 15:14:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734362076; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Uy94Nlq/h1pypo2j0Mab5cswT7mccejpOSst9rzI/nA=; b=C51y+avgBkOfcbIyKlD3LVKHn1sudFA+yYxNx0EltRJpZYUw93TZ3qSFY9hII+7Zp/ya+F yIxzchv+t5tvnti/xLBHGmfqABcSXYsDA8yRqwZFoDY4Lso0ztHeJZFnWyKZH8KL8NHDtd uFKnwnffrNzJSDEv77Masi72KckMM1hBf7WAYrGGiS7YOj/k7I2+5Tqe0iUxfAjM4fmpkA r3Np5p6pY3TxF6gw7SnI7aNzWG2oAk3SxO0QYUlVEYuu/pxhVcCjDIZmlwWPTA63JJWWNe I/jl2/x63SunFln4pm/TZWU3FLhfORACirjUexcKTtALnYASuyddeREv2qromw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734362076; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Uy94Nlq/h1pypo2j0Mab5cswT7mccejpOSst9rzI/nA=; b=R+o7D+YJ4Xv3rBbWXglwLl+1V/vDNXVM8ZWmbkXgjLhC3ZpRTbvUHQMl0fKzz/F2rAeKFi AUM8RJOhT7522gbQWZepZ7sH0CSLpeq0DJWIciohQ4D/2KQTKIF9nhO65hji0yr34b9UM/ UrljKLwQeONWMBWluIujx+twKpPKFGERdulbkIf6mKLKRuVdZgw0vFasNEbeMgGz+9B3au +9oNY2l43in+oylJKts8QYTbme+Ypbxk+zqgJHkwJr+5A7rfGYz0gozkc50IIkcO8sY94j vtnUQ27lqyO5xJohq8lrm8FeTC4EGcR2Yh6sn54oC5gvEw6pjolv33NOiP5j6w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734362076; a=rsa-sha256; cv=none; b=x/rI/5Hl/yF5eVocr7ViN1hXUZxpnPf4WAqbRuBaqFUyhYUBcj3IVVbNC0xZ1JGQU89F2+ vvJJxkKrqqMmr3ixmyfhvZkCfWZu5X1koNmbZbyOBc44bI5wC4jEkBYP+4bzON+FVfXhMR 0OF8kHElxjL52yB291OIb1xZ81pVJ0qwn7t3vXZxaAgQQGYV3JCqE0shXImNxqFHsx3AUs tIbjnsdAwhSITjIMJmswlmQGziLaqVuI2FxWbPYx3Lzq5tQ3DRPgqEyNRPBjSgA8+vlQJG QsmMgOaM94snls1U3BMAxA0DpftBKpysTOlwyROvewQF/3WxioaeOjPqDr5Irw== 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 4YBk4r3ZyvzyDL; Mon, 16 Dec 2024 15:14:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BGFEaul011024; Mon, 16 Dec 2024 15:14:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BGFEak0011021; Mon, 16 Dec 2024 15:14:36 GMT (envelope-from git) Date: Mon, 16 Dec 2024 15:14:36 GMT Message-Id: <202412161514.4BGFEak0011021@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: 3e93a090b5c8 - stable/14 - nanobsd: Add missing options to usage() 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: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 3e93a090b5c8f48e503cf640e67e926e6e79b31b Auto-Submitted: auto-generated The branch stable/14 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=3e93a090b5c8f48e503cf640e67e926e6e79b31b commit 3e93a090b5c8f48e503cf640e67e926e6e79b31b Author: Jose Luis Duran AuthorDate: 2024-11-07 14:16:50 +0000 Commit: Jose Luis Duran CommitDate: 2024-12-16 15:11:22 +0000 nanobsd: Add missing options to usage() -B suppress installs (both kernel and world) -I build disk image from existing build/install -W suppress installworld PR: 277269 Reviewed by: imp, emaste Approved by: emaste (mentor) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D47475 (cherry picked from commit 999f288a0eeb230d3655da94c1186ca03c0cc404) --- tools/tools/nanobsd/defaults.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/tools/nanobsd/defaults.sh b/tools/tools/nanobsd/defaults.sh index 55314d7ef78d..33111a9c401f 100755 --- a/tools/tools/nanobsd/defaults.sh +++ b/tools/tools/nanobsd/defaults.sh @@ -852,17 +852,20 @@ pprint ( ) ( usage ( ) { ( - echo "Usage: $0 [-bfhiKknqvwX] [-c config_file]" + echo "Usage: $0 [-BbfhIiKknqvWwX] [-c config_file]" + echo " -B suppress installs (both kernel and world)" echo " -b suppress builds (both kernel and world)" echo " -c specify config file" echo " -f suppress code slice extraction (implies -i)" echo " -h print this help summary page" + echo " -I build disk image from existing build/install" echo " -i suppress disk image build" echo " -K suppress installkernel" echo " -k suppress buildkernel" echo " -n add -DNO_CLEAN to buildworld, buildkernel, etc" echo " -q make output more quiet" echo " -v make output more verbose" + echo " -W suppress installworld" echo " -w suppress buildworld" echo " -X make native-xtools" ) 1>&2 From nobody Mon Dec 16 15:14: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 4YBk4s5MQ2z5hY4q; Mon, 16 Dec 2024 15:14: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YBk4s4xGLz46B5; Mon, 16 Dec 2024 15:14:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734362077; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cllxg8DXXI6Ku9Mf3uOcbL8cTyuKZltHymLVyFmNdjE=; b=Qc+wiwDLbFVGrkHRlMnRzwFx5wcwCWIAoxIPCci9QD9k/mWZYmna//tYF9dAvWchWJl+FJ jV8rJ/Xl/nKuCKezMWn9asLM+ZpnXYN9xZWS1A14HU+V1jzn5kiOFaYKG5gKnJaL8WjXas KH6HXrad16vMIBxC3sBZV4VI8+h0lfZyH3Ujkj/oIb/+G36KXaGz4RlA0lRxGKf/nwMAXm aoS68gSeOykIXigfzJSa+SvRSTE1hDyK7xRTFZKCy/kq3WmzJ8Lk1zwxC4lMIeZ5BNh1kv zfEVX7AITYWxJK6VfeNyigQimOUuOasEm5FgLsmjZ2m5oCM8e3cviHzmhcSDaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734362077; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cllxg8DXXI6Ku9Mf3uOcbL8cTyuKZltHymLVyFmNdjE=; b=Eu9/I7eGTXxHB6AXNvCK94i+z31t7ou/kASlbaCripM61fG2SNZLkT8i5VszYU/WwN4PlS qdCmM4EURGdoG07ufuSvzyQq4GMUkjlPha+nIk77YadlbG+xJMWw1/vNL8/ziDvT29wJ+8 LE9EzgVyykNTai68om4r1cEOyRH3Z7JswVvmsjJZw2dSHKy0ORMuoknmD9eO4yuS1G4ab2 1kMWZf1+cZzrr2ZHH99TCQkVBREX9zZcSvDLMsFDTD1ryVPpvqnJbbLk7SD/DY9EW9Wdc4 eR5NXjSC3CEg/v89D7lfwitvya26VBXPxyOLID0ewi/a5eV54dZuKGxAJrzE2w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734362077; a=rsa-sha256; cv=none; b=GDpHOoLZM3BcgiyqsLrwHGnK5yksF5bArPWGudujQmc8lNUXgARyQ9EQ44J8kpFJK/y7jQ OG2u+em5msgLWEtxRLU0c4pTr36yT7t0sX1Lky+VUkDYjPJghna9orZg8+XITPmWYKTJ4n ZZt571G8Ihy7m+fvTxIf4l3x8ymU6Ha9d8iB772gfEch+RJQKdbHpCEiq1XozrY79soL1l S6ieOEnlpeymtfibxE2e9DUZvPxeB8YtrTqtdXe1mQPKvEoVWMvTgadzxc+3EfK8htZ81I SJAk6K+QxlqTXtsZpRHskVoSg826WYu/PioQFCIsPT8D/3WVNmjg+46f5NHboQ== 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 4YBk4s4XYJzyhy; Mon, 16 Dec 2024 15:14:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BGFEboj011070; Mon, 16 Dec 2024 15:14:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BGFEbbp011067; Mon, 16 Dec 2024 15:14:37 GMT (envelope-from git) Date: Mon, 16 Dec 2024 15:14:37 GMT Message-Id: <202412161514.4BGFEbbp011067@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: 67dd41cdb10d - stable/14 - nanobsd: Fix parallel make 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: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 67dd41cdb10dcdf113f29645ff2c10e00bd27770 Auto-Submitted: auto-generated The branch stable/14 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=67dd41cdb10dcdf113f29645ff2c10e00bd27770 commit 67dd41cdb10dcdf113f29645ff2c10e00bd27770 Author: Jose Luis Duran AuthorDate: 2024-11-07 14:32:01 +0000 Commit: Jose Luis Duran CommitDate: 2024-12-16 15:11:31 +0000 nanobsd: Fix parallel make The NANO_NCPU (number of CPUs) value gets ignored by the build script when setting the NANO_PMAKE (parallel make) value. Fix it by setting the NANO_PMAKE later in the process. PR: 277269 Reviewed by: imp, emaste Approved by: emaste (mentor) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D47476 (cherry picked from commit 3c5d19a40de7273bb478163639dd8532af425595) --- tools/tools/nanobsd/defaults.sh | 5 ++++- tools/tools/nanobsd/nanobsd.sh | 4 ---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/tools/tools/nanobsd/defaults.sh b/tools/tools/nanobsd/defaults.sh index 33111a9c401f..8ce3af149356 100755 --- a/tools/tools/nanobsd/defaults.sh +++ b/tools/tools/nanobsd/defaults.sh @@ -67,7 +67,6 @@ NANO_PKG_META_BASE=/var/db # Make & parallel Make NANO_MAKE="make" NANO_NCPU=$(sysctl -n hw.ncpu) -NANO_PMAKE="make -j $NANO_NCPU" # The default name for any image we create. NANO_IMGNAME="_.disk.full" @@ -892,6 +891,10 @@ set_defaults_and_export ( ) { : ${NANO_DISKIMGDIR:=${NANO_OBJ}} : ${NANO_WORLDDIR:=${NANO_OBJ}/_.w} : ${NANO_LOG:=${NANO_OBJ}} + : ${NANO_PMAKE:="${NANO_MAKE} -j ${NANO_NCPU}"} + if ! $do_clean; then + NANO_PMAKE="${NANO_PMAKE} -DNO_CLEAN" + fi NANO_MAKE_CONF_BUILD=${MAKEOBJDIRPREFIX}/make.conf.build NANO_MAKE_CONF_INSTALL=${NANO_OBJ}/make.conf.install diff --git a/tools/tools/nanobsd/nanobsd.sh b/tools/tools/nanobsd/nanobsd.sh index af03d89acece..4c390d8ca371 100755 --- a/tools/tools/nanobsd/nanobsd.sh +++ b/tools/tools/nanobsd/nanobsd.sh @@ -156,10 +156,6 @@ if [ ! -d "${NANO_TOOLS}" ]; then exit 1 fi -if ! $do_clean; then - NANO_PMAKE="${NANO_PMAKE} -DNO_CLEAN" -fi - pprint 1 "NanoBSD image ${NANO_NAME} build starting" run_early_customize From nobody Mon Dec 16 15:14: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 4YBk4t6CkQz5hYR6; Mon, 16 Dec 2024 15:14: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YBk4t5S4Gz46F1; Mon, 16 Dec 2024 15:14:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734362078; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zZKTfOkHeUWwVnDV/mURU9IdQecpLzERNkrAMx3dkX4=; b=iFCs/xggO/72xfF6kBZMq0riX1kIeKp/NqVwzi0QJJqswwC1801PdLCGN/rc1dxJ83mPAs 5VhhmOnPRkgd0P8hOQE5NHNPQnKXp4rHwQL5NAlMX2qbH/SULZ54rk038ZDx1+6JoDngdy iIwga9YRecdQ30cIPwWKj7Ny37oX1bW8zzgSdb2Zmj+P8EWx/oUZVuH1/BH0Vr87RwBubq CgQMHqxSBcsy3NsdyWSC8u9V7EDQYlCgrs40BX8AOQHcvIF0mhIaj6AMkBi9HWdhK0uieU c8uVKyjGP08c9Cm+0nZH2ET1IT8Kqx1qXhy2kgJRSeqx3h2RXP7AlAcREkzaIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734362078; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zZKTfOkHeUWwVnDV/mURU9IdQecpLzERNkrAMx3dkX4=; b=Zz+JoQww+eiOwpPGgdXgk8BETo2fl1R3UFC104L2EVd3C11k73m5PoNrhYF8ZwzkQpO02P 6Sr88VnfS4jmsXcbOR2e0tTBWrYfPrZvdtNsddMpH8u1V0nY8NTS807J6IMgJhbFpneoG/ CUt835s5CXfETKlUqN88+sj/Rk4FvnpEoGoAjSpMR4OrKzbdhOKGU7y6vkGCGTQthotQNe DkhBy8xclvAAgRRaralceNEcNvO8aAgzojALtJekhWUDk635zJt/hI5w2htIyGHf2e1i2r 8qkNFVh6ZToCrWW6hRKaxeEiaAcHabNHRhKvZ0zLfqrm6T0HaTnycYvh8Nv9eA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734362078; a=rsa-sha256; cv=none; b=Tj3F+BvoN2JJZ1oh32ZFChjq0+jPmsWSqzkWAFWLT6IUhmL1FH9+rsffUWPDRSs7DDZ35U ORCZrNeHcdk37phZLAj2sqn/iZPbyFEzEcDczZpCQzynC+XZbZPEDz0NSkv8Iffo7zuoaR Yj9iLukYX9PnRzKQQjiASavSZOR3GBYUyb/O+Xv+h/2H3/ft9H4JEe7amov2kNtmXeY3HI iPeUERM5dFY+3uFRChg2Mo4gRLwP//FxEa+wGY6TgNxzcx8vbmtzbDBtporMk5HJkNRp/1 zlgCHRyByW+RXXRN2fMEBvm0l4viamIxb9CqT4mbMqhRh6c2bIn8SFQgnUno7A== 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 4YBk4t54N3zyjf; Mon, 16 Dec 2024 15:14:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BGFEcWP011121; Mon, 16 Dec 2024 15:14:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BGFEcqk011118; Mon, 16 Dec 2024 15:14:38 GMT (envelope-from git) Date: Mon, 16 Dec 2024 15:14:38 GMT Message-Id: <202412161514.4BGFEcqk011118@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: 6df2857eaa53 - stable/14 - nanobsd: Avoid read-only file system warnings 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: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 6df2857eaa53d640d9bc729135f95179948cc9df Auto-Submitted: auto-generated The branch stable/14 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=6df2857eaa53d640d9bc729135f95179948cc9df commit 6df2857eaa53d640d9bc729135f95179948cc9df Author: Jose Luis Duran AuthorDate: 2024-11-08 18:13:48 +0000 Commit: Jose Luis Duran CommitDate: 2024-12-16 15:11:39 +0000 nanobsd: Avoid read-only file system warnings The default setting of some loader or rc variables generate warnings because the file system is read-only: Set the following options to avoid printing these warnings: /boot/defaults/loader.conf: - hostuuid_load="NO" to disable loading /etc/hostid early at boot time - entropy_cache_load="NO" to disable loading cached entropy at boot time - kern.random.initial_seeding.disable_bypass_warnings="1" to disable logging a warning if the 'bypass_before_seeding' knob is enabled (enabled by default) and a request is submitted prior to initial seeding /etc/defaults/rc.conf: - kldxref_enable="NO" to disable building linker.hints files with kldxref(8) - entropy_boot_file="NO" to disable very early (used at early boot-time) entropy caching through reboots - entropy_dir="NO" to disable caching entropy via cron While here, move rc.conf options before sourcing vendor.conf, so they can be overridden. PR: 277601 Reviewed by: imp Approved by: emaste (mentor) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D47502 (cherry picked from commit e5579f98c02ff64b0c305f6731c3557ba69c2d25) --- tools/tools/nanobsd/defaults.sh | 41 +++++++++++++++++++++++++++++++++++------ 1 file changed, 35 insertions(+), 6 deletions(-) diff --git a/tools/tools/nanobsd/defaults.sh b/tools/tools/nanobsd/defaults.sh index 8ce3af149356..e431f6653fec 100755 --- a/tools/tools/nanobsd/defaults.sh +++ b/tools/tools/nanobsd/defaults.sh @@ -570,13 +570,42 @@ setup_nanobsd_etc ( ) ( # create diskless marker file touch etc/diskless - [ -n "${NANO_NOPRIV_BUILD}" ] && chmod 666 etc/defaults/rc.conf - - # Make root filesystem R/O by default - echo "root_rw_mount=NO" >> etc/defaults/rc.conf - # Disable entropy file, since / is read-only /var/db/entropy should be enough? - echo "entropy_file=NO" >> etc/defaults/rc.conf + [ -n "${NANO_NOPRIV_BUILD}" ] && chmod 666 boot/defaults/loader.conf + { + echo + echo '### NanoBSD configuration ##################################' + echo 'hostuuid_load="NO"' + echo 'entropy_cache_load="NO" # Disable loading cached entropy at boot time.' + echo 'kern.random.initial_seeding.disable_bypass_warnings="1" # Do not log a warning' + echo " # if the 'bypass_before_seeding' knob is enabled" + echo " # and a request is submitted prior to initial" + echo " # seeding." + } >> boot/defaults/loader.conf + [ -n "${NANO_NOPRIV_BUILD}" ] && chmod 444 boot/defaults/loader.conf + [ -n "${NANO_NOPRIV_BUILD}" ] && chmod 666 etc/defaults/rc.conf + if ! ed -s etc/defaults/rc.conf <<\EOF +/^### Define source_rc_confs, the mechanism used by \/etc\/rc\.\* ##$/i +### NanoBSD options ######################################## +############################################################## + +kldxref_enable="NO" # Disable building linker.hints files with kldxref(8). +root_rw_mount="NO" # Inhibit remounting root read-write. +entropy_boot_file="NO" # Disable very early (used at early boot time) + # entropy caching through reboots. +entropy_file="NO" # Disable late (used when going multi-user) + # entropy through reboots. +entropy_dir="NO" # Disable caching entropy via cron. + +############################################################## +. +w +q +EOF + then + echo "Regular expression pattern not found" + exit 2 + fi [ -n "${NANO_NOPRIV_BUILD}" ] && chmod 444 etc/defaults/rc.conf # save config file for scripts From nobody Mon Dec 16 15:14: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 4YBk4w1MnQz5hYR7; Mon, 16 Dec 2024 15:14: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YBk4v6Y92z46HD; Mon, 16 Dec 2024 15:14:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734362079; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PB/dxEE8HBwkZKTjgdYrj4hBpXgP6/Rso+w28zE2DFo=; b=ZRPKNPrw4/xhBpoWQmtjZdoz8w4mofJM2hCyGtlyu5hsYhe5oCJhb8RdzEbUEo4LauNMPP b3+ydVLuv2Z5qN0dr9QUS1lVW4t+YZeQqie8udm4ZLK5zOsHuNoxSpMeGR5eFB08yuBU86 Ps0tHeoV+lHQn/nXkLitlgyXwaCW4zqtuNd3erjsHTq7qmcmGXV0djC+ePcNr6oVhGZhwC k/r9fJyXv5a7eVOr3bjfRty4cvLyymAQZYneX8I7iqQ9gbhpbtswCNO2kpAbiToyjLK99q 159gxVbBEyr3byWaCjPujmPrA2Pl3SYEtcu2uQI6mAYsnnc9lR578UuKtulmgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734362079; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PB/dxEE8HBwkZKTjgdYrj4hBpXgP6/Rso+w28zE2DFo=; b=pgUcISnnIRTRUXA4GNdxSo30WRxG/r28Rokzhr+yA/zIkzoOKUX8tqAWA0WkNIiIBCWsBJ FJa7P8tupTDYPBhUAinWoomjX5ffHB6B7RDbLyKoer/Cm85YHXFcVpsVjbjYn+mvbhX5GY daax503NGIt7T4vV4zhROBvQXnkTE31VWZcATP4Db+VSy4Mg0mOc9Czz/z6DsNHg11weFt oF6FyyfLnpxVks1u8czYZ9sN0HO8ZGylHdzoywrL4wixZpTwHmK94PSnIJFCiyCHelIH6a OXHLcfPYXX3yxS1tWCDNmWmjD8gbwM2eos+2PCXWWJRfHgm3dJaIMj/45faEtw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734362079; a=rsa-sha256; cv=none; b=I8pluJg8W4IQZcY3mkhJmE5CWD5lLe6s7HP00HU/IiQxOK/UBqGk+8VhhHvikjuHKxKgUu gdM1npxO6byRuQbJ9OcJbQDnBkQCFGUEqVsR2I/g9QrxkBVUrk/fkFb5+G2z/wr1f6gdo6 2W3qSCa6N9Y5Qv17fM2xbR2gxIGuL8lljOhC0YUszXU2wHd1DtJqYSNDt8W4wIHZpX96K6 CPDPS+1BJMDKzi8a3FGpd/ASG2CxEqes9+1AgyCx+972uQWqdD0W9Qdz7ytmS3jjI3LRfu z0g8KIk5GQlgpzz5OVgboRhhXuJDILM5NjTRCjd8iT1wZwaJLKkykTK/Z1LpIQ== 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 4YBk4v6615zyDM; Mon, 16 Dec 2024 15:14:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BGFEdwA011179; Mon, 16 Dec 2024 15:14:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BGFEdGa011176; Mon, 16 Dec 2024 15:14:39 GMT (envelope-from git) Date: Mon, 16 Dec 2024 15:14:39 GMT Message-Id: <202412161514.4BGFEdGa011176@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: 897c8ff0df39 - stable/14 - nanobsd.8: Chase usage string 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: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 897c8ff0df395f45f197bbde30e282fcef3f6b37 Auto-Submitted: auto-generated The branch stable/14 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=897c8ff0df395f45f197bbde30e282fcef3f6b37 commit 897c8ff0df395f45f197bbde30e282fcef3f6b37 Author: Jose Luis Duran AuthorDate: 2024-11-10 06:50:07 +0000 Commit: Jose Luis Duran CommitDate: 2024-12-16 15:11:49 +0000 nanobsd.8: Chase usage string updates Update the manual page for NanoBSD to match its usage. Reviewed by: emaste, imp Approved by: emaste (mentor) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D47505 (cherry picked from commit f6f311d8cdacdc964967e83c8f6377d8465806d5) --- share/man/man8/nanobsd.8 | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/share/man/man8/nanobsd.8 b/share/man/man8/nanobsd.8 index 140a63b3d2f3..2ba072541ada 100644 --- a/share/man/man8/nanobsd.8 +++ b/share/man/man8/nanobsd.8 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd May 19, 2016 +.Dd November 10, 2024 .Dt NANOBSD 8 .Os .Sh NAME @@ -31,7 +31,7 @@ applications .Sh SYNOPSIS .Nm -.Op Fl bfhiKknqvwX +.Op Fl BbfhIiKknqvWwX .Op Fl c Ar config-file .Sh DESCRIPTION The @@ -47,6 +47,8 @@ installation and maintenance. .Pp The following options are available: .Bl -tag -width ".Fl c Ar config-file" -offset indent +.It Fl B +Skip the install stages (both for kernel and world). .It Fl b Skip the build stages (both for kernel and world). .It Fl c Ar config-file @@ -55,6 +57,8 @@ Specify the configuration file to use. Skip the code slice extraction. .It Fl h Display usage information. +.It Fl I +Build the disk image from an existing build/install. .It Fl i Skip the disk image build stage. .It Fl K @@ -75,13 +79,17 @@ used for each build stage (world and kernel). Make output more quiet. .It Fl v Make output more verbose. +.It Fl W +Skip the +.Cm installworld +stage of the build. .It Fl w Skip the .Cm buildworld stage of the build. .It Fl X Make -.Cm native-xtools. +.Cm native-xtools . .El .Pp The features of From nobody Mon Dec 16 15:14: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 4YBk4x3nX0z5hYZG; Mon, 16 Dec 2024 15:14: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YBk4x0KVCz460Y; Mon, 16 Dec 2024 15:14:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734362081; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0oC4XyFXxLaZ8qsaSCiVMHcsLL1Pnrudwe8wr3SC0Fc=; b=grB59ASt1K3P6FaNpeshZM5eluKW7To81kbcwDKjEIbEsWA2oORkB3u5pa8WuPEBrmsR1D /b6UEBBNOrNzdYcu5hdmym6ETgzmIqfIxqGtWoqKbCYhx6MicUft0s7JTi1NoOCQQzFvkF Kb1WfRqAfI9PYcO1nObQd4KV9wSMEdKqbGEf7/3WXLFqXal/YDl+l8xsBsqRjr29oNjScX n2WK/zKXTrBHEPwnZWjd9oaNiwvulHHshkihw4JKz5HcNlJ/Yk1lQYEL97Jx0haVygvFFx W765XEYgLO5fsOp4hoJe5nHUmPfqnL9PHsk2szi5Us62zUckcZyX9rhjmDVnlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734362081; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0oC4XyFXxLaZ8qsaSCiVMHcsLL1Pnrudwe8wr3SC0Fc=; b=GfSYNdC+0jS0Y4qSWWwhOtL+FAlhT+brkQz1XZkQB22uc/dGHv/GjZn9L9WrRhZXPKzZRv koDHV5aJnbk0l5ZaD03hUBzwx9Mgb+stdqwTmZ3i0nyd0h2CTWa7Bsd5/JJjjGqtdqk4x3 TDBuf4w/wRkfRR9U6LblMo8MTdBZC6W2xmTbybVyxO7NuSPeFWA0O+DJWBZp6wbW1SDOK4 kyDP0+SIRiuTU0dIS/CzQ/8w03401T766FektM0ukxdC+T89q3GsaOF+r/cDsHsMj6zDn+ kVO65LX7k3MaOJfLEnnmWcKm+LffL+Wu7x7pCvWvj2mJrhPf5ptc7iSAOm9kvw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734362081; a=rsa-sha256; cv=none; b=hKtQsVOPA1U3rWlSiCvyKOfhibx2XbiKDYGBHgoQQ9xUvix0FEPE4ksZ8XCGfY42G/0/Mb KMZAhBWUKe9q3lqC+Ky+V0UgiKEDMnYc4lHjrFd/x5KGV6wHYtlPCQ+hhpkhbCPSa/gWcK idznIUetMH+9G01rISi6mbE//27nnjzVu99mDJKQ4/7A2An/kx9Q9jjz33cbZU+a1zFSTQ kGCvOl6P5tRcTYtI45vgCBJIK6LM8Vr1vYNh0d+NMSa9ocvvsIStUbneVowfjU6CsMf8Lh gbYHAS/owXosrCLz27JoRiGNsTp6aNX6pCvBtTT3+02RTGZgxvH+EO/ygU4wjA== 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 4YBk4w73bZzyTq; Mon, 16 Dec 2024 15:14:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BGFEesc011225; Mon, 16 Dec 2024 15:14:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BGFEeGJ011222; Mon, 16 Dec 2024 15:14:40 GMT (envelope-from git) Date: Mon, 16 Dec 2024 15:14:40 GMT Message-Id: <202412161514.4BGFEeGJ011222@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: 4b26b3d2ac9b - stable/14 - nanobsd: Update fill_pkg.sh 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: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4b26b3d2ac9b9947c98062104691d9df420d3a2b Auto-Submitted: auto-generated The branch stable/14 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=4b26b3d2ac9b9947c98062104691d9df420d3a2b commit 4b26b3d2ac9b9947c98062104691d9df420d3a2b Author: Jose Luis Duran AuthorDate: 2024-11-12 07:33:12 +0000 Commit: Jose Luis Duran CommitDate: 2024-12-16 15:11:57 +0000 nanobsd: Update fill_pkg.sh fill_pkg.sh is a script that links a package and its dependencies from a "package dump" directory (like /usr/ports/packages/All) to a specified directory (NANO_PACKAGE_DIR), for cust_pkgng()[*]. Update the script by: - Using `make package-name` instead of `make -V pkgname` - Looking for package files with *.pkg instead of *.txz - Adding a -c option that copies the files instead of linking them[*] [*] After 9af130ae8c03 cust_pkgng() cannot be used with a directory populated by fill_pkg.sh, because it uses a nullfs mount, which doesn't follow symlinks, therefore the links inside NANO_PACKAGE_DIR will not work. PR: 269884 Reviewed by: imp Approved by: emaste (mentor) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D47531 (cherry picked from commit 4db04f5e3a9bd927ba1173bf8d3b6a70178eab5f) --- tools/tools/nanobsd/fill_pkg.sh | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/tools/tools/nanobsd/fill_pkg.sh b/tools/tools/nanobsd/fill_pkg.sh index 2869122c5fbf..6734498350a9 100644 --- a/tools/tools/nanobsd/fill_pkg.sh +++ b/tools/tools/nanobsd/fill_pkg.sh @@ -27,16 +27,16 @@ # # # Usage: -# $0 PACKAGE_DUMP NANO_PACKAGE_DIR /usr/ports/foo/bar [package.txz]... +# $0 [-cv] PACKAGE_DUMP NANO_PACKAGE_DIR /usr/ports/foo/bar [package.pkg]... # -# Will symlink the packages listed, including their runtime dependencies, +# Will symlink/copy the packages listed, including their runtime dependencies, # from the PACKAGE_DUMP to the NANO_PACKAGE_DIR. # : ${PORTSDIR:=/usr/ports} usage () { - echo "Usage: $0 [-v] package-dump-dir nano-package-dir port-dir-or-pkg ..." 1>&2 + echo "Usage: $0 [-cv] package-dump-dir nano-package-dir port-dir-or-pkg ..." 1>&2 exit 2 } @@ -53,29 +53,29 @@ ports_recurse() ( for p do if [ -d "$p" -a -f "$p/Makefile" ] ; then msg 3 "$p: full path to port" - pkgname=`cd "$p" && make -V pkgname` + pkgname=`cd "$p" && make package-name` type=port fullpath=$p elif [ -d "${PORTSDIR}/$p" -a -f "${PORTSDIR}/$p/Makefile" ] ; then msg 3 "$p: path to port relative to ${PORTSDIR}}" - pkgname=`cd "${PORTSDIR}/$p" && make -V pkgname` + pkgname=`cd "${PORTSDIR}/$p" && make package-name` type=port fullpath=${PORTSDIR}/$p - elif [ "${p%.txz}" != "$p" -a -f "$p" ] && pkg info -F "$p" > /dev/null 2>&1 ; then + elif [ "${p%.pkg}" != "$p" -a -f "$p" ] && pkg info -F "$p" > /dev/null 2>&1 ; then msg 3 "$p: full package file name" - pkgname=`basename "$p" | sed 's/\.txz$//I'` + pkgname=`basename "$p" | sed 's/\.pkg$//I'` type=pkg fullpath=$p - elif [ "${p%.txz}" != "$p" -a -f "$dumpdir/$p" ] && pkg info -F "$dumpdir/$p" > /dev/null 2>&1 ; then + elif [ "${p%.pkg}" != "$p" -a -f "$dumpdir/$p" ] && pkg info -F "$dumpdir/$p" > /dev/null 2>&1 ; then msg 3 "$p: package file name relative to $dumpdir" - pkgname=`basename "$p" | sed 's/\.txz$//I'` + pkgname=`basename "$p" | sed 's/\.pkg$//I'` type=pkg fullpath=$dumpdir/$p - elif [ -f "$dumpdir/$p.txz" ] && pkg info -F "$dumpdir/$p.txz" > /dev/null 2>&1 ; then + elif [ -f "$dumpdir/$p.pkg" ] && pkg info -F "$dumpdir/$p.pkg" > /dev/null 2>&1 ; then msg 3 "$p: package name relative to $dumpdir" pkgname=`basename "$p"` type=pkg - fullpath=$dumpdir/$p.txz + fullpath=$dumpdir/$p.pkg else echo "Missing port or package $p" 1>&2 exit 2 @@ -106,7 +106,7 @@ ports_recurse() ( fi deps=`pkg info -dF "$fullpath" | grep -v "$pkgname:"` for dep in $deps ; do - arg=`echo $dep | sed -e "s|^|$dir|" -e 's/$/.txz/'` + arg=`echo $dep | sed -e "s|^|$dir|" -e 's/$/.pkg/'` msg 2 "Check $arg as requirement for package $pkgname" ports_recurse "$outputfile" "$dumpdir" "$arg" done @@ -116,10 +116,12 @@ ports_recurse() ( done ) +COPY="ln -s" VERBOSE=0 -while getopts v opt ; do +while getopts cv opt ; do case "$opt" in + c) COPY="cp -p" ;; v) VERBOSE=$(($VERBOSE + 1)) ;; [?]) usage ;; esac @@ -155,8 +157,8 @@ for p do done for i in `cat "$PL"` ; do - if [ -f "$NANO_PKG_DUMP/$i.txz" ] ; then - ln -s "$NANO_PKG_DUMP/$i.txz" "$NANO_PKG_DIR" + if [ -f "$NANO_PKG_DUMP/$i.pkg" ] ; then + $COPY "$NANO_PKG_DUMP/$i.pkg" "$NANO_PKG_DIR" else echo "Package $i misssing in $NANO_PKG_DUMP" 1>&2 exit 1 From nobody Mon Dec 16 15:14: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 4YBk4y2wPQz5hYCn; Mon, 16 Dec 2024 15:14: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YBk4y0ywMz46N4; Mon, 16 Dec 2024 15:14:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734362082; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/B28NCga+735L1USRGyXtdnf+OH2had04hC1rEYcbsI=; b=elneFKlzhLKTSKa9/FXbxtV2Y9EHjyjkS8DJfwg+S1YneLo7oxjnAbm1R5RXvff11HQfUw stq4WTaEI0BU+eW/bbtVKXAPBVYWVruHSG/jVYbhLW6VOlIL+MR3kmygs58vWIg4vLL+ry a7wVI+SroBYFT3qbzwhV7p99CtvZDxJvmQWQSTJQH+KwBW5r7LzfhXGXrF1QfbrbdTFaNf DUhwwV3y2rsh8b2ePq22LCgrblOm/hSi2llS/vqecz6ObuabQrQa1U84ByVkCv2AYMcgg9 gxlkGwNZ1kKmIFdJGdut+372Pz5AAug9JAQt3UbYQ5uobJVDAiWsPrf5PDe1nQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734362082; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/B28NCga+735L1USRGyXtdnf+OH2had04hC1rEYcbsI=; b=PnHx3qXfl+uzw5Y1shmuFHigTh0l9xNBozTFfBaRLrTQbPG6mD7qNGFUhtKNtE2/Zyffe8 qwWBeVy4L95/813L17ywKkMruInp5obRPplrfK0N6hVEx8izjPwuHS/TerubXmycYYxx4K 7ekEp7gE5vPFpo3aTF6q1kPeZTICBf1cJnkgJkAcY8DOlNLGEyZsLojWMNPkl7mDLdQOWX OXJc4ZBbWw+Mqw2yMMV2Z9yRi0UIRBKf7mqBmfircLTDw01AalLBEpza5Y9009XghNwpY3 nU9ihuOqmFDDX1APqmsA4HTr1iy6iyYZd0A774tnQ/KecvPXGzas4NnXJcrPzQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734362082; a=rsa-sha256; cv=none; b=BA20LXkP0nkBcFQPpySmTI05bGxObt8wtaAvlzBjkCb3DE9uxPunOTSD6OBMxXxdLy5F80 36lmuY4QJforRW0IKiJYvUz4ArAU2Zaq+qjzsA1BdS6A13xj32rC9G3cyph03tRjTQkh+P NygH/opJFvA6F5PBq8YPFUHTuAkrlAjhlFgoNzpGvLK1Ke08qP8UEC18fGEEU+NAkoqPYe py1O7yWwyqeDXa/Ky2CbNBVvK4UqnvVMnzPvTUNDKVV7/HUb3JNF1BqHVlqREBk7PyUMKg G82KImkzMUp9oN4OuFpaPOMB55NPsnKIW4Akr9xQhmoWtSVyPkhjJ21q6oMbrQ== 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 4YBk4y0bD1zy4h; Mon, 16 Dec 2024 15:14:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BGFEglU011276; Mon, 16 Dec 2024 15:14:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BGFEgDm011273; Mon, 16 Dec 2024 15:14:42 GMT (envelope-from git) Date: Mon, 16 Dec 2024 15:14:42 GMT Message-Id: <202412161514.4BGFEgDm011273@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: 7594f6ce25e2 - stable/14 - nanobsd: Use the real path for NANO_PACKAGE_DIR 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: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7594f6ce25e25fe098da361d862f7db54cf4f27a Auto-Submitted: auto-generated The branch stable/14 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=7594f6ce25e25fe098da361d862f7db54cf4f27a commit 7594f6ce25e25fe098da361d862f7db54cf4f27a Author: Jose Luis Duran AuthorDate: 2024-11-12 20:17:14 +0000 Commit: Jose Luis Duran CommitDate: 2024-12-16 15:12:05 +0000 nanobsd: Use the real path for NANO_PACKAGE_DIR As users may have the Pkg directory as a symbolic link to the NanoBSD "package dump directory". In commit 9af130ae8c03, cust_pkgng() was greatly improved, however as a side effect of using a nullfs mount, the directories and files must not be symlinks. Fix it by using NANO_PACKAGE_DIR realpath(). PR: 269884 Reviewed by: imp Approved by: emaste (mentor) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D47532 (cherry picked from commit 4223c668e4b9ba71e2c6cfabbd66795729b7ff8b) --- tools/tools/nanobsd/defaults.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/tools/nanobsd/defaults.sh b/tools/tools/nanobsd/defaults.sh index e431f6653fec..119c632b328d 100755 --- a/tools/tools/nanobsd/defaults.sh +++ b/tools/tools/nanobsd/defaults.sh @@ -788,6 +788,7 @@ cust_pkgng ( ) ( fi # If the package directory doesn't exist, we're done. + NANO_PACKAGE_DIR="$(realpath $NANO_PACKAGE_DIR)" if [ ! -d ${NANO_PACKAGE_DIR} ]; then echo "DONE 0 packages" return 0 From nobody Mon Dec 16 15:14: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 4YBk4z6350z5hYMH; Mon, 16 Dec 2024 15:14: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YBk4z2jK4z46Qb; Mon, 16 Dec 2024 15:14:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734362083; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=c2YRQO7+pjTuiAxpPZaP8mNPtiF7WsVjyR9VIXewpmQ=; b=KFdfqb8pUUV5n37UZvQlgzCcPWudxfGuXQCKVNwaOMPOjIlE3nkngG8/DLFdu+IL3Y5ED7 zhAgDMW8biwR/YWrWDhWjOTSTK9pJwbC5qDFL5h8xYUSnkGuVHAuoSNNpIY68dA3ONvh5K /ojO1B6GYaSgkwicsIpulvsbybSXs/DvdTdjWIIelE+SC3/D6RDdn4ethE/nKTfPHqNdIG J7FM84xZPT4wFTpjmBFS9UNnknT+IhaIM/VcD0rRFLnC7fT4S+CcXxQI8h+e79uW2oq4Ui /ROkPFW3Awgn9hCwdC9ctfgXRpp05qg/0scnW/IrbgoM1q9I8WioYWXvobIaMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734362083; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=c2YRQO7+pjTuiAxpPZaP8mNPtiF7WsVjyR9VIXewpmQ=; b=pCrUdqfLSOxdSREdL5LqUw/jWQnnJX7iOqBGzOKSGeSqH/oSqMck7tGm5jX6fpsaU3CAT5 dfGWu+Os0NhZnAItSP1wIEjdGA7q8HUxoTdkD1SLGCRgME0IxvNQn/KVaR5H95fbxDuzua 6rKp+Zdl4n8yPh0jICSC4MOzM+RY578C+wDYO9otMR70mRzTeRT+4+nJrH82BQd2jpya+s Lx2T3PjIhGixylLDfZo1drJeVF6hdam6pRnelnJ5HMr0h20U3s7TIXsmVs3TJTbpXQ3QaJ UxV98Lk36YYtrL4dd5V5s7f9Mx7JZvOKnW9zUtUdBV8OgC4oSd7fwBA4g86nPQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734362083; a=rsa-sha256; cv=none; b=xpUjjIzScle+VC0WvPU9QBaesqQ8r4MD/52kWYuFjq5YcL3GCMAHp9NHkwsgDWqFiP8H91 CA/C8kxh4bKCpNe05w12VCI20jqsYcF312wtud8I9lM6ZGP+u1Y0Uzd99xZ7zSfulnwNox so/mSF0iVXAXRad+EHyNM0NuHFfpnGaDxtNcj+BfFGTcf4jqXedpDvCECCP+afK/0UCyfb G75zIgDIhq2b+WiCWUgDDcZILduQ/BcVp/Zxy+t6u9vYYii6rEhwCGmJy6/RKwlnvwo5Xc SS89cSbYDjH3+skOixVaHLdy0O8CFk3p6rxuU3dN+/aIl6LEM8w4TS3oaD8OXw== 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 4YBk4z1yYrzyDN; Mon, 16 Dec 2024 15:14:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BGFEhxT011323; Mon, 16 Dec 2024 15:14:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BGFEh2O011319; Mon, 16 Dec 2024 15:14:43 GMT (envelope-from git) Date: Mon, 16 Dec 2024 15:14:43 GMT Message-Id: <202412161514.4BGFEh2O011319@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: 7f50357e0d8b - stable/14 - nanobsd: Fix cust_comconsole search patterns 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: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7f50357e0d8b7cfbc937701cd9715ba8d824d26b Auto-Submitted: auto-generated The branch stable/14 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=7f50357e0d8b7cfbc937701cd9715ba8d824d26b commit 7f50357e0d8b7cfbc937701cd9715ba8d824d26b Author: Jose Luis Duran AuthorDate: 2024-11-15 04:28:01 +0000 Commit: Jose Luis Duran CommitDate: 2024-12-16 15:12:15 +0000 nanobsd: Fix cust_comconsole search patterns The current patterns are outdated, and may produce "offifexists", after e310437971b8 ("For video consoles, only launch a getty if the device exists."). Fix the expressions to: 1. Disable getty(8) on the virtual syscons(4) or vt(4) terminals (/dev/ttyv*). 2. Enable the use of the first serial port as the system console. Reviewed by: imp Approved by: emaste (mentor) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D47586 (cherry picked from commit 0f7b0db5dd07e7c48285db4cac19e15fc9a42622) --- tools/tools/nanobsd/defaults.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/tools/nanobsd/defaults.sh b/tools/tools/nanobsd/defaults.sh index 119c632b328d..587df09f0f3f 100755 --- a/tools/tools/nanobsd/defaults.sh +++ b/tools/tools/nanobsd/defaults.sh @@ -742,10 +742,10 @@ UsbDevice ( ) { cust_comconsole ( ) ( # Enable getty on console - sed -i "" -e /tty[du]0/s/off/on/ ${NANO_WORLDDIR}/etc/ttys + sed -i "" -e '/^tty[du]0/s/off/onifconsole/' ${NANO_WORLDDIR}/etc/ttys - # Disable getty on syscons devices - sed -i "" -e '/^ttyv[0-8]/s/ on/ off/' ${NANO_WORLDDIR}/etc/ttys + # Disable getty on syscons or vt devices + sed -i "" -E '/^ttyv[0-8]/s/\ton(ifexists)?/\toff/' ${NANO_WORLDDIR}/etc/ttys # Tell loader to use serial console early. echo "${NANO_BOOT2CFG}" > ${NANO_WORLDDIR}/boot.config From nobody Mon Dec 16 15:14: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 4YBk504xtHz5hYVJ; Mon, 16 Dec 2024 15:14: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YBk503HMlz46NY; Mon, 16 Dec 2024 15:14:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734362084; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JvKgObnlfgEeUNQxaZcmnz40YM6OrFDrc/ZtooIH1q8=; b=qaYBAkQTHL3xe89GekQaNvAjbuNR6OtpQVPfuuGJnZIdx0JY7zEGMdSvO7ZH14f8gH49ck DHftFUwQJ5P9As36MRTv67nppdnHHzuHjXvTXAeENqvNkog4PGk6dDrexOeMe96XXqgTok 6PLn2nzeWRE4E7WLPogcM5QEvq97pOn4bM+JJwIF0PH6p/Q9XOp553eqQObUTPIFg+V50N Q0nR69Uvl5cOmClyRbCs/5M/Wov9GwhVOWK7tsV4ZvgDoSNo0V324iYT3qHXeMHkR+yA4q QEqLOHTK8MRdY1Uk7xhLLFz5IoApfsXCn75qHv2qs6N+XSsfh/6zj+zAmqxMFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734362084; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JvKgObnlfgEeUNQxaZcmnz40YM6OrFDrc/ZtooIH1q8=; b=vVpqVifJdZG0DaiY/i9Uz1voX7P+XJ4FQhY6TF+4C26OBW/0M7zawddr0azm1vcZqisLNe fwPQ+gzOH1ObEQjqOHOyLklFsZm4E5h8Hf8pkB5o9haLxxU4sn31euUvTusbJtvtk8Iah3 fzQ0r99E3pA5bg+Wv3lBdnuNNxufZBYoTuYMh/hoxr+j/f1vDP9VIZMOT4YA9BYSmXQPaT bVIkVOex1QlHtTtv3RI0pjKRLvtGw6f2lT9B/xCGE2wckvF8uQnZj01yxobWKFQ0/ETL45 irdYHlSNfBbaGW09kHWTeVs132J2TmPfSythVBwmeLBeV0QqF2fokNLlgKmKTw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734362084; a=rsa-sha256; cv=none; b=yQhScau8xajh63K/d8fOSzV/yq/oCIRxdVfuSvL36OthxW+cHDVnAvDBx1ypjhDdk3JdXZ 8aBbwHCw9xA0gzuYexTYy8zbM2Fr78VkuaNSt3yTMboPibIVZqlPWKfBPVTB0q65JzGdPv XaYFZqUixDpddLMCiO/GvUSf3MTby5hAAyPAHuJlkyNgI8fV0GebBZmcfbMx/R2C2APg65 0O0dHyll//aZ9hrgTsuMuNYz3FahdxmHvOi/tlK8qexZyJM8K2DaowTymHgtqBp90aG+2R 2cJc7zwsQV+VvXRwEXJflYPJL3Upls2jn7pCm8SumsWBepME22C4VNNSPlRSwQ== 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 4YBk502vtBzy4j; Mon, 16 Dec 2024 15:14:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BGFEiTF011366; Mon, 16 Dec 2024 15:14:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BGFEirM011363; Mon, 16 Dec 2024 15:14:44 GMT (envelope-from git) Date: Mon, 16 Dec 2024 15:14:44 GMT Message-Id: <202412161514.4BGFEirM011363@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: 8e8ccdf02e14 - stable/14 - nanobsd: Fix typos 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: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8e8ccdf02e140e06b9012fa21e14d4df058629e9 Auto-Submitted: auto-generated The branch stable/14 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=8e8ccdf02e140e06b9012fa21e14d4df058629e9 commit 8e8ccdf02e140e06b9012fa21e14d4df058629e9 Author: Jose Luis Duran AuthorDate: 2024-11-15 04:54:09 +0000 Commit: Jose Luis Duran CommitDate: 2024-12-16 15:12:23 +0000 nanobsd: Fix typos Fix a number of typos in the code or comments. Files under dhcpd, embedded, pcengines, and rescue were intentionally omitted. These directories will be reviewed at a later date. PR: 269884 Reviewed by: imp, zlei Approved by: emaste (mentor) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D47587 (cherry picked from commit 12cbad923dbcccb3d6f71a77ad3241508f186048) --- tools/tools/nanobsd/Files/root/save_cfg | 2 +- tools/tools/nanobsd/defaults.sh | 10 +++++----- tools/tools/nanobsd/fill_pkg.sh | 2 +- tools/tools/nanobsd/mtree-dedup.awk | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tools/tools/nanobsd/Files/root/save_cfg b/tools/tools/nanobsd/Files/root/save_cfg index 1931e5c79923..24f812197a68 100644 --- a/tools/tools/nanobsd/Files/root/save_cfg +++ b/tools/tools/nanobsd/Files/root/save_cfg @@ -62,7 +62,7 @@ do # Add to cfg (y/n/i)? # y) -> save this file in /cfg # n) -> do not save this file in /cfg for current script invocation ONLY - # i) -> add file to ignore list (/cfg/.ignore hiereachy) and never save + # i) -> add file to ignore list (/cfg/.ignore hierarchy) and never save # try to add this file to /cfg. # # touch is used to add files to /cfg to keep the script flow straight and easy diff --git a/tools/tools/nanobsd/defaults.sh b/tools/tools/nanobsd/defaults.sh index 587df09f0f3f..df9e7dc1ee48 100755 --- a/tools/tools/nanobsd/defaults.sh +++ b/tools/tools/nanobsd/defaults.sh @@ -497,10 +497,10 @@ run_late_customize ( ) ( # a user's cfg file would override this. # fixup_before_diskimage ( ) ( - # Run the deduplication script that takes the matalog journal and + # Run the deduplication script that takes the metalog journal and # combines multiple entries for the same file (see source for # details). We take the extra step of removing the size keywords. This - # script, and many of the user scripts, copies, appeneds and otherwise + # script, and many of the user scripts, copies, appends and otherwise # modifies files in the build, changing their sizes. These actions are # impossible to trap, so go ahead remove the size= keyword. For this # narrow use, it doesn't buy us any protection and just gets in the way. @@ -814,7 +814,7 @@ cust_pkgng ( ) ( CR "${PKGCMD} add /_.p/${_NANO_PKG_PACKAGE}" ( - # Expand any glob characters in pacakge list + # Expand any glob characters in package list cd "${NANO_PACKAGE_DIR}" _PKGS=`find ${NANO_PACKAGE_LIST} -not -name "${_NANO_PKG_PACKAGE}" -print | sort | uniq` @@ -905,7 +905,7 @@ usage ( ) { # Setup and Export Internal variables # -export_var ( ) { # Don't wawnt a subshell +export_var ( ) { # Don't want a subshell var=$1 # Lookup value of the variable. eval val=\$$var @@ -914,7 +914,7 @@ export_var ( ) { # Don't wawnt a subshell } # Call this function to set defaults _after_ parsing options. -# dont want a subshell otherwise variable setting is thrown away. +# don't want a subshell otherwise variable setting is thrown away. set_defaults_and_export ( ) { : ${NANO_OBJ:=/usr/obj/nanobsd.${NANO_NAME}${NANO_LAYOUT:+.${NANO_LAYOUT}}} : ${MAKEOBJDIRPREFIX:=${NANO_OBJ}} diff --git a/tools/tools/nanobsd/fill_pkg.sh b/tools/tools/nanobsd/fill_pkg.sh index 6734498350a9..17d163709f91 100644 --- a/tools/tools/nanobsd/fill_pkg.sh +++ b/tools/tools/nanobsd/fill_pkg.sh @@ -160,7 +160,7 @@ for i in `cat "$PL"` ; do if [ -f "$NANO_PKG_DUMP/$i.pkg" ] ; then $COPY "$NANO_PKG_DUMP/$i.pkg" "$NANO_PKG_DIR" else - echo "Package $i misssing in $NANO_PKG_DUMP" 1>&2 + echo "Package $i missing in $NANO_PKG_DUMP" 1>&2 exit 1 fi done diff --git a/tools/tools/nanobsd/mtree-dedup.awk b/tools/tools/nanobsd/mtree-dedup.awk index e30f3100b4da..8840047f5318 100755 --- a/tools/tools/nanobsd/mtree-dedup.awk +++ b/tools/tools/nanobsd/mtree-dedup.awk @@ -84,7 +84,7 @@ function mtree_from_kvs(path, kvs) return lv; } -# Parse the mtree line into path + KVs. Use a sentinal value +# Parse the mtree line into path + KVs. Use a sentinel value # for a bare keyword, which is extremely unlikely to be used # for real. function line2kv(kvs, str) From nobody Mon Dec 16 15:15: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 4YBk5g0Sngz5hYMm; Mon, 16 Dec 2024 15:15: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YBk5f6L81z488W; Mon, 16 Dec 2024 15:15:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734362118; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0oZ67saPM6AXMf5ve0kCXz5vsIT2+2BAt5u0NgAxiQU=; b=iwi66TeiBaBYiLI0MHApguKJQO7dEzN22LSSpN/1yG3sYNr5alwt+ZtzAtbQDSj4pUJsr9 6jqsZP7H9xK4ZWd+ZNqeoxWVg9qBjaGp8PRf/bv1q4diPq3jx+9klcb7VeIX+Gd6QSMiSO nlYVCcNsLJy3SsvmqQ8k688ioRgjhY3aWGQWZHd/Ntz7EZlKlEW5Swq1wu5ro+SPNMcT4z EMsI7LzdCtSAmt0e8TG8aJl+p1FFEeauf3MTvSRLq/A5EkkIKG8koGnu1xjAXs4fmRkGDh sLCwOBspTjKqVyG1qE6ExczS3DTBtsiRDJS8NNWxgnX6ueUN5DsZBezaZJMPNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734362118; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0oZ67saPM6AXMf5ve0kCXz5vsIT2+2BAt5u0NgAxiQU=; b=kz0tNMXuSuvJR8tAR4PlS2TVpHXpDfoA/Sk1QomvfBO+AT+vcxGmT7LJFKuedh07wuWlya yZAAS/J9yIj+JaKqLL2STMtE56kYFK0fW/n8RY3ju1N1yPMR57vYJD85o70MWod1rSTS3A DKCPupGrtxrTMPpBJTy7zEq17rAkKjy8fBOYrbYDlJWMj2oqAJMBHkNexv0AOqPOCIp93O q9Ntk/zUm2I+hX/wb8mBT+jbd30LKxGVFpvSL5VdRA6ykh9bEBUhKJYOacSFGYxuygC2z1 1RlD9Sjh7Y1Jf23FgbrVzgmyErQT4vIYhgf4wYqyPIt8J9GwrAwDgF6twnkNjw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734362118; a=rsa-sha256; cv=none; b=CgTkI047eSrwF5IVZjMy8ftj0Vl47A7MfE5ZqqHA4GeKa+lQTzKQav05HfWJNpMmokYdUD fgKNZdOU1StTXzAGnvMJqI4Jh6nQEGdzirrvn8nok77qccAuI6Njt9NJ3JfY4LeXoIEPS+ 0hsmG7VSfBV+lUlzSV+t7hemONADSXXVMjBtOqPwcbPiKeGWY3ge1aY8LoDZMVX5F1Ndbo SIq5pQeZLPwfV7W1n2BdaghXRM0EPpv9RRalD34jUlD5V2ORUr+CjTYEejNdtUQxPoATXF lFjhI9ruusGCQwouv6VASoTLU2Suur3BlQOhF9Pe5ycMD2Hxpfe0fVWossWoNw== 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 4YBk5f5msmzyDR; Mon, 16 Dec 2024 15:15:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BGFFIvh011800; Mon, 16 Dec 2024 15:15:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BGFFIFA011797; Mon, 16 Dec 2024 15:15:18 GMT (envelope-from git) Date: Mon, 16 Dec 2024 15:15:18 GMT Message-Id: <202412161515.4BGFFIFA011797@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: e6850fef72de - stable/13 - nanobsd: Add missing options to usage() 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: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e6850fef72deb8f24ca27380565fc519c7ac2147 Auto-Submitted: auto-generated The branch stable/13 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=e6850fef72deb8f24ca27380565fc519c7ac2147 commit e6850fef72deb8f24ca27380565fc519c7ac2147 Author: Jose Luis Duran AuthorDate: 2024-11-07 14:16:50 +0000 Commit: Jose Luis Duran CommitDate: 2024-12-16 15:13:05 +0000 nanobsd: Add missing options to usage() -B suppress installs (both kernel and world) -I build disk image from existing build/install -W suppress installworld PR: 277269 Reviewed by: imp, emaste Approved by: emaste (mentor) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D47475 (cherry picked from commit 999f288a0eeb230d3655da94c1186ca03c0cc404) --- tools/tools/nanobsd/defaults.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/tools/nanobsd/defaults.sh b/tools/tools/nanobsd/defaults.sh index 028f3e7773be..065788133ff5 100755 --- a/tools/tools/nanobsd/defaults.sh +++ b/tools/tools/nanobsd/defaults.sh @@ -852,17 +852,20 @@ pprint ( ) ( usage ( ) { ( - echo "Usage: $0 [-bfhiKknqvwX] [-c config_file]" + echo "Usage: $0 [-BbfhIiKknqvWwX] [-c config_file]" + echo " -B suppress installs (both kernel and world)" echo " -b suppress builds (both kernel and world)" echo " -c specify config file" echo " -f suppress code slice extraction (implies -i)" echo " -h print this help summary page" + echo " -I build disk image from existing build/install" echo " -i suppress disk image build" echo " -K suppress installkernel" echo " -k suppress buildkernel" echo " -n add -DNO_CLEAN to buildworld, buildkernel, etc" echo " -q make output more quiet" echo " -v make output more verbose" + echo " -W suppress installworld" echo " -w suppress buildworld" echo " -X make native-xtools" ) 1>&2 From nobody Mon Dec 16 15:15: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 4YBk5h251Zz5hYVq; Mon, 16 Dec 2024 15:15: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YBk5h0NzJz48N1; Mon, 16 Dec 2024 15:15:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734362120; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=S0+inPWOKugj+6vkJgJNQr7u2h3BIJGZuhns0VMz93g=; b=FSGqShaQwTvXsO1rLffAz8I4ZZif6QJsNWRupZTdzKkKVsrB9mFhAmeMuCet6v7Wm5u26t ouJ/G9tayYFJ3fUrjGjWRa8W0u9On8IAZOfaNsdtjwaDqWVIMSqdsagWTU79Ibo9bECZuZ wKsa3YyIqTq1jSsqyRS+k5/UiQqBO5LOl7xjf3XA/qHMWlV4uzaw90cxHIzVa8HOwgWGyq +y0GzZ4CunNX9nAar1xSOsApeaDVWSSaOU20bl9qYMyM/5lSHwJNcoOparzYz0faJRHItO X94IbHsypfO3B7P8zcEIgvw+7wSQf8SJHu0veI1BRWHyOoo9WhehO7EM6PBCgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734362120; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=S0+inPWOKugj+6vkJgJNQr7u2h3BIJGZuhns0VMz93g=; b=qPRX8HEsozlibCHjDSB5gmU3FqVHPaSSTUmqVaCaxolTSBar5b0FYz7hRMd7NCKkXMUqjX OCqr7q8cvCwS5QkEo8K37xpSbHEtxSvEy/3LfDXHBLP35UwDXW/2a+dgTxSZZNvsvIIaE4 +qhqCyKR6Ifl1ZqkwEnZjrVGNteOMCsLt7teTqJS6zaHa4S20ER9u1eY0rnn4rdst5qgSd FkQGQsfUvbKgcLeiovIXzDED0DrOiTl+UUD1Vi+jNlm+/4HdVw/yP9MJXDBfKyf4F4XQ0i XmdJQL5z7J0DFokz20XdKtsDyVczJjjm8+W0PuPCu+q+y8nXvNIYFoAHFVz+gA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734362120; a=rsa-sha256; cv=none; b=l8KXl7RalCQodOvWz+r3/WDNKU4RgTf+VBvnXlI1Xd7PYRrFoxdb3xzuCVf4k0RQJAF5L0 GkcX0untscRLHXHGFQH6fOkK4DEaeXnjqnnb81Vvsr8x3OQHOGqWkmZVqOLDPacoW7EsLH 43+szjYQH0+yl8UmuVL1blygIsdWg8q1Kl3jstNXvtFcdkviTHi+ckBmLl91YPhGCjKKjV d65xzTDGervo/RPlPAH/wedZNMqJ9wB06YhFQtTKJ4xhr7pT6ptMsXH/QtwK4l4+9bVBXf PZBwHQf/hm5pIGPMnA3uRR/tInTXNEGKvytcjXic6/3Noe8z1dkT6vwao6WOZg== 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 4YBk5h00myzyZT; Mon, 16 Dec 2024 15:15:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BGFFJP6011862; Mon, 16 Dec 2024 15:15:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BGFFJaB011859; Mon, 16 Dec 2024 15:15:19 GMT (envelope-from git) Date: Mon, 16 Dec 2024 15:15:19 GMT Message-Id: <202412161515.4BGFFJaB011859@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: 16fc83629869 - stable/13 - nanobsd: Fix parallel make 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: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 16fc8362986908ed125f4f451fdbf3a37e30b3de Auto-Submitted: auto-generated The branch stable/13 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=16fc8362986908ed125f4f451fdbf3a37e30b3de commit 16fc8362986908ed125f4f451fdbf3a37e30b3de Author: Jose Luis Duran AuthorDate: 2024-11-07 14:32:01 +0000 Commit: Jose Luis Duran CommitDate: 2024-12-16 15:13:12 +0000 nanobsd: Fix parallel make The NANO_NCPU (number of CPUs) value gets ignored by the build script when setting the NANO_PMAKE (parallel make) value. Fix it by setting the NANO_PMAKE later in the process. PR: 277269 Reviewed by: imp, emaste Approved by: emaste (mentor) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D47476 (cherry picked from commit 3c5d19a40de7273bb478163639dd8532af425595) --- tools/tools/nanobsd/defaults.sh | 5 ++++- tools/tools/nanobsd/nanobsd.sh | 4 ---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/tools/tools/nanobsd/defaults.sh b/tools/tools/nanobsd/defaults.sh index 065788133ff5..d5d357d9ad19 100755 --- a/tools/tools/nanobsd/defaults.sh +++ b/tools/tools/nanobsd/defaults.sh @@ -67,7 +67,6 @@ NANO_PKG_META_BASE=/var/db # Make & parallel Make NANO_MAKE="make" NANO_NCPU=$(sysctl -n hw.ncpu) -NANO_PMAKE="make -j $NANO_NCPU" # The default name for any image we create. NANO_IMGNAME="_.disk.full" @@ -892,6 +891,10 @@ set_defaults_and_export ( ) { : ${NANO_DISKIMGDIR:=${NANO_OBJ}} : ${NANO_WORLDDIR:=${NANO_OBJ}/_.w} : ${NANO_LOG:=${NANO_OBJ}} + : ${NANO_PMAKE:="${NANO_MAKE} -j ${NANO_NCPU}"} + if ! $do_clean; then + NANO_PMAKE="${NANO_PMAKE} -DNO_CLEAN" + fi NANO_MAKE_CONF_BUILD=${MAKEOBJDIRPREFIX}/make.conf.build NANO_MAKE_CONF_INSTALL=${NANO_OBJ}/make.conf.install diff --git a/tools/tools/nanobsd/nanobsd.sh b/tools/tools/nanobsd/nanobsd.sh index af03d89acece..4c390d8ca371 100755 --- a/tools/tools/nanobsd/nanobsd.sh +++ b/tools/tools/nanobsd/nanobsd.sh @@ -156,10 +156,6 @@ if [ ! -d "${NANO_TOOLS}" ]; then exit 1 fi -if ! $do_clean; then - NANO_PMAKE="${NANO_PMAKE} -DNO_CLEAN" -fi - pprint 1 "NanoBSD image ${NANO_NAME} build starting" run_early_customize From nobody Mon Dec 16 15:15:21 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 4YBk5j3S3yz5hYRK; Mon, 16 Dec 2024 15:15: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YBk5j1Lrbz48N3; Mon, 16 Dec 2024 15:15:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734362121; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WjR0sniwCdaEBo4jeLyce2uKLOS5es1g2RtBgb9hH54=; b=m0We14R7pAUioYkc7Dgs3jIOGcQBR7zR6L8yGubS3rns4dusZS+3LYxG5Fn9D7trujV5Tg 40jo7mf+QXx5i6g4JjKBmXcZ8H08TnPHn6seDo/mZ07kbkqM67QzMHnJMMfDYZz/sCRplE tMGic56bmPpipIhSvhVcpPQBBdsNANXZrBrCZt/uHPR9EobBFf+xOSskr65zXPxKB2b6wL pvSwcpA8WJOH4haODv5dYPxRzVZ5xL0LG+Df3dMa6nK8gG8yFPBchBpUrdOAbZioUk+Ui0 5IPiqWdXuylvlnDMiKpVbFlpi7uIKFS7h5ywFru9a21YRDlggWeSbrbDIkAhEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734362121; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WjR0sniwCdaEBo4jeLyce2uKLOS5es1g2RtBgb9hH54=; b=g0AB9Md5v77Lu6h8m5xelUCVzS9kz/9nCgwmRM1RdskCRc/nTcY4yF16kKF1VD5KjqFtoy YUEFZ1u2t59QXVNVt4TBhMRwVqfG/UlmubuYkeHF+MZyEsDGI2m8GX3g8pKjgZAX0TRBum eHevffb9dyoWyMHhT0kUlfj3Iqs8VA/15Ef20QNsp9FfRP6EasFHbEcSRTz0Y1vk9sEQEZ rpavKWqBdJxeuq0cek6feaCVtwXR7ljDp0hfR4ba+y6TbRCICV1fY+8rBfVY05pIoHjcdb XMH8FTMhXOAUO7MPAW8qEGwvYnAQn3SYSAPMXIyLRA2DdWsvQNXhnzB2aFP3sA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734362121; a=rsa-sha256; cv=none; b=lVt3sjPQVDVFxGFYITqaOnOYn11VdQ53gqjogmX4JALyy5gZeATTuvGYdnf9yIoUtYRTOD kyVayuFARrm2oTyqSxC60jb1Q0PQaZYnsppGOGzoMCyyBCteTW0rsTEkoeVEYsqDgGoVd2 O5koOSDrhtx8IqS8o9mGdHoOHs2c/pdcWXIVkEDC0sUQi6zIUBK4MA9EAf7mg960lZaeKd ElxOGy6u8howydBSymAX8I8YUn1OOzdTeWsubDS4DHRCePRxOGyjRu2IGE0pUgAG56YjHD spDK6MZr96E7Pi6bR+aGhp7obYhY0B5nanbrYFaa4ueYZhTqefrw2namP+VpDQ== 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 4YBk5j0yXmzyJf; Mon, 16 Dec 2024 15:15:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BGFFL2c011910; Mon, 16 Dec 2024 15:15:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BGFFLr9011907; Mon, 16 Dec 2024 15:15:21 GMT (envelope-from git) Date: Mon, 16 Dec 2024 15:15:21 GMT Message-Id: <202412161515.4BGFFLr9011907@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: a641dd41fcaf - stable/13 - nanobsd: Avoid read-only file system warnings 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: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a641dd41fcafade204d6b8dabcf235c32eacc70b Auto-Submitted: auto-generated The branch stable/13 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=a641dd41fcafade204d6b8dabcf235c32eacc70b commit a641dd41fcafade204d6b8dabcf235c32eacc70b Author: Jose Luis Duran AuthorDate: 2024-11-08 18:13:48 +0000 Commit: Jose Luis Duran CommitDate: 2024-12-16 15:13:19 +0000 nanobsd: Avoid read-only file system warnings The default setting of some loader or rc variables generate warnings because the file system is read-only: Set the following options to avoid printing these warnings: /boot/defaults/loader.conf: - hostuuid_load="NO" to disable loading /etc/hostid early at boot time - entropy_cache_load="NO" to disable loading cached entropy at boot time - kern.random.initial_seeding.disable_bypass_warnings="1" to disable logging a warning if the 'bypass_before_seeding' knob is enabled (enabled by default) and a request is submitted prior to initial seeding /etc/defaults/rc.conf: - kldxref_enable="NO" to disable building linker.hints files with kldxref(8) - entropy_boot_file="NO" to disable very early (used at early boot-time) entropy caching through reboots - entropy_dir="NO" to disable caching entropy via cron While here, move rc.conf options before sourcing vendor.conf, so they can be overridden. PR: 277601 Reviewed by: imp Approved by: emaste (mentor) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D47502 (cherry picked from commit e5579f98c02ff64b0c305f6731c3557ba69c2d25) --- tools/tools/nanobsd/defaults.sh | 41 +++++++++++++++++++++++++++++++++++------ 1 file changed, 35 insertions(+), 6 deletions(-) diff --git a/tools/tools/nanobsd/defaults.sh b/tools/tools/nanobsd/defaults.sh index d5d357d9ad19..bb1e96b911e5 100755 --- a/tools/tools/nanobsd/defaults.sh +++ b/tools/tools/nanobsd/defaults.sh @@ -570,13 +570,42 @@ setup_nanobsd_etc ( ) ( # create diskless marker file touch etc/diskless - [ -n "${NANO_NOPRIV_BUILD}" ] && chmod 666 etc/defaults/rc.conf - - # Make root filesystem R/O by default - echo "root_rw_mount=NO" >> etc/defaults/rc.conf - # Disable entropy file, since / is read-only /var/db/entropy should be enough? - echo "entropy_file=NO" >> etc/defaults/rc.conf + [ -n "${NANO_NOPRIV_BUILD}" ] && chmod 666 boot/defaults/loader.conf + { + echo + echo '### NanoBSD configuration ##################################' + echo 'hostuuid_load="NO"' + echo 'entropy_cache_load="NO" # Disable loading cached entropy at boot time.' + echo 'kern.random.initial_seeding.disable_bypass_warnings="1" # Do not log a warning' + echo " # if the 'bypass_before_seeding' knob is enabled" + echo " # and a request is submitted prior to initial" + echo " # seeding." + } >> boot/defaults/loader.conf + [ -n "${NANO_NOPRIV_BUILD}" ] && chmod 444 boot/defaults/loader.conf + [ -n "${NANO_NOPRIV_BUILD}" ] && chmod 666 etc/defaults/rc.conf + if ! ed -s etc/defaults/rc.conf <<\EOF +/^### Define source_rc_confs, the mechanism used by \/etc\/rc\.\* ##$/i +### NanoBSD options ######################################## +############################################################## + +kldxref_enable="NO" # Disable building linker.hints files with kldxref(8). +root_rw_mount="NO" # Inhibit remounting root read-write. +entropy_boot_file="NO" # Disable very early (used at early boot time) + # entropy caching through reboots. +entropy_file="NO" # Disable late (used when going multi-user) + # entropy through reboots. +entropy_dir="NO" # Disable caching entropy via cron. + +############################################################## +. +w +q +EOF + then + echo "Regular expression pattern not found" + exit 2 + fi [ -n "${NANO_NOPRIV_BUILD}" ] && chmod 444 etc/defaults/rc.conf # save config file for scripts From nobody Mon Dec 16 15:15: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 4YBk5k33htz5hYMq; Mon, 16 Dec 2024 15:15: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YBk5k27m4z47yf; Mon, 16 Dec 2024 15:15:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734362122; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=M/PV48EFnp5nH/r1+sLdCVOhL/mPrqFGXihE+ZcZETc=; b=ZXySduTL/K1WapSTGR1sANoZa1LbxK1ZxTtW9PXlkUX7WJp2tB6kcViomnZPe0fdWntZ0Y U2ZRXVtbh1lsoCzL0v7iYG/j/vLBZHLWv1sua52sX9nmTFjxdQ8TkDP6WkMPA5boAQ6jqp jrCF9YsLxbJrVsEuWbLW/RcV2dKA3FDxAce5scRHq/rO8yrB0m/C5ZjYE2d7GfNBgW8QmO +6Geo2ED9sQbAlwuZxpqvz8Zeg9R/kpUvKQG5ehs+yU/U9OD1R5CgmgwaNl99MXdruxcYD HkUnnI9LnUnY9+lsPWSuDToLohm04vEJyyGUyyKjcDAexX8/eFwvKDNYsUAHNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734362122; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=M/PV48EFnp5nH/r1+sLdCVOhL/mPrqFGXihE+ZcZETc=; b=wzY+HUa1V5BOKC3WFF2Dano1fsB+HpOu3sWaBQpfg3xYAd6mCIjaqo6o183l3ktIQ/LO9t jwJSN+XYmpECZXp+x4ksEGngtoAJbqBnsMj32bbFldXx+yTGHrNlJNcR4s720ztEqbyX6R 8q9QWY4fkVjuBo2PbPE9IMHD68FlIhIKfB4hyuKa771xcqVU1SdkTcbpjkeaNtHnuRcGVZ lHhtJdNBY+eOJl/m3Dn13YnfjPx36k1ZO/g5SqBu2YXnoNPm4iMv6nPXh6UQBYrZXIP4a/ 30TLpnQt78ZABT1I+dSNr6di1mPZ0KObmQ9yNf4D8+AJBCuUGWx9nC2WvfRctA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734362122; a=rsa-sha256; cv=none; b=iWfgNhPvyl2Ahy/yd8gLEy9y5NFv99IJ4KzSHPlfJjBcTWs0xgiHbgO/oPyT7m0zAy/MIh 8xd8MItFGzFtE5QMi6vAkFTLgWcdUF/I4qWwS2TFq1SGle1F/2UUjLbnjMjBBUOlIsnVUp MJsv1wE3gbyMXbusT8Nj2uvyDIdvZEbSAmRQxTJweMWUQHt5lo96MuhN2pcc59l0WZKlno YyQv4K3GSw6agSEY312n1H+LbPQOVLTnVGxtsT2ZagdsH2CPh23ho3bvne+Ut4uf0SJ6Fy gzKfGKf3vt/49icvvUtPWrui/JoyL5EiSL5FOnTPUkqFKXWfnBexi3on1N1ZIg== 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 4YBk5k1lFhzyJg; Mon, 16 Dec 2024 15:15:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BGFFMmw011955; Mon, 16 Dec 2024 15:15:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BGFFMDF011952; Mon, 16 Dec 2024 15:15:22 GMT (envelope-from git) Date: Mon, 16 Dec 2024 15:15:22 GMT Message-Id: <202412161515.4BGFFMDF011952@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: fb6f7d93218f - stable/13 - nanobsd.8: Chase usage string 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: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: fb6f7d93218f29786e9552fd48d95526e78757c2 Auto-Submitted: auto-generated The branch stable/13 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=fb6f7d93218f29786e9552fd48d95526e78757c2 commit fb6f7d93218f29786e9552fd48d95526e78757c2 Author: Jose Luis Duran AuthorDate: 2024-11-10 06:50:07 +0000 Commit: Jose Luis Duran CommitDate: 2024-12-16 15:13:29 +0000 nanobsd.8: Chase usage string updates Update the manual page for NanoBSD to match its usage. Reviewed by: emaste, imp Approved by: emaste (mentor) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D47505 (cherry picked from commit f6f311d8cdacdc964967e83c8f6377d8465806d5) --- share/man/man8/nanobsd.8 | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/share/man/man8/nanobsd.8 b/share/man/man8/nanobsd.8 index 140a63b3d2f3..2ba072541ada 100644 --- a/share/man/man8/nanobsd.8 +++ b/share/man/man8/nanobsd.8 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd May 19, 2016 +.Dd November 10, 2024 .Dt NANOBSD 8 .Os .Sh NAME @@ -31,7 +31,7 @@ applications .Sh SYNOPSIS .Nm -.Op Fl bfhiKknqvwX +.Op Fl BbfhIiKknqvWwX .Op Fl c Ar config-file .Sh DESCRIPTION The @@ -47,6 +47,8 @@ installation and maintenance. .Pp The following options are available: .Bl -tag -width ".Fl c Ar config-file" -offset indent +.It Fl B +Skip the install stages (both for kernel and world). .It Fl b Skip the build stages (both for kernel and world). .It Fl c Ar config-file @@ -55,6 +57,8 @@ Specify the configuration file to use. Skip the code slice extraction. .It Fl h Display usage information. +.It Fl I +Build the disk image from an existing build/install. .It Fl i Skip the disk image build stage. .It Fl K @@ -75,13 +79,17 @@ used for each build stage (world and kernel). Make output more quiet. .It Fl v Make output more verbose. +.It Fl W +Skip the +.Cm installworld +stage of the build. .It Fl w Skip the .Cm buildworld stage of the build. .It Fl X Make -.Cm native-xtools. +.Cm native-xtools . .El .Pp The features of From nobody Mon Dec 16 15:15: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 4YBk5l4J7fz5hYRN; Mon, 16 Dec 2024 15:15: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YBk5l3Ly1z48Nt; Mon, 16 Dec 2024 15:15:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734362123; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BWeacFmBoY5Mgj2nZU3G1K/Fis+XrnbPTkxK+BFhsms=; b=pnkI/0N5rwywoNB7SXpZXOoVWMhpHxsqptfqyX76ShnQhZqAEvOV6T9yTF5/mctbv/L4Qc V2fr1IyUt+ADYe9uPfrgx2bS9nFk58s/KEqXny3nz/5XNCY3cM9ZsTOcyR2QjRL5LBUlzn eS8b+gghG4zRQgGXzdkOAhZ4FNOMrRcOLjP6xhvVLm39vK7L0pgmnsRjAOs8IUrPUL1qQT qReHPZIkejUKxWHYnhJzq3gjD9qlIWP8oePWpJUK2ofGbcOUAGoSCCCCo1eJo47gnyra2V r+nRd6a3lBK8QYvsCQ6xbh2nplvDh2bC1jAcoZBUKHUEEYhIwUFJTEqwpjQdZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734362123; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BWeacFmBoY5Mgj2nZU3G1K/Fis+XrnbPTkxK+BFhsms=; b=J4P3cENgUp2EBvGGjcCer6yPcBmSCKD8fIju1JmFgw04sR5hmCFrcFzJvrqZjbDy0PrRbR GrXHr7B6UxeEc7fprqdefbjsXfApWB4P1o04gKb+FmSzxBBi6bboX0t3ECq+5/OrfhADku R9ocEeyLXNR7A2iIOdU0DcGgVBqEpm6vYCunDa4hE3UrjZiLfenWbQFBLMMSVDuB2lg0nA AmaY1MUEzDEEWL5GSl4Jp7e+kTn00YgCJ8OqHnCGyis2qekQ6Oj3Tqxdf9Zd7EtS7DtKVc SaEDKP6dfKm2iDCiZFRQwkCTGRp6g6uZ784RudIwmMZoZjOCrrw+uAIO2ICq9A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734362123; a=rsa-sha256; cv=none; b=k8dmnvMGScK/Vn7YPcvbxSvHnOtSh5vUFXA5kP4MCdjGGSEEhzn2zIuLmWzFuSWfmhY1BT bbbZFCr+hGp1EdfMu/g38dFDRDkUP/Dg9Frmc8xmods+leVRBBcsGf80HZ7jkio0QQeNjL ZDryIF0C0UYrcJ1vNGIGpmL/sNcGodUWBjBJMYy21JuL/dXzhxxI76UuqdgBzqz2mI4LbO vp/Ks6W0FLC75SfkpUHoCcyKGflqWDAkqkG7Ly0uAtZluGyNTulT1mWl57uJR6NWE3lBlF rUENuH/tp3ov5fBGGOW0g66ENOWYfYD7baoCzqgi511judDaiKPLV6LtsU6xyw== 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 4YBk5l2zH3zym7; Mon, 16 Dec 2024 15:15:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BGFFN1h011996; Mon, 16 Dec 2024 15:15:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BGFFNdM011993; Mon, 16 Dec 2024 15:15:23 GMT (envelope-from git) Date: Mon, 16 Dec 2024 15:15:23 GMT Message-Id: <202412161515.4BGFFNdM011993@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: f5613e2d4952 - stable/13 - nanobsd: Update fill_pkg.sh 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: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f5613e2d49523cb304638fcc322970128958f16f Auto-Submitted: auto-generated The branch stable/13 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=f5613e2d49523cb304638fcc322970128958f16f commit f5613e2d49523cb304638fcc322970128958f16f Author: Jose Luis Duran AuthorDate: 2024-11-12 07:33:12 +0000 Commit: Jose Luis Duran CommitDate: 2024-12-16 15:13:37 +0000 nanobsd: Update fill_pkg.sh fill_pkg.sh is a script that links a package and its dependencies from a "package dump" directory (like /usr/ports/packages/All) to a specified directory (NANO_PACKAGE_DIR), for cust_pkgng()[*]. Update the script by: - Using `make package-name` instead of `make -V pkgname` - Looking for package files with *.pkg instead of *.txz - Adding a -c option that copies the files instead of linking them[*] [*] After 9af130ae8c03 cust_pkgng() cannot be used with a directory populated by fill_pkg.sh, because it uses a nullfs mount, which doesn't follow symlinks, therefore the links inside NANO_PACKAGE_DIR will not work. PR: 269884 Reviewed by: imp Approved by: emaste (mentor) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D47531 (cherry picked from commit 4db04f5e3a9bd927ba1173bf8d3b6a70178eab5f) --- tools/tools/nanobsd/fill_pkg.sh | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/tools/tools/nanobsd/fill_pkg.sh b/tools/tools/nanobsd/fill_pkg.sh index 2869122c5fbf..6734498350a9 100644 --- a/tools/tools/nanobsd/fill_pkg.sh +++ b/tools/tools/nanobsd/fill_pkg.sh @@ -27,16 +27,16 @@ # # # Usage: -# $0 PACKAGE_DUMP NANO_PACKAGE_DIR /usr/ports/foo/bar [package.txz]... +# $0 [-cv] PACKAGE_DUMP NANO_PACKAGE_DIR /usr/ports/foo/bar [package.pkg]... # -# Will symlink the packages listed, including their runtime dependencies, +# Will symlink/copy the packages listed, including their runtime dependencies, # from the PACKAGE_DUMP to the NANO_PACKAGE_DIR. # : ${PORTSDIR:=/usr/ports} usage () { - echo "Usage: $0 [-v] package-dump-dir nano-package-dir port-dir-or-pkg ..." 1>&2 + echo "Usage: $0 [-cv] package-dump-dir nano-package-dir port-dir-or-pkg ..." 1>&2 exit 2 } @@ -53,29 +53,29 @@ ports_recurse() ( for p do if [ -d "$p" -a -f "$p/Makefile" ] ; then msg 3 "$p: full path to port" - pkgname=`cd "$p" && make -V pkgname` + pkgname=`cd "$p" && make package-name` type=port fullpath=$p elif [ -d "${PORTSDIR}/$p" -a -f "${PORTSDIR}/$p/Makefile" ] ; then msg 3 "$p: path to port relative to ${PORTSDIR}}" - pkgname=`cd "${PORTSDIR}/$p" && make -V pkgname` + pkgname=`cd "${PORTSDIR}/$p" && make package-name` type=port fullpath=${PORTSDIR}/$p - elif [ "${p%.txz}" != "$p" -a -f "$p" ] && pkg info -F "$p" > /dev/null 2>&1 ; then + elif [ "${p%.pkg}" != "$p" -a -f "$p" ] && pkg info -F "$p" > /dev/null 2>&1 ; then msg 3 "$p: full package file name" - pkgname=`basename "$p" | sed 's/\.txz$//I'` + pkgname=`basename "$p" | sed 's/\.pkg$//I'` type=pkg fullpath=$p - elif [ "${p%.txz}" != "$p" -a -f "$dumpdir/$p" ] && pkg info -F "$dumpdir/$p" > /dev/null 2>&1 ; then + elif [ "${p%.pkg}" != "$p" -a -f "$dumpdir/$p" ] && pkg info -F "$dumpdir/$p" > /dev/null 2>&1 ; then msg 3 "$p: package file name relative to $dumpdir" - pkgname=`basename "$p" | sed 's/\.txz$//I'` + pkgname=`basename "$p" | sed 's/\.pkg$//I'` type=pkg fullpath=$dumpdir/$p - elif [ -f "$dumpdir/$p.txz" ] && pkg info -F "$dumpdir/$p.txz" > /dev/null 2>&1 ; then + elif [ -f "$dumpdir/$p.pkg" ] && pkg info -F "$dumpdir/$p.pkg" > /dev/null 2>&1 ; then msg 3 "$p: package name relative to $dumpdir" pkgname=`basename "$p"` type=pkg - fullpath=$dumpdir/$p.txz + fullpath=$dumpdir/$p.pkg else echo "Missing port or package $p" 1>&2 exit 2 @@ -106,7 +106,7 @@ ports_recurse() ( fi deps=`pkg info -dF "$fullpath" | grep -v "$pkgname:"` for dep in $deps ; do - arg=`echo $dep | sed -e "s|^|$dir|" -e 's/$/.txz/'` + arg=`echo $dep | sed -e "s|^|$dir|" -e 's/$/.pkg/'` msg 2 "Check $arg as requirement for package $pkgname" ports_recurse "$outputfile" "$dumpdir" "$arg" done @@ -116,10 +116,12 @@ ports_recurse() ( done ) +COPY="ln -s" VERBOSE=0 -while getopts v opt ; do +while getopts cv opt ; do case "$opt" in + c) COPY="cp -p" ;; v) VERBOSE=$(($VERBOSE + 1)) ;; [?]) usage ;; esac @@ -155,8 +157,8 @@ for p do done for i in `cat "$PL"` ; do - if [ -f "$NANO_PKG_DUMP/$i.txz" ] ; then - ln -s "$NANO_PKG_DUMP/$i.txz" "$NANO_PKG_DIR" + if [ -f "$NANO_PKG_DUMP/$i.pkg" ] ; then + $COPY "$NANO_PKG_DUMP/$i.pkg" "$NANO_PKG_DIR" else echo "Package $i misssing in $NANO_PKG_DUMP" 1>&2 exit 1 From nobody Mon Dec 16 15:15: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 4YBk5m5gyDz5hYZQ; Mon, 16 Dec 2024 15:15:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YBk5m4Rfbz48Rl; Mon, 16 Dec 2024 15:15:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734362124; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9DPmFiCrmWuYI+HGZwgYnRUBpTpePpwfpM+zXONuu44=; b=hYmm5tDMCqKn3W33heRITHlaZRiiesLtnssYm5zTKI1dVAOdPLrUhZ5h2nkJC/ObstcCZo 73uxiw1zfQZAy3CLM6ZqzxJfke4KXaM3Pheucc/9vbmseFtYNlk5qfmE5OTcZDwe+xIr99 YvOgfNp2WMI4g4xTbO1TS6adOtJiw/PlM8GUaZVOFuYnH3gXlCQcl2IcsFOmk5OyVe3Mp9 fU2ZZzN9jQMRAIrMa1PK52t2ARtxVDc70j8m5Xga5VsFju5FM7ttFAnk+RBHzw5b5sgXrt 8ZLfW7ndKQiqu1zF7XsEl+wc/Dp5DvuPrfp9wzIEnCjTZImZU7lSr79bZOsj1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734362124; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9DPmFiCrmWuYI+HGZwgYnRUBpTpePpwfpM+zXONuu44=; b=hMR5RFJsF9WCtcIAlQ8CFEYAjkO/60vbSYp8KDNR8Ysckxp8Pg56k0pZCWhUu8li1TV1XE BLnIX384w4z0TKFa/bFVfaTv1imFa9o7gulPmLpi8XWyll2UL0M/uWVqP5+RjioWYFJLMq 3Xw6FN2CoPoCXwmlNiRVj2OyrTSALh8gdjkhtxz8/eEOm4oW1CvST8Zlygyxa7syiXRRHh uWyCIErnUiO8FBFBnnrPUH+zXq0uW4ZuS/DB9B3wfqa9GMupp7IqB7Wpgc6wvcMSIQ9fsi Okd+q+YUgxNJR3fU16WRjpahu8op03InQER+saHjrIEHrypKvhEjvFLLSfaHMQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734362124; a=rsa-sha256; cv=none; b=bgodcIE9oDWOvQ67dtSYAto1GBi1CjTXG9TiOhJ+YIbdx7PCI6QZyZXdpq3ueif5jjme83 vdd5Ky8FvMziY1EcLLv4vX9exSeRlppXiaOOpHLP+Q0dHOgpYv7YAZ/iiiXKxE2tSxypph dm+sgH8WVcfk/lcBRTD+baaV6o2oNzAeRP9qBFo9FxatQo19n8ExX9NWZXZ+Lqjjg+69ND NN7EoCFkNeF+rq5oqMMa+3oUMC9C36SNNsTyXFUqYbnL4QkoFztbeQ/rwAhOwtuNcv1ht/ 23WskCcYPFFT1p1C9Ryi6hYz0tbkSAGjsr+jFj1BCVcv9fxSySvF0KKd2RQqQA== 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 4YBk5m3z2QzyZV; Mon, 16 Dec 2024 15:15:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BGFFOOJ012058; Mon, 16 Dec 2024 15:15:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BGFFOQO012055; Mon, 16 Dec 2024 15:15:24 GMT (envelope-from git) Date: Mon, 16 Dec 2024 15:15:24 GMT Message-Id: <202412161515.4BGFFOQO012055@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: a7e4493778b0 - stable/13 - nanobsd: Use the real path for NANO_PACKAGE_DIR 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: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a7e4493778b02af51344ab6d217942c2440d3736 Auto-Submitted: auto-generated The branch stable/13 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=a7e4493778b02af51344ab6d217942c2440d3736 commit a7e4493778b02af51344ab6d217942c2440d3736 Author: Jose Luis Duran AuthorDate: 2024-11-12 20:17:14 +0000 Commit: Jose Luis Duran CommitDate: 2024-12-16 15:13:44 +0000 nanobsd: Use the real path for NANO_PACKAGE_DIR As users may have the Pkg directory as a symbolic link to the NanoBSD "package dump directory". In commit 9af130ae8c03, cust_pkgng() was greatly improved, however as a side effect of using a nullfs mount, the directories and files must not be symlinks. Fix it by using NANO_PACKAGE_DIR realpath(). PR: 269884 Reviewed by: imp Approved by: emaste (mentor) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D47532 (cherry picked from commit 4223c668e4b9ba71e2c6cfabbd66795729b7ff8b) --- tools/tools/nanobsd/defaults.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/tools/nanobsd/defaults.sh b/tools/tools/nanobsd/defaults.sh index bb1e96b911e5..69e89958b02b 100755 --- a/tools/tools/nanobsd/defaults.sh +++ b/tools/tools/nanobsd/defaults.sh @@ -788,6 +788,7 @@ cust_pkgng ( ) ( fi # If the package directory doesn't exist, we're done. + NANO_PACKAGE_DIR="$(realpath $NANO_PACKAGE_DIR)" if [ ! -d ${NANO_PACKAGE_DIR} ]; then echo "DONE 0 packages" return 0 From nobody Mon Dec 16 15:15: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 4YBk5n6D3zz5hYX8; Mon, 16 Dec 2024 15:15: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YBk5n55bxz487L; Mon, 16 Dec 2024 15:15:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734362125; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=paXFknQjk3UoKPmcH4MQJda7v1G3Rdt2vcdcow59wzI=; b=mualEZej26XNHvV9WuFlgsK1h8tWlrigKcVDFgQykJSuSqaafSolZ61BmNWorr98LTMBny Lx4vJLHWplBKdWT4oS7wC/4KCVuna/r3ltn6Dr6298TRPTTRSq8WbkYdzo1DY0NByCuykS 8/KEsB76KV820uY5aCxD9HZfEkyyv1h1WQwOc2yH+dpRynVBFMgKooxVIbKK8fLDSV80Rs 67RuwUKPJN8lWdOWIke1aQ/6ncglPDtIPLzBav9+ZOH9wg+/LcPXVU/rnKUuB6ikM9vUxj tXFdMz1JQHDC7gesxG2jVTmgh3FfG39clHdTVRwjnGsbvY7Jm2BC7M0FJeHC+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734362125; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=paXFknQjk3UoKPmcH4MQJda7v1G3Rdt2vcdcow59wzI=; b=ROoOGwUyR5e4RilEDSa0mz+jjW/q7R+ansZ90ldudBTXh1/xZrwRHehmbGviq6yyEvRmMW RsUxonI+4UlG7YeGiXRfaXDQSx715uDSezHhg0b2x5cElGqwCYnCBbkZZrk22JVn+XpHky j8cjapwDIXXNMxLxzcTgBZEPXM0erFgjhy6dSJ+wbjRRNzLJDD+zffrvX8FmTqJ9rHrC0n rldGSzbbf2+WnHrZPkLmb4YO+OD+Tz3Xm8Fh777h4XJIPNfrq/PydERD4g0mck3h2etFQw SwY797OI0HCQ5V9izhrSRHqbu5CJl6n906L1kKnRxK3YrJL+5GV2SYfJk184Aw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734362125; a=rsa-sha256; cv=none; b=Z4GeBC80Ik5OZlMHhqX28rYOOE4A/cbd7JKh63jF/VNXEtHYzF5W4OBsl5uNhJBrndTfO8 U24CfE0qEiKyxllbkVqfJtCr7ZF9cuiOYMrO3hHsMvjDbnLR3rbM/eOtJvn1rTCU8HXRrP mmyy0IyOQt6kUyVbl+/aYaorAsvF69KyLk3M1IR6H9MvC6d+Lpl3QNXe3SGQfD2WiKbij/ gsJ46drD6L5NMW8AuYvJtgxFhGZGENpgfxH9Yxbe08w1QOTujUMWieu/fjbd+4uiTq7LN6 +GYb7kf6zEA7gfxq2ebM1HF0ijyghLvDVLf4mRDlqAX9lkX8usq6wL/dvtJObw== 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 4YBk5n4gNczy4l; Mon, 16 Dec 2024 15:15:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BGFFPTW012103; Mon, 16 Dec 2024 15:15:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BGFFP1C012100; Mon, 16 Dec 2024 15:15:25 GMT (envelope-from git) Date: Mon, 16 Dec 2024 15:15:25 GMT Message-Id: <202412161515.4BGFFP1C012100@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: 4ace066a9085 - stable/13 - nanobsd: Fix cust_comconsole search patterns 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: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4ace066a9085e8b0e9febf7850b3c51cd9533f7a Auto-Submitted: auto-generated The branch stable/13 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=4ace066a9085e8b0e9febf7850b3c51cd9533f7a commit 4ace066a9085e8b0e9febf7850b3c51cd9533f7a Author: Jose Luis Duran AuthorDate: 2024-11-15 04:28:01 +0000 Commit: Jose Luis Duran CommitDate: 2024-12-16 15:13:51 +0000 nanobsd: Fix cust_comconsole search patterns The current patterns are outdated, and may produce "offifexists", after e310437971b8 ("For video consoles, only launch a getty if the device exists."). Fix the expressions to: 1. Disable getty(8) on the virtual syscons(4) or vt(4) terminals (/dev/ttyv*). 2. Enable the use of the first serial port as the system console. Reviewed by: imp Approved by: emaste (mentor) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D47586 (cherry picked from commit 0f7b0db5dd07e7c48285db4cac19e15fc9a42622) --- tools/tools/nanobsd/defaults.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/tools/nanobsd/defaults.sh b/tools/tools/nanobsd/defaults.sh index 69e89958b02b..8ef9cc0a6066 100755 --- a/tools/tools/nanobsd/defaults.sh +++ b/tools/tools/nanobsd/defaults.sh @@ -742,10 +742,10 @@ UsbDevice ( ) { cust_comconsole ( ) ( # Enable getty on console - sed -i "" -e /tty[du]0/s/off/on/ ${NANO_WORLDDIR}/etc/ttys + sed -i "" -e '/^tty[du]0/s/off/onifconsole/' ${NANO_WORLDDIR}/etc/ttys - # Disable getty on syscons devices - sed -i "" -e '/^ttyv[0-8]/s/ on/ off/' ${NANO_WORLDDIR}/etc/ttys + # Disable getty on syscons or vt devices + sed -i "" -E '/^ttyv[0-8]/s/\ton(ifexists)?/\toff/' ${NANO_WORLDDIR}/etc/ttys # Tell loader to use serial console early. echo "${NANO_BOOT2CFG}" > ${NANO_WORLDDIR}/boot.config From nobody Mon Dec 16 15:15: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 4YBk5q1Fy5z5hYD0; Mon, 16 Dec 2024 15:15: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YBk5p6Tgnz48kr; Mon, 16 Dec 2024 15:15:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734362126; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=m7l++cUeHDF9+jLCLirOG3eezBUozppN7C5wxDAE7sg=; b=hBfQzevvNP+vUPol21VeyB2+cCTvYWTunx3r8Tz63TTEQ0+6HIv6ur55ag9Ypblp52J22l n+yx8U4BpdZSXHxLIPRX1J2Pq6FiitLCpfwSXQGETsgQZo0bcs7PXBtU+RlDdFw7/r/2RY NTxzBH4ASVJvSku2BYqOEkq9WtUqc+92aRRMfaKXAmB6zlSfg9FsEI25W+1znwqUWZMhhC kZhqotD8iilVpGJZIrHVDGvV+uU/4WCPaEI9GRgy0Z682OQXqIDbbjrvl7L3CfvKA7oM2w zLWkcsEXxY4aWfDZkCMRl34RUEgs8+ri0q7l8nnzpwGLsfFJlth1qhSZkDOLTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734362126; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=m7l++cUeHDF9+jLCLirOG3eezBUozppN7C5wxDAE7sg=; b=OGDaTOMHlnz6M0aClKDqlTOcYEIh/d0UJRBsBCl1Nhz7uGn3daeaPjE2vEwkfofKsEDvIM 0pUIxCl5ezqlY6UFk28BMpMHHvskIEMPnj9a74GL9GkcXLe3MxnP04pQlavLzmWJG5xKTm /BmmBkMp4x4NatFkSp13O2pGUT4RPySyctWexUFTPnxGeGhwoMZQvI+pQYX5Iu53M5NK+4 797fUshvHvxPy8N34iAtnHwMKk03ylaoTe74vFEWe7LurfQDG+CXKJvKix89FfUhBXr90q W/J91i1cmDoSPQHYID3VE77l8xYvbk040au0sE+yNS5GfRbL/kKPOzD6+/qjeg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734362126; a=rsa-sha256; cv=none; b=bUvhplqfPDp4zyhKW9RP7TDogw+EY/PbL1HhsF5YkhqI/b7FoS9Elu8zqcGRAGVMVClSSP HAHvRsUOAeKSJ1B9BlKYgHBFXCVXAKlosrudmKuDBOBYCyk22lGMFl/jlXPtfQlleTz9gM G2HMNCAJ1Q7L7SXe1JKFxHC3DZ754tZuYQ3t9ifH3gyc5LMCqsMEtsJPRvNYYBCdQJsoC6 rtTeBpEjMFUnGVQUufb1c+VCDqM+ABH34VuEXmEmfClETtX5l+QTmOT8kjcGnIM+2h5Sgx UPeXHjHubB+aWupJ2g6XKhf16GE2yEx3vcPm24YoswduKNCC8AlVQiDbIWsQZA== 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 4YBk5p5lz5zym8; Mon, 16 Dec 2024 15:15:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BGFFQvv012145; Mon, 16 Dec 2024 15:15:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BGFFQVN012142; Mon, 16 Dec 2024 15:15:26 GMT (envelope-from git) Date: Mon, 16 Dec 2024 15:15:26 GMT Message-Id: <202412161515.4BGFFQVN012142@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: 6b466bbd6134 - stable/13 - nanobsd: Fix typos 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: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6b466bbd6134980985b67a68787e4258c0e49b88 Auto-Submitted: auto-generated The branch stable/13 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=6b466bbd6134980985b67a68787e4258c0e49b88 commit 6b466bbd6134980985b67a68787e4258c0e49b88 Author: Jose Luis Duran AuthorDate: 2024-11-15 04:54:09 +0000 Commit: Jose Luis Duran CommitDate: 2024-12-16 15:13:59 +0000 nanobsd: Fix typos Fix a number of typos in the code or comments. Files under dhcpd, embedded, pcengines, and rescue were intentionally omitted. These directories will be reviewed at a later date. PR: 269884 Reviewed by: imp, zlei Approved by: emaste (mentor) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D47587 (cherry picked from commit 12cbad923dbcccb3d6f71a77ad3241508f186048) --- tools/tools/nanobsd/Files/root/save_cfg | 2 +- tools/tools/nanobsd/defaults.sh | 10 +++++----- tools/tools/nanobsd/fill_pkg.sh | 2 +- tools/tools/nanobsd/mtree-dedup.awk | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tools/tools/nanobsd/Files/root/save_cfg b/tools/tools/nanobsd/Files/root/save_cfg index 1931e5c79923..24f812197a68 100644 --- a/tools/tools/nanobsd/Files/root/save_cfg +++ b/tools/tools/nanobsd/Files/root/save_cfg @@ -62,7 +62,7 @@ do # Add to cfg (y/n/i)? # y) -> save this file in /cfg # n) -> do not save this file in /cfg for current script invocation ONLY - # i) -> add file to ignore list (/cfg/.ignore hiereachy) and never save + # i) -> add file to ignore list (/cfg/.ignore hierarchy) and never save # try to add this file to /cfg. # # touch is used to add files to /cfg to keep the script flow straight and easy diff --git a/tools/tools/nanobsd/defaults.sh b/tools/tools/nanobsd/defaults.sh index 8ef9cc0a6066..c2efcbd52571 100755 --- a/tools/tools/nanobsd/defaults.sh +++ b/tools/tools/nanobsd/defaults.sh @@ -497,10 +497,10 @@ run_late_customize ( ) ( # a user's cfg file would override this. # fixup_before_diskimage ( ) ( - # Run the deduplication script that takes the matalog journal and + # Run the deduplication script that takes the metalog journal and # combines multiple entries for the same file (see source for # details). We take the extra step of removing the size keywords. This - # script, and many of the user scripts, copies, appeneds and otherwise + # script, and many of the user scripts, copies, appends and otherwise # modifies files in the build, changing their sizes. These actions are # impossible to trap, so go ahead remove the size= keyword. For this # narrow use, it doesn't buy us any protection and just gets in the way. @@ -814,7 +814,7 @@ cust_pkgng ( ) ( CR "${PKGCMD} add /_.p/${_NANO_PKG_PACKAGE}" ( - # Expand any glob characters in pacakge list + # Expand any glob characters in package list cd "${NANO_PACKAGE_DIR}" _PKGS=`find ${NANO_PACKAGE_LIST} -not -name "${_NANO_PKG_PACKAGE}" -print | sort | uniq` @@ -905,7 +905,7 @@ usage ( ) { # Setup and Export Internal variables # -export_var ( ) { # Don't wawnt a subshell +export_var ( ) { # Don't want a subshell var=$1 # Lookup value of the variable. eval val=\$$var @@ -914,7 +914,7 @@ export_var ( ) { # Don't wawnt a subshell } # Call this function to set defaults _after_ parsing options. -# dont want a subshell otherwise variable setting is thrown away. +# don't want a subshell otherwise variable setting is thrown away. set_defaults_and_export ( ) { : ${NANO_OBJ:=/usr/obj/nanobsd.${NANO_NAME}} : ${MAKEOBJDIRPREFIX:=${NANO_OBJ}} diff --git a/tools/tools/nanobsd/fill_pkg.sh b/tools/tools/nanobsd/fill_pkg.sh index 6734498350a9..17d163709f91 100644 --- a/tools/tools/nanobsd/fill_pkg.sh +++ b/tools/tools/nanobsd/fill_pkg.sh @@ -160,7 +160,7 @@ for i in `cat "$PL"` ; do if [ -f "$NANO_PKG_DUMP/$i.pkg" ] ; then $COPY "$NANO_PKG_DUMP/$i.pkg" "$NANO_PKG_DIR" else - echo "Package $i misssing in $NANO_PKG_DUMP" 1>&2 + echo "Package $i missing in $NANO_PKG_DUMP" 1>&2 exit 1 fi done diff --git a/tools/tools/nanobsd/mtree-dedup.awk b/tools/tools/nanobsd/mtree-dedup.awk index e30f3100b4da..8840047f5318 100755 --- a/tools/tools/nanobsd/mtree-dedup.awk +++ b/tools/tools/nanobsd/mtree-dedup.awk @@ -84,7 +84,7 @@ function mtree_from_kvs(path, kvs) return lv; } -# Parse the mtree line into path + KVs. Use a sentinal value +# Parse the mtree line into path + KVs. Use a sentinel value # for a bare keyword, which is extremely unlikely to be used # for real. function line2kv(kvs, str) From nobody Tue Dec 17 02:28: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 4YC11r5l85z5gwpm; Tue, 17 Dec 2024 02:28: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YC11r59jyz4b4r; Tue, 17 Dec 2024 02:28:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734402480; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Kk2uSU4wesa5r+N0SCxgqgmPpd9d1D2FeCGsHv2coW0=; b=kX2qA9RPIJInxSjOotqowEDsIwxANYFzyyCCFtQAxpGBHK6ylJ15zZUS2NfZTb4roPDWC7 Z81N01g2rdhIzIIw/QFgI8fOzXy8URHVI3DMi3GVPRx9lzm14+si9y6t1qaYN/fNNfRd4m CPMAJFa1doz9FDxWUMihLz1NPkJLO1+jzXFekw+kSv5D0VdN7aNTMyyJo+u1nf90i9b2c+ GqgEcnhM7cNpwZcKZQ9n7K22cm/Kl1mxlTP5y1A2TuUt+LnLLPLviU9CG5L27Ml8AlxEMS tcu7RNW6hOLvb/xZCw+nvRjFBguNhFgInjNEDdmksJuaYIoXI6FWp+LGBXLBZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734402480; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Kk2uSU4wesa5r+N0SCxgqgmPpd9d1D2FeCGsHv2coW0=; b=RjP1L8fS0Cs1iwiwf6+V+Hd2FiIjyWBByhftX6nBjhJoEJ7lb6iLiRHXLXHL6CwvutjcTN UReFUOTFeqP00NKjREbLUvhpk6p/nKXIKZKDIcvvTqrexdfHUSktwH6mgsMH0IDrW33YQ/ d6aeX1O9Wx7HcdbcyBEMg+LyA7kxod9H27AQfzdVi/PHYueB79otnGm4A9AadB/6kJbjCx P2oDqaso2BUIXHFKYZplu8Rh6/tRcegG/hSSUZ5oR6lrs7eKelTIeLxjWkxF79dCYeVlxz Z+VP++VE5cuuxfhn6I9y/2iA1I64iCf7fkdGgHx0ivbzKG9E9AucWKTybeJVvA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734402480; a=rsa-sha256; cv=none; b=oxzh3axsUanTLQuiSbrETXCKURdbQyK/K+jo2rCJeLyKfunznyTjSsj0u/5POAcXqaWpVy 50BPDxYFL2dfwvRnwRPbBLyy9Nxp0F3YrrGvg3VCsdUIqnGHCoCeS/2162SqgtLUbMzC59 cqkK6kNBWYAzDeGqb4BTabMAgj/Pa7aLvLlgQgOgE3o1qwO1Ak06GglyDa8DSnFdoonAG8 Hnozwtmbk0rXaHOk5t8hhH4vZAa5EOaSF/a0BIC4ms49XTAu2GSvIyG+87aXNtB9r0FMH2 On0CeSksGihtGN+53KIcIEY/sCFdxnjaE27gLRnyW3vo9JJ5NTihUS+0REkp2A== 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 4YC11r4nYkz1K0y; Tue, 17 Dec 2024 02:28:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BH2S0rr063426; Tue, 17 Dec 2024 02:28:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BH2S0Wc063423; Tue, 17 Dec 2024 02:28:00 GMT (envelope-from git) Date: Tue, 17 Dec 2024 02:28:00 GMT Message-Id: <202412170228.4BH2S0Wc063423@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: 2f57e37c43ba - stable/14 - release: Standardize on *-${FS}.* VM image naming 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: 2f57e37c43bab5a964d4685f00021fba989e63ee Auto-Submitted: auto-generated The branch stable/14 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=2f57e37c43bab5a964d4685f00021fba989e63ee commit 2f57e37c43bab5a964d4685f00021fba989e63ee Author: Colin Percival AuthorDate: 2024-12-10 19:57:52 +0000 Commit: Colin Percival CommitDate: 2024-12-17 00:54:16 +0000 release: Standardize on *-${FS}.* VM image naming We publish three sets of VM images on download.freebsd.org: * Generic VM images * BASIC-CLOUDINIT VM images * BASIC-CI VM images Of these, the first had names like FreeBSD-14.2-RELEASE-amd64-ufs.raw.xz, the second had names like FreeBSD-14.2-RELEASE-amd64-BASIC-CLOUDINIT.ufs.qcow2.xz, and the third had names like FreeBSD-14.2-RELEASE-amd64-BASIC-CI.ufs.raw.xz but were listed in the CHECKSUM files with names like FreeBSD-14.2-RELEASE-amd64-BASIC-CI-ufs.raw.xz Standardize these to consistently use a hyphen before the filesystem type rather than a period. Note: On FreeBSD 14 we ship images without the -${FS} component in their names; these are hardlinks to the -ufs images for compatibility purposes. On FreeBSD 13 we only have UFS images and don't include the filesystem in the name. MFC after: 1 week Reported by: jmg Sponsored by: Amazon (cherry picked from commit 35623ccc375846648f4dcdfc47c7e84fc9db4852) --- release/Makefile.mirrors | 28 ++++++++++++++-------------- release/Makefile.vm | 4 ++-- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/release/Makefile.mirrors b/release/Makefile.mirrors index 7e25d69588bd..abd01231606b 100644 --- a/release/Makefile.mirrors +++ b/release/Makefile.mirrors @@ -220,13 +220,13 @@ vm-images-stage: . for VMFORMAT in ${${CW}_FORMAT} . for FS in ${${CW}_FSLIST} cd ${RELEASEDIR}/vmimages && \ - mv ${OSRELEASE}-${CW}.${FS}.${VMFORMAT}.xz \ - ${OSRELEASE}-${CW}-${SNAP_SUFFIX}.${FS}.${VMFORMAT}.xz - cp -p ${RELEASEDIR}/vmimages/${OSRELEASE}-${CW}-${SNAP_SUFFIX}.${FS}.${VMFORMAT}.xz \ - ${VM_DIR}/${BUILDDATE}/${OSRELEASE}-${CW}-${SNAP_SUFFIX}.${FS}.${VMFORMAT}.xz + mv ${OSRELEASE}-${CW}-${FS}.${VMFORMAT}.xz \ + ${OSRELEASE}-${CW}-${SNAP_SUFFIX}-${FS}.${VMFORMAT}.xz + cp -p ${RELEASEDIR}/vmimages/${OSRELEASE}-${CW}-${SNAP_SUFFIX}-${FS}.${VMFORMAT}.xz \ + ${VM_DIR}/${BUILDDATE}/${OSRELEASE}-${CW}-${SNAP_SUFFIX}-${FS}.${VMFORMAT}.xz cd ${VM_DIR}/Latest && \ - ln -s ../${BUILDDATE}/${OSRELEASE}-${CW}-${SNAP_SUFFIX}.${FS}.${VMFORMAT}.xz \ - ${OSRELEASE}-${CW}.${FS}.${VMFORMAT}.xz + ln -s ../${BUILDDATE}/${OSRELEASE}-${CW}-${SNAP_SUFFIX}-${FS}.${VMFORMAT}.xz \ + ${OSRELEASE}-${CW}-${FS}.${VMFORMAT}.xz . endfor . endfor . endif @@ -260,8 +260,8 @@ vm-images-stage: . if ${CW} == BASIC-CLOUDINIT . for VMFORMAT in ${${CW}_FORMAT} . for FS in ${${CW}_FSLIST} - cp -p ${RELEASEDIR}/vmimages/${OSRELEASE}-${CW}.${FS}.${VMFORMAT}.xz \ - ${VM_DIR}/Latest/${OSRELEASE}-${CW}.${FS}.${VMFORMAT}.xz + cp -p ${RELEASEDIR}/vmimages/${OSRELEASE}-${CW}-${FS}.${VMFORMAT}.xz \ + ${VM_DIR}/Latest/${OSRELEASE}-${CW}-${FS}.${VMFORMAT}.xz . endfor . endfor . endif @@ -287,12 +287,12 @@ ci-images-stage: . for FS in ${${CW}_FSLIST} cd ${RELEASEDIR}/ciimages && \ mv ${OSRELEASE}-${CW}-${FS}.${VMFORMAT}.xz \ - ${OSRELEASE}-${CW}-${SNAP_SUFFIX}.${FS}.${VMFORMAT}.xz - cp -p ${RELEASEDIR}/ciimages/${OSRELEASE}-${CW}-${SNAP_SUFFIX}.${FS}.${VMFORMAT}.xz \ - ${CI_DIR}/${BUILDDATE}/${OSRELEASE}-${CW}-${SNAP_SUFFIX}.${FS}.${VMFORMAT}.xz + ${OSRELEASE}-${CW}-${SNAP_SUFFIX}-${FS}.${VMFORMAT}.xz + cp -p ${RELEASEDIR}/ciimages/${OSRELEASE}-${CW}-${SNAP_SUFFIX}-${FS}.${VMFORMAT}.xz \ + ${CI_DIR}/${BUILDDATE}/${OSRELEASE}-${CW}-${SNAP_SUFFIX}-${FS}.${VMFORMAT}.xz cd ${CI_DIR}/Latest && \ - ln -s ../${BUILDDATE}/${OSRELEASE}-${CW}-${SNAP_SUFFIX}.${FS}.${VMFORMAT}.xz \ - ${OSRELEASE}-${CW}.${FS}.${VMFORMAT}.xz + ln -s ../${BUILDDATE}/${OSRELEASE}-${CW}-${SNAP_SUFFIX}-${FS}.${VMFORMAT}.xz \ + ${OSRELEASE}-${CW}-${FS}.${VMFORMAT}.xz . endfor cd ${RELEASEDIR}/ciimages && \ mv ${OSRELEASE}-${CW}.${VMFORMAT}.xz \ @@ -325,7 +325,7 @@ ci-images-stage: . for VMFORMAT in ${${CW}_FORMAT} . for FS in ${${CW}_FSLIST} cp -p ${RELEASEDIR}/ciimages/${OSRELEASE}-${CW}-${FS}.${VMFORMAT}.xz \ - ${CI_DIR}/Latest/${OSRELEASE}-${CW}.${FS}.${VMFORMAT}.xz + ${CI_DIR}/Latest/${OSRELEASE}-${CW}-${FS}.${VMFORMAT}.xz . endfor cp -p ${RELEASEDIR}/ciimages/${OSRELEASE}-${CW}.${VMFORMAT}.xz \ ${CI_DIR}/Latest/${OSRELEASE}-${CW}.${VMFORMAT}.xz diff --git a/release/Makefile.vm b/release/Makefile.vm index 07fd8ec94f87..f96fc6d1e902 100644 --- a/release/Makefile.vm +++ b/release/Makefile.vm @@ -247,8 +247,8 @@ cloud-install-BASIC-CLOUDINIT: .for _FS in ${BASIC-CLOUDINIT_FSLIST} . for _FMT in ${BASIC-CLOUDINIT_FORMAT} cp -p ${.OBJDIR}/${BASIC-CLOUDINIT${_FS:tu}${_FMT:tu}IMAGE} \ - ${DESTDIR}/vmimages/${OSRELEASE}-BASIC-CLOUDINIT.${_FS}.${_FMT} - ${XZ_CMD} ${DESTDIR}/vmimages/${OSRELEASE}-BASIC-CLOUDINIT.${_FS}.${_FMT} + ${DESTDIR}/vmimages/${OSRELEASE}-BASIC-CLOUDINIT-${_FS}.${_FMT} + ${XZ_CMD} ${DESTDIR}/vmimages/${OSRELEASE}-BASIC-CLOUDINIT-${_FS}.${_FMT} . endfor .endfor cd ${DESTDIR}/vmimages && sha512 ${OSRELEASE}* > \ From nobody Wed Dec 18 13:46: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 4YCw2g56ZJz5hN07; Wed, 18 Dec 2024 13:46: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YCw2g4ZX6z4D61; Wed, 18 Dec 2024 13:46:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734529611; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kYoo0hzQY70IgTvT+mj9gdA40TFvM4F/o8srrmzydl0=; b=lhcmyboE1AQpw9TazpuqNMfkp4cBK15AJxzeB+1IqsTE4Qp90hWunmiBYVr7Tz7UqVBTL6 Agaw6zqj+Uq6wZj623PV9s1hn2U2UaAxgFFaGBzde4UmPJMTWoZ8WnHQxGvC5Vhh7Qlnqi CWqXPvdAV9spgJh7id3MzIu/AfgeCoDh+Ou6x7zMcAlaVX/tsp5gRetRTz+F8kccu4lvU8 n5Pz1GlQ6HBdubeJlJU95q22eZs3eGX+QrC9IJCyTr+aVtcEOkNKA2W2EMHisZevjfrJro vFhEPFn9QKSYN/1lWBx8EscdNVvO7wyv6TzNzex+QOiNdCGd/u/rI15UrgdT2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734529611; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kYoo0hzQY70IgTvT+mj9gdA40TFvM4F/o8srrmzydl0=; b=nTCUjd4qhE/VyPHOBGW8U0RijAZitKYPRbqpk4l4a9Qo0kRjSfyumondXnxJbZOaf4gnBf VN0BctUI1SfcIhKEb4wc0huL+n4r4dhuOr1xiujITDJLbcU8reY91Jjlq6M2aOFBzS+woM IWsrSGgP9iujgCyU3IbEBhsAc5UqKe74uXhvZ4hjisIn2eRNI45RnSdsdPkxVM7J+IIC0j cqENrsxsEWctzICBc9riOyRT9g5MYlO2TKu1+ejTp0fPtu+JKHECTGuRt6RBeWwpQP2CaD qtAW4cPDGC9d6KvnOEOMzG8shoVe60u51MWNh1qwni4YmeQveXllxulkgz/vaQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734529611; a=rsa-sha256; cv=none; b=CpSOqvo5tjDlKMU2gLeoPreKAUndn2A/87hiWuZAQl32MQEca4aFA22z+JU+HJ06uZ0kaB K/z5b6UPmA5EUUkbZc3HPmla+JcvoLwEdXa9vqGEoDuBpRx7142OZgc3O6W95G0Xx34JdK V1OQEo/BRbAkRsknlHPqRuaxD4Rid8GeN3lHHygQXeGY92Oxn17l39Z4/SscVdswS/DwGm 2nVE33Y67SZ3Is5QF6AvFGmJid5eHj4TDGhfq8IBDWZb8Xg6KFkTzkSMV2VxF4SzvGTvOF bH8xFU7NLMma23z57weRamRwtELAT4qD8SNhzI4n0ofxApO88smhtiYVAQ4Fdg== 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 4YCw2g46T2z19QM; Wed, 18 Dec 2024 13:46:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BIDkpwS019159; Wed, 18 Dec 2024 13:46:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BIDkpOK019157; Wed, 18 Dec 2024 13:46:51 GMT (envelope-from git) Date: Wed, 18 Dec 2024 13:46:51 GMT Message-Id: <202412181346.4BIDkpOK019157@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: 60786eb3fe7f - stable/14 - sockstat: Ensure that there is always a space between columns 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: 60786eb3fe7fc0198baba9b153eec7fa5af1f9e9 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=60786eb3fe7fc0198baba9b153eec7fa5af1f9e9 commit 60786eb3fe7fc0198baba9b153eec7fa5af1f9e9 Author: Mark Johnston AuthorDate: 2024-12-04 01:12:39 +0000 Commit: Mark Johnston CommitDate: 2024-12-18 13:43:34 +0000 sockstat: Ensure that there is always a space between columns PR: 282978 Reviewed by: asomers MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D47840 (cherry picked from commit fbd3448614fbd7bd92e7d34c3bfd2592a07391e3) --- usr.bin/sockstat/sockstat.c | 56 ++++++++++++++++++++++++++------------------- 1 file changed, 33 insertions(+), 23 deletions(-) diff --git a/usr.bin/sockstat/sockstat.c b/usr.bin/sockstat/sockstat.c index c1886deb89e7..11434a6efa68 100644 --- a/usr.bin/sockstat/sockstat.c +++ b/usr.bin/sockstat/sockstat.c @@ -1130,14 +1130,12 @@ displaysock(struct sock *s, int pos) switch (s->family) { case AF_INET: case AF_INET6: - if (laddr != NULL) { + if (laddr != NULL) pos += printaddr(&laddr->address); - if (s->family == AF_INET6 && pos >= 58) - pos += xprintf(" "); - } offset += opt_w ? 46 : 22; - while (pos < offset) + do pos += xprintf(" "); + while (pos < offset); if (faddr != NULL) pos += printaddr(&faddr->address); offset += opt_w ? 46 : 22; @@ -1209,8 +1207,9 @@ displaysock(struct sock *s, int pos) abort(); } if (opt_f) { - while (pos < offset) + do pos += xprintf(" "); + while (pos < offset); pos += xprintf("%d", s->fibnum); offset += 7; } @@ -1221,12 +1220,14 @@ displaysock(struct sock *s, int pos) sp = RB_FIND(socks_t, &socks, &(struct sock) { .socket = s->splice_socket }); if (sp != NULL) { - while (pos < offset) + do pos += xprintf(" "); + while (pos < offset); pos += printaddr(&sp->laddr->address); } else { - while (pos < offset) + do pos += xprintf(" "); + while (pos < offset); pos += xprintf("??"); offset += opt_w ? 46 : 22; } @@ -1236,8 +1237,9 @@ displaysock(struct sock *s, int pos) if (opt_i) { if (s->proto == IPPROTO_TCP || s->proto == IPPROTO_UDP) { - while (pos < offset) + do pos += xprintf(" "); + while (pos < offset); pos += xprintf("%" PRIu64, s->inp_gencnt); } offset += 9; @@ -1251,8 +1253,9 @@ displaysock(struct sock *s, int pos) (s->proto == IPPROTO_TCP && s->state != TCPS_CLOSED && s->state != TCPS_LISTEN))) { - while (pos < offset) + do pos += xprintf(" "); + while (pos < offset); pos += xprintf("%u", ntohs(faddr->encaps_port)); } @@ -1264,8 +1267,9 @@ displaysock(struct sock *s, int pos) s->state != SCTP_CLOSED && s->state != SCTP_BOUND && s->state != SCTP_LISTEN) { - while (pos < offset) + do pos += xprintf(" "); + while (pos < offset); pos += xprintf("%s", sctp_path_state(faddr->state)); } @@ -1275,8 +1279,9 @@ displaysock(struct sock *s, int pos) if (opt_s) { if (s->proto == IPPROTO_SCTP || s->proto == IPPROTO_TCP) { - while (pos < offset) + do pos += xprintf(" "); + while (pos < offset); switch (s->proto) { case IPPROTO_SCTP: pos += xprintf("%s", @@ -1296,8 +1301,9 @@ displaysock(struct sock *s, int pos) } if (opt_S) { if (s->proto == IPPROTO_TCP) { - while (pos < offset) + do pos += xprintf(" "); + while (pos < offset); pos += xprintf("%.*s", TCP_FUNCTION_NAME_LEN_MAX, s->stack); @@ -1306,8 +1312,9 @@ displaysock(struct sock *s, int pos) } if (opt_C) { if (s->proto == IPPROTO_TCP) { - while (pos < offset) + do pos += xprintf(" "); + while (pos < offset); xprintf("%.*s", TCP_CA_NAME_MAX, s->cc); } offset += TCP_CA_NAME_MAX + 1; @@ -1372,18 +1379,21 @@ display(void) pos = 0; if (opt_n || (pwd = cap_getpwuid(cappwd, xf->xf_uid)) == NULL) - pos += xprintf("%lu ", (u_long)xf->xf_uid); + pos += xprintf("%lu", (u_long)xf->xf_uid); else - pos += xprintf("%s ", pwd->pw_name); - while (pos < 9) + pos += xprintf("%s", pwd->pw_name); + do pos += xprintf(" "); + while (pos < 9); pos += xprintf("%.10s", getprocname(xf->xf_pid)); - while (pos < 20) + do pos += xprintf(" "); - pos += xprintf("%5lu ", (u_long)xf->xf_pid); - while (pos < 26) + while (pos < 20); + pos += xprintf("%5lu", (u_long)xf->xf_pid); + do pos += xprintf(" "); - pos += xprintf("%-3d ", xf->xf_fd); + while (pos < 26); + pos += xprintf("%-3d", xf->xf_fd); displaysock(s, pos); } } @@ -1392,7 +1402,7 @@ display(void) SLIST_FOREACH(s, &nosocks, socket_list) { if (!check_ports(s)) continue; - pos = xprintf("%-8s %-10s %-5s %-2s ", + pos = xprintf("%-8s %-10s %-5s %-3s", "?", "?", "?", "?"); displaysock(s, pos); } @@ -1401,7 +1411,7 @@ display(void) continue; if (!check_ports(s)) continue; - pos = xprintf("%-8s %-10s %-5s %-2s ", + pos = xprintf("%-8s %-10s %-5s %-3s", "?", "?", "?", "?"); displaysock(s, pos); } From nobody Wed Dec 18 13:46:52 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 4YCw2j00Rrz5hN09; Wed, 18 Dec 2024 13:46:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YCw2h6YSdz4DDc; Wed, 18 Dec 2024 13:46:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734529612; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZXlUdglifj8TI/hcX7mKKnL0RjgnxWjQfz3TEinfd2I=; b=TDLjI3eMoOGr+AfVSX35Es7Bm5228pwemK1zSgBqc/abEJMJLrpacz/Z4r5DN3xMiJhkVT ACOjXP1MSCTI6WohWSsdKNiukn8mXmQk2flxTH+BsKzWlP5Ke1/taPYtCsNv/KSKVTMYEG BGyItCKnYOZa4yEumadp7hsMAqbtvxqBlEhNGU1kQsHSEooF1ompYN6xfjM2kK69X5ic9B qRD37fZT7eNmvCKv/f5NYBZLAdBG9spreJpyAYtg+iIn5KcCJcNrnKJPOwOuN2IUqJK18S bqlgH/byGmYli0767p79/BC6mtCpOu1Yf8o8ipZFel05d8/kjpeCoQBe4It42A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734529612; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZXlUdglifj8TI/hcX7mKKnL0RjgnxWjQfz3TEinfd2I=; b=GHegCv+wToGSIGSsfGMiyWzsI7BFWLodbCl7HOIfeX4E5Tla/aQZX/mfiolQ6Lo4+U7hU8 mqNbRpjvpuomCtRM7HLWVODyEIjREKX/Xvus1otfEgCWXnCcMnsQP26RE+FJ5BurQvjKvo wA68uOLNLbA66nvDGFeMspxI/XPd9/U4EtLJrs6WGXSycKDRNxTrATGZD07B6V9GsCbkR6 tfEYCARAkEZBTUfUYTs5sQIkaek8qVm2oxrvZZWPet+cEs/gvH5NSOEUF65I2gY1TVUfik lbIjxcdCqsZS6xh+nnTLn0fQntt1AaAD6i+1qQy7dOtmfawwtZwV350yto0S9w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734529612; a=rsa-sha256; cv=none; b=YV9GMMwlOSmbpI7GXJ4UPH5sHDF0MLKX+bPYZB5f8TSdVuN4ZrS8yh3skoEnF51GJ/U7oE TUhgDZPE/q6bpMp2olTAXAE1cfl5ZW4asbCWzUBk4mjp827iP9iGcx0cXG1YeeiLVRRDg/ CrFMTxUVw0J9zj0kceTxo/xGinilxOIA5SlMHDcik43XaLFJaJTXbK8L+B2RkM5nHGLUbO 7g6IPXw9CDpODAO/Ww9Gs5oDrhiGzSG/2mk3CdOwXqgdKcSsMhbCVa/8+uuvGz1V5pEZcP vjZW+/2WOjjHMYR8xjwyocgkf/AuUZ91NcSFGS1mgjvWnW9GZ6H5UY/Fa13rnA== 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 4YCw2h53pmz19QN; Wed, 18 Dec 2024 13:46:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BIDkqHP019204; Wed, 18 Dec 2024 13:46:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BIDkqfl019201; Wed, 18 Dec 2024 13:46:52 GMT (envelope-from git) Date: Wed, 18 Dec 2024 13:46:52 GMT Message-Id: <202412181346.4BIDkqfl019201@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: 0c5701ff8fdf - stable/14 - pfkey: Fix some checks in kdebug_sadb() 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: 0c5701ff8fdf9103446f605fcab29608f4715338 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=0c5701ff8fdf9103446f605fcab29608f4715338 commit 0c5701ff8fdf9103446f605fcab29608f4715338 Author: Tobias Heider AuthorDate: 2024-12-04 01:13:41 +0000 Commit: Mark Johnston CommitDate: 2024-12-18 13:43:42 +0000 pfkey: Fix some checks in kdebug_sadb() Besides not doing any sufficient check that the length of a parsed message is not bigger than the actual allocated buffer, kdebug_sadb() incorrectly compares ext->sadb_ext_len, the extension payload size in 8 byte chunks, with tlen, which is the full message payload size in bytes. This should compare PFKEY_UNUNIT64(ext->sadb_ext_len) with tlen instead. PR: 277456 MFC after: 2 weeks (cherry picked from commit 0dab21248bc9fab09e92b0c037303c921ebb1b8d) --- sys/netipsec/key_debug.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/netipsec/key_debug.c b/sys/netipsec/key_debug.c index dcb542b22ad8..017105e78f2b 100644 --- a/sys/netipsec/key_debug.c +++ b/sys/netipsec/key_debug.c @@ -189,11 +189,12 @@ kdebug_sadb(struct sadb_msg *base) ext->sadb_ext_len, ext->sadb_ext_type, kdebug_sadb_exttype(ext->sadb_ext_type)); - if (ext->sadb_ext_len == 0) { + extlen = PFKEY_UNUNIT64(ext->sadb_ext_len); + if (extlen == 0) { printf("%s: invalid ext_len=0 was passed.\n", __func__); return; } - if (ext->sadb_ext_len > tlen) { + if (extlen > tlen) { printf("%s: ext_len too big (%u > %u).\n", __func__, ext->sadb_ext_len, tlen); return; @@ -257,7 +258,6 @@ kdebug_sadb(struct sadb_msg *base) return; } - extlen = PFKEY_UNUNIT64(ext->sadb_ext_len); tlen -= extlen; ext = (struct sadb_ext *)((caddr_t)ext + extlen); } From nobody Wed Dec 18 13:46:53 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 4YCw2k2gtsz5hMv9; Wed, 18 Dec 2024 13:46:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YCw2j71t4z4DH6; Wed, 18 Dec 2024 13:46:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734529614; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hy3sASSvNUIauhRqKXnpHTR/LgZmCMQOZm3i6nSKr1M=; b=iDBfV8NCQ4PE8QId3vFp0/4MwkPtl/MVgcPDN2n/duLBGO+NxBapfjhNbtLpcGeCFGgY0X E7Rjh0iYFtUVy11YIs2kEdAgsdVYjItz6Ikzg8dQbG78AENSpPEyRQXCydjIFeaLQNBHoN /OT8gixdo2gdSpTCnb+o4TR+O7dsqJno6+QW4NpPPTMnUYhE2cS2NN5Syn1yNnt8KmYAiV dnpigO0ZcQqG5ZJCDShYCps0ybysjsW2nwvPsXVJdpe136zMmmkMdzQLtc/vJEMlRlUWLc lwTUlqNgX8pSswRCRxGbVaVxr6YvQbSTSIu7Bm+Yd3GjpSmdOo0hCBOA43LZLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734529614; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hy3sASSvNUIauhRqKXnpHTR/LgZmCMQOZm3i6nSKr1M=; b=ekx4WUowaFmx2Qyx+CNYSXHQTgZTqYhJnJd0U+iHty7pn6vzt85kdDdAgiqPTTfv4cfZoz RnsBC3rqqT0vIksJBMhI5Kdg0utsK1w0jbvF2BafqaLoD6n7y+w82/I1Ydqk0JFhNL15Dx ea8X22Kcq4C8Z8LVgqjn1m96HGUkg6kp9S+ZDm7vnx8DEmlJN06vEynkgS3WvrABiZkUUh Xf5lN7PpMJ0EMJfL9MKCwMnk+M87lTZ3GoxpRCy/3yonnftEoXmKDO5gxnn2LGzZiL0O1M Usr370v2uh1XEytcu6ntL652kTj3YmUjPNM6+LNFoHsSe0Xm7Tp0YcQaj5NswA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734529614; a=rsa-sha256; cv=none; b=YPd+e0o4dfjzDrblwZAYFZHmoxz3hcwBOlVWkFYVsy2RxzeiUuEHAO3uzjwUelGG8k29Ao SBTYgQYyZOktRShWf6fkTMcZBZj8coU0E9R+ZTMXDh35ZDy3qFwQvPyVUPYX5jI3HxyQzD nTLBHTzmYMLpZzv7weNFxdnoqh2mrm4d09sxFYqFzjL9TlQ5WZ/Vd3dcQYQDAeuJ1gzOgE PljJyGGFQYkCwwlP3Q8l5aywdgbahjX3U7VFRPMi7BV+dqzGx4HqK3hMKbvtj3zq+3xzwt LBG2qyKADx87VQGfvLW9nihg2cymUv1HEbGMpEyJ3IIQzJ0z5KLHFSSgs9Iorg== 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 4YCw2j67XCz190p; Wed, 18 Dec 2024 13:46:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BIDkrF3019264; Wed, 18 Dec 2024 13:46:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BIDkri6019261; Wed, 18 Dec 2024 13:46:53 GMT (envelope-from git) Date: Wed, 18 Dec 2024 13:46:53 GMT Message-Id: <202412181346.4BIDkri6019261@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: 113875f91607 - stable/14 - iflib: Set the NUMA domain in receive packet headers 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: 113875f91607f385e87a54e017ac61f842df3282 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=113875f91607f385e87a54e017ac61f842df3282 commit 113875f91607f385e87a54e017ac61f842df3282 Author: Mark Johnston AuthorDate: 2024-12-04 01:13:02 +0000 Commit: Mark Johnston CommitDate: 2024-12-18 13:43:49 +0000 iflib: Set the NUMA domain in receive packet headers Reading PR 273559 made me realize that commit 767723ddebe9 is incomplete. iflib should set the NUMA domain of received packets before passing them to protocol layers. PR: 273559 Reviewed by: zlei, kbowling, erj Fixes: 767723ddebe9 ("iflib: Use if_alloc_dev() to allocate the ifnet") MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D47841 (cherry picked from commit 3d642b0f71c501dd9ee7aa0487788f619900d297) --- sys/net/iflib.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/net/iflib.c b/sys/net/iflib.c index 997da7ca5b00..93a2ca526072 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -2880,6 +2880,9 @@ iflib_rxd_pkt_get(iflib_rxq_t rxq, if_rxd_info_t ri) m->m_flags |= ri->iri_flags; m->m_pkthdr.ether_vtag = ri->iri_vtag; m->m_pkthdr.flowid = ri->iri_flowid; +#ifdef NUMA + m->m_pkthdr.numa_domain = if_getnumadomain(ri->iri_ifp); +#endif M_HASHTYPE_SET(m, ri->iri_rsstype); m->m_pkthdr.csum_flags = ri->iri_csum_flags; m->m_pkthdr.csum_data = ri->iri_csum_data; From nobody Wed Dec 18 13:46: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 4YCw2l2GN7z5hMg1; Wed, 18 Dec 2024 13:46: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YCw2l0Xbsz4D6K; Wed, 18 Dec 2024 13:46:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734529615; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IZAJi5M4QFMEtHz1Wu0f8DuyJeXF2dcbb7hDy5OI6Y8=; b=p+jLEMTRI+V9vb6F595WNk7x1xtOfOTD4LXZ6YeZzSwhwo9AunLiB1TuWrIRGn17gzXLp8 SLxu9qchvaMiWmm5D03DqZE4wpDmMWH4D53TdaGr2px0QapoYKv2J8kYlIbJ1k5SElW0Po c/i/xWWz3Ys44L528FvAhMUMrDGYb2GtMde9/7++C+rf+DsjyqUzo/wTqZ1p+YU4P4LSfO mR+uTUgyx6Vhi49O3R+dOBMzhYy7wik46to9EK5mxVEluizbYw0iRodk9Ue0QLB8ODdWk4 bbIbW5k3LoVAiLzDGGDH5Ipgt16tPlyNYGtRN4MNYs9Z0lJsThjjDDvvxspnzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734529615; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IZAJi5M4QFMEtHz1Wu0f8DuyJeXF2dcbb7hDy5OI6Y8=; b=o55W+vwzYoLd71p/Z8OPcJ/+3TTtsluYHYH+wpIlLApfbDdi/l0Sh38lXgE7Frmv0UARXP GYx6E6fNuq2sIh/xTcL0DwdasyhvaX9QNlkbYqWyfkMpdLtsZrKhs8Ztns3UJxDYdwRT1b uP4dfVI49Fo1k4nXvwTGVqno4j82/KLBJ6y8dU4uRZISXiX0lF1svebzQm+W+wudj0tM4C r3zr4rg7dncm8NjhcqUz/H3K1hdOzG2880h6eii/JP+xlmMnWUOuueDoMN71/ECb8sWPiI TvsV3rqRfE8Ff+diepmmFH/X9tjO2lYYKyKiImw6hCCtXjtTq0B7VZ+KSAzD0g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734529615; a=rsa-sha256; cv=none; b=V3RAUPRlUiY2/2tpC4MhiAoTtn6MdNvvFLMtWOEe4hSlxjcUlPzvGGpDFGXr/1+aOhiKuO uy9Z46XYGTAZH3gHhCUSArfBFQ4JcC21Tj2Tg/09D0pstcZcIcOamS7WTKiuH9Wv8ruJrY BlSHlv0/wjsRVvu+rrduphuH2MVAi+QlaEO4eq2NEzUmacFWwIeIa61Ugr3Tx37V0tft/P +iJP53Imkyo6vfcSP4xFl8blai9rRL/02iAkGdPAKgpZAqV34imlkXmtU7QNYHxlGVnJCt wXt01oWb+i0YpU5FZziIfAsX/cmZgW/jLQQdMODmIJ47lKwcV5dQ1Dug3Kfrug== 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 4YCw2k6sCHz196C; Wed, 18 Dec 2024 13:46:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BIDks66019310; Wed, 18 Dec 2024 13:46:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BIDks2u019307; Wed, 18 Dec 2024 13:46:54 GMT (envelope-from git) Date: Wed, 18 Dec 2024 13:46:54 GMT Message-Id: <202412181346.4BIDks2u019307@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: 9daf6d641922 - stable/14 - shm: Handle swap pager allocation failures 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: 9daf6d64192281f8f438d9df770927d2e599a25c Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=9daf6d64192281f8f438d9df770927d2e599a25c commit 9daf6d64192281f8f438d9df770927d2e599a25c Author: Mark Johnston AuthorDate: 2024-12-04 01:04:33 +0000 Commit: Mark Johnston CommitDate: 2024-12-18 13:43:56 +0000 shm: Handle swap pager allocation failures shm_alloc() can fail if swap reservation fails (i.e., vm.overcommit is non-zero) or racct is imposing some limits on swap usage. PR: 282994 MFC after: 2 weeks Reviewed by: olce, kib Differential Revision: https://reviews.freebsd.org/D47839 (cherry picked from commit f3b7dbdad53b31492757417fc1336ed74ec80fd8) --- sys/kern/kern_umtx.c | 8 +++++- sys/kern/uipc_shm.c | 80 ++++++++++++++++++++++++++++++++-------------------- 2 files changed, 57 insertions(+), 31 deletions(-) diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c index a900435e9d4e..0ba0876bfb1f 100644 --- a/sys/kern/kern_umtx.c +++ b/sys/kern/kern_umtx.c @@ -4484,6 +4484,7 @@ static int umtx_shm_create_reg(struct thread *td, const struct umtx_key *key, struct umtx_shm_reg **res) { + struct shmfd *shm; struct umtx_shm_reg *reg, *reg1; struct ucred *cred; int error; @@ -4503,9 +4504,14 @@ umtx_shm_create_reg(struct thread *td, const struct umtx_key *key, cred = td->td_ucred; if (!chgumtxcnt(cred->cr_ruidinfo, 1, lim_cur(td, RLIMIT_UMTXP))) return (ENOMEM); + shm = shm_alloc(td->td_ucred, O_RDWR, false); + if (shm == NULL) { + chgumtxcnt(cred->cr_ruidinfo, -1, 0); + return (ENOMEM); + } reg = uma_zalloc(umtx_shm_reg_zone, M_WAITOK | M_ZERO); bcopy(key, ®->ushm_key, sizeof(*key)); - reg->ushm_obj = shm_alloc(td->td_ucred, O_RDWR, false); + reg->ushm_obj = shm; reg->ushm_cred = crhold(cred); error = shm_dotruncate(reg->ushm_obj, PAGE_SIZE); if (error != 0) { diff --git a/sys/kern/uipc_shm.c b/sys/kern/uipc_shm.c index dad9fb23250f..e159c802795b 100644 --- a/sys/kern/uipc_shm.c +++ b/sys/kern/uipc_shm.c @@ -938,22 +938,32 @@ shm_alloc(struct ucred *ucred, mode_t mode, bool largepage) struct shmfd *shmfd; vm_object_t obj; + if (largepage) { + obj = phys_pager_allocate(NULL, &shm_largepage_phys_ops, + NULL, 0, VM_PROT_DEFAULT, 0, ucred); + } else { + obj = vm_pager_allocate(shmfd_pager_type, NULL, 0, + VM_PROT_DEFAULT, 0, ucred); + } + if (obj == NULL) { + /* + * swap reservation limits can cause object allocation + * to fail. + */ + return (NULL); + } + shmfd = malloc(sizeof(*shmfd), M_SHMFD, M_WAITOK | M_ZERO); - shmfd->shm_size = 0; shmfd->shm_uid = ucred->cr_uid; shmfd->shm_gid = ucred->cr_gid; shmfd->shm_mode = mode; if (largepage) { - obj = phys_pager_allocate(NULL, &shm_largepage_phys_ops, - NULL, shmfd->shm_size, VM_PROT_DEFAULT, 0, ucred); obj->un_pager.phys.phys_priv = shmfd; shmfd->shm_lp_alloc_policy = SHM_LARGEPAGE_ALLOC_DEFAULT; } else { - obj = vm_pager_allocate(shmfd_pager_type, NULL, - shmfd->shm_size, VM_PROT_DEFAULT, 0, ucred); obj->un_pager.swp.swp_priv = shmfd; } - KASSERT(obj != NULL, ("shm_create: vm_pager_allocate")); + VM_OBJECT_WLOCK(obj); vm_object_set_flag(obj, OBJ_POSIXSHM); VM_OBJECT_WUNLOCK(obj); @@ -1210,8 +1220,8 @@ kern_shm_open2(struct thread *td, const char *userpath, int flags, mode_t mode, if (CAP_TRACING(td)) ktrcapfail(CAPFAIL_NAMEI, path); if (IN_CAPABILITY_MODE(td)) { - free(path, M_SHMFD); - return (ECAPMODE); + error = ECAPMODE; + goto outnofp; } #endif @@ -1231,20 +1241,21 @@ kern_shm_open2(struct thread *td, const char *userpath, int flags, mode_t mode, * in sys_shm_open() to keep this implementation compliant. */ error = falloc_caps(td, &fp, &fd, flags & O_CLOEXEC, fcaps); - if (error) { - free(path, M_SHMFD); - return (error); - } + if (error != 0) + goto outnofp; /* A SHM_ANON path pointer creates an anonymous object. */ if (userpath == SHM_ANON) { /* A read-only anonymous object is pointless. */ if ((flags & O_ACCMODE) == O_RDONLY) { - fdclose(td, fp, fd); - fdrop(fp, td); - return (EINVAL); + error = EINVAL; + goto out; } shmfd = shm_alloc(td->td_ucred, cmode, largepage); + if (shmfd == NULL) { + error = ENOMEM; + goto out; + } shmfd->shm_seals = initial_seals; shmfd->shm_flags = shmflags; } else { @@ -1261,17 +1272,26 @@ kern_shm_open2(struct thread *td, const char *userpath, int flags, mode_t mode, #endif shmfd = shm_alloc(td->td_ucred, cmode, largepage); - shmfd->shm_seals = initial_seals; - shmfd->shm_flags = shmflags; - shm_insert(path, fnv, shmfd); + if (shmfd == NULL) { + error = ENOMEM; + } else { + shmfd->shm_seals = + initial_seals; + shmfd->shm_flags = shmflags; + shm_insert(path, fnv, shmfd); + path = NULL; + } #ifdef MAC } #endif } else { - free(path, M_SHMFD); error = ENOENT; } } else { + /* + * Object already exists, obtain a new reference if + * requested and permitted. + */ rl_cookie = shm_rangelock_wlock(shmfd, 0, OFF_MAX); /* @@ -1284,12 +1304,6 @@ kern_shm_open2(struct thread *td, const char *userpath, int flags, mode_t mode, */ initial_seals &= ~shmfd->shm_seals; - /* - * Object already exists, obtain a new - * reference if requested and permitted. - */ - free(path, M_SHMFD); - /* * initial_seals can't set additional seals if we've * already been set F_SEAL_SEAL. If F_SEAL_SEAL is set, @@ -1348,19 +1362,25 @@ kern_shm_open2(struct thread *td, const char *userpath, int flags, mode_t mode, } sx_xunlock(&shm_dict_lock); - if (error) { - fdclose(td, fp, fd); - fdrop(fp, td); - return (error); - } + if (error != 0) + goto out; } finit(fp, FFLAGS(flags & O_ACCMODE), DTYPE_SHM, shmfd, &shm_ops); td->td_retval[0] = fd; fdrop(fp, td); + free(path, M_SHMFD); return (0); + +out: + fdclose(td, fp, fd); + fdrop(fp, td); +outnofp: + free(path, M_SHMFD); + + return (error); } /* System calls. */ From nobody Wed Dec 18 14:16: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 4YCwhS5z0Wz5hPC9; Wed, 18 Dec 2024 14:16: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YCwhS5JwQz4K21; Wed, 18 Dec 2024 14:16:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734531368; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2DECmXeXp6q3SFUJxWbhABxqsiPbOyVErUqL+Ow2KNM=; b=H7Yj8nrDcsYsyUTfHf7jZLP1rU+wCcKhmD0tVtEvjzurqJDYUdbyQGJpbEtCrjdjqij8lE LPbvnUGLZI8Yi2kQJqRA+OFq4HTUHubB0xErzul5WP0G9pfJJJ+S6VsI4zj5vALI+OX1ex tRv+HBpHL5muVh1vqVSB/YbmGF+wtZHyMRZ6FpXKdIfhMRM6NOBYinq51gMMV7Dj/Oq/BP gcAsooPmToLx0wDpvaahE0lYdRaib9RrXoPTAO7+KQ0Zgi98SwT3AOdQmU2rYKCJaeS44T FXHncWx618fMFfMBhfQw+Qdp0IUZE3MFGwtRIwjvuS+Nj2dT4qJwqwy9V4ijXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734531368; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2DECmXeXp6q3SFUJxWbhABxqsiPbOyVErUqL+Ow2KNM=; b=kRkPtu3PtEyYrCB454Ko4znf4z5LePp8nbWnt/GbMFpGepXqv+4Bm+SFYec1M3yJUvfm2Y fqnNer99ok8gjh1isUcrrzPLaNDls/03IT9rZPlefYYrqlLVMLSLZHPYx4PDrKARwacNxj 3zEXI7mawZQOIHwy/+dSfrLGVDbEZ0X1RIsEdQCS+oYE5u/gWDj0QGol9DmmqrvqjGeWST 1cECV1dnebx7OarUbYXUQORKPxMJLuNEoZoQMd/t+rkHHYeqfULJrOCXL1ShhEFDueH7IK 0t+Wez1/BUoSo/gEgFQSP9rGktMQ6mS+OWefiBCRwVlzRlw/WXWrAfoKhY/KoQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734531368; a=rsa-sha256; cv=none; b=a49f70NJZ7zGSNpePGGOaGNSdZlm6++pCAsatrY9vzCJ+RzMrErJYGZ/DINnY7xaB/OsZS IKW7euTs5Qt9ra3d+7f/YnihNy1/oT+KAyMmXIkPUBgvFiEHDR4+Mh7DMqYcuYFDfGOhKK IuRx6k1VUPTwFv3skbxeDVyhIV/aJr0LvHZD9HaztJgUaGv3WKMv5/B2GbnHQJyI7iupAw O0sVuYtAaLtC8EpX3Y6okiuTsjfCK0zD5D7B/V5fh6YhPXoVg7VHZPlxVodLdio3G1d544 glyl5qP6lJj88G09VLJygCBqqQop+Ptd92KykymBJWojewTlUIQwXnA01ctAlw== 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 4YCwhS4p7Gz1B0j; Wed, 18 Dec 2024 14:16:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BIEG8wZ075636; Wed, 18 Dec 2024 14:16:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BIEG8Vc075633; Wed, 18 Dec 2024 14:16:08 GMT (envelope-from git) Date: Wed, 18 Dec 2024 14:16:08 GMT Message-Id: <202412181416.4BIEG8Vc075633@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: 11c7eb30cc9b - stable/13 - pfkey: Fix some checks in kdebug_sadb() 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: 11c7eb30cc9b38d199c4686ad00071a678a1fc58 Auto-Submitted: auto-generated The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=11c7eb30cc9b38d199c4686ad00071a678a1fc58 commit 11c7eb30cc9b38d199c4686ad00071a678a1fc58 Author: Tobias Heider AuthorDate: 2024-12-04 01:13:41 +0000 Commit: Mark Johnston CommitDate: 2024-12-18 14:15:46 +0000 pfkey: Fix some checks in kdebug_sadb() Besides not doing any sufficient check that the length of a parsed message is not bigger than the actual allocated buffer, kdebug_sadb() incorrectly compares ext->sadb_ext_len, the extension payload size in 8 byte chunks, with tlen, which is the full message payload size in bytes. This should compare PFKEY_UNUNIT64(ext->sadb_ext_len) with tlen instead. PR: 277456 MFC after: 2 weeks (cherry picked from commit 0dab21248bc9fab09e92b0c037303c921ebb1b8d) --- sys/netipsec/key_debug.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/netipsec/key_debug.c b/sys/netipsec/key_debug.c index ab4def455ac9..ef511f25411c 100644 --- a/sys/netipsec/key_debug.c +++ b/sys/netipsec/key_debug.c @@ -189,11 +189,12 @@ kdebug_sadb(struct sadb_msg *base) ext->sadb_ext_len, ext->sadb_ext_type, kdebug_sadb_exttype(ext->sadb_ext_type)); - if (ext->sadb_ext_len == 0) { + extlen = PFKEY_UNUNIT64(ext->sadb_ext_len); + if (extlen == 0) { printf("%s: invalid ext_len=0 was passed.\n", __func__); return; } - if (ext->sadb_ext_len > tlen) { + if (extlen > tlen) { printf("%s: ext_len too big (%u > %u).\n", __func__, ext->sadb_ext_len, tlen); return; @@ -257,7 +258,6 @@ kdebug_sadb(struct sadb_msg *base) return; } - extlen = PFKEY_UNUNIT64(ext->sadb_ext_len); tlen -= extlen; ext = (struct sadb_ext *)((caddr_t)ext + extlen); } From nobody Wed Dec 18 14:21: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 4YCwpS2gz5z5hPLJ; Wed, 18 Dec 2024 14:21: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YCwpS20nzz4KPd; Wed, 18 Dec 2024 14:21:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734531680; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=S6aFZ+lTCg5M5guVW/rgyBSoytUf6aIwCO7ccpN8nO4=; b=EiySBpEFwjnrhM8a6U3V112svlIl51TtNxmQtmAAWR6jJ4MlKL2LB0xFzB4i+zi2OZW6G6 JPVdnQwoRkLXigpEC1O+qLiPNprVwyg6cvBoTwZnpYWk0hwSi4rWXJwdXM+52LE+nvIRXP Q/S92juGPzK/3te2Vj3mkjXqE+k09hjp9JsSJMKxvKF/09v5FtnOhvJHAF9+VDlYo/IlAH orpG7xWso9posUqx8RmPwEzB8G1b8bmdRVNjbHb862UPdiFMrNGqXC3ui/rJNdneZiT692 aVyn464PUWJqIgUWT6J/jz/bfJGQhBRNmN2HzowAw5D0QNbBFTv7r0pERtyWYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734531680; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=S6aFZ+lTCg5M5guVW/rgyBSoytUf6aIwCO7ccpN8nO4=; b=FCyA6rCQJ8OzT2aTUDDb1dWTz9Z669rXm8bh24UyBCE6Fl/3lINsBMoEHtF8ABPBTd4/7P 3UJdHLATcHfefK3qBXv6Q6qxsThx1ow1noYZLzvspAPHTwisgRoqSf95RVamFxbTKqrAZ5 LAsXDmMPtj0btaStb2U6xCSXG12QX7uTztWYNAcTnIyUccQW9jD18wzj3JGAChO1jFTTx+ Iye+BLK3nwhx31CIbvjFynyatoMdHqh/vGiif5hWyxn4UYmUzMa7pgmWiOq+E6WAn7XLQ9 86bn+y+xcXz8E93KZUNFC7moHEjV3QGAl1JMJhMT5AZvJ/y1gxnH3lPN6i/v1Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734531680; a=rsa-sha256; cv=none; b=EhuVtYxYcsnVnLwDN9zDjO1FsXTKxTHex/Wyzn2JC4stUpPE1OBEfQNpz6yHhfLmyZRvUA SJor6eh69C9De2MNzpoVzw92555/tPk6idTLLYgRyMFe718XZpmRwuhsROBem5L9gfguTD DUpEMeCWQ6s8ntqF1FMRSwDmvEpr3j/MSXohFAFWYTmlS1/I+HVHzK8vGRdy8gQzpj2gTV ea5s4Kl5x+w59m2KyHCbqK5a8ZlQPwFjJaRkowLQ420NZHZABQ9DLHvlBPhVX8Z7x/y8Hb /BfiEawiIiVU50j8zbAfAoAoD389r/BQ4ZzUoVJ77QkahLh6PNUwwUF5B6w4cA== 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 4YCwpS1Vm9z1BDv; Wed, 18 Dec 2024 14:21:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BIELKu9089411; Wed, 18 Dec 2024 14:21:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BIELKwP089408; Wed, 18 Dec 2024 14:21:20 GMT (envelope-from git) Date: Wed, 18 Dec 2024 14:21:20 GMT Message-Id: <202412181421.4BIELKwP089408@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: 705337455f06 - stable/14 - amd iommu: remove unused function 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: 705337455f0622223fc58a78a77ea1a536d746a5 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=705337455f0622223fc58a78a77ea1a536d746a5 commit 705337455f0622223fc58a78a77ea1a536d746a5 Author: Konstantin Belousov AuthorDate: 2024-12-15 22:49:52 +0000 Commit: Konstantin Belousov CommitDate: 2024-12-18 14:20:41 +0000 amd iommu: remove unused function (cherry picked from commit 58d1fdfaa90a5365a5f951e2ac80e0fce02ca9bb) --- sys/x86/iommu/amd_drv.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/sys/x86/iommu/amd_drv.c b/sys/x86/iommu/amd_drv.c index 72aae58334f2..04e5444b0b46 100644 --- a/sys/x86/iommu/amd_drv.c +++ b/sys/x86/iommu/amd_drv.c @@ -80,12 +80,6 @@ static int amdiommu_enable = 0; static TAILQ_HEAD(, amdiommu_unit) amdiommu_units = TAILQ_HEAD_INITIALIZER(amdiommu_units); -static u_int -ivrs_info_to_unit_id(UINT32 info) -{ - return ((info & ACPI_IVHD_UNIT_ID_MASK) >> 8); -} - typedef bool (*amdiommu_itercc_t)(void *, void *); typedef bool (*amdiommu_iter40_t)(ACPI_IVRS_HARDWARE2 *, void *); typedef bool (*amdiommu_iter11_t)(ACPI_IVRS_HARDWARE2 *, void *); From nobody Fri Dec 20 22:08: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 4YFM4d34Qvz5h3sy; Fri, 20 Dec 2024 22:08: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YFM4d2b8mz4bgL; Fri, 20 Dec 2024 22:08:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734732513; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cDH1f30AO4Ci+C6RzlwbAsDeWHArjAosyK7lZy9JIKg=; b=AP0QgdNmPchvqunySsiT7FhzYFNLYrvJHQRp8cKRJYPqjq6rVDhUXwa5ZfVaapKOyNU8u2 Og6Wf4enT+SrvryKx1yRHMbUARK53Anq7F52fW9ItVCHmeFzb8fy92kV66xpqU3mt3/UYq 6pIX6pWTdwAWoY/4AYrzWgZeArP4ayXHr+xlb5zht2Iv9qZvrs6ZXD1T1aL9HU5xHeVZd4 dY5Sb6btNxJBldDRchdGcU1/3k9Lq2Q6WRFvExKLRT5feLGWSEWxFpc+Wb5OMnDXqUDU8D MWxUMn1X1xN1PNYjmQtr2HNvlcZfVU9BnK4v+bKo3M23TbQ6ygSWlwpz0h8heQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734732513; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cDH1f30AO4Ci+C6RzlwbAsDeWHArjAosyK7lZy9JIKg=; b=fE9FW4k7FSsMHAlXKFHS78H5K9r55HwKePbVoglenOi/zNme6shYnwSlEnqbOyBAXkE8wO WJdJJaKkYFfpE6T2g6mrMg6OVhNZRsbdP9Wlozbhg5ycMBIszTMeN4aCS16mxYMHmus6Dd Yk/93d0gzhn9Q0FoSAHt8xK4+uztk8cST8c073TyreADFnvzomkyyg6dqHkm42c7msqVRP JUL4SbBScVyUZdx5ZYPdv986Ssn7cxlnaAMZxrjJ7tzpJjBzd0JA5PciiIvKJiQf/qN7w/ APzJ+eNlcwLPlQeInClaHlz6F0tk2wROt107EqtM08/cI7CWHvHLPANhNyvQ0Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734732513; a=rsa-sha256; cv=none; b=IVfmFix9yV7t5aX6ZS9bQUSPBM3uU8FfqRWUzRwaB7DP+XDebtLnxhk1S4Lw5t8LGkr6+A WtwOSRt0Z13xWao/V+9k2U6oqWvWLK97X6gWhEA5T0fKOuZvBgBXOLdtA58nQivZbeaB0A v3Qmn7p9xU+Azape9LvYyIysMyGUIhZBuYzkIeb2jcTwN7UV1pxJhFV5RjIIAUS5vFV/b2 HXCi75WFfTQqDA7K6qcAbli0T0N03CFyAzkwskMcPpcZBfC5oU/OsKZNbK7HPlzeBLLhdb PZyf1wp66ysUT6QDOiusntIZQ+bEbz6QHzAXBaz6RWJqPGsWj04hApnxCF9zaw== 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 4YFM4d1tF8zwHB; Fri, 20 Dec 2024 22:08:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BKM8Xjq038575; Fri, 20 Dec 2024 22:08:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BKM8XXh038572; Fri, 20 Dec 2024 22:08:33 GMT (envelope-from git) Date: Fri, 20 Dec 2024 22:08:33 GMT Message-Id: <202412202208.4BKM8XXh038572@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: efe6a0997383 - stable/14 - fs: Add static asserts for the size of fid structures 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: efe6a0997383d728290cd01c07d9cf59adc2ed05 Auto-Submitted: auto-generated The branch stable/14 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=efe6a0997383d728290cd01c07d9cf59adc2ed05 commit efe6a0997383d728290cd01c07d9cf59adc2ed05 Author: Rick Macklem AuthorDate: 2024-12-06 01:56:23 +0000 Commit: Rick Macklem CommitDate: 2024-12-20 22:07:12 +0000 fs: Add static asserts for the size of fid structures File system specific *fid structures are copied into the generic struct fid defined in sys/mount.h. As such, they cannot be larger than struct fid. This patch adds _Static_assert()s to check for this. ZFS and fuse already have _Static_assert()s. (cherry picked from commit 91b5592a1e1af97480d615cf508be05b5674d2f3) --- sys/fs/msdosfs/msdosfs_vnops.c | 2 ++ sys/fs/tmpfs/tmpfs_vnops.c | 2 ++ sys/fs/udf/udf_vnops.c | 2 ++ sys/ufs/ffs/ffs_vnops.c | 2 ++ 4 files changed, 8 insertions(+) diff --git a/sys/fs/msdosfs/msdosfs_vnops.c b/sys/fs/msdosfs/msdosfs_vnops.c index 078ea5e52312..6417b7dac16b 100644 --- a/sys/fs/msdosfs/msdosfs_vnops.c +++ b/sys/fs/msdosfs/msdosfs_vnops.c @@ -1962,6 +1962,8 @@ msdosfs_vptofh(struct vop_vptofh_args *ap) { struct denode *dep; struct defid *defhp; + _Static_assert(sizeof(struct defid) <= sizeof(struct fid), + "struct defid cannot be larger than struct fid"); dep = VTODE(ap->a_vp); defhp = (struct defid *)ap->a_fhp; diff --git a/sys/fs/tmpfs/tmpfs_vnops.c b/sys/fs/tmpfs/tmpfs_vnops.c index 206a95350d2e..4571a2855be3 100644 --- a/sys/fs/tmpfs/tmpfs_vnops.c +++ b/sys/fs/tmpfs/tmpfs_vnops.c @@ -1687,6 +1687,8 @@ vop_vptofh { struct tmpfs_fid_data tfd; struct tmpfs_node *node; struct fid *fhp; + _Static_assert(sizeof(struct tmpfs_fid_data) <= sizeof(struct fid), + "struct tmpfs_fid_data cannot be larger than struct fid"); node = VP_TO_TMPFS_NODE(ap->a_vp); fhp = ap->a_fhp; diff --git a/sys/fs/udf/udf_vnops.c b/sys/fs/udf/udf_vnops.c index 98a779280690..88bf4917a851 100644 --- a/sys/fs/udf/udf_vnops.c +++ b/sys/fs/udf/udf_vnops.c @@ -1274,6 +1274,8 @@ udf_vptofh(struct vop_vptofh_args *a) { struct udf_node *node; struct ifid *ifhp; + _Static_assert(sizeof(struct ifid) <= sizeof(struct fid), + "struct ifid cannot be larger than struct fid"); node = VTON(a->a_vp); ifhp = (struct ifid *)a->a_fhp; diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c index c14cb5e1ee66..0f60f8061043 100644 --- a/sys/ufs/ffs/ffs_vnops.c +++ b/sys/ufs/ffs/ffs_vnops.c @@ -1922,6 +1922,8 @@ ffs_vptofh( { struct inode *ip; struct ufid *ufhp; + _Static_assert(sizeof(struct ufid) <= sizeof(struct fid), + "struct ufid cannot be larger than struct fid"); ip = VTOI(ap->a_vp); ufhp = (struct ufid *)ap->a_fhp; From nobody Sat Dec 21 11:51: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 4YFjLD34WDz5Z2M4; Sat, 21 Dec 2024 11:51: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YFjLD2Nncz4vSC; Sat, 21 Dec 2024 11:51:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734781892; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ONNhgqiZbHvJ6mOvcBSta3WNkuVthtmEatdsadfUL68=; b=C2yvutjGsUMWOfBBA9OnjijsVqHLFnpbGYfZPyBK78IQshaQ8nceYHPXxUYw6bjHELcdym nN6l+xxjeAnr20MPqJYVnm3fT0yA7K8jpg8W0K63ILY04Jpd+jf8+SN+jpQN5mYl5TUSZS aHczf/rgIxROgR9i9ATvPSzadk3QkIKJ/jwCeA683+iICwo+CdbuBps2ER4EvZQYcJ3zCJ yW3mE+gRLIMftuvZFZBfxti/geICyh31zoQQ16KAlqDXKiNNr/2YP6rhC4eF8cTkQp3jx8 rjiZvVjmoIyu9f0sHR1I5uIVLJKQ1R6CIx12vryjbXbtt/NfCSoE2plQs3QLTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734781892; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ONNhgqiZbHvJ6mOvcBSta3WNkuVthtmEatdsadfUL68=; b=jDBJ9OtdKX84vT8lGaR45HBLmKETykQeVQTiHaXFul9J+xYWqnWu5TTAbfwMty3Rm67ut/ FvQTorlZLxsc459jDPkwLuTL16bVbZP1OQribUoeSK2k8+QFjac7OKbf7mc6HBRKc3NY6h 4/Q/LF49LTxJqPIwgKTpbXUSJ4+GwjDkAgb7w81GbDqNQkBUIvLGLACTeZ1oNkI0mjboto qd1Wk0hYMRuoivRG6OQwK3jnzZ1wNGO44f0BQLj/ObCltDyJp3dhZGB86qzxl9/C8VZvKk GJab16+CNyPQuXIyCFzIZZbYwuqfSYpTnwYXCjo0NY+FlbS+DHS0vygoGOJCtw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734781892; a=rsa-sha256; cv=none; b=jJynQW/+AnfVIOepqFhAnddwhH3b/fYgjn+Xhl73dqXyHTIEaTJ5oOmzDJM9vzLYSF8PtX UmEs6e+1hInPQbFSNWTNMZYHHUjYjJuXvFIyaUFVwmgvzWEWqNF9dC1ZAmuI8t8CtWvE/A z54o7JPdJb0GCnWl7ddIpiTPCU08aCZLFw/1k70nAV5e4zRgsyfTWGhNzTrirIyKjPa6AB +tcZz9vcCauNKh3/B80hPmXHm66e4exC455agAjQUjXpHGHwuiNkqvO2zjYOH9AWisU3jU DmPTevLIvjisWwvQPQKGYPf1hl1Lo2fxDML1L6LIHNh5PzXXfvGYDcsK9cxjyA== 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 4YFjLD1vjGzMWC; Sat, 21 Dec 2024 11:51:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BLBpWhU084764; Sat, 21 Dec 2024 11:51:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BLBpWQO084761; Sat, 21 Dec 2024 11:51:32 GMT (envelope-from git) Date: Sat, 21 Dec 2024 11:51:32 GMT Message-Id: <202412211151.4BLBpWQO084761@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Morozovsky Subject: git: 859e098fd187 - stable/14 - services: fix typo ucp -> udp 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: marck X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 859e098fd187a6c85afb5070e8ae1c2ef49e3e60 Auto-Submitted: auto-generated The branch stable/14 has been updated by marck: URL: https://cgit.FreeBSD.org/src/commit/?id=859e098fd187a6c85afb5070e8ae1c2ef49e3e60 commit 859e098fd187a6c85afb5070e8ae1c2ef49e3e60 Author: Dmitry Morozovsky AuthorDate: 2024-11-30 21:53:47 +0000 Commit: Dmitry Morozovsky CommitDate: 2024-12-21 11:50:35 +0000 services: fix typo ucp -> udp Fix two proto name typos MFC after: 2 weeks (cherry picked from commit 7aa7f4b5c324a0f698b3ae1e39856cc087a14e0c) --- usr.sbin/services_mkdb/services | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/services_mkdb/services b/usr.sbin/services_mkdb/services index 12c411e8c9c0..799778c3c365 100644 --- a/usr.sbin/services_mkdb/services +++ b/usr.sbin/services_mkdb/services @@ -479,8 +479,8 @@ td-service 267/udp #Tobit David Service Layer td-replica 268/tcp #Tobit David Replica td-replica 268/udp #Tobit David Replica manet 269/tcp #MANET Protocols [RFC5498] -manet 269/ucp #MANET Protocols [RFC5498] -gist 270/ucp #Q-mode encapsulation for [RFC5971] +manet 269/udp #MANET Protocols [RFC5498] +gist 270/udp #Q-mode encapsulation for [RFC5971] pt-tls 271/tcp #Assessment (NEA) Posture # 272-279 unassigned http-mgmt 280/tcp From nobody Sat Dec 21 11:55: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 4YFjQb56qFz5Z2Zx; Sat, 21 Dec 2024 11:55: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YFjQb4XGkz4vZj; Sat, 21 Dec 2024 11:55:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734782119; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/vXsTa12jv3FRGrVbyDHmVdwqj7XMqX9xIVd0Qme2cQ=; b=F3Dj+r6+q1XuOS7cnCaMi2CCNyV5yhyt5kqyXhIf49LVxHISSnV0bF4o8c9NiyQ5qLFq5C Bt3u3CJqatj5ZnmxteoIB4ZK99ZBHvHoAUTiVQGjcoZTMUHFYurQ5At28OCAYgLJI2M7RH rkCTu/rAclsaSC5u8b4A5LczlPKoR01VTaxs5JPh73YAwmNYnQpo+KosHNgeeDlwLW2w4J +DAvL3JRT5vPmsW1a42EsdmC+xC32Q/4tb0YbNpPaPz5V+l9uMLhDMklmhO8wEblWFP4cf KgbmXTvPOM1LG7HErPX2btcqUsOahXzuV/WKgThVUKXSWMRsWU2MuEogEiyHTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734782119; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/vXsTa12jv3FRGrVbyDHmVdwqj7XMqX9xIVd0Qme2cQ=; b=ajUV2dbWK/q/Fd6gCRJVX+y0Q/8JQFWZITJVjebVCcgLPd7IwKz69Ehc2eYJ6hRMv1XaYC YuC4QDCZrSWB/NNs1sLfaRcyuiWfstxwVYku3vKlda6FEHs0fI9Do3Qrvt9J6Rul/gq1Hq eVcqYAX1MC0ADiDrjV8iu5r27G9jgNZxIyMsyN5eAe7TAajPYGaqbulfLM0W0Z/MysXoOE /XaQLXlMWAHp3wdQecruAPFRI4L6HpKND8pwq9xa77DSgj07E0XX6FIkQOT1/0BlqdUFlU dNdGF3XYc/3x67aiQj9lXfvo6G7d8HPIiXI2JohHNCWfiJw5U7kDlYLlSHxE4Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734782119; a=rsa-sha256; cv=none; b=nOY3oiHYFcAfz2usRJOTcL0u8jithsNUEoYw1BV1K74iNKfhKBJj2qd+Xfv3g+TEz99HeE Mo4YabMTGAGfUgywhUeSCmqkOrTQZs6D/EDBFCHAUfeojgwltLHYzJcVz4s3ZX5gGwK8jO rGVMj+4HZahq0CPYfhypVNUIwYpf2Rhe3SvvvtfXYfsYkRZyqhZ5C5WPcr1KLuJr2BVYbm NpQAYZl00fm0I0O9x04y88V0gxdHcHTtniDMgT1dLdNwxNQpE1lCM/rrg58s0USC/pK2E3 yNTKACE1ZtFP/Lq6dKPdCZCbytsPxGagez3g+UoUcIQs1xMfuEPVvnetM0QMNQ== 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 4YFjQb47GMzNS7; Sat, 21 Dec 2024 11:55:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BLBtJPH090652; Sat, 21 Dec 2024 11:55:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BLBtJ4H090649; Sat, 21 Dec 2024 11:55:19 GMT (envelope-from git) Date: Sat, 21 Dec 2024 11:55:19 GMT Message-Id: <202412211155.4BLBtJ4H090649@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Morozovsky Subject: git: 15d5f84b1b7c - stable/13 - services: fix typo ucp -> udp 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: marck X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 15d5f84b1b7ccf6eebcff184b8e5f841a48c69ef Auto-Submitted: auto-generated The branch stable/13 has been updated by marck: URL: https://cgit.FreeBSD.org/src/commit/?id=15d5f84b1b7ccf6eebcff184b8e5f841a48c69ef commit 15d5f84b1b7ccf6eebcff184b8e5f841a48c69ef Author: Dmitry Morozovsky AuthorDate: 2024-11-30 21:53:47 +0000 Commit: Dmitry Morozovsky CommitDate: 2024-12-21 11:54:51 +0000 services: fix typo ucp -> udp Fix two proto name typos MFC after: 2 weeks (cherry picked from commit 7aa7f4b5c324a0f698b3ae1e39856cc087a14e0c) --- usr.sbin/services_mkdb/services | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/services_mkdb/services b/usr.sbin/services_mkdb/services index 12c411e8c9c0..799778c3c365 100644 --- a/usr.sbin/services_mkdb/services +++ b/usr.sbin/services_mkdb/services @@ -479,8 +479,8 @@ td-service 267/udp #Tobit David Service Layer td-replica 268/tcp #Tobit David Replica td-replica 268/udp #Tobit David Replica manet 269/tcp #MANET Protocols [RFC5498] -manet 269/ucp #MANET Protocols [RFC5498] -gist 270/ucp #Q-mode encapsulation for [RFC5971] +manet 269/udp #MANET Protocols [RFC5498] +gist 270/udp #Q-mode encapsulation for [RFC5971] pt-tls 271/tcp #Assessment (NEA) Posture # 272-279 unassigned http-mgmt 280/tcp From nobody Sat Dec 21 17:06: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 4YFrK70RDDz5hPgV; Sat, 21 Dec 2024 17:06: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YFrK66txCz4PM8; Sat, 21 Dec 2024 17:06:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734800763; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rvpezruvHW3Kcf2HkC5evs3YFdNDMG0Tt4HMPYYM4L8=; b=QWx6xUoZT8NeAiKnQmxkF9e9CGiFE1w0FJnAdtgnaA7GQgRULBKrGKYCfRPgnEDkv7Ik9L sHtl8vZHxm2nIbyWbZbNMqUKoTSAY4I8xB4ixq271FXr+6O6O65HhL784glJ+CVEgj8XGV 6N/iLbkH4ABBTMtgh5wPKKVwlU1TDvddK83dGzBH3LSl6o69yxbrkrmZ1W1zlMytCOIyY8 LXQIxKPyJbLQ9hEfd1TKV8xi2Jdfdl9QvaZA4S31cHWhZF6lLgodm3WI/yAvqy9CDf9wm1 bp9fQYOVcSDiEnMlS61oiQHLpe7FAeaXfdN46bAE7qpl19rmj9D9Qapxvdb9mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734800763; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rvpezruvHW3Kcf2HkC5evs3YFdNDMG0Tt4HMPYYM4L8=; b=veCBaWa27Nk+Lq2l/W11vFRdt5MZCzUSesw4GQfcU6t+06V8j8EZdUYpdCybdOvj34A4md DdyvFMQoRt8hZNvW30CcaPKPMAXaSzcjewoTFgYWHpiUR8gU70dfG2z8IPeiXi7IL/Am2i JgiWFrCEPB6PA4crmdRKMYGzY7kZiKtq5qIl/W8FQTaO0mU+muSFNNU3HltNkJL8fGw52L oMn+RQ//yYid3vR6vyhsGqeM2sVG4pwKI9Z6h2STtWVOT8JGJJKf5vy8198Xt7RXhp+HmG 34sP7j0+4rSDHd0tzHqZhABsdDeXVQEbni8f3FrFNfdtHhcki+P1zf1D8iNDGA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734800763; a=rsa-sha256; cv=none; b=grcWFxPzLOAQ7T365UZY3rT/ns12ueoZe44WMTE6OD/BFLQhDDz4JJG9zc2Gp7dXJPPh7m 71hjQtBfAm+unvc2C2bV4WmC8dnO4clFuvx7VuxpPqYPrriWc6WX47dp4GTlSr/Rv3wOtb wLm6IfVI/lyRn6hMcX9BL04C4e++mbZkfWTpUQkdBXI7p5pkxjhUkmRTqbkzcMtTKxBxTB hghdtGVPhRWRwc6E6ac1fqSa4O6GuV6AzEK5EfxKwWJVTIiPFD5UrJ3Cd7+24GPMavFeaF njnL+x/KmjBW68zHfEP+Q3BkuDksG1sKhmkTKRe21qSm98/A2Rtv2dHA5vOenw== 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 4YFrK66B0FzYHh; Sat, 21 Dec 2024 17:06:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BLH62vC071150; Sat, 21 Dec 2024 17:06:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BLH621Q071147; Sat, 21 Dec 2024 17:06:02 GMT (envelope-from git) Date: Sat, 21 Dec 2024 17:06:02 GMT Message-Id: <202412211706.4BLH621Q071147@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: a7d56527c2fd - stable/14 - geom: Allow BSD type '!0' partitions 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: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a7d56527c2fd0730eea2551087c3b785691603b2 Auto-Submitted: auto-generated The branch stable/14 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=a7d56527c2fd0730eea2551087c3b785691603b2 commit a7d56527c2fd0730eea2551087c3b785691603b2 Author: Jose Luis Duran AuthorDate: 2024-11-17 23:55:14 +0000 Commit: Jose Luis Duran CommitDate: 2024-12-21 17:04:07 +0000 geom: Allow BSD type '!0' partitions Allow the creation of '!0' partition types. Fix it by not considering "0" an invalid partition type. Reviewed by: emaste Approved by: emaste (mentor) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D47652 (cherry picked from commit accf71534c612b76ee2701f2dfcaa464748e527a) --- sys/geom/part/g_part_bsd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/geom/part/g_part_bsd.c b/sys/geom/part/g_part_bsd.c index bb1aed0cf59d..625cdb4c727e 100644 --- a/sys/geom/part/g_part_bsd.c +++ b/sys/geom/part/g_part_bsd.c @@ -136,7 +136,7 @@ bsd_parse_type(const char *type, uint8_t *fstype) if (type[0] == '!') { lt = strtol(type + 1, &endp, 0); - if (type[1] == '\0' || *endp != '\0' || lt <= 0 || lt >= 256) + if (type[1] == '\0' || *endp != '\0' || lt < 0 || lt >= 256) return (EINVAL); *fstype = (u_int)lt; return (0); From nobody Sat Dec 21 17:06: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 4YFrK83Jn2z5hPnV; Sat, 21 Dec 2024 17:06: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YFrK814Lrz4PZS; Sat, 21 Dec 2024 17:06:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734800764; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=taZW+Qwd73GHflGWtu+xN6zI50kc1WUGRlXBmRcrB4o=; b=jCHBeRJrDs8k8u+6l+a0i3cuY8Ng49rfBskupz4OOc0eFe50BfneIuW7kyG9xPPixv0KM2 s0tijtuC5ludMWMsdRmr3SUPsQJzlSW/eGoLDhoKHnm/fLOjpMM/btSViYqcz77SmFmLmT qVHF3TX3PVs7p9MZmAUWtv8RxGn4D88spEj7egfN+BUEsog70XrdDncBDhAmVkGkTZjnkw w+K3yOG5XBedvTbAv9wYf1PGe2BRhGpeCcqjc8aSVjv+YviIcefm4MzWBQ1shkKvlz5h/C xNa+OYN1vaGAapEob2qSXmxgWaJaXW4K4kPUTyQMjExYi1ivBNtDomLh+3D7Tg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734800764; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=taZW+Qwd73GHflGWtu+xN6zI50kc1WUGRlXBmRcrB4o=; b=IEHZeuHg+cJs4Pyl3oSyc/MY/HQJAkFCAVDp4k/GxLTXy9ewQyAZEWF/6wB0hZWdcaUah7 EGPjEgya7KcObhsbeuqZyOW2Omcu71oMiwO07zMGl5HRfI+3n3ABcvAeStS8htIixJ2J2A KW3NL3XCKd2KZvEzv2dO4d8AVnxhvMhLAuEUCnWK1vyCQJiaf4QWWF5KmeUbIabALGtA5F Ox38SXKqcjpjXDX2QX7quxej64lKxOAw1aXZQG7JxlyGRgxJ9gvMbi8DJm5imeTTTh+OIK VEl9F2cVRM4nE/kXMG1m+MHvA0Z5E7pKrBUlRc6BCEoTKOGfIRgwFOt2vT1Ogg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734800764; a=rsa-sha256; cv=none; b=tBUls9YjEqonx6Xkk0au8lLP7DXLgEDpPfZ/Y+k3xED8aVq7I3C1M7uLDJVCWE8mU+e49b Cgw3TRSc4PCVJeoT3r38xE7FPHa/PZ6U50v/UainKilhrUsGSLAa4TRWvuvo8YhLD41ntD fum+BuISUd1zEzoigpO7AjnMJttauDhWPOoq/c7o8sDrZqPXkIcE8v3x34ppBzfFJPTRnm vu7cCZAF1b7NKQ7l2BGbd967lnFJH9X+Co3Wdei7jytrQxGvSloHAvhZuw1sYI6iaQmCNC kit+DreMxHKiN1cIuOluSwigaKuWmDh2gdSvQlFvb7SP4eqsYwJ2yMFgYlDphA== 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 4YFrK76x2tzYMd; Sat, 21 Dec 2024 17:06:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BLH63Zn071201; Sat, 21 Dec 2024 17:06:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BLH63Fe071198; Sat, 21 Dec 2024 17:06:03 GMT (envelope-from git) Date: Sat, 21 Dec 2024 17:06:03 GMT Message-Id: <202412211706.4BLH63Fe071198@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: 0520d2ea9dd3 - stable/14 - nanobsd: Remove dependency on bsdlabel 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: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0520d2ea9dd37fc968f02e615b53bfe4521af789 Auto-Submitted: auto-generated The branch stable/14 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=0520d2ea9dd37fc968f02e615b53bfe4521af789 commit 0520d2ea9dd37fc968f02e615b53bfe4521af789 Author: Jose Luis Duran AuthorDate: 2024-11-18 00:16:50 +0000 Commit: Jose Luis Duran CommitDate: 2024-12-21 17:04:24 +0000 nanobsd: Remove dependency on bsdlabel The bsdlabel utility is deprecated, gpart should be used instead: - Offset the first 16 sectors, just like bsdlabel did (used for metadata) - Use a freebsd-ufs partition type (regardless bsdlabel creating a '!0') Reviewed by: emaste, imp Approved by: emaste (mentor) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D47653 (cherry picked from commit 87e87fecb139d60a00837f004de0d37dbecd205c) --- tools/tools/nanobsd/legacy.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/tools/nanobsd/legacy.sh b/tools/tools/nanobsd/legacy.sh index 58288d063b4a..a45b447337b2 100644 --- a/tools/tools/nanobsd/legacy.sh +++ b/tools/tools/nanobsd/legacy.sh @@ -116,14 +116,15 @@ create_code_slice ( ) ( trap "echo 'Running exit trap code' ; df -i ${MNT} ; umount ${MNT} || true ; mdconfig -d -u $MD" 1 2 15 EXIT - bsdlabel -w ${MD} + gpart create -s bsd "${MD}" + gpart add -t freebsd-ufs -b 16 "${MD}" if [ -f ${NANO_WORLDDIR}/boot/boot ]; then echo "Making bootable partition" gpart bootcode -b ${NANO_WORLDDIR}/boot/boot ${MD} else echo "Partition will not be bootable" fi - bsdlabel ${MD} + gpart list ${MD} # Create first image populate_slice /dev/${MD}${NANO_PARTITION_ROOT} ${NANO_WORLDDIR} ${MNT} "${NANO_ROOT}" From nobody Sat Dec 21 17:06: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 4YFrKd0PJ6z5hPhm; Sat, 21 Dec 2024 17:06:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YFrKc5mqsz4PrV; Sat, 21 Dec 2024 17:06:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734800788; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iRZnFjGyb7iLF1yNdwSnJ0iASq5r5DJlMTL64SPrWwo=; b=aT0xGkKPa0RfGvGoCB+RHoDwTh7Ae3yltx1OefDG7lul7m2Fg7Jyc9qBieIzIfLFCPmRDt Als8VJpMK16Pxlu6KGQc1riePpE61BmfO6pkB05ytpbPxmRakNTiHTlIGSo9MXFf4os/4P f8ajuXxLnEA1ZH2V9cWuBilJ+agnzsnXuGXyKY25Z/W05YSQlitQVYroi6hzaZeMIx6hcR B5S6ehkKLPEgwTAW24Y9mtC4ZSwXk518DdFzJtlffiFDdfrWrCQaMXVC50f328iOS77rPX zxX8Gu1iri9RK1pu844WbpD0EciU83h1q+Hjw/+KgeoJlhb65ttBOjQbShsTwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734800788; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iRZnFjGyb7iLF1yNdwSnJ0iASq5r5DJlMTL64SPrWwo=; b=kevncvXj6pFUrPvPc5BF5jxJe8aG+PaYgUSIohJxKs4sgMSNp7fuAc5NRX3XaPoKs2qhk6 /wouVqMjxydVFhYPIIS2J1VxEAqIlsLNMuZhItMER5rDZrI2gJK0/ctwaD8FM2ZPXQPEDw 988YG32l0KZa374QuseYomnNMjsWm7dTn/4XOdgplWOp8SckzHVryj4JZ/q0J5eQf/IfWe IhknKhfOv76Wwu5Zku5kNBnMErvJVoXJ+31fVDBNTKCRNq9D5z1YkyvhvcO/qY91sBPLEl 0ftgRPOxgl/aakSfyznfIBSAgX8yZfRNec9YUXFj0Apnhe0WvyxFJssG36ciKg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734800788; a=rsa-sha256; cv=none; b=lHFOvJJ8VlmR9BOIOPMwkR6FoJU8MgTZ6O5GeNFhILV812jYP1V3Xm+hlwaMhgWUqvT783 aZDSo77/6C4D8d5R2+y4Riqg7Ywou7oOFfeK08uwQYjGc/he/imzMBVifBh/4qJorIuEl5 M9DGF+bZQfBTduWoTjjXDt9765COgC6poT7mvN2z+eAt2GfkIB4zAgYZW5xQdLXnS5Y2I4 uBIHZg/tbC5GJW5gNkdPOCX6tK7goBybztTFQK8alxH8/yeMwz99nn4Jeho0cejI9gOuKK BMmwvRSHIIBCX7Zp9Kz5wmmNjKJEHKbo5ndYuA3Dx7VdsuKEDTVpUIdSWeXHrA== 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 4YFrKc4sLnzYMf; Sat, 21 Dec 2024 17:06:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BLH6SX5071479; Sat, 21 Dec 2024 17:06:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BLH6SSj071476; Sat, 21 Dec 2024 17:06:28 GMT (envelope-from git) Date: Sat, 21 Dec 2024 17:06:28 GMT Message-Id: <202412211706.4BLH6SSj071476@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: 494120df401b - stable/13 - geom: Allow BSD type '!0' partitions 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: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 494120df401b9b6fdca1378f6e1e0da1722b9849 Auto-Submitted: auto-generated The branch stable/13 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=494120df401b9b6fdca1378f6e1e0da1722b9849 commit 494120df401b9b6fdca1378f6e1e0da1722b9849 Author: Jose Luis Duran AuthorDate: 2024-11-17 23:55:14 +0000 Commit: Jose Luis Duran CommitDate: 2024-12-21 17:05:08 +0000 geom: Allow BSD type '!0' partitions Allow the creation of '!0' partition types. Fix it by not considering "0" an invalid partition type. Reviewed by: emaste Approved by: emaste (mentor) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D47652 (cherry picked from commit accf71534c612b76ee2701f2dfcaa464748e527a) --- sys/geom/part/g_part_bsd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/geom/part/g_part_bsd.c b/sys/geom/part/g_part_bsd.c index bb1aed0cf59d..625cdb4c727e 100644 --- a/sys/geom/part/g_part_bsd.c +++ b/sys/geom/part/g_part_bsd.c @@ -136,7 +136,7 @@ bsd_parse_type(const char *type, uint8_t *fstype) if (type[0] == '!') { lt = strtol(type + 1, &endp, 0); - if (type[1] == '\0' || *endp != '\0' || lt <= 0 || lt >= 256) + if (type[1] == '\0' || *endp != '\0' || lt < 0 || lt >= 256) return (EINVAL); *fstype = (u_int)lt; return (0); From nobody Sat Dec 21 17:06:29 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 4YFrKf0bM4z5hPdd; Sat, 21 Dec 2024 17:06:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YFrKd6gGSz4PvF; Sat, 21 Dec 2024 17:06:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734800789; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ynKPSKt07Y319QCOyGuzx2aIvOFffgmccjgf5yA4X3M=; b=gUqWzuMEjgdaKGsvW4dtaeTGytpO0B3UQ4LKYCZYXT+TZXArm1ZRsNb1VIHxNWTuSeecI7 4H23NN0yQYCpKL3ziC7SEfDH0rcI3PHhxdWsB63h1tT2oiGet2JdFh/qBfwLnb8xcG3DAh 3VvpAepnht9dRseLQW50Cc+8x1lZtMQYgh2nHvmnIBvUXrcFsl6+m2HUKh6PaeGdJlY3q4 ODCC1fp3INSCR7ts/DSQihLX3xXEsd5Y/iQktgBZVXAcaFw7D5RaBewPqNdNTF9OzXAvSO NxhQ6PxrTC2PWkFRFMQl2XNCP1M9Yba2VNHfYVp5C+13BE4uM+7rKI98kOrBfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734800789; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ynKPSKt07Y319QCOyGuzx2aIvOFffgmccjgf5yA4X3M=; b=U00suyeMaytgGIg/9QvMIWXAPi9zHs9XUjT5Ak4Z8hTd5GuMYYXpSdE6y2GFoT0WQxaZCB N0p0+oc6JXJ/GRVqSndYdw9vqt9W97sj46etwblLCFNBnr2TdX/+Nc0l+mb3pSr/TtIjHL APD6TCybfI7Nrl0xxV6zXlVEAoQVtKdwYiGPprSmTw125SLbQK4pZS3YZ8snAZmltfeZwd Y36Y6wwTtLM0YvrLwCzjNHkwOkZnZqBcvhSf5nw8geW7LPviiZShTVWE/an+IFZJfTlOJT oP+uBgmSZUomR/vggIWg3+XO+4m6Tgt7qhw3+4mH7amY8ZCkWqq+fLpeFbkDuQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734800789; a=rsa-sha256; cv=none; b=d5YqfZDfLEVJBWnhsogISA5dHfXESQuvlBSdC1uQIzJjN5cM0zAsIfGtFc6YgnV9YvXS06 IaX9muOZntRgvM10MaQFWHP+cEWCvHi60e6T/q+wHxFftVqOdi2lgIylL94BZbSBLBfpKT fOl3ptbxUc9stMVmnoON3kg7SeCMZfdY3KvaTKisP3ITHrcZ9kMky7RTK0J1DUz1XHPbra R+6ybOLTANGw3L+MuOCf7kImvq7YPzB5+mb1vhXzi4XEKnk0FbcoRTklClB/Ha+e6LgHqW usXLe/Z/mrxDgTsgT4vtLjYk29TwMeESeex7kmZFBTVowmqNzfuijPux+XYDNg== 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 4YFrKd68NVzYMg; Sat, 21 Dec 2024 17:06:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BLH6TT5071531; Sat, 21 Dec 2024 17:06:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BLH6THf071528; Sat, 21 Dec 2024 17:06:29 GMT (envelope-from git) Date: Sat, 21 Dec 2024 17:06:29 GMT Message-Id: <202412211706.4BLH6THf071528@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: a63708347d83 - stable/13 - nanobsd: Remove dependency on bsdlabel 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: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a63708347d831e37c50cae291ece97d889c71728 Auto-Submitted: auto-generated The branch stable/13 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=a63708347d831e37c50cae291ece97d889c71728 commit a63708347d831e37c50cae291ece97d889c71728 Author: Jose Luis Duran AuthorDate: 2024-11-18 00:16:50 +0000 Commit: Jose Luis Duran CommitDate: 2024-12-21 17:05:24 +0000 nanobsd: Remove dependency on bsdlabel The bsdlabel utility is deprecated, gpart should be used instead: - Offset the first 16 sectors, just like bsdlabel did (used for metadata) - Use a freebsd-ufs partition type (regardless bsdlabel creating a '!0') Reviewed by: emaste, imp Approved by: emaste (mentor) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D47653 (cherry picked from commit 87e87fecb139d60a00837f004de0d37dbecd205c) --- tools/tools/nanobsd/legacy.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/tools/nanobsd/legacy.sh b/tools/tools/nanobsd/legacy.sh index 58288d063b4a..a45b447337b2 100644 --- a/tools/tools/nanobsd/legacy.sh +++ b/tools/tools/nanobsd/legacy.sh @@ -116,14 +116,15 @@ create_code_slice ( ) ( trap "echo 'Running exit trap code' ; df -i ${MNT} ; umount ${MNT} || true ; mdconfig -d -u $MD" 1 2 15 EXIT - bsdlabel -w ${MD} + gpart create -s bsd "${MD}" + gpart add -t freebsd-ufs -b 16 "${MD}" if [ -f ${NANO_WORLDDIR}/boot/boot ]; then echo "Making bootable partition" gpart bootcode -b ${NANO_WORLDDIR}/boot/boot ${MD} else echo "Partition will not be bootable" fi - bsdlabel ${MD} + gpart list ${MD} # Create first image populate_slice /dev/${MD}${NANO_PARTITION_ROOT} ${NANO_WORLDDIR} ${MNT} "${NANO_ROOT}" From nobody Sun Dec 22 03:37: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 4YG6L52zsfz5hx1v; Sun, 22 Dec 2024 03:37: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YG6L52SGnz4DMl; Sun, 22 Dec 2024 03:37:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734838669; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EbkaybhHcPuctrGqgrWx9Mjgv7SBXKqwhwi5+PkD6N4=; b=aSQAN9WBvnYzXnU6ORBHdlCpEGT7DjcxWFuglUqzeoapibpBLKxFrwnxRBhH99KpQ8SpmQ cExwcNIf/3Ba1LLzvU7/W7LXeyxofSWkOO2Qq0EJ9hm6V/xQum8Lm53I2hh+x+UrCYr5wt LhyI7B3NhBBaY6B8QD9F/yF5Xgh1FWX12qhGKqUrzFONu42NxRbBGAksW0hSAaWdQIFWTK olPdzxki7umG+YxWJ1KHAtbqfchTleYtzrHK6dFwXgu83KhYYMAlnG+N6qkTvTEzxYU+/Y 8W1WgvPAxzcmSikFwFApUx6lgVaOkMJDbzieF3oTeo+9Fh7dxhfSJ/WJnatCOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734838669; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EbkaybhHcPuctrGqgrWx9Mjgv7SBXKqwhwi5+PkD6N4=; b=k/l+MUyeBfs3SnXgKRoYEl9njiTrvDRBniG8rj/vlkPLJDLdJ4SeZw4JAD3ETiO2pPfr11 jrXRSPo7ArVtxgae3It8hDPncfnAyzuk8rZQeNwFwp9dpSeekQG4oDs5TpIcCqAHzGC8Os 617h33m+YzOiquE7Cs+/z+AavHNCuJF7ocuL6ZPpUW00FjCGzPlHkkjgpf2ODeAGzV8PXN 4NcnB/wYHLZVnGobcLcKpVGBc0nNnYnc4rj7+keoue0z89iE3ryKhunQA1xf3Ipcs8K7AQ w+rsuWMO/Nu7u5ct5eqD2ryVm7V5sUB6MJkGENmqyuNzyVsFCfnMaotL+ijy8Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734838669; a=rsa-sha256; cv=none; b=eWfxnZHie7M86iBQUF156xVCkF84/ChVJ+oWclSd8s0ZP6PvkaXqLkSh/S13hSkhyeqHFp 4C7MnjvIRt6OhczLnvHXRtT0HmjbXbO62fU4uiel49Zo3OFCEILmhR5WBl6ZUd0/39bge9 tdyWns4s/FblVOFb9lulqocE/zM+D4fd8x0efPhg95V5Rt8hNeYTySBioNHNuaFu59Jyu1 uNg2F+RbzLR1R5gNNsvm+MLqD0KM3C6HmfeTX8vjxwu/oPjMfc/YSn3uL4sMeawVowW2mt U0S0I2+apD58fKoryu1B0H7SV8VJ5Yz7xuWFtxr1jKrI0H7pOUFNIyL9nGAptA== 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 4YG6L521WkzrtW; Sun, 22 Dec 2024 03:37:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BM3bnns052903; Sun, 22 Dec 2024 03:37:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BM3bn5x052900; Sun, 22 Dec 2024 03:37:49 GMT (envelope-from git) Date: Sun, 22 Dec 2024 03:37:49 GMT Message-Id: <202412220337.4BM3bn5x052900@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: 4bbc69192e4f - stable/14 - uhid(4): update ugd_actlen in USB_GET_REPORT ioctl 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: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4bbc69192e4feea57198b5d00ec2b7e2f1b0579d Auto-Submitted: auto-generated The branch stable/14 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=4bbc69192e4feea57198b5d00ec2b7e2f1b0579d commit 4bbc69192e4feea57198b5d00ec2b7e2f1b0579d Author: Matthew Nygard Dodd AuthorDate: 2024-11-18 04:15:01 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-12-22 03:33:16 +0000 uhid(4): update ugd_actlen in USB_GET_REPORT ioctl USB_GET_REPORT ioctl is documented to update ugd_actlen on return with the number of bytes copied. It does not do this. Reviewed by: wulf PR: 282790 MFC after: 1 week (cherry picked from commit 0b5d86b38ae9aec92ef96b9227a404a2df3c9234) --- sys/dev/usb/input/uhid.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/dev/usb/input/uhid.c b/sys/dev/usb/input/uhid.c index 863e04f4e52b..098ec4364df7 100644 --- a/sys/dev/usb/input/uhid.c +++ b/sys/dev/usb/input/uhid.c @@ -633,11 +633,13 @@ uhid_ioctl(struct usb_fifo *fifo, u_long cmd, void *addr, default: return (EINVAL); } + size = imin(ugd->ugd_maxlen, size); if (id != 0) error = copyin(ugd->ugd_data, &id, 1); if (error == 0) error = uhid_get_report(sc, ugd->ugd_report_type, id, - NULL, ugd->ugd_data, imin(ugd->ugd_maxlen, size)); + NULL, ugd->ugd_data, size); + ugd->ugd_actlen = size; break; case USB_SET_REPORT: From nobody Sun Dec 22 03:37: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 4YG6L63W8Zz5hwqd; Sun, 22 Dec 2024 03:37: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YG6L62nfwz4DMm; Sun, 22 Dec 2024 03:37:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734838670; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=q9DRZt2VKZEQ0CmFGhJZN82IETtJr0DVNUbwrJ+wpPw=; b=Rij7E3Z2xA0vy9Hr4slMBW8+c7JcPnSAhTwNsYbhJfsBPRKOiJItV4NQcA316sUmJ3toTH ZyPJ6IQrEcJG0tZJN6//TQELNhj6R6mLx/YKPvAFgKgiVi1HcqNOMAACNsNsBZ56zFSR+t wm6IKyVOaRm+rhv2vQ9SbLS/sijphurp7x5WZzyo+DKY9Dqy8jbo5E6yt/auLUwx/PPLmL DBNEuIVCIW2UAhM9WSLrkoZyTbYreCWHPunrXX9jxqOaxd6/jSz9kCknFy1pRivtdbyXcE lHX+ItuHik5kRZv3R+XN3Yg90O0hqtCnHJ0OMIiGfGafeJ2xiCYsQ6cR/2aH7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734838670; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=q9DRZt2VKZEQ0CmFGhJZN82IETtJr0DVNUbwrJ+wpPw=; b=URTLGRjkbeGOuIlEA3OQbAAXY6QdrQt55Dvh057/qeGu494+SqbG6nFRqJpUkjiHxvjmU6 aubtKuOflpo+EcTiVeJyMNyP/M7hXotnQKNpKDXRCk3DHO1/ERFkWZRBiVyYg+Da6aHJEh Wszbn1q2vFecxouPJGTaueFBev+ydlkOrPjTQpI1dBFEia9bRJpEh4eMVSqxxCRtNZweCY xVNac22TMAm5zQ2Gdh8YtFE430+igAmcYfCQI2C5PuzohUP3KTmQsQEbhU14x27kjynafT I5e82v7p8D4Pij0p8cxOqhXmF532APSli4Fonk9VtJeye7g6IE4KeC1qqEFUdA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734838670; a=rsa-sha256; cv=none; b=jOx3JQ59WrG9LNGcvcplL4RGvR8ozcKx47BekID3zjsg1WxDmDCrVIaQPhAgADmIySd2Bg TT8rtY8YDTnjEgMgs6gzGIGlwYOlklJWBmLGFu1sYHp4m23EY09ZYx1jwFRPTxOtFafV0g xHf95MnRjG2PNj8G+6N8nhmj0Qd8JsxDnZ7kWgzLu7AmZinBV5ffQ/K5YC1n0tOmAfhOz5 PR8qhKsCZiqIMVV4Et7SCELU5H8V4DgZB9SNZzqT8B1Qpp+ioEUHDVbOfAwErix4Lwtknm a+ILr+EknahxEltou/sd4EeRp8y9JWrJbQSY5trdq2M2ahTKEgv6Uxpwo/v81A== 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 4YG6L62N1KzrtX; Sun, 22 Dec 2024 03:37:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BM3bodr052961; Sun, 22 Dec 2024 03:37:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BM3bobZ052957; Sun, 22 Dec 2024 03:37:50 GMT (envelope-from git) Date: Sun, 22 Dec 2024 03:37:50 GMT Message-Id: <202412220337.4BM3bobZ052957@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: c620dfb037e7 - stable/14 - hidraw(4): update hgd_actlen in HIDRAW_GET_REPORT ioctl 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: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c620dfb037e7cdcbc26f33edf8afa4764c3757ac Auto-Submitted: auto-generated The branch stable/14 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=c620dfb037e7cdcbc26f33edf8afa4764c3757ac commit c620dfb037e7cdcbc26f33edf8afa4764c3757ac Author: Matthew Nygard Dodd AuthorDate: 2024-11-18 04:25:10 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-12-22 03:33:27 +0000 hidraw(4): update hgd_actlen in HIDRAW_GET_REPORT ioctl HIDRAW_GET_REPORT ioctl is documented to update hgd_actlen on return with the number of bytes copied. It does not do this. Reviewed by: wulf PR: 282790 MFC after: 1 week (cherry picked from commit f4f46a2eef3be6d19c65a4ca4ee70f365dd5be4f) --- sys/dev/hid/hidraw.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/sys/dev/hid/hidraw.c b/sys/dev/hid/hidraw.c index 618a6d2d5c31..45ef1995063e 100644 --- a/sys/dev/hid/hidraw.c +++ b/sys/dev/hid/hidraw.c @@ -570,6 +570,7 @@ hidraw_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct hidraw_devinfo *hd; const char *devname; uint32_t size; + hid_size_t actsize; int id, len; int error = 0; @@ -747,16 +748,16 @@ hidraw_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, } size = MIN(hgd->hgd_maxlen, size); buf = HIDRAW_LOCAL_ALLOC(local_buf, size); - error = hid_get_report(sc->sc_dev, buf, size, NULL, + actsize = 0; + error = hid_get_report(sc->sc_dev, buf, size, &actsize, hgd->hgd_report_type, id); if (!error) - error = copyout(buf, hgd->hgd_data, size); + error = copyout(buf, hgd->hgd_data, actsize); HIDRAW_LOCAL_FREE(local_buf, buf); + hgd->hgd_actlen = actsize; #ifdef COMPAT_FREEBSD32 - /* - * HIDRAW_GET_REPORT is declared _IOWR, but hgd is not written - * so we don't call update_hgd32(). - */ + if (hgd32 != NULL) + update_hgd32(hgd, hgd32); #endif return (error); From nobody Sun Dec 22 03:37: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 4YG6L759Rlz5hx41; Sun, 22 Dec 2024 03:37: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YG6L73tV2z4DBL; Sun, 22 Dec 2024 03:37:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734838671; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8BQYssxJxgqJAEJ+CU8CckEM6gKMs8wj+WgnRez5Wjg=; b=AU5d5tCe8bGhFCHjDU/D3/bJECusn7s+/EB+ty9jh/j/+qtjY8B+mfVWgIpiumgda4Itv6 LxXtf/Oa2NfXZo/ID+IfXKte3xTwTT3yPEqoFul9Y3uhVBlgPPdHcxXVfLYasFkMV++F3d LJi51of0HYpTZfwNgwP9CFsYNxaei8RQu2Ngm5x6Zeoj4EDfDB11xsclOPIqQHFhqYNZKV Y9612M20W5/GBA4CHNYDkWOcaHeNJ+Loeso8VRk/cR0gSi0JJfxikhry8B7FivscILODGp URKST+77I4O1QBR7ku/64gPl8FKA7LJ9IyDeEC7lHKYQiq8qMHo2RQNyca7ZFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734838671; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8BQYssxJxgqJAEJ+CU8CckEM6gKMs8wj+WgnRez5Wjg=; b=Dz443ciHU4NjQ2BC7nCImW305onZrpIlVIxz2XNLWZ2KNRo7dpaBMmdORIlduEpkXlPzEn S7CQa17HHRvufrwgAnUwZQLHeieG0DzRYREbqQFUuT0+Ew0UsG9FlNPMofApnNX98WG8OO dh5VlVv9r+VtxJQ90ah1NVLMIT9q3HfmnGV879Qj5O1ibxSkm/gIg3LGE6NzQrzR9XAMc8 zasSiYr1SqA5aZr3mhP6U5qLu6Sdxtq7JNJLyTkFs37WfbMIWIuYXKp8YPxNT9onZ86iuZ RVEhj7cEjkSfRsnoSj6C2aWxIEEqmmPYXB2iwP+KSkFKNrYW0hns6X2q18EA7Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734838671; a=rsa-sha256; cv=none; b=hJuZ+A1NnbdQlxni7otcm85ySiHu9UfM8SjWt/M27lTQBtrB3PwUUwUcPUbFeM922Eve5M tZTM7FjWAoFYycmZ9C527BSxvHXogVq3g8NjMH127MLS4Q3nCSuDJ+cwmOoW+ngONnIkqw QbvgXVzYBJpjn/CVIwkAa1bVYlGodtV0nFltu/1lLIXwgZlRjdN+uwqEqIJ++QhT7Cq8eL x7Q6YqCPLg6Etu6QOUjPOM+WAJ1VM2+qa7Qb2iEDkXX273gGgvvZiphtqABUASn1HqhRkD LerASUr34NHwNBZmHSjqpfHit/4jy8CK4ytBvhI4TwrUSr8/gY7JscDnL1fqVQ== 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 4YG6L73HQRzsRs; Sun, 22 Dec 2024 03:37:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BM3bpY6053021; Sun, 22 Dec 2024 03:37:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BM3bpZg053015; Sun, 22 Dec 2024 03:37:51 GMT (envelope-from git) Date: Sun, 22 Dec 2024 03:37:51 GMT Message-Id: <202412220337.4BM3bpZg053015@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: 8e62ae9693bd - stable/14 - iwmbtfw(4): Add support for 9260/9560 bluetooth adaptors 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: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8e62ae9693bde7da254682f903b9b3236bec19d7 Auto-Submitted: auto-generated The branch stable/14 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=8e62ae9693bde7da254682f903b9b3236bec19d7 commit 8e62ae9693bde7da254682f903b9b3236bec19d7 Author: Vladimir Kondratyev AuthorDate: 2024-11-06 23:26:51 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-12-22 03:33:43 +0000 iwmbtfw(4): Add support for 9260/9560 bluetooth adaptors Required firmware files are already included in to comms/iwmbt-firmware port Sponsored by: Future Crew LLC MFC after: 1 month Reviewed by: bz Differential Revision: https://reviews.freebsd.org/D46735 (cherry picked from commit c1643cedbf243424370162febf6d9180bdd1df58) --- usr.sbin/bluetooth/iwmbtfw/Makefile | 2 + usr.sbin/bluetooth/iwmbtfw/iwmbt_fw.c | 21 +++ usr.sbin/bluetooth/iwmbtfw/iwmbt_fw.h | 71 +++++++ usr.sbin/bluetooth/iwmbtfw/iwmbt_hw.c | 183 ++++++++++++++++-- usr.sbin/bluetooth/iwmbtfw/iwmbt_hw.h | 12 +- usr.sbin/bluetooth/iwmbtfw/iwmbtfw.8 | 4 +- usr.sbin/bluetooth/iwmbtfw/iwmbtfw.conf | 5 +- usr.sbin/bluetooth/iwmbtfw/main.c | 323 +++++++++++++++++++++++++------- 8 files changed, 531 insertions(+), 90 deletions(-) diff --git a/usr.sbin/bluetooth/iwmbtfw/Makefile b/usr.sbin/bluetooth/iwmbtfw/Makefile index 0a81d7fdbc32..c2ad86e2ff8e 100644 --- a/usr.sbin/bluetooth/iwmbtfw/Makefile +++ b/usr.sbin/bluetooth/iwmbtfw/Makefile @@ -5,6 +5,8 @@ CONFSDIR= /etc/devd PROG= iwmbtfw MAN= iwmbtfw.8 LIBADD+= usb +# Not having NDEBUG defined will enable assertions +CFLAGS+= -DNDEBUG SRCS= main.c iwmbt_fw.c iwmbt_hw.c .include diff --git a/usr.sbin/bluetooth/iwmbtfw/iwmbt_fw.c b/usr.sbin/bluetooth/iwmbtfw/iwmbt_fw.c index 6816b152912d..815b40982d5b 100644 --- a/usr.sbin/bluetooth/iwmbtfw/iwmbt_fw.c +++ b/usr.sbin/bluetooth/iwmbtfw/iwmbt_fw.c @@ -3,6 +3,7 @@ * * Copyright (c) 2013 Adrian Chadd * Copyright (c) 2019 Vladimir Kondratyev + * Copyright (c) 2023 Future Crew LLC. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -170,3 +171,23 @@ iwmbt_get_fwname(struct iwmbt_version *ver, struct iwmbt_boot_params *params, return (fwname); } + +char * +iwmbt_get_fwname_tlv(struct iwmbt_version_tlv *ver, const char *prefix, + const char *suffix) +{ + char *fwname; + +#define IWMBT_PACK_CNVX_TOP(cnvx_top) ((uint16_t)( \ + ((cnvx_top) & 0x0f000000) >> 16 | \ + ((cnvx_top) & 0x0000000f) << 12 | \ + ((cnvx_top) & 0x00000ff0) >> 4)) + + asprintf(&fwname, "%s/ibt-%04x-%04x.%s", + prefix, + IWMBT_PACK_CNVX_TOP(ver->cnvi_top), + IWMBT_PACK_CNVX_TOP(ver->cnvr_top), + suffix); + + return (fwname); +} diff --git a/usr.sbin/bluetooth/iwmbtfw/iwmbt_fw.h b/usr.sbin/bluetooth/iwmbtfw/iwmbt_fw.h index f737c1c0c2c8..2666d123c8f0 100644 --- a/usr.sbin/bluetooth/iwmbtfw/iwmbt_fw.h +++ b/usr.sbin/bluetooth/iwmbtfw/iwmbt_fw.h @@ -3,6 +3,7 @@ * * Copyright (c) 2013 Adrian Chadd * Copyright (c) 2019 Vladimir Kondratyev + * Copyright (c) 2023 Future Crew LLC. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -29,6 +30,15 @@ #ifndef __IWMBT_FW_H__ #define __IWMBT_FW_H__ +#include +#define L2CAP_SOCKET_CHECKED +#include + +#define RSA_HEADER_LEN 644 +#define ECDSA_HEADER_LEN 320 +#define ECDSA_OFFSET RSA_HEADER_LEN +#define CSS_HEADER_OFFSET 8 + struct iwmbt_version { uint8_t status; uint8_t hw_platform; @@ -62,6 +72,65 @@ struct iwmbt_boot_params { uint8_t unlocked_state; } __attribute__ ((packed)); +enum { + IWMBT_TLV_CNVI_TOP = 0x10, + IWMBT_TLV_CNVR_TOP, + IWMBT_TLV_CNVI_BT, + IWMBT_TLV_CNVR_BT, + IWMBT_TLV_CNVI_OTP, + IWMBT_TLV_CNVR_OTP, + IWMBT_TLV_DEV_REV_ID, + IWMBT_TLV_USB_VENDOR_ID, + IWMBT_TLV_USB_PRODUCT_ID, + IWMBT_TLV_PCIE_VENDOR_ID, + IWMBT_TLV_PCIE_DEVICE_ID, + IWMBT_TLV_PCIE_SUBSYSTEM_ID, + IWMBT_TLV_IMAGE_TYPE, + IWMBT_TLV_TIME_STAMP, + IWMBT_TLV_BUILD_TYPE, + IWMBT_TLV_BUILD_NUM, + IWMBT_TLV_FW_BUILD_PRODUCT, + IWMBT_TLV_FW_BUILD_HW, + IWMBT_TLV_FW_STEP, + IWMBT_TLV_BT_SPEC, + IWMBT_TLV_MFG_NAME, + IWMBT_TLV_HCI_REV, + IWMBT_TLV_LMP_SUBVER, + IWMBT_TLV_OTP_PATCH_VER, + IWMBT_TLV_SECURE_BOOT, + IWMBT_TLV_KEY_FROM_HDR, + IWMBT_TLV_OTP_LOCK, + IWMBT_TLV_API_LOCK, + IWMBT_TLV_DEBUG_LOCK, + IWMBT_TLV_MIN_FW, + IWMBT_TLV_LIMITED_CCE, + IWMBT_TLV_SBE_TYPE, + IWMBT_TLV_OTP_BDADDR, + IWMBT_TLV_UNLOCKED_STATE +}; + +struct iwmbt_version_tlv { + uint32_t cnvi_top; + uint32_t cnvr_top; + uint32_t cnvi_bt; + uint32_t cnvr_bt; + uint16_t dev_rev_id; + uint8_t img_type; + uint16_t timestamp; + uint8_t build_type; + uint32_t build_num; + uint8_t secure_boot; + uint8_t otp_lock; + uint8_t api_lock; + uint8_t debug_lock; + uint8_t min_fw_build_nn; + uint8_t min_fw_build_cw; + uint8_t min_fw_build_yy; + uint8_t limited_cce; + uint8_t sbe_type; + bdaddr_t otp_bd_addr; +}; + struct iwmbt_firmware { char *fwname; int len; @@ -73,5 +142,7 @@ extern void iwmbt_fw_free(struct iwmbt_firmware *fw); extern char *iwmbt_get_fwname(struct iwmbt_version *ver, struct iwmbt_boot_params *params, const char *prefix, const char *suffix); +extern char *iwmbt_get_fwname_tlv(struct iwmbt_version_tlv *ver, + const char *prefix, const char *suffix); #endif diff --git a/usr.sbin/bluetooth/iwmbtfw/iwmbt_hw.c b/usr.sbin/bluetooth/iwmbtfw/iwmbt_hw.c index ea732c9925ee..05a851f9d85b 100644 --- a/usr.sbin/bluetooth/iwmbtfw/iwmbt_hw.c +++ b/usr.sbin/bluetooth/iwmbtfw/iwmbt_hw.c @@ -2,6 +2,7 @@ * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2019 Vladimir Kondratyev + * Copyright (c) 2023 Future Crew LLC. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -29,6 +30,7 @@ #include #include +#include #include #include #include @@ -267,16 +269,6 @@ iwmbt_patch_fwfile(struct libusb_device_handle *hdl, return (activate_patch); } -int -iwmbt_load_fwfile(struct libusb_device_handle *hdl, - const struct iwmbt_firmware *fw, uint32_t *boot_param) -{ - int ready = 0, sent = 0; - int ret, transferred; - struct iwmbt_hci_cmd *cmd; - struct iwmbt_hci_event *event; - uint8_t buf[IWMBT_HCI_MAX_EVENT_SIZE]; - #define IWMBT_SEND_FRAGMENT(fragment_type, size, msg) do { \ iwmbt_debug("transferring %d bytes, offset %d", size, sent); \ \ @@ -293,12 +285,11 @@ iwmbt_load_fwfile(struct libusb_device_handle *hdl, sent += size; \ } while (0) - if (fw->len < 644) { - iwmbt_err("Invalid size of firmware file (%d)", fw->len); - return (-1); - } - - iwmbt_debug("file=%s, size=%d", fw->fwname, fw->len); +int +iwmbt_load_rsa_header(struct libusb_device_handle *hdl, + const struct iwmbt_firmware *fw) +{ + int ret, sent = 0; IWMBT_SEND_FRAGMENT(0x00, 0x80, "CCS segment"); IWMBT_SEND_FRAGMENT(0x03, 0x80, "public key / part 1"); @@ -310,6 +301,32 @@ iwmbt_load_fwfile(struct libusb_device_handle *hdl, IWMBT_SEND_FRAGMENT(0x02, 0x80, "signature / part 1"); IWMBT_SEND_FRAGMENT(0x02, 0x80, "signature / part 2"); + return (0); +} + +int +iwmbt_load_ecdsa_header(struct libusb_device_handle *hdl, + const struct iwmbt_firmware *fw) +{ + int ret, sent = ECDSA_OFFSET; + + IWMBT_SEND_FRAGMENT(0x00, 0x80, "CCS segment"); + IWMBT_SEND_FRAGMENT(0x03, 0x60, "public key"); + IWMBT_SEND_FRAGMENT(0x02, 0x60, "signature"); + + return (0); +} + +int +iwmbt_load_fwfile(struct libusb_device_handle *hdl, + const struct iwmbt_firmware *fw, uint32_t *boot_param, int offset) +{ + int ready = 0, sent = offset; + int ret, transferred; + struct iwmbt_hci_cmd *cmd; + struct iwmbt_hci_event *event; + uint8_t buf[IWMBT_HCI_MAX_EVENT_SIZE]; + /* * Send firmware chunks. Chunk len must be 4 byte aligned. * multiple commands can be combined @@ -460,6 +477,140 @@ iwmbt_get_version(struct libusb_device_handle *hdl, return (0); } +int +iwmbt_get_version_tlv(struct libusb_device_handle *hdl, + struct iwmbt_version_tlv *version) +{ + int ret, transferred; + struct iwmbt_hci_event_cmd_compl *event; + static struct iwmbt_hci_cmd cmd = { + .opcode = htole16(0xfc05), + .length = 1, + .data = { 0xff }, + }; + uint8_t status, datalen, type, len; + uint8_t *data; + uint8_t buf[255]; + + memset(buf, 0, sizeof(buf)); + + ret = iwmbt_hci_command(hdl, + &cmd, + buf, + sizeof(buf), + &transferred, + IWMBT_HCI_CMD_TIMEOUT); + + if (ret < 0 || transferred < (int)IWMBT_HCI_EVT_COMPL_SIZE(uint16_t)) { + iwmbt_debug("Can't get version: code=%d, size=%d", + ret, + transferred); + return (-1); + } + + event = (struct iwmbt_hci_event_cmd_compl *)buf; + memcpy(version, event->data, sizeof(struct iwmbt_version)); + + datalen = event->header.length - IWMBT_HCI_EVENT_COMPL_HEAD_SIZE; + data = event->data; + status = *data++; + if (status != 0) + return (-1); + datalen--; + + while (datalen >= 2) { + type = *data++; + len = *data++; + datalen -= 2; + + if (datalen < len) + return (-1); + + switch (type) { + case IWMBT_TLV_CNVI_TOP: + assert(len == 4); + version->cnvi_top = le32dec(data); + break; + case IWMBT_TLV_CNVR_TOP: + assert(len == 4); + version->cnvr_top = le32dec(data); + break; + case IWMBT_TLV_CNVI_BT: + assert(len == 4); + version->cnvi_bt = le32dec(data); + break; + case IWMBT_TLV_CNVR_BT: + assert(len == 4); + version->cnvr_bt = le32dec(data); + break; + case IWMBT_TLV_DEV_REV_ID: + assert(len == 2); + version->dev_rev_id = le16dec(data); + break; + case IWMBT_TLV_IMAGE_TYPE: + assert(len == 1); + version->img_type = *data; + break; + case IWMBT_TLV_TIME_STAMP: + assert(len == 2); + version->min_fw_build_cw = data[0]; + version->min_fw_build_yy = data[1]; + version->timestamp = le16dec(data); + break; + case IWMBT_TLV_BUILD_TYPE: + assert(len == 1); + version->build_type = *data; + break; + case IWMBT_TLV_BUILD_NUM: + assert(len == 4); + version->min_fw_build_nn = *data; + version->build_num = le32dec(data); + break; + case IWMBT_TLV_SECURE_BOOT: + assert(len == 1); + version->secure_boot = *data; + break; + case IWMBT_TLV_OTP_LOCK: + assert(len == 1); + version->otp_lock = *data; + break; + case IWMBT_TLV_API_LOCK: + assert(len == 1); + version->api_lock = *data; + break; + case IWMBT_TLV_DEBUG_LOCK: + assert(len == 1); + version->debug_lock = *data; + break; + case IWMBT_TLV_MIN_FW: + assert(len == 3); + version->min_fw_build_nn = data[0]; + version->min_fw_build_cw = data[1]; + version->min_fw_build_yy = data[2]; + break; + case IWMBT_TLV_LIMITED_CCE: + assert(len == 1); + version->limited_cce = *data; + break; + case IWMBT_TLV_SBE_TYPE: + assert(len == 1); + version->sbe_type = *data; + break; + case IWMBT_TLV_OTP_BDADDR: + memcpy(&version->otp_bd_addr, data, sizeof(bdaddr_t)); + break; + default: + /* Ignore other types */ + break; + } + + datalen -= len; + data += len; + } + + return (0); +} + int iwmbt_get_boot_params(struct libusb_device_handle *hdl, struct iwmbt_boot_params *params) diff --git a/usr.sbin/bluetooth/iwmbtfw/iwmbt_hw.h b/usr.sbin/bluetooth/iwmbtfw/iwmbt_hw.h index eafb2c3f31d8..9467c3807a2a 100644 --- a/usr.sbin/bluetooth/iwmbtfw/iwmbt_hw.h +++ b/usr.sbin/bluetooth/iwmbtfw/iwmbt_hw.h @@ -2,6 +2,7 @@ * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2019 Vladimir Kondratyev + * Copyright (c) 2023 Future Crew LLC. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -59,6 +60,9 @@ struct iwmbt_hci_event_cmd_compl { #define IWMBT_HCI_EVT_COMPL_SIZE(payload) \ (offsetof(struct iwmbt_hci_event_cmd_compl, data) + sizeof(payload)) +#define IWMBT_HCI_EVENT_COMPL_HEAD_SIZE \ + (offsetof(struct iwmbt_hci_event_cmd_compl, data) - \ + offsetof(struct iwmbt_hci_event_cmd_compl, numpkt)) #define IWMBT_CONTROL_ENDPOINT_ADDR 0x00 #define IWMBT_INTERRUPT_ENDPOINT_ADDR 0x81 @@ -73,13 +77,19 @@ struct iwmbt_hci_event_cmd_compl { extern int iwmbt_patch_fwfile(struct libusb_device_handle *hdl, const struct iwmbt_firmware *fw); +extern int iwmbt_load_rsa_header(struct libusb_device_handle *hdl, + const struct iwmbt_firmware *fw); +extern int iwmbt_load_ecdsa_header(struct libusb_device_handle *hdl, + const struct iwmbt_firmware *fw); extern int iwmbt_load_fwfile(struct libusb_device_handle *hdl, - const struct iwmbt_firmware *fw, uint32_t *boot_param); + const struct iwmbt_firmware *fw, uint32_t *boot_param, int offset); extern int iwmbt_enter_manufacturer(struct libusb_device_handle *hdl); extern int iwmbt_exit_manufacturer(struct libusb_device_handle *hdl, int mode); extern int iwmbt_get_version(struct libusb_device_handle *hdl, struct iwmbt_version *version); +extern int iwmbt_get_version_tlv(struct libusb_device_handle *hdl, + struct iwmbt_version_tlv *version); extern int iwmbt_get_boot_params(struct libusb_device_handle *hdl, struct iwmbt_boot_params *params); extern int iwmbt_intel_reset(struct libusb_device_handle *hdl, diff --git a/usr.sbin/bluetooth/iwmbtfw/iwmbtfw.8 b/usr.sbin/bluetooth/iwmbtfw/iwmbtfw.8 index 1924c5f3ce74..2ce828cb5ebe 100644 --- a/usr.sbin/bluetooth/iwmbtfw/iwmbtfw.8 +++ b/usr.sbin/bluetooth/iwmbtfw/iwmbtfw.8 @@ -26,7 +26,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd May 31, 2024 +.Dd September 15, 2024 .Dt IWMBTFW 8 .Os .Sh NAME @@ -48,7 +48,7 @@ device. .Pp This utility will .Em only -work with Intel Wireless 7260/8260/8265 chip based Bluetooth USB devices +work with Intel Wireless 7260/8260/9260 chip based Bluetooth USB devices and some of their successors. The identification is currently based on USB vendor ID/product ID pair. The vendor ID should be 0x8087 diff --git a/usr.sbin/bluetooth/iwmbtfw/iwmbtfw.conf b/usr.sbin/bluetooth/iwmbtfw/iwmbtfw.conf index ef8d5263383b..e30a3c15ccaa 100644 --- a/usr.sbin/bluetooth/iwmbtfw/iwmbtfw.conf +++ b/usr.sbin/bluetooth/iwmbtfw/iwmbtfw.conf @@ -1,11 +1,12 @@ # -# Download Intel Wireless 8260/8265 bluetooth adaptor firmware +# Download Intel Wireless bluetooth adaptor firmware +# notify 100 { match "system" "USB"; match "subsystem" "DEVICE"; match "type" "ATTACH"; match "vendor" "0x8087"; - match "product" "(0x07dc|0x0a2a|0x0aa7|0x0a2b|0x0aaa|0x0025|0x0026|0x0029)"; + match "product" "(0x07dc|0x0a2a|0x0aa7|0x0a2b|0x0aaa|0x0025|0x0026|0x0029|0x0032|0x0033)"; action "/usr/sbin/iwmbtfw -d $cdev -f /usr/local/share/iwmbt-firmware"; }; diff --git a/usr.sbin/bluetooth/iwmbtfw/main.c b/usr.sbin/bluetooth/iwmbtfw/main.c index 9ef31b906b77..c2b67ce01906 100644 --- a/usr.sbin/bluetooth/iwmbtfw/main.c +++ b/usr.sbin/bluetooth/iwmbtfw/main.c @@ -3,6 +3,7 @@ * * Copyright (c) 2013 Adrian Chadd * Copyright (c) 2019 Vladimir Kondratyev + * Copyright (c) 2023 Future Crew LLC. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -50,71 +51,63 @@ int iwmbt_do_debug = 0; int iwmbt_do_info = 0; +enum iwmbt_device { + IWMBT_DEVICE_UNKNOWN, + IWMBT_DEVICE_7260, + IWMBT_DEVICE_8260, + IWMBT_DEVICE_9260, +}; + struct iwmbt_devid { uint16_t product_id; uint16_t vendor_id; + enum iwmbt_device device; }; -static struct iwmbt_devid iwmbt_list_72xx[] = { +static struct iwmbt_devid iwmbt_list[] = { - /* Intel Wireless 7260/7265 and successors */ - { .vendor_id = 0x8087, .product_id = 0x07dc }, - { .vendor_id = 0x8087, .product_id = 0x0a2a }, - { .vendor_id = 0x8087, .product_id = 0x0aa7 }, -}; + /* Intel Wireless 7260/7265 and successors */ + { .vendor_id = 0x8087, .product_id = 0x07dc, .device = IWMBT_DEVICE_7260 }, + { .vendor_id = 0x8087, .product_id = 0x0a2a, .device = IWMBT_DEVICE_7260 }, + { .vendor_id = 0x8087, .product_id = 0x0aa7, .device = IWMBT_DEVICE_7260 }, -static struct iwmbt_devid iwmbt_list_82xx[] = { + /* Intel Wireless 8260/8265 and successors */ + { .vendor_id = 0x8087, .product_id = 0x0a2b, .device = IWMBT_DEVICE_8260 }, + { .vendor_id = 0x8087, .product_id = 0x0aaa, .device = IWMBT_DEVICE_8260 }, + { .vendor_id = 0x8087, .product_id = 0x0025, .device = IWMBT_DEVICE_8260 }, + { .vendor_id = 0x8087, .product_id = 0x0026, .device = IWMBT_DEVICE_8260 }, + { .vendor_id = 0x8087, .product_id = 0x0029, .device = IWMBT_DEVICE_8260 }, - /* Intel Wireless 8260/8265 and successors */ - { .vendor_id = 0x8087, .product_id = 0x0a2b }, - { .vendor_id = 0x8087, .product_id = 0x0aaa }, - { .vendor_id = 0x8087, .product_id = 0x0025 }, - { .vendor_id = 0x8087, .product_id = 0x0026 }, - { .vendor_id = 0x8087, .product_id = 0x0029 }, + /* Intel Wireless 9260/9560 and successors */ + { .vendor_id = 0x8087, .product_id = 0x0032, .device = IWMBT_DEVICE_9260 }, + { .vendor_id = 0x8087, .product_id = 0x0033, .device = IWMBT_DEVICE_9260 }, }; -static int -iwmbt_is_7260(struct libusb_device_descriptor *d) +static enum iwmbt_device +iwmbt_is_supported(struct libusb_device_descriptor *d) { int i; /* Search looking for whether it's an 7260/7265 */ - for (i = 0; i < (int) nitems(iwmbt_list_72xx); i++) { - if ((iwmbt_list_72xx[i].product_id == d->idProduct) && - (iwmbt_list_72xx[i].vendor_id == d->idVendor)) { - iwmbt_info("found 7260/7265"); - return (1); - } - } - - /* Not found */ - return (0); -} - -static int -iwmbt_is_8260(struct libusb_device_descriptor *d) -{ - int i; - - /* Search looking for whether it's an 8260/8265 */ - for (i = 0; i < (int) nitems(iwmbt_list_82xx); i++) { - if ((iwmbt_list_82xx[i].product_id == d->idProduct) && - (iwmbt_list_82xx[i].vendor_id == d->idVendor)) { - iwmbt_info("found 8260/8265"); - return (1); + for (i = 0; i < (int) nitems(iwmbt_list); i++) { + if ((iwmbt_list[i].product_id == d->idProduct) && + (iwmbt_list[i].vendor_id == d->idVendor)) { + iwmbt_info("found iwmbtfw compatible"); + return (iwmbt_list[i].device); } } /* Not found */ - return (0); + return (IWMBT_DEVICE_UNKNOWN); } static libusb_device * iwmbt_find_device(libusb_context *ctx, int bus_id, int dev_id, - int *iwmbt_use_old_method) + enum iwmbt_device *iwmbt_device) { libusb_device **list, *dev = NULL, *found = NULL; struct libusb_device_descriptor d; + enum iwmbt_device device; ssize_t cnt, i; int r; @@ -141,20 +134,13 @@ iwmbt_find_device(libusb_context *ctx, int bus_id, int dev_id, } /* Match on the vendor/product id */ - if (iwmbt_is_7260(&d)) { + device = iwmbt_is_supported(&d); + if (device != IWMBT_DEVICE_UNKNOWN) { /* * Take a reference so it's not freed later on. */ found = libusb_ref_device(dev); - *iwmbt_use_old_method = 1; - break; - } else - if (iwmbt_is_8260(&d)) { - /* - * Take a reference so it's not freed later on. - */ - found = libusb_ref_device(dev); - *iwmbt_use_old_method = 0; + *iwmbt_device = device; break; } } @@ -200,6 +186,44 @@ iwmbt_dump_boot_params(struct iwmbt_boot_params *params) params->otp_bdaddr[0]); } +static void +iwmbt_dump_version_tlv(struct iwmbt_version_tlv *ver) +{ + iwmbt_info("cnvi_top 0x%08x", ver->cnvi_top); + iwmbt_info("cnvr_top 0x%08x", ver->cnvr_top); + iwmbt_info("cnvi_bt 0x%08x", ver->cnvi_bt); + iwmbt_info("cnvr_bt 0x%08x", ver->cnvr_bt); + iwmbt_info("dev_rev_id 0x%04x", ver->dev_rev_id); + iwmbt_info("img_type 0x%02x", ver->img_type); + iwmbt_info("timestamp 0x%04x", ver->timestamp); + iwmbt_info("build_type 0x%02x", ver->build_type); + iwmbt_info("build_num 0x%08x", ver->build_num); + iwmbt_info("Secure Boot: %s", ver->secure_boot ? "on" : "off"); + iwmbt_info("OTP lock: %s", ver->otp_lock ? "on" : "off"); + iwmbt_info("API lock: %s", ver->api_lock ? "on" : "off"); + iwmbt_info("Debug lock: %s", ver->debug_lock ? "on" : "off"); + iwmbt_info("Minimum firmware build %u week %u year %u", + ver->min_fw_build_nn, + ver->min_fw_build_cw, + 2000 + ver->min_fw_build_yy); + iwmbt_info("limited_cce 0x%02x", ver->limited_cce); + iwmbt_info("sbe_type 0x%02x", ver->sbe_type); + iwmbt_info("OTC BD_ADDR: %02x:%02x:%02x:%02x:%02x:%02x", + ver->otp_bd_addr.b[5], + ver->otp_bd_addr.b[4], + ver->otp_bd_addr.b[3], + ver->otp_bd_addr.b[2], + ver->otp_bd_addr.b[1], + ver->otp_bd_addr.b[0]); + if (ver->img_type == 0x01 || ver->img_type == 0x03) + iwmbt_info("%s timestamp %u.%u buildtype %u build %u", + ver->img_type == 0x01 ? "Bootloader" : "Firmware", + 2000 + (ver->timestamp >> 8), + ver->timestamp & 0xff, + ver->build_type, + ver->build_num); +} + static int iwmbt_patch_firmware(libusb_device_handle *hdl, const char *firmware_path) { @@ -227,10 +251,10 @@ iwmbt_patch_firmware(libusb_device_handle *hdl, const char *firmware_path) static int iwmbt_init_firmware(libusb_device_handle *hdl, const char *firmware_path, - uint32_t *boot_param) + uint32_t *boot_param, uint8_t hw_variant, uint8_t sbe_type) { struct iwmbt_firmware fw; - int ret; + int header_len, ret = -1; iwmbt_debug("loading %s", firmware_path); @@ -240,12 +264,76 @@ iwmbt_init_firmware(libusb_device_handle *hdl, const char *firmware_path, return (-1); } - /* Load in the firmware */ - ret = iwmbt_load_fwfile(hdl, &fw, boot_param); + iwmbt_debug("Firmware file size=%d", fw.len); + + if (hw_variant <= 0x14) { + /* + * Hardware variants 0x0b, 0x0c, 0x11 - 0x14 .sfi file have + * a RSA header of 644 bytes followed by Command Buffer. + */ + header_len = RSA_HEADER_LEN; + if (fw.len < header_len) { + iwmbt_err("Invalid size of firmware file (%d)", fw.len); + ret = -1; + goto exit; + } + + /* Check if the CSS Header version is RSA(0x00010000) */ + if (le32dec(fw.buf + CSS_HEADER_OFFSET) != 0x00010000) { + iwmbt_err("Invalid CSS Header version"); + ret = -1; + goto exit; + } + + /* Only RSA secure boot engine supported */ + if (sbe_type != 0x00) { + iwmbt_err("Invalid SBE type for hardware variant (%d)", + hw_variant); + ret = -1; + goto exit; + } + + } else if (hw_variant >= 0x17) { + /* + * Hardware variants 0x17, 0x18 onwards support both RSA and + * ECDSA secure boot engine. As a result, the corresponding sfi + * file will have RSA header of 644, ECDSA header of 320 bytes + * followed by Command Buffer. + */ + header_len = ECDSA_OFFSET + ECDSA_HEADER_LEN; + if (fw.len < header_len) { + iwmbt_err("Invalid size of firmware file (%d)", fw.len); + ret = -1; + goto exit; + } + + /* Check if CSS header for ECDSA follows the RSA header */ + if (fw.buf[ECDSA_OFFSET] != 0x06) { + ret = -1; + goto exit; + } + + /* Check if the CSS Header version is ECDSA(0x00020000) */ + if (le32dec(fw.buf + ECDSA_OFFSET + CSS_HEADER_OFFSET) != 0x00020000) { + iwmbt_err("Invalid CSS Header version"); + ret = -1; + goto exit; + } + } + + /* Load in the CSS header */ + if (sbe_type == 0x00) + ret = iwmbt_load_rsa_header(hdl, &fw); + else if (sbe_type == 0x01) + ret = iwmbt_load_ecdsa_header(hdl, &fw); if (ret < 0) - iwmbt_debug("Loading firmware file failed"); + goto exit; - /* free it */ + /* Load in the Command Buffer */ + ret = iwmbt_load_fwfile(hdl, &fw, boot_param, header_len); + +exit: + /* free firmware */ iwmbt_fw_free(&fw); return (ret); @@ -318,6 +406,7 @@ main(int argc, char *argv[]) libusb_device *dev = NULL; libusb_device_handle *hdl = NULL; static struct iwmbt_version ver; + static struct iwmbt_version_tlv ver_tlv; static struct iwmbt_boot_params params; uint32_t boot_param; int r; @@ -327,7 +416,7 @@ main(int argc, char *argv[]) char *firmware_dir = NULL; char *firmware_path = NULL; int retcode = 1; - int iwmbt_use_old_method = 0; + enum iwmbt_device iwmbt_device; /* Parse command line arguments */ while ((n = getopt(argc, argv, "Dd:f:hIm:p:v:")) != -1) { @@ -372,7 +461,7 @@ main(int argc, char *argv[]) iwmbt_debug("opening dev %d.%d", (int) bus_id, (int) dev_id); /* Find a device based on the bus/dev id */ - dev = iwmbt_find_device(ctx, bus_id, dev_id, &iwmbt_use_old_method); + dev = iwmbt_find_device(ctx, bus_id, dev_id, &iwmbt_device); if (dev == NULL) { iwmbt_err("device not found"); goto shutdown; @@ -401,16 +490,16 @@ main(int argc, char *argv[]) goto shutdown; } - /* Get Intel version */ - r = iwmbt_get_version(hdl, &ver); - if (r < 0) { - iwmbt_debug("iwmbt_get_version() failed code %d", r); - goto shutdown; - } - iwmbt_dump_version(&ver); - iwmbt_debug("fw_variant=0x%02x", (int) ver.fw_variant); + if (iwmbt_device == IWMBT_DEVICE_7260) { - if (iwmbt_use_old_method) { + /* Get Intel version */ + r = iwmbt_get_version(hdl, &ver); + if (r < 0) { + iwmbt_debug("iwmbt_get_version() failed code %d", r); + goto shutdown; + } + iwmbt_dump_version(&ver); + iwmbt_debug("fw_patch_num=0x%02x", (int) ver.fw_patch_num); /* fw_patch_num = >0 operational mode */ if (ver.fw_patch_num > 0x00) { @@ -469,7 +558,16 @@ main(int argc, char *argv[]) iwmbt_info("Intel Event Mask is set"); (void)iwmbt_exit_manufacturer(hdl, 0x00); - } else { + } else if (iwmbt_device == IWMBT_DEVICE_8260) { + + /* Get Intel version */ + r = iwmbt_get_version(hdl, &ver); + if (r < 0) { + iwmbt_debug("iwmbt_get_version() failed code %d", r); + goto shutdown; + } + iwmbt_dump_version(&ver); + iwmbt_debug("fw_variant=0x%02x", (int) ver.fw_variant); /* fw_variant = 0x06 bootloader mode / 0x23 operational mode */ if (ver.fw_variant == 0x23) { @@ -509,7 +607,7 @@ main(int argc, char *argv[]) iwmbt_debug("firmware_path = %s", firmware_path); /* Download firmware and parse it for magic Intel Reset parameter */ - r = iwmbt_init_firmware(hdl, firmware_path, &boot_param); + r = iwmbt_init_firmware(hdl, firmware_path, &boot_param, 0, 0); free(firmware_path); if (r < 0) goto shutdown; @@ -546,6 +644,93 @@ main(int argc, char *argv[]) r = iwmbt_set_event_mask(hdl); if (r == 0) iwmbt_info("Intel Event Mask is set"); + + } else { + + /* Get Intel version */ + r = iwmbt_get_version_tlv(hdl, &ver_tlv); + if (r < 0) { + iwmbt_debug("iwmbt_get_version_tlv() failed code %d", r); + goto shutdown; + } + iwmbt_dump_version_tlv(&ver_tlv); + iwmbt_debug("img_type=0x%02x", (int) ver_tlv.img_type); + + /* img_type = 0x01 bootloader mode / 0x03 operational mode */ + if (ver_tlv.img_type == 0x03) { + iwmbt_info("Firmware has already been downloaded"); + retcode = 0; + goto reset; + } + + if (ver_tlv.img_type != 0x01){ + iwmbt_err("unknown img_type 0x%02x", (int) ver_tlv.img_type); + goto shutdown; + } + + /* Check if firmware fragments are ACKed with a cmd complete event */ + if (ver_tlv.limited_cce != 0x00) { + iwmbt_err("Unsupported Intel firmware loading method (%u)", + ver_tlv.limited_cce); + goto shutdown; + } + + /* Check if secure boot engine is supported: 1 (ECDSA) or 0 (RSA) */ + if (ver_tlv.sbe_type > 0x01) { + iwmbt_err("Unsupported secure boot engine (%u)", + ver_tlv.sbe_type); + goto shutdown; + } + + /* Default the firmware path */ + if (firmware_dir == NULL) + firmware_dir = strdup(_DEFAULT_IWMBT_FIRMWARE_PATH); + + firmware_path = iwmbt_get_fwname_tlv(&ver_tlv, firmware_dir, "sfi"); + if (firmware_path == NULL) + goto shutdown; + + iwmbt_debug("firmware_path = %s", firmware_path); + + /* Download firmware and parse it for magic Intel Reset parameter */ + r = iwmbt_init_firmware(hdl, firmware_path, &boot_param, + ver_tlv.cnvi_bt >> 16 & 0x3f, ver_tlv.sbe_type); + free(firmware_path); + if (r < 0) + goto shutdown; + + r = iwmbt_intel_reset(hdl, boot_param); + if (r < 0) { + iwmbt_debug("iwmbt_intel_reset() failed!"); + goto shutdown; + } + + iwmbt_info("Firmware operational"); + + /* Once device is running in operational mode we can ignore failures */ + retcode = 0; + + /* Execute Read Intel Version one more time */ + r = iwmbt_get_version(hdl, &ver); + if (r == 0) + iwmbt_dump_version(&ver); + + /* Apply the device configuration (DDC) parameters */ + firmware_path = iwmbt_get_fwname_tlv(&ver_tlv, firmware_dir, "ddc"); + iwmbt_debug("ddc_path = %s", firmware_path); + if (firmware_path != NULL) { + r = iwmbt_init_ddc(hdl, firmware_path); + if (r == 0) + iwmbt_info("DDC download complete"); + free(firmware_path); + } + + /* Set Intel Event mask */ + r = iwmbt_set_event_mask(hdl); + if (r == 0) + iwmbt_info("Intel Event Mask is set"); + + iwmbt_info("Firmware download complete"); } reset: From nobody Sun Dec 22 03:37:53 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 4YG6LB74k9z5hwl9; Sun, 22 Dec 2024 03:37:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YG6L967kPz4D6x; Sun, 22 Dec 2024 03:37:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734838673; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FMEccDUeVb+gDuDoAxAkyvny/EfvEdgiCpzohyRH588=; b=oFcE6l2W75kuOA2Q3UJUJtu5z3EZmqvYhdmZo1X0f+EcrwA23I5ghou/6kRCEsPHn/WV/z yBu8ZRG+imz1iG5dwAWKXC+nGYgwdhGRClX0BG1T3F/OKX7F245yf3sxNcnoa6KGxcH7ls Lf5kTTRi8DEnC91to6T2TB/fFKVAdE2nq/NgU01Erq7+S9gKTWN2j1r4ZFxfluCmL55wnn sJIe/URVcML2ObxljzmIbuxEZsKVaTcSSKcIkOXle2akVK3E6/gt3Dec6Vvc0X6c1GboF8 DZ544p65vvdCHNYRk34pJ5/Xr91izYfzJf3lxMnM5waQoIt8+Dh6iZNcXUscAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734838673; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FMEccDUeVb+gDuDoAxAkyvny/EfvEdgiCpzohyRH588=; b=JyYBGphDQ6bAX+qLteFPKL2VnBs+s7i0+rkc2HqcRRAtTi/7c54IQI3WLqj4XOVl3NtxPh 3vRsCMWsPazDDZ9NOn8FXBILax+xKe7zYCxfrCyJeg5gT6rFotUCDZVrbETAFn9+puNL3P EzQlDHyCcy0to+f8hjfZoE28z29AEYfCl3YU48gIx2qsULvZUityjgHVN5zVvMXE8IQvZZ GrQSKZNMuoRWJGWrShlUvlZKTWOz3a6NqKxxRMS50IfeLxPBnKZ3hwRJNaRdYJfi/QWQHp z0yfA22SUCDPI5Z2EAXeJgyVoh98KfdTQWF7NitJTZAVkZZmX7oXGeoRpTPHFw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734838673; a=rsa-sha256; cv=none; b=oel1XlOzXKT/Jc65j5G5YjZHiAVGIaCgbB8BtQgJH7a3UrLAe5Wh6rlLG72EYxfTAAcQNw Sd5XuTapta2ErtCSlBrgZlMFahDPzWys1v9Va6I4atq5AV0mHh8PnBX7jQkXxBizV2QTN4 OB8Mqo/P+Kc8U/X56ymP7L6tMkan10ykA8Lz6e7Kg+pjE5gm+OKreOFEpddr32Rv2YadSC /mURwbR6F3Xv3pcEEQwvrcPR6ytuNA/Om5C4TzSHF62PlWACNh77+iVI3sHyUS+EFJ8moT 5yJ855xuOLV3KOP/ZkARU5qzGIlsAJbBrwMwlbPD41EHLEbBuuBJMeD/vqHaDA== 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 4YG6L95Sg9zsRv; Sun, 22 Dec 2024 03:37:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BM3brAi053153; Sun, 22 Dec 2024 03:37:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BM3brDc053150; Sun, 22 Dec 2024 03:37:53 GMT (envelope-from git) Date: Sun, 22 Dec 2024 03:37:53 GMT Message-Id: <202412220337.4BM3brDc053150@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: f5b685add059 - stable/14 - ng_ubt(4): do not attach Realtek 87XX/88XX adaptors in bootloader mode. 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: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f5b685add05937eec2e090d0c87199a5232e957a Auto-Submitted: auto-generated The branch stable/14 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=f5b685add05937eec2e090d0c87199a5232e957a commit f5b685add05937eec2e090d0c87199a5232e957a Author: Vladimir Kondratyev AuthorDate: 2024-11-06 23:28:11 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-12-22 03:34:09 +0000 ng_ubt(4): do not attach Realtek 87XX/88XX adaptors in bootloader mode. Attempt to initialize FreeBSD bluetooth stack while such a device is in bootloader mode locks the adapter hardly so it requires power on/off cycle to restore. This change blocks ng_ubt attachment unless operational firmware is loaded thus preventing the lock up. Sponsored by: Future Crew LLC MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D46738 (cherry picked from commit 24ae172a50352ad4fd22989477f29ecca5aed6e3) --- sys/conf/files | 1 + sys/modules/netgraph/bluetooth/ubt/Makefile | 4 +- sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c | 3 + sys/netgraph/bluetooth/drivers/ubt/ng_ubt_rtl.c | 265 ++++++++++++++++++++++++ sys/netgraph/bluetooth/drivers/ubt/ng_ubt_var.h | 3 + 5 files changed, 274 insertions(+), 2 deletions(-) diff --git a/sys/conf/files b/sys/conf/files index 0c3169173868..b571db1e27e8 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -4225,6 +4225,7 @@ net80211/ieee80211_alq.c optional wlan ieee80211_alq netgraph/bluetooth/common/ng_bluetooth.c optional netgraph_bluetooth netgraph/bluetooth/drivers/ubt/ng_ubt.c optional netgraph_bluetooth_ubt usb netgraph/bluetooth/drivers/ubt/ng_ubt_intel.c optional netgraph_bluetooth_ubt usb +netgraph/bluetooth/drivers/ubt/ng_ubt_rtl.c optional netgraph_bluetooth_ubt usb netgraph/bluetooth/drivers/ubtbcmfw/ubtbcmfw.c optional netgraph_bluetooth_ubtbcmfw usb netgraph/bluetooth/hci/ng_hci_cmds.c optional netgraph_bluetooth_hci netgraph/bluetooth/hci/ng_hci_evnt.c optional netgraph_bluetooth_hci diff --git a/sys/modules/netgraph/bluetooth/ubt/Makefile b/sys/modules/netgraph/bluetooth/ubt/Makefile index 6ef7da5fbfb2..1d95fd567888 100644 --- a/sys/modules/netgraph/bluetooth/ubt/Makefile +++ b/sys/modules/netgraph/bluetooth/ubt/Makefile @@ -6,7 +6,7 @@ CFLAGS+= -I${SRCTOP}/sys/netgraph/bluetooth/include \ -I${SRCTOP}/sys/netgraph/bluetooth/drivers/ubt KMOD= ng_ubt -SRCS= ng_ubt.c ng_ubt_intel.c opt_bus.h opt_usb.h device_if.h \ - bus_if.h usb_if.h usbdevs.h +SRCS= ng_ubt.c ng_ubt_intel.c ng_ubt_rtl.c opt_bus.h opt_usb.h \ + device_if.h bus_if.h usb_if.h usbdevs.h .include diff --git a/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c b/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c index 76a71e2f8d53..649c479d1d9f 100644 --- a/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c +++ b/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c @@ -614,6 +614,9 @@ ubt_probe(device_t dev) if (usbd_lookup_id_by_uaa(ubt_ignore_devs, sizeof(ubt_ignore_devs), uaa) == 0) return (ENXIO); + if (usbd_lookup_id_by_uaa(ubt_rtl_devs, + ubt_rtl_devs_sizeof, uaa) == 0) + return (ENXIO); id = usbd_lookup_id_by_info(ubt_devs, sizeof(ubt_devs), &uaa->info); diff --git a/sys/netgraph/bluetooth/drivers/ubt/ng_ubt_rtl.c b/sys/netgraph/bluetooth/drivers/ubt/ng_ubt_rtl.c new file mode 100644 index 000000000000..b9fbc1c12a29 --- /dev/null +++ b/sys/netgraph/bluetooth/drivers/ubt/ng_ubt_rtl.c @@ -0,0 +1,265 @@ +/* + * ng_ubt_rtl.c + */ + +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2019 Vladimir Kondratyev + * Copyright (c) 2023 Future Crew LLC. + * + * 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. + */ + +/* + * Attempt to initialize FreeBSD bluetooth stack while Realtek 87XX/88XX USB + * device is in bootloader mode locks the adapter hardly so it requires power + * on/off cycle to restore. This driver blocks ng_ubt attachment until + * operational firmware is loaded by rtlbtfw utility thus avoiding the lock up. + */ + +#include +#include +#include +#include +#include +#include +#include + +#include "usbdevs.h" +#include +#include +#define USB_DEBUG_VAR usb_debug +#include + +#include +#include +#include +#include +#include +#include +#include + +static device_probe_t ubt_rtl_probe; + +/* + * List of supported bluetooth devices. If you add a new device PID here ensure + * that it is blacklisted in ng_ubt.c and is supported by rtlbtfw utility. + */ + +const STRUCT_USB_HOST_ID ubt_rtl_devs[] = +{ + /* Generic Realtek Bluetooth class devices */ + { USB_VENDOR(USB_VENDOR_REALTEK), + USB_IFACE_CLASS(UDCLASS_WIRELESS), + USB_IFACE_SUBCLASS(UDSUBCLASS_RF), + USB_IFACE_PROTOCOL(UDPROTO_BLUETOOTH) }, + + /* Realtek 8821CE Bluetooth devices */ + { USB_VPI(0x13d3, 0x3529, 0) }, + + /* Realtek 8822CE Bluetooth devices */ + { USB_VPI(0x0bda, 0xb00c, 0) }, + { USB_VPI(0x0bda, 0xc822, 0) }, + + /* Realtek 8822CU Bluetooth devices */ + { USB_VPI(0x13d3, 0x3549, 0) }, + + /* Realtek 8852AE Bluetooth devices */ + { USB_VPI(0x0bda, 0x2852, 0) }, + { USB_VPI(0x0bda, 0xc852, 0) }, + { USB_VPI(0x0bda, 0x385a, 0) }, + { USB_VPI(0x0bda, 0x4852, 0) }, + { USB_VPI(0x04c5, 0x165c, 0) }, + { USB_VPI(0x04ca, 0x4006, 0) }, + { USB_VPI(0x0cb8, 0xc549, 0) }, + + /* Realtek 8852CE Bluetooth devices */ + { USB_VPI(0x04ca, 0x4007, 0) }, + { USB_VPI(0x04c5, 0x1675, 0) }, + { USB_VPI(0x0cb8, 0xc558, 0) }, + { USB_VPI(0x13d3, 0x3587, 0) }, + { USB_VPI(0x13d3, 0x3586, 0) }, + { USB_VPI(0x13d3, 0x3592, 0) }, + + /* Realtek 8852BE Bluetooth devices */ + { USB_VPI(0x0cb8, 0xc559, 0) }, + { USB_VPI(0x0bda, 0x887b, 0) }, + { USB_VPI(0x13d3, 0x3571, 0) }, + + /* Realtek 8723AE Bluetooth devices */ + { USB_VPI(0x0930, 0x021d, 0) }, + { USB_VPI(0x13d3, 0x3394, 0) }, + + /* Realtek 8723BE Bluetooth devices */ + { USB_VPI(0x0489, 0xe085, 0) }, + { USB_VPI(0x0489, 0xe08b, 0) }, + { USB_VPI(0x04f2, 0xb49f, 0) }, + { USB_VPI(0x13d3, 0x3410, 0) }, + { USB_VPI(0x13d3, 0x3416, 0) }, + { USB_VPI(0x13d3, 0x3459, 0) }, + { USB_VPI(0x13d3, 0x3494, 0) }, + + /* Realtek 8723BU Bluetooth devices */ + { USB_VPI(0x7392, 0xa611, 0) }, + + /* Realtek 8723DE Bluetooth devices */ + { USB_VPI(0x0bda, 0xb009, 0) }, + { USB_VPI(0x2ff8, 0xb011, 0) }, + + /* Realtek 8761BUV Bluetooth devices */ + { USB_VPI(0x2357, 0x0604, 0) }, + { USB_VPI(0x0b05, 0x190e, 0) }, + { USB_VPI(0x2550, 0x8761, 0) }, + { USB_VPI(0x0bda, 0x8771, 0) }, + { USB_VPI(0x6655, 0x8771, 0) }, + { USB_VPI(0x7392, 0xc611, 0) }, + { USB_VPI(0x2b89, 0x8761, 0) }, + + /* Realtek 8821AE Bluetooth devices */ + { USB_VPI(0x0b05, 0x17dc, 0) }, + { USB_VPI(0x13d3, 0x3414, 0) }, + { USB_VPI(0x13d3, 0x3458, 0) }, + { USB_VPI(0x13d3, 0x3461, 0) }, + { USB_VPI(0x13d3, 0x3462, 0) }, + + /* Realtek 8822BE Bluetooth devices */ + { USB_VPI(0x13d3, 0x3526, 0) }, + { USB_VPI(0x0b05, 0x185c, 0) }, + + /* Realtek 8822CE Bluetooth devices */ + { USB_VPI(0x04ca, 0x4005, 0) }, + { USB_VPI(0x04c5, 0x161f, 0) }, + { USB_VPI(0x0b05, 0x18ef, 0) }, + { USB_VPI(0x13d3, 0x3548, 0) }, + { USB_VPI(0x13d3, 0x3549, 0) }, + { USB_VPI(0x13d3, 0x3553, 0) }, + { USB_VPI(0x13d3, 0x3555, 0) }, + { USB_VPI(0x2ff8, 0x3051, 0) }, + { USB_VPI(0x1358, 0xc123, 0) }, + { USB_VPI(0x0bda, 0xc123, 0) }, + { USB_VPI(0x0cb5, 0xc547, 0) }, +}; +const size_t ubt_rtl_devs_sizeof = sizeof(ubt_rtl_devs); + +/* + * List of lmp_subversion values that correspond to Realtek firmwares + * incompatible with ng_ubt driver. Alternative firmware for these devices + * has to be loaded with rtlbtfw utility. That will trigger lmp_subversion + * change to different value. + */ +static const uint16_t ubt_rtl_lmp_subvers[] = { + 0x8703, 0x1200, 0x8723, 0x8821, + 0x8761, 0x8822, 0x8852, 0x8851, +}; + +/* + * Execute generic HCI command and return response in provided buffer. + */ + +static usb_error_t +ubt_rtl_do_hci_request(struct usb_device *udev, uint16_t opcode, + void *resp, uint8_t resp_len) +{ +#define UBT_RTL_HCICMD_TIMEOUT 2000 /* ms */ + struct ubt_hci_event_command_compl *evt; + struct ubt_hci_cmd cmd; + usb_error_t error; + + memset(&cmd, 0, sizeof(cmd)); + cmd.opcode = htole16(opcode); + evt = malloc(offsetof(struct ubt_hci_event_command_compl, data) + + resp_len, M_TEMP, M_ZERO | M_WAITOK); + evt->header.event = NG_HCI_EVENT_COMMAND_COMPL; + evt->header.length = resp_len + UBT_HCI_EVENT_COMPL_HEAD_SIZE; + + error = ubt_do_hci_request(udev, &cmd, evt, UBT_RTL_HCICMD_TIMEOUT); + if (error != USB_ERR_NORMAL_COMPLETION) + goto exit; + + if (evt->header.event == NG_HCI_EVENT_COMMAND_COMPL && + evt->header.length == resp_len + UBT_HCI_EVENT_COMPL_HEAD_SIZE) + memcpy(resp, evt->data, resp_len); + else + error = USB_ERR_INVAL; +exit: + free(evt, M_TEMP); + return (error); +} + +/* + * Probe for a Realtek 87XX/88XX USB Bluetooth device. + */ + +static int +ubt_rtl_probe(device_t dev) +{ + struct usb_attach_arg *uaa = device_get_ivars(dev); + ng_hci_read_local_ver_rp ver; + unsigned int i; + int error; + + if (uaa->usb_mode != USB_MODE_HOST) + return (ENXIO); + + if (uaa->info.bIfaceIndex != 0) + return (ENXIO); + + error = usbd_lookup_id_by_uaa(ubt_rtl_devs, sizeof(ubt_rtl_devs), uaa); + if (error != 0) + return (error); + + if (ubt_rtl_do_hci_request(uaa->device, + NG_HCI_OPCODE(NG_HCI_OGF_INFO, NG_HCI_OCF_READ_LOCAL_VER), + &ver, sizeof(ver)) != USB_ERR_NORMAL_COMPLETION) + return (ENXIO); + + DPRINTFN(2, "hci_version 0x%02x\n", ver.hci_version); + DPRINTFN(2, "hci_revision 0x%04x\n", le16toh(ver.hci_revision)); + DPRINTFN(2, "lmp_version 0x%02x\n", ver.lmp_version); + DPRINTFN(2, "lmp_subversion 0x%04x\n", le16toh(ver.lmp_subversion)); + + for (i = 0; i < nitems(ubt_rtl_lmp_subvers); i++) + if (le16toh(ver.lmp_subversion) == ubt_rtl_lmp_subvers[i]) + return (ENXIO); + + return (BUS_PROBE_DEFAULT); +} + +/* + * Module interface. Attach and detach methods, netgraph node type + * registration and PNP string are inherited from ng_ubt.c driver. + */ + +static device_method_t ubt_rtl_methods[] = +{ + DEVMETHOD(device_probe, ubt_rtl_probe), + DEVMETHOD_END +}; + +DEFINE_CLASS_1(ubt, ubt_rtl_driver, ubt_rtl_methods, + sizeof(struct ubt_softc), ubt_driver); +DRIVER_MODULE(ng_ubt_rtl, uhub, ubt_rtl_driver, 0, 0); +MODULE_VERSION(ng_ubt_rtl, NG_BLUETOOTH_VERSION); +MODULE_DEPEND(ng_ubt_rtl, netgraph, NG_ABI_VERSION, NG_ABI_VERSION, NG_ABI_VERSION); +MODULE_DEPEND(ng_ubt_rtl, ng_hci, NG_BLUETOOTH_VERSION, NG_BLUETOOTH_VERSION, NG_BLUETOOTH_VERSION); +MODULE_DEPEND(ng_ubt_rtl, usb, 1, 1, 1); diff --git a/sys/netgraph/bluetooth/drivers/ubt/ng_ubt_var.h b/sys/netgraph/bluetooth/drivers/ubt/ng_ubt_var.h index 7b97ad245a68..a48a6732f5a8 100644 --- a/sys/netgraph/bluetooth/drivers/ubt/ng_ubt_var.h +++ b/sys/netgraph/bluetooth/drivers/ubt/ng_ubt_var.h @@ -164,6 +164,9 @@ typedef struct ubt_softc * ubt_softc_p; usb_error_t ubt_do_hci_request(struct usb_device *, struct ubt_hci_cmd *, void *, usb_timeout_t); +extern const STRUCT_USB_HOST_ID ubt_rtl_devs[]; +extern const size_t ubt_rtl_devs_sizeof; + extern driver_t ubt_driver; #endif /* ndef _NG_UBT_VAR_H_ */ From nobody Sun Dec 22 03:37:52 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 4YG6LB5v7gz5hwy8; Sun, 22 Dec 2024 03:37:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YG6L86J0jz4DHH; Sun, 22 Dec 2024 03:37:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734838672; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LexdcXGi8zTP4+ndjc2vKRqdMDVqNYg0fbWkMOh5Sds=; b=Wh5PbawQwqyg2FktbB4TgRDfhNB9bOePQj6ZeG+S+pew9XTgiTgjCXigVYP/N1CdD7ogeT j9m+2YgwTDH3PpUwaGZjQifA3PeSRUlL4pKBP1vuenzsfD6EY4ThWm8gqPEAMZBPIGDnwl v1cxk5X8DQkKs64cmomf2UkjLvPglUilJXyCXNDGKgccM5Ivs7qVygS3W+iPDsxDicNJFL l6ZLW2vSNtyYTc61HimB5U4IzOWOuK30S3oomYLCoiQXBe52TnFgFXywTZ8CuKULcEw+SG 3TMUNEuXF7B/SYhck6mHWKIr6IJvS3E32yu8u/kgU45JgYVIkfV4D4WylDLmdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734838672; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LexdcXGi8zTP4+ndjc2vKRqdMDVqNYg0fbWkMOh5Sds=; b=DEU5hKVsm+9Df2b67j4wP9/CTLOOBBeRzynENVi7fuIvzPWj5iUM46Jy/O487aBo2UOYj9 3TwhHpJ+m54nREc66TlTepOx9QUrkU5Fz26QH3HfoQ+GB8c6gGQwow6tv+qjPFCqkIxQuo PfwfuW9F73LEp6cueC5xOWOvnf4ToDzyot0cGgNF9IeOsp5fGIm8JRT1kZCcCvCY57ptf8 8vMUNEyJHIttntYNTNe6u5SZNB7gzRbJfavTb2LLUt2aqbEiyUX7tZaPjyi4grPsuxHvzm fmqvD0sS3W7rDj5qiMTFZcAdEJiX4qiTIzTITckgChDTspdAEyXmpvocOyUU+w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734838672; a=rsa-sha256; cv=none; b=I5tnoChdAnDEjqVVXjJVUFS+HHExYXpa9NZ82QMyqSkc3kiQSMPO3vlwZhrylKYK8VefEk xqg1MlD/+9wnpeqHFAEutnYYWZFajUNLftk4QPQGCRgzQXEqwu82np8txHzgoKt5Np+Ib7 gc7RjJK1om78IRMwgKQqIlCYqb96pRR/85sJnZGvEuz1AwxxujRSH+DLFJzs94nq5JE3+J aRmm+zUz8y6a6TLR2vPXr1hMAlwquXR0YsNSJQEBkjbqgDnSCa4jQ4IXRmm8uT5Yo3suJI bpa5JhvpDsD6gbXArJzEZrH0wiOg5ms0FbOC31yaXfx7QeDdFaxkIKaLBAN8BA== 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 4YG6L84GyGzsRt; Sun, 22 Dec 2024 03:37:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BM3bqmM053078; Sun, 22 Dec 2024 03:37:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BM3bqaR053074; Sun, 22 Dec 2024 03:37:52 GMT (envelope-from git) Date: Sun, 22 Dec 2024 03:37:52 GMT Message-Id: <202412220337.4BM3bqaR053074@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: 624635e2ad29 - stable/14 - iwmbtfw(8): Ignore unexpected HCI events List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: 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: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 624635e2ad291987e8bff6944489841b8c160d75 Auto-Submitted: auto-generated The branch stable/14 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=624635e2ad291987e8bff6944489841b8c160d75 commit 624635e2ad291987e8bff6944489841b8c160d75 Author: Vladimir Kondratyev AuthorDate: 2024-11-06 23:27:48 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-12-22 03:33:54 +0000 iwmbtfw(8): Ignore unexpected HCI events If Intel firmware is already in operational mode at boot that takes place at warm boot, BT adaptor can generate extra HCI events which interferes with firmware mode detection logic. Ignore them. Sponsored by: Future Crew LLC MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D46737 (cherry picked from commit aa0b938434a8af8eebf8f2634914f2d9fe8a5dc4) --- usr.sbin/bluetooth/iwmbtfw/iwmbt_hw.c | 58 +++++++++++++++++++++++++++-------- usr.sbin/bluetooth/iwmbtfw/iwmbt_hw.h | 6 ++++ 2 files changed, 52 insertions(+), 12 deletions(-) diff --git a/usr.sbin/bluetooth/iwmbtfw/iwmbt_hw.c b/usr.sbin/bluetooth/iwmbtfw/iwmbt_hw.c index 05a851f9d85b..1efd24ecf9f6 100644 --- a/usr.sbin/bluetooth/iwmbtfw/iwmbt_hw.c +++ b/usr.sbin/bluetooth/iwmbtfw/iwmbt_hw.c @@ -37,10 +37,13 @@ #include #include #include +#include #include #include +#include + #include "iwmbt_fw.h" #include "iwmbt_hw.h" #include "iwmbt_dbg.h" @@ -95,6 +98,7 @@ static int iwmbt_hci_command(struct libusb_device_handle *hdl, struct iwmbt_hci_cmd *cmd, void *event, int size, int *transferred, int timeout) { + struct timespec to, now, remains; int ret; ret = libusb_control_transfer(hdl, @@ -112,18 +116,47 @@ iwmbt_hci_command(struct libusb_device_handle *hdl, struct iwmbt_hci_cmd *cmd, return (ret); } - ret = libusb_interrupt_transfer(hdl, - IWMBT_INTERRUPT_ENDPOINT_ADDR, - event, - size, - transferred, - timeout); + clock_gettime(CLOCK_MONOTONIC, &now); + to = IWMBT_MSEC2TS(timeout); + timespecadd(&to, &now, &to); - if (ret < 0) - iwmbt_err("libusb_interrupt_transfer() failed: err=%s", - libusb_strerror(ret)); + do { + timespecsub(&to, &now, &remains); + ret = libusb_interrupt_transfer(hdl, + IWMBT_INTERRUPT_ENDPOINT_ADDR, + event, + size, + transferred, + IWMBT_TS2MSEC(remains) + 1); - return (ret); + if (ret < 0) { + iwmbt_err("libusb_interrupt_transfer() failed: err=%s", + libusb_strerror(ret)); + return (ret); + } + + switch (((struct iwmbt_hci_event *)event)->header.event) { + case NG_HCI_EVENT_COMMAND_COMPL: + if (*transferred < + (int)offsetof(struct iwmbt_hci_event_cmd_compl, data)) + break; + if (cmd->opcode != + ((struct iwmbt_hci_event_cmd_compl *)event)->opcode) + break; + /* FALLTHROUGH */ + case 0xFF: + return (0); + default: + break; + } + iwmbt_debug("Stray HCI event: %x", + ((struct iwmbt_hci_event *)event)->header.event); + } while (timespeccmp(&to, &now, >)); + + iwmbt_err("libusb_interrupt_transfer() failed: err=%s", + libusb_strerror(LIBUSB_ERROR_TIMEOUT)); + + return (LIBUSB_ERROR_TIMEOUT); } int @@ -691,6 +724,7 @@ iwmbt_load_ddc(struct libusb_device_handle *hdl, int size, sent = 0; int ret, transferred; uint8_t buf[IWMBT_HCI_MAX_CMD_SIZE]; + uint8_t evt[IWMBT_HCI_MAX_CMD_SIZE]; struct iwmbt_hci_cmd *cmd = (struct iwmbt_hci_cmd *)buf; size = ddc->len; @@ -713,8 +747,8 @@ iwmbt_load_ddc(struct libusb_device_handle *hdl, ret = iwmbt_hci_command(hdl, cmd, - buf, - sizeof(buf), + evt, + sizeof(evt), &transferred, IWMBT_HCI_CMD_TIMEOUT); diff --git a/usr.sbin/bluetooth/iwmbtfw/iwmbt_hw.h b/usr.sbin/bluetooth/iwmbtfw/iwmbt_hw.h index 9467c3807a2a..89ee344fe587 100644 --- a/usr.sbin/bluetooth/iwmbtfw/iwmbt_hw.h +++ b/usr.sbin/bluetooth/iwmbtfw/iwmbt_hw.h @@ -72,6 +72,12 @@ struct iwmbt_hci_event_cmd_compl { #define IWMBT_HCI_MAX_CMD_SIZE 256 #define IWMBT_HCI_MAX_EVENT_SIZE 16 +#define IWMBT_MSEC2TS(msec) \ + (struct timespec) { \ + .tv_sec = (msec) / 1000, \ + .tv_nsec = ((msec) % 1000) * 1000000 \ + }; +#define IWMBT_TS2MSEC(ts) ((ts).tv_sec * 1000 + (ts).tv_nsec / 1000000) #define IWMBT_HCI_CMD_TIMEOUT 2000 /* ms */ #define IWMBT_LOADCMPL_TIMEOUT 5000 /* ms */ From nobody Sun Dec 22 03:37: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 4YG6LD48zkz5hwlD; Sun, 22 Dec 2024 03:37: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YG6LC0Qt0z4DQw; Sun, 22 Dec 2024 03:37:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734838675; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lMnUWiVbemMOUHHcx2ZZyXHO8e6qTwoS9goeihdDOFA=; b=A0Y3atABiOy2MBIf9K5pfEx/Zwz/S3YAxZF3XTwef6FznIujthH84vJlZi8TpVneg83suZ f3ffb8eTh+9OxceluPxhAc+B7s97o+jZaMK4TN7ylrG9ITlA0gU1TTNfjG2wrdwhlhTLn0 mhLtU3EsmZXZSZadX+ZvogqNC9np9tNQW4Zv1LmDadGnhLUXmlG8mYB8EoKTc3MNMWIz9h Ckdl937LlC7TmZOQl0Ohi+wxS7HER+rL93KmVZCyitWQoEUqliWlS4QAjYkdd05VXgGU92 7fPrkfoJAoTUMIrIQumRMsg8DX6MJwbRHMD6krkv+P7tLC8RRlH4GoFvGG7P8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734838675; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lMnUWiVbemMOUHHcx2ZZyXHO8e6qTwoS9goeihdDOFA=; b=jt/CZf4H7J/owgBJfC3MQbiXRzp2MeeTVnDZWXSxGcsJDutYD/e3Ukr0SVy+0neXab9SEA V4oMDyM0jBEyaZpyqc3Y8oeck3LfBfZ22ClIcSMbtuv6jJ5G9LimWmlXg9hUJa/F12xPdV 2iQ4psVH3E2Wu4bhzf8L+aaprxPV+8RXxgHCDXHEswnuZ790ktZYr92iLWZQf3j2aip169 NyS8wEgEvy2tBAEyK0e2m/+n548WBCcGiJSjagw4Sc3znatLrEk9+4uxmBoivjN2BhXEGE EAgoluB0eGSXy2RYhysy1WF39kWkpSX9FStdyMUIzhKeR5QefKfJWBBXPs+h4Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734838675; a=rsa-sha256; cv=none; b=D89M8ZiYj0GwSeJGLQpMmPskNWZ7Pi1fmp+xTcn8Y9ArQ/8q4TSqtKbqLp+rRaZUPmpBYQ vJHPorAy+OJ/jxP3OVDJlBemZdfcNDNcFQ68edRQMTvySJFBttWAiRxjOJfNNcNyO8Vz0i Xg48ZD10e903uWsLBY4ivFAtDwXiF/KsnfF7BRGZ+0WiGg3XmHteRybILU+Bu3kB0y7iQW G0XTLp91EXQclydSXgIHBl1ZemFZe9LX4/KYFkGy7MZ9fmvTwNBZUzZxbCqGCCD73+nVYP Tl+n9Xwq90tBUD/xPtPCITKJOvQ71EVfBbYLp48JYP2YhB7KceiwZLZugR31QA== 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 4YG6LB65b8zrtZ; Sun, 22 Dec 2024 03:37:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BM3bsYb053211; Sun, 22 Dec 2024 03:37:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BM3bs0A053208; Sun, 22 Dec 2024 03:37:54 GMT (envelope-from git) Date: Sun, 22 Dec 2024 03:37:54 GMT Message-Id: <202412220337.4BM3bs0A053208@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: 5ce844d3daa2 - stable/14 - ng_ubt_intel: Allow to attach to 9260 bluetooth adaptors 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: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 5ce844d3daa29ba0358e455d3723226d127a28af Auto-Submitted: auto-generated The branch stable/14 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=5ce844d3daa29ba0358e455d3723226d127a28af commit 5ce844d3daa29ba0358e455d3723226d127a28af Author: Vladimir Kondratyev AuthorDate: 2024-11-06 23:25:56 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-12-22 03:34:24 +0000 ng_ubt_intel: Allow to attach to 9260 bluetooth adaptors with operational mode firmware. Sponsored by: Future Crew LLC MFC after: 1 month Reviewed by: bz Differential Revision: https://reviews.freebsd.org/D46734 (cherry picked from commit 19a577ea5cae1238065106de9080cb6f3e66034d) --- sys/netgraph/bluetooth/drivers/ubt/ng_ubt_intel.c | 69 ++++++++++++++++++++++- 1 file changed, 68 insertions(+), 1 deletion(-) diff --git a/sys/netgraph/bluetooth/drivers/ubt/ng_ubt_intel.c b/sys/netgraph/bluetooth/drivers/ubt/ng_ubt_intel.c index ad71cae5fa83..f93b74b264ad 100644 --- a/sys/netgraph/bluetooth/drivers/ubt/ng_ubt_intel.c +++ b/sys/netgraph/bluetooth/drivers/ubt/ng_ubt_intel.c @@ -6,6 +6,7 @@ * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2019, 2021 Vladimir Kondratyev + * Copyright (c) 2023 Future Crew LLC. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -56,9 +57,13 @@ #include #include +#define UBT_INTEL_HCICMD_TIMEOUT 2000 /* ms */ +#define UBT_INTEL_TLV_IMAGE_TYPE 0x1c + enum { UBT_INTEL_DEVICE_7260, UBT_INTEL_DEVICE_8260, + UBT_INTEL_DEVICE_9260, }; struct ubt_intel_version_rp { @@ -93,6 +98,9 @@ static const STRUCT_USB_HOST_ID ubt_intel_devs[] = { USB_VPI(USB_VENDOR_INTEL2, 0x0025, UBT_INTEL_DEVICE_8260) }, { USB_VPI(USB_VENDOR_INTEL2, 0x0026, UBT_INTEL_DEVICE_8260) }, { USB_VPI(USB_VENDOR_INTEL2, 0x0029, UBT_INTEL_DEVICE_8260) }, + /* Intel Wireless 9260/9560 and successors */ + { USB_VPI(USB_VENDOR_INTEL2, 0x0032, UBT_INTEL_DEVICE_9260) }, + { USB_VPI(USB_VENDOR_INTEL2, 0x0033, UBT_INTEL_DEVICE_9260) }, }; /* @@ -103,7 +111,6 @@ static usb_error_t ubt_intel_do_hci_request(struct usb_device *udev, uint16_t opcode, void *resp, uint8_t resp_len) { -#define UBT_INTEL_HCICMD_TIMEOUT 2000 /* ms */ struct ubt_hci_event_command_compl *evt; struct ubt_hci_cmd cmd; usb_error_t error; @@ -128,6 +135,53 @@ exit: return (error); } +static uint8_t +ubt_intel_get_img_type(struct usb_device *udev) +{ +#define UBT_INTEL_MAX_EVT_SIZE 256 + static struct ubt_hci_cmd cmd = { + .opcode = htole16(NG_HCI_OPCODE(NG_HCI_OGF_VENDOR, 0x05)), + .length = 1, + .data = { 0xff }, + }; + struct ubt_hci_event_command_compl *evt; + usb_error_t error; + uint8_t status, datalen, type, len, img_type = 0; + uint8_t *data; + + evt = malloc(UBT_INTEL_MAX_EVT_SIZE, M_TEMP, M_ZERO | M_WAITOK); + evt->header.length = + UBT_INTEL_MAX_EVT_SIZE - sizeof(struct ubt_hci_evhdr); + + error = ubt_do_hci_request(udev, &cmd, evt, UBT_INTEL_HCICMD_TIMEOUT); + if (error != USB_ERR_NORMAL_COMPLETION) + goto exit; + + datalen = evt->header.length - UBT_HCI_EVENT_COMPL_HEAD_SIZE; + data = evt->data; + status = *data++; + if (status != 0) + goto exit; + datalen--; + + while (datalen >= 2) { + type = *data++; + len = *data++; + datalen -= 2; + if (datalen < len) + break; + if (type == UBT_INTEL_TLV_IMAGE_TYPE && len == 1) { + img_type = *data; + break; + } + datalen -= len; + data += len; + } +exit: + free(evt, M_TEMP); + return (img_type); +} + /* * Probe for a Intel Wireless Bluetooth device. */ @@ -139,6 +193,7 @@ ubt_intel_probe(device_t dev) struct ubt_intel_version_rp version; ng_hci_reset_rp reset; int error; + uint8_t img_type; if (uaa->usb_mode != USB_MODE_HOST) return (ENXIO); @@ -193,6 +248,18 @@ ubt_intel_probe(device_t dev) return (ENXIO); break; + case UBT_INTEL_DEVICE_9260: + /* + * Find if the Intel Wireless 9260/9560 device is in bootloader + * mode or is running operational firmware with checking of + * image type byte of "Intel version" HCI command response. + * The value 0x03 identifies the operational firmware. + */ + img_type = ubt_intel_get_img_type(uaa->device); + if (img_type != 0x03) + return (ENXIO); + break; + default: KASSERT(0 == 1, ("Unknown DRIVER_INFO")); } From nobody Sun Dec 22 03:37: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 4YG6LF2nGDz5hwn1; Sun, 22 Dec 2024 03:37: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YG6LD0kQbz4DHs; Sun, 22 Dec 2024 03:37:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734838676; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OZFViPoFMbIYtHiLRzppN2uSaE1l5P0W4yH3kp6muIY=; b=a6ANwPBJOgRDy7O9kwS2QbezMh3vc0vQLRkf7CBQd94M9L3Y0YRoVo/9Glx0B9T1G2hv70 Q7uQmbjmTTLF6D0v4wAlqevI+gzODehQteFWEEXgOCtmM45JYTDQOxvsCe2lq+Y60YQ3eA gxHqjEN6zddl1JSQx6+07aetrysDyzRVN0vv9lVkpMA/ncGMQGPf5MRfDUYZNbcNX74HJW qNF36KdaGPBbvdcsAcgkt3hMY04ODw593Rir5nZx0Y4mnyLAPRvHjtBNAqvVzgfsmUNJXl b46XC/Si61tQVql7NvoSzslPMhiM5v7I/6iAby4stQeMNyzu8B7KfEwgBS5BkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734838676; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OZFViPoFMbIYtHiLRzppN2uSaE1l5P0W4yH3kp6muIY=; b=PizfhSJGoz9OcS0ehbcEkUuasltQPo/fR4RS9FqE33Xb7jP8cm+ZB6/dkKZvQ2w82Q1ymb I8Pss3tpzMZOie93USLT0fiAFwg6SaQUFdCKv+jm0M7Bw+4gxmT1tpe5poPztWmrIOdAiB BEjw9pYuX+GGhZUV1hzeHBIJd2w11EUKYI3oLqMl2/oCw7bfsEr6xXhEerAzkmuIA50wZG GUHBGkRowP3gj4CaGGLhNs68/50LX21tYQMs6i5dXRDEMuDPqxYlM9vk85kErKKOUpgzV4 Flzrv7ny2akdyIO69yNrZyIbFcB/DyXHd5+ZR8qCNuKxuwcaLcPxS48MmKriOg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734838676; a=rsa-sha256; cv=none; b=jt8Zz85Q7F5cySdS+ejOOycWeP4QwqGTwAEhtiwz1WbuFWag4g3G0SkVFOyP4n8iZH/vXT RrxRdAoRvFdphH7fLiFi2cX775y06Wlq65A2gVSl06Maf65YGrsBJIoY1e7zmCPsuM99Z4 bldF60N00QABh/mFOkAoansAfwYxcgm2/K6hunHlW3ykYcMSfm4tDFTv2YL0YKWB9R6GWF HjBD/19AOTGGyJLtqrF2fIPQQwp5D3tOPr3lVz/H/WyCpRrw+hYDKtzyzKKwUfuAfqbNlp GYCm50kJ7GKqp2Rz/EmhccCZhWvOibkuxdnVCngEw+xoQ0ZDyx62shGkZ37vFQ== 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 4YG6LD0Fg5zrxD; Sun, 22 Dec 2024 03:37:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BM3bt0n053268; Sun, 22 Dec 2024 03:37:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BM3bt3U053265; Sun, 22 Dec 2024 03:37:55 GMT (envelope-from git) Date: Sun, 22 Dec 2024 03:37:55 GMT Message-Id: <202412220337.4BM3bt3U053265@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: ccfbbe2d8aff - stable/14 - rtlbtfw: Firmware loader for Realtek 87XX/88XX bluetooth USB adaptors 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: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ccfbbe2d8aff7b23f1a42c5f8d968100aba764b5 Auto-Submitted: auto-generated The branch stable/14 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=ccfbbe2d8aff7b23f1a42c5f8d968100aba764b5 commit ccfbbe2d8aff7b23f1a42c5f8d968100aba764b5 Author: Vladimir Kondratyev AuthorDate: 2024-11-06 23:28:49 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-12-22 03:34:35 +0000 rtlbtfw: Firmware loader for Realtek 87XX/88XX bluetooth USB adaptors Firmware files are available in the comms/rtlbt-firmware port. Sponsored by: Future Crew LLC MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D46739 (cherry picked from commit 5036d9652a5701d00e9e40ea942c278e9f77d33d) --- targets/pseudo/userland/Makefile.depend | 1 + tools/build/mk/OptionalObsoleteFiles.inc | 3 + usr.sbin/bluetooth/Makefile | 1 + usr.sbin/bluetooth/rtlbtfw/Makefile | 9 + usr.sbin/bluetooth/rtlbtfw/main.c | 525 +++++++++++++++++++++++++++++++ usr.sbin/bluetooth/rtlbtfw/rtlbt_dbg.h | 46 +++ usr.sbin/bluetooth/rtlbtfw/rtlbt_fw.c | 385 +++++++++++++++++++++++ usr.sbin/bluetooth/rtlbtfw/rtlbt_fw.h | 92 ++++++ usr.sbin/bluetooth/rtlbtfw/rtlbt_hw.c | 236 ++++++++++++++ usr.sbin/bluetooth/rtlbtfw/rtlbt_hw.h | 104 ++++++ usr.sbin/bluetooth/rtlbtfw/rtlbtfw.8 | 100 ++++++ usr.sbin/bluetooth/rtlbtfw/rtlbtfw.conf | 373 ++++++++++++++++++++++ 12 files changed, 1875 insertions(+) diff --git a/targets/pseudo/userland/Makefile.depend b/targets/pseudo/userland/Makefile.depend index b44d6f92414a..d27194933184 100644 --- a/targets/pseudo/userland/Makefile.depend +++ b/targets/pseudo/userland/Makefile.depend @@ -432,6 +432,7 @@ DIRDEPS+= \ usr.sbin/bluetooth/l2control \ usr.sbin/bluetooth/l2ping \ usr.sbin/bluetooth/rfcomm_pppd \ + usr.sbin/bluetooth/rtlbtfw \ usr.sbin/bluetooth/sdpcontrol \ usr.sbin/bluetooth/sdpd \ usr.sbin/bootparamd/bootparamd \ diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc index 96af8fb91008..6af2a2e33eb0 100644 --- a/tools/build/mk/OptionalObsoleteFiles.inc +++ b/tools/build/mk/OptionalObsoleteFiles.inc @@ -197,6 +197,7 @@ OLD_FILES+=etc/bluetooth/hosts OLD_FILES+=etc/bluetooth/protocols OLD_FILES+=etc/defaults/bluetooth.device.conf OLD_FILES+=etc/devd/iwmbtfw.conf +OLD_FILES+=etc/devd/rtlbtfw.conf OLD_DIRS+=etc/bluetooth OLD_FILES+=etc/rc.d/bluetooth OLD_FILES+=etc/rc.d/bthidd @@ -244,6 +245,7 @@ OLD_FILES+=usr/sbin/iwmbtfw OLD_FILES+=usr/sbin/l2control OLD_FILES+=usr/sbin/l2ping OLD_FILES+=usr/sbin/rfcomm_pppd +OLD_FILES+=usr/sbin/rtlbtfw OLD_FILES+=usr/sbin/sdpcontrol OLD_FILES+=usr/sbin/sdpd OLD_FILES+=usr/share/examples/etc/defaults/bluetooth.device.conf @@ -322,6 +324,7 @@ OLD_FILES+=usr/share/man/man8/iwmbtfw.8.gz OLD_FILES+=usr/share/man/man8/l2control.8.gz OLD_FILES+=usr/share/man/man8/l2ping.8.gz OLD_FILES+=usr/share/man/man8/rfcomm_pppd.8.gz +OLD_FILES+=usr/share/man/man8/rtlbtfw.8.gz OLD_FILES+=usr/share/man/man8/sdpcontrol.8.gz OLD_FILES+=usr/share/man/man8/sdpd.8.gz .endif diff --git a/usr.sbin/bluetooth/Makefile b/usr.sbin/bluetooth/Makefile index fb660029b3d1..5afc12450194 100644 --- a/usr.sbin/bluetooth/Makefile +++ b/usr.sbin/bluetooth/Makefile @@ -19,6 +19,7 @@ SUBDIR+= bcmfw SUBDIR+= bthidcontrol SUBDIR+= bthidd SUBDIR+= iwmbtfw +SUBDIR+= rtlbtfw .endif .include diff --git a/usr.sbin/bluetooth/rtlbtfw/Makefile b/usr.sbin/bluetooth/rtlbtfw/Makefile new file mode 100644 index 000000000000..f9c5dfd12b1f --- /dev/null +++ b/usr.sbin/bluetooth/rtlbtfw/Makefile @@ -0,0 +1,9 @@ +PACKAGE= bluetooth +CONFS= rtlbtfw.conf +CONFSDIR= /etc/devd +PROG= rtlbtfw +MAN= rtlbtfw.8 +LIBADD+= usb +SRCS= main.c rtlbt_fw.c rtlbt_hw.c + +.include diff --git a/usr.sbin/bluetooth/rtlbtfw/main.c b/usr.sbin/bluetooth/rtlbtfw/main.c new file mode 100644 index 000000000000..029c04f98b26 --- /dev/null +++ b/usr.sbin/bluetooth/rtlbtfw/main.c @@ -0,0 +1,525 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2013 Adrian Chadd + * Copyright (c) 2019 Vladimir Kondratyev + * Copyright (c) 2023 Future Crew LLC. + * + * 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 +#include +#include +#include + +#include + +#include "rtlbt_fw.h" +#include "rtlbt_hw.h" +#include "rtlbt_dbg.h" + +#define _DEFAULT_RTLBT_FIRMWARE_PATH "/usr/share/firmware/rtlbt" + +int rtlbt_do_debug = 0; +int rtlbt_do_info = 0; + +struct rtlbt_devid { + uint16_t product_id; + uint16_t vendor_id; +}; + +static struct rtlbt_devid rtlbt_list[] = { + /* Realtek 8821CE Bluetooth devices */ + { .vendor_id = 0x13d3, .product_id = 0x3529 }, + + /* Realtek 8822CE Bluetooth devices */ + { .vendor_id = 0x0bda, .product_id = 0xb00c }, + { .vendor_id = 0x0bda, .product_id = 0xc822 }, + + /* Realtek 8822CU Bluetooth devices */ + { .vendor_id = 0x13d3, .product_id = 0x3549 }, + + /* Realtek 8852AE Bluetooth devices */ + { .vendor_id = 0x0bda, .product_id = 0x2852 }, + { .vendor_id = 0x0bda, .product_id = 0xc852 }, + { .vendor_id = 0x0bda, .product_id = 0x385a }, + { .vendor_id = 0x0bda, .product_id = 0x4852 }, + { .vendor_id = 0x04c5, .product_id = 0x165c }, + { .vendor_id = 0x04ca, .product_id = 0x4006 }, + { .vendor_id = 0x0cb8, .product_id = 0xc549 }, + +#ifdef RTLBTFW_SUPPORTS_FW_V2 + /* Realtek 8852CE Bluetooth devices */ + { .vendor_id = 0x04ca, .product_id = 0x4007 }, + { .vendor_id = 0x04c5, .product_id = 0x1675 }, + { .vendor_id = 0x0cb8, .product_id = 0xc558 }, + { .vendor_id = 0x13d3, .product_id = 0x3587 }, + { .vendor_id = 0x13d3, .product_id = 0x3586 }, + { .vendor_id = 0x13d3, .product_id = 0x3592 }, +#endif + + /* Realtek 8852BE Bluetooth devices */ + { .vendor_id = 0x0cb8, .product_id = 0xc559 }, + { .vendor_id = 0x0bda, .product_id = 0x887b }, + { .vendor_id = 0x13d3, .product_id = 0x3571 }, + + /* Realtek 8723AE Bluetooth devices */ + { .vendor_id = 0x0930, .product_id = 0x021d }, + { .vendor_id = 0x13d3, .product_id = 0x3394 }, + + /* Realtek 8723BE Bluetooth devices */ + { .vendor_id = 0x0489, .product_id = 0xe085 }, + { .vendor_id = 0x0489, .product_id = 0xe08b }, + { .vendor_id = 0x04f2, .product_id = 0xb49f }, + { .vendor_id = 0x13d3, .product_id = 0x3410 }, + { .vendor_id = 0x13d3, .product_id = 0x3416 }, + { .vendor_id = 0x13d3, .product_id = 0x3459 }, + { .vendor_id = 0x13d3, .product_id = 0x3494 }, + + /* Realtek 8723BU Bluetooth devices */ + { .vendor_id = 0x7392, .product_id = 0xa611 }, + + /* Realtek 8723DE Bluetooth devices */ + { .vendor_id = 0x0bda, .product_id = 0xb009 }, + { .vendor_id = 0x2ff8, .product_id = 0xb011 }, + + /* Realtek 8761BUV Bluetooth devices */ + { .vendor_id = 0x2357, .product_id = 0x0604 }, + { .vendor_id = 0x0b05, .product_id = 0x190e }, + { .vendor_id = 0x2550, .product_id = 0x8761 }, + { .vendor_id = 0x0bda, .product_id = 0x8771 }, + { .vendor_id = 0x6655, .product_id = 0x8771 }, + { .vendor_id = 0x7392, .product_id = 0xc611 }, + { .vendor_id = 0x2b89, .product_id = 0x8761 }, + + /* Realtek 8821AE Bluetooth devices */ + { .vendor_id = 0x0b05, .product_id = 0x17dc }, + { .vendor_id = 0x13d3, .product_id = 0x3414 }, + { .vendor_id = 0x13d3, .product_id = 0x3458 }, + { .vendor_id = 0x13d3, .product_id = 0x3461 }, + { .vendor_id = 0x13d3, .product_id = 0x3462 }, + + /* Realtek 8822BE Bluetooth devices */ + { .vendor_id = 0x13d3, .product_id = 0x3526 }, + { .vendor_id = 0x0b05, .product_id = 0x185c }, + + /* Realtek 8822CE Bluetooth devices */ + { .vendor_id = 0x04ca, .product_id = 0x4005 }, + { .vendor_id = 0x04c5, .product_id = 0x161f }, + { .vendor_id = 0x0b05, .product_id = 0x18ef }, + { .vendor_id = 0x13d3, .product_id = 0x3548 }, + { .vendor_id = 0x13d3, .product_id = 0x3549 }, + { .vendor_id = 0x13d3, .product_id = 0x3553 }, + { .vendor_id = 0x13d3, .product_id = 0x3555 }, + { .vendor_id = 0x2ff8, .product_id = 0x3051 }, + { .vendor_id = 0x1358, .product_id = 0xc123 }, + { .vendor_id = 0x0bda, .product_id = 0xc123 }, + { .vendor_id = 0x0cb5, .product_id = 0xc547 }, +}; + +static int +rtlbt_is_realtek(struct libusb_device_descriptor *d) +{ + int i; + + /* Search looking for whether it's a Realtek-based device */ + for (i = 0; i < (int) nitems(rtlbt_list); i++) { + if ((rtlbt_list[i].product_id == d->idProduct) && + (rtlbt_list[i].vendor_id == d->idVendor)) { + rtlbt_info("found USB Realtek"); + return (1); + } + } + + /* Not found */ + return (0); +} + +static int +rtlbt_is_bluetooth(struct libusb_device *dev) +{ + struct libusb_config_descriptor *cfg; + const struct libusb_interface *ifc; + const struct libusb_interface_descriptor *d; + int r; + + r = libusb_get_active_config_descriptor(dev, &cfg); + if (r < 0) { + rtlbt_err("Cannot retrieve config descriptor: %s", + libusb_error_name(r)); + return (0); + } + + if (cfg->bNumInterfaces != 0) { + /* Only 0-th HCI/ACL interface is supported by downloader */ + ifc = &cfg->interface[0]; + if (ifc->num_altsetting != 0) { + /* BT HCI/ACL interface has no altsettings */ + d = &ifc->altsetting[0]; + /* Check if interface is a bluetooth */ + if (d->bInterfaceClass == LIBUSB_CLASS_WIRELESS && + d->bInterfaceSubClass == 0x01 && + d->bInterfaceProtocol == 0x01) { + rtlbt_info("found USB Realtek"); + libusb_free_config_descriptor(cfg); + return (1); + } + } + } + libusb_free_config_descriptor(cfg); + + /* Not found */ + return (0); +} + +static libusb_device * +rtlbt_find_device(libusb_context *ctx, int bus_id, int dev_id) +{ + libusb_device **list, *dev = NULL, *found = NULL; + struct libusb_device_descriptor d; + ssize_t cnt, i; + int r; + + cnt = libusb_get_device_list(ctx, &list); + if (cnt < 0) { + rtlbt_err("libusb_get_device_list() failed: code %lld", + (long long int) cnt); + return (NULL); + } + + /* + * Scan through USB device list. + */ + for (i = 0; i < cnt; i++) { + dev = list[i]; + if (bus_id == libusb_get_bus_number(dev) && + dev_id == libusb_get_device_address(dev)) { + /* Get the device descriptor for this device entry */ + r = libusb_get_device_descriptor(dev, &d); + if (r != 0) { + rtlbt_err("libusb_get_device_descriptor: %s", + libusb_strerror(r)); + break; + } + + /* For non-Realtek match on the vendor/product id */ + if (rtlbt_is_realtek(&d)) { + /* + * Take a reference so it's not freed later on. + */ + found = libusb_ref_device(dev); + break; + } + /* For Realtek vendor match on the interface class */ + if (d.idVendor == 0x0bda && rtlbt_is_bluetooth(dev)) { + /* + * Take a reference so it's not freed later on. + */ + found = libusb_ref_device(dev); + break; + } + } + } + + libusb_free_device_list(list, 1); + return (found); +} + +static void +rtlbt_dump_version(ng_hci_read_local_ver_rp *ver) +{ + rtlbt_info("hci_version 0x%02x", ver->hci_version); + rtlbt_info("hci_revision 0x%04x", le16toh(ver->hci_revision)); + rtlbt_info("lmp_version 0x%02x", ver->lmp_version); + rtlbt_info("lmp_subversion 0x%04x", le16toh(ver->lmp_subversion)); +} + +/* + * Parse ugen name and extract device's bus and address + */ + +static int +parse_ugen_name(char const *ugen, uint8_t *bus, uint8_t *addr) +{ + char *ep; + + if (strncmp(ugen, "ugen", 4) != 0) + return (-1); + + *bus = (uint8_t) strtoul(ugen + 4, &ep, 10); + if (*ep != '.') + return (-1); + + *addr = (uint8_t) strtoul(ep + 1, &ep, 10); + if (*ep != '\0') + return (-1); + + return (0); +} + +static void +usage(void) +{ + fprintf(stderr, + "Usage: rtlbtfw (-D) -d ugenX.Y (-f firmware path) (-I)\n"); + fprintf(stderr, " -D: enable debugging\n"); + fprintf(stderr, " -d: device to operate upon\n"); + fprintf(stderr, " -f: firmware path, if not default\n"); + fprintf(stderr, " -I: enable informational output\n"); + exit(127); +} + +int +main(int argc, char *argv[]) +{ + libusb_context *ctx = NULL; + libusb_device *dev = NULL; + libusb_device_handle *hdl = NULL; + ng_hci_read_local_ver_rp ver; + int r; + uint8_t bus_id = 0, dev_id = 0; + int devid_set = 0; + int n; + char *firmware_dir = NULL; + char *firmware_path = NULL; + char *config_path = NULL; + int retcode = 1; + const struct rtlbt_id_table *ic; + uint8_t rom_version; + struct rtlbt_firmware fw, cfg; + enum rtlbt_fw_type fw_type; + uint16_t fw_lmp_subversion; + + /* Parse command line arguments */ + while ((n = getopt(argc, argv, "Dd:f:hIm:p:v:")) != -1) { + switch (n) { + case 'd': /* ugen device name */ + devid_set = 1; + if (parse_ugen_name(optarg, &bus_id, &dev_id) < 0) + usage(); + break; + case 'D': + rtlbt_do_debug = 1; + break; + case 'f': /* firmware dir */ + if (firmware_dir) + free(firmware_dir); + firmware_dir = strdup(optarg); + break; + case 'I': + rtlbt_do_info = 1; + break; + case 'h': + default: + usage(); + break; + /* NOT REACHED */ + } + } + + /* Ensure the devid was given! */ + if (devid_set == 0) { + usage(); + /* NOTREACHED */ + } + + /* libusb setup */ + r = libusb_init(&ctx); + if (r != 0) { + rtlbt_err("libusb_init failed: code %d", r); + exit(127); + } + + rtlbt_debug("opening dev %d.%d", (int) bus_id, (int) dev_id); + + /* Find a device based on the bus/dev id */ + dev = rtlbt_find_device(ctx, bus_id, dev_id); + if (dev == NULL) { + rtlbt_err("device not found"); + goto shutdown; + } + + /* XXX enforce that bInterfaceNumber is 0 */ + + /* XXX enforce the device/product id if they're non-zero */ + + /* Grab device handle */ + r = libusb_open(dev, &hdl); + if (r != 0) { + rtlbt_err("libusb_open() failed: code %d", r); + goto shutdown; + } + + /* Check if ng_ubt is attached */ + r = libusb_kernel_driver_active(hdl, 0); + if (r < 0) { + rtlbt_err("libusb_kernel_driver_active() failed: code %d", r); + goto shutdown; + } + if (r > 0) { + rtlbt_info("Firmware has already been downloaded"); + retcode = 0; + goto shutdown; + } + + /* Get local version */ + r = rtlbt_read_local_ver(hdl, &ver); + if (r < 0) { + rtlbt_err("rtlbt_read_local_ver() failed code %d", r); + goto shutdown; + } + rtlbt_dump_version(&ver); + + ic = rtlbt_get_ic(ver.lmp_subversion, ver.hci_revision, + ver.hci_version); + if (ic == NULL) { + rtlbt_err("rtlbt_get_ic() failed: Unknown IC"); + goto shutdown; + } + + /* Default the firmware path */ + if (firmware_dir == NULL) + firmware_dir = strdup(_DEFAULT_RTLBT_FIRMWARE_PATH); + + firmware_path = rtlbt_get_fwname(ic->fw_name, firmware_dir, "_fw.bin"); + if (firmware_path == NULL) + goto shutdown; + + rtlbt_debug("firmware_path = %s", firmware_path); + + rtlbt_info("loading firmware %s", firmware_path); + + /* Read in the firmware */ + if (rtlbt_fw_read(&fw, firmware_path) <= 0) { + rtlbt_debug("rtlbt_fw_read() failed"); + return (-1); + } + + fw_type = rtlbt_get_fw_type(&fw, &fw_lmp_subversion); + if (fw_type == RTLBT_FW_TYPE_UNKNOWN && + (ic->flags & RTLBT_IC_FLAG_SIMPLE) == 0) { + rtlbt_debug("Unknown firmware type"); + goto shutdown; + } + + if (fw_type != RTLBT_FW_TYPE_UNKNOWN) { + + /* Match hardware and firmware lmp_subversion */ + if (fw_lmp_subversion != ver.lmp_subversion) { + rtlbt_err("firmware is for %x but this is a %x", + fw_lmp_subversion, ver.lmp_subversion); + goto shutdown; + } + + /* Query a ROM version */ + r = rtlbt_read_rom_ver(hdl, &rom_version); + if (r < 0) { + rtlbt_err("rtlbt_read_rom_ver() failed code %d", r); + goto shutdown; + } + rtlbt_debug("rom_version = %d", rom_version); + + /* Load in the firmware */ + r = rtlbt_parse_fwfile_v1(&fw, rom_version); + if (r < 0) { + rtlbt_err("Parseing firmware file failed"); + goto shutdown; + } + + config_path = rtlbt_get_fwname(ic->fw_name, firmware_dir, + "_config.bin"); + if (config_path == NULL) + goto shutdown; + + rtlbt_info("loading config %s", config_path); + + /* Read in the config file */ + if (rtlbt_fw_read(&cfg, config_path) <= 0) { + rtlbt_err("rtlbt_fw_read() failed"); + if ((ic->flags & RTLBT_IC_FLAG_CONFIG) != 0) + goto shutdown; + } else { + r = rtlbt_append_fwfile(&fw, &cfg); + rtlbt_fw_free(&cfg); + if (r < 0) { + rtlbt_err("Appending config file failed"); + goto shutdown; + } + } + } + + r = rtlbt_load_fwfile(hdl, &fw); + if (r < 0) { + rtlbt_debug("Loading firmware file failed"); + goto shutdown; + } + + /* free it */ + rtlbt_fw_free(&fw); + + rtlbt_info("Firmware download complete"); + + /* Execute Read Local Version one more time */ + r = rtlbt_read_local_ver(hdl, &ver); + if (r < 0) { + rtlbt_err("rtlbt_read_local_ver() failed code %d", r); + goto shutdown; + } + rtlbt_dump_version(&ver); + + retcode = 0; + + /* Ask kernel driver to probe and attach device again */ + r = libusb_reset_device(hdl); + if (r != 0) + rtlbt_err("libusb_reset_device() failed: %s", + libusb_strerror(r)); + +shutdown: + + /* Shutdown */ + + if (hdl != NULL) + libusb_close(hdl); + + if (dev != NULL) + libusb_unref_device(dev); + + if (ctx != NULL) + libusb_exit(ctx); + + if (retcode == 0) + rtlbt_info("Firmware download is successful!"); + else + rtlbt_err("Firmware download failed!"); + + return (retcode); +} diff --git a/usr.sbin/bluetooth/rtlbtfw/rtlbt_dbg.h b/usr.sbin/bluetooth/rtlbtfw/rtlbt_dbg.h new file mode 100644 index 000000000000..54c982119d40 --- /dev/null +++ b/usr.sbin/bluetooth/rtlbtfw/rtlbt_dbg.h @@ -0,0 +1,46 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2013 Adrian Chadd + * Copyright (c) 2019 Vladimir Kondratyev + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef __RTLBT_DEBUG_H__ +#define __RTLBT_DEBUG_H__ + +extern int rtlbt_do_debug; +extern int rtlbt_do_info; + +#define rtlbt_err(fmt, ...) \ + fprintf(stderr, "rtlbtfw: %s: "fmt"\n", __func__, ##__VA_ARGS__) +#define rtlbt_info(fmt, ...) do { \ + if (rtlbt_do_info) \ + fprintf(stderr, "%s: "fmt"\n", __func__, ##__VA_ARGS__);\ +} while (0) +#define rtlbt_debug(fmt, ...) do { \ + if (rtlbt_do_debug) \ + fprintf(stderr, "%s: "fmt"\n", __func__, ##__VA_ARGS__);\ +} while (0) + +#endif diff --git a/usr.sbin/bluetooth/rtlbtfw/rtlbt_fw.c b/usr.sbin/bluetooth/rtlbtfw/rtlbt_fw.c new file mode 100644 index 000000000000..bb3d20d79527 --- /dev/null +++ b/usr.sbin/bluetooth/rtlbtfw/rtlbt_fw.c @@ -0,0 +1,385 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2013 Adrian Chadd + * Copyright (c) 2019 Vladimir Kondratyev + * Copyright (c) 2023 Future Crew LLC. + * + * 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 +#include +#include + +#include "rtlbt_fw.h" +#include "rtlbt_dbg.h" + +static const struct rtlbt_id_table rtlbt_ic_id_table[] = { + { /* 8723A */ + .lmp_subversion = RTLBT_ROM_LMP_8723A, + .hci_revision = 0xb, + .hci_version = 0x6, + .flags = RTLBT_IC_FLAG_SIMPLE, + .fw_name = "rtl8723a", + }, { /* 8723B */ + .lmp_subversion = RTLBT_ROM_LMP_8723B, + .hci_revision = 0xb, + .hci_version = 0x6, + .fw_name = "rtl8723b", + }, { /* 8723D */ + .lmp_subversion = RTLBT_ROM_LMP_8723B, + .hci_revision = 0xd, + .hci_version = 0x8, + .flags = RTLBT_IC_FLAG_CONFIG, + .fw_name = "rtl8723d", + }, { /* 8821A */ + .lmp_subversion = RTLBT_ROM_LMP_8821A, + .hci_revision = 0xa, + .hci_version = 0x6, + .fw_name = "rtl8821a", + }, { /* 8821C */ + .lmp_subversion = RTLBT_ROM_LMP_8821A, + .hci_revision = 0xc, + .hci_version = 0x8, + .flags = RTLBT_IC_FLAG_MSFT, + .fw_name = "rtl8821c", + }, { /* 8761A */ + .lmp_subversion = RTLBT_ROM_LMP_8761A, + .hci_revision = 0xa, + .hci_version = 0x6, + .fw_name = "rtl8761a", + }, { /* 8761BU */ + .lmp_subversion = RTLBT_ROM_LMP_8761A, + .hci_revision = 0xb, + .hci_version = 0xa, + .fw_name = "rtl8761bu", + }, { /* 8822C with USB interface */ + .lmp_subversion = RTLBT_ROM_LMP_8822B, + .hci_revision = 0xc, + .hci_version = 0xa, + .flags = RTLBT_IC_FLAG_MSFT, + .fw_name = "rtl8822cu", + }, { /* 8822B */ + .lmp_subversion = RTLBT_ROM_LMP_8822B, + .hci_revision = 0xb, + .hci_version = 0x7, + .flags = RTLBT_IC_FLAG_CONFIG | RTLBT_IC_FLAG_MSFT, + .fw_name = "rtl8822b", + }, { /* 8852A */ + .lmp_subversion = RTLBT_ROM_LMP_8852A, + .hci_revision = 0xa, + .hci_version = 0xb, + .flags = RTLBT_IC_FLAG_MSFT, + .fw_name = "rtl8852au", + }, { /* 8852B */ + .lmp_subversion = RTLBT_ROM_LMP_8852A, + .hci_revision = 0xb, + .hci_version = 0xb, + .flags = RTLBT_IC_FLAG_MSFT, + .fw_name = "rtl8852bu", +#ifdef RTLBTFW_SUPPORTS_FW_V2 + }, { /* 8852C */ + .lmp_subversion = RTLBT_ROM_LMP_8852A, + .hci_revision = 0xc, + .hci_version = 0xc, + .flags = RTLBT_IC_FLAG_MSFT, + .fw_name = "rtl8852cu", + }, { /* 8851B */ + .lmp_subversion = RTLBT_ROM_LMP_8851B, + .hci_revision = 0xb, + .hci_version = 0xc, + .flags = RTLBT_IC_FLAG_MSFT, + .fw_name = "rtl8851bu", +#endif + }, +}; + +static const uint16_t project_ids[] = { + [ 0 ] = RTLBT_ROM_LMP_8723A, + [ 1 ] = RTLBT_ROM_LMP_8723B, + [ 2 ] = RTLBT_ROM_LMP_8821A, + [ 3 ] = RTLBT_ROM_LMP_8761A, + [ 7 ] = RTLBT_ROM_LMP_8703B, + [ 8 ] = RTLBT_ROM_LMP_8822B, + [ 9 ] = RTLBT_ROM_LMP_8723B, /* 8723DU */ + [ 10 ] = RTLBT_ROM_LMP_8821A, /* 8821CU */ + [ 13 ] = RTLBT_ROM_LMP_8822B, /* 8822CU */ + [ 14 ] = RTLBT_ROM_LMP_8761A, /* 8761BU */ + [ 18 ] = RTLBT_ROM_LMP_8852A, /* 8852AU */ + [ 19 ] = RTLBT_ROM_LMP_8723B, /* 8723FU */ + [ 20 ] = RTLBT_ROM_LMP_8852A, /* 8852BU */ + [ 25 ] = RTLBT_ROM_LMP_8852A, /* 8852CU */ + [ 33 ] = RTLBT_ROM_LMP_8822B, /* 8822EU */ + [ 36 ] = RTLBT_ROM_LMP_8851B, /* 8851BU */ +}; + +/* Signatures */ +static const uint8_t fw_header_sig_v1[8] = + {0x52, 0x65, 0x61, 0x6C, 0x74, 0x65, 0x63, 0x68}; /* Realtech */ +#ifdef RTLBTFW_SUPPORTS_FW_V2 +static const uint8_t fw_header_sig_v2[8] = + {0x52, 0x54, 0x42, 0x54, 0x43, 0x6F, 0x72, 0x65}; /* RTBTCore */ +#endif +static const uint8_t fw_ext_sig[4] = {0x51, 0x04, 0xFD, 0x77}; + +int +rtlbt_fw_read(struct rtlbt_firmware *fw, const char *fwname) +{ + int fd; + struct stat sb; + unsigned char *buf; + ssize_t r; + + fd = open(fwname, O_RDONLY); + if (fd < 0) { + warn("%s: open: %s", __func__, fwname); + return (0); + } + + if (fstat(fd, &sb) != 0) { + warn("%s: stat: %s", __func__, fwname); + close(fd); + return (0); + } + + buf = calloc(1, sb.st_size); + if (buf == NULL) { + warn("%s: calloc", __func__); + close(fd); + return (0); + } + + /* XXX handle partial reads */ + r = read(fd, buf, sb.st_size); + if (r < 0) { + warn("%s: read", __func__); + free(buf); + close(fd); + return (0); + } + + if (r != sb.st_size) { + rtlbt_err("read len %d != file size %d", + (int) r, + (int) sb.st_size); + free(buf); + close(fd); + return (0); + } + + /* We have everything, so! */ + + memset(fw, 0, sizeof(*fw)); + + fw->fwname = strdup(fwname); + fw->len = sb.st_size; + fw->buf = buf; + + close(fd); + return (1); +} + +void +rtlbt_fw_free(struct rtlbt_firmware *fw) +{ + if (fw->fwname) + free(fw->fwname); + if (fw->buf) + free(fw->buf); + memset(fw, 0, sizeof(*fw)); +} + +char * +rtlbt_get_fwname(const char *fw_name, const char *prefix, const char *suffix) +{ + char *fwname; + + asprintf(&fwname, "%s/%s%s", prefix, fw_name, suffix); + + return (fwname); +} + +const struct rtlbt_id_table * +rtlbt_get_ic(uint16_t lmp_subversion, uint16_t hci_revision, + uint8_t hci_version) +{ + unsigned int i; + + for (i = 0; i < nitems(rtlbt_ic_id_table); i++) { + if (rtlbt_ic_id_table[i].lmp_subversion == lmp_subversion && + rtlbt_ic_id_table[i].hci_revision == hci_revision && + rtlbt_ic_id_table[i].hci_version == hci_version) + return (rtlbt_ic_id_table + i); + } + + return (NULL); +} + +enum rtlbt_fw_type +rtlbt_get_fw_type(struct rtlbt_firmware *fw, uint16_t *fw_lmp_subversion) +{ + enum rtlbt_fw_type fw_type; + size_t fw_header_len; + uint8_t *ptr; + uint8_t opcode, oplen, project_id; + + if (fw->len < 8) { + rtlbt_err("firmware file too small"); + return (RTLBT_FW_TYPE_UNKNOWN); + } + + if (memcmp(fw->buf, fw_header_sig_v1, sizeof(fw_header_sig_v1)) == 0) { + fw_type = RTLBT_FW_TYPE_V1; + fw_header_len = sizeof(struct rtlbt_fw_header_v1); + } else +#ifdef RTLBTFW_SUPPORTS_FW_V2 + if (memcmp(fw->buf, fw_header_sig_v2, sizeof(fw_header_sig_v2)) == 0) { + fw_type = RTLBT_FW_TYPE_V2; + fw_header_len = sizeof(struct rtlbt_fw_header_v2); + } else +#endif + return (RTLBT_FW_TYPE_UNKNOWN); + + if (fw->len < fw_header_len + sizeof(fw_ext_sig) + 4) { + rtlbt_err("firmware file too small"); + return (RTLBT_FW_TYPE_UNKNOWN); + } + + ptr = fw->buf + fw->len - sizeof(fw_ext_sig); + if (memcmp(ptr, fw_ext_sig, sizeof(fw_ext_sig)) != 0) { + rtlbt_err("invalid extension section signature"); + return (RTLBT_FW_TYPE_UNKNOWN); + } + + do { + opcode = *--ptr; + oplen = *--ptr; + ptr -= oplen; + + rtlbt_debug("code=%x len=%x", opcode, oplen); + + if (opcode == 0x00) { + if (oplen != 1) { + rtlbt_err("invalid instruction length"); + return (RTLBT_FW_TYPE_UNKNOWN); + } + project_id = *ptr; + rtlbt_debug("project_id=%x", project_id); + if (project_id >= nitems(project_ids) || *** 1024 LINES SKIPPED *** From nobody Sun Dec 22 03:37: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 4YG6LG2H5pz5hwn4; Sun, 22 Dec 2024 03:37:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YG6LF2Hvbz4DFd; Sun, 22 Dec 2024 03:37:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734838677; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Y5xefTgf2nOoYmWMc+5H1QL9vxxkMpqc57cjL1Tg6j0=; b=Ijz6WE5m0tJy0Bpg1LLPe61chC1yyC+iGpKjDcO5uydMswpyl9//SfvG6av01h8keF5Xxr lpJWHTFR9EURzMSc7+zzKVYjuj2+DkKiHI5yblwCN/47YAd/+X5P5sHobhc1KQwwDWldzS 6GzVCmjwOzO41zjDZBh0djwoQftnC2NtChsczqXdRohmo24GThkFVG0EgSUXmz6oYdZ/z2 BdQP3bA0PvsSnvi7JjBgMoEiXbW/MLNIUywPWdOZjNzbRZ71/4g9K/tt/TD378Jd/Uv/OR HX17RBF8/f3CNsviXsWIOkv0sipYIoT8AjP60gBBQUPrISFbDPoAbkedwVUMkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734838677; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Y5xefTgf2nOoYmWMc+5H1QL9vxxkMpqc57cjL1Tg6j0=; b=rJovLy2S+iRyJa2YtdVMyT73bK+VlRG/tqAnRrngoU7imQ/YWbNzWLZos7Bbmsb1nlZd90 ckXcUAeHuvvWJQBZKUT/f95dlbOXZA3QUMSne1RklcBxCXX8AuF8ETA/J0wHKbs0x6gca6 XXaKve92oTZgJxaCtbqGpV7OqPlC0F+sSjLXlygHyogduoJPuhw9oLW7BRsHx3XxBrJhnP QyA3rrSTfFvx9+9E5LHJsOcprQx0afaqMbzPoGZ8BhBvBmb+BSAQEsUT3PHjHr5F4cEJRK yU8fdCNCwIkoKJI543ZbceqnKZV7ivR6hg/u7bwmOlchNp2FAzFLvkXDI62f1A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734838677; a=rsa-sha256; cv=none; b=S/9zl+ziNNFqUGh9xCvTg3R7WVIgL9w7Ye2nvsioMhYZfXV6hx8xIGvt7xCbPypvqHxjy4 qHJ8P+kdDGGl24fSWCVWmlHREEzIAIVg2zsXcIvEuD2dnzOihltt+R/fFXxb4ENF/ov7Nx L7orJ5CcxW+jAnzMM2q0Ee4tPqqMToOCNAsTajpPIfLi6cJqOz0XRO5qsCH6n1IQdrVn+P LDUSoRC+7fMppe14EEdUleIelUVUMsuTndpuN20OoyFTo/hagDa3LJBzlfVNxkh/psF9pB OxVWQ+jhB5h7EfpNXVI+mbd/xaEBSWaEonUTGDBVzzSeeYR/mx6cL5AM7+DyYw== 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 4YG6LF1F4YzsRw; Sun, 22 Dec 2024 03:37:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BM3bveV053311; Sun, 22 Dec 2024 03:37:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BM3bvK0053308; Sun, 22 Dec 2024 03:37:57 GMT (envelope-from git) Date: Sun, 22 Dec 2024 03:37:57 GMT Message-Id: <202412220337.4BM3bvK0053308@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: e908df969af2 - stable/14 - ng_ubt_intel: Ignore unexpected HCI events List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: 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: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e908df969af2384def482c0629ce1c83c018b415 Auto-Submitted: auto-generated The branch stable/14 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=e908df969af2384def482c0629ce1c83c018b415 commit e908df969af2384def482c0629ce1c83c018b415 Author: Vladimir Kondratyev AuthorDate: 2024-11-06 23:27:20 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-12-22 03:35:08 +0000 ng_ubt_intel: Ignore unexpected HCI events If Intel firmware is already in operational mode at boot that takes place at warm boot, BT adaptor can generate extra HCI events which interferes with firmware mode detection logic. Ignore them. Sponsored by: Future Crew LLC MFC after: 1 month Reviewed by: bz Differential Revision: https://reviews.freebsd.org/D46736 (cherry picked from commit 0b23c50ae834d11842810304e4ddad2754298ada) --- sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c | 27 +++++++++++++++++++++++ sys/netgraph/bluetooth/drivers/ubt/ng_ubt_intel.c | 5 +++-- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c b/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c index 649c479d1d9f..64b41c0a328d 100644 --- a/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c +++ b/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c @@ -530,6 +530,7 @@ static const STRUCT_USB_HOST_ID ubt_devs[] = * Size of both command and response buffers are passed in length field of * corresponding structures in "Parameter Total Length" format i.e. * not including HCI packet headers. + * Expected event code must be placed into "Event code" of the response buffer. * * Must not be used after USB transfers have been configured in attach routine. */ @@ -568,6 +569,12 @@ ubt_do_hci_request(struct usb_device *udev, struct ubt_hci_cmd *cmd, if (evt == NULL) return (USB_ERR_NORMAL_COMPLETION); + /* Save operation code if we expect completion event in response */ + if(((struct ubt_hci_event *)evt)->header.event == + NG_HCI_EVENT_COMMAND_COMPL) + ((struct ubt_hci_event_command_compl *)evt)->opcode = + cmd->opcode; + /* Initialize INTR endpoint xfer and wait for response */ mtx_init(&mtx, "ubt pb", NULL, MTX_DEF | MTX_NEW); @@ -841,6 +848,8 @@ ubt_probe_intr_callback(struct usb_xfer *xfer, usb_error_t error) struct ubt_hci_event *evt = usbd_xfer_softc(xfer); struct usb_page_cache *pc; int actlen; + struct ubt_hci_evhdr evhdr; + uint16_t opcode; usbd_xfer_status(xfer, &actlen, NULL, NULL, NULL); @@ -848,7 +857,25 @@ ubt_probe_intr_callback(struct usb_xfer *xfer, usb_error_t error) case USB_ST_TRANSFERRED: if (actlen > UBT_HCI_EVENT_SIZE(evt)) actlen = UBT_HCI_EVENT_SIZE(evt); + if (actlen < sizeof(evhdr)) + goto submit_next; pc = usbd_xfer_get_frame(xfer, 0); + usbd_copy_out(pc, 0, &evhdr, sizeof(evhdr)); + /* Check for expected event code */ + if (evt->header.event != 0 && + (evt->header.event != evhdr.event)) + goto submit_next; + /* For completion events check operation code as well */ + if (evt->header.event == NG_HCI_EVENT_COMMAND_COMPL) { + if (actlen < sizeof(struct ubt_hci_event_command_compl)) + goto submit_next; + usbd_copy_out(pc, + offsetof(struct ubt_hci_event_command_compl, opcode), + &opcode, sizeof(opcode)); + if (opcode != + ((struct ubt_hci_event_command_compl *)evt)->opcode) + goto submit_next; + } usbd_copy_out(pc, 0, evt, actlen); /* OneShot mode */ wakeup(evt); diff --git a/sys/netgraph/bluetooth/drivers/ubt/ng_ubt_intel.c b/sys/netgraph/bluetooth/drivers/ubt/ng_ubt_intel.c index f93b74b264ad..c4410b7b2c80 100644 --- a/sys/netgraph/bluetooth/drivers/ubt/ng_ubt_intel.c +++ b/sys/netgraph/bluetooth/drivers/ubt/ng_ubt_intel.c @@ -119,14 +119,14 @@ ubt_intel_do_hci_request(struct usb_device *udev, uint16_t opcode, cmd.opcode = htole16(opcode); evt = malloc(offsetof(struct ubt_hci_event_command_compl, data) + resp_len, M_TEMP, M_ZERO | M_WAITOK); + evt->header.event = NG_HCI_EVENT_COMMAND_COMPL; evt->header.length = resp_len + UBT_HCI_EVENT_COMPL_HEAD_SIZE; error = ubt_do_hci_request(udev, &cmd, evt, UBT_INTEL_HCICMD_TIMEOUT); if (error != USB_ERR_NORMAL_COMPLETION) goto exit; - if (evt->header.event == NG_HCI_EVENT_COMMAND_COMPL && - evt->header.length == resp_len + UBT_HCI_EVENT_COMPL_HEAD_SIZE) + if (evt->header.length == resp_len + UBT_HCI_EVENT_COMPL_HEAD_SIZE) memcpy(resp, evt->data, resp_len); else error = USB_ERR_INVAL; @@ -150,6 +150,7 @@ ubt_intel_get_img_type(struct usb_device *udev) uint8_t *data; evt = malloc(UBT_INTEL_MAX_EVT_SIZE, M_TEMP, M_ZERO | M_WAITOK); + evt->header.event = NG_HCI_EVENT_COMMAND_COMPL; evt->header.length = UBT_INTEL_MAX_EVT_SIZE - sizeof(struct ubt_hci_evhdr); From nobody Sun Dec 22 03:50:52 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 4YG6d91TdCz5hyP9; Sun, 22 Dec 2024 03:50:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YG6d90xHDz4GgV; Sun, 22 Dec 2024 03:50:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734839453; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3+ftvBT4SPTMlwPXA0vHYcIL1yPBO9+7s0KZFJGXpvc=; b=adOMC3A0IcdgzwGWTWXwUDD8xw6yb2NIbrRagSyecyGMvz8ante3/AMzqEGJMM++7WUxFB bMp3dGeVTTXosFgbkc9rwGWZ+PN5Y/7mPksLfg5VIk4OmQ6vgPET41yZkJc68BG1UIV3Lj JVp3XNEzVf+xtbtX1/kMNhxqDso8n5pAgfCdzGpWwIEKRJ7Ap8Bv189iBNSNOhhPUbvZyN uesVvIIgwvr7W+GV5OCA2dQHxQ9UpUybdXKOEz6tCxb5L+vyHoQqp4qRFM/TN4s3Jt5AJ4 rbVmoghJytIQ14uzE5QE+AAnVHyem9P+Vb6iPY90I7I2Donh+PvN/fK2WzVsCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734839453; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3+ftvBT4SPTMlwPXA0vHYcIL1yPBO9+7s0KZFJGXpvc=; b=HBYIHBK/tV7mGayyEYjrvbVNMFs1MP23FiRm+nQI4qzJ5OAMlBQf6d7nO4e8dao9iyghO0 O7iiWAG/rCjB9zP1Mwjg52+8LgI3h7ufn1TXD5lzhHoaEWDrssinx9s/cjdVWAO27L9lwU 9yQpH7gfbhSsLIB5iTEabq11fq/yILl+Jth2eKE1byMHzeiuUxpSuUiSpvUx6n0eTfLnlX vI2hYsQs1jQ+30MyB6l9ZybvPpL+glzPfkuDdXQbISC/OOumFQdV8NBCaP4rMEF8yoyDWW VoXafs3dKJust2sFwF3MsMU4Gj427Q0ntYKGDwhgfIh2t9BaCRRXPy5ArbQRXw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734839453; a=rsa-sha256; cv=none; b=Pq/BF8SX5IuolQqJPJyztJMxV/c+5zn3wTNJt40laeSiAyZFAgS79qOpy7ncyG2wZRVTmp nZ2s6MzUTFY3BwQQi11vH/eyWccbcWlVexF2IOkPwMD1d/o3ACsYEJrdQFYoU+ly7LH7sa h7Ssoqbmx9Ga2aPjpu6alsRgHGHEd2HjTHl2GzGXIxH9x4dNC/TPj6c1KKD5wJsqcnkxT/ 4nddDiQu3Cz3PDU/91CqzzmXyXypum1uiayOjwac+/w4Wus5jBtW1mzGQExtMKdLNurIab qI2Iu655wMgOc+4WoB85EgjEaUsj3YtR1T12sV2YZC8evZabWnxmpJV8pY3OOw== 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 4YG6d90XPfzs3n; Sun, 22 Dec 2024 03:50:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BM3oqbH081848; Sun, 22 Dec 2024 03:50:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BM3oqV6081845; Sun, 22 Dec 2024 03:50:52 GMT (envelope-from git) Date: Sun, 22 Dec 2024 03:50:52 GMT Message-Id: <202412220350.4BM3oqV6081845@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: 05abe2c9076e - stable/13 - uhid(4): update ugd_actlen in USB_GET_REPORT ioctl 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: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 05abe2c9076e35c353c755702e6cf4a6ea59eab7 Auto-Submitted: auto-generated The branch stable/13 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=05abe2c9076e35c353c755702e6cf4a6ea59eab7 commit 05abe2c9076e35c353c755702e6cf4a6ea59eab7 Author: Matthew Nygard Dodd AuthorDate: 2024-11-18 04:15:01 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-12-22 03:49:07 +0000 uhid(4): update ugd_actlen in USB_GET_REPORT ioctl USB_GET_REPORT ioctl is documented to update ugd_actlen on return with the number of bytes copied. It does not do this. Reviewed by: wulf PR: 282790 MFC after: 1 week (cherry picked from commit 0b5d86b38ae9aec92ef96b9227a404a2df3c9234) --- sys/dev/usb/input/uhid.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/dev/usb/input/uhid.c b/sys/dev/usb/input/uhid.c index f6447dd0d3c6..03279669b000 100644 --- a/sys/dev/usb/input/uhid.c +++ b/sys/dev/usb/input/uhid.c @@ -633,11 +633,13 @@ uhid_ioctl(struct usb_fifo *fifo, u_long cmd, void *addr, default: return (EINVAL); } + size = imin(ugd->ugd_maxlen, size); if (id != 0) error = copyin(ugd->ugd_data, &id, 1); if (error == 0) error = uhid_get_report(sc, ugd->ugd_report_type, id, - NULL, ugd->ugd_data, imin(ugd->ugd_maxlen, size)); + NULL, ugd->ugd_data, size); + ugd->ugd_actlen = size; break; case USB_SET_REPORT: From nobody Sun Dec 22 03:50: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 4YG6dB2CdMz5hy7Y; Sun, 22 Dec 2024 03:50:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YG6dB1Hs2z4Gys; Sun, 22 Dec 2024 03:50:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734839454; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4PslL2UVBUB/wpynJxKOuStBi7RKqKLBpfItUj1JyDs=; b=G7FPKb/dKMHpyTMpeRzwdC8ptTtmANkMmCEwryqgVFL432SjoYXRXJYe0XI5/bJ2qTB/qa p1OwZfUajMfb6rI9xAGpY4vq6ohh3WapXAcLtCu/20BewBBIczoefLbNqeVUZiAPFOL1gX 2sMXt2IFTTs5egEZKwOFVLWGWOyDbWBSLmb9P2tcNxzDehQA3NUCxF98Tv509X7lLOymFH sSEvbvfaT2LwZfYKTCNRgd4nKSU5pe3DC+vYkG1FE6EZRkhRV5L14yPGPMPoAMAfZi2lTf n1zYIPUbCl4EHPpK4s4jasbmGFPoVEekzIKKuNsxnLcMdjOtCQhKPXD+zRTQDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734839454; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4PslL2UVBUB/wpynJxKOuStBi7RKqKLBpfItUj1JyDs=; b=XOvJuHt6a2Xx4gt7X7ibjXoP+h0e9Pww4mADt+leeGzOISyeqDBzH0r4IioQFG4HZdxtBS JUsESIVgu6RbXdmaeXEVMD2RWV+vi44cXuG8foIMDajbrwTLi+ne+eEFzI8wF56pOdNaRX 0kfONbJNgevsmNv5EPqtSp7WWeVm9IfXxSf2w+9UWyj6quX15jVnQu6P6X+rm9hCHbMbh9 dz7epZV95V4JJpBPxqOFXJA8AD50VDxLFI90/pXWiCa3UTWH7DigU4n221++dpnmk+xJdv GCxXv9lKc7h/iIX5qYXW9ELzq2eDCCk7+Sq3sY/Le+MPMJlYZXdEKx09j+uQ7Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734839454; a=rsa-sha256; cv=none; b=Xm/8F7wGGiihUQxqkjCQvjisIf7nCITw7HUvI4aXHVhQeb49EiznezDZW10jnUQen7BVY4 Ov9MwSGq/IPf+awFsrAiCAFEDiKqV6gBL6BgcE9pU84uAVblG8VJBVkZvglKFUlHc/TEO+ 29mI4TKy2xRexaS+/bYfBr3dg0wkqw8n9qfeQ0++SY2s4U3415jhBES27sln/XYqKH/A7u LgJrPfSabHGDe099KGapCoswbuUSoHoG9z4+K5zFSRL2kZLOhNuMAW/uJ+U44+VRZyQMiP Atl0+3mcB52i8I6ZXJqhx7Ce04rXnGow/Fnpy8M0iZJ5asGfgaZGK6NPkXAGfg== 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 4YG6dB0vNHzsWR; Sun, 22 Dec 2024 03:50:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BM3osgx081941; Sun, 22 Dec 2024 03:50:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BM3osGf081938; Sun, 22 Dec 2024 03:50:54 GMT (envelope-from git) Date: Sun, 22 Dec 2024 03:50:54 GMT Message-Id: <202412220350.4BM3osGf081938@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: ca6cd0e57cca - stable/13 - hidraw(4): update hgd_actlen in HIDRAW_GET_REPORT ioctl 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: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ca6cd0e57cca4a39a2947c35b9e5f0ef11979fb5 Auto-Submitted: auto-generated The branch stable/13 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=ca6cd0e57cca4a39a2947c35b9e5f0ef11979fb5 commit ca6cd0e57cca4a39a2947c35b9e5f0ef11979fb5 Author: Matthew Nygard Dodd AuthorDate: 2024-11-18 04:25:10 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-12-22 03:49:07 +0000 hidraw(4): update hgd_actlen in HIDRAW_GET_REPORT ioctl HIDRAW_GET_REPORT ioctl is documented to update hgd_actlen on return with the number of bytes copied. It does not do this. Reviewed by: wulf PR: 282790 MFC after: 1 week (cherry picked from commit f4f46a2eef3be6d19c65a4ca4ee70f365dd5be4f) --- sys/dev/hid/hidraw.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/sys/dev/hid/hidraw.c b/sys/dev/hid/hidraw.c index 703e16d8bf8f..bd5f99bd4eba 100644 --- a/sys/dev/hid/hidraw.c +++ b/sys/dev/hid/hidraw.c @@ -570,6 +570,7 @@ hidraw_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct hidraw_devinfo *hd; const char *devname; uint32_t size; + hid_size_t actsize; int id, len; int error = 0; @@ -748,16 +749,16 @@ hidraw_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, } size = MIN(hgd->hgd_maxlen, size); buf = HIDRAW_LOCAL_ALLOC(local_buf, size); - error = hid_get_report(sc->sc_dev, buf, size, NULL, + actsize = 0; + error = hid_get_report(sc->sc_dev, buf, size, &actsize, hgd->hgd_report_type, id); if (!error) - error = copyout(buf, hgd->hgd_data, size); + error = copyout(buf, hgd->hgd_data, actsize); HIDRAW_LOCAL_FREE(local_buf, buf); + hgd->hgd_actlen = actsize; #ifdef COMPAT_FREEBSD32 - /* - * HIDRAW_GET_REPORT is declared _IOWR, but hgd is not written - * so we don't call update_hgd32(). - */ + if (hgd32 != NULL) + update_hgd32(hgd, hgd32); #endif return (error); From nobody Sun Dec 22 07:31: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 4YGCWm6tHsz5jC97; Sun, 22 Dec 2024 07:31: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YGCWm6R3Pz4ZNK; Sun, 22 Dec 2024 07:31:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734852692; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=C4K9+/1k266WP05HjmlZHjE1Ze6T362GBXv7wRaK008=; b=MMb9R6Vz0VRRx69GRpLZEmevN88vmeLhgHtSjJmmg06aQVczRS/zbuHeYTP2++GI2XieoB E3ifraCa64kb2T9/4E8S68fIcp4TScx+pGU4B43NPjT+NZngFqv+0BrP1bPMFN0Ll3Wf9N O+7WQ/S64sed3XQTp80W3o8cRAjogDPwInt91ggKjBUohqt2CHvdVzC7Sal/mFA9KW4UcI KArx2wUL2Jko/tkwQRLKzqB+APfZUEcFPJ5zjzYSF80FWYBGDjudvVlXR8izZ1sCcJJfji N8ts4xCszJyxXeQtU18W0eDaHpgFo8QaY2Y2CA1afaKdo+mcEiu0ObZpGYAIOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734852692; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=C4K9+/1k266WP05HjmlZHjE1Ze6T362GBXv7wRaK008=; b=OsWDQD02J6h1wjCJrsZC4WL5Bo22SyqfdoRbqXhHxa4z2SyRTs7QW7mQ9erWCjhiIRF8Db I68G79uVOsmbrHXjDqJg5GizJpcCipMxQLyvyg62HC1mB/Lx7iMwgApwTuzsjciSug3zh1 7b/Wo/vs79klkspHjcnG6J7/BNJOLHaWj8IGC4xAz+vz8H9VaytFeoYWvA1ivdh9kRVlH9 TxB6o8TOW6V0TGoPAEm//hErCQcsNnlPQxiiDKDHesYupjdtzTmLM/xrSGQZJrYB/Np9g+ MswA4extS1LmkG+m96L9OPicacGb8ED1XOMfLlXpMdauFA2ZVTJ1Zg784S9Rpw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734852692; a=rsa-sha256; cv=none; b=e7pfMbwZt3WJ3dIFxuVSkyX+7G/vjFAG0IS6Baa65iZkJiHr9QtEy4FCOG4+wbSjqStMl9 nmJ+TNgUX+iOJLw+BvffwRUGpsiECpX7IN+XQNg6yb35jqdSI4WI0ArRlK3EJkFFWflzQS BSd26/G0Kani40BwDFIzItIMa4fEG9aH4PRPRdxHqCAib4cHP67Mwhid3zPADinPFQgiq8 2zNHvRkvWOPnClbL9m9U6HpD12XBddVCg5PlV8aBlmlLuFtm6Hpl+Fac13gw9Edkbp7ZVx lj1EPMAxLe8a5wrzNsLcXsrABlmNJ/9o06jng5/jyKwO+Vi7wBFRBVhLYK+d7g== 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 4YGCWm63Hpz10LC; Sun, 22 Dec 2024 07:31:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BM7VWKr099639; Sun, 22 Dec 2024 07:31:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BM7VWAW099636; Sun, 22 Dec 2024 07:31:32 GMT (envelope-from git) Date: Sun, 22 Dec 2024 07:31:32 GMT Message-Id: <202412220731.4BM7VWAW099636@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Xin LI Subject: git: 97cf82ebe022 - stable/14 - Revise qsort(3) reflect POSIX.1-2024 update. 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: delphij X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 97cf82ebe02210daf14801f40164adc98e5197f4 Auto-Submitted: auto-generated The branch stable/14 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=97cf82ebe02210daf14801f40164adc98e5197f4 commit 97cf82ebe02210daf14801f40164adc98e5197f4 Author: Xin LI AuthorDate: 2024-10-28 06:15:21 +0000 Commit: Xin LI CommitDate: 2024-12-22 07:30:52 +0000 Revise qsort(3) reflect POSIX.1-2024 update. Reviewed by: emaste, trasz Differential Revision: https://reviews.freebsd.org/D47262 (cherry picked from commit 3df1abdfd9c309efbdc7884d6b6f6fe25efcb397) --- lib/libc/stdlib/qsort.3 | 49 ++++++++++++++++++++++++------------------------- 1 file changed, 24 insertions(+), 25 deletions(-) diff --git a/lib/libc/stdlib/qsort.3 b/lib/libc/stdlib/qsort.3 index 6e585cecbf48..e2e29e7cf04f 100644 --- a/lib/libc/stdlib/qsort.3 +++ b/lib/libc/stdlib/qsort.3 @@ -29,9 +29,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" @(#)qsort.3 8.1 (Berkeley) 6/4/93 -.\" -.Dd April 19, 2023 +.Dd October 25, 2024 .Dt QSORT 3 .Os .Sh NAME @@ -250,16 +248,8 @@ untrue. The .Fn qsort_s function behaves the same as -.Fn qsort_r , except that: -.Bl -dash -.It -The order of arguments is different -.It -The order of arguments to -.Fa compar -is different -.It -If +.Fn qsort_r , +except that if .Fa nmemb or .Fa size @@ -279,7 +269,6 @@ returns an error. Note that the handler is called before .Fn qsort_s returns the error, and the handler function might not return. -.El .Sh RETURN VALUES The .Fn qsort @@ -335,16 +324,21 @@ main(void) .Sh COMPATIBILITY The order of arguments for the comparison function used with .Fn qsort_r -is different from the one used by -.Fn qsort_s , +is historically different from the one used by +.Fn qsort_s and the GNU libc implementation of .Fn qsort_r . -When porting software written for GNU libc, it is usually possible -to replace +However, as of +.Fx 14.0 , +the .Fn qsort_r -with -.Fn qsort_s -to work around this problem. +has been updated so that the +.Fa thunk +parameter appears last to match +.St -p1003.1-2024 . +Both the historical and the updated interfaces are now accepted +via C11 generic selection and C++ polymorphism, +but the updated interface is recommended for portable applications. .Pp .Fn qsort_s is part of the @@ -428,11 +422,15 @@ were unable to allocate memory. .Sh STANDARDS The .Fn qsort -function -conforms to +function conforms to .St -isoC . +The +.Fn qsort_r +function conforms to +.St -p1003.1-2024 . +The .Fn qsort_s -conforms to +function conforms to .St -isoC-2011 K.3.6.3.2. .Sh HISTORY @@ -444,4 +442,5 @@ In .Fx 14.0 , the prototype of .Fn qsort_r -was updated to match POSIX. +was updated to match +.St -p1003.1-2024 . From nobody Sun Dec 22 07:33: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 4YGCYk53gSz5jCVj; Sun, 22 Dec 2024 07:33: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YGCYk3SvVz4ZYZ; Sun, 22 Dec 2024 07:33:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734852794; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qdjsR3OG+3sXPI+NI5vBIp9WnxAmIW6FiG0uV6wXPYw=; b=YU+Bi/yMqn9eWbkO+VEHsRqToK0/wFdoL8Ck3wzM/N9XgFNWPXpaAdYYUtKz+eiQw63uy4 GjE4AFr1eNF/xmpTUoiQ3RW3s7uhKqlwcAAkA52lSNKaYqqzzvG8nvV2ypbryJMMeEX8+z VkXGv7lHLQl94dHJvF9+9/1/GHpjPzfScPVRi8UuCD6nqj18QMdF+tCBukUklTg2Iv/rJt 8mJX20hxi1rA3mAZcFDDMYyy0gD4p3Gq9jPjD5bslYYwcbonLqjbzRK5ldq58m8jOtLlcB QoBMfBggiJWRB3oTMwx6L2HirKvw4Tk4OJrk0RfxAfyqrMAoLMx4hk43uATxMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734852794; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qdjsR3OG+3sXPI+NI5vBIp9WnxAmIW6FiG0uV6wXPYw=; b=nEESafAfViRKGa3FKzBzTQICE6hXsDe3tMP2MbPfhtyyHNx/G9Jctx+AoNjWGToBDkYnx1 /U63M/iqLoeteeAdhmzWi1ztdHYIkg5gfbtKD38Ma+VW5kGtlQx1EDUf6blilw1ijtTSoZ PXD3KkAcveQzbwmDDnpw0Vbb2qDgBtR15D+IANs5aMr1aRbu8LS1ViSc/pDnnYjJ9+BSsm MQ44/w0yuyloAO7t8IwVJ5DMMcpEeIS8d4mGM+r/6MAzJhASx4/wsl6yJwzIqj94Cf2sHq sjlCVJ16kOpyFHpgEeaanYDSEt86QjZClmhhr4tzT4pDV8c/t/VkLMWaY931+A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734852794; a=rsa-sha256; cv=none; b=wObM2SO4DOXaT7QQBniZLH9MmVkY6FUMacI7WKthLl11qr+aBRRdAAJd1vmD+Jzq+Pg8rT NO8Psg2eMlizi0vvWjqyLr5nYShuZdVmiaf98P30n5ro7/ncBbbz/t3XWJbnZurB59G5gQ pBvSj8Q+CJkWJ0Yr26cyncOGgQWE3Ab4Khq+q6Puq7FZ9JKgH+wJPX0DA0UxRqvxi1720d SLdXzngtPWPhHqhbuf726/5bS35hvKnv+HNTKw9trl7QnB5KMydSYdVjpk58XvBd08O2jn JUi24lgp+08ewNbCd2kVMabEDp0tyTxjV+8symAfJiOH20WXof6qiQUwHokbjg== 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 4YGCYk2kC3z10VD; Sun, 22 Dec 2024 07:33:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BM7XEec001362; Sun, 22 Dec 2024 07:33:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BM7XDK2001359; Sun, 22 Dec 2024 07:33:13 GMT (envelope-from git) Date: Sun, 22 Dec 2024 07:33:13 GMT Message-Id: <202412220733.4BM7XDK2001359@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Xin LI Subject: git: 679e92405637 - stable/14 - MFC: MFV: xz 5.6.2. 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: delphij X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 679e924056374cedeef858d3b150ea89c1c42946 Auto-Submitted: auto-generated The branch stable/14 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=679e924056374cedeef858d3b150ea89c1c42946 commit 679e924056374cedeef858d3b150ea89c1c42946 Author: Xin LI AuthorDate: 2024-06-04 01:14:43 +0000 Commit: Xin LI CommitDate: 2024-12-22 07:32:38 +0000 MFC: MFV: xz 5.6.2. (cherry picked from commit 3b35e7ee8de9b0260149a2b77e87a2b9c7a36244) --- contrib/xz/AUTHORS | 49 +- contrib/xz/COPYING | 103 +- contrib/xz/COPYING.0BSD | 11 + contrib/xz/ChangeLog | 17790 ++++++++++--------- contrib/xz/README | 57 +- contrib/xz/THANKS | 13 +- contrib/xz/TODO | 4 - contrib/xz/doxygen/Doxyfile | 2698 +-- contrib/xz/doxygen/update-doxygen | 137 +- contrib/xz/src/common/mythread.h | 30 +- contrib/xz/src/common/sysdefs.h | 18 +- contrib/xz/src/common/tuklib_common.h | 27 +- contrib/xz/src/common/tuklib_config.h | 2 + contrib/xz/src/common/tuklib_cpucores.c | 5 +- contrib/xz/src/common/tuklib_cpucores.h | 5 +- contrib/xz/src/common/tuklib_exit.c | 5 +- contrib/xz/src/common/tuklib_exit.h | 9 +- contrib/xz/src/common/tuklib_gettext.h | 5 +- contrib/xz/src/common/tuklib_integer.h | 56 +- contrib/xz/src/common/tuklib_mbstr.h | 5 +- contrib/xz/src/common/tuklib_mbstr_fw.c | 5 +- contrib/xz/src/common/tuklib_mbstr_width.c | 5 +- contrib/xz/src/common/tuklib_open_stdxxx.c | 5 +- contrib/xz/src/common/tuklib_open_stdxxx.h | 5 +- contrib/xz/src/common/tuklib_physmem.c | 25 +- contrib/xz/src/common/tuklib_physmem.h | 5 +- contrib/xz/src/common/tuklib_progname.c | 5 +- contrib/xz/src/common/tuklib_progname.h | 5 +- contrib/xz/src/liblzma/api/lzma.h | 31 +- contrib/xz/src/liblzma/api/lzma/base.h | 25 +- contrib/xz/src/liblzma/api/lzma/bcj.h | 10 +- contrib/xz/src/liblzma/api/lzma/block.h | 5 +- contrib/xz/src/liblzma/api/lzma/check.h | 5 +- contrib/xz/src/liblzma/api/lzma/container.h | 17 +- contrib/xz/src/liblzma/api/lzma/delta.h | 5 +- contrib/xz/src/liblzma/api/lzma/filter.h | 11 +- contrib/xz/src/liblzma/api/lzma/hardware.h | 5 +- contrib/xz/src/liblzma/api/lzma/index.h | 42 +- contrib/xz/src/liblzma/api/lzma/index_hash.h | 5 +- contrib/xz/src/liblzma/api/lzma/lzma12.h | 7 +- contrib/xz/src/liblzma/api/lzma/stream_flags.h | 5 +- contrib/xz/src/liblzma/api/lzma/version.h | 9 +- contrib/xz/src/liblzma/api/lzma/vli.h | 10 +- contrib/xz/src/liblzma/check/check.c | 5 +- contrib/xz/src/liblzma/check/check.h | 5 +- contrib/xz/src/liblzma/check/crc32_arm64.h | 122 + contrib/xz/src/liblzma/check/crc32_fast.c | 158 +- contrib/xz/src/liblzma/check/crc32_small.c | 5 +- contrib/xz/src/liblzma/check/crc32_table.c | 34 +- contrib/xz/src/liblzma/check/crc32_table_be.h | 4 +- contrib/xz/src/liblzma/check/crc32_table_le.h | 4 +- contrib/xz/src/liblzma/check/crc32_tablegen.c | 23 +- contrib/xz/src/liblzma/check/crc32_x86.S | 5 +- contrib/xz/src/liblzma/check/crc64_fast.c | 446 +- contrib/xz/src/liblzma/check/crc64_small.c | 5 +- contrib/xz/src/liblzma/check/crc64_table.c | 16 +- contrib/xz/src/liblzma/check/crc64_table_be.h | 4 +- contrib/xz/src/liblzma/check/crc64_table_le.h | 4 +- contrib/xz/src/liblzma/check/crc64_tablegen.c | 15 +- contrib/xz/src/liblzma/check/crc64_x86.S | 5 +- contrib/xz/src/liblzma/check/crc_common.h | 137 + contrib/xz/src/liblzma/check/crc_macros.h | 30 - contrib/xz/src/liblzma/check/crc_x86_clmul.h | 428 + contrib/xz/src/liblzma/common/alone_decoder.c | 5 +- contrib/xz/src/liblzma/common/alone_decoder.h | 5 +- contrib/xz/src/liblzma/common/alone_encoder.c | 5 +- contrib/xz/src/liblzma/common/auto_decoder.c | 5 +- .../xz/src/liblzma/common/block_buffer_decoder.c | 5 +- .../xz/src/liblzma/common/block_buffer_encoder.c | 5 +- .../xz/src/liblzma/common/block_buffer_encoder.h | 5 +- contrib/xz/src/liblzma/common/block_decoder.c | 5 +- contrib/xz/src/liblzma/common/block_decoder.h | 5 +- contrib/xz/src/liblzma/common/block_encoder.c | 5 +- contrib/xz/src/liblzma/common/block_encoder.h | 5 +- .../xz/src/liblzma/common/block_header_decoder.c | 5 +- .../xz/src/liblzma/common/block_header_encoder.c | 5 +- contrib/xz/src/liblzma/common/block_util.c | 5 +- contrib/xz/src/liblzma/common/common.c | 5 +- contrib/xz/src/liblzma/common/common.h | 5 +- .../xz/src/liblzma/common/easy_buffer_encoder.c | 5 +- .../xz/src/liblzma/common/easy_decoder_memusage.c | 5 +- contrib/xz/src/liblzma/common/easy_encoder.c | 5 +- .../xz/src/liblzma/common/easy_encoder_memusage.c | 5 +- contrib/xz/src/liblzma/common/easy_preset.c | 5 +- contrib/xz/src/liblzma/common/easy_preset.h | 10 +- contrib/xz/src/liblzma/common/file_info.c | 5 +- .../xz/src/liblzma/common/filter_buffer_decoder.c | 7 +- .../xz/src/liblzma/common/filter_buffer_encoder.c | 5 +- contrib/xz/src/liblzma/common/filter_common.c | 16 +- contrib/xz/src/liblzma/common/filter_common.h | 5 +- contrib/xz/src/liblzma/common/filter_decoder.c | 28 +- contrib/xz/src/liblzma/common/filter_decoder.h | 5 +- contrib/xz/src/liblzma/common/filter_encoder.c | 38 +- contrib/xz/src/liblzma/common/filter_encoder.h | 5 +- .../xz/src/liblzma/common/filter_flags_decoder.c | 5 +- .../xz/src/liblzma/common/filter_flags_encoder.c | 5 +- .../xz/src/liblzma/common/hardware_cputhreads.c | 5 +- contrib/xz/src/liblzma/common/hardware_physmem.c | 5 +- contrib/xz/src/liblzma/common/index.c | 5 +- contrib/xz/src/liblzma/common/index.h | 5 +- contrib/xz/src/liblzma/common/index_decoder.c | 16 +- contrib/xz/src/liblzma/common/index_decoder.h | 5 +- contrib/xz/src/liblzma/common/index_encoder.c | 5 +- contrib/xz/src/liblzma/common/index_encoder.h | 5 +- contrib/xz/src/liblzma/common/index_hash.c | 5 +- contrib/xz/src/liblzma/common/lzip_decoder.c | 5 +- contrib/xz/src/liblzma/common/lzip_decoder.h | 5 +- contrib/xz/src/liblzma/common/memcmplen.h | 37 +- contrib/xz/src/liblzma/common/microlzma_decoder.c | 5 +- contrib/xz/src/liblzma/common/microlzma_encoder.c | 5 +- contrib/xz/src/liblzma/common/outqueue.c | 5 +- contrib/xz/src/liblzma/common/outqueue.h | 10 +- .../xz/src/liblzma/common/stream_buffer_decoder.c | 5 +- .../xz/src/liblzma/common/stream_buffer_encoder.c | 5 +- contrib/xz/src/liblzma/common/stream_decoder.c | 5 +- contrib/xz/src/liblzma/common/stream_decoder.h | 5 +- contrib/xz/src/liblzma/common/stream_decoder_mt.c | 5 +- contrib/xz/src/liblzma/common/stream_encoder.c | 5 +- contrib/xz/src/liblzma/common/stream_encoder_mt.c | 5 +- .../xz/src/liblzma/common/stream_flags_common.c | 5 +- .../xz/src/liblzma/common/stream_flags_common.h | 5 +- .../xz/src/liblzma/common/stream_flags_decoder.c | 5 +- .../xz/src/liblzma/common/stream_flags_encoder.c | 5 +- contrib/xz/src/liblzma/common/string_conversion.c | 26 +- contrib/xz/src/liblzma/common/vli_decoder.c | 5 +- contrib/xz/src/liblzma/common/vli_encoder.c | 5 +- contrib/xz/src/liblzma/common/vli_size.c | 5 +- contrib/xz/src/liblzma/delta/delta_common.c | 5 +- contrib/xz/src/liblzma/delta/delta_common.h | 5 +- contrib/xz/src/liblzma/delta/delta_decoder.c | 10 +- contrib/xz/src/liblzma/delta/delta_decoder.h | 5 +- contrib/xz/src/liblzma/delta/delta_encoder.c | 5 +- contrib/xz/src/liblzma/delta/delta_encoder.h | 5 +- contrib/xz/src/liblzma/delta/delta_private.h | 5 +- contrib/xz/src/liblzma/liblzma.pc.in | 6 +- contrib/xz/src/liblzma/liblzma_generic.map | 4 +- contrib/xz/src/liblzma/liblzma_linux.map | 4 +- contrib/xz/src/liblzma/lz/lz_decoder.c | 48 +- contrib/xz/src/liblzma/lz/lz_decoder.h | 116 +- contrib/xz/src/liblzma/lz/lz_encoder.c | 9 +- contrib/xz/src/liblzma/lz/lz_encoder.h | 15 +- contrib/xz/src/liblzma/lz/lz_encoder_hash.h | 5 +- contrib/xz/src/liblzma/lz/lz_encoder_hash_table.h | 4 +- contrib/xz/src/liblzma/lz/lz_encoder_mf.c | 5 +- contrib/xz/src/liblzma/lzma/fastpos.h | 5 +- contrib/xz/src/liblzma/lzma/fastpos_table.c | 4 +- contrib/xz/src/liblzma/lzma/fastpos_tablegen.c | 17 +- contrib/xz/src/liblzma/lzma/lzma2_decoder.c | 5 +- contrib/xz/src/liblzma/lzma/lzma2_decoder.h | 5 +- contrib/xz/src/liblzma/lzma/lzma2_encoder.c | 5 +- contrib/xz/src/liblzma/lzma/lzma2_encoder.h | 5 +- contrib/xz/src/liblzma/lzma/lzma_common.h | 41 +- contrib/xz/src/liblzma/lzma/lzma_decoder.c | 760 +- contrib/xz/src/liblzma/lzma/lzma_decoder.h | 5 +- contrib/xz/src/liblzma/lzma/lzma_encoder.c | 18 +- contrib/xz/src/liblzma/lzma/lzma_encoder.h | 5 +- .../src/liblzma/lzma/lzma_encoder_optimum_fast.c | 5 +- .../src/liblzma/lzma/lzma_encoder_optimum_normal.c | 7 +- contrib/xz/src/liblzma/lzma/lzma_encoder_presets.c | 5 +- contrib/xz/src/liblzma/lzma/lzma_encoder_private.h | 9 +- contrib/xz/src/liblzma/rangecoder/price.h | 5 +- contrib/xz/src/liblzma/rangecoder/price_table.c | 4 +- contrib/xz/src/liblzma/rangecoder/price_tablegen.c | 22 +- contrib/xz/src/liblzma/rangecoder/range_common.h | 14 +- contrib/xz/src/liblzma/rangecoder/range_decoder.h | 839 +- contrib/xz/src/liblzma/rangecoder/range_encoder.h | 5 +- contrib/xz/src/liblzma/simple/arm.c | 5 +- contrib/xz/src/liblzma/simple/arm64.c | 5 +- contrib/xz/src/liblzma/simple/armthumb.c | 5 +- contrib/xz/src/liblzma/simple/ia64.c | 5 +- contrib/xz/src/liblzma/simple/powerpc.c | 5 +- contrib/xz/src/liblzma/simple/riscv.c | 755 + contrib/xz/src/liblzma/simple/simple_coder.c | 5 +- contrib/xz/src/liblzma/simple/simple_coder.h | 22 +- contrib/xz/src/liblzma/simple/simple_decoder.c | 5 +- contrib/xz/src/liblzma/simple/simple_decoder.h | 5 +- contrib/xz/src/liblzma/simple/simple_encoder.c | 5 +- contrib/xz/src/liblzma/simple/simple_encoder.h | 5 +- contrib/xz/src/liblzma/simple/simple_private.h | 5 +- contrib/xz/src/liblzma/simple/sparc.c | 5 +- contrib/xz/src/liblzma/simple/x86.c | 16 +- contrib/xz/src/liblzma/validate_map.sh | 6 +- contrib/xz/src/lzmainfo/lzmainfo.1 | 4 +- contrib/xz/src/lzmainfo/lzmainfo.c | 5 +- contrib/xz/src/xz/args.c | 186 +- contrib/xz/src/xz/args.h | 8 +- contrib/xz/src/xz/coder.c | 607 +- contrib/xz/src/xz/coder.h | 42 +- contrib/xz/src/xz/file_io.c | 144 +- contrib/xz/src/xz/file_io.h | 21 +- contrib/xz/src/xz/hardware.c | 11 +- contrib/xz/src/xz/hardware.h | 5 +- contrib/xz/src/xz/list.c | 31 +- contrib/xz/src/xz/list.h | 5 +- contrib/xz/src/xz/main.c | 91 +- contrib/xz/src/xz/main.h | 5 +- contrib/xz/src/xz/message.c | 94 +- contrib/xz/src/xz/message.h | 16 +- contrib/xz/src/xz/mytime.c | 105 +- contrib/xz/src/xz/mytime.h | 11 +- contrib/xz/src/xz/options.c | 7 +- contrib/xz/src/xz/options.h | 5 +- contrib/xz/src/xz/private.h | 26 +- contrib/xz/src/xz/sandbox.c | 355 + contrib/xz/src/xz/sandbox.h | 43 + contrib/xz/src/xz/signals.c | 29 +- contrib/xz/src/xz/signals.h | 5 +- contrib/xz/src/xz/suffix.c | 17 +- contrib/xz/src/xz/suffix.h | 5 +- contrib/xz/src/xz/util.c | 36 +- contrib/xz/src/xz/util.h | 19 +- contrib/xz/src/xz/xz.1 | 469 +- contrib/xz/src/xzdec/xzdec.1 | 6 +- contrib/xz/src/xzdec/xzdec.c | 180 +- lib/liblzma/Makefile | 1 + lib/liblzma/config.h | 123 +- usr.bin/xz/Makefile | 1 + 217 files changed, 15386 insertions(+), 13436 deletions(-) diff --git a/contrib/xz/AUTHORS b/contrib/xz/AUTHORS index 69bbfc3ef609..5eff238ae413 100644 --- a/contrib/xz/AUTHORS +++ b/contrib/xz/AUTHORS @@ -2,22 +2,20 @@ Authors of XZ Utils =================== - XZ Utils is developed and maintained by Lasse Collin - and Jia Tan . + XZ Utils is developed and maintained by + Lasse Collin . Major parts of liblzma are based on code written by Igor Pavlov, specifically the LZMA SDK . Without this code, XZ Utils wouldn't exist. - The SHA-256 implementation in liblzma is based on the code found from - 7-Zip , which has a modified version of the SHA-256 - code found from Crypto++ . The SHA-256 code - in Crypto++ was written by Kevin Springle and Wei Dai. + The SHA-256 implementation in liblzma is based on code written by + Wei Dai in Crypto++ Library . - Some scripts have been adapted from gzip. The original versions - were written by Jean-loup Gailly, Charles Levert, and Paul Eggert. - Andrew Dudman helped adapting the scripts and their man pages for - XZ Utils. + A few scripts have been adapted from GNU gzip. The original + versions were written by Jean-loup Gailly, Charles Levert, and + Paul Eggert. Andrew Dudman helped adapting the scripts and their + man pages for XZ Utils. The initial version of the threaded .xz decompressor was written by Sebastian Andrzej Siewior. @@ -25,15 +23,36 @@ Authors of XZ Utils The initial version of the .lz (lzip) decoder was written by Michał Górny. - CLMUL-accelerated CRC code was contributed by Ilya Kurdyukov. + Architecture-specific CRC optimizations were contributed by + Ilya Kurdyukov, Hans Jansen, and Chenxi Mao. Other authors: - Jonathan Nieder - Joachim Henke - The GNU Autotools-based build system contains files from many authors, - which I'm not trying to list here. + Special author: Jia Tan was a co-maintainer in 2022-2024. He and + the team behind him inserted a backdoor (CVE-2024-3094) into + XZ Utils 5.6.0 and 5.6.1 releases. He suddenly disappeared when + this was discovered. - Several people have contributed fixes or reported bugs. Most of them - are mentioned in the file THANKS. + Many people have contributed improvements or reported bugs. + Most of these people are mentioned in the file THANKS. + + The translations of the command line tools and man pages have been + contributed by many people via the Translation Project: + + - https://translationproject.org/domain/xz.html + - https://translationproject.org/domain/xz-man.html + + The authors of the translated man pages are in the header comments + of the man page files. In the source package, the authors of the + translations are in po/*.po and po4a/*.po files. + + Third-party code whose authors aren't listed here: + + - GNU getopt_long() in the 'lib' directory is included for + platforms that don't have a usable getopt_long(). + + - The build system files from GNU Autoconf, GNU Automake, + GNU Libtool, GNU Gettext, Autoconf Archive, and related files. diff --git a/contrib/xz/COPYING b/contrib/xz/COPYING index e54eeacfbf3f..aed21531497c 100644 --- a/contrib/xz/COPYING +++ b/contrib/xz/COPYING @@ -3,74 +3,81 @@ XZ Utils Licensing ================== Different licenses apply to different files in this package. Here - is a rough summary of which licenses apply to which parts of this - package (but check the individual files to be sure!): + is a summary of which licenses apply to which parts of this package: - - liblzma is in the public domain. + - liblzma is under the BSD Zero Clause License (0BSD). - - xz, xzdec, and lzmadec command line tools are in the public - domain unless GNU getopt_long had to be compiled and linked - in from the lib directory. The getopt_long code is under - GNU LGPLv2.1+. + - The command line tools xz, xzdec, lzmadec, and lzmainfo are + under 0BSD except that, on systems that don't have a usable + getopt_long, GNU getopt_long is compiled and linked in from the + 'lib' directory. The getopt_long code is under GNU LGPLv2.1+. - The scripts to grep, diff, and view compressed files have been - adapted from gzip. These scripts and their documentation are - under GNU GPLv2+. + adapted from GNU gzip. These scripts (xzgrep, xzdiff, xzless, + and xzmore) are under GNU GPLv2+. The man pages of the scripts + are under 0BSD; they aren't based on the man pages of GNU gzip. - - All the documentation in the doc directory and most of the - XZ Utils specific documentation files in other directories - are in the public domain. + - Most of the XZ Utils specific documentation that is in + plain text files (like README, INSTALL, PACKAGERS, NEWS, + and ChangeLog) are under 0BSD unless stated otherwise in + the file itself. The files xz-file-format.txt and + lzma-file-format.xt are in the public domain but may + be distributed under the terms of 0BSD too. - Note: The JavaScript files (under the MIT license) have - been removed from the Doxygen-generated HTML version of the - liblzma API documentation. Doxygen itself is under the GNU GPL - but the remaining files generated by Doxygen are not affected - by the licenses used in Doxygen because Doxygen licensing has - the following exception: + - Translated messages and man pages are under 0BSD except that + some old translations are in the public domain. - "Documents produced by doxygen are derivative works - derived from the input used in their production; - they are not affected by this license." + - Test files and test code in the 'tests' directory, and + debugging utilities in the 'debug' directory are under + the BSD Zero Clause License (0BSD). - - Translated messages are in the public domain. + - The GNU Autotools based build system contains files that are + under GNU GPLv2+, GNU GPLv3+, and a few permissive licenses. + These files don't affect the licensing of the binaries being + built. - - The build system contains public domain files, and files that - are under GNU GPLv2+ or GNU GPLv3+. None of these files end up - in the binaries being built. + - The 'extra' directory contains files that are under various + free software licenses. These aren't built or installed as + part of XZ Utils. - - Test files and test code in the tests directory, and debugging - utilities in the debug directory are in the public domain. + For the files under the BSD Zero Clause License (0BSD), if + a copyright notice is needed, the following is sufficient: - - The extra directory may contain public domain files, and files - that are under various free software licenses. + Copyright (C) The XZ Utils authors and contributors - You can do whatever you want with the files that have been put into - the public domain. If you find public domain legally problematic, - take the previous sentence as a license grant. If you still find - the lack of copyright legally problematic, you have too many - lawyers. - - As usual, this software is provided "as is", without any warranty. - - If you copy significant amounts of public domain code from XZ Utils + If you copy significant amounts of 0BSD-licensed code from XZ Utils into your project, acknowledging this somewhere in your software is polite (especially if it is proprietary, non-free software), but - naturally it is not legally required. Here is an example of a good - notice to put into "about box" or into documentation: + it is not legally required by the license terms. Here is an example + of a good notice to put into "about box" or into documentation: This software includes code from XZ Utils . The following license texts are included in the following files: + - COPYING.0BSD: BSD Zero Clause License - COPYING.LGPLv2.1: GNU Lesser General Public License version 2.1 - COPYING.GPLv2: GNU General Public License version 2 - COPYING.GPLv3: GNU General Public License version 3 - Note that the toolchain (compiler, linker etc.) may add some code - pieces that are copyrighted. Thus, it is possible that e.g. liblzma - binary wouldn't actually be in the public domain in its entirety - even though it contains no copyrighted code from the XZ Utils source - package. - - If you have questions, don't hesitate to ask the author(s) for more - information. + A note about old XZ Utils releases: + + XZ Utils releases 5.4.6 and older and 5.5.1alpha have a + significant amount of code put into the public domain and + that obviously remains so. The switch from public domain to + 0BSD for newer releases was made in Febrary 2024 because + public domain has (real or perceived) legal ambiguities in + some jurisdictions. + + There is very little *practical* difference between public + domain and 0BSD. The main difference likely is that one + shouldn't claim that 0BSD-licensed code is in the public + domain; 0BSD-licensed code is copyrighted but available under + an extremely permissive license. Neither 0BSD nor public domain + require retaining or reproducing author, copyright holder, or + license notices when distributing the software. (Compare to, + for example, BSD 2-Clause "Simplified" License which does have + such requirements.) + + If you have questions, don't hesitate to ask for more information. + The contact information is in the README file. diff --git a/contrib/xz/COPYING.0BSD b/contrib/xz/COPYING.0BSD new file mode 100644 index 000000000000..4322122aecf1 --- /dev/null +++ b/contrib/xz/COPYING.0BSD @@ -0,0 +1,11 @@ +Permission to use, copy, modify, and/or distribute this +software for any purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL +WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL +THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR +CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, +NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/contrib/xz/ChangeLog b/contrib/xz/ChangeLog index 4dd0978ef313..c7795974ba23 100644 --- a/contrib/xz/ChangeLog +++ b/contrib/xz/ChangeLog @@ -1,11756 +1,12662 @@ -commit 49053c0a649f4c8bd2b8d97ce915f401fbc0f3d9 -Author: Jia Tan -Date: 2023-10-31 22:30:29 +0800 +commit 3ec664d3f652133136587a51d4505b1abe1acdd7 +Author: Lasse Collin +Date: 2024-05-29 18:03:51 +0300 - Bump version and soname for 5.4.5. + Bump version and soname for 5.6.2 src/liblzma/Makefile.am | 2 +- src/liblzma/api/lzma/version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) -commit 84c0cfc556287628df871703672879e530d0391f -Author: Jia Tan -Date: 2023-11-01 20:18:30 +0800 +commit 3cc0aa702e50b786c52c6f3d3f831a635c4df197 +Author: Lasse Collin +Date: 2024-05-29 18:03:04 +0300 - Add NEWS for 5.4.5. + Add NEWS for 5.6.2 - NEWS | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 74 insertions(+) + NEWS | 130 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 130 insertions(+) -commit d90ed84db9770712e2421e170076b43bda9b64a7 +commit 526d3f7f2c2d5e134157d08b37fb5fd0b125799e Author: Lasse Collin -Date: 2023-10-31 21:41:09 +0200 +Date: 2024-05-29 18:03:04 +0300 - liblzma: Fix compilation of fastpos_tablegen.c. - - The macro lzma_attr_visibility_hidden has to be defined to make - fastpos.h usable. The visibility attribute is irrelevant to - fastpos_tablegen.c so simply #define the macro to an empty value. - - fastpos_tablegen.c is never built by the included build systems - and so the problem wasn't noticed earlier. It's just a standalone - program for generating fastpos_table.c. - - Fixes: https://github.com/tukaani-project/xz/pull/69 - Thanks to GitHub user Jamaika1. + Add NEWS for 5.4.7 - src/liblzma/lzma/fastpos_tablegen.c | 2 ++ - 1 file changed, 2 insertions(+) + NEWS | 89 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 89 insertions(+) -commit 9b1268538b0b2c6c0a121f95165de65fc71ad23c -Author: Jia Tan -Date: 2023-10-31 21:51:40 +0800 +commit 660b09279e8f544acf120d29194d5c3051b484eb +Author: Lasse Collin +Date: 2024-05-29 18:03:04 +0300 - Build: Fix text wrapping in an output message. + Add NEWS for 5.2.13 - configure.ac | 9 +++++---- - 1 file changed, 5 insertions(+), 4 deletions(-) + NEWS | 115 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 115 insertions(+) -commit 068ee436f4a8a706125ef43e8228b30001b1554e +commit 7d76282dac766c0ced8ae24e0f7ce0005f3e377d Author: Lasse Collin -Date: 2023-10-22 17:59:11 +0300 +Date: 2024-05-29 17:47:13 +0300 - liblzma: Use lzma_always_inline in memcmplen.h. + Translations: Run po4a/update-po + + Now the files are in the new formatting without source file + line numbers. Future updates should keep the diffs much smaller. - src/liblzma/common/memcmplen.h | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) + po4a/de.po | 1592 ++++++++++--------- + po4a/fr.po | 4450 +++++++++++++++++----------------------------------- + po4a/ko.po | 1592 ++++++++++--------- + po4a/pt_BR.po | 4817 ++++++++++++++++++--------------------------------------- + po4a/ro.po | 1592 ++++++++++--------- + po4a/uk.po | 1592 ++++++++++--------- + 6 files changed, 6114 insertions(+), 9521 deletions(-) -commit 6cdf0a7b7974baf58c1fd20ec3278f3b84ae56e5 +commit 4470c3f7d8954bb47b280ec07ad0bd4be2223083 Author: Lasse Collin -Date: 2023-10-30 17:43:03 +0200 +Date: 2024-05-29 17:44:53 +0300 - liblzma: #define lzma_always_inline in common.h. + Translations: Run "make -C po update-po" + + In the past this wasn't done before releases; the Git repository + just contained the files from the Translation Project. But this + way it is clearer when comparing release tarballs against the + Git repository. In future releases this might no longer be necessary + within a stable branch as the .po files won't change so easily anymore + when creating a tarball. - src/liblzma/common/common.h | 17 +++++++++++++++++ - 1 file changed, 17 insertions(+) + po/ca.po | 567 +++++++++++++++++++++++++--------------- + po/cs.po | 821 +++++++++++++++++++++++++++++++++++++-------------------- + po/da.po | 809 +++++++++++++++++++++++++++++++++++--------------------- + po/de.po | 403 ++++++++++++++-------------- + po/eo.po | 403 ++++++++++++++-------------- + po/es.po | 403 ++++++++++++++-------------- + po/fi.po | 578 +++++++++++++++++++++++++--------------- + po/fr.po | 538 +++++++++++++++++++++++--------------- + po/hr.po | 403 ++++++++++++++-------------- + po/hu.po | 403 ++++++++++++++-------------- + po/it.po | 854 +++++++++++++++++++++++++++++++++++++++--------------------- + po/ko.po | 403 ++++++++++++++-------------- + po/pl.po | 403 ++++++++++++++-------------- + po/pt.po | 842 +++++++++++++++++++++++++++++++++++++++-------------------- + po/pt_BR.po | 567 +++++++++++++++++++++++++--------------- + po/ro.po | 403 ++++++++++++++-------------- + po/sr.po | 838 ++++++++++++++++++++++++++++++++++++++-------------------- + po/sv.po | 403 ++++++++++++++-------------- + po/tr.po | 567 +++++++++++++++++++++++++--------------- + po/uk.po | 403 ++++++++++++++-------------- + po/vi.po | 403 ++++++++++++++-------------- + po/zh_CN.po | 417 +++++++++++++++-------------- + po/zh_TW.po | 558 ++++++++++++++++++++++++--------------- + 23 files changed, 7257 insertions(+), 5132 deletions(-) -commit 33daad3961a4f07f3902b40f13e823e6e43e85da +commit 33b8a85face5392b5ac843bdbe3a72f024cad6ef Author: Lasse Collin -Date: 2023-10-22 17:15:32 +0300 +Date: 2024-05-29 16:33:24 +0300 - liblzma: Use lzma_attr_visibility_hidden on private extern declarations. + Build: Update po/*.po files only when needed - These variables are internal to liblzma and not exposed in the API. + When po/xz.pot doesn't exist, running "make" or "make dist" will + create it. Then the .po files will be updated but only if they + actually would change more than the POT-Creation-Date line. + Then the .gmo files would be generated from the .po files. + This is the case before and after this commit. + + However, "make dist" and thus "make mydist" did a forced update + to the files, updating them even if the only change was the + POT-Creation-Date line. This had pros and cons: It made it clear + that the .po file really is in sync with the recent strings in + the package. On the other hand, it added noise in form of changed + files in the source tree and distribution tarballs. It can be + ignored with something like "diff -I'^"POT-Creation-Date: '" but + it's still a minor annoyance *if* there's not enough value in + having the most recent timestamp. + + Setting DIST_DEPENDS_ON_UPDATE_PO = no means that such forced + update won't happen in "make dist" anymore. However, the "mydist" + target will use xz.pot-update target which is the same target that + is run when xz.pot doesn't exist at all yet. Thus "mydist" will + ensure that the translations are up to date, without noise from + changes that would affect only the POT-Creation-Date line. + + Note that po4a always uses msgmerge with --update, so POT-Creation-Date + in the man page translations is never the only change in .po files. + In that sense this commit makes the message translations behave more + similarly to the man page translations. + + Distribution tarballs will still have non-reproducible POT-Creation-Date + in po/xz.pot and po4a/xz-man.pot but those are just two files. Even they + could be made reproducible from a Git timestamp if desired. + + (cherry picked from commit 9284f1aea31f0eb23e2ea72f7218b271e2234762) - src/liblzma/check/check.h | 7 +++++++ - src/liblzma/common/stream_flags_common.h | 3 +++ - src/liblzma/lz/lz_encoder_hash.h | 1 + - src/liblzma/lzma/fastpos.h | 1 + - src/liblzma/rangecoder/price.h | 1 + - 5 files changed, 13 insertions(+) + Makefile.am | 3 ++- + po/Makevars | 6 +++++- + 2 files changed, 7 insertions(+), 2 deletions(-) -commit 6961a5ac7df178bfc2b7a181c40575847bc3035f +commit 09daebd66b55799bbc495b84310a86c91bbfc1c8 Author: Lasse Collin -Date: 2023-10-22 17:08:39 +0300 +Date: 2024-05-28 21:10:33 +0300 - liblzma: #define lzma_attr_visibility_hidden in common.h. - - In ELF shared libs: + po4a/update-po: Disable wrapping in .pot and .po files - -fvisibility=hidden affects definitions of symbols but not - declarations.[*] This doesn't affect direct calls to functions - inside liblzma as a linker can replace a call to lzma_foo@plt - with a call directly to lzma_foo when -fvisibility=hidden is used. - - [*] It has to be like this because otherwise every installed - header file would need to explictly set the symbol visibility - to default. + The .po files from the Translation Project come with unwrapped + strings so this matches it. - When accessing extern variables that aren't defined in the - same translation unit, compiler assumes that the variable has - the default visibility and thus indirection is needed. Unlike - function calls, linker cannot optimize this. + This may reduce the noise in diffs too. When the beginning of + a paragraph had changed, the rest of the lines got rewrapped + in msgsid. Now it's just one very long line that changes when + a paragraph has been edited. - Using __attribute__((__visibility__("hidden"))) with the extern - variable declarations tells the compiler that indirection isn't - needed because the definition is in the same shared library. + The --add-location=file option was removed as redundant. The line + numbers don't exist in the .pot file due to --porefs file and thus + they cannot get copied to the .po files either. - About 15+ years ago, someone told me that it would be good if - the CRC tables would be defined in the same translation unit - as the C code of the CRC functions. While I understood that it - could help a tiny amount, I didn't want to change the code because - a separate translation unit for the CRC tables was needed for the - x86 assembly code anyway. But when visibility attributes are - supported, simply marking the extern declaration with the - hidden attribute will get identical result. When there are only - a few affected variables, this is trivial to do. I wish I had - understood this back then already. + (cherry picked from commit 4beba1cd62d7f8f7a6f1e899b68292d94c53b599) - src/liblzma/common/common.h | 11 +++++++++++ - 1 file changed, 11 insertions(+) + po4a/update-po | 15 +++++++++++---- + 1 file changed, 11 insertions(+), 4 deletions(-) -commit 5b9e16764905d06fa8e8339ba185ddfee304e5fb +commit 51ad72dae4e516e9292f6f399bd1e4970b77f7c1 Author: Lasse Collin -Date: 2023-09-30 22:54:28 +0300 +Date: 2024-05-28 18:36:53 +0300 - liblzma: Refer to MinGW-w64 instead of MinGW in the API headers. + Update contact info in README - MinGW (formely a MinGW.org Project, later the MinGW.OSDN Project - at ) has GCC 9.2.0 as the - most recent GCC package (released 2021-02-02). The project might - still be alive but majority of people have switched to MinGW-w64. - Thus it seems clearer to refer to MinGW-w64 in our API headers too. - Building with MinGW is likely to still work but I haven't tested it - in the recent years. + (cherry picked from commit b14c130a58a649f9a73392eeb122cb252327c569) - src/liblzma/api/lzma.h | 4 ++-- - src/liblzma/api/lzma/version.h | 2 +- - 2 files changed, 3 insertions(+), 3 deletions(-) + README | 12 +++++++++--- + 1 file changed, 9 insertions(+), 3 deletions(-) -commit 36fabdbe67c8a8fbdc3ac695a91fc443a1328cc4 +commit 18463917f9b255b8f925fa54ab9388319735b14a Author: Lasse Collin -Date: 2023-09-27 00:58:17 +0300 +Date: 2024-05-28 13:25:07 +0300 - CMake: Use -D_FILE_OFFSET_BITS=64 if (and only if) needed. + Translations: Use --package-name=xz-man with po4a - A CMake option LARGE_FILE_SUPPORT is created if and only if - -D_FILE_OFFSET_BITS=64 affects sizeof(off_t). + This is to match reality. See the added comment. - This is needed on many 32-bit platforms and even with 64-bit builds - with MinGW-w64 to get support for files larger than 2 GiB. + (cherry picked from commit 75f5f2e014b0ee646963f36bc6a9c840fb272353) - CMakeLists.txt | 7 ++++- - cmake/tuklib_large_file_support.cmake | 52 +++++++++++++++++++++++++++++++++++ - 2 files changed, 58 insertions(+), 1 deletion(-) + po4a/update-po | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) -commit 989c8c354cbd2d20fbae4a432a3e31f5bc1cb9bf +commit 26bbcb13cd2bbb56fe406544a484b4edfc7e0837 Author: Lasse Collin -Date: 2023-09-30 02:14:25 +0300 +Date: 2024-05-28 13:03:40 +0300 - CMake: Generate and install liblzma.pc if not using MSVC. + Translations: Omit --package-name from po/Makevars - Autotools based build uses -pthread and thus adds it to Libs.private - in liblzma.pc. CMake doesn't use -pthread at all if pthread functions - are available in libc so Libs.private doesn't get -pthread either. + This is closer to the reality in the po/*.po files. + + (cherry picked from commit eb217d016cfbbba1babc19a61095b3ea25898af6) - CMakeLists.txt | 21 +++++++++++++++++++++ - 1 file changed, 21 insertions(+) + po/Makevars | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) -commit 983f3b458dc79c5976a4237fdfe4f8079f8d8830 +commit c35ee804b89556d15bc8cdc16867f4316e69392f Author: Lasse Collin -Date: 2023-09-30 01:13:13 +0300 +Date: 2024-05-28 01:17:45 +0300 - CMake: Rearrange the PACKAGE_ variables. + Translations: Omit man page line numbers from .pot and .po files - The windres workaround now replaces spaces with \x20 so - the package name isn't repeated. + (cherry picked from commit 9114267038deaecf4832a5cacb5acbe6591ac839) + + po4a/update-po | 5 +++++ + 1 file changed, 5 insertions(+) + +commit 0f4429d47f9cfe2cdfbad115a7bc2f11221cb217 +Author: Lasse Collin +Date: 2024-05-28 01:06:30 +0300 + + Translations: Use the xgettext option --add-location=file - These changes will help with creation of liblzma.pc. + (cherry picked from commit 093490b58271e9424ce38a7b1b38bcf61b9c86c6) - CMakeLists.txt | 26 +++++++++++++++----------- - 1 file changed, 15 insertions(+), 11 deletions(-) + po/Makevars | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) -commit 4083c8e9501a48934a5fb563d2c3ce2ae143cd27 +commit a93e2c2d1d34a6f609d24a8e62072ce78df7a734 Author: Lasse Collin -Date: 2023-09-29 20:46:11 +0300 +Date: 2024-05-28 00:43:53 +0300 - liblzma: Add Cflags.private to liblzma.pc.in for MSYS2. + Translations: Use the msgmerge option --add-location=file - It properly adds -DLZMA_API_STATIC when compiling code that - will be linked against static liblzma. Having it there on - systems other than Windows does no harm. + This way the PO file diffs are less noisy but the locations of the + strings are still present at file level, just without line numbers. - See: https://www.msys2.org/docs/pkgconfig/ + The option is available since gettext 0.19 (2014). + configure.ac requires 0.19.6. + + (cherry picked from commit fccebe2b4fd513488fc920e4dac32562ed3c7637) - src/liblzma/liblzma.pc.in | 1 + - 1 file changed, 1 insertion(+) + po/Makevars | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) -commit 661549ecb7a9b136d72a01c137d9776c75d52d51 +commit d4389895592e9a8e0f6391fdad816ae0537bb07b Author: Lasse Collin -Date: 2023-09-27 22:46:20 +0300 +Date: 2024-05-27 12:22:08 +0300 - CMake: Create liblzma.def when building liblzma.dll with MinGW-w64. + Build: Use $(SHELL) instead of sh to run scripts in Makefile.am + + (cherry picked from commit f361d9ae85707a87eb28db400eb7229cec103d58) - CMakeLists.txt | 20 ++++++++++++++++++++ - cmake/remove-ordinals.cmake | 26 ++++++++++++++++++++++++++ - 2 files changed, 46 insertions(+) + Makefile.am | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) -commit 0e546eb4da05c52b7d257e5bd85e15c51c4d86a3 +commit 5781414b6e3120098b0060d073aa2b0580ff6f40 Author: Lasse Collin -Date: 2023-10-26 21:44:42 +0300 +Date: 2024-05-23 17:25:13 +0300 - CMake: Change one CMAKE_CURRENT_SOURCE_DIR to CMAKE_CURRENT_LIST_DIR. + Translations: Change the home page URLs in man page translations - In this case they have identical values. + Since the source strings have changed, these would get marked as + fuzzy and the original string would be used instead. The original + and translated strings are identical in this case so it wouldn't + matter. But patching the translations helps still because then + po4a will show the correct translation percentage. + + (cherry picked from commit a26dece34793a09aac2476f954d162d03e9cf62b) - CMakeLists.txt | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) + po4a/de.po | 8 ++++---- + po4a/fr.po | 4 ++-- + po4a/ko.po | 4 ++-- + po4a/pt_BR.po | 4 ++-- + po4a/ro.po | 8 ++++---- + po4a/uk.po | 8 ++++---- + 6 files changed, 18 insertions(+), 18 deletions(-) -commit da4d04e4d6e199d28b58bd2e0df4e120c52dd5d7 +commit 3670e0616eb9d86e7519d2b76242fd32c6e0c1ae Author: Lasse Collin -Date: 2023-10-01 19:10:57 +0300 +Date: 2024-05-23 15:15:18 +0300 - CMake/Windows: Fix the import library filename. + CMake: Add manual support for 32-bit x86 assembly files - Both PREFIX and IMPORT_PERFIX have to be set to "" to get - liblzma.dll and liblzma.dll.a. + One has to pass -DENABLE_X86_ASM=ON to cmake to enable the + CRC assembly code. Autodetection isn't done. Looking at + CMAKE_SYSTEM_PROCESSOR might not work as it comes from uname + unless cross-compilation is done using a CMake toolchain file. + + On top of this, if the code is run on modern processors that support + the CLMUL instruction, then the C code should be faster (but then + one should also be using a x86-64 build if possible). + + (cherry picked from commit 24387c234b4eed1ef9a7eaa107391740b4095568) - CMakeLists.txt | 1 + - 1 file changed, 1 insertion(+) + CMakeLists.txt | 34 +++++++++++++++++++++++++++++++--- + 1 file changed, 31 insertions(+), 3 deletions(-) -commit 007558a358c48a0175cc8d47d11798d7967282ab +commit c1b001b09e902ecacabb8a2ae1fc991018a4d1f8 Author: Lasse Collin -Date: 2023-10-11 19:47:44 +0300 +Date: 2024-05-23 14:26:45 +0300 - CMake: Don't shadow the cache entry ENABLE_THREADS with a normal variable. + CMake: Rename USE_DOXYGEN to ENABLE_DOXYGEN - Using set(ENABLE_THREADS "posix") is confusing because it sets - a new normal variable and leaves the cache entry with the same - name unchanged. The intent wasn't to change the cache entry so - this switches to a different variable name. + It's more consistent with the other option() uses. + + (cherry picked from commit 0fb3c9c3f684f5a25bd425ed079a20a79f0c969d) - CMakeLists.txt | 10 +++++++--- - 1 file changed, 7 insertions(+), 3 deletions(-) + CMakeLists.txt | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) -commit 7d01de67ee3dd76cfc12c23220e2e4cdc59708f1 +commit 7213fe39c717d4623c92af715484a71d9a6ff8d0 Author: Lasse Collin -Date: 2023-10-09 21:12:31 +0300 +Date: 2024-05-22 15:21:53 +0300 - CMake: Edit threading related messages. + Use more confident language in COPYING - It's mostly to change from "thread method" to "threading method". + (cherry picked from commit 62733592a1cc6f0b41f46ef52e06d1a6fe1ff38a) - CMakeLists.txt | 19 ++++++++++--------- - 1 file changed, 10 insertions(+), 9 deletions(-) + COPYING | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) -commit f8edcf3da689aad4b21e139197725450f2c456a0 +commit 15358be94a4e3f9c20f331b64b3980f3e5283760 Author: Lasse Collin -Date: 2023-10-09 20:59:24 +0300 +Date: 2024-04-29 17:16:38 +0300 - CMake: Use FATAL_ERROR if user-supplied options aren't understood. + Add SPDX license identifiers to files under tests/ossfuzz - This way typos are caught quickly and compounding error messages - are avoided (a single typo could cause more than one error). + (cherry picked from commit 9ae2ebc1e504a1814b0788de95fb5c58c0328dde) + + tests/ossfuzz/Makefile | 2 ++ + tests/ossfuzz/config/fuzz_decode_alone.options | 2 ++ + tests/ossfuzz/config/fuzz_decode_stream.options | 2 ++ + tests/ossfuzz/config/fuzz_encode_stream.options | 2 ++ + tests/ossfuzz/config/fuzz_lzma.dict | 2 ++ + tests/ossfuzz/config/fuzz_xz.dict | 2 ++ + 6 files changed, 12 insertions(+) + +commit 1aa92c7ffd0bf8f9738ebf3bd1263bd6f5f096a2 +Author: Lasse Collin +Date: 2024-04-29 17:16:06 +0300 + + Add SPDX license identifier to .codespellrc - This keeps using SEND_ERROR when the system is lacking a feature - (like threading library or sandboxing method). This way the whole - configuration log will be generated in case someone wishes to - report a problem upstream. + (cherry picked from commit 9000d70eb9815bd7f43ffddc1c3316c507aa0e05) - CMakeLists.txt | 28 ++++++++++++++-------------- - 1 file changed, 14 insertions(+), 14 deletions(-) + .codespellrc | 2 ++ + 1 file changed, 2 insertions(+) -commit 1695021e4a233a9388ddd428654c1447f0ea3bfb -Author: Jia Tan -Date: 2023-10-19 16:09:01 +0800 +commit 3c7e400fdcabc0a1b78863948fc17964667a9401 +Author: Lasse Collin *** 37237 LINES SKIPPED *** From nobody Sun Dec 22 07:33: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 4YGCYl5Hlbz5jCQD; Sun, 22 Dec 2024 07:33: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YGCYl3yLCz4ZT3; Sun, 22 Dec 2024 07:33:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734852795; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=13gNfioEWXyYQJiLEJXtXIRrz3QscxL/K5ZmUL8f0OY=; b=brYFabrH5awmR1UgmdEGAXAgSjVg1dlGk+QD1XZxj+ILNoY6yREvcf8h1g6NRwXwIIoelb RB0YMIXUBaVD8Z6JJtYkxRDYoisd/ckUinQmoTp0ti0qylZWk/cYbEsU6LAYj3qXUK7+ee 4xDHCyF3EZ/GhB6JSbeHNIkw+go3iROKZ3kROZYY4+nd0hJn3ii8wIqE/f5N4ycmnuAM3O Bkv92G1xJJ50wZVPZmFL2BClb9esC1yFq/25IFOTbMIHGFqWoQHxxpakK4sPLxUlme2+vs c/s2WYoyIT/QwpFzO4xE3xoRonpbD1061YOgdgq/OQEuih02stue4Pdt4qE4pA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734852795; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=13gNfioEWXyYQJiLEJXtXIRrz3QscxL/K5ZmUL8f0OY=; b=nAMawDxA6QuvjkqV0xSMh67xk/3f59idm+jUKTFNZZ7jn0xquO+H3KPQafumdwgPdHCatB d2b3TzBIk5MHmekNdOdmtoDpHreY4XVj0KzCJc7rFy0eVRpaD1+DPHhWG9rpDRfhGgCCZr 3s731n2ZJiiONk6vHMbc4RP7+AWLVvig8c1yQBKax+eufir7WFD3t3IQUTJIfUHa4Fmkcc lO7VyTUlGbM51nSs2NutE+V/vWkucKuANIAswMkSYdmqlyycqVBGsuUypld7CNlyPl4+tK T1bFPbTMRNk7aJOHv2JUfOguLDw+9GAuyQE+pghdVlQMVUpogwxj3Dh5ymwJ3A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734852795; a=rsa-sha256; cv=none; b=aJpsMICgY6kddixH5JurV6A61BRxWkS/ZlTjus0n3JG1ei4QJ2BtYJ7PL9eE0/2T6KsZPO x1hPmsMFVEcw4ckcPz1Vzff+vS/ImkggSIXlq+TFYZt5kBkwVZTRuPCgATCdEuRPTHIyAn xkXuabYxA/43V0+VtQOHX+cqctMdcJklemn3e7SWzHeEb+lNdwQ7as7IqpPU/t1CuXYFkH WAz78RE3+jUKz4BFVk+JajHv6Rve2PMc93EQpAzyC8EDcyEkBqUvKiDAvNenb7JRSOlItY HA1IUG00yH+ZNM8R5VfPLo3lw4CBp47lr6np/SvWoi2ZNSxoqwdua7OEa+G8Aw== 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 4YGCYl3YGNzyqt; Sun, 22 Dec 2024 07:33:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BM7XFp3001416; Sun, 22 Dec 2024 07:33:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BM7XFV4001413; Sun, 22 Dec 2024 07:33:15 GMT (envelope-from git) Date: Sun, 22 Dec 2024 07:33:15 GMT Message-Id: <202412220733.4BM7XFV4001413@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Xin LI Subject: git: edf0691b19b2 - stable/14 - MFC: MFV: xz 5.6.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: delphij X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: edf0691b19b240396c1d0a6a992dd5c3bf42f035 Auto-Submitted: auto-generated The branch stable/14 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=edf0691b19b240396c1d0a6a992dd5c3bf42f035 commit edf0691b19b240396c1d0a6a992dd5c3bf42f035 Author: Xin LI AuthorDate: 2024-12-09 15:20:04 +0000 Commit: Xin LI CommitDate: 2024-12-22 07:32:54 +0000 MFC: MFV: xz 5.6.3 (cherry picked from commit 26743408e9ff53ac0e041407c359ed3c17c15596) --- contrib/xz/ChangeLog | 1246 +++++++++++++++++++++ contrib/xz/THANKS | 19 + contrib/xz/src/common/tuklib_integer.h | 14 +- contrib/xz/src/liblzma/api/lzma/container.h | 2 +- contrib/xz/src/liblzma/api/lzma/version.h | 2 +- contrib/xz/src/liblzma/check/crc32_table.c | 10 +- contrib/xz/src/liblzma/check/crc_common.h | 6 +- contrib/xz/src/liblzma/check/crc_x86_clmul.h | 12 +- contrib/xz/src/liblzma/rangecoder/range_decoder.h | 24 +- contrib/xz/src/liblzma/simple/arm64.c | 4 +- contrib/xz/src/lzmainfo/lzmainfo.c | 5 +- contrib/xz/src/xz/args.c | 1 - contrib/xz/src/xz/list.c | 7 + contrib/xz/src/xz/mytime.c | 2 +- contrib/xz/src/xzdec/xzdec.c | 2 +- lib/liblzma/config.h | 9 +- 16 files changed, 1321 insertions(+), 44 deletions(-) diff --git a/contrib/xz/ChangeLog b/contrib/xz/ChangeLog index c7795974ba23..2d36d7bb1043 100644 --- a/contrib/xz/ChangeLog +++ b/contrib/xz/ChangeLog @@ -1,3 +1,1249 @@ +commit 9331ce4009ddc839f5191d234cc41b2d4797376d +Author: Lasse Collin +Date: 2024-10-01 12:21:22 +0300 + + Bump version and soname for 5.6.3 + + src/liblzma/Makefile.am | 2 +- + src/liblzma/api/lzma/version.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit f52857ffde768058db0e0e13f68a2660ca9f1330 +Author: Lasse Collin +Date: 2024-10-01 12:17:39 +0300 + + Add NEWS for 5.6.3 + + NEWS | 125 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 125 insertions(+) + +commit b8f52990b5d47a50902bf33cd2305ce985457bac +Author: Lasse Collin +Date: 2024-10-01 12:10:23 +0300 + + Update THANKS + + (cherry picked from commit 1ebbe915d4e0d877154261b5f8103719a6722975) + + THANKS | 2 ++ + 1 file changed, 2 insertions(+) + +commit 51f6f455873911894f155e6997bc23a9be8f42ba +Author: Lasse Collin +Date: 2024-10-01 12:10:23 +0300 + + Tests/Windows: Add the application manifest to the test programs + + This ensures that the test programs get executed the same way as + the binaries that are installed. + + (cherry picked from commit 74702ee00ecfd080d8ab11118cd25dbe6c437ec0) + + CMakeLists.txt | 14 ++++++++++---- + tests/Makefile.am | 10 ++++++++++ + tests/tests.cmake | 33 ++++++++++++++++++++++++++++++++- + tests/tests_w32res.rc | 18 ++++++++++++++++++ + 4 files changed, 70 insertions(+), 5 deletions(-) + +commit bf518b9ba446327a062ddfe67e7e0a5baed2394f +Author: Lasse Collin +Date: 2024-10-01 12:10:23 +0300 + + Windows: Embed an application manifest in the EXE files + + IMPORTANT: This includes a security fix to command line tool + argument handling. + + Some toolchains embed an application manifest by default to declare + UAC-compliance. Some also declare compatibility with Vista/8/8.1/10/11 + to let the app access features newer than those of Vista. + + We want all the above but also two more things: + + - Declare that the app is long path aware to support paths longer + than 259 characters (this may also require a registry change). + + - Force the code page to UTF-8. This allows the command line tools + to access files whose names contain characters that don't exist + in the current legacy code page (except unpaired surrogates). + The UTF-8 code page also fixes security issues in command line + argument handling which can be exploited with malicious filenames. + See the new file w32_application.manifest.comments.txt. + + Thanks to Orange Tsai and splitline from DEVCORE Research Team + for discovering this issue. + + Thanks to Vijay Sarvepalli for reporting the issue to me. + + Thanks to Kelvin Lee for testing with MSVC and helping with + the required build system fixes. + + (cherry picked from commit 46ee0061629fb075d61d83839e14dd193337af59) + + CMakeLists.txt | 18 +++ + src/Makefile.am | 4 +- + src/common/common_w32res.rc | 5 + + src/common/w32_application.manifest | 28 ++++ + src/common/w32_application.manifest.comments.txt | 178 +++++++++++++++++++++++ + 5 files changed, 232 insertions(+), 1 deletion(-) + +commit 5718ce932e6ad4262d5fffc9e2a7a838f963d7e5 +Author: Lasse Collin +Date: 2024-09-29 14:46:52 +0300 + + Windows: Set DLL name accurately in StringFileInfo on Cygwin and MSYS2 + + Now the information in the "Details" tab in the file properties + dialog matches the naming convention of Cygwin and MSYS2. This + is only a cosmetic change. + + (cherry picked from commit dad153091552b52a41b95ec4981c6951f1cae487) + + src/liblzma/liblzma_w32res.rc | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +commit e77c0ca61d12ebac433b7661840cb18d7031700a +Author: Lasse Collin +Date: 2024-09-25 15:47:55 +0300 + + common_w32res.rc: White space edits + + LANGUAGE and VS_VERSION_INFO begin new statements so put an empty line + between them. + + (cherry picked from commit 8940ecb96fe9f0f2a9cfb8b66fe9ed31ffbea904) + + src/common/common_w32res.rc | 15 ++++++++------- + 1 file changed, 8 insertions(+), 7 deletions(-) + +commit e0ba0f26d9f3f53cedc92fb13303924c39d00392 +Author: Lasse Collin +Date: 2024-09-28 20:09:50 +0300 + + CMake: Add the resource files to the Cygwin and MSYS2 builds + + Autotools-based build has always done this so this is for consistency. + + However, the CMake build won't create the DEF file when building + for Cygwin or MSYS2 because in that context it should be useless. + (If Cygwin or MSYS2 is used to host building of normal Windows + binaries then the DEF file is still created.) + + (cherry picked from commit c3b9dad07d3fd9319f88386b7095019bcea45ce1) + + CMakeLists.txt | 16 ++++++++++------ + 1 file changed, 10 insertions(+), 6 deletions(-) + +commit 69637d0c323c0d7d9619cff637c7ce97dabc4f02 +Author: Lasse Collin +Date: 2024-09-28 15:19:14 +0300 + + CMake: Fix Windows resource file dependencies + + If common_w32res.rc is modified, the resource files need to be rebuilt. + In contrast, the liblzma*.map files truly are link dependencies. + + (cherry picked from commit da4f275bd1c18b897e5c2dd0043546de3accce0a) + + CMakeLists.txt | 17 +++++++++-------- + 1 file changed, 9 insertions(+), 8 deletions(-) + +commit af8533459c60d7bc5b55f2f516251af4572169e4 +Author: Lasse Collin +Date: 2024-09-29 01:20:03 +0300 + + CMake: Checking for CYGWIN covers MSYS2 too + + On MSYS2, both CYGWIN and MSYS are set. + + (cherry picked from commit 1c673c0aac7f7dee8dda2c1140351c8417a71e47) + + CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit eca08e4c204db404911e513f95110dcb0fb919bd +Author: Lasse Collin +Date: 2024-09-28 09:37:30 +0300 + + Translations: Add the SPDX license identifier to pt_BR.po + + (cherry picked from commit 6aaa0173b839e28429d43a8b62d257ad2f3b4521) + + po/pt_BR.po | 2 ++ + 1 file changed, 2 insertions(+) + +commit 85801c96c32456300177fbbad1506b07f5dd0a47 +Author: Lasse Collin +Date: 2024-09-25 16:41:37 +0300 + + Windows/CMake: Use the correct resource file for lzmadec.exe + + CMakeLists.txt was using xzdec_w32res.rc for both xzdec and lzmadec. + + Fixes: 998d0b29536094a89cf385a3b894e157db1ccefe + (cherry picked from commit dc7b9f24b737e4e55bcbbdde6754883f991c2cfb) + + CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit a341d19c835a8c10fcf561b00b548c53af43381e +Author: Lasse Collin +Date: 2024-09-25 21:29:59 +0300 + + Translations: Update the Brazilian Portuguese translation + + (cherry picked from commit b834ae5f80911a3819d6cdb484f61b257174c544) + + po/pt_BR.po | 144 ++++++++++++++++++++++-------------------------------------- + 1 file changed, 53 insertions(+), 91 deletions(-) + +commit e69c0b9b2e00ade984393ef9cabac57342072328 +Author: Lasse Collin +Date: 2024-09-17 01:21:15 +0300 + + Update THANKS + + (cherry picked from commit eceb023d4c129fd63ee881a2d8696eaf52ad1532) + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit aef9a25b3200457c16846b046222fb2c7967afe0 +Author: Tobias Stoeckmann +Date: 2024-09-16 23:19:46 +0200 + + lzmainfo: Avoid integer overflow + + The MB output can overflow with huge numbers. Most likely these are + invalid .lzma files anyway, but let's avoid garbage output. + + lzmadec was adapted from LZMA Utils. The original code with this bug + was written in 2005, over 19 years ago. + + Co-authored-by: Lasse Collin + Closes: https://github.com/tukaani-project/xz/pull/144 + (cherry picked from commit 76cfd0a9bb33ae8e534b1f73f6359dc825589f2f) + + src/lzmainfo/lzmainfo.c | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +commit 40a7f163f56aca6b3c8b83e9382f5e5cb4f8e93b +Author: Tobias Stoeckmann +Date: 2024-09-16 22:04:40 +0200 + + xzdec: Remove unused short option -M + + "xzdec -M123" exited with exit status 1 without printing + any messages. The "M:" entry should have been removed when + the memory usage limiter support was removed from xzdec. + + Fixes: 792331bdee706aa852a78b171040ebf814c6f3ae + Closes: https://github.com/tukaani-project/xz/pull/143 + [ Lasse: Commit message edits ] + + (cherry picked from commit 78355aebb7fb654302e5e33692ba109909dacaff) + + src/xzdec/xzdec.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit c98714a57058ac381365c2ff1e1d1cd63a5742c4 +Author: Lasse Collin +Date: 2024-09-10 13:54:47 +0300 + + Update THANKS + + (cherry picked from commit e5758db7bd75587a2499e0771907521a4aa86908) + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 4ed449517817b3659b35d19f39703e3c460f46c2 +Author: Firas Khalil Khana +Date: 2024-09-10 12:30:32 +0300 + + Build: Fix a typo in autogen.sh + + Fixes: e9be74f5b129fe8a5388d588e68b1b7f5168a310 + Closes: https://github.com/tukaani-project/xz/pull/141 + (cherry picked from commit 80ffa38f56657257ed4d90d76f6bd2f2bcb8163c) + + autogen.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 3b83577a1547e72cb78a905ad3d308a799ded485 +Author: Lasse Collin +Date: 2024-09-02 20:08:40 +0300 + + Translations: Update Chinese (simplified) translation + + Differences to the zh_CN.po file from the Translation Project: + + - Two uses of \v were fixed. + + - Missing "OPTS" translation in --riscv[=OPTS] was copied from + previous lines. + + - "make update-po" was run to remove line numbers from comments. + + (cherry picked from commit 68c54e45d042add64a4cb44bfc87ca74d29b87e2) + + po/zh_CN.po | 102 ++++++++++++++++++++++++------------------------------------ + 1 file changed, 40 insertions(+), 62 deletions(-) + +commit 06f4c7edda0387eb6a2d6303804b59dcf4d3db1f +Author: Lasse Collin +Date: 2024-09-02 19:40:50 +0300 + + Translations: Update the Catalan translation + + Differences to the ca.po file from the Translation Project: + + - An overlong line translating --filters-help was wrapped. + + - "make update-po" was used to remove line numbers from the comments + to match the changes in fccebe2b4fd513488fc920e4dac32562ed3c7637 + and 093490b58271e9424ce38a7b1b38bcf61b9c86c6. xz.pot in the TP + is older than these commits. + + (cherry picked from commit 2230692aa1bcebb586100183831e3daf1714d60a) + + po/ca.po | 171 ++++++++++++++++++++++++++------------------------------------- + 1 file changed, 69 insertions(+), 102 deletions(-) + +commit 406cb5b669e47c0e45c98f1afb7be998084a93d0 +Author: Lasse Collin +Date: 2024-08-22 11:01:07 +0300 + + Update THANKS + + (cherry picked from commit 5e375987509fab484b7bef0b90be92f241c58c91) + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 3a4a05d75eb41ddc41899324df0511670ceaaf1e +Author: Yifeng Li +Date: 2024-08-22 02:18:49 +0000 + + liblzma: Fix x86-64 movzw compatibility in range_decoder.h + + Support for instruction "movzw" without suffix in "GNU as" was + added in commit [1] and stabilized in binutils 2.27, released + in August 2016. Earlier systems don't accept this instruction + without a suffix, making range_decoder.h's inline assembly + unable to build on old systems such as Ubuntu 16.04, creating + error messages like: + + lzma_decoder.c: Assembler messages: + lzma_decoder.c:371: Error: no such instruction: `movzw 2(%r11),%esi' + lzma_decoder.c:373: Error: no such instruction: `movzw 4(%r11),%edi' + lzma_decoder.c:388: Error: no such instruction: `movzw 6(%r11),%edx' + lzma_decoder.c:398: Error: no such instruction: `movzw (%r11,%r14,4),%esi' + + Change "movzw" to "movzwl" for compatibility. + + [1] https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=c07315e0c610e0e3317b4c02266f81793df253d2 + + Suggested-by: Lasse Collin + Tested-by: Yifeng Li + Signed-off-by: Yifeng Li + Fixes: 3182a330c1512cc1f5c87b5c5a272578e60a5158 + Fixes: https://github.com/tukaani-project/xz/issues/121 + Closes: https://github.com/tukaani-project/xz/pull/136 + (cherry picked from commit 6cd7c8607843c337edfe2c472aa316602a393754) + + src/liblzma/rangecoder/range_decoder.h | 24 ++++++++++++------------ + 1 file changed, 12 insertions(+), 12 deletions(-) + +commit 4669f06d1a8d31de4b8b5861b5e8afd82cacd721 +Author: Lasse Collin +Date: 2024-07-19 20:02:43 +0300 + + Build: Comment that elf_aux_info(3) will be available on OpenBSD >= 7.6 + + (cherry picked from commit bf901dee5d4c46609645e50311c0cb2dfdcf9738) + + CMakeLists.txt | 2 +- + configure.ac | 17 +++++++++++------ + 2 files changed, 12 insertions(+), 7 deletions(-) + +commit 9edddda5636d7b3504a033c31e8ea763e293fd35 +Author: Lasse Collin +Date: 2024-07-13 22:10:37 +0300 + + liblzma: Tweak a comment + + (cherry picked from commit 7c292dd0bf23cefcdf4b1509f3666322e08a7ede) + + src/liblzma/simple/arm64.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 1a93ab55d1563f5eb9b2c1b8240384046fe4bb97 +Author: Lasse Collin +Date: 2024-07-11 22:17:56 +0300 + + CMake: Bump maximum policy version to 3.30 + + CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit cfe4465742ad2963fb0d9795e258615d7c1cf32d +Author: Lasse Collin +Date: 2024-07-09 14:27:51 +0300 + + Update THANKS + + (cherry picked from commit 028185dd4889e3d6235ff13560160ebca6985021) + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 0f47db18d04434203b350bde4909a5e468f197cc +Author: Lasse Collin +Date: 2024-07-06 14:04:48 +0300 + + xz: Remove the TODO comment about --recursive + + It won't be implemented. find + xargs is more flexible, for example, + it allows compressing small files in parallel. An example for that + has been included in the xz man page since 2010. + + (cherry picked from commit baecfa142644eb5f5c6dd6f8e2f531c362fa3747) + + src/xz/args.c | 1 - + 1 file changed, 1 deletion(-) + +commit 07f52c3528e43c4a925a3fc59a933c89f5604d92 +Author: Lasse Collin +Date: 2024-07-03 20:45:48 +0300 + + CMake: Link xz against Threads::Threads if using pthreads + + The liblzma target was recently changed to link against Threads::Threads + with the PRIVATE keyword. I had forgotten that xz itself depends on + pthreads too due to pthread_sigmask(). Thus, the build broke when + building shared liblzma and pthread_sigmask() wasn't in libc. + + Thanks to Peter Seiderer for the bug report. + + Fixes: ac05f1b0d7cda1e7ae79775a8dfecc54601d7f1c + Fixes: https://github.com/tukaani-project/xz/issues/129#issuecomment-2204522994 + (cherry picked from commit b3e53122f42796aaebd767bab920cf7bedf69966) + + CMakeLists.txt | 13 +++++++++++++ + 1 file changed, 13 insertions(+) + +commit eccb4d258b01651d06a2a31b8b68be9b04b7998c +Author: Lasse Collin +Date: 2024-07-02 22:49:33 +0300 + + Update THANKS + + (cherry picked from commit 5742ec1fc7f2cf1c82cfe3477bb90594a4658374) + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit c9bd00327f064778babb014302718a18d65cf7d3 +Author: Sam James +Date: 2024-06-28 14:18:35 +0300 + + CI: Speed up Valgrind job by using --trace-children-skip-by-arg=... + + This addresses the issue I mentioned in + 6c095a98fbec70b790253a663173ecdb669108c4 and speeds up the Valgrind + job a bit, because non-xz tools aren't run unnecessarily with + Valgrind by the script tests. + + (cherry picked from commit 7e99856f66c07852c4e0de7aa01951e9147d86b0) + + .github/workflows/ci.yml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 495de6ec9d7834c4ef4d5286844ef7b784eb951b +Author: Lasse Collin +Date: 2024-06-25 16:00:22 +0300 + + Build: Prepend, not append, PTHREAD_CFLAGS to LIBS + + It shouldn't make any difference because LIBS should be empty + at that point in configure. But prepending is the correct way + because in general the libraries being added might require other + libraries that come later on the command line. + + (cherry picked from commit 2402e8a1ae92676fa0d4cb1b761d7f62f005c098) + + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 55bf3f49a812e20a21e42323e39526bb31d9341a +Author: Lasse Collin +Date: 2024-06-25 14:24:29 +0300 + + Build: Use AC_LINK_IFELSE to handle implicit function declarations + + It's more robust in case the compiler allows pre-C99 implicit function + declarations. If an x86 intrinsic is missing and gets treated as + implicit function, the linking step will very probably fail. This + isn't the only way to workaround implicit function declarations but + it might be the simplest and cleanest. + + The problem hasn't been observed in the wild. + + There are a couple more AC_COMPILE_IFELSE uses in configure.ac. + Of these, Landlock check calls prctl() and in theory could have + the same problem. In practice it doesn't as the check program + looks for several other things too. However, it was changed to + AC_LINK_IFELSE still to look more correct. + + Similarly, m4/tuklib_cpucores.m4 and m4/tuklib_physmem.m4 were + updated although they haven't given any trouble either. They + have worked all these years because those check programs rely + on specific headers and types: if headers or types are missing, + compilation will fail. Using the linker makes these checks more + similar to the ones in cmake/tuklib_*.cmake which always link. + + (cherry picked from commit 7bb46f2b7b3989c1b589a247a251470f65e91cda) + + configure.ac | 8 ++++++-- + m4/tuklib_cpucores.m4 | 8 ++++---- + m4/tuklib_physmem.m4 | 17 +++++++++++------ + 3 files changed, 21 insertions(+), 12 deletions(-) + +commit b45270d88f0de1b2e8bf510f0e370a5db4067e1f +Author: Lasse Collin +Date: 2024-06-24 23:35:59 +0300 + + Build: Use AC_LINK_IFELSE instead of -Werror + + AC_COMPILE_IFELSE needed -Werror because Clang <= 14 would merely + warn about the unsupported attribute and implicit function declaration. + Changing to AC_LINK_IFELSE handles the implicit declaration because + the symbol __crc32d is unlikely to exist in libc. + + Note that the other part of the check is that #include + must work. If the header is missing, most compilers give an error + and the linking step won't be attempted. + + Avoiding -Werror makes the check more robust in case CFLAGS contains + warning flags that break -Werror anyway (but this isn't the only check + in configure.ac that has this problem). Using AC_LINK_IFELSE also makes + the check more similar to how it is done in CMakeLists.txt. + + (cherry picked from commit 35eb57355ad1c415a838d26192d5af84abb7cf39) + + configure.ac | 12 +----------- + 1 file changed, 1 insertion(+), 11 deletions(-) + +commit 2c3e4cbbdcefe214ef3033a725049034b73e9756 +Author: Lasse Collin +Date: 2024-06-24 23:34:34 +0300 + + Build: Sync the compile check changes from CMakeLists.txt + + It's nice to keep these in sync. The use of main() will later allow + AC_LINK_IFELSE usage too which may avoid the more fragile -Werror. + + (cherry picked from commit 5a728813c378cc3c4c9c95793762452418d08f1b) + + configure.ac | 15 ++++++++------- + 1 file changed, 8 insertions(+), 7 deletions(-) + +commit 809e69f1f574dad3c9b00d4f01b9ef1a492319f3 +Author: Lasse Collin +Date: 2024-06-25 16:11:13 +0300 + + CMake: Use configure_file() to copy a file + + I had missed this simpler method before. It does create a dependency + so that if .in.h changes the copying is done again. + + (cherry picked from commit de215a0517645d16343f3a5336d3df884a4f665f) + + CMakeLists.txt | 17 +++++++---------- + 1 file changed, 7 insertions(+), 10 deletions(-) + +commit 52a8c87f37f4bd133f670722d2d4b73a74e352bc +Author: Lasse Collin +Date: 2024-06-25 15:51:48 +0300 + + CMake: Always add pthread flags into CMAKE_REQUIRED_LIBRARIES + + It was weird to add CMAKE_THREAD_LIBS_INIT in CMAKE_REQUIRED_LIBRARIES + only if CLOCK_MONOTONIC is available. Alternative would be to remove + the thread libs from CMAKE_REQUIRED_LIBRARIES after the check for + pthread_condattr_setclock() but keeping the libs should be fine too. + Then it's ready in case more pthread functions were wanted some day. + + (cherry picked from commit e620f35097c0ad20cd76d8258750aa706758ced9) + + CMakeLists.txt | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +commit 1591747bf692d10c3b2fd92c9dc8ba931626fd84 +Author: Lasse Collin +Date: 2024-06-24 22:41:10 +0300 + + CMake: Fix three checks if building with -flto + + In CMake, check_c_source_compiles() always links too. With + link-time optimization, unused functions may get omitted if + main() doesn't depend on them. Consider the following which + tries to check if somefunction() is available when + has been included: + + #include + int foo(void) { return somefunction(); } + int main(void) { return 0; } + + LTO may omit foo() completely because the program as a whole doesn't + need it and then the program will link even if the symbol somefunction + isn't available in libc or other library being linked in, and then + the test may pass when it shouldn't. + + What happens if doesn't declare somefunction()? + Shouldn't the test fail in the compilation phase already? It should + but many compilers don't follow the C99 and later standards that + prohibit implicit function declarations. Instead such compilers + assume that somefunction() exists, compilation succeeds (with a + warning), and then linker with LTO omits the call to somefunction(). + + Change the tests so that they are part of main(). If compiler accepts + implicitly declared functions, LTO cannot omit them because it has to + assume that they might have side effects and thus linking will fail. + On the other hand, if the functions/intrinsics being used are supported, + they might get optimized away but in that case it's fine because they + really are supported. + + It is fine to use __attribute__((target(...))) for main(). At least + it works with GCC 4.9 to 14.1 on x86-64. + + Reported-by: Sam James + (cherry picked from commit 114cba69dbb96003e676c8c87a2e9943b12d065f) + + CMakeLists.txt | 19 ++++++++----------- + 1 file changed, 8 insertions(+), 11 deletions(-) + +commit cc386f4ff4b87ff895fbc30fd3b13ee6e6152ace +Author: Lasse Collin +Date: 2024-06-24 21:06:18 +0300 + + CMake: Improve the comment about LIBS + + (cherry picked from commit d3f20382fc1bd865eb70a65455d5022ed05caac8) + + CMakeLists.txt | 6 ++++++ + 1 file changed, 6 insertions(+) + +commit 65aaa0f87048f78a3f69c4ec0ad03723a2354fa7 +Author: Lasse Collin +Date: 2024-06-24 17:39:54 +0300 + + CI: Workaround buggy config.guess on Ubuntu 22.04LTS and 24.04LTS + + Check for the wrong triplet from config.guess and override it with + the --build option on the configure command line. Then i386 assembly + autodetection will work. + + These Ubuntu versions (and as of writing, also Debian unstable) + ship config.guess version 2022-01-09 which contains a bug that + was fixed in version 2022-05-08. It results in a wrong configure + triplet when using CC="gcc -m32" to build i386 binaries. + + Upstream fix: + https://git.savannah.gnu.org/cgit/config.git/commit/?id=f56a7140386d08a531bcfd444d632b28c61a6329 + + More information: + https://mail.gnu.org/archive/html/config-patches/2022-05/msg00003.html + + (cherry picked from commit 1bf83cded2955282fe1a868f08c83d4e5d6dca4a) + + build-aux/ci_build.bash | 9 +++++++++ + 1 file changed, 9 insertions(+) + +commit 810f1a8aee9edb3bff430559f4b832cd0ec50797 +Author: Lasse Collin +Date: 2024-06-24 15:24:52 +0300 + + CI: Use CC="gcc -m32" to get i386 compiler on x86-64 + + The old method put it in CFLAGS which is a wrong place because + config.guess doesn't read CFLAGS. + + (cherry picked from commit dbcdabf68fee9ed694b68c3a82e6adbeff20b679) + + .github/workflows/ci.yml | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit dde14ded9a3240fd524d9bc01c9ceeb4d7909e95 +Author: Lasse Collin +Date: 2024-06-24 14:54:17 +0300 + + CI: Let CMake use the CC environment variable + + CC from environment is used to initialize CMAKE_C_COMPILER so + setting CMAKE_C_COMPILER explicitly isn't needed. + + The syntax in ci_build.bash was broken in case one wished to put + spaces in CC. + + (cherry picked from commit 0c1e6d900bac127464fb30a854776e1810ab5f16) + + build-aux/ci_build.bash | 4 ---- + 1 file changed, 4 deletions(-) + +commit 85a55e1120bebac2f3cd9af8965f4a6335eeeb9b +Author: Lasse Collin +Date: 2024-06-20 18:12:21 +0300 + + CMake: Keep existing options in LIBS when adding -lrt + + This makes no difference yet because -lrt is currently the only option + that might be added to LIBS. + + (cherry picked from commit 75ce4797d49621710e6da95d8cb91541028c6d68) + + CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit e24a762f1be6bf379df73b7fe0a115ccae139a35 +Author: Lasse Collin +Date: 2024-06-15 18:07:04 +0300 + + CMake: Fix indentation + + (cherry picked from commit c715dec8e800b65145918cfb0ee9bbc90faa8aad) + + CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 99555b721b55263a6892b1093f2806f09a92e1fb +Author: Lasse Collin +Date: 2024-06-15 23:34:29 +0300 + + CMake: Link Threads::Threads as PRIVATE to liblzma + + This way pthread options aren't passed to the linker when linking + against shared liblzma but they are still passed when linking against + static liblzma. (Also, one never needs the include path of the + threading library to use liblzma since liblzma's API headers + don't #include . But tends to be in the + default include path so here this change makes no difference.) + + One cannot mix target_link_libraries() calls that use the scope + (PRIVATE, PUBLIC, or INTERFACE) keyword and calls that don't use it. + The calls without the keyword are like PUBLIC except perhaps when + they aren't, or something like that... It seems best to always + specify a scope keyword as the meanings of those three keywords + at least are clear. + + (cherry picked from commit ac05f1b0d7cda1e7ae79775a8dfecc54601d7f1c) + + CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 258bae30a2040138c783b5c380cef0ca603663ed +Author: Lasse Collin +Date: 2024-06-16 19:39:32 +0300 + + CMake: Add empty lines + + (cherry picked from commit 82986d8c691a294c78b48d8391303e5c428b5437) + + CMakeLists.txt | 2 ++ + 1 file changed, 2 insertions(+) + +commit a95a9601a109f0d0d059dea7a5a44efa87ef1401 +Author: Lasse Collin +Date: 2024-06-16 19:37:36 +0300 + + CMake: Use CMAKE_THREAD_LIBS_INIT in liblzma.pc only with pthreads + + This shouldn't make much difference in practice as on Windows + no flags are needed anyway and unitialized variable (when threading + is disabled) expands to empty. But it's clearer this way. + + (cherry picked from commit 2aecffe0f0e14f3ef635e8cd7b405420f2385de2) + + CMakeLists.txt | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +commit 65a10ddd439ad435d2c0176106b1e2d6b9c1b3a1 +Author: Lasse Collin +Date: 2024-06-17 18:20:14 +0300 + + Update THANKS + + (cherry picked from commit 664918bd3635ea8e773f06022286ecb0c485166c) + + THANKS | 3 +++ + 1 file changed, 3 insertions(+) + +commit 6ad5739094ac69ac448a84493f2c7ddfc6eb0688 +Author: Lasse Collin +Date: 2024-06-16 19:25:07 +0300 + + CMake: Use native newlines in liblzma.pc + + vcpkg doesn't specify the newline type so it should be fine to + use native newlines in liblzma.pc on Windows. + + (cherry picked from commit 5ca96a93488d0f5a530c78b274cac317453807ff) + + CMakeLists.txt | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +commit 4107f2066764bb3a31d114852bc20722d582fd82 +Author: Lasse Collin +Date: 2024-06-16 19:18:56 +0300 + + CMake: Use relative paths in liblzma.pc if possible + + Now liblzma.pc can be relocatable only if using CMake >= 3.20 + but that should be OK as now we shouldn't get broken liblzma.pc + if CMAKE_INSTALL_LIBDIR or CMAKE_INSTALL_INCLUDEDIR contain an + absolute path. + + Thanks to Eli Schwartz. + + (cherry picked from commit ebd155c3a1b87411edae06d3bdaa9659ec057522) + + CMakeLists.txt | 18 ++++++++++++++---- + 1 file changed, 14 insertions(+), 4 deletions(-) + +commit ff697eb154361417d94284e0c569aa08cacf9031 +Author: Lasse Collin +Date: 2024-06-16 13:39:37 +0300 + + liblzma: CRC CLMUL: Omit is_arch_extension_supported() when not needed + + On E2K the function compiles only due to compiler emulation but the + function is never used. It's cleaner to omit the function when it's + not needed even though it's a "static inline" function. + + Thanks to Ilya Kurdyukov. + + (cherry picked from commit 30a2d5d51006301a3ddab5ef1f5ff0a9d74dce6f) + + src/liblzma/check/crc_x86_clmul.h | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 4e4a568f6a089c867891c2388a19624e312eb2f3 +Author: Lasse Collin +Date: 2024-06-12 14:26:44 +0300 + + CMake: Prefer C11 with a fallback to C99 + + There is no need to make a similar change in configure.ac. + With Autoconf 2.72, the deprecated macro AC_PROG_CC_C99 + is an alias for AC_PROG_CC which prefers a C11 compiler. + + (cherry picked from commit 2178acf8a4d40a93e970cfcf9b807d5ef6c8da92) + + CMakeLists.txt | 17 +++++++++++------ + 1 file changed, 11 insertions(+), 6 deletions(-) + +commit 849e757a8cce41bfd6acfaa7dd3b07324363de90 +Author: Lasse Collin +Date: 2024-06-12 14:20:21 +0300 + + Update THANKS + + (cherry picked from commit c97e9c12fef4d1093ee2a75236742481361f50f5) + + THANKS | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 1305056a54e68895e052506bceb26274f52bbc9a +Author: Lasse Collin +Date: 2024-06-11 11:15:49 +0300 + + Tests: Improve the CRC32 test + + A similar one was already there for CRC64 but nowadays also CRC32 + has a CLMUL implementation, so it's good to test it better too. + + (cherry picked from commit 89e9f12e03324b8a186e807b268f34f92d1b2f41) + + tests/test_check.c | 17 +++++++++++++---- + 1 file changed, 13 insertions(+), 4 deletions(-) + +commit a44493ec41edc98f24ed9933668e7372f5267a40 +Author: Lasse Collin +Date: 2024-06-11 22:42:26 +0300 + + xz: Fix white space + + (cherry picked from commit c7164b1927e3fe7cdba70ee4687e1a590a81043b) + + src/xz/list.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 5e74a6a8138b3c102193d731120139d5a854f2cf +Author: Lasse Collin +Date: 2024-06-11 21:59:09 +0300 + + liblzma: Fix a typo in a comment + + Thanks to Sam James for spotting it. + + Fixes: f644473a211394447824ea00518d0a214ff3f7f2 + (cherry picked from commit 0a32d2072c598de281058b26dc08920fbf0cd2a1) + + src/liblzma/check/crc_x86_clmul.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 3f7edc673cf21b3e4db3e2f11746905e0a393db7 +Author: Lasse Collin +Date: 2024-05-10 15:52:26 +0300 + + liblzma: Fix a comment indentation + + (cherry picked from commit afd9b4d282a10186808c3331dad4caf79c02d55f) + + src/liblzma/check/crc_common.h | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 8a9cc7ca0867494f39990f0d4cbe0972042f6d59 +Author: Lasse Collin +Date: 2024-05-09 22:09:12 +0300 + + liblzma: Fix white space + + (cherry picked from commit 50e6bff274568c568930e15094da8217e7d47d28) + + src/liblzma/check/crc32_table.c | 10 +++++----- + src/liblzma/check/crc_x86_clmul.h | 6 +++--- + src/liblzma/check/sha256.c | 2 +- + 3 files changed, 9 insertions(+), 9 deletions(-) + +commit b29b13082fe578a3bb9384a5939c82055f796a34 +Author: RainRat +Date: 2024-06-05 15:21:49 -0700 + + Fix typos + + Closes: https://github.com/tukaani-project/xz/pull/124 + (cherry picked from commit 9e73918a4f14be754a23f74dda45ca431939a4a0) + + INSTALL | 2 +- + doc/examples/03_compress_custom.c | 2 +- + src/common/tuklib_integer.h | 2 +- + src/liblzma/api/lzma/container.h | 2 +- + src/xz/mytime.c | 2 +- + tests/test_filter_str.c | 2 +- + 6 files changed, 6 insertions(+), 6 deletions(-) + +commit 6f66155e01a6467e70db48cddbe790bdb8d87754 +Author: Lasse Collin +Date: 2024-06-07 15:47:20 +0300 + + tuklib_integer: Fix building on OpenBSD/sparc64 that uses GCC 4.2 + + GCC 4.2 doesn't have __builtin_bswap16() and friends so tuklib_integer.h + tries to use OS-specific byte swap methods instead. On OpenBSD those + macros are swap16/32/64 instead of bswap16/32/64 like on other *BSDs + and Darwin. + + An alternative to "#ifdef __OpenBSD__" could be "#ifdef swap16" as it + is a macro. But since OpenBSD seems to be a special case under this + special case of "*BSDs and Darwin", checking for __OpenBSD__ seems *** 772 LINES SKIPPED *** From nobody Sun Dec 22 07:36: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 4YGCdn39hSz5jCWv; Sun, 22 Dec 2024 07:36: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YGCdn1C3Kz4bLF; Sun, 22 Dec 2024 07:36:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734853005; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MKCcXRRJf3kW3au0thWURI4ttpIy3gGHZBpDtzLyAj0=; b=E+xXb8Tu0CLFxD1jH52aJBaTao4VQb16DQY6lkX7Sp8BRq2FBsdQ7hTlpag2hEeGOUMCiz TfUiiuwo0u2j0hlRUuBeEbtEusOpP18xAXVltqbxKxUGdH1rmZ3wFz7yRVmOqhVE5Ylv5C nOfOyNRCFdmnBQcyA4k6zDGi0RhGDwnbtRtqTcybwaO/PrC1oN4tCP1U1LMXDuyWWEtFMl YRyU04lLKeDQKzkINbMO4XZwX04pgtw1OdvesZlqh1gMN4X38Y8JO8pExdRkwRGBz/wVOY KlUb8N8P50U1odrPax67yCXuZfdrvsYYsN0U7utaGjHlWAPLkRkdIZuAPUR2cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734853005; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MKCcXRRJf3kW3au0thWURI4ttpIy3gGHZBpDtzLyAj0=; b=O0r8i+GkI4uovwWX+rle1WYjRsUVBSz8S9RhMGk4JiuDp/i/Er5qsvCO/fQiUJy9Y9pnQJ rd8YsipVeTvKJG49W+OLxeYPl+cnuVyERIouueLZryn8+tn1Zg0ywxBlk0+aLOxrhjHXlQ 3e3MgpXsX3vsK0gjP/btFp5zsfxOpNXhjmu8Nu4MYJStt4muncae5m2QACn8M9RDnbenab XLwPGKGX5ey0TBfwn81MMu691CKq/76MAS9LBBKpPNDCF1pP2Ri+TR7DkOfE3CazT69v8/ giUFrdwp5B4UWFWEuDpDA6jD5P8h/2l6Nbr6W5STGCFFAao17p4/X5cI1EZVpQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734853005; a=rsa-sha256; cv=none; b=HvqOsjWy/NnJSUzF68yNekqejTLkHtZD27A8fwGi/e59miu1gcEd54hqm2koK7UdKV2mHW VOapMdZkVOu7lf/aGZIK67omP7QSk9NHie388jfS8u5BkHjM4jVGi6ReoAnITWSFqttY4r Jr92+rj9VRiftE02gt6Rjo87+TcHPKSOOoVf1MC7oVBhJ2UBpO31vuu7Uw7ZoFUwk7xt62 40gbtHRnvliTaPL3e7qBHP1AF5D2GpPoSYlD0bIaKEZn5SVnsRBwwzvaKSjbYVhvqzRyCK ZgP2BlOEJJqXxtcq3uhPUZHkdxRH6Rn8JToN3qKE9PeR16FKncxLEYoO6fakOA== 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 4YGCdn0pp9z10LX; Sun, 22 Dec 2024 07:36:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BM7ajCP002609; Sun, 22 Dec 2024 07:36:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BM7ajMZ002605; Sun, 22 Dec 2024 07:36:45 GMT (envelope-from git) Date: Sun, 22 Dec 2024 07:36:45 GMT Message-Id: <202412220736.4BM7ajMZ002605@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Xin LI Subject: git: aa2f56a6ecd6 - stable/13 - MFC: MFV: xz 5.6.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: delphij X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: aa2f56a6ecd6c6320965ac0d1309f737c406c5d2 Auto-Submitted: auto-generated The branch stable/13 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=aa2f56a6ecd6c6320965ac0d1309f737c406c5d2 commit aa2f56a6ecd6c6320965ac0d1309f737c406c5d2 Author: Xin LI AuthorDate: 2024-12-09 15:20:04 +0000 Commit: Xin LI CommitDate: 2024-12-22 07:36:33 +0000 MFC: MFV: xz 5.6.3 (cherry picked from commit 26743408e9ff53ac0e041407c359ed3c17c15596) --- contrib/xz/ChangeLog | 1246 +++++++++++++++++++++ contrib/xz/THANKS | 19 + contrib/xz/src/common/tuklib_integer.h | 14 +- contrib/xz/src/liblzma/api/lzma/container.h | 2 +- contrib/xz/src/liblzma/api/lzma/version.h | 2 +- contrib/xz/src/liblzma/check/crc32_table.c | 10 +- contrib/xz/src/liblzma/check/crc_common.h | 6 +- contrib/xz/src/liblzma/check/crc_x86_clmul.h | 12 +- contrib/xz/src/liblzma/rangecoder/range_decoder.h | 24 +- contrib/xz/src/liblzma/simple/arm64.c | 4 +- contrib/xz/src/lzmainfo/lzmainfo.c | 5 +- contrib/xz/src/xz/args.c | 1 - contrib/xz/src/xz/list.c | 7 + contrib/xz/src/xz/mytime.c | 2 +- contrib/xz/src/xzdec/xzdec.c | 2 +- lib/liblzma/config.h | 9 +- 16 files changed, 1321 insertions(+), 44 deletions(-) diff --git a/contrib/xz/ChangeLog b/contrib/xz/ChangeLog index c7795974ba23..2d36d7bb1043 100644 --- a/contrib/xz/ChangeLog +++ b/contrib/xz/ChangeLog @@ -1,3 +1,1249 @@ +commit 9331ce4009ddc839f5191d234cc41b2d4797376d +Author: Lasse Collin +Date: 2024-10-01 12:21:22 +0300 + + Bump version and soname for 5.6.3 + + src/liblzma/Makefile.am | 2 +- + src/liblzma/api/lzma/version.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit f52857ffde768058db0e0e13f68a2660ca9f1330 +Author: Lasse Collin +Date: 2024-10-01 12:17:39 +0300 + + Add NEWS for 5.6.3 + + NEWS | 125 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 125 insertions(+) + +commit b8f52990b5d47a50902bf33cd2305ce985457bac +Author: Lasse Collin +Date: 2024-10-01 12:10:23 +0300 + + Update THANKS + + (cherry picked from commit 1ebbe915d4e0d877154261b5f8103719a6722975) + + THANKS | 2 ++ + 1 file changed, 2 insertions(+) + +commit 51f6f455873911894f155e6997bc23a9be8f42ba +Author: Lasse Collin +Date: 2024-10-01 12:10:23 +0300 + + Tests/Windows: Add the application manifest to the test programs + + This ensures that the test programs get executed the same way as + the binaries that are installed. + + (cherry picked from commit 74702ee00ecfd080d8ab11118cd25dbe6c437ec0) + + CMakeLists.txt | 14 ++++++++++---- + tests/Makefile.am | 10 ++++++++++ + tests/tests.cmake | 33 ++++++++++++++++++++++++++++++++- + tests/tests_w32res.rc | 18 ++++++++++++++++++ + 4 files changed, 70 insertions(+), 5 deletions(-) + +commit bf518b9ba446327a062ddfe67e7e0a5baed2394f +Author: Lasse Collin +Date: 2024-10-01 12:10:23 +0300 + + Windows: Embed an application manifest in the EXE files + + IMPORTANT: This includes a security fix to command line tool + argument handling. + + Some toolchains embed an application manifest by default to declare + UAC-compliance. Some also declare compatibility with Vista/8/8.1/10/11 + to let the app access features newer than those of Vista. + + We want all the above but also two more things: + + - Declare that the app is long path aware to support paths longer + than 259 characters (this may also require a registry change). + + - Force the code page to UTF-8. This allows the command line tools + to access files whose names contain characters that don't exist + in the current legacy code page (except unpaired surrogates). + The UTF-8 code page also fixes security issues in command line + argument handling which can be exploited with malicious filenames. + See the new file w32_application.manifest.comments.txt. + + Thanks to Orange Tsai and splitline from DEVCORE Research Team + for discovering this issue. + + Thanks to Vijay Sarvepalli for reporting the issue to me. + + Thanks to Kelvin Lee for testing with MSVC and helping with + the required build system fixes. + + (cherry picked from commit 46ee0061629fb075d61d83839e14dd193337af59) + + CMakeLists.txt | 18 +++ + src/Makefile.am | 4 +- + src/common/common_w32res.rc | 5 + + src/common/w32_application.manifest | 28 ++++ + src/common/w32_application.manifest.comments.txt | 178 +++++++++++++++++++++++ + 5 files changed, 232 insertions(+), 1 deletion(-) + +commit 5718ce932e6ad4262d5fffc9e2a7a838f963d7e5 +Author: Lasse Collin +Date: 2024-09-29 14:46:52 +0300 + + Windows: Set DLL name accurately in StringFileInfo on Cygwin and MSYS2 + + Now the information in the "Details" tab in the file properties + dialog matches the naming convention of Cygwin and MSYS2. This + is only a cosmetic change. + + (cherry picked from commit dad153091552b52a41b95ec4981c6951f1cae487) + + src/liblzma/liblzma_w32res.rc | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +commit e77c0ca61d12ebac433b7661840cb18d7031700a +Author: Lasse Collin +Date: 2024-09-25 15:47:55 +0300 + + common_w32res.rc: White space edits + + LANGUAGE and VS_VERSION_INFO begin new statements so put an empty line + between them. + + (cherry picked from commit 8940ecb96fe9f0f2a9cfb8b66fe9ed31ffbea904) + + src/common/common_w32res.rc | 15 ++++++++------- + 1 file changed, 8 insertions(+), 7 deletions(-) + +commit e0ba0f26d9f3f53cedc92fb13303924c39d00392 +Author: Lasse Collin +Date: 2024-09-28 20:09:50 +0300 + + CMake: Add the resource files to the Cygwin and MSYS2 builds + + Autotools-based build has always done this so this is for consistency. + + However, the CMake build won't create the DEF file when building + for Cygwin or MSYS2 because in that context it should be useless. + (If Cygwin or MSYS2 is used to host building of normal Windows + binaries then the DEF file is still created.) + + (cherry picked from commit c3b9dad07d3fd9319f88386b7095019bcea45ce1) + + CMakeLists.txt | 16 ++++++++++------ + 1 file changed, 10 insertions(+), 6 deletions(-) + +commit 69637d0c323c0d7d9619cff637c7ce97dabc4f02 +Author: Lasse Collin +Date: 2024-09-28 15:19:14 +0300 + + CMake: Fix Windows resource file dependencies + + If common_w32res.rc is modified, the resource files need to be rebuilt. + In contrast, the liblzma*.map files truly are link dependencies. + + (cherry picked from commit da4f275bd1c18b897e5c2dd0043546de3accce0a) + + CMakeLists.txt | 17 +++++++++-------- + 1 file changed, 9 insertions(+), 8 deletions(-) + +commit af8533459c60d7bc5b55f2f516251af4572169e4 +Author: Lasse Collin +Date: 2024-09-29 01:20:03 +0300 + + CMake: Checking for CYGWIN covers MSYS2 too + + On MSYS2, both CYGWIN and MSYS are set. + + (cherry picked from commit 1c673c0aac7f7dee8dda2c1140351c8417a71e47) + + CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit eca08e4c204db404911e513f95110dcb0fb919bd +Author: Lasse Collin +Date: 2024-09-28 09:37:30 +0300 + + Translations: Add the SPDX license identifier to pt_BR.po + + (cherry picked from commit 6aaa0173b839e28429d43a8b62d257ad2f3b4521) + + po/pt_BR.po | 2 ++ + 1 file changed, 2 insertions(+) + +commit 85801c96c32456300177fbbad1506b07f5dd0a47 +Author: Lasse Collin +Date: 2024-09-25 16:41:37 +0300 + + Windows/CMake: Use the correct resource file for lzmadec.exe + + CMakeLists.txt was using xzdec_w32res.rc for both xzdec and lzmadec. + + Fixes: 998d0b29536094a89cf385a3b894e157db1ccefe + (cherry picked from commit dc7b9f24b737e4e55bcbbdde6754883f991c2cfb) + + CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit a341d19c835a8c10fcf561b00b548c53af43381e +Author: Lasse Collin +Date: 2024-09-25 21:29:59 +0300 + + Translations: Update the Brazilian Portuguese translation + + (cherry picked from commit b834ae5f80911a3819d6cdb484f61b257174c544) + + po/pt_BR.po | 144 ++++++++++++++++++++++-------------------------------------- + 1 file changed, 53 insertions(+), 91 deletions(-) + +commit e69c0b9b2e00ade984393ef9cabac57342072328 +Author: Lasse Collin +Date: 2024-09-17 01:21:15 +0300 + + Update THANKS + + (cherry picked from commit eceb023d4c129fd63ee881a2d8696eaf52ad1532) + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit aef9a25b3200457c16846b046222fb2c7967afe0 +Author: Tobias Stoeckmann +Date: 2024-09-16 23:19:46 +0200 + + lzmainfo: Avoid integer overflow + + The MB output can overflow with huge numbers. Most likely these are + invalid .lzma files anyway, but let's avoid garbage output. + + lzmadec was adapted from LZMA Utils. The original code with this bug + was written in 2005, over 19 years ago. + + Co-authored-by: Lasse Collin + Closes: https://github.com/tukaani-project/xz/pull/144 + (cherry picked from commit 76cfd0a9bb33ae8e534b1f73f6359dc825589f2f) + + src/lzmainfo/lzmainfo.c | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +commit 40a7f163f56aca6b3c8b83e9382f5e5cb4f8e93b +Author: Tobias Stoeckmann +Date: 2024-09-16 22:04:40 +0200 + + xzdec: Remove unused short option -M + + "xzdec -M123" exited with exit status 1 without printing + any messages. The "M:" entry should have been removed when + the memory usage limiter support was removed from xzdec. + + Fixes: 792331bdee706aa852a78b171040ebf814c6f3ae + Closes: https://github.com/tukaani-project/xz/pull/143 + [ Lasse: Commit message edits ] + + (cherry picked from commit 78355aebb7fb654302e5e33692ba109909dacaff) + + src/xzdec/xzdec.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit c98714a57058ac381365c2ff1e1d1cd63a5742c4 +Author: Lasse Collin +Date: 2024-09-10 13:54:47 +0300 + + Update THANKS + + (cherry picked from commit e5758db7bd75587a2499e0771907521a4aa86908) + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 4ed449517817b3659b35d19f39703e3c460f46c2 +Author: Firas Khalil Khana +Date: 2024-09-10 12:30:32 +0300 + + Build: Fix a typo in autogen.sh + + Fixes: e9be74f5b129fe8a5388d588e68b1b7f5168a310 + Closes: https://github.com/tukaani-project/xz/pull/141 + (cherry picked from commit 80ffa38f56657257ed4d90d76f6bd2f2bcb8163c) + + autogen.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 3b83577a1547e72cb78a905ad3d308a799ded485 +Author: Lasse Collin +Date: 2024-09-02 20:08:40 +0300 + + Translations: Update Chinese (simplified) translation + + Differences to the zh_CN.po file from the Translation Project: + + - Two uses of \v were fixed. + + - Missing "OPTS" translation in --riscv[=OPTS] was copied from + previous lines. + + - "make update-po" was run to remove line numbers from comments. + + (cherry picked from commit 68c54e45d042add64a4cb44bfc87ca74d29b87e2) + + po/zh_CN.po | 102 ++++++++++++++++++++++++------------------------------------ + 1 file changed, 40 insertions(+), 62 deletions(-) + +commit 06f4c7edda0387eb6a2d6303804b59dcf4d3db1f +Author: Lasse Collin +Date: 2024-09-02 19:40:50 +0300 + + Translations: Update the Catalan translation + + Differences to the ca.po file from the Translation Project: + + - An overlong line translating --filters-help was wrapped. + + - "make update-po" was used to remove line numbers from the comments + to match the changes in fccebe2b4fd513488fc920e4dac32562ed3c7637 + and 093490b58271e9424ce38a7b1b38bcf61b9c86c6. xz.pot in the TP + is older than these commits. + + (cherry picked from commit 2230692aa1bcebb586100183831e3daf1714d60a) + + po/ca.po | 171 ++++++++++++++++++++++++++------------------------------------- + 1 file changed, 69 insertions(+), 102 deletions(-) + +commit 406cb5b669e47c0e45c98f1afb7be998084a93d0 +Author: Lasse Collin +Date: 2024-08-22 11:01:07 +0300 + + Update THANKS + + (cherry picked from commit 5e375987509fab484b7bef0b90be92f241c58c91) + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 3a4a05d75eb41ddc41899324df0511670ceaaf1e +Author: Yifeng Li +Date: 2024-08-22 02:18:49 +0000 + + liblzma: Fix x86-64 movzw compatibility in range_decoder.h + + Support for instruction "movzw" without suffix in "GNU as" was + added in commit [1] and stabilized in binutils 2.27, released + in August 2016. Earlier systems don't accept this instruction + without a suffix, making range_decoder.h's inline assembly + unable to build on old systems such as Ubuntu 16.04, creating + error messages like: + + lzma_decoder.c: Assembler messages: + lzma_decoder.c:371: Error: no such instruction: `movzw 2(%r11),%esi' + lzma_decoder.c:373: Error: no such instruction: `movzw 4(%r11),%edi' + lzma_decoder.c:388: Error: no such instruction: `movzw 6(%r11),%edx' + lzma_decoder.c:398: Error: no such instruction: `movzw (%r11,%r14,4),%esi' + + Change "movzw" to "movzwl" for compatibility. + + [1] https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=c07315e0c610e0e3317b4c02266f81793df253d2 + + Suggested-by: Lasse Collin + Tested-by: Yifeng Li + Signed-off-by: Yifeng Li + Fixes: 3182a330c1512cc1f5c87b5c5a272578e60a5158 + Fixes: https://github.com/tukaani-project/xz/issues/121 + Closes: https://github.com/tukaani-project/xz/pull/136 + (cherry picked from commit 6cd7c8607843c337edfe2c472aa316602a393754) + + src/liblzma/rangecoder/range_decoder.h | 24 ++++++++++++------------ + 1 file changed, 12 insertions(+), 12 deletions(-) + +commit 4669f06d1a8d31de4b8b5861b5e8afd82cacd721 +Author: Lasse Collin +Date: 2024-07-19 20:02:43 +0300 + + Build: Comment that elf_aux_info(3) will be available on OpenBSD >= 7.6 + + (cherry picked from commit bf901dee5d4c46609645e50311c0cb2dfdcf9738) + + CMakeLists.txt | 2 +- + configure.ac | 17 +++++++++++------ + 2 files changed, 12 insertions(+), 7 deletions(-) + +commit 9edddda5636d7b3504a033c31e8ea763e293fd35 +Author: Lasse Collin +Date: 2024-07-13 22:10:37 +0300 + + liblzma: Tweak a comment + + (cherry picked from commit 7c292dd0bf23cefcdf4b1509f3666322e08a7ede) + + src/liblzma/simple/arm64.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 1a93ab55d1563f5eb9b2c1b8240384046fe4bb97 +Author: Lasse Collin +Date: 2024-07-11 22:17:56 +0300 + + CMake: Bump maximum policy version to 3.30 + + CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit cfe4465742ad2963fb0d9795e258615d7c1cf32d +Author: Lasse Collin +Date: 2024-07-09 14:27:51 +0300 + + Update THANKS + + (cherry picked from commit 028185dd4889e3d6235ff13560160ebca6985021) + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 0f47db18d04434203b350bde4909a5e468f197cc +Author: Lasse Collin +Date: 2024-07-06 14:04:48 +0300 + + xz: Remove the TODO comment about --recursive + + It won't be implemented. find + xargs is more flexible, for example, + it allows compressing small files in parallel. An example for that + has been included in the xz man page since 2010. + + (cherry picked from commit baecfa142644eb5f5c6dd6f8e2f531c362fa3747) + + src/xz/args.c | 1 - + 1 file changed, 1 deletion(-) + +commit 07f52c3528e43c4a925a3fc59a933c89f5604d92 +Author: Lasse Collin +Date: 2024-07-03 20:45:48 +0300 + + CMake: Link xz against Threads::Threads if using pthreads + + The liblzma target was recently changed to link against Threads::Threads + with the PRIVATE keyword. I had forgotten that xz itself depends on + pthreads too due to pthread_sigmask(). Thus, the build broke when + building shared liblzma and pthread_sigmask() wasn't in libc. + + Thanks to Peter Seiderer for the bug report. + + Fixes: ac05f1b0d7cda1e7ae79775a8dfecc54601d7f1c + Fixes: https://github.com/tukaani-project/xz/issues/129#issuecomment-2204522994 + (cherry picked from commit b3e53122f42796aaebd767bab920cf7bedf69966) + + CMakeLists.txt | 13 +++++++++++++ + 1 file changed, 13 insertions(+) + +commit eccb4d258b01651d06a2a31b8b68be9b04b7998c +Author: Lasse Collin +Date: 2024-07-02 22:49:33 +0300 + + Update THANKS + + (cherry picked from commit 5742ec1fc7f2cf1c82cfe3477bb90594a4658374) + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit c9bd00327f064778babb014302718a18d65cf7d3 +Author: Sam James +Date: 2024-06-28 14:18:35 +0300 + + CI: Speed up Valgrind job by using --trace-children-skip-by-arg=... + + This addresses the issue I mentioned in + 6c095a98fbec70b790253a663173ecdb669108c4 and speeds up the Valgrind + job a bit, because non-xz tools aren't run unnecessarily with + Valgrind by the script tests. + + (cherry picked from commit 7e99856f66c07852c4e0de7aa01951e9147d86b0) + + .github/workflows/ci.yml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 495de6ec9d7834c4ef4d5286844ef7b784eb951b +Author: Lasse Collin +Date: 2024-06-25 16:00:22 +0300 + + Build: Prepend, not append, PTHREAD_CFLAGS to LIBS + + It shouldn't make any difference because LIBS should be empty + at that point in configure. But prepending is the correct way + because in general the libraries being added might require other + libraries that come later on the command line. + + (cherry picked from commit 2402e8a1ae92676fa0d4cb1b761d7f62f005c098) + + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 55bf3f49a812e20a21e42323e39526bb31d9341a +Author: Lasse Collin +Date: 2024-06-25 14:24:29 +0300 + + Build: Use AC_LINK_IFELSE to handle implicit function declarations + + It's more robust in case the compiler allows pre-C99 implicit function + declarations. If an x86 intrinsic is missing and gets treated as + implicit function, the linking step will very probably fail. This + isn't the only way to workaround implicit function declarations but + it might be the simplest and cleanest. + + The problem hasn't been observed in the wild. + + There are a couple more AC_COMPILE_IFELSE uses in configure.ac. + Of these, Landlock check calls prctl() and in theory could have + the same problem. In practice it doesn't as the check program + looks for several other things too. However, it was changed to + AC_LINK_IFELSE still to look more correct. + + Similarly, m4/tuklib_cpucores.m4 and m4/tuklib_physmem.m4 were + updated although they haven't given any trouble either. They + have worked all these years because those check programs rely + on specific headers and types: if headers or types are missing, + compilation will fail. Using the linker makes these checks more + similar to the ones in cmake/tuklib_*.cmake which always link. + + (cherry picked from commit 7bb46f2b7b3989c1b589a247a251470f65e91cda) + + configure.ac | 8 ++++++-- + m4/tuklib_cpucores.m4 | 8 ++++---- + m4/tuklib_physmem.m4 | 17 +++++++++++------ + 3 files changed, 21 insertions(+), 12 deletions(-) + +commit b45270d88f0de1b2e8bf510f0e370a5db4067e1f +Author: Lasse Collin +Date: 2024-06-24 23:35:59 +0300 + + Build: Use AC_LINK_IFELSE instead of -Werror + + AC_COMPILE_IFELSE needed -Werror because Clang <= 14 would merely + warn about the unsupported attribute and implicit function declaration. + Changing to AC_LINK_IFELSE handles the implicit declaration because + the symbol __crc32d is unlikely to exist in libc. + + Note that the other part of the check is that #include + must work. If the header is missing, most compilers give an error + and the linking step won't be attempted. + + Avoiding -Werror makes the check more robust in case CFLAGS contains + warning flags that break -Werror anyway (but this isn't the only check + in configure.ac that has this problem). Using AC_LINK_IFELSE also makes + the check more similar to how it is done in CMakeLists.txt. + + (cherry picked from commit 35eb57355ad1c415a838d26192d5af84abb7cf39) + + configure.ac | 12 +----------- + 1 file changed, 1 insertion(+), 11 deletions(-) + +commit 2c3e4cbbdcefe214ef3033a725049034b73e9756 +Author: Lasse Collin +Date: 2024-06-24 23:34:34 +0300 + + Build: Sync the compile check changes from CMakeLists.txt + + It's nice to keep these in sync. The use of main() will later allow + AC_LINK_IFELSE usage too which may avoid the more fragile -Werror. + + (cherry picked from commit 5a728813c378cc3c4c9c95793762452418d08f1b) + + configure.ac | 15 ++++++++------- + 1 file changed, 8 insertions(+), 7 deletions(-) + +commit 809e69f1f574dad3c9b00d4f01b9ef1a492319f3 +Author: Lasse Collin +Date: 2024-06-25 16:11:13 +0300 + + CMake: Use configure_file() to copy a file + + I had missed this simpler method before. It does create a dependency + so that if .in.h changes the copying is done again. + + (cherry picked from commit de215a0517645d16343f3a5336d3df884a4f665f) + + CMakeLists.txt | 17 +++++++---------- + 1 file changed, 7 insertions(+), 10 deletions(-) + +commit 52a8c87f37f4bd133f670722d2d4b73a74e352bc +Author: Lasse Collin +Date: 2024-06-25 15:51:48 +0300 + + CMake: Always add pthread flags into CMAKE_REQUIRED_LIBRARIES + + It was weird to add CMAKE_THREAD_LIBS_INIT in CMAKE_REQUIRED_LIBRARIES + only if CLOCK_MONOTONIC is available. Alternative would be to remove + the thread libs from CMAKE_REQUIRED_LIBRARIES after the check for + pthread_condattr_setclock() but keeping the libs should be fine too. + Then it's ready in case more pthread functions were wanted some day. + + (cherry picked from commit e620f35097c0ad20cd76d8258750aa706758ced9) + + CMakeLists.txt | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +commit 1591747bf692d10c3b2fd92c9dc8ba931626fd84 +Author: Lasse Collin +Date: 2024-06-24 22:41:10 +0300 + + CMake: Fix three checks if building with -flto + + In CMake, check_c_source_compiles() always links too. With + link-time optimization, unused functions may get omitted if + main() doesn't depend on them. Consider the following which + tries to check if somefunction() is available when + has been included: + + #include + int foo(void) { return somefunction(); } + int main(void) { return 0; } + + LTO may omit foo() completely because the program as a whole doesn't + need it and then the program will link even if the symbol somefunction + isn't available in libc or other library being linked in, and then + the test may pass when it shouldn't. + + What happens if doesn't declare somefunction()? + Shouldn't the test fail in the compilation phase already? It should + but many compilers don't follow the C99 and later standards that + prohibit implicit function declarations. Instead such compilers + assume that somefunction() exists, compilation succeeds (with a + warning), and then linker with LTO omits the call to somefunction(). + + Change the tests so that they are part of main(). If compiler accepts + implicitly declared functions, LTO cannot omit them because it has to + assume that they might have side effects and thus linking will fail. + On the other hand, if the functions/intrinsics being used are supported, + they might get optimized away but in that case it's fine because they + really are supported. + + It is fine to use __attribute__((target(...))) for main(). At least + it works with GCC 4.9 to 14.1 on x86-64. + + Reported-by: Sam James + (cherry picked from commit 114cba69dbb96003e676c8c87a2e9943b12d065f) + + CMakeLists.txt | 19 ++++++++----------- + 1 file changed, 8 insertions(+), 11 deletions(-) + +commit cc386f4ff4b87ff895fbc30fd3b13ee6e6152ace +Author: Lasse Collin +Date: 2024-06-24 21:06:18 +0300 + + CMake: Improve the comment about LIBS + + (cherry picked from commit d3f20382fc1bd865eb70a65455d5022ed05caac8) + + CMakeLists.txt | 6 ++++++ + 1 file changed, 6 insertions(+) + +commit 65aaa0f87048f78a3f69c4ec0ad03723a2354fa7 +Author: Lasse Collin +Date: 2024-06-24 17:39:54 +0300 + + CI: Workaround buggy config.guess on Ubuntu 22.04LTS and 24.04LTS + + Check for the wrong triplet from config.guess and override it with + the --build option on the configure command line. Then i386 assembly + autodetection will work. + + These Ubuntu versions (and as of writing, also Debian unstable) + ship config.guess version 2022-01-09 which contains a bug that + was fixed in version 2022-05-08. It results in a wrong configure + triplet when using CC="gcc -m32" to build i386 binaries. + + Upstream fix: + https://git.savannah.gnu.org/cgit/config.git/commit/?id=f56a7140386d08a531bcfd444d632b28c61a6329 + + More information: + https://mail.gnu.org/archive/html/config-patches/2022-05/msg00003.html + + (cherry picked from commit 1bf83cded2955282fe1a868f08c83d4e5d6dca4a) + + build-aux/ci_build.bash | 9 +++++++++ + 1 file changed, 9 insertions(+) + +commit 810f1a8aee9edb3bff430559f4b832cd0ec50797 +Author: Lasse Collin +Date: 2024-06-24 15:24:52 +0300 + + CI: Use CC="gcc -m32" to get i386 compiler on x86-64 + + The old method put it in CFLAGS which is a wrong place because + config.guess doesn't read CFLAGS. + + (cherry picked from commit dbcdabf68fee9ed694b68c3a82e6adbeff20b679) + + .github/workflows/ci.yml | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit dde14ded9a3240fd524d9bc01c9ceeb4d7909e95 +Author: Lasse Collin +Date: 2024-06-24 14:54:17 +0300 + + CI: Let CMake use the CC environment variable + + CC from environment is used to initialize CMAKE_C_COMPILER so + setting CMAKE_C_COMPILER explicitly isn't needed. + + The syntax in ci_build.bash was broken in case one wished to put + spaces in CC. + + (cherry picked from commit 0c1e6d900bac127464fb30a854776e1810ab5f16) + + build-aux/ci_build.bash | 4 ---- + 1 file changed, 4 deletions(-) + +commit 85a55e1120bebac2f3cd9af8965f4a6335eeeb9b +Author: Lasse Collin +Date: 2024-06-20 18:12:21 +0300 + + CMake: Keep existing options in LIBS when adding -lrt + + This makes no difference yet because -lrt is currently the only option + that might be added to LIBS. + + (cherry picked from commit 75ce4797d49621710e6da95d8cb91541028c6d68) + + CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit e24a762f1be6bf379df73b7fe0a115ccae139a35 +Author: Lasse Collin +Date: 2024-06-15 18:07:04 +0300 + + CMake: Fix indentation + + (cherry picked from commit c715dec8e800b65145918cfb0ee9bbc90faa8aad) + + CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 99555b721b55263a6892b1093f2806f09a92e1fb +Author: Lasse Collin +Date: 2024-06-15 23:34:29 +0300 + + CMake: Link Threads::Threads as PRIVATE to liblzma + + This way pthread options aren't passed to the linker when linking + against shared liblzma but they are still passed when linking against + static liblzma. (Also, one never needs the include path of the + threading library to use liblzma since liblzma's API headers + don't #include . But tends to be in the + default include path so here this change makes no difference.) + + One cannot mix target_link_libraries() calls that use the scope + (PRIVATE, PUBLIC, or INTERFACE) keyword and calls that don't use it. + The calls without the keyword are like PUBLIC except perhaps when + they aren't, or something like that... It seems best to always + specify a scope keyword as the meanings of those three keywords + at least are clear. + + (cherry picked from commit ac05f1b0d7cda1e7ae79775a8dfecc54601d7f1c) + + CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 258bae30a2040138c783b5c380cef0ca603663ed +Author: Lasse Collin +Date: 2024-06-16 19:39:32 +0300 + + CMake: Add empty lines + + (cherry picked from commit 82986d8c691a294c78b48d8391303e5c428b5437) + + CMakeLists.txt | 2 ++ + 1 file changed, 2 insertions(+) + +commit a95a9601a109f0d0d059dea7a5a44efa87ef1401 +Author: Lasse Collin +Date: 2024-06-16 19:37:36 +0300 + + CMake: Use CMAKE_THREAD_LIBS_INIT in liblzma.pc only with pthreads + + This shouldn't make much difference in practice as on Windows + no flags are needed anyway and unitialized variable (when threading + is disabled) expands to empty. But it's clearer this way. + + (cherry picked from commit 2aecffe0f0e14f3ef635e8cd7b405420f2385de2) + + CMakeLists.txt | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +commit 65a10ddd439ad435d2c0176106b1e2d6b9c1b3a1 +Author: Lasse Collin +Date: 2024-06-17 18:20:14 +0300 + + Update THANKS + + (cherry picked from commit 664918bd3635ea8e773f06022286ecb0c485166c) + + THANKS | 3 +++ + 1 file changed, 3 insertions(+) + +commit 6ad5739094ac69ac448a84493f2c7ddfc6eb0688 +Author: Lasse Collin +Date: 2024-06-16 19:25:07 +0300 + + CMake: Use native newlines in liblzma.pc + + vcpkg doesn't specify the newline type so it should be fine to + use native newlines in liblzma.pc on Windows. + + (cherry picked from commit 5ca96a93488d0f5a530c78b274cac317453807ff) + + CMakeLists.txt | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +commit 4107f2066764bb3a31d114852bc20722d582fd82 +Author: Lasse Collin +Date: 2024-06-16 19:18:56 +0300 + + CMake: Use relative paths in liblzma.pc if possible + + Now liblzma.pc can be relocatable only if using CMake >= 3.20 + but that should be OK as now we shouldn't get broken liblzma.pc + if CMAKE_INSTALL_LIBDIR or CMAKE_INSTALL_INCLUDEDIR contain an + absolute path. + + Thanks to Eli Schwartz. + + (cherry picked from commit ebd155c3a1b87411edae06d3bdaa9659ec057522) + + CMakeLists.txt | 18 ++++++++++++++---- + 1 file changed, 14 insertions(+), 4 deletions(-) + +commit ff697eb154361417d94284e0c569aa08cacf9031 +Author: Lasse Collin +Date: 2024-06-16 13:39:37 +0300 + + liblzma: CRC CLMUL: Omit is_arch_extension_supported() when not needed + + On E2K the function compiles only due to compiler emulation but the + function is never used. It's cleaner to omit the function when it's + not needed even though it's a "static inline" function. + + Thanks to Ilya Kurdyukov. + + (cherry picked from commit 30a2d5d51006301a3ddab5ef1f5ff0a9d74dce6f) + + src/liblzma/check/crc_x86_clmul.h | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 4e4a568f6a089c867891c2388a19624e312eb2f3 +Author: Lasse Collin +Date: 2024-06-12 14:26:44 +0300 + + CMake: Prefer C11 with a fallback to C99 + + There is no need to make a similar change in configure.ac. + With Autoconf 2.72, the deprecated macro AC_PROG_CC_C99 + is an alias for AC_PROG_CC which prefers a C11 compiler. + + (cherry picked from commit 2178acf8a4d40a93e970cfcf9b807d5ef6c8da92) + + CMakeLists.txt | 17 +++++++++++------ + 1 file changed, 11 insertions(+), 6 deletions(-) + +commit 849e757a8cce41bfd6acfaa7dd3b07324363de90 +Author: Lasse Collin +Date: 2024-06-12 14:20:21 +0300 + + Update THANKS + + (cherry picked from commit c97e9c12fef4d1093ee2a75236742481361f50f5) + + THANKS | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 1305056a54e68895e052506bceb26274f52bbc9a +Author: Lasse Collin +Date: 2024-06-11 11:15:49 +0300 + + Tests: Improve the CRC32 test + + A similar one was already there for CRC64 but nowadays also CRC32 + has a CLMUL implementation, so it's good to test it better too. + + (cherry picked from commit 89e9f12e03324b8a186e807b268f34f92d1b2f41) + + tests/test_check.c | 17 +++++++++++++---- + 1 file changed, 13 insertions(+), 4 deletions(-) + +commit a44493ec41edc98f24ed9933668e7372f5267a40 +Author: Lasse Collin +Date: 2024-06-11 22:42:26 +0300 + + xz: Fix white space + + (cherry picked from commit c7164b1927e3fe7cdba70ee4687e1a590a81043b) + + src/xz/list.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 5e74a6a8138b3c102193d731120139d5a854f2cf +Author: Lasse Collin +Date: 2024-06-11 21:59:09 +0300 + + liblzma: Fix a typo in a comment + + Thanks to Sam James for spotting it. + + Fixes: f644473a211394447824ea00518d0a214ff3f7f2 + (cherry picked from commit 0a32d2072c598de281058b26dc08920fbf0cd2a1) + + src/liblzma/check/crc_x86_clmul.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 3f7edc673cf21b3e4db3e2f11746905e0a393db7 +Author: Lasse Collin +Date: 2024-05-10 15:52:26 +0300 + + liblzma: Fix a comment indentation + + (cherry picked from commit afd9b4d282a10186808c3331dad4caf79c02d55f) + + src/liblzma/check/crc_common.h | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 8a9cc7ca0867494f39990f0d4cbe0972042f6d59 +Author: Lasse Collin +Date: 2024-05-09 22:09:12 +0300 + + liblzma: Fix white space + + (cherry picked from commit 50e6bff274568c568930e15094da8217e7d47d28) + + src/liblzma/check/crc32_table.c | 10 +++++----- + src/liblzma/check/crc_x86_clmul.h | 6 +++--- + src/liblzma/check/sha256.c | 2 +- + 3 files changed, 9 insertions(+), 9 deletions(-) + +commit b29b13082fe578a3bb9384a5939c82055f796a34 +Author: RainRat +Date: 2024-06-05 15:21:49 -0700 + + Fix typos + + Closes: https://github.com/tukaani-project/xz/pull/124 + (cherry picked from commit 9e73918a4f14be754a23f74dda45ca431939a4a0) + + INSTALL | 2 +- + doc/examples/03_compress_custom.c | 2 +- + src/common/tuklib_integer.h | 2 +- + src/liblzma/api/lzma/container.h | 2 +- + src/xz/mytime.c | 2 +- + tests/test_filter_str.c | 2 +- + 6 files changed, 6 insertions(+), 6 deletions(-) + +commit 6f66155e01a6467e70db48cddbe790bdb8d87754 +Author: Lasse Collin +Date: 2024-06-07 15:47:20 +0300 + + tuklib_integer: Fix building on OpenBSD/sparc64 that uses GCC 4.2 + + GCC 4.2 doesn't have __builtin_bswap16() and friends so tuklib_integer.h + tries to use OS-specific byte swap methods instead. On OpenBSD those + macros are swap16/32/64 instead of bswap16/32/64 like on other *BSDs + and Darwin. + + An alternative to "#ifdef __OpenBSD__" could be "#ifdef swap16" as it + is a macro. But since OpenBSD seems to be a special case under this + special case of "*BSDs and Darwin", checking for __OpenBSD__ seems *** 772 LINES SKIPPED *** From nobody Sun Dec 22 07: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 4YGCfp5dVBz5jCj3; Sun, 22 Dec 2024 07: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YGCfp5FJLz4bpR; Sun, 22 Dec 2024 07: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=1734853058; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UV+UUm9diE/reiXIguw794C9TbSX6BVcczMgCaporOs=; b=WCCGWLSTH+tgcy99kihoEChrcJjsmecLJblus70kDQHNvHNJVNgbOUgk1gk9YGUsFsgtai DVmB/0XFQoSxHwCL6KhkO6lUUylYwVEblC63cvQl/g5tvE8iCTuJuuEIWeLQ3SJajEN6lK bXAOxUsCExFtwbUhHKmVJdwb6XxdAFKQm9yM+tCb30mh8hZ8fSLc7jCWyyHrZG5yiivZsB CeRSCUhkhJRl4ekDTvEaIiZl1o+Di2fit9QXWUUUSI8hWJ5C9BEaU0vHXhwSlOmepYP0LH SrL+kR22EJZ8IKFY5RN2ema06xvtXGywVb8RsbpdXhOCCqg8a+zCG6OFYG7/KQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734853058; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UV+UUm9diE/reiXIguw794C9TbSX6BVcczMgCaporOs=; b=BM/SPNYIjliHU+Fj9fVcg+ipI8UVoahEUhfqHrJc8whXgb3PXymjAMeHJVOh9ibZKQXfO0 xoPpCVlvd+ZN/EJNOdfwl6Dfeizw+Bi0TFNIFcaP2YWalHvVLcOtVp+apH9BhIo2dpBDgb vYLpTZ4rVkcU+ASO9h7dsjuj6oZMJMIiSeHdx91ZK52fWgKfE99CjE6LaAqAmF1DXzKIU2 r7rYPfNBV5e9a6QZYIggIL/MwD/RI8M3wSD/txCG2YU3Yo+FiEZ0vnVik1FXqOABwNYSa2 isNERcw2qRPhM/VSW6JqW/W8OSIT2Ju2BDAY6IRwTp3jGkhOGFimhWyBtz7IBw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734853058; a=rsa-sha256; cv=none; b=NgwpeosEP3cWwadzs2tvv5E6UiDSCXZazD7FikddCf6vwiytgCfKbdmI+m+IYINvXVBaG/ bWnABcyRQeTwPtN6wCbz1hyf4YjNzCx0Em4/y5e0o3wN7kVa23pmFwuxJyiEJPLzqaULqw FvrrN0mW9nBnWGN21MkYAhVNAWy2GD+HmNzcF295Xrp363EvGERk0Ul86WSl8hUQr2GSBD DJNGYYMD89BZdohQIn3taBLIMXET3jdtQ1aqf+ls3ME6ngbbMEP3eZtYT0nxJ0OcHJSnMl g75wVbGvIEyjBfWN5UsENxrxKAMtI455GMJdqQSBYytC74EzimDKXF+HrPC/jQ== 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 4YGCfp4lJwz108J; Sun, 22 Dec 2024 07:37:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BM7bcuv003007; Sun, 22 Dec 2024 07:37:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BM7bcCu002998; Sun, 22 Dec 2024 07:37:38 GMT (envelope-from git) Date: Sun, 22 Dec 2024 07:37:38 GMT Message-Id: <202412220737.4BM7bcCu002998@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Xin LI Subject: git: 71c92e6b94f0 - stable/14 - MFC: MFV: file 5.46. 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: delphij X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 71c92e6b94f0757ba698352888e98363495b5c44 Auto-Submitted: auto-generated The branch stable/14 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=71c92e6b94f0757ba698352888e98363495b5c44 commit 71c92e6b94f0757ba698352888e98363495b5c44 Author: Xin LI AuthorDate: 2024-12-08 19:07:01 +0000 Commit: Xin LI CommitDate: 2024-12-22 07:37:20 +0000 MFC: MFV: file 5.46. (cherry picked from commit ae316d1d1cffd71ab7751f94e10118777a88e027) --- contrib/file/ChangeLog | 32 + contrib/file/Makefile.in | 1 + contrib/file/aclocal.m4 | 4 +- contrib/file/config.h.in | 137 +- contrib/file/configure | 3017 ++++++++++++-------- contrib/file/configure.ac | 35 +- contrib/file/doc/Makefile.in | 1 + contrib/file/doc/file.man | 6 +- contrib/file/doc/libmagic.man | 29 +- contrib/file/doc/magic.man | 112 +- contrib/file/ltmain.sh | 863 ++++-- contrib/file/m4/libtool.m4 | 227 +- contrib/file/m4/ltoptions.m4 | 4 +- contrib/file/m4/ltsugar.m4 | 2 +- contrib/file/m4/ltversion.m4 | 13 +- contrib/file/m4/lt~obsolete.m4 | 4 +- contrib/file/magic/Magdir/acorn | 35 +- contrib/file/magic/Magdir/adventure | 4 +- contrib/file/magic/Magdir/algol68 | 4 +- contrib/file/magic/Magdir/android | 14 +- contrib/file/magic/Magdir/animation | 126 +- contrib/file/magic/Magdir/apple | 58 +- contrib/file/magic/Magdir/archive | 291 +- contrib/file/magic/Magdir/aria | 2 + contrib/file/magic/Magdir/arm | 11 +- contrib/file/magic/Magdir/asf | 14 +- contrib/file/magic/Magdir/audio | 123 +- contrib/file/magic/Magdir/ber | 3 +- contrib/file/magic/Magdir/biosig | 6 +- contrib/file/magic/Magdir/bsdi | 9 +- contrib/file/magic/Magdir/c64 | 158 +- contrib/file/magic/Magdir/cafebabe | 91 +- contrib/file/magic/Magdir/cbor | 4 +- contrib/file/magic/Magdir/claris | 10 +- contrib/file/magic/Magdir/coff | 179 +- contrib/file/magic/Magdir/commands | 14 +- contrib/file/magic/Magdir/compress | 27 +- contrib/file/magic/Magdir/console | 426 ++- contrib/file/magic/Magdir/ctf | 1 + contrib/file/magic/Magdir/database | 41 +- contrib/file/magic/Magdir/dataone | 13 +- contrib/file/magic/Magdir/diff | 125 +- contrib/file/magic/Magdir/digital | 20 +- contrib/file/magic/Magdir/efi | 45 +- contrib/file/magic/Magdir/elf | 32 +- contrib/file/magic/Magdir/epoc | 37 +- contrib/file/magic/Magdir/espressif | 4 +- contrib/file/magic/Magdir/filesystems | 179 +- contrib/file/magic/Magdir/firmware | 146 +- contrib/file/magic/Magdir/fonts | 36 +- contrib/file/magic/Magdir/frame | 120 +- contrib/file/magic/Magdir/games | 78 +- contrib/file/magic/Magdir/gentoo | 22 +- contrib/file/magic/Magdir/geo | 6 +- contrib/file/magic/Magdir/geos | 11 +- contrib/file/magic/Magdir/hitachi-sh | 18 +- contrib/file/magic/Magdir/hp | 25 +- contrib/file/magic/Magdir/ibm370 | 14 +- contrib/file/magic/Magdir/ibm6000 | 9 +- contrib/file/magic/Magdir/iff | 23 +- contrib/file/magic/Magdir/images | 629 +++- contrib/file/magic/Magdir/ispell | 190 +- contrib/file/magic/Magdir/javascript | 29 +- contrib/file/magic/Magdir/jpeg | 55 +- contrib/file/magic/Magdir/keyman | 14 + contrib/file/magic/Magdir/lammps | 5 +- contrib/file/magic/Magdir/lauterbach | 7 + contrib/file/magic/Magdir/linux | 415 ++- contrib/file/magic/Magdir/lisp | 12 +- contrib/file/magic/Magdir/magic | 47 +- contrib/file/magic/Magdir/mail.news | 22 +- contrib/file/magic/Magdir/map | 3 +- contrib/file/magic/Magdir/meteorological | 17 +- contrib/file/magic/Magdir/mips | 180 +- contrib/file/magic/Magdir/mmdf | 23 +- contrib/file/magic/Magdir/motorola | 8 +- contrib/file/magic/Magdir/msdos | 1309 +++++++-- contrib/file/magic/Magdir/msooxml | 37 +- contrib/file/magic/Magdir/msvc | 13 +- contrib/file/magic/Magdir/msx | 31 +- contrib/file/magic/Magdir/music | 4 +- contrib/file/magic/Magdir/nasa | 3 +- contrib/file/magic/Magdir/ole2compounddocs | 54 +- contrib/file/magic/Magdir/olf | 14 +- contrib/file/magic/Magdir/pack | 101 + contrib/file/magic/Magdir/pc88 | 24 - contrib/file/magic/Magdir/pdp | 16 +- contrib/file/magic/Magdir/pgp | 140 +- contrib/file/magic/Magdir/plan9 | 8 +- contrib/file/magic/Magdir/printer | 28 +- contrib/file/magic/Magdir/python | 33 +- contrib/file/magic/Magdir/revision | 27 +- contrib/file/magic/Magdir/riff | 89 +- contrib/file/magic/Magdir/rpm | 12 +- contrib/file/magic/Magdir/sgml | 98 +- contrib/file/magic/Magdir/sharc | 6 +- contrib/file/magic/Magdir/sniffer | 8 +- contrib/file/magic/Magdir/sql | 95 +- contrib/file/magic/Magdir/ssh | 45 + contrib/file/magic/Magdir/ssl | 22 +- contrib/file/magic/Magdir/sun | 17 +- contrib/file/magic/Magdir/symbos | 3 +- contrib/file/magic/Magdir/terminfo | 14 +- contrib/file/magic/Magdir/uf2 | 40 +- contrib/file/magic/Magdir/uxn | 18 + contrib/file/magic/Magdir/varied.script | 5 +- contrib/file/magic/Magdir/vax | 4 +- contrib/file/magic/Magdir/virtual | 38 +- contrib/file/magic/Magdir/weak | 1 + contrib/file/magic/Magdir/windows | 167 +- contrib/file/magic/Magdir/wordprocessors | 50 +- contrib/file/magic/Magdir/xenix | 136 +- contrib/file/magic/Magdir/xilinx | 49 +- contrib/file/magic/Magdir/yara | 16 +- contrib/file/magic/Makefile.am | 7 +- contrib/file/magic/Makefile.in | 8 +- contrib/file/python/Makefile.in | 1 + contrib/file/src/Makefile.in | 1 + contrib/file/src/apprentice.c | 104 +- contrib/file/src/cdf.c | 108 +- contrib/file/src/cdf.h | 131 +- contrib/file/src/cdf_time.c | 22 +- contrib/file/src/compress.c | 77 +- contrib/file/src/der.c | 22 +- contrib/file/src/der.h | 4 +- contrib/file/src/encoding.c | 4 +- contrib/file/src/file.c | 10 +- contrib/file/src/file.h | 69 +- contrib/file/src/funcs.c | 19 +- contrib/file/src/is_csv.c | 9 +- contrib/file/src/magic.c | 27 +- contrib/file/src/magic.h.in | 5 +- contrib/file/src/mygetopt.h | 9 +- contrib/file/src/print.c | 50 +- contrib/file/src/readelf.c | 150 +- contrib/file/src/readelf.h | 31 + contrib/file/src/seccomp.c | 103 +- contrib/file/src/softmagic.c | 148 +- contrib/file/tests/Makefile.am | 21 + contrib/file/tests/Makefile.in | 22 + contrib/file/tests/keyman-0.result | 1 + contrib/file/tests/keyman-0.testfile | Bin 0 -> 1494 bytes contrib/file/tests/keyman-1.result | 1 + contrib/file/tests/keyman-1.testfile | Bin 0 -> 378 bytes contrib/file/tests/keyman-2.result | 1 + contrib/file/tests/keyman-2.testfile | Bin 0 -> 1092 bytes contrib/file/tests/multiple.result | 2 +- contrib/file/tests/rpm-v3.0-bin-aarch64.result | 1 + contrib/file/tests/rpm-v3.0-bin-aarch64.testfile | Bin 0 -> 6361 bytes contrib/file/tests/rpm-v3.0-bin-powerpc64.result | 1 + contrib/file/tests/rpm-v3.0-bin-powerpc64.testfile | Bin 0 -> 6309 bytes contrib/file/tests/rpm-v3.0-bin-s390x.result | 1 + contrib/file/tests/rpm-v3.0-bin-s390x.testfile | Bin 0 -> 6301 bytes contrib/file/tests/rpm-v3.0-bin-x86_64.result | 1 + contrib/file/tests/rpm-v3.0-bin-x86_64.testfile | Bin 0 -> 6365 bytes contrib/file/tests/rpm-v3.0-src.result | 1 + contrib/file/tests/rpm-v3.0-src.testfile | Bin 0 -> 6554 bytes contrib/file/tests/searchbug.magic | 12 + contrib/file/tests/searchbug.result | 1 + contrib/file/tests/searchbug.testfile | 1 + contrib/file/tests/uf2.result | 2 +- contrib/file/tests/utf16xmlsvg.result | 1 + contrib/file/tests/utf16xmlsvg.testfile | Bin 0 -> 5564 bytes lib/libmagic/config.h | 147 +- 164 files changed, 8963 insertions(+), 3905 deletions(-) diff --git a/contrib/file/ChangeLog b/contrib/file/ChangeLog index fdf1cff6e2d3..d2dfbc14b77f 100644 --- a/contrib/file/ChangeLog +++ b/contrib/file/ChangeLog @@ -1,3 +1,35 @@ +2024-11-27 14:44 Christos Zoulas + + * release 5.46 + * Add OFFPOSITIVE + +2024-11-25 13:56 Christos Zoulas + + * avoid leaking symbols in libmagic + +2024-11-10 13:56 Christos Zoulas + + * PR/562: jsummers: Search/regex offsets are absolute to the + beginning of the file, so adjust them by subtracting the + offset that the "use" starts so that we don't double-count it. + + +2024-11-09 19:30 Christos Zoulas + * PR/543: matshch: bump nbuf so we can get the flags into the buffer. + + +2024-11-02 14:34 Christos Zoulas + + * Add Android elf notes (enh) + +2023-12-29 12:55 Christos Zoulas + + * Add limit for number of magic warnings allowed + +2023-07-29 12:55 Christos Zoulas + + * check regex bounds (found by clusterfuzz) + 2023-07-27 15:45 Christos Zoulas * release 5.45 diff --git a/contrib/file/Makefile.in b/contrib/file/Makefile.in index 4ce98d934433..8c72613f17f9 100644 --- a/contrib/file/Makefile.in +++ b/contrib/file/Makefile.in @@ -264,6 +264,7 @@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FILECMD = @FILECMD@ GREP = @GREP@ HAVE_VISIBILITY = @HAVE_VISIBILITY@ INSTALL = @INSTALL@ diff --git a/contrib/file/aclocal.m4 b/contrib/file/aclocal.m4 index 3ccd6030e97b..82f7c4bcaacb 100644 --- a/contrib/file/aclocal.m4 +++ b/contrib/file/aclocal.m4 @@ -14,8 +14,8 @@ m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.71],, -[m4_warning([this file was generated for autoconf 2.71. +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.72],, +[m4_warning([this file was generated for autoconf 2.72. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) diff --git a/contrib/file/config.h.in b/contrib/file/config.h.in index 5ae30c61edd1..9391b4e7dd71 100644 --- a/contrib/file/config.h.in +++ b/contrib/file/config.h.in @@ -12,10 +12,10 @@ /* Define for ELF core file support */ #undef ELFCORE -/* Define to 1 if you have the `asctime_r' function. */ +/* Define to 1 if you have the 'asctime_r' function. */ #undef HAVE_ASCTIME_R -/* Define to 1 if you have the `asprintf' function. */ +/* Define to 1 if you have the 'asprintf' function. */ #undef HAVE_ASPRINTF /* Define to 1 if you have the header file. */ @@ -24,24 +24,24 @@ /* Define to 1 if you have the header file. */ #undef HAVE_BZLIB_H -/* Define to 1 if you have the `ctime_r' function. */ +/* Define to 1 if you have the 'ctime_r' function. */ #undef HAVE_CTIME_R /* HAVE_DAYLIGHT */ #undef HAVE_DAYLIGHT -/* Define to 1 if you have the declaration of `daylight', and to 0 if you +/* Define to 1 if you have the declaration of 'daylight', and to 0 if you don't. */ #undef HAVE_DECL_DAYLIGHT -/* Define to 1 if you have the declaration of `tzname', and to 0 if you don't. +/* Define to 1 if you have the declaration of 'tzname', and to 0 if you don't. */ #undef HAVE_DECL_TZNAME /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H -/* Define to 1 if you have the `dprintf' function. */ +/* Define to 1 if you have the 'dprintf' function. */ #undef HAVE_DPRINTF /* Define to 1 if you have the header file. */ @@ -50,63 +50,69 @@ /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H -/* Define to 1 if you have the `fmtcheck' function. */ +/* Define to 1 if you have the 'fmtcheck' function. */ #undef HAVE_FMTCHECK -/* Define to 1 if you have the `fork' function. */ +/* Define to 1 if you have the 'fork' function. */ #undef HAVE_FORK -/* Define to 1 if you have the `freelocale' function. */ +/* Define to 1 if you have the 'freelocale' function. */ #undef HAVE_FREELOCALE -/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */ +/* Define to 1 if fseeko (and ftello) are declared in stdio.h. */ #undef HAVE_FSEEKO -/* Define to 1 if you have the `getline' function. */ +/* Define to 1 if you have the 'getline' function. */ #undef HAVE_GETLINE /* Define to 1 if you have the header file. */ #undef HAVE_GETOPT_H -/* Define to 1 if you have the `getopt_long' function. */ +/* Define to 1 if you have the 'getopt_long' function. */ #undef HAVE_GETOPT_LONG -/* Define to 1 if you have the `getpagesize' function. */ +/* Define to 1 if you have the 'getpagesize' function. */ #undef HAVE_GETPAGESIZE -/* Define to 1 if you have the `gmtime_r' function. */ +/* Define to 1 if you have the 'gmtime_r' function. */ #undef HAVE_GMTIME_R -/* Define to 1 if the system has the type `intptr_t'. */ +/* Define to 1 if the system has the type 'intptr_t'. */ #undef HAVE_INTPTR_T /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H -/* Define to 1 if you have the `bz2' library (-lbz2). */ +/* Define to 1 if you have the 'bz2' library (-lbz2). */ #undef HAVE_LIBBZ2 -/* Define to 1 if you have the `gnurx' library (-lgnurx). */ +/* Define to 1 if you have the 'gnurx' library (-lgnurx). */ #undef HAVE_LIBGNURX -/* Define to 1 if you have the `lz' library (-llz). */ +/* Define to 1 if you have the 'lrzip' library (-llrzip). */ +#undef HAVE_LIBLRZIP + +/* Define to 1 if you have the 'lz' library (-llz). */ #undef HAVE_LIBLZ -/* Define to 1 if you have the `lzma' library (-llzma). */ +/* Define to 1 if you have the 'lzma' library (-llzma). */ #undef HAVE_LIBLZMA -/* Define to 1 if you have the `seccomp' library (-lseccomp). */ +/* Define to 1 if you have the 'seccomp' library (-lseccomp). */ #undef HAVE_LIBSECCOMP -/* Define to 1 if you have the `z' library (-lz). */ +/* Define to 1 if you have the 'z' library (-lz). */ #undef HAVE_LIBZ -/* Define to 1 if you have the `zstd' library (-lzstd). */ +/* Define to 1 if you have the 'zstd' library (-lzstd). */ #undef HAVE_LIBZSTD -/* Define to 1 if you have the `localtime_r' function. */ +/* Define to 1 if you have the 'localtime_r' function. */ #undef HAVE_LOCALTIME_R +/* Define to 1 if you have the header file. */ +#undef HAVE_LRZIP_H + /* Define to 1 if you have the header file. */ #undef HAVE_LZLIB_H @@ -119,31 +125,31 @@ /* Define to 1 if declares mbstate_t. */ #undef HAVE_MBSTATE_T -/* Define to 1 if you have the `memmem' function. */ +/* Define to 1 if you have the 'memmem' function. */ #undef HAVE_MEMMEM /* Define to 1 if you have the header file. */ #undef HAVE_MINIX_CONFIG_H -/* Define to 1 if you have the `mkostemp' function. */ +/* Define to 1 if you have the 'mkostemp' function. */ #undef HAVE_MKOSTEMP -/* Define to 1 if you have the `mkstemp' function. */ +/* Define to 1 if you have the 'mkstemp' function. */ #undef HAVE_MKSTEMP -/* Define to 1 if you have a working `mmap' system call. */ +/* Define to 1 if you have a working 'mmap' system call. */ #undef HAVE_MMAP -/* Define to 1 if you have the `newlocale' function. */ +/* Define to 1 if you have the 'newlocale' function. */ #undef HAVE_NEWLOCALE -/* Define to 1 if you have the `pipe2' function. */ +/* Define to 1 if you have the 'pipe2' function. */ #undef HAVE_PIPE2 -/* Define to 1 if you have the `posix_spawnp' function. */ +/* Define to 1 if you have the 'posix_spawnp' function. */ #undef HAVE_POSIX_SPAWNP -/* Define to 1 if you have the `pread' function. */ +/* Define to 1 if you have the 'pread' function. */ #undef HAVE_PREAD /* Have sig_t type */ @@ -161,7 +167,7 @@ /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H -/* Define to 1 if you have the `strcasestr' function. */ +/* Define to 1 if you have the 'strcasestr' function. */ #undef HAVE_STRCASESTR /* Define to 1 if you have the header file. */ @@ -170,28 +176,28 @@ /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H -/* Define to 1 if you have the `strlcat' function. */ +/* Define to 1 if you have the 'strlcat' function. */ #undef HAVE_STRLCAT -/* Define to 1 if you have the `strlcpy' function. */ +/* Define to 1 if you have the 'strlcpy' function. */ #undef HAVE_STRLCPY -/* Define to 1 if you have the `strndup' function. */ +/* Define to 1 if you have the 'strndup' function. */ #undef HAVE_STRNDUP -/* Define to 1 if you have the `strtof' function. */ +/* Define to 1 if you have the 'strtof' function. */ #undef HAVE_STRTOF /* HAVE_STRUCT_OPTION */ #undef HAVE_STRUCT_OPTION -/* Define to 1 if `st_rdev' is a member of `struct stat'. */ +/* Define to 1 if 'st_rdev' is a member of 'struct stat'. */ #undef HAVE_STRUCT_STAT_ST_RDEV -/* Define to 1 if `tm_gmtoff' is a member of `struct tm'. */ +/* Define to 1 if 'tm_gmtoff' is a member of 'struct tm'. */ #undef HAVE_STRUCT_TM_TM_GMTOFF -/* Define to 1 if `tm_zone' is a member of `struct tm'. */ +/* Define to 1 if 'tm_zone' is a member of 'struct tm'. */ #undef HAVE_STRUCT_TM_TM_ZONE /* Define to 1 if you have the header file. */ @@ -233,28 +239,28 @@ /* HAVE_TZNAME */ #undef HAVE_TZNAME -/* Define to 1 if the system has the type `uintptr_t'. */ +/* Define to 1 if the system has the type 'uintptr_t'. */ #undef HAVE_UINTPTR_T /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H -/* Define to 1 if you have the `uselocale' function. */ +/* Define to 1 if you have the 'uselocale' function. */ #undef HAVE_USELOCALE -/* Define to 1 if you have the `utime' function. */ +/* Define to 1 if you have the 'utime' function. */ #undef HAVE_UTIME -/* Define to 1 if you have the `utimes' function. */ +/* Define to 1 if you have the 'utimes' function. */ #undef HAVE_UTIMES /* Define to 1 if you have the header file. */ #undef HAVE_UTIME_H -/* Define to 1 if you have the `vasprintf' function. */ +/* Define to 1 if you have the 'vasprintf' function. */ #undef HAVE_VASPRINTF -/* Define to 1 if you have the `vfork' function. */ +/* Define to 1 if you have the 'vfork' function. */ #undef HAVE_VFORK /* Define to 1 if you have the header file. */ @@ -270,13 +276,13 @@ /* Define to 1 if you have the header file. */ #undef HAVE_WCTYPE_H -/* Define to 1 if you have the `wcwidth' function. */ +/* Define to 1 if you have the 'wcwidth' function. */ #undef HAVE_WCWIDTH -/* Define to 1 if `fork' works. */ +/* Define to 1 if 'fork' works. */ #undef HAVE_WORKING_FORK -/* Define to 1 if `vfork' works. */ +/* Define to 1 if 'vfork' works. */ #undef HAVE_WORKING_VFORK /* Define to 1 if you have the header file. */ @@ -291,17 +297,20 @@ /* Define to 1 if you have the header file. */ #undef HAVE_ZSTD_H +/* Enable lrziplib compression support */ +#undef LRZIPLIBSUPPORT + /* Define to the sub-directory where libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Enable lzlib compression support */ #undef LZLIBSUPPORT -/* Define to 1 if `major', `minor', and `makedev' are declared in . +/* Define to 1 if 'major', 'minor', and 'makedev' are declared in . */ #undef MAJOR_IN_MKDEV -/* Define to 1 if `major', `minor', and `makedev' are declared in +/* Define to 1 if 'major', 'minor', and 'makedev' are declared in . */ #undef MAJOR_IN_SYSMACROS @@ -326,15 +335,15 @@ /* Define to the version of this package. */ #undef PACKAGE_VERSION -/* Define to 1 if all of the C90 standard headers exist (not just the ones +/* Define to 1 if all of the C89 standard headers exist (not just the ones required in a freestanding environment). This macro is provided for backward compatibility; new code need not use it. */ #undef STDC_HEADERS -/* Define to 1 if your declares `struct tm'. */ +/* Define to 1 if your declares 'struct tm'. */ #undef TM_IN_SYS_TIME -/* Enable extensions on AIX 3, Interix. */ +/* Enable extensions on AIX, Interix, z/OS. */ #ifndef _ALL_SOURCE # undef _ALL_SOURCE #endif @@ -395,11 +404,15 @@ #ifndef __STDC_WANT_IEC_60559_DFP_EXT__ # undef __STDC_WANT_IEC_60559_DFP_EXT__ #endif +/* Enable extensions specified by C23 Annex F. */ +#ifndef __STDC_WANT_IEC_60559_EXT__ +# undef __STDC_WANT_IEC_60559_EXT__ +#endif /* Enable extensions specified by ISO/IEC TS 18661-4:2015. */ #ifndef __STDC_WANT_IEC_60559_FUNCS_EXT__ # undef __STDC_WANT_IEC_60559_FUNCS_EXT__ #endif -/* Enable extensions specified by ISO/IEC TS 18661-3:2015. */ +/* Enable extensions specified by C23 Annex H and ISO/IEC TS 18661-3:2015. */ #ifndef __STDC_WANT_IEC_60559_TYPES_EXT__ # undef __STDC_WANT_IEC_60559_TYPES_EXT__ #endif @@ -449,12 +462,15 @@ /* Number of bits in a file offset, on hosts where this is settable. */ #undef _FILE_OFFSET_BITS -/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */ +/* Define to 1 if necessary to make fseeko visible. */ #undef _LARGEFILE_SOURCE -/* Define for large files, on AIX-style hosts. */ +/* Define to 1 on platforms where this makes off_t a 64-bit type. */ #undef _LARGE_FILES +/* Number of bits in time_t, on hosts where this is settable. */ +#undef _TIME_BITS + /* Define for Solaris 2.5.1 so the uint32_t typedef from , , or is not used. If the typedef were allowed, the #define below would cause a syntax error. */ @@ -470,6 +486,9 @@ #define below would cause a syntax error. */ #undef _UINT8_T +/* Define to 1 on platforms where this makes time_t a 64-bit type. */ +#undef __MINGW_USE_VC2005_COMPAT + /* Define to the type of a signed integer type of width exactly 32 bits if such a type exists and the standard includes do not define it. */ #undef int32_t @@ -485,13 +504,13 @@ /* Define to a type if does not define. */ #undef mbstate_t -/* Define to `long int' if does not define. */ +/* Define to 'long int' if does not define. */ #undef off_t /* Define as a signed integer type capable of holding a process identifier. */ #undef pid_t -/* Define to `unsigned int' if does not define. */ +/* Define as 'unsigned int' if doesn't define. */ #undef size_t /* Define to the type of an unsigned integer type of width exactly 16 bits if @@ -514,5 +533,5 @@ pointer, if such a type exists, and if the system does not define it. */ #undef uintptr_t -/* Define as `fork' if `vfork' does not work. */ +/* Define as 'fork' if 'vfork' does not work. */ #undef vfork diff --git a/contrib/file/configure b/contrib/file/configure index 8043072f56f7..cdcdd746f562 100755 --- a/contrib/file/configure +++ b/contrib/file/configure @@ -1,11 +1,11 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for file 5.45. +# Generated by GNU Autoconf 2.72 for file 5.46. # # Report bugs to . # # -# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, +# Copyright (C) 1992-1996, 1998-2017, 2020-2023 Free Software Foundation, # Inc. # # @@ -17,7 +17,6 @@ # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -as_nop=: if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh @@ -26,12 +25,13 @@ then : # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else $as_nop - case `(set -o) 2>/dev/null` in #( +else case e in #( + e) case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; +esac ;; esac fi @@ -103,7 +103,7 @@ IFS=$as_save_IFS ;; esac -# We did not find ourselves, most probably we were run as `sh COMMAND' +# We did not find ourselves, most probably we were run as 'sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 @@ -133,15 +133,14 @@ case $- in # (((( esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed `exec'. +# out after a failed 'exec'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="as_nop=: -if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 + as_bourne_compatible="if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: @@ -149,12 +148,13 @@ then : # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST -else \$as_nop - case \`(set -o) 2>/dev/null\` in #( +else case e in #( + e) case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; +esac ;; esac fi " @@ -172,8 +172,9 @@ as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ) then : -else \$as_nop - exitcode=1; echo positional parameters were not saved. +else case e in #( + e) exitcode=1; echo positional parameters were not saved. ;; +esac fi test x\$exitcode = x0 || exit 1 blah=\$(echo \$(echo blah)) @@ -195,14 +196,15 @@ test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null then : as_have_required=yes -else $as_nop - as_have_required=no +else case e in #( + e) as_have_required=no ;; +esac fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null then : -else $as_nop - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +else case e in #( + e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do @@ -235,12 +237,13 @@ IFS=$as_save_IFS if $as_found then : -else $as_nop - if { test -f "$SHELL" || test -f "$SHELL.exe"; } && +else case e in #( + e) if { test -f "$SHELL" || test -f "$SHELL.exe"; } && as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null then : CONFIG_SHELL=$SHELL as_have_required=yes -fi +fi ;; +esac fi @@ -262,7 +265,7 @@ case $- in # (((( esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed `exec'. +# out after a failed 'exec'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi @@ -282,7 +285,8 @@ $0: a modern shell, or manually run the script under such a $0: shell if you do have one." fi exit 1 -fi +fi ;; +esac fi fi SHELL=${CONFIG_SHELL-/bin/sh} @@ -321,14 +325,6 @@ as_fn_exit () as_fn_set_status $1 exit $1 } # as_fn_exit -# as_fn_nop -# --------- -# Do nothing but, unlike ":", preserve the value of $?. -as_fn_nop () -{ - return $? -} -as_nop=as_fn_nop # as_fn_mkdir_p # ------------- @@ -397,11 +393,12 @@ then : { eval $1+=\$2 }' -else $as_nop - as_fn_append () +else case e in #( + e) as_fn_append () { eval $1=\$$1\$2 - } + } ;; +esac fi # as_fn_append # as_fn_arith ARG... @@ -415,21 +412,14 @@ then : { as_val=$(( $* )) }' -else $as_nop - as_fn_arith () +else case e in #( + e) as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` - } + } ;; +esac fi # as_fn_arith -# as_fn_nop -# --------- -# Do nothing but, unlike ":", preserve the value of $?. -as_fn_nop () -{ - return $? -} -as_nop=as_fn_nop # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- @@ -503,6 +493,8 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits /[$]LINENO/= ' <$as_myself | sed ' + t clear + :clear s/[$]LINENO.*/&-/ t lineno b @@ -551,7 +543,6 @@ esac as_echo='printf %s\n' as_echo_n='printf %s' - rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file @@ -563,9 +554,9 @@ if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -pR'. + # 1) On MSYS, both 'ln -s file dir' and 'ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; 'ln -s' creates a wrapper executable. + # In both cases, we have to default to 'cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then @@ -590,10 +581,12 @@ as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" +as_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" +as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated # Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" +as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g" +as_tr_sh="eval sed '$as_sed_sh'" # deprecated SHELL=${CONFIG_SHELL-/bin/sh} @@ -621,8 +614,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='file' PACKAGE_TARNAME='file' -PACKAGE_VERSION='5.45' -PACKAGE_STRING='file 5.45' +PACKAGE_VERSION='5.46' +PACKAGE_STRING='file 5.46' PACKAGE_BUGREPORT='christos@astron.com' PACKAGE_URL='' @@ -659,6 +652,7 @@ ac_includes_default="\ ac_header_c_list= ac_func_c_list= +enable_year2038=yes ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS @@ -679,6 +673,7 @@ ac_ct_AR AR DLLTOOL OBJDUMP +FILECMD NM ac_ct_DUMPBIN DUMPBIN @@ -802,6 +797,7 @@ enable_bzlib enable_xzlib enable_zstdlib enable_lzlib +enable_lrziplib enable_libseccomp enable_fsect_man5 enable_dependency_tracking @@ -815,6 +811,7 @@ with_sysroot enable_libtool_lock enable_largefile enable_warnings +enable_year2038 ' ac_precious_vars='build_alias host_alias @@ -933,7 +930,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: \`$ac_useropt'" + as_fn_error $? "invalid feature name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -959,7 +956,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: \`$ac_useropt'" + as_fn_error $? "invalid feature name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1172,7 +1169,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: \`$ac_useropt'" + as_fn_error $? "invalid package name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1188,7 +1185,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: \`$ac_useropt'" + as_fn_error $? "invalid package name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1218,8 +1215,8 @@ do | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; - -*) as_fn_error $? "unrecognized option: \`$ac_option' -Try \`$0 --help' for more information" + -*) as_fn_error $? "unrecognized option: '$ac_option' +Try '$0 --help' for more information" ;; *=*) @@ -1227,7 +1224,7 @@ Try \`$0 --help' for more information" # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) - as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + as_fn_error $? "invalid variable name: '$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; @@ -1277,7 +1274,7 @@ do as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done -# There might be people who depend on the old broken behavior: `$host' +# There might be people who depend on the old broken behavior: '$host' *** 23372 LINES SKIPPED *** From nobody Sun Dec 22 07:40: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 4YGCk24CfGz5jCpm; Sun, 22 Dec 2024 07:40: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YGCk23zxJz4cb2; Sun, 22 Dec 2024 07:40:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734853226; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5SEWr4XeSMJnIkKWpP6SBhKOOTc8QPtbpkENawQrf3Y=; b=Sp49a+PGEdQiXxtJDqaq5WEW3juHD8ViWNXrEidmLA7iocpXipjbquIMqJke9tFK3cyL0J QwQWXUCXpAYkvs9CNIC708vvtbydYpxHdNIs9mMpLcyLPYMfej9ujS1CAWzIIVNb0CUcx8 OvNlLRsa342prm4scP0S7aTvwPkVLNqu99Z1UQ5ZxLxfko4CFjU7gM3cTcua4MIZG08z+K 5jTT57qFRTn+a1zifZ188P7xwkHSURfCKHnXquh8JEkEYhmipYVR1gE+mlAf/yF8O7XGcf ihD6M1fOHmDHBxaRvjG1wjqzpfaS1pOYh0vgyWnuZEX8PmbGKYQk9GBLA2jutg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734853226; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5SEWr4XeSMJnIkKWpP6SBhKOOTc8QPtbpkENawQrf3Y=; b=r6mt+nW88BrvPl99Fs+defKCdzE1Fcelm9ZRjAwUbq/FYZEIAW+Dd0MgGiRzfrBeVrcrbB JTn6nMJ0uGZ9HkQkXjkd0mKRRLRBzWhrQVw7CP61vw/0Ymqk3WQCuLATJIcifaOISej+SV A2YdgsLy4HT+JgvHH9qpp5HBCtQyKuDBUg5UzENWDtRREsOpLnLbPN2RP4/6SiYOqJvgWd uKRdVJErkmuCYeM4cq7PgLa1/DlWTB1fu3E0ePLcwVA7jgIuoppMmFfYPyDs/494aogMJj E8u55ou7blKXCCurk3Jpu83iZW0jAgXHjkDFGL4kRriqWXQ7DOErGRotpgbWpg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734853226; a=rsa-sha256; cv=none; b=pAlwuhD2ol+tkdMBi53xmcMIDS5/8OQ0sB2xvml+INUCSeTjlvAOwB69gozZ+zVzpEig2D //eEuoN3CKt0yIUCat/z9xVenGF+fvtL7jPbC044N2SRmKF24MpLD1N/uNhNFd//mPo6Xm xyh7iIVy+PFbinnvSILsMFnpk4mYfNmI5rbO5yacKzmRm0VOJXAiQPxrjY1OOA7J7oYoEl T/iv7WxE/fq5YK1yH9QaOPOE+XAynA95Ap1xhRS159rDLcencHFBEDBc3rGN451ZZNZtR1 yv5UGPHkbRD5mRee/GduhOGTlLLHkhlH1AHKVWK2FLSXh3+nWN7sk4R4VnxUFg== 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 4YGCk23b02z10YG; Sun, 22 Dec 2024 07:40:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BM7eQkk012605; Sun, 22 Dec 2024 07:40:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BM7eQqi012602; Sun, 22 Dec 2024 07:40:26 GMT (envelope-from git) Date: Sun, 22 Dec 2024 07:40:26 GMT Message-Id: <202412220740.4BM7eQqi012602@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Xin LI Subject: git: 90222d7fa4bb - stable/13 - MFC: MFV: file 5.45. 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: delphij X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 90222d7fa4bbf6dd9c57d4330c36b8733cf48ba0 Auto-Submitted: auto-generated The branch stable/13 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=90222d7fa4bbf6dd9c57d4330c36b8733cf48ba0 commit 90222d7fa4bbf6dd9c57d4330c36b8733cf48ba0 Author: Xin LI AuthorDate: 2023-09-10 19:20:33 +0000 Commit: Xin LI CommitDate: 2024-12-22 07:39:59 +0000 MFC: MFV: file 5.45. (cherry picked from commit 898496ee09ed2b7d25f6807edc4515628196ec0a) Disable byteswap.h for now. (cherry picked from commit 90474518912f5e5f49bc5325b7f88e94eba64d6a) --- contrib/file/ChangeLog | 64 ++- contrib/file/README.md | 3 +- contrib/file/acinclude.m4 | 5 +- contrib/file/config.guess | 2 + contrib/file/config.h.in | 21 + contrib/file/config.sub | 1 + contrib/file/configure | 184 ++++++- contrib/file/configure.ac | 40 +- contrib/file/doc/file.man | 21 +- contrib/file/doc/libmagic.man | 26 +- contrib/file/doc/magic.man | 88 ++-- contrib/file/libmagic.pc.in | 1 + contrib/file/magic/Magdir/algol68 | 12 +- contrib/file/magic/Magdir/android | 52 +- contrib/file/magic/Magdir/animation | 25 +- contrib/file/magic/Magdir/apple | 299 +++++++++-- contrib/file/magic/Magdir/archive | 547 ++++++++++++++++++++- contrib/file/magic/Magdir/arm | 11 +- contrib/file/magic/Magdir/asf | 4 +- contrib/file/magic/Magdir/audio | 17 +- contrib/file/magic/Magdir/blender | 15 +- contrib/file/magic/Magdir/bytecode | 13 +- contrib/file/magic/Magdir/c-lang | 8 +- contrib/file/magic/Magdir/c64 | 357 +++++++++++++- contrib/file/magic/Magdir/cad | 40 +- contrib/file/magic/Magdir/coff | 3 +- contrib/file/magic/Magdir/commands | 18 +- contrib/file/magic/Magdir/compress | 88 +++- contrib/file/magic/Magdir/console | 52 +- contrib/file/magic/Magdir/crypto | 46 +- contrib/file/magic/Magdir/database | 62 ++- contrib/file/magic/Magdir/der | 9 +- contrib/file/magic/Magdir/dsf | 25 - contrib/file/magic/Magdir/dwarfs | 45 ++ contrib/file/magic/Magdir/elf | 10 +- contrib/file/magic/Magdir/filesystems | 211 ++++---- contrib/file/magic/Magdir/firmware | 133 +++++ contrib/file/magic/Magdir/games | 198 +++++++- contrib/file/magic/Magdir/gentoo | 9 +- contrib/file/magic/Magdir/geo | 42 +- contrib/file/magic/Magdir/images | 342 +++++++++++-- contrib/file/magic/Magdir/intel | 8 +- contrib/file/magic/Magdir/java | 9 +- contrib/file/magic/Magdir/javascript | 64 ++- contrib/file/magic/Magdir/jpeg | 8 +- contrib/file/magic/Magdir/lif | 9 +- contrib/file/magic/Magdir/linux | 99 +++- contrib/file/magic/Magdir/llvm | 3 +- contrib/file/magic/Magdir/macintosh | 56 ++- contrib/file/magic/Magdir/magic | 65 ++- contrib/file/magic/Magdir/mail.news | 4 +- contrib/file/magic/Magdir/map | 7 +- contrib/file/magic/Magdir/mathematica | 69 ++- contrib/file/magic/Magdir/meteorological | 8 +- contrib/file/magic/Magdir/misctools | 66 ++- contrib/file/magic/Magdir/modem | 12 +- contrib/file/magic/Magdir/msdos | 460 +++++++++++++++-- contrib/file/magic/Magdir/msooxml | 12 +- contrib/file/magic/Magdir/ole2compounddocs | 155 ++++-- contrib/file/magic/Magdir/pdf | 6 +- contrib/file/magic/Magdir/perl | 8 +- contrib/file/magic/Magdir/playdate | 57 +++ contrib/file/magic/Magdir/printer | 144 +++++- contrib/file/magic/Magdir/qt | 13 +- contrib/file/magic/Magdir/rst | 6 +- contrib/file/magic/Magdir/rust | 21 + contrib/file/magic/Magdir/scientific | 43 +- contrib/file/magic/Magdir/sendmail | 4 +- contrib/file/magic/Magdir/sgml | 13 +- contrib/file/magic/Magdir/sniffer | 75 ++- contrib/file/magic/Magdir/softquad | 9 +- contrib/file/magic/Magdir/spectrum | 118 ++++- contrib/file/magic/Magdir/sql | 65 ++- contrib/file/magic/Magdir/ssh | 11 +- contrib/file/magic/Magdir/svf | 5 + contrib/file/magic/Magdir/sysex | 6 +- contrib/file/magic/Magdir/terminfo | 3 +- contrib/file/magic/Magdir/tex | 10 +- contrib/file/magic/Magdir/tplink | 13 +- contrib/file/magic/Magdir/troff | 8 +- contrib/file/magic/Magdir/uterus | 4 +- contrib/file/magic/Magdir/varied.script | 64 +-- contrib/file/magic/Magdir/web | 8 +- contrib/file/magic/Magdir/windows | 532 ++++++++++++++++++-- contrib/file/magic/Magdir/wordprocessors | 72 ++- contrib/file/magic/Magdir/xenix | 18 +- contrib/file/magic/Magdir/xilinx | 20 +- contrib/file/magic/Makefile.am | 8 +- contrib/file/magic/Makefile.in | 8 +- contrib/file/src/Makefile.am | 8 +- contrib/file/src/Makefile.in | 23 +- contrib/file/src/apprentice.c | 275 ++++++----- contrib/file/src/apptype.c | 8 +- contrib/file/src/ascmagic.c | 38 +- contrib/file/src/asctime_r.c | 4 +- contrib/file/src/asprintf.c | 2 +- contrib/file/src/buffer.c | 11 +- contrib/file/src/cdf.c | 2 +- contrib/file/src/cdf_time.c | 6 +- contrib/file/src/compress.c | 389 +++++++++++---- contrib/file/src/ctime_r.c | 4 +- contrib/file/src/der.c | 12 +- contrib/file/src/dprintf.c | 2 +- contrib/file/src/encoding.c | 40 +- contrib/file/src/file.c | 131 ++--- contrib/file/src/file.h | 187 +++---- contrib/file/src/file_opts.h | 4 +- contrib/file/src/fmtcheck.c | 2 +- contrib/file/src/fsmagic.c | 8 +- contrib/file/src/funcs.c | 120 +++-- contrib/file/src/getline.c | 4 +- contrib/file/src/getopt_long.c | 2 +- contrib/file/src/gmtime_r.c | 4 +- contrib/file/src/is_csv.c | 12 +- contrib/file/src/is_json.c | 6 +- contrib/file/src/is_simh.c | 209 ++++++++ contrib/file/src/is_tar.c | 14 +- contrib/file/src/localtime_r.c | 4 +- contrib/file/src/magic.c | 60 ++- contrib/file/src/magic.h.in | 9 +- contrib/file/src/memtest.c | 3 +- contrib/file/src/pread.c | 2 +- contrib/file/src/print.c | 30 +- contrib/file/src/readcdf.c | 26 +- contrib/file/src/readelf.c | 72 +-- contrib/file/src/seccomp.c | 3 +- contrib/file/src/softmagic.c | 252 ++++++---- contrib/file/src/strlcat.c | 2 +- contrib/file/src/strlcpy.c | 2 +- contrib/file/src/tar.h | 4 +- contrib/file/src/vasprintf.c | 7 +- contrib/file/tests/CVE-2014-1943.result | 2 +- contrib/file/tests/HWP2016.hwp.result | 1 + contrib/file/tests/HWP2016.hwp.testfile | Bin 0 -> 9216 bytes contrib/file/tests/HWP2016.hwpx.zip.result | 1 + contrib/file/tests/HWP2016.hwpx.zip.testfile | Bin 0 -> 14377 bytes contrib/file/tests/HWP97.hwp.result | 1 + contrib/file/tests/HWP97.hwp.testfile | Bin 0 -> 8975 bytes contrib/file/tests/JW07022A.mp3.result | 2 +- contrib/file/tests/Makefile.am | 70 ++- contrib/file/tests/Makefile.in | 70 ++- contrib/file/tests/android-vdex-1.result | 2 +- contrib/file/tests/android-vdex-2.result | 2 +- contrib/file/tests/arj.result | 2 +- contrib/file/tests/bcachefs.result | 2 +- contrib/file/tests/bcachefs2.result | 1 + contrib/file/tests/bcachefs2.testfile | Bin 0 -> 8192 bytes contrib/file/tests/cl8m8ocofedso.result | 2 +- contrib/file/tests/cmd1.result | 1 + contrib/file/tests/cmd1.testfile | 1 + contrib/file/tests/cmd2.result | 1 + contrib/file/tests/cmd2.testfile | 1 + contrib/file/tests/cmd3.result | 1 + contrib/file/tests/cmd3.testfile | 2 + contrib/file/tests/cmd4.result | 1 + contrib/file/tests/cmd4.testfile | 2 + contrib/file/tests/dsd64-dff.result | 2 +- contrib/file/tests/dsd64-dsf.result | 2 +- contrib/file/tests/escapevel.result | 2 +- contrib/file/tests/ext4.result | 2 +- contrib/file/tests/fit-map-data.result | 2 +- contrib/file/tests/gedcom.result | 2 +- contrib/file/tests/hddrawcopytool.result | 2 +- contrib/file/tests/hello-racket_rkt.result | 1 + contrib/file/tests/hello-racket_rkt.testfile | Bin 0 -> 1664 bytes contrib/file/tests/issue311docx.result | 2 +- contrib/file/tests/issue359xlsx.result | 2 +- contrib/file/tests/jpeg-text.result | 1 + contrib/file/tests/jpeg-text.testfile | 1 + contrib/file/tests/json1.result | 2 +- contrib/file/tests/json2.result | 2 +- contrib/file/tests/json3.result | 2 +- contrib/file/tests/json4.result | 2 +- contrib/file/tests/json5.result | 2 +- contrib/file/tests/json6.result | 2 +- contrib/file/tests/json7.result | 2 +- contrib/file/tests/json8.result | 2 +- contrib/file/tests/jsonlines1.result | 2 +- contrib/file/tests/matilde.arm.result | 2 +- contrib/file/tests/multiple-A.magic | 2 + contrib/file/tests/multiple-B.magic | 2 + contrib/file/tests/multiple.flags | 1 + contrib/file/tests/multiple.result | 1 + contrib/file/tests/multiple.testfile | 1 + contrib/file/tests/pcjr.result | 2 +- contrib/file/tests/pgp-binary-key-v2-phil.result | 2 +- contrib/file/tests/pgp-binary-key-v3-lutz.result | 2 +- contrib/file/tests/pgp-binary-key-v4-dsa.result | 2 +- .../pgp-binary-key-v4-ecc-no-userid-secret.result | 2 +- .../tests/pgp-binary-key-v4-ecc-secret-key.result | 2 +- .../file/tests/pgp-binary-key-v4-rsa-key.result | 2 +- .../pgp-binary-key-v4-rsa-no-userid-secret.result | 2 +- .../tests/pgp-binary-key-v4-rsa-secret-key.result | 2 +- contrib/file/tests/pnm1.result | 1 + contrib/file/tests/pnm1.testfile | 5 + contrib/file/tests/pnm2.result | 1 + contrib/file/tests/pnm2.testfile | Bin 0 -> 15 bytes contrib/file/tests/pnm3.result | 1 + contrib/file/tests/pnm3.testfile | 5 + contrib/file/tests/regex-eol.result | 2 +- contrib/file/tests/registry-pol.result | 1 + contrib/file/tests/registry-pol.testfile | Bin 0 -> 7094 bytes contrib/file/tests/test.c | 70 ++- contrib/file/tests/uf2.result | 2 +- contrib/file/tests/xclbin.result | 1 + contrib/file/tests/xclbin.testfile | Bin 0 -> 512 bytes contrib/file/tests/zstd-3-skippable-frames.result | 2 +- contrib/file/tests/zstd-dictionary-0.result | 2 +- contrib/file/tests/zstd-dictionary-1.result | 2 +- contrib/file/tests/zstd-dictionary-2.result | 2 +- contrib/file/tests/zstd-skippable-frame-0.result | 2 +- contrib/file/tests/zstd-skippable-frame-4.result | 2 +- contrib/file/tests/zstd-skippable-frame-8.result | 2 +- contrib/file/tests/zstd-skippable-frame-C.result | 2 +- contrib/file/tests/zstd-v0.2-FF.result | 2 +- contrib/file/tests/zstd-v0.3-FF.result | 2 +- contrib/file/tests/zstd-v0.4-FF.result | 2 +- contrib/file/tests/zstd-v0.5-FF.result | 2 +- contrib/file/tests/zstd-v0.6-FF.result | 2 +- contrib/file/tests/zstd-v0.7-00.result | 2 +- contrib/file/tests/zstd-v0.7-21.result | 2 +- contrib/file/tests/zstd-v0.7-22.result | 2 +- contrib/file/tests/zstd-v0.8-00.result | 2 +- contrib/file/tests/zstd-v0.8-01.result | 2 +- contrib/file/tests/zstd-v0.8-02.result | 2 +- contrib/file/tests/zstd-v0.8-03.result | 2 +- contrib/file/tests/zstd-v0.8-16.result | 2 +- contrib/file/tests/zstd-v0.8-20.result | 2 +- contrib/file/tests/zstd-v0.8-21.result | 2 +- contrib/file/tests/zstd-v0.8-22.result | 2 +- contrib/file/tests/zstd-v0.8-23.result | 2 +- contrib/file/tests/zstd-v0.8-F4.result | 2 +- contrib/file/tests/zstd-v0.8-FF.result | 2 +- lib/libmagic/Makefile | 1 + lib/libmagic/config.h | 27 +- 235 files changed, 6484 insertions(+), 1559 deletions(-) diff --git a/contrib/file/ChangeLog b/contrib/file/ChangeLog index dd95543fe649..fdf1cff6e2d3 100644 --- a/contrib/file/ChangeLog +++ b/contrib/file/ChangeLog @@ -1,3 +1,63 @@ +2023-07-27 15:45 Christos Zoulas + + * release 5.45 + +2023-07-17 11:53 Christos Zoulas + + * PR/465: psrok1: Avoid muslc asctime_r crash + +2023-05-21 13:05 Christos Zoulas + + * add SIMH tape format support + +2023-02-09 12:50 Christos Zoulas + + * bump the max size of the elf section notes to be read to 128K + and make it configurable + +2023-01-08 1:08 Christos Zoulas + + * PR/415: Fix decompression with program returning empty + +2022-12-26 1:47 Christos Zoulas + + * PR/408: fix -p with seccomp + * PR/412: fix MinGW compilation + +2022-12-26 12:26 Christos Zoulas + + * release 5.44 + +2022-12-14 9:24 Christos Zoulas + + * Handle nan's so that we don't get internal floating point exceptions + when they are enabled (Vincent Mihalkovic) + +2022-10-23 10:21 Christos Zoulas + + * PR/397: Restore the ability to process files from stdin immediately. + +2022-09-20 17:12 Christos Zoulas + + * fixed various clustefuzz issues + +2022-09-19 15:54 Christos Zoulas + + * Fix error detection for decompression code (Vincent Mihalkovic) + +2022-09-15 13:50 Christos Zoulas + + * Add MAGIC_NO_COMPRESS_FORK and use it to produce a more + meaningful error message if we are sandboxing. + +2022-09-15 10:45 Christos Zoulas + + * Add built-in lzip decompression support (Michal Gorny) + +2022-09-14 10:35 Christos Zoulas + + * Add built-in zstd decompression support (Martin Rodriguez Reboredo) + 2022-09-13 14:55 Christos Zoulas * release 5.43 @@ -229,7 +289,7 @@ 2019-12-15 22:13 Christos Zoulas Document changes since the previous release: - Always accept -S (no sandbox) even if we don't support sandboxing - - More syscalls elided for sandboxiing + - More syscalls elided for sandboxing - For ELF dynamic means having an interpreter not just PT_DYNAMIC - Check for large ELF session header offset - When saving and restoring a locale, keep the locale name in our @@ -1759,7 +1819,7 @@ * Magic format checks (Dr. Werner Fink) - * Magic format function improvent (Karl Chen) + * Magic format function improvement (Karl Chen) 2006-05-03 11:11 Christos Zoulas diff --git a/contrib/file/README.md b/contrib/file/README.md index 37a3b17856c6..26e38045812c 100644 --- a/contrib/file/README.md +++ b/contrib/file/README.md @@ -1,6 +1,6 @@ ## README for file(1) Command and the libmagic(3) library ## - @(#) $File: README.md,v 1.4 2021/10/21 01:51:31 christos Exp $ + @(#) $File: README.md,v 1.5 2023/05/28 13:59:47 christos Exp $ - Bug Tracker: - Build Status: @@ -91,6 +91,7 @@ COPYING - read this first. * `src/gmtime_r.c` - replacement for OS's that don't have it. * `src/is_csv.c` - knows about Comma Separated Value file format (RFC 4180). * `src/is_json.c` - knows about JavaScript Object Notation format (RFC 8259). +* `src/is_simh.c` - knows about SIMH tape file format. * `src/is_tar.c, tar.h` - knows about Tape ARchive format (courtesy John Gilmore). * `src/localtime_r.c` - replacement for OS's that don't have it. * `src/magic.h.in` - source file for magic.h diff --git a/contrib/file/acinclude.m4 b/contrib/file/acinclude.m4 index e0811dd899aa..30242712bad3 100644 --- a/contrib/file/acinclude.m4 +++ b/contrib/file/acinclude.m4 @@ -39,11 +39,12 @@ AC_CHECK_DECLS([daylight], , , [#include #include ]) AC_CACHE_CHECK(for daylight, ac_cv_var_daylight, [AC_LINK_IFELSE( -[AC_LANG_PROGRAM([#include ], +[AC_LANG_PROGRAM([#include +#include ], [#if !HAVE_DECL_DAYLIGHT extern int daylight; #endif -atoi(daylight);])], ac_cv_var_daylight=yes, ac_cv_var_daylight=no)]) +daylight = atoi("1");])], ac_cv_var_daylight=yes, ac_cv_var_daylight=no)]) if test $ac_cv_var_daylight = yes; then AC_DEFINE(HAVE_DAYLIGHT,1,[HAVE_DAYLIGHT]) fi diff --git a/contrib/file/config.guess b/contrib/file/config.guess index 5d222e2ed594..cd4dbf7293fa 100755 --- a/contrib/file/config.guess +++ b/contrib/file/config.guess @@ -210,6 +210,8 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in aarch64eb) machine=aarch64_be-unknown ;; armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; + mipsn64eb) machine=mips64-unknown ;; + mipsn64el) machine=mips64el-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; diff --git a/contrib/file/config.h.in b/contrib/file/config.h.in index 8bf5e7ce6610..5ae30c61edd1 100644 --- a/contrib/file/config.h.in +++ b/contrib/file/config.h.in @@ -89,6 +89,9 @@ /* Define to 1 if you have the `gnurx' library (-lgnurx). */ #undef HAVE_LIBGNURX +/* Define to 1 if you have the `lz' library (-llz). */ +#undef HAVE_LIBLZ + /* Define to 1 if you have the `lzma' library (-llzma). */ #undef HAVE_LIBLZMA @@ -98,9 +101,15 @@ /* Define to 1 if you have the `z' library (-lz). */ #undef HAVE_LIBZ +/* Define to 1 if you have the `zstd' library (-lzstd). */ +#undef HAVE_LIBZSTD + /* Define to 1 if you have the `localtime_r' function. */ #undef HAVE_LOCALTIME_R +/* Define to 1 if you have the header file. */ +#undef HAVE_LZLIB_H + /* Define to 1 if you have the header file. */ #undef HAVE_LZMA_H @@ -276,9 +285,18 @@ /* Define to 1 if you have the header file. */ #undef HAVE_ZLIB_H +/* Define to 1 if you have the header file. */ +#undef HAVE_ZSTD_ERRORS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_ZSTD_H + /* Define to the sub-directory where libtool stores uninstalled libraries. */ #undef LT_OBJDIR +/* Enable lzlib compression support */ +#undef LZLIBSUPPORT + /* Define to 1 if `major', `minor', and `makedev' are declared in . */ #undef MAJOR_IN_MKDEV @@ -425,6 +443,9 @@ /* Enable zlib compression support */ #undef ZLIBSUPPORT +/* Enable zstdlib compression support */ +#undef ZSTDLIBSUPPORT + /* Number of bits in a file offset, on hosts where this is settable. */ #undef _FILE_OFFSET_BITS diff --git a/contrib/file/config.sub b/contrib/file/config.sub index d74fb6deac94..f6564f2885d4 100755 --- a/contrib/file/config.sub +++ b/contrib/file/config.sub @@ -1219,6 +1219,7 @@ case $cpu-$vendor in | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ + | mipsn64eb | mipsn64el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa32r3 | mipsisa32r3el \ diff --git a/contrib/file/configure b/contrib/file/configure index 143ccc5bbacb..8043072f56f7 100755 --- a/contrib/file/configure +++ b/contrib/file/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for file 5.43. +# Generated by GNU Autoconf 2.71 for file 5.45. # # Report bugs to . # @@ -621,8 +621,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='file' PACKAGE_TARNAME='file' -PACKAGE_VERSION='5.43' -PACKAGE_STRING='file 5.43' +PACKAGE_VERSION='5.45' +PACKAGE_STRING='file 5.45' PACKAGE_BUGREPORT='christos@astron.com' PACKAGE_URL='' @@ -800,6 +800,8 @@ enable_elf_core enable_zlib enable_bzlib enable_xzlib +enable_zstdlib +enable_lzlib enable_libseccomp enable_fsect_man5 enable_dependency_tracking @@ -1371,7 +1373,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures file 5.43 to adapt to many kinds of systems. +\`configure' configures file 5.45 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1442,7 +1444,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of file 5.43:";; + short | recursive ) echo "Configuration of file 5.45:";; esac cat <<\_ACEOF @@ -1458,6 +1460,9 @@ Optional Features: --disable-bzlib disable bz2lib compression support [default=auto] --disable-xzlib disable liblzma/xz compression support [default=auto] + --disable-zstdlib disable zstdlib compression support [default=auto] + --disable-lzlib disable liblz (lzip) compression support + [default=auto] --disable-libseccomp disable libseccomp sandboxing [default=auto] --enable-fsect-man5 enable file formats in man section 5 --enable-dependency-tracking @@ -1562,7 +1567,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -file configure 5.43 +file configure 5.45 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. @@ -2129,7 +2134,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by file $as_me 5.43, which was +It was created by file $as_me 5.45, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw @@ -3405,7 +3410,7 @@ fi # Define the identity of the package. PACKAGE='file' - VERSION='5.43' + VERSION='5.45' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h @@ -3641,6 +3646,28 @@ fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_xzlib" >&5 printf "%s\n" "$enable_xzlib" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for zstdlib support" >&5 +printf %s "checking for zstdlib support... " >&6; } +# Check whether --enable-zstdlib was given. +if test ${enable_zstdlib+y} +then : + enableval=$enable_zstdlib; +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_zstdlib" >&5 +printf "%s\n" "$enable_zstdlib" >&6; } + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for lzlib support" >&5 +printf %s "checking for lzlib support... " >&6; } +# Check whether --enable-lzlib was given. +if test ${enable_lzlib+y} +then : + enableval=$enable_lzlib; +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_lzlib" >&5 +printf "%s\n" "$enable_lzlib" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libseccomp support" >&5 printf %s "checking for libseccomp support... " >&6; } # Check whether --enable-libseccomp was given. @@ -13665,6 +13692,30 @@ then : fi +fi +if test "$enable_zstdlib" != "no"; then + ac_fn_c_check_header_compile "$LINENO" "zstd.h" "ac_cv_header_zstd_h" "$ac_includes_default" +if test "x$ac_cv_header_zstd_h" = xyes +then : + printf "%s\n" "#define HAVE_ZSTD_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "zstd_errors.h" "ac_cv_header_zstd_errors_h" "$ac_includes_default" +if test "x$ac_cv_header_zstd_errors_h" = xyes +then : + printf "%s\n" "#define HAVE_ZSTD_ERRORS_H 1" >>confdefs.h + +fi + +fi +if test "$enable_lzlib" != "no"; then + ac_fn_c_check_header_compile "$LINENO" "lzlib.h" "ac_cv_header_lzlib_h" "$ac_includes_default" +if test "x$ac_cv_header_lzlib_h" = xyes +then : + printf "%s\n" "#define HAVE_LZLIB_H 1" >>confdefs.h + +fi + fi ac_fn_c_check_type "$LINENO" "sig_t" "ac_cv_type_sig_t" "#include " @@ -14037,13 +14088,14 @@ else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include +#include int main (void) { #if !HAVE_DECL_DAYLIGHT extern int daylight; #endif -atoi(daylight); +daylight = atoi("1"); ; return 0; } @@ -15459,6 +15511,96 @@ then : fi +fi +if test "$enable_zstdlib" != "no"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ZSTD_createDStream in -lzstd" >&5 +printf %s "checking for ZSTD_createDStream in -lzstd... " >&6; } +if test ${ac_cv_lib_zstd_ZSTD_createDStream+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lzstd $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char ZSTD_createDStream (); +int +main (void) +{ +return ZSTD_createDStream (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_zstd_ZSTD_createDStream=yes +else $as_nop + ac_cv_lib_zstd_ZSTD_createDStream=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_zstd_ZSTD_createDStream" >&5 +printf "%s\n" "$ac_cv_lib_zstd_ZSTD_createDStream" >&6; } +if test "x$ac_cv_lib_zstd_ZSTD_createDStream" = xyes +then : + printf "%s\n" "#define HAVE_LIBZSTD 1" >>confdefs.h + + LIBS="-lzstd $LIBS" + +fi + +fi +if test "$enable_lzlib" != "no"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for LZ_decompress_open in -llz" >&5 +printf %s "checking for LZ_decompress_open in -llz... " >&6; } +if test ${ac_cv_lib_lz_LZ_decompress_open+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-llz $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char LZ_decompress_open (); +int +main (void) +{ +return LZ_decompress_open (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_lz_LZ_decompress_open=yes +else $as_nop + ac_cv_lib_lz_LZ_decompress_open=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lz_LZ_decompress_open" >&5 +printf "%s\n" "$ac_cv_lib_lz_LZ_decompress_open" >&6; } +if test "x$ac_cv_lib_lz_LZ_decompress_open" = xyes +then : + printf "%s\n" "#define HAVE_LIBLZ 1" >>confdefs.h + + LIBS="-llz $LIBS" + +fi + fi if test "$enable_libseccomp" != "no"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for seccomp_init in -lseccomp" >&5 @@ -15591,6 +15733,26 @@ if test "$ac_cv_header_lzma_h$ac_cv_lib_lzma_lzma_stream_decoder" = "yesyes"; t printf "%s\n" "#define XZLIBSUPPORT 1" >>confdefs.h +fi +if test "$enable_zstdlib" = "yes"; then + if test "$ac_cv_header_zstd_h$ac_cv_lib_zstd_ZSTD_createDStream" != "yesyes"; then + as_fn_error $? "zstdlib support requested but not found" "$LINENO" 5 + fi +fi +if test "$ac_cv_header_zstd_h$ac_cv_lib_zstd_ZSTD_createDStream" = "yesyes"; then + +printf "%s\n" "#define ZSTDLIBSUPPORT 1" >>confdefs.h + +fi +if test "$enable_lzlib" = "yes"; then + if test "$ac_cv_header_lzlib_h$ac_cv_lib_lz_LZ_decompress_open" != "yesyes"; then + as_fn_error $? "lzlib support requested but not found" "$LINENO" 5 + fi +fi +if test "$ac_cv_header_lzlib_h$ac_cv_lib_lz_LZ_decompress_open" = "yesyes"; then + +printf "%s\n" "#define LZLIBSUPPORT 1" >>confdefs.h + fi ac_config_files="$ac_config_files Makefile src/Makefile magic/Makefile tests/Makefile doc/Makefile python/Makefile libmagic.pc" @@ -16131,7 +16293,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by file $as_me 5.43, which was +This file was extended by file $as_me 5.45, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -16199,7 +16361,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -file config.status 5.43 +file config.status 5.45 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" diff --git a/contrib/file/configure.ac b/contrib/file/configure.ac index 6629300fd021..aa728badb1b7 100644 --- a/contrib/file/configure.ac +++ b/contrib/file/configure.ac @@ -1,5 +1,5 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT([file],[5.43],[christos@astron.com]) +AC_INIT([file],[5.45],[christos@astron.com]) AM_INIT_AUTOMAKE([subdir-objects foreign]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) @@ -49,6 +49,16 @@ AC_ARG_ENABLE([xzlib], [AS_HELP_STRING([--disable-xzlib], [disable liblzma/xz compression support @<:@default=auto@:>@])]) AC_MSG_RESULT($enable_xzlib) +AC_MSG_CHECKING(for zstdlib support) +AC_ARG_ENABLE([zstdlib], +[AS_HELP_STRING([--disable-zstdlib], [disable zstdlib compression support @<:@default=auto@:>@])]) +AC_MSG_RESULT($enable_zstdlib) + +AC_MSG_CHECKING(for lzlib support) +AC_ARG_ENABLE([lzlib], +[AS_HELP_STRING([--disable-lzlib], [disable liblz (lzip) compression support @<:@default=auto@:>@])]) +AC_MSG_RESULT($enable_lzlib) + AC_MSG_CHECKING(for libseccomp support) AC_ARG_ENABLE([libseccomp], [AS_HELP_STRING([--disable-libseccomp], [disable libseccomp sandboxing @<:@default=auto@:>@])]) @@ -112,6 +122,12 @@ fi if test "$enable_xzlib" != "no"; then AC_CHECK_HEADERS(lzma.h) fi +if test "$enable_zstdlib" != "no"; then + AC_CHECK_HEADERS(zstd.h zstd_errors.h) +fi +if test "$enable_lzlib" != "no"; then + AC_CHECK_HEADERS(lzlib.h) +fi AC_CHECK_TYPE([sig_t],[AC_DEFINE([HAVE_SIG_T],1,[Have sig_t type])],,[#include ]) dnl Checks for typedefs, structures, and compiler characteristics. @@ -180,6 +196,12 @@ fi if test "$enable_xzlib" != "no"; then AC_CHECK_LIB(lzma, lzma_stream_decoder) fi +if test "$enable_zstdlib" != "no"; then + AC_CHECK_LIB(zstd, ZSTD_createDStream) +fi +if test "$enable_lzlib" != "no"; then + AC_CHECK_LIB(lz, LZ_decompress_open) +fi if test "$enable_libseccomp" != "no"; then AC_CHECK_LIB(seccomp, seccomp_init) fi @@ -215,6 +237,22 @@ fi if test "$ac_cv_header_lzma_h$ac_cv_lib_lzma_lzma_stream_decoder" = "yesyes"; then AC_DEFINE([XZLIBSUPPORT], 1, [Enable xzlib compression support]) fi +if test "$enable_zstdlib" = "yes"; then + if test "$ac_cv_header_zstd_h$ac_cv_lib_zstd_ZSTD_createDStream" != "yesyes"; then + AC_MSG_ERROR([zstdlib support requested but not found]) + fi +fi +if test "$ac_cv_header_zstd_h$ac_cv_lib_zstd_ZSTD_createDStream" = "yesyes"; then + AC_DEFINE([ZSTDLIBSUPPORT], 1, [Enable zstdlib compression support]) +fi +if test "$enable_lzlib" = "yes"; then + if test "$ac_cv_header_lzlib_h$ac_cv_lib_lz_LZ_decompress_open" != "yesyes"; then + AC_MSG_ERROR([lzlib support requested but not found]) + fi +fi +if test "$ac_cv_header_lzlib_h$ac_cv_lib_lz_LZ_decompress_open" = "yesyes"; then + AC_DEFINE([LZLIBSUPPORT], 1, [Enable lzlib compression support]) +fi AC_CONFIG_FILES([Makefile src/Makefile magic/Makefile tests/Makefile doc/Makefile python/Makefile libmagic.pc]) AC_OUTPUT diff --git a/contrib/file/doc/file.man b/contrib/file/doc/file.man index 91470b8e199d..b9580a970dc1 100644 --- a/contrib/file/doc/file.man +++ b/contrib/file/doc/file.man @@ -1,5 +1,5 @@ -.\" $File: file.man,v 1.146 2022/10/26 16:56:14 christos Exp $ -.Dd October 26, 2022 +.\" $File: file.man,v 1.150 2023/05/21 17:08:34 christos Exp $ +.Dd May 21, 2023 .Dt FILE __CSECTION__ .Os .Sh NAME @@ -224,6 +224,8 @@ elf magic is found. Examines JSON (RFC-7159) files by parsing them for compliance. .It soft Consults magic files. +.It simh +Examines SIMH tape files. .It tar Examines tar files by verifying the checksum of the 512 byte tar header. Excluding this test can provide more detailed content description by using @@ -337,16 +339,17 @@ attempt to preserve the access time of files analyzed, to pretend that never read them. .It Fl P , Fl Fl parameter Ar name=value Set various parameter limits. -.Bl -column "elf_phnum" "Default" "XXXXXXXXXXXXXXXXXXXXXXXXXXX" -offset indent +.Bl -column "elf_phnum" "Default" "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" .It Sy "Name" Ta Sy "Default" Ta Sy "Explanation" -.It Li bytes Ta 1048576 Ta max number of bytes to read from file +.It Li bytes Ta 1M Ta max number of bytes to read from file .It Li elf_notes Ta 256 Ta max ELF notes processed -.It Li elf_phnum Ta 2048 Ta max ELF program sections processed -.It Li elf_shnum Ta 32768 Ta max ELF sections processed -.It Li encoding Ta 65536 Ta max number of bytes to scan for encoding evaluation +.It Li elf_phnum Ta 2K Ta max ELF program sections processed +.It Li elf_shnum Ta 32K Ta max ELF sections processed +.It Li elf_shsize Ta 128MB Ta max ELF section size processed +.It Li encoding Ta 65K Ta max number of bytes to determine encoding .It Li indir Ta 50 Ta recursion limit for indirect magic .It Li name Ta 50 Ta use count limit for name/use magic -.It Li regex Ta 8192 Ta length limit for regex searches +.It Li regex Ta 8K Ta length limit for regex searches .El .It Fl r , Fl Fl raw Don't translate unprintable characters to \eooo. @@ -728,7 +731,7 @@ variable in file.h), then we don't seek to that offset, but we give up. It would be better if buffer managements was done when the file descriptor is available so we can seek around the file. One must be careful though because this has performance and thus security -considerations, because one can slow down things by repeateadly seeking. +considerations, because one can slow down things by repeatedly seeking. .Pp There is support now for keeping separate buffers and having offsets from the end of the file, but the internal buffer management still needs an diff --git a/contrib/file/doc/libmagic.man b/contrib/file/doc/libmagic.man index b0cf0339f19d..e89c6ee0bfac 100644 --- a/contrib/file/doc/libmagic.man +++ b/contrib/file/doc/libmagic.man @@ -1,6 +1,6 @@ -.\" $File: libmagic.man,v 1.45 2019/06/08 22:16:24 christos Exp $ +.\" $File: libmagic.man,v 1.49 2023/07/20 14:32:07 christos Exp $ .\" -.\" Copyright (c) Christos Zoulas 2003, 2018. +.\" Copyright (c) Christos Zoulas 2003, 2018, 2022 .\" All Rights Reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd June 8, 2019 +.Dd June 16, 2023 .Dt LIBMAGIC 3 .Os .Sh NAME @@ -84,6 +84,8 @@ .Fn magic_setparam "magic_t cookie" "int param" "const void *value" .Ft int .Fn magic_version "void" +.Ft const char * +.Fn magic_getpath "const char *magicfile" "int action" .Sh DESCRIPTION These functions operate on the magic database file @@ -143,6 +145,8 @@ Don't report on compression, only report about the uncompressed data. Don't check for .Dv EMX application type (only on EMX). +.It Dv MAGIC_NO_COMPRESS_FORK +Don't allow decompressors that use fork. .It Dv MAGIC_NO_CHECK_CDF Don't get extra information on MS Composite Document Files. .It Dv MAGIC_NO_CHECK_COMPRESS @@ -163,6 +167,8 @@ Don't look for known tokens inside ascii files. Don't examine JSON files. .It Dv MAGIC_NO_CHECK_CSV Don't examine CSV files. +.It Dv MAGIC_NO_CHECK_SIMH +Don't examine SIMH tape files. .El .Pp The @@ -343,6 +349,20 @@ from .In magic.h . This can be used by client programs to verify that the version they compile against is the same as the version that they run against. +.Pp +The +.Fn magic_getpath +command returns the colon separated list of magic database locations. +If the +.Fa filename +is non-NULL, then it is returned. +Otherwise, if the +.Dv MAGIC +environment variable is defined, then it is returned. +Otherwise, if +.Fa action +is 0 (meaning "file load"), then any user-specific magic database file is included. +Otherwise, only the system default magic database path is included. .Sh RETURN VALUES The function .Fn magic_open diff --git a/contrib/file/doc/magic.man b/contrib/file/doc/magic.man index d38b0e0b4019..af4bfa89c6bd 100644 --- a/contrib/file/doc/magic.man +++ b/contrib/file/doc/magic.man @@ -1,5 +1,5 @@ -.\" $File: magic.man,v 1.100 2022/09/10 13:19:26 christos Exp $ -.Dd September 10, 2022 +.\" $File: magic.man,v 1.103 2023/07/20 14:32:07 christos Exp $ +.Dd Arpil 18, 2023 .Dt MAGIC __FSECTION__ .Os .\" install as magic.4 on USG, magic.5 on V7, Berkeley and Linux systems. @@ -68,54 +68,52 @@ A 32-bit single precision IEEE floating point number in this machine's native by A 64-bit double precision IEEE floating point number in this machine's native byte order. .It Dv string A string of bytes. -The string type specification can be optionally followed *** 14628 LINES SKIPPED *** From nobody Sun Dec 22 07:40: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 4YGCk40JCdz5jCrb; Sun, 22 Dec 2024 07:40: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YGCk350Xpz4cb5; Sun, 22 Dec 2024 07:40:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734853227; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Onvj/XN0QDp3467tq2hMeurZPLOLC7MtQ7J6uuM3HTs=; b=VyJCCUpZ1uPQeYDSHgFpuEzmfhr3XAquUIXWb7H8LU/NPObwTNU8K32hgeY7eUSe4krskz udW+G9EFVRTcvY0NRB7V8DWoRTnN5wpmJuaMcb3Fjr2Dx15B5VhC5tmdt3fG7EfM1G/XCv 5mu/k9rpz0YG4uFjfmgeG3OtaeMvnUDX++7valakpVgNkjiOvj9RWUJIWgEDdgOZpssv9h m7iypgfLQSr6wi2ggz6PwHnJryjhKHNxzA90DnH+REXbCp+9/nz7e34tpykyrlXZyEx9Xf 77tkoNEoXEgaoRafMBTcH212N5KKKH51CMJpTlEKYdiSCfD8puu7GG2cKuDrnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734853227; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Onvj/XN0QDp3467tq2hMeurZPLOLC7MtQ7J6uuM3HTs=; b=LTY+2ZPGv/uPugU09tXLeU4dRYtUU8GLCMMDK4x9v1akkawUXelaLNbKb14Hq5grQCGUSn JjDOVoFbHpb6clg1GmXcBhmavFGgZcSi3M6pMZJt2Qwb6Ut4Bi+Oa0Zw3r9h9AZjr41Ood Zf7+EnhdLYu0W1QXIiYTPCss76DMU9rTd+Nj4lUnBf/LiNeLFoSLB4/XyR+wWVszk7KE7N m2c4oII8h8W25G7NK+9ePPNH2Zv7ASzAiRvxxClNTQVqaNqDdTLGzG9VjANZBrXB4cfu1m XQjtRsewEUlgbHy3W9oZy/OPqdNsWH7Iojf4OmcRwlplXzkV/yBV6E2tJbqZpg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734853227; a=rsa-sha256; cv=none; b=A4RPU799lt4gt0Z1L7j8soWwRlCG4NIAWFt4Y18H39ZPrX/Jzm8HpiUV52fTCPUeJU/8yf vqvX0fiClfaHWSiqduza7/VoFQnu1jLUqdCvyNK9X5O/UY/0vpnY2NYuV4xLwI+EDKqlV/ efA+A0/r1szQFX7S/pclPm5UdIdAwhsOccm4t+htnh7ak47nS3eMAxbXyaIL6DyWlKnAOY eFyeaASc/siX/PAuvDchJ0qwMkB9WF6ClTsL2EhbxqQf2su8KPVFMUTgjM62hQUk6ASjpc KX/Pn18OwsqwGHxq8m2UNle5PjuKIrSVvm0Dwht2J+ngNxD2pFSsAdig8XPD/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 4YGCk34c20z108L; Sun, 22 Dec 2024 07:40:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BM7eR0o012644; Sun, 22 Dec 2024 07:40:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BM7eRH3012641; Sun, 22 Dec 2024 07:40:27 GMT (envelope-from git) Date: Sun, 22 Dec 2024 07:40:27 GMT Message-Id: <202412220740.4BM7eRH3012641@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Xin LI Subject: git: 2d54b1f5e5a8 - stable/13 - file_test: Fix file test 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: delphij X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2d54b1f5e5a8a29399e8fd131ef83fd0f4b8220d Auto-Submitted: auto-generated The branch stable/13 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=2d54b1f5e5a8a29399e8fd131ef83fd0f4b8220d commit 2d54b1f5e5a8a29399e8fd131ef83fd0f4b8220d Author: Jose Luis Duran AuthorDate: 2023-10-07 12:47:29 +0000 Commit: Xin LI CommitDate: 2024-12-22 07:39:59 +0000 file_test: Fix file test Trimming of the line feed is no longer necessary after https://github.com/file/file/commit/d993c6b0db20711b2c4cb9d2bee8c7f2e59b0a43 Currently the tests: - bcachefs2 - gpkg-1-zst - multiple are failing, but a fix will be committed upstream. This also reverts c5e957ad4 "file: fix test case for gpkg by removing the extra \n." MFC after: 3 days (cherry picked from commit 0d3a87569f14b0e48826bbaab5e05f35669bcebf) --- contrib/file/tests/gpkg-1-zst.result | 2 +- usr.bin/file/tests/file_test.sh | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/contrib/file/tests/gpkg-1-zst.result b/contrib/file/tests/gpkg-1-zst.result index 10379834d4b1..e99149450b1a 100644 --- a/contrib/file/tests/gpkg-1-zst.result +++ b/contrib/file/tests/gpkg-1-zst.result @@ -1 +1 @@ -Gentoo GLEP 78 (GPKG) binary package for "inkscape-1.2.1-r2-1" using zstd compression \ No newline at end of file +Gentoo GLEP 78 (GPKG) binary package for "inkscape-1.2.1-r2-1" using zstd compression diff --git a/usr.bin/file/tests/file_test.sh b/usr.bin/file/tests/file_test.sh index e6e398f6e51d..02d494b0f643 100644 --- a/usr.bin/file/tests/file_test.sh +++ b/usr.bin/file/tests/file_test.sh @@ -40,8 +40,7 @@ contrib_file_tests_body() { # The result files were created in UTC. TZ=Z atf_check -o save:actual_output file ${file_args} \ --brief "$testfile" - atf_check -o save:trimmed_output tr -d '\012' < actual_output - atf_check cmp trimmed_output "$result_file" + atf_check cmp actual_output "$result_file" done } From nobody Sun Dec 22 07:40: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 4YGCk50YXPz5jCtx; Sun, 22 Dec 2024 07:40: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YGCk46Bnmz4cqr; Sun, 22 Dec 2024 07:40:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734853228; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iGCgUErhrUvv619KS131xAcRdT4NuTHYg/lqlMaGdn0=; b=cMpAQY6mHOVU9hqk1WcLVAuMkpgLEX4fF8L5zO51enSVTuUS3g4vzamIil/Ozv0eX7zmRS zX1yJgSRuILGzXtEDRxYLnT16PhT8y2RzdEMydog63f2tl+aLlqv0TSnjBlgUe/wrfMHxv sp8tA7y3aS0W6BkpuABrRIynRAKyWGTcw+Wtug1fSYyw9hiaGd/NXo+yewk2AVVQ3wbKgA Gi1/0zFcTvxxv5eFFfutBOEAazIH1peMM6WTRfcg8wRQKznlAPjhVile06ZZfWEftYJVsw GD2I15BQj7T60PYVLqkmnl2xhCqrRFqQ4GoV1U/w03JuoJEsnJupcRHoLVMfcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734853228; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iGCgUErhrUvv619KS131xAcRdT4NuTHYg/lqlMaGdn0=; b=cG3W5zR3L2IWRadPDXcqqdOZA62jE8fwsdTUdTcXOzcyp2aPUPGFL2ElR2ae33ApOl5On2 RAT8FUWweELvK+kfVVwAR7bmMmTiXDPKPhYRosBBPkv2kCPJl0WdxxoDOt03yxkb/3bL85 /Zkvqf0rB7sXlo3RvdNOiWZXIiqaCRY+lLBW8vJaaP+m+g4BdD0y+79Bro/JKP7IKBsArR l/a8f/xWyDLpqHqhWRIg5b0X6vfvItkaYOIjYq47sJiFykio0HK5E2T2ZErs6oUskz1Hq9 hY1c2T0OU/VjYCJNoxh3iFlUnZUCCG7cyUGLAGIk6aJwlfX/bBHGHxpHlZMnHw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734853228; a=rsa-sha256; cv=none; b=MenX6kZ90f9Eh+/WIcMpfrPzz5zmsOav+NGjpccXjwO/+8jjq/7g7T3p9DuRHt8vpAsBWJ 2uG65hpZEky/jYYUk7duIEvnqApHH5hCkOVflWWGN2joQhxcx+71ohPoz2l+u1G1uGKbJn d5YOGKfLgsPWZfNcNDpkb2qcIgElTfDzhyzSYQA5yTnU6x3AY3vNLDzRkkIAqMZ1QA1j9r BYW9/k550p0DGO25zwdYoyr60i1uhCU7WFrPFZJh09d9bqW+2j2fX66InWqst0YHajWf2T clZbx2J/qSVdwp3PJDk4Kz6VL0ENKb64D1fnQGUvw0MZmhhfxmuanh2ScikC6g== 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 4YGCk4503yz10LZ; Sun, 22 Dec 2024 07:40:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BM7eSDO012698; Sun, 22 Dec 2024 07:40:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BM7eS7K012695; Sun, 22 Dec 2024 07:40:28 GMT (envelope-from git) Date: Sun, 22 Dec 2024 07:40:28 GMT Message-Id: <202412220740.4BM7eS7K012695@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Xin LI Subject: git: 0826d4b6c4f1 - stable/13 - (upstream) PR/386: Add newlines for consitency 2 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: delphij X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0826d4b6c4f1580c4fd749e62a171934c0995f0c Auto-Submitted: auto-generated The branch stable/13 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=0826d4b6c4f1580c4fd749e62a171934c0995f0c commit 0826d4b6c4f1580c4fd749e62a171934c0995f0c Author: Jose Luis Duran AuthorDate: 2023-10-09 04:52:53 +0000 Commit: Xin LI CommitDate: 2024-12-22 07:40:00 +0000 (upstream) PR/386: Add newlines for consitency 2 Obtained from: https://github.com/file/file/pull/134/ (cherry picked from commit 3347078000c078f2e67214ef1ba2e0bffe1aea4f) --- contrib/file/tests/bcachefs2.result | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/file/tests/bcachefs2.result b/contrib/file/tests/bcachefs2.result index 9ebf64bb55bc..30fe8e8910d2 100644 --- a/contrib/file/tests/bcachefs2.result +++ b/contrib/file/tests/bcachefs2.result @@ -1 +1 @@ -bcachefs, UUID=4fa11b1e-75e6-4210-9167-34e1769c0fe1, label "Label", version 26, min version 26, device 0/UUID=0a3643b7-c515-47f8-a0ea-91fc38d043d1, 1 devices (unclean) \ No newline at end of file +bcachefs, UUID=4fa11b1e-75e6-4210-9167-34e1769c0fe1, label "Label", version 26, min version 26, device 0/UUID=0a3643b7-c515-47f8-a0ea-91fc38d043d1, 1 devices (unclean) From nobody Sun Dec 22 07:40:29 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 4YGCk635Cvz5jD08; Sun, 22 Dec 2024 07:40: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YGCk623TYz4cjZ; Sun, 22 Dec 2024 07:40:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734853230; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DV+UDncoNALyAu5NmWcLRIHQK3CmSWUPSjB8Bwr9qj4=; b=OVOZ6DtkRjgvKeEmQG4izipFIRg3hMZ317Sy+IaUaF3eur4zt7BIWhp1nbux/F7jnoeQjb eckgzZIjaSULsREekWR5owkF3SKm98gG7r3DUbov0ImvplDaiaIwPfBmkhBrMCXFhmQLt+ 0I0WhsLKw84UtM2TcPZbMt40hwnSwevBSq3VwHX/k0qGp7F+tlye4IgbKy7OgErucgLsO/ 6ODZLhLEfNgcofhPWGp0hunn2YHDb37lbZQMi9b9Z2+C2TIJvcNqpZ+GV5cL6oHY6G6cQg jT/FlGNu8ZhbH1SqFMtWDFzHa9WD9JBk2IMhk633X6Rn6acgez07WlKKoMlBRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734853230; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DV+UDncoNALyAu5NmWcLRIHQK3CmSWUPSjB8Bwr9qj4=; b=twgyY52znD4WgurHa6Pl71DsJiQmsLo34uvz9YoT7gqkRabqrSWuuxs1l7/sLKqZCtS+1S AEgPfdNTWFiYhZYg43DgO67Po4p/javi5qi17+fz3XJTgDW25MVty0DMdnduPJ3hy6KWpM lzKmXTBU2JnJxKmK0Gn/Lly531BEFqhIk/sVkbXP0u42YrzbiLNQ4uvzPl6WuaCkyQCKrj zgHkFmQgjCadfgy5iMoePufaSztf5s8RFUpZaNndBREQ1l0SRKaV7H9Tz9MplOMhwhzt8J R9M9KKCVQUI1ZdUn2TsS9h7vSUKW0RuvpfQ7yMit2OEQ8I9WKwOx8NHJCDwRvQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734853230; a=rsa-sha256; cv=none; b=jWhw60Ri8tPwzUd5n/MozX80Ds+g93cxQKNjMmuWNjV9WcFpD6xr8LvXzKr9o3Xqw5OoQo k566gnbDZBZUWda4FuYeVObGs14x+d+V6aoQn5I+K+Kgq5tn0CWO/Ko9tM//n4M/6lJjU3 mh/AE4QWLKB4tnK/pZAYH+iXSADC6Su/fcIm/yuTZ4fd523yCgIV1JoY6gBI+tt85r+Iod xKnKwRJSui+8TBR0H1G6ot+522S1emRkxDxY20OQngVVR6oe0X7IJIaeLEgAsEHv7mG1D6 QHgGPcbXx2KwqKMFM7ZdyM3IPca9/DZkLYbsYZBkVb4QVeChKYkQmzaWgd0rFg== 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 4YGCk60jksz10W3; Sun, 22 Dec 2024 07:40:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BM7eUB8012743; Sun, 22 Dec 2024 07:40:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BM7eT5J012740; Sun, 22 Dec 2024 07:40:29 GMT (envelope-from git) Date: Sun, 22 Dec 2024 07:40:29 GMT Message-Id: <202412220740.4BM7eT5J012740@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Xin LI Subject: git: dcb4ac96fcf6 - stable/13 - MFC: MFV: file 5.46. 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: delphij X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: dcb4ac96fcf69b5c95e36284a1b679dac51d51c6 Auto-Submitted: auto-generated The branch stable/13 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=dcb4ac96fcf69b5c95e36284a1b679dac51d51c6 commit dcb4ac96fcf69b5c95e36284a1b679dac51d51c6 Author: Xin LI AuthorDate: 2024-12-08 19:07:01 +0000 Commit: Xin LI CommitDate: 2024-12-22 07:40:01 +0000 MFC: MFV: file 5.46. (cherry picked from commit ae316d1d1cffd71ab7751f94e10118777a88e027) --- contrib/file/ChangeLog | 32 + contrib/file/Makefile.in | 1 + contrib/file/aclocal.m4 | 4 +- contrib/file/config.h.in | 137 +- contrib/file/configure | 3017 ++++++++++++-------- contrib/file/configure.ac | 35 +- contrib/file/doc/Makefile.in | 1 + contrib/file/doc/file.man | 6 +- contrib/file/doc/libmagic.man | 29 +- contrib/file/doc/magic.man | 112 +- contrib/file/ltmain.sh | 863 ++++-- contrib/file/m4/libtool.m4 | 227 +- contrib/file/m4/ltoptions.m4 | 4 +- contrib/file/m4/ltsugar.m4 | 2 +- contrib/file/m4/ltversion.m4 | 13 +- contrib/file/m4/lt~obsolete.m4 | 4 +- contrib/file/magic/Magdir/acorn | 35 +- contrib/file/magic/Magdir/adventure | 4 +- contrib/file/magic/Magdir/algol68 | 4 +- contrib/file/magic/Magdir/android | 14 +- contrib/file/magic/Magdir/animation | 126 +- contrib/file/magic/Magdir/apple | 58 +- contrib/file/magic/Magdir/archive | 291 +- contrib/file/magic/Magdir/aria | 2 + contrib/file/magic/Magdir/arm | 11 +- contrib/file/magic/Magdir/asf | 14 +- contrib/file/magic/Magdir/audio | 123 +- contrib/file/magic/Magdir/ber | 3 +- contrib/file/magic/Magdir/biosig | 6 +- contrib/file/magic/Magdir/bsdi | 9 +- contrib/file/magic/Magdir/c64 | 158 +- contrib/file/magic/Magdir/cafebabe | 91 +- contrib/file/magic/Magdir/cbor | 4 +- contrib/file/magic/Magdir/claris | 10 +- contrib/file/magic/Magdir/coff | 179 +- contrib/file/magic/Magdir/commands | 14 +- contrib/file/magic/Magdir/compress | 27 +- contrib/file/magic/Magdir/console | 426 ++- contrib/file/magic/Magdir/ctf | 1 + contrib/file/magic/Magdir/database | 41 +- contrib/file/magic/Magdir/dataone | 13 +- contrib/file/magic/Magdir/diff | 125 +- contrib/file/magic/Magdir/digital | 20 +- contrib/file/magic/Magdir/efi | 45 +- contrib/file/magic/Magdir/elf | 32 +- contrib/file/magic/Magdir/epoc | 37 +- contrib/file/magic/Magdir/espressif | 4 +- contrib/file/magic/Magdir/filesystems | 179 +- contrib/file/magic/Magdir/firmware | 146 +- contrib/file/magic/Magdir/fonts | 36 +- contrib/file/magic/Magdir/frame | 120 +- contrib/file/magic/Magdir/games | 78 +- contrib/file/magic/Magdir/gentoo | 22 +- contrib/file/magic/Magdir/geo | 6 +- contrib/file/magic/Magdir/geos | 11 +- contrib/file/magic/Magdir/hitachi-sh | 18 +- contrib/file/magic/Magdir/hp | 25 +- contrib/file/magic/Magdir/ibm370 | 14 +- contrib/file/magic/Magdir/ibm6000 | 9 +- contrib/file/magic/Magdir/iff | 23 +- contrib/file/magic/Magdir/images | 629 +++- contrib/file/magic/Magdir/ispell | 190 +- contrib/file/magic/Magdir/javascript | 29 +- contrib/file/magic/Magdir/jpeg | 55 +- contrib/file/magic/Magdir/keyman | 14 + contrib/file/magic/Magdir/lammps | 5 +- contrib/file/magic/Magdir/lauterbach | 7 + contrib/file/magic/Magdir/linux | 415 ++- contrib/file/magic/Magdir/lisp | 12 +- contrib/file/magic/Magdir/magic | 47 +- contrib/file/magic/Magdir/mail.news | 22 +- contrib/file/magic/Magdir/map | 3 +- contrib/file/magic/Magdir/meteorological | 17 +- contrib/file/magic/Magdir/mips | 180 +- contrib/file/magic/Magdir/mmdf | 23 +- contrib/file/magic/Magdir/motorola | 8 +- contrib/file/magic/Magdir/msdos | 1309 +++++++-- contrib/file/magic/Magdir/msooxml | 37 +- contrib/file/magic/Magdir/msvc | 13 +- contrib/file/magic/Magdir/msx | 31 +- contrib/file/magic/Magdir/music | 4 +- contrib/file/magic/Magdir/nasa | 3 +- contrib/file/magic/Magdir/ole2compounddocs | 54 +- contrib/file/magic/Magdir/olf | 14 +- contrib/file/magic/Magdir/pack | 101 + contrib/file/magic/Magdir/pc88 | 24 - contrib/file/magic/Magdir/pdp | 16 +- contrib/file/magic/Magdir/pgp | 140 +- contrib/file/magic/Magdir/plan9 | 8 +- contrib/file/magic/Magdir/printer | 28 +- contrib/file/magic/Magdir/python | 33 +- contrib/file/magic/Magdir/revision | 27 +- contrib/file/magic/Magdir/riff | 89 +- contrib/file/magic/Magdir/rpm | 12 +- contrib/file/magic/Magdir/sgml | 98 +- contrib/file/magic/Magdir/sharc | 6 +- contrib/file/magic/Magdir/sniffer | 8 +- contrib/file/magic/Magdir/sql | 95 +- contrib/file/magic/Magdir/ssh | 45 + contrib/file/magic/Magdir/ssl | 22 +- contrib/file/magic/Magdir/sun | 17 +- contrib/file/magic/Magdir/symbos | 3 +- contrib/file/magic/Magdir/terminfo | 14 +- contrib/file/magic/Magdir/uf2 | 40 +- contrib/file/magic/Magdir/uxn | 18 + contrib/file/magic/Magdir/varied.script | 5 +- contrib/file/magic/Magdir/vax | 4 +- contrib/file/magic/Magdir/virtual | 38 +- contrib/file/magic/Magdir/weak | 1 + contrib/file/magic/Magdir/windows | 167 +- contrib/file/magic/Magdir/wordprocessors | 50 +- contrib/file/magic/Magdir/xenix | 136 +- contrib/file/magic/Magdir/xilinx | 49 +- contrib/file/magic/Magdir/yara | 16 +- contrib/file/magic/Makefile.am | 7 +- contrib/file/magic/Makefile.in | 8 +- contrib/file/python/Makefile.in | 1 + contrib/file/src/Makefile.in | 1 + contrib/file/src/apprentice.c | 104 +- contrib/file/src/cdf.c | 108 +- contrib/file/src/cdf.h | 131 +- contrib/file/src/cdf_time.c | 22 +- contrib/file/src/compress.c | 77 +- contrib/file/src/der.c | 22 +- contrib/file/src/der.h | 4 +- contrib/file/src/encoding.c | 4 +- contrib/file/src/file.c | 10 +- contrib/file/src/file.h | 69 +- contrib/file/src/funcs.c | 19 +- contrib/file/src/is_csv.c | 9 +- contrib/file/src/magic.c | 27 +- contrib/file/src/magic.h.in | 5 +- contrib/file/src/mygetopt.h | 9 +- contrib/file/src/print.c | 50 +- contrib/file/src/readelf.c | 150 +- contrib/file/src/readelf.h | 31 + contrib/file/src/seccomp.c | 103 +- contrib/file/src/softmagic.c | 148 +- contrib/file/tests/Makefile.am | 21 + contrib/file/tests/Makefile.in | 22 + contrib/file/tests/keyman-0.result | 1 + contrib/file/tests/keyman-0.testfile | Bin 0 -> 1494 bytes contrib/file/tests/keyman-1.result | 1 + contrib/file/tests/keyman-1.testfile | Bin 0 -> 378 bytes contrib/file/tests/keyman-2.result | 1 + contrib/file/tests/keyman-2.testfile | Bin 0 -> 1092 bytes contrib/file/tests/multiple.result | 2 +- contrib/file/tests/rpm-v3.0-bin-aarch64.result | 1 + contrib/file/tests/rpm-v3.0-bin-aarch64.testfile | Bin 0 -> 6361 bytes contrib/file/tests/rpm-v3.0-bin-powerpc64.result | 1 + contrib/file/tests/rpm-v3.0-bin-powerpc64.testfile | Bin 0 -> 6309 bytes contrib/file/tests/rpm-v3.0-bin-s390x.result | 1 + contrib/file/tests/rpm-v3.0-bin-s390x.testfile | Bin 0 -> 6301 bytes contrib/file/tests/rpm-v3.0-bin-x86_64.result | 1 + contrib/file/tests/rpm-v3.0-bin-x86_64.testfile | Bin 0 -> 6365 bytes contrib/file/tests/rpm-v3.0-src.result | 1 + contrib/file/tests/rpm-v3.0-src.testfile | Bin 0 -> 6554 bytes contrib/file/tests/searchbug.magic | 12 + contrib/file/tests/searchbug.result | 1 + contrib/file/tests/searchbug.testfile | 1 + contrib/file/tests/uf2.result | 2 +- contrib/file/tests/utf16xmlsvg.result | 1 + contrib/file/tests/utf16xmlsvg.testfile | Bin 0 -> 5564 bytes lib/libmagic/config.h | 147 +- 164 files changed, 8963 insertions(+), 3905 deletions(-) diff --git a/contrib/file/ChangeLog b/contrib/file/ChangeLog index fdf1cff6e2d3..d2dfbc14b77f 100644 --- a/contrib/file/ChangeLog +++ b/contrib/file/ChangeLog @@ -1,3 +1,35 @@ +2024-11-27 14:44 Christos Zoulas + + * release 5.46 + * Add OFFPOSITIVE + +2024-11-25 13:56 Christos Zoulas + + * avoid leaking symbols in libmagic + +2024-11-10 13:56 Christos Zoulas + + * PR/562: jsummers: Search/regex offsets are absolute to the + beginning of the file, so adjust them by subtracting the + offset that the "use" starts so that we don't double-count it. + + +2024-11-09 19:30 Christos Zoulas + * PR/543: matshch: bump nbuf so we can get the flags into the buffer. + + +2024-11-02 14:34 Christos Zoulas + + * Add Android elf notes (enh) + +2023-12-29 12:55 Christos Zoulas + + * Add limit for number of magic warnings allowed + +2023-07-29 12:55 Christos Zoulas + + * check regex bounds (found by clusterfuzz) + 2023-07-27 15:45 Christos Zoulas * release 5.45 diff --git a/contrib/file/Makefile.in b/contrib/file/Makefile.in index 4ce98d934433..8c72613f17f9 100644 --- a/contrib/file/Makefile.in +++ b/contrib/file/Makefile.in @@ -264,6 +264,7 @@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FILECMD = @FILECMD@ GREP = @GREP@ HAVE_VISIBILITY = @HAVE_VISIBILITY@ INSTALL = @INSTALL@ diff --git a/contrib/file/aclocal.m4 b/contrib/file/aclocal.m4 index 3ccd6030e97b..82f7c4bcaacb 100644 --- a/contrib/file/aclocal.m4 +++ b/contrib/file/aclocal.m4 @@ -14,8 +14,8 @@ m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.71],, -[m4_warning([this file was generated for autoconf 2.71. +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.72],, +[m4_warning([this file was generated for autoconf 2.72. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) diff --git a/contrib/file/config.h.in b/contrib/file/config.h.in index 5ae30c61edd1..9391b4e7dd71 100644 --- a/contrib/file/config.h.in +++ b/contrib/file/config.h.in @@ -12,10 +12,10 @@ /* Define for ELF core file support */ #undef ELFCORE -/* Define to 1 if you have the `asctime_r' function. */ +/* Define to 1 if you have the 'asctime_r' function. */ #undef HAVE_ASCTIME_R -/* Define to 1 if you have the `asprintf' function. */ +/* Define to 1 if you have the 'asprintf' function. */ #undef HAVE_ASPRINTF /* Define to 1 if you have the header file. */ @@ -24,24 +24,24 @@ /* Define to 1 if you have the header file. */ #undef HAVE_BZLIB_H -/* Define to 1 if you have the `ctime_r' function. */ +/* Define to 1 if you have the 'ctime_r' function. */ #undef HAVE_CTIME_R /* HAVE_DAYLIGHT */ #undef HAVE_DAYLIGHT -/* Define to 1 if you have the declaration of `daylight', and to 0 if you +/* Define to 1 if you have the declaration of 'daylight', and to 0 if you don't. */ #undef HAVE_DECL_DAYLIGHT -/* Define to 1 if you have the declaration of `tzname', and to 0 if you don't. +/* Define to 1 if you have the declaration of 'tzname', and to 0 if you don't. */ #undef HAVE_DECL_TZNAME /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H -/* Define to 1 if you have the `dprintf' function. */ +/* Define to 1 if you have the 'dprintf' function. */ #undef HAVE_DPRINTF /* Define to 1 if you have the header file. */ @@ -50,63 +50,69 @@ /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H -/* Define to 1 if you have the `fmtcheck' function. */ +/* Define to 1 if you have the 'fmtcheck' function. */ #undef HAVE_FMTCHECK -/* Define to 1 if you have the `fork' function. */ +/* Define to 1 if you have the 'fork' function. */ #undef HAVE_FORK -/* Define to 1 if you have the `freelocale' function. */ +/* Define to 1 if you have the 'freelocale' function. */ #undef HAVE_FREELOCALE -/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */ +/* Define to 1 if fseeko (and ftello) are declared in stdio.h. */ #undef HAVE_FSEEKO -/* Define to 1 if you have the `getline' function. */ +/* Define to 1 if you have the 'getline' function. */ #undef HAVE_GETLINE /* Define to 1 if you have the header file. */ #undef HAVE_GETOPT_H -/* Define to 1 if you have the `getopt_long' function. */ +/* Define to 1 if you have the 'getopt_long' function. */ #undef HAVE_GETOPT_LONG -/* Define to 1 if you have the `getpagesize' function. */ +/* Define to 1 if you have the 'getpagesize' function. */ #undef HAVE_GETPAGESIZE -/* Define to 1 if you have the `gmtime_r' function. */ +/* Define to 1 if you have the 'gmtime_r' function. */ #undef HAVE_GMTIME_R -/* Define to 1 if the system has the type `intptr_t'. */ +/* Define to 1 if the system has the type 'intptr_t'. */ #undef HAVE_INTPTR_T /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H -/* Define to 1 if you have the `bz2' library (-lbz2). */ +/* Define to 1 if you have the 'bz2' library (-lbz2). */ #undef HAVE_LIBBZ2 -/* Define to 1 if you have the `gnurx' library (-lgnurx). */ +/* Define to 1 if you have the 'gnurx' library (-lgnurx). */ #undef HAVE_LIBGNURX -/* Define to 1 if you have the `lz' library (-llz). */ +/* Define to 1 if you have the 'lrzip' library (-llrzip). */ +#undef HAVE_LIBLRZIP + +/* Define to 1 if you have the 'lz' library (-llz). */ #undef HAVE_LIBLZ -/* Define to 1 if you have the `lzma' library (-llzma). */ +/* Define to 1 if you have the 'lzma' library (-llzma). */ #undef HAVE_LIBLZMA -/* Define to 1 if you have the `seccomp' library (-lseccomp). */ +/* Define to 1 if you have the 'seccomp' library (-lseccomp). */ #undef HAVE_LIBSECCOMP -/* Define to 1 if you have the `z' library (-lz). */ +/* Define to 1 if you have the 'z' library (-lz). */ #undef HAVE_LIBZ -/* Define to 1 if you have the `zstd' library (-lzstd). */ +/* Define to 1 if you have the 'zstd' library (-lzstd). */ #undef HAVE_LIBZSTD -/* Define to 1 if you have the `localtime_r' function. */ +/* Define to 1 if you have the 'localtime_r' function. */ #undef HAVE_LOCALTIME_R +/* Define to 1 if you have the header file. */ +#undef HAVE_LRZIP_H + /* Define to 1 if you have the header file. */ #undef HAVE_LZLIB_H @@ -119,31 +125,31 @@ /* Define to 1 if declares mbstate_t. */ #undef HAVE_MBSTATE_T -/* Define to 1 if you have the `memmem' function. */ +/* Define to 1 if you have the 'memmem' function. */ #undef HAVE_MEMMEM /* Define to 1 if you have the header file. */ #undef HAVE_MINIX_CONFIG_H -/* Define to 1 if you have the `mkostemp' function. */ +/* Define to 1 if you have the 'mkostemp' function. */ #undef HAVE_MKOSTEMP -/* Define to 1 if you have the `mkstemp' function. */ +/* Define to 1 if you have the 'mkstemp' function. */ #undef HAVE_MKSTEMP -/* Define to 1 if you have a working `mmap' system call. */ +/* Define to 1 if you have a working 'mmap' system call. */ #undef HAVE_MMAP -/* Define to 1 if you have the `newlocale' function. */ +/* Define to 1 if you have the 'newlocale' function. */ #undef HAVE_NEWLOCALE -/* Define to 1 if you have the `pipe2' function. */ +/* Define to 1 if you have the 'pipe2' function. */ #undef HAVE_PIPE2 -/* Define to 1 if you have the `posix_spawnp' function. */ +/* Define to 1 if you have the 'posix_spawnp' function. */ #undef HAVE_POSIX_SPAWNP -/* Define to 1 if you have the `pread' function. */ +/* Define to 1 if you have the 'pread' function. */ #undef HAVE_PREAD /* Have sig_t type */ @@ -161,7 +167,7 @@ /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H -/* Define to 1 if you have the `strcasestr' function. */ +/* Define to 1 if you have the 'strcasestr' function. */ #undef HAVE_STRCASESTR /* Define to 1 if you have the header file. */ @@ -170,28 +176,28 @@ /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H -/* Define to 1 if you have the `strlcat' function. */ +/* Define to 1 if you have the 'strlcat' function. */ #undef HAVE_STRLCAT -/* Define to 1 if you have the `strlcpy' function. */ +/* Define to 1 if you have the 'strlcpy' function. */ #undef HAVE_STRLCPY -/* Define to 1 if you have the `strndup' function. */ +/* Define to 1 if you have the 'strndup' function. */ #undef HAVE_STRNDUP -/* Define to 1 if you have the `strtof' function. */ +/* Define to 1 if you have the 'strtof' function. */ #undef HAVE_STRTOF /* HAVE_STRUCT_OPTION */ #undef HAVE_STRUCT_OPTION -/* Define to 1 if `st_rdev' is a member of `struct stat'. */ +/* Define to 1 if 'st_rdev' is a member of 'struct stat'. */ #undef HAVE_STRUCT_STAT_ST_RDEV -/* Define to 1 if `tm_gmtoff' is a member of `struct tm'. */ +/* Define to 1 if 'tm_gmtoff' is a member of 'struct tm'. */ #undef HAVE_STRUCT_TM_TM_GMTOFF -/* Define to 1 if `tm_zone' is a member of `struct tm'. */ +/* Define to 1 if 'tm_zone' is a member of 'struct tm'. */ #undef HAVE_STRUCT_TM_TM_ZONE /* Define to 1 if you have the header file. */ @@ -233,28 +239,28 @@ /* HAVE_TZNAME */ #undef HAVE_TZNAME -/* Define to 1 if the system has the type `uintptr_t'. */ +/* Define to 1 if the system has the type 'uintptr_t'. */ #undef HAVE_UINTPTR_T /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H -/* Define to 1 if you have the `uselocale' function. */ +/* Define to 1 if you have the 'uselocale' function. */ #undef HAVE_USELOCALE -/* Define to 1 if you have the `utime' function. */ +/* Define to 1 if you have the 'utime' function. */ #undef HAVE_UTIME -/* Define to 1 if you have the `utimes' function. */ +/* Define to 1 if you have the 'utimes' function. */ #undef HAVE_UTIMES /* Define to 1 if you have the header file. */ #undef HAVE_UTIME_H -/* Define to 1 if you have the `vasprintf' function. */ +/* Define to 1 if you have the 'vasprintf' function. */ #undef HAVE_VASPRINTF -/* Define to 1 if you have the `vfork' function. */ +/* Define to 1 if you have the 'vfork' function. */ #undef HAVE_VFORK /* Define to 1 if you have the header file. */ @@ -270,13 +276,13 @@ /* Define to 1 if you have the header file. */ #undef HAVE_WCTYPE_H -/* Define to 1 if you have the `wcwidth' function. */ +/* Define to 1 if you have the 'wcwidth' function. */ #undef HAVE_WCWIDTH -/* Define to 1 if `fork' works. */ +/* Define to 1 if 'fork' works. */ #undef HAVE_WORKING_FORK -/* Define to 1 if `vfork' works. */ +/* Define to 1 if 'vfork' works. */ #undef HAVE_WORKING_VFORK /* Define to 1 if you have the header file. */ @@ -291,17 +297,20 @@ /* Define to 1 if you have the header file. */ #undef HAVE_ZSTD_H +/* Enable lrziplib compression support */ +#undef LRZIPLIBSUPPORT + /* Define to the sub-directory where libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Enable lzlib compression support */ #undef LZLIBSUPPORT -/* Define to 1 if `major', `minor', and `makedev' are declared in . +/* Define to 1 if 'major', 'minor', and 'makedev' are declared in . */ #undef MAJOR_IN_MKDEV -/* Define to 1 if `major', `minor', and `makedev' are declared in +/* Define to 1 if 'major', 'minor', and 'makedev' are declared in . */ #undef MAJOR_IN_SYSMACROS @@ -326,15 +335,15 @@ /* Define to the version of this package. */ #undef PACKAGE_VERSION -/* Define to 1 if all of the C90 standard headers exist (not just the ones +/* Define to 1 if all of the C89 standard headers exist (not just the ones required in a freestanding environment). This macro is provided for backward compatibility; new code need not use it. */ #undef STDC_HEADERS -/* Define to 1 if your declares `struct tm'. */ +/* Define to 1 if your declares 'struct tm'. */ #undef TM_IN_SYS_TIME -/* Enable extensions on AIX 3, Interix. */ +/* Enable extensions on AIX, Interix, z/OS. */ #ifndef _ALL_SOURCE # undef _ALL_SOURCE #endif @@ -395,11 +404,15 @@ #ifndef __STDC_WANT_IEC_60559_DFP_EXT__ # undef __STDC_WANT_IEC_60559_DFP_EXT__ #endif +/* Enable extensions specified by C23 Annex F. */ +#ifndef __STDC_WANT_IEC_60559_EXT__ +# undef __STDC_WANT_IEC_60559_EXT__ +#endif /* Enable extensions specified by ISO/IEC TS 18661-4:2015. */ #ifndef __STDC_WANT_IEC_60559_FUNCS_EXT__ # undef __STDC_WANT_IEC_60559_FUNCS_EXT__ #endif -/* Enable extensions specified by ISO/IEC TS 18661-3:2015. */ +/* Enable extensions specified by C23 Annex H and ISO/IEC TS 18661-3:2015. */ #ifndef __STDC_WANT_IEC_60559_TYPES_EXT__ # undef __STDC_WANT_IEC_60559_TYPES_EXT__ #endif @@ -449,12 +462,15 @@ /* Number of bits in a file offset, on hosts where this is settable. */ #undef _FILE_OFFSET_BITS -/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */ +/* Define to 1 if necessary to make fseeko visible. */ #undef _LARGEFILE_SOURCE -/* Define for large files, on AIX-style hosts. */ +/* Define to 1 on platforms where this makes off_t a 64-bit type. */ #undef _LARGE_FILES +/* Number of bits in time_t, on hosts where this is settable. */ +#undef _TIME_BITS + /* Define for Solaris 2.5.1 so the uint32_t typedef from , , or is not used. If the typedef were allowed, the #define below would cause a syntax error. */ @@ -470,6 +486,9 @@ #define below would cause a syntax error. */ #undef _UINT8_T +/* Define to 1 on platforms where this makes time_t a 64-bit type. */ +#undef __MINGW_USE_VC2005_COMPAT + /* Define to the type of a signed integer type of width exactly 32 bits if such a type exists and the standard includes do not define it. */ #undef int32_t @@ -485,13 +504,13 @@ /* Define to a type if does not define. */ #undef mbstate_t -/* Define to `long int' if does not define. */ +/* Define to 'long int' if does not define. */ #undef off_t /* Define as a signed integer type capable of holding a process identifier. */ #undef pid_t -/* Define to `unsigned int' if does not define. */ +/* Define as 'unsigned int' if doesn't define. */ #undef size_t /* Define to the type of an unsigned integer type of width exactly 16 bits if @@ -514,5 +533,5 @@ pointer, if such a type exists, and if the system does not define it. */ #undef uintptr_t -/* Define as `fork' if `vfork' does not work. */ +/* Define as 'fork' if 'vfork' does not work. */ #undef vfork diff --git a/contrib/file/configure b/contrib/file/configure index 8043072f56f7..cdcdd746f562 100755 --- a/contrib/file/configure +++ b/contrib/file/configure @@ -1,11 +1,11 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for file 5.45. +# Generated by GNU Autoconf 2.72 for file 5.46. # # Report bugs to . # # -# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, +# Copyright (C) 1992-1996, 1998-2017, 2020-2023 Free Software Foundation, # Inc. # # @@ -17,7 +17,6 @@ # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -as_nop=: if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh @@ -26,12 +25,13 @@ then : # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else $as_nop - case `(set -o) 2>/dev/null` in #( +else case e in #( + e) case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; +esac ;; esac fi @@ -103,7 +103,7 @@ IFS=$as_save_IFS ;; esac -# We did not find ourselves, most probably we were run as `sh COMMAND' +# We did not find ourselves, most probably we were run as 'sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 @@ -133,15 +133,14 @@ case $- in # (((( esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed `exec'. +# out after a failed 'exec'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="as_nop=: -if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 + as_bourne_compatible="if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: @@ -149,12 +148,13 @@ then : # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST -else \$as_nop - case \`(set -o) 2>/dev/null\` in #( +else case e in #( + e) case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; +esac ;; esac fi " @@ -172,8 +172,9 @@ as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ) then : -else \$as_nop - exitcode=1; echo positional parameters were not saved. +else case e in #( + e) exitcode=1; echo positional parameters were not saved. ;; +esac fi test x\$exitcode = x0 || exit 1 blah=\$(echo \$(echo blah)) @@ -195,14 +196,15 @@ test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null then : as_have_required=yes -else $as_nop - as_have_required=no +else case e in #( + e) as_have_required=no ;; +esac fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null then : -else $as_nop - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +else case e in #( + e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do @@ -235,12 +237,13 @@ IFS=$as_save_IFS if $as_found then : -else $as_nop - if { test -f "$SHELL" || test -f "$SHELL.exe"; } && +else case e in #( + e) if { test -f "$SHELL" || test -f "$SHELL.exe"; } && as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null then : CONFIG_SHELL=$SHELL as_have_required=yes -fi +fi ;; +esac fi @@ -262,7 +265,7 @@ case $- in # (((( esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed `exec'. +# out after a failed 'exec'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi @@ -282,7 +285,8 @@ $0: a modern shell, or manually run the script under such a $0: shell if you do have one." fi exit 1 -fi +fi ;; +esac fi fi SHELL=${CONFIG_SHELL-/bin/sh} @@ -321,14 +325,6 @@ as_fn_exit () as_fn_set_status $1 exit $1 } # as_fn_exit -# as_fn_nop -# --------- -# Do nothing but, unlike ":", preserve the value of $?. -as_fn_nop () -{ - return $? -} -as_nop=as_fn_nop # as_fn_mkdir_p # ------------- @@ -397,11 +393,12 @@ then : { eval $1+=\$2 }' -else $as_nop - as_fn_append () +else case e in #( + e) as_fn_append () { eval $1=\$$1\$2 - } + } ;; +esac fi # as_fn_append # as_fn_arith ARG... @@ -415,21 +412,14 @@ then : { as_val=$(( $* )) }' -else $as_nop - as_fn_arith () +else case e in #( + e) as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` - } + } ;; +esac fi # as_fn_arith -# as_fn_nop -# --------- -# Do nothing but, unlike ":", preserve the value of $?. -as_fn_nop () -{ - return $? -} -as_nop=as_fn_nop # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- @@ -503,6 +493,8 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits /[$]LINENO/= ' <$as_myself | sed ' + t clear + :clear s/[$]LINENO.*/&-/ t lineno b @@ -551,7 +543,6 @@ esac as_echo='printf %s\n' as_echo_n='printf %s' - rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file @@ -563,9 +554,9 @@ if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -pR'. + # 1) On MSYS, both 'ln -s file dir' and 'ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; 'ln -s' creates a wrapper executable. + # In both cases, we have to default to 'cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then @@ -590,10 +581,12 @@ as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" +as_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" +as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated # Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" +as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g" +as_tr_sh="eval sed '$as_sed_sh'" # deprecated SHELL=${CONFIG_SHELL-/bin/sh} @@ -621,8 +614,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='file' PACKAGE_TARNAME='file' -PACKAGE_VERSION='5.45' -PACKAGE_STRING='file 5.45' +PACKAGE_VERSION='5.46' +PACKAGE_STRING='file 5.46' PACKAGE_BUGREPORT='christos@astron.com' PACKAGE_URL='' @@ -659,6 +652,7 @@ ac_includes_default="\ ac_header_c_list= ac_func_c_list= +enable_year2038=yes ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS @@ -679,6 +673,7 @@ ac_ct_AR AR DLLTOOL OBJDUMP +FILECMD NM ac_ct_DUMPBIN DUMPBIN @@ -802,6 +797,7 @@ enable_bzlib enable_xzlib enable_zstdlib enable_lzlib +enable_lrziplib enable_libseccomp enable_fsect_man5 enable_dependency_tracking @@ -815,6 +811,7 @@ with_sysroot enable_libtool_lock enable_largefile enable_warnings +enable_year2038 ' ac_precious_vars='build_alias host_alias @@ -933,7 +930,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: \`$ac_useropt'" + as_fn_error $? "invalid feature name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -959,7 +956,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: \`$ac_useropt'" + as_fn_error $? "invalid feature name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1172,7 +1169,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: \`$ac_useropt'" + as_fn_error $? "invalid package name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1188,7 +1185,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: \`$ac_useropt'" + as_fn_error $? "invalid package name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1218,8 +1215,8 @@ do | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; - -*) as_fn_error $? "unrecognized option: \`$ac_option' -Try \`$0 --help' for more information" + -*) as_fn_error $? "unrecognized option: '$ac_option' +Try '$0 --help' for more information" ;; *=*) @@ -1227,7 +1224,7 @@ Try \`$0 --help' for more information" # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) - as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + as_fn_error $? "invalid variable name: '$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; @@ -1277,7 +1274,7 @@ do as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done -# There might be people who depend on the old broken behavior: `$host' +# There might be people who depend on the old broken behavior: '$host' *** 23372 LINES SKIPPED *** From nobody Sun Dec 22 07:45: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 4YGCrG28wgz5jDG0; Sun, 22 Dec 2024 07:45: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YGCrF6yZDz4f6B; Sun, 22 Dec 2024 07:45:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734853549; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bOopy8+/w9lEHP8G7k4prIhvEAziX/FtFyorUm+ugTg=; b=jT7/dAz+jW0pXYYnI8LbKEpU/4INKoILSOF7vJ+zTEtxnVQE1n+JOa9AtwH85EbYViz2Zl ioQ67u4XHXKuZnTah2xl/UY6qQc/EtokMznQYfXfD0W+sVPMG/2nxlVPI10AaWbAFSsoar FntI7FlZUP0jCCl5U/+QvLgZWenKuLdyvTntaVewKsjCagktT8nRb0BcY0HJMn04wpTYsW m4tWKEZp8MWgpajBgQifPrYKEs4LXtO6/E52ocr8xJpnCXBYUMKMlWA9rLYhnvXRwzGMQ1 /wFfrKPKnpasDXM/fc48ef0jUyJ2bui94ld5rhXR2V/w+OTOIuPZoMyfby/puw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734853549; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bOopy8+/w9lEHP8G7k4prIhvEAziX/FtFyorUm+ugTg=; b=Npo/kYQSPQM9dMxtUMsvPyz5ETSJrCMK4al1Y8/oo4nETYy4NPU/fqTP3Lp5bBMCu9bAru 6Cz1fAwUFWVnqtP0h++m2Vn6OjrzBJuVtaqWO05aYm41eizyJz/AeDyHrCwsanlWBiR9pv +K8CNgOgxqTBbk+HCIM8KUnSpF9paMa/F4ZU5GpccKvMv60zuvWMBhJn2TDqULiyFuso31 2L1GJQhSrggJ3ht3gS6A9LGkAtZjPDu2aA7uIuKb2Jl5BJUp6jpeuEYc1JasC0y4K3CU3g 6jZaH4ejPmk/7XLtF/TuFn0KaQNswCgIOUCuN6/nI4FwCdfDhlEwQixiv60ubA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734853549; a=rsa-sha256; cv=none; b=nfVliVH+xHWCGQfxFmdTyu9HpnSJzQJ0qjrmYHGp4S3FdKfgGfK0MC6DpCOzSkdTH2O7NC CRzzce4dSnHnJsgS4v1ZBgm0b6Qi3rIPTjQ3FWNaQ1BAd28THFxURSJo4kN+TKd9dsIu9I ZfNZG0yY1wa007msDlncN6F+FYFf/WdSVjSqc0yeLgM5JoVhuonvL60SG4UlD6c9oUBONi is2ge5zs6k1Q4zK1QtbRH3EY2x92BxHpofqKHC/sHCg+dGo1x/yJg7CdDKQow8g6cVSOOv umoeT0q/mG+MX3HLpQ6BWbhDKytQogifZNsUBFGdOuz2z0o9aX/wdv+P1uE/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 4YGCrF6Yz9z10Ym; Sun, 22 Dec 2024 07:45:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BM7jnbH021415; Sun, 22 Dec 2024 07:45:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BM7jnqv021412; Sun, 22 Dec 2024 07:45:49 GMT (envelope-from git) Date: Sun, 22 Dec 2024 07:45:49 GMT Message-Id: <202412220745.4BM7jnqv021412@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Xin LI Subject: git: 7fcc9d60956f - stable/14 - MFC: MFV: expat 2.6.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: delphij X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7fcc9d60956fc482d14acd579786390b989a5057 Auto-Submitted: auto-generated The branch stable/14 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=7fcc9d60956fc482d14acd579786390b989a5057 commit 7fcc9d60956fc482d14acd579786390b989a5057 Author: Enji Cooper AuthorDate: 2024-09-28 14:19:59 +0000 Commit: Xin LI CommitDate: 2024-12-22 07:42:50 +0000 MFC: MFV: expat 2.6.3 The 2.6.1 - 2.6.3 releases address several security issues with the library. The release notes for the 2.6.1-2.6.3 releases can be found at https://github.com/libexpat/libexpat/blob/R_2_6_3/expat/Changes . Differential Revision: https://reviews.freebsd.org/D46829 Merge commit '8e1eae2319cd3a651941c88b46d95e8ee8507c6c' (cherry picked from commit ffd294a1f4c23863c3e515d16dce31d5509bcb01) --- contrib/expat/Changes | 136 ++++++++++++++++++- contrib/expat/FREEBSD-Xlist | 1 - contrib/expat/Makefile.am | 6 +- contrib/expat/Makefile.in | 8 +- contrib/expat/README.md | 14 +- contrib/expat/buildconf.sh | 24 +--- contrib/expat/configure.ac | 39 ++++-- contrib/expat/doc/Makefile.am | 21 ++- contrib/expat/doc/Makefile.in | 58 ++++----- contrib/expat/doc/reference.html | 19 ++- contrib/expat/doc/xmlwf.1 | 2 +- contrib/expat/doc/xmlwf.xml | 2 +- contrib/expat/examples/Makefile.in | 2 +- contrib/expat/expat_config.h.in | 3 - contrib/expat/fix-xmltest-log.sh | 12 +- contrib/expat/lib/Makefile.am | 19 +-- contrib/expat/lib/Makefile.in | 79 ++++++++---- contrib/expat/lib/expat.h | 5 +- contrib/expat/lib/internal.h | 17 ++- contrib/expat/lib/siphash.h | 3 +- contrib/expat/lib/xmlparse.c | 73 ++++++++--- contrib/expat/tests/Makefile.am | 11 +- contrib/expat/tests/Makefile.in | 19 +-- contrib/expat/tests/README.md | 11 ++ contrib/expat/tests/README.txt | 13 -- contrib/expat/tests/acc_tests.c | 59 +++++++++ contrib/expat/tests/basic_tests.c | 208 ++++++++++++++++++++---------- contrib/expat/tests/benchmark/Makefile.in | 2 +- contrib/expat/tests/misc_tests.c | 2 +- contrib/expat/xmlwf/Makefile.in | 2 +- 30 files changed, 605 insertions(+), 265 deletions(-) diff --git a/contrib/expat/Changes b/contrib/expat/Changes index a7d4caf9ac81..c1d22efa5a3c 100644 --- a/contrib/expat/Changes +++ b/contrib/expat/Changes @@ -1,6 +1,136 @@ -NOTE: We are looking for help with a few things: - https://github.com/libexpat/libexpat/labels/help%20wanted - If you can help, please get in touch. Thanks! + __ __ _ + ___\ \/ /_ __ __ _| |_ + / _ \\ /| '_ \ / _` | __| + | __// \| |_) | (_| | |_ + \___/_/\_\ .__/ \__,_|\__| + |_| XML parser + +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!! Expat is UNDERSTAFFED and WITHOUT FUNDING. !! +!! ~~~~~~~~~~~~ !! +!! The following topics need *additional skilled C developers* to progress !! +!! in a timely manner or at all (loosely ordered by descending priority): !! +!! !! +!! - fixing a complex non-public security issue, !! +!! - teaming up on researching and fixing future security reports and !! +!! ClusterFuzz findings with few-days-max response times in communication !! +!! in order to (1) have a sound fix ready before the end of a 90 days !! +!! grace period and (2) in a sustainable manner, !! +!! - implementing and auto-testing XML 1.0r5 support !! +!! (needs discussion before pull requests), !! +!! - smart ideas on fixing the Autotools CMake files generation issue !! +!! without breaking CI (needs discussion before pull requests), !! +!! - the Windows binaries topic (needs requirements engineering first), !! +!! - pushing migration from `int` to `size_t` further !! +!! including edge-cases test coverage (needs discussion before anything). !! +!! !! +!! For details, please reach out via e-mail to sebastian@pipping.org so we !! +!! can schedule a voice call on the topic, in English or German. !! +!! !! +!! THANK YOU! Sebastian Pipping -- Berlin, 2024-03-09 !! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +Release 2.6.3 Wed September 4 2024 + Security fixes: + #887 #890 CVE-2024-45490 -- Calling function XML_ParseBuffer with + len < 0 without noticing and then calling XML_GetBuffer + will have XML_ParseBuffer fail to recognize the problem + and XML_GetBuffer corrupt memory. + With the fix, XML_ParseBuffer now complains with error + XML_ERROR_INVALID_ARGUMENT just like sibling XML_Parse + has been doing since Expat 2.2.1, and now documented. + Impact is denial of service to potentially artitrary code + execution. + #888 #891 CVE-2024-45491 -- Internal function dtdCopy can have an + integer overflow for nDefaultAtts on 32-bit platforms + (where UINT_MAX equals SIZE_MAX). + Impact is denial of service to potentially artitrary code + execution. + #889 #892 CVE-2024-45492 -- Internal function nextScaffoldPart can + have an integer overflow for m_groupSize on 32-bit + platforms (where UINT_MAX equals SIZE_MAX). + Impact is denial of service to potentially artitrary code + execution. + + Other changes: + #851 #879 Autotools: Sync CMake templates with CMake 3.28 + #853 Autotools: Always provide path to find(1) for portability + #861 Autotools: Ensure that the m4 directory always exists. + #870 Autotools: Simplify handling of SIZEOF_VOID_P + #869 Autotools: Support non-GNU sed + #856 Autotools|CMake: Fix main() to main(void) + #865 Autotools|CMake: Fix compile tests for HAVE_SYSCALL_GETRANDOM + #863 Autotools|CMake: Stop requiring dos2unix + #854 #855 CMake: Fix check for symbols size_t and off_t + #864 docs|tests: Convert README to Markdown and update + #741 Windows: Drop support for Visual Studio <=15.0/2017 + #886 Drop needless XML_DTD guards around is_param access + #885 Fix typo in a code comment + #894 #896 Version info bumped from 10:2:9 (libexpat*.so.1.9.2) + to 10:3:9 (libexpat*.so.1.9.3); see https://verbump.de/ + for what these numbers do + + Infrastructure: + #880 Readme: Promote the call for help + #868 CI: Fix various issues + #849 CI: Allow triggering GitHub Actions workflows manually + #851 #872 .. + #873 #879 CI: Adapt to breaking changes in GitHub Actions + + Special thanks to: + Alexander Bluhm + Berkay Eren Ürün + Dag-Erling Smørgrav + Ferenc Géczi + TaiYou + +Release 2.6.2 Wed March 13 2024 + Security fixes: + #839 #842 CVE-2024-28757 -- Prevent billion laughs attacks with + isolated use of external parsers. Please see the commit + message of commit 1d50b80cf31de87750103656f6eb693746854aa8 + for details. + + Bug fixes: + #839 #841 Reject direct parameter entity recursion + and avoid the related undefined behavior + + Other changes: + #847 Autotools: Fix build for DOCBOOK_TO_MAN containing spaces + #837 Add missing #821 and #824 to 2.6.1 change log + #838 #843 Version info bumped from 10:1:9 (libexpat*.so.1.9.1) + to 10:2:9 (libexpat*.so.1.9.2); see https://verbump.de/ + for what these numbers do + + Special thanks to: + Philippe Antoine + Tomas Korbar + and + Clang UndefinedBehaviorSanitizer + OSS-Fuzz / ClusterFuzz + +Release 2.6.1 Thu February 29 2024 + Bug fixes: + #817 Make tests independent of CPU speed, and thus more robust + #828 #836 Expose billion laughs API with XML_DTD defined and + XML_GE undefined, regression from 2.6.0 + + Other changes: + #829 Hide test-only code behind new internal macro + #833 Autotools: Reject expat_config.h.in defining SIZEOF_VOID_P + #821 #824 Autotools: Fix "make clean" for case: + ./configure --without-docbook && make clean all + #819 Address compiler warnings + #832 #834 Version info bumped from 10:0:9 (libexpat*.so.1.9.0) + to 10:1:9 (libexpat*.so.1.9.1); see https://verbump.de/ + for what these numbers do + + Infrastructure: + #818 CI: Adapt to breaking changes in clang-format + + Special thanks to: + David Hall + Snild Dolkow Release 2.6.0 Tue February 6 2024 Security fixes: diff --git a/contrib/expat/FREEBSD-Xlist b/contrib/expat/FREEBSD-Xlist index c1f2a689fee4..82ceb055ae1e 100644 --- a/contrib/expat/FREEBSD-Xlist +++ b/contrib/expat/FREEBSD-Xlist @@ -1,4 +1,3 @@ -# $FreeBSD$ *.MPW *.cmake *.def diff --git a/contrib/expat/Makefile.am b/contrib/expat/Makefile.am index 9c2259d23e63..7d8e17c2cf86 100644 --- a/contrib/expat/Makefile.am +++ b/contrib/expat/Makefile.am @@ -10,6 +10,8 @@ # Copyright (c) 2018 KangLin # Copyright (c) 2022 Johnny Jazeix # Copyright (c) 2023 Sony Corporation / Snild Dolkow +# Copyright (c) 2024 Alexander Bluhm +# Copyright (c) 2024 Dag-Erling Smørgrav # Licensed under the MIT license: # # Permission is hereby granted, free of charge, to any person obtaining @@ -114,10 +116,10 @@ buildlib: @echo 'ERROR: is no longer supported. INSTEAD please:' >&2 @echo 'ERROR:' >&2 @echo 'ERROR: * Mass-patch Makefile.am, e.g.' >&2 - @echo 'ERROR: # find -name Makefile.am -exec sed \' >&2 + @echo 'ERROR: # find . -name Makefile.am -exec sed \' >&2 @echo 'ERROR: -e "s,libexpat\.la,libexpatw.la," \' >&2 @echo 'ERROR: -e "s,libexpat_la,libexpatw_la," \' >&2 - @echo 'ERROR: -i {} +' >&2 + @echo 'ERROR: -i.bak {} +' >&2 @echo 'ERROR:' >&2 @echo 'ERROR: * Run automake to re-generate Makefile.in files' >&2 @echo 'ERROR:' >&2 diff --git a/contrib/expat/Makefile.in b/contrib/expat/Makefile.in index f505224f6fa8..c0fcb5dd05d1 100644 --- a/contrib/expat/Makefile.in +++ b/contrib/expat/Makefile.in @@ -26,6 +26,8 @@ # Copyright (c) 2018 KangLin # Copyright (c) 2022 Johnny Jazeix # Copyright (c) 2023 Sony Corporation / Snild Dolkow +# Copyright (c) 2024 Alexander Bluhm +# Copyright (c) 2024 Dag-Erling Smørgrav # Licensed under the MIT license: # # Permission is hereby granted, free of charge, to any person obtaining @@ -384,6 +386,7 @@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ +SIZEOF_VOID_P = @SIZEOF_VOID_P@ SO_MAJOR = @SO_MAJOR@ SO_MINOR = @SO_MINOR@ SO_PATCH = @SO_PATCH@ @@ -397,7 +400,6 @@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -ac_cv_sizeof_void_p = @ac_cv_sizeof_void_p@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -1080,10 +1082,10 @@ buildlib: @echo 'ERROR: is no longer supported. INSTEAD please:' >&2 @echo 'ERROR:' >&2 @echo 'ERROR: * Mass-patch Makefile.am, e.g.' >&2 - @echo 'ERROR: # find -name Makefile.am -exec sed \' >&2 + @echo 'ERROR: # find . -name Makefile.am -exec sed \' >&2 @echo 'ERROR: -e "s,libexpat\.la,libexpatw.la," \' >&2 @echo 'ERROR: -e "s,libexpat_la,libexpatw_la," \' >&2 - @echo 'ERROR: -i {} +' >&2 + @echo 'ERROR: -i.bak {} +' >&2 @echo 'ERROR:' >&2 @echo 'ERROR: * Run automake to re-generate Makefile.in files' >&2 @echo 'ERROR:' >&2 diff --git a/contrib/expat/README.md b/contrib/expat/README.md index 43c4f4f3dbb3..180a68e4abbe 100644 --- a/contrib/expat/README.md +++ b/contrib/expat/README.md @@ -4,8 +4,14 @@ [![Downloads SourceForge](https://img.shields.io/sourceforge/dt/expat?label=Downloads%20SourceForge)](https://sourceforge.net/projects/expat/files/) [![Downloads GitHub](https://img.shields.io/github/downloads/libexpat/libexpat/total?label=Downloads%20GitHub)](https://github.com/libexpat/libexpat/releases) +> [!CAUTION] +> +> Expat is **understaffed** and without funding. +> There is a [call for help with details](https://github.com/libexpat/libexpat/blob/master/expat/Changes) +> at the top of the `Changes` file. -# Expat, Release 2.6.0 + +# Expat, Release 2.6.3 This is Expat, a C99 library for parsing [XML 1.0 Fourth Edition](https://www.w3.org/TR/2006/REC-xml-20060816/), started by @@ -20,7 +26,7 @@ Expat supports the following compilers: - GNU GCC >=4.5 - LLVM Clang >=3.5 -- Microsoft Visual Studio >=15.0/2017 (rolling `${today} minus 5 years`) +- Microsoft Visual Studio >=16.0/2019 (rolling `${today} minus 5 years`) Windows users can use the [`expat-win32bin-*.*.*.{exe,zip}` download](https://github.com/libexpat/libexpat/releases), @@ -158,10 +164,10 @@ support this mode of compilation (yet): 1. Mass-patch `Makefile.am` files to use `libexpatw.la` for a library name:
- `find -name Makefile.am -exec sed + `find . -name Makefile.am -exec sed -e 's,libexpat\.la,libexpatw.la,' -e 's,libexpat_la,libexpatw_la,' - -i {} +` + -i.bak {} +` 1. Run `automake` to re-write `Makefile.in` files:
`automake` diff --git a/contrib/expat/buildconf.sh b/contrib/expat/buildconf.sh index 5e2b3269c256..4e506b30082b 100755 --- a/contrib/expat/buildconf.sh +++ b/contrib/expat/buildconf.sh @@ -8,6 +8,7 @@ # # Copyright (c) 2017-2022 Sebastian Pipping # Copyright (c) 2018 Marco Maggi +# Copyright (c) 2024 Dag-Erling Smørgrav # Licensed under the MIT license: # # Permission is hereby granted, free of charge, to any person obtaining @@ -31,25 +32,4 @@ set -e -# File expat_config.h.in (as generated by autoheader by autoreconf) contains -# macro SIZEOF_VOID_P which is (1) not really needed by Expat as of today and -# (2) a problem to "multilib" systems with one shared installed -# /usr/include/expat_config.h for two Expats with different "void *" sizes -# installed in e.g. /usr/lib32 and /usr/lib64. Hence we patch macro -# SIZEOF_VOID_P out of template expat_config.h.in so that configure will -# not put SIZEOF_VOID_P in the eventual expat_config.h. -patch_expat_config_h_in() { - local filename="$1" - local sizeof_void_p_line_number="$(grep -F -n SIZEOF_VOID_P "${filename}" | awk -F: '{print $1}')" - [[ ${sizeof_void_p_line_number} =~ ^[0-9]+$ ]] # cheap assert - local first_line_to_delete=$(( sizeof_void_p_line_number - 1 )) - local last_line_to_delete=$(( sizeof_void_p_line_number + 1 )) - # Note: Avoiding "sed -i" only for macOS portability. - local tempfile="$(mktemp)" - sed "${first_line_to_delete},${last_line_to_delete}d" "${filename}" > "${tempfile}" - mv "${tempfile}" "${filename}" -} - -autoreconf --warnings=all --install --verbose "$@" - -patch_expat_config_h_in expat_config.h.in +exec autoreconf --warnings=all --install --verbose "$@" diff --git a/contrib/expat/configure.ac b/contrib/expat/configure.ac index a5d1ff9317c8..1a930413ffe5 100644 --- a/contrib/expat/configure.ac +++ b/contrib/expat/configure.ac @@ -22,6 +22,8 @@ dnl Copyright (c) 2018 KangLin dnl Copyright (c) 2019 Mohammed Khajapasha dnl Copyright (c) 2019 Kishore Kunche dnl Copyright (c) 2020 Jeffrey Walton +dnl Copyright (c) 2024 Ferenc Géczi +dnl Copyright (c) 2024 Dag-Erling Smørgrav dnl Licensed under the MIT license: dnl dnl Permission is hereby granted, free of charge, to any person obtaining @@ -83,7 +85,7 @@ dnl If the API changes incompatibly set LIBAGE back to 0 dnl LIBCURRENT=10 # sync -LIBREVISION=0 # with +LIBREVISION=3 # with LIBAGE=9 # CMakeLists.txt! AC_CONFIG_HEADERS([expat_config.h]) @@ -160,7 +162,6 @@ AC_C_BIGENDIAN([AC_DEFINE([WORDS_BIGENDIAN], 1) AC_DEFINE_UNQUOTED([BYTEORDER], $BYTEORDER, [1234 = LILENDIAN, 4321 = BIGENDIAN]) AC_C_CONST -AC_TYPE_SIZE_T AC_ARG_WITH([xmlwf], [AS_HELP_STRING([--without-xmlwf], [do not build xmlwf])], @@ -215,7 +216,7 @@ AC_LINK_IFELSE([AC_LANG_SOURCE([ #else # include /* for arc4random_buf on BSD */ #endif - int main() { + int main(void) { char dummy[[123]]; // double brackets for m4 arc4random_buf(dummy, 0U); return 0; @@ -232,7 +233,7 @@ AC_LINK_IFELSE([AC_LANG_SOURCE([ #else # include #endif - int main() { + int main(void) { arc4random(); return 0; } @@ -254,7 +255,7 @@ AS_IF([test "x$with_getrandom" != xno], AC_LINK_IFELSE([AC_LANG_SOURCE([ #include /* for NULL */ #include - int main() { + int main(void) { return getrandom(NULL, 0U, 0U); } ])], @@ -275,10 +276,11 @@ AS_HELP_STRING([--without-sys-getrandom], AS_IF([test "x$with_sys_getrandom" != xno], [AC_MSG_CHECKING([for syscall SYS_getrandom (Linux 3.17+)]) AC_LINK_IFELSE([AC_LANG_SOURCE([ + #define _GNU_SOURCE #include /* for NULL */ #include /* for syscall */ #include /* for SYS_getrandom */ - int main() { + int main(void) { syscall(SYS_getrandom, NULL, 0, 0); return 0; } @@ -357,11 +359,22 @@ AS_IF([test "x${DOCBOOK_TO_MAN}" != x -a "x$with_docbook" != xno], page for xmlwf.])])]) dnl This will make sure that a release tarball shipping a pre-rendered xmlwf man page will -dnl get it installed, independent of whether some flavor of docbook2man is available. +dnl get it installed, when no working flavor of docbook2man is available (or wanted). dnl This relies on file xmlwf.1 being at least as recent as its source file xmlwf.xml. AS_IF([test -f "${srcdir}"/doc/xmlwf.1], - [AM_CONDITIONAL(WITH_DOCBOOK, [true])], - [AM_CONDITIONAL(WITH_DOCBOOK, [test "x${DOCBOOK_TO_MAN}" != x])]) + [AM_CONDITIONAL(WITH_MANPAGE, [true]) + AS_IF([test "x$with_docbook" = xno -o "x${DOCBOOK_TO_MAN}" = x], + [AM_CONDITIONAL(WITH_PREBUILT_MANPAGE, [true]) + AM_CONDITIONAL(WITH_DISTRIBUTABLE_MANPAGE, [false])], + [AM_CONDITIONAL(WITH_PREBUILT_MANPAGE, [false]) + AM_CONDITIONAL(WITH_DISTRIBUTABLE_MANPAGE, [true])]) + ], + [AS_IF([test "x$with_docbook" != xno -a "x${DOCBOOK_TO_MAN}" != x], + [AM_CONDITIONAL(WITH_MANPAGE, [true]) + AM_CONDITIONAL(WITH_DISTRIBUTABLE_MANPAGE, [true])], + [AM_CONDITIONAL(WITH_MANPAGE, [false]) + AM_CONDITIONAL(WITH_DISTRIBUTABLE_MANPAGE, [false])]) + AM_CONDITIONAL(WITH_PREBUILT_MANPAGE, [false])]) dnl Configure CMake file templates dnl NOTE: The *_TRUE variables read here are Automake conditionals @@ -392,7 +405,6 @@ LIBDIR_BASENAME="$(basename "${libdir}")" SO_MAJOR="$(expr "${LIBCURRENT}" - "${LIBAGE}")" SO_MINOR="${LIBAGE}" SO_PATCH="${LIBREVISION}" -AC_CHECK_SIZEOF([void *]) # sets ac_cv_sizeof_void_p AC_SUBST([EXPAT_ATTR_INFO]) AC_SUBST([EXPAT_DTD]) AC_SUBST([EXPAT_LARGE_SIZE]) @@ -405,8 +417,13 @@ AC_SUBST([LIBDIR_BASENAME]) AC_SUBST([SO_MAJOR]) AC_SUBST([SO_MINOR]) AC_SUBST([SO_PATCH]) -AC_SUBST([ac_cv_sizeof_void_p]) +dnl The canonical way of doing this is AC_CHECK_SIZEOF(void *), but +dnl that adds SIZEOF_VOID_P to expat_config.h.in, making it difficult +dnl to have 32-bit and 64-bit versions of libexpat installed on the +dnl same system with a single, shared copy of the header. +AC_COMPUTE_INT(SIZEOF_VOID_P, [sizeof(void *)]) +AC_SUBST([SIZEOF_VOID_P]) dnl write the Automake flags we set AC_SUBST([AM_CPPFLAGS]) diff --git a/contrib/expat/doc/Makefile.am b/contrib/expat/doc/Makefile.am index c3a3ce59c1b9..3bea96e9aa6f 100644 --- a/contrib/expat/doc/Makefile.am +++ b/contrib/expat/doc/Makefile.am @@ -6,9 +6,10 @@ # \___/_/\_\ .__/ \__,_|\__| # |_| XML parser # -# Copyright (c) 2017-2022 Sebastian Pipping +# Copyright (c) 2017-2024 Sebastian Pipping # Copyright (c) 2017 Stephen Groat # Copyright (c) 2017 Joe Orton +# Copyright (c) 2024 Tomas Korbar # Licensed under the MIT license: # # Permission is hereby granted, free of charge, to any person obtaining @@ -32,26 +33,24 @@ .PHONY: dist-hook # not inside conditional to avoid automake warning -if WITH_DOCBOOK +if WITH_MANPAGE dist_man_MANS = xmlwf.1 xmlwf.1: xmlwf.xml -rm -f $@ - $(DOCBOOK_TO_MAN) $< + test "x$(DOCBOOK_TO_MAN)" != x && $(DOCBOOK_TO_MAN) $< test -f $@ || mv XMLWF.1 $@ -else +endif + +if !WITH_DISTRIBUTABLE_MANPAGE dist-hook: @echo 'ERROR: Configure with --with-docbook for "make dist".' 1>&2 @false endif -# https://www.gnu.org/software/automake/manual/automake.html#What-Gets-Cleaned -.PHONY: clean-local -clean-local: clean-local-check - -.PHONY: clean-local-check -clean-local-check: - $(RM) xmlwf.1 +if !WITH_PREBUILT_MANPAGE +CLEANFILES = xmlwf.1 +endif EXTRA_DIST = \ ok.min.css \ diff --git a/contrib/expat/doc/Makefile.in b/contrib/expat/doc/Makefile.in index 18f86be3947b..72deb0565d94 100644 --- a/contrib/expat/doc/Makefile.in +++ b/contrib/expat/doc/Makefile.in @@ -22,9 +22,10 @@ # \___/_/\_\ .__/ \__,_|\__| # |_| XML parser # -# Copyright (c) 2017-2022 Sebastian Pipping +# Copyright (c) 2017-2024 Sebastian Pipping # Copyright (c) 2017 Stephen Groat # Copyright (c) 2017 Joe Orton +# Copyright (c) 2024 Tomas Korbar # Licensed under the MIT license: # # Permission is hereby granted, free of charge, to any person obtaining @@ -285,6 +286,7 @@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ +SIZEOF_VOID_P = @SIZEOF_VOID_P@ SO_MAJOR = @SO_MAJOR@ SO_MINOR = @SO_MINOR@ SO_PATCH = @SO_PATCH@ @@ -298,7 +300,6 @@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -ac_cv_sizeof_void_p = @ac_cv_sizeof_void_p@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -345,7 +346,8 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -@WITH_DOCBOOK_TRUE@dist_man_MANS = xmlwf.1 +@WITH_MANPAGE_TRUE@dist_man_MANS = xmlwf.1 +@WITH_PREBUILT_MANPAGE_FALSE@CLEANFILES = xmlwf.1 EXTRA_DIST = \ ok.min.css \ reference.html \ @@ -439,7 +441,7 @@ ctags CTAGS: cscope cscopelist: -@WITH_DOCBOOK_TRUE@dist-hook: +@WITH_DISTRIBUTABLE_MANPAGE_TRUE@dist-hook: distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am @@ -505,6 +507,7 @@ install-strip: mostlyclean-generic: clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) @@ -515,7 +518,7 @@ maintainer-clean-generic: @echo "it deletes files that may require special tools to rebuild." clean: clean-am -clean-am: clean-generic clean-libtool clean-local mostlyclean-am +clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile @@ -584,38 +587,31 @@ uninstall-man: uninstall-man1 .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ - clean-local cscopelist-am ctags-am dist-hook distclean \ - distclean-generic distclean-libtool distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-man1 install-pdf \ - install-pdf-am install-ps install-ps-am install-strip \ - installcheck installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ - uninstall-am uninstall-man uninstall-man1 + cscopelist-am ctags-am dist-hook distclean distclean-generic \ + distclean-libtool distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-man1 install-pdf install-pdf-am install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ + ps ps-am tags-am uninstall uninstall-am uninstall-man \ + uninstall-man1 .PRECIOUS: Makefile .PHONY: dist-hook # not inside conditional to avoid automake warning -@WITH_DOCBOOK_TRUE@xmlwf.1: xmlwf.xml -@WITH_DOCBOOK_TRUE@ -rm -f $@ -@WITH_DOCBOOK_TRUE@ $(DOCBOOK_TO_MAN) $< -@WITH_DOCBOOK_TRUE@ test -f $@ || mv XMLWF.1 $@ -@WITH_DOCBOOK_FALSE@dist-hook: -@WITH_DOCBOOK_FALSE@ @echo 'ERROR: Configure with --with-docbook for "make dist".' 1>&2 -@WITH_DOCBOOK_FALSE@ @false - -# https://www.gnu.org/software/automake/manual/automake.html#What-Gets-Cleaned -.PHONY: clean-local -clean-local: clean-local-check - -.PHONY: clean-local-check -clean-local-check: - $(RM) xmlwf.1 +@WITH_MANPAGE_TRUE@xmlwf.1: xmlwf.xml +@WITH_MANPAGE_TRUE@ -rm -f $@ +@WITH_MANPAGE_TRUE@ test "x$(DOCBOOK_TO_MAN)" != x && $(DOCBOOK_TO_MAN) $< +@WITH_MANPAGE_TRUE@ test -f $@ || mv XMLWF.1 $@ + +@WITH_DISTRIBUTABLE_MANPAGE_FALSE@dist-hook: +@WITH_DISTRIBUTABLE_MANPAGE_FALSE@ @echo 'ERROR: Configure with --with-docbook for "make dist".' 1>&2 +@WITH_DISTRIBUTABLE_MANPAGE_FALSE@ @false # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/contrib/expat/doc/reference.html b/contrib/expat/doc/reference.html index 898f03a3364d..4cfb2ce9384e 100644 --- a/contrib/expat/doc/reference.html +++ b/contrib/expat/doc/reference.html @@ -52,7 +52,7 @@

The Expat XML Parser - Release 2.6.0 + Release 2.6.3

@@ -319,7 +319,7 @@ directions in the next section. Otherwise if you have Microsoft's Developer Studio installed, you can use CMake to generate a .sln file, e.g. -cmake -G"Visual Studio 15 2017" -DCMAKE_BUILD_TYPE=RelWithDebInfo . +cmake -G"Visual Studio 16 2019" -DCMAKE_BUILD_TYPE=RelWithDebInfo . , and build Expat using msbuild /m expat.sln after.

Alternatively, you may download the Win32 binary package that @@ -356,10 +356,7 @@ library and header would get installed in

Configuring Expat Using the Pre-Processor

Expat's feature set can be configured using a small number of -pre-processor definitions. The definition of this symbols does not -affect the set of entry points for Expat, only the behavior of the API -and the definition of character types in the case of -XML_UNICODE_WCHAR_T. The symbols are:

+pre-processor definitions. The symbols are:

XML_GE
@@ -1138,7 +1135,9 @@ containing part (or perhaps all) of the document. The number of bytes of s that are part of the document is indicated by len. This means that s doesn't have to be null-terminated. It also means that if len is larger than the number of bytes in the block of -memory that s points at, then a memory fault is likely. The +memory that s points at, then a memory fault is likely. +Negative values for len are rejected since Expat 2.2.1. +The isFinal parameter informs the parser that this is the last piece of the document. Frequently, the last piece is empty (i.e. len is zero.) @@ -1186,11 +1185,17 @@ XML_ParseBuffer(XML_Parser p, int isFinal);
+

This is just like XML_Parse, except in this case Expat provides the buffer. By obtaining the buffer from Expat with the XML_GetBuffer function, the application can avoid double copying of the input. +

+ +

+Negative values for len are rejected since Expat 2.6.3. +

XML_GetBuffer

diff --git a/contrib/expat/doc/xmlwf.1 b/contrib/expat/doc/xmlwf.1 index ac5ce21e6b81..347c36f06109 100644 --- a/contrib/expat/doc/xmlwf.1 +++ b/contrib/expat/doc/xmlwf.1 @@ -5,7 +5,7 @@ \\$2 \(la\\$1\(ra\\$3 .. .if \n(.g .mso www.tmac -.TH XMLWF 1 "February 6, 2024" "" "" +.TH XMLWF 1 "September 4, 2024" "" "" .SH NAME xmlwf \- Determines if an XML document is well-formed .SH SYNOPSIS diff --git a/contrib/expat/doc/xmlwf.xml b/contrib/expat/doc/xmlwf.xml index 2b3f1ccd74a8..10b29782b197 100644 --- a/contrib/expat/doc/xmlwf.xml +++ b/contrib/expat/doc/xmlwf.xml @@ -21,7 +21,7 @@ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [ Scott"> Bronson"> - February 6, 2024"> + September 4, 2024"> 1"> bronson@rinspin.com"> diff --git a/contrib/expat/examples/Makefile.in b/contrib/expat/examples/Makefile.in index 0ccc020dd94f..044c9089c565 100644 --- a/contrib/expat/examples/Makefile.in +++ b/contrib/expat/examples/Makefile.in @@ -313,6 +313,7 @@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ +SIZEOF_VOID_P = @SIZEOF_VOID_P@ SO_MAJOR = @SO_MAJOR@ SO_MINOR = @SO_MINOR@ SO_PATCH = @SO_PATCH@ @@ -326,7 +327,6 @@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -ac_cv_sizeof_void_p = @ac_cv_sizeof_void_p@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ diff --git a/contrib/expat/expat_config.h.in b/contrib/expat/expat_config.h.in index 91c32340868e..67ef89c7171a 100644 --- a/contrib/expat/expat_config.h.in +++ b/contrib/expat/expat_config.h.in @@ -139,7 +139,4 @@ /* Define to `long int' if does not define. */ #undef off_t -/* Define to `unsigned int' if does not define. */ -#undef size_t - #endif // ndef EXPAT_CONFIG_H diff --git a/contrib/expat/fix-xmltest-log.sh b/contrib/expat/fix-xmltest-log.sh index 7981cf3b00c8..4739acab6b02 100755 --- a/contrib/expat/fix-xmltest-log.sh +++ b/contrib/expat/fix-xmltest-log.sh @@ -7,6 +7,7 @@ # |_| XML parser # # Copyright (c) 2019-2022 Sebastian Pipping +# Copyright (c) 2024 Dag-Erling Smørgrav # Licensed under the MIT license: # # Permission is hereby granted, free of charge, to any person obtaining @@ -32,10 +33,10 @@ set -e filename="${1:-tests/xmltest.log}" -dos2unix "${filename}" - -tempfile="$(mktemp)" -sed \ +sed -i.bak \ + -e '# convert DOS line endings to Unix without resorting to dos2unix' \ + -e $'s/\r//' \ + \ -e 's/^wine: Call .* msvcrt\.dll\._wperror, aborting$/ibm49i02.dtd: No such file or directory/' \ \ -e '/^wine: /d' \ @@ -46,5 +47,4 @@ sed \ -e '/^wine client error:/d' \ -e '/^In ibm\/invalid\/P49\/: Unhandled exception: unimplemented .\+/d' \ \ - "${filename}" > "${tempfile}" -mv "${tempfile}" "${filename}" + "${filename}" diff --git a/contrib/expat/lib/Makefile.am b/contrib/expat/lib/Makefile.am index 0e0185b59120..1958f322f319 100644 --- a/contrib/expat/lib/Makefile.am +++ b/contrib/expat/lib/Makefile.am @@ -6,7 +6,7 @@ # \___/_/\_\ .__/ \__,_|\__| # |_| XML parser # -# Copyright (c) 2017-2022 Sebastian Pipping +# Copyright (c) 2017-2024 Sebastian Pipping # Copyright (c) 2017 Tomasz Kłoczko # Copyright (c) 2019 David Loffredo # Licensed under the MIT license: @@ -36,7 +36,9 @@ include_HEADERS = \ expat_external.h lib_LTLIBRARIES = libexpat.la -noinst_LTLIBRARIES = libexpatinternal.la +if WITH_TESTS +noinst_LTLIBRARIES = libtestpat.la +endif libexpat_la_LDFLAGS = \ @AM_LDFLAGS@ \ @@ -44,17 +46,16 @@ libexpat_la_LDFLAGS = \ -no-undefined \ -version-info @LIBCURRENT@:@LIBREVISION@:@LIBAGE@ -libexpat_la_SOURCES = - -# This layer of indirection allows -# the test suite to access internal symbols -# despite compiling with -fvisibility=hidden -libexpatinternal_la_SOURCES = \ +libexpat_la_SOURCES = \ xmlparse.c \ xmltok.c \ xmlrole.c -libexpat_la_LIBADD = libexpatinternal.la +if WITH_TESTS +libtestpat_la_CPPFLAGS = -DXML_TESTING + +libtestpat_la_SOURCES = $(libexpat_la_SOURCES) +endif doc_DATA = \ ../AUTHORS \ diff --git a/contrib/expat/lib/Makefile.in b/contrib/expat/lib/Makefile.in index 29584d8bbe74..1a97e85fc41f 100644 --- a/contrib/expat/lib/Makefile.in +++ b/contrib/expat/lib/Makefile.in @@ -22,7 +22,7 @@ # \___/_/\_\ .__/ \__,_|\__| # |_| XML parser # -# Copyright (c) 2017-2022 Sebastian Pipping +# Copyright (c) 2017-2024 Sebastian Pipping # Copyright (c) 2017 Tomasz Kłoczko # Copyright (c) 2019 David Loffredo # Licensed under the MIT license: @@ -176,8 +176,8 @@ am__uninstall_files_from_dir = { \ am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(docdir)" \ "$(DESTDIR)$(includedir)" LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES) -libexpat_la_DEPENDENCIES = libexpatinternal.la -am_libexpat_la_OBJECTS = +libexpat_la_LIBADD = +am_libexpat_la_OBJECTS = xmlparse.lo xmltok.lo xmlrole.lo libexpat_la_OBJECTS = $(am_libexpat_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -186,9 +186,13 @@ am__v_lt_1 = libexpat_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libexpat_la_LDFLAGS) $(LDFLAGS) -o $@ -libexpatinternal_la_LIBADD = -am_libexpatinternal_la_OBJECTS = xmlparse.lo xmltok.lo xmlrole.lo -libexpatinternal_la_OBJECTS = $(am_libexpatinternal_la_OBJECTS) +libtestpat_la_LIBADD = +am__libtestpat_la_SOURCES_DIST = xmlparse.c xmltok.c xmlrole.c +am__objects_1 = libtestpat_la-xmlparse.lo libtestpat_la-xmltok.lo \ + libtestpat_la-xmlrole.lo +@WITH_TESTS_TRUE@am_libtestpat_la_OBJECTS = $(am__objects_1) +libtestpat_la_OBJECTS = $(am_libtestpat_la_OBJECTS) +@WITH_TESTS_TRUE@am_libtestpat_la_rpath = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false @@ -204,8 +208,10 @@ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/conftools/depcomp am__maybe_remake_depfiles = depfiles -am__depfiles_remade = ./$(DEPDIR)/xmlparse.Plo ./$(DEPDIR)/xmlrole.Plo \ - ./$(DEPDIR)/xmltok.Plo +am__depfiles_remade = ./$(DEPDIR)/libtestpat_la-xmlparse.Plo \ + ./$(DEPDIR)/libtestpat_la-xmlrole.Plo \ + ./$(DEPDIR)/libtestpat_la-xmltok.Plo ./$(DEPDIR)/xmlparse.Plo \ + ./$(DEPDIR)/xmlrole.Plo ./$(DEPDIR)/xmltok.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -225,8 +231,9 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = -SOURCES = $(libexpat_la_SOURCES) $(libexpatinternal_la_SOURCES) -DIST_SOURCES = $(libexpat_la_SOURCES) $(libexpatinternal_la_SOURCES) +SOURCES = $(libexpat_la_SOURCES) $(libtestpat_la_SOURCES) +DIST_SOURCES = $(libexpat_la_SOURCES) \ + $(am__libtestpat_la_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ @@ -344,6 +351,7 @@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ +SIZEOF_VOID_P = @SIZEOF_VOID_P@ SO_MAJOR = @SO_MAJOR@ SO_MINOR = @SO_MINOR@ SO_PATCH = @SO_PATCH@ @@ -357,7 +365,6 @@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -ac_cv_sizeof_void_p = @ac_cv_sizeof_void_p@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -410,24 +417,20 @@ include_HEADERS = \ expat_external.h lib_LTLIBRARIES = libexpat.la -noinst_LTLIBRARIES = libexpatinternal.la +@WITH_TESTS_TRUE@noinst_LTLIBRARIES = libtestpat.la libexpat_la_LDFLAGS = \ @AM_LDFLAGS@ \ @LIBM@ \ -no-undefined \ -version-info @LIBCURRENT@:@LIBREVISION@:@LIBAGE@ -libexpat_la_SOURCES = - -# This layer of indirection allows -# the test suite to access internal symbols -# despite compiling with -fvisibility=hidden -libexpatinternal_la_SOURCES = \ +libexpat_la_SOURCES = \ xmlparse.c \ xmltok.c \ xmlrole.c -libexpat_la_LIBADD = libexpatinternal.la +@WITH_TESTS_TRUE@libtestpat_la_CPPFLAGS = -DXML_TESTING +@WITH_TESTS_TRUE@libtestpat_la_SOURCES = $(libexpat_la_SOURCES) doc_DATA = \ ../AUTHORS \ ../Changes @@ -534,8 +537,8 @@ clean-noinstLTLIBRARIES: libexpat.la: $(libexpat_la_OBJECTS) $(libexpat_la_DEPENDENCIES) $(EXTRA_libexpat_la_DEPENDENCIES) $(AM_V_CCLD)$(libexpat_la_LINK) -rpath $(libdir) $(libexpat_la_OBJECTS) $(libexpat_la_LIBADD) $(LIBS) -libexpatinternal.la: $(libexpatinternal_la_OBJECTS) $(libexpatinternal_la_DEPENDENCIES) $(EXTRA_libexpatinternal_la_DEPENDENCIES) - $(AM_V_CCLD)$(LINK) $(libexpatinternal_la_OBJECTS) $(libexpatinternal_la_LIBADD) $(LIBS) +libtestpat.la: $(libtestpat_la_OBJECTS) $(libtestpat_la_DEPENDENCIES) $(EXTRA_libtestpat_la_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) $(am_libtestpat_la_rpath) $(libtestpat_la_OBJECTS) $(libtestpat_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -543,6 +546,9 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtestpat_la-xmlparse.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtestpat_la-xmlrole.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtestpat_la-xmltok.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmlparse.Plo@am__quote@ # am--include-marker *** 979 LINES SKIPPED *** From nobody Sun Dec 22 07:45: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 4YGCrH5cHHz5jDKq; Sun, 22 Dec 2024 07:45: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YGCrH2ZSHz4fDx; Sun, 22 Dec 2024 07:45:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734853551; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=onjoVz2dnQe7LLcKFvtqGk8N0VqlZNgTVXhgsRDVkcQ=; b=rENgdTu66DHzFQDRF9WJjtK/yb2GTQohIELy+HsXbCCqYsGdS5F9S8wO1kNwl1tg4Ixx6q CkjfIbR0SuWfxA15C0RGMst13N3l3ISQdBdYH6ZQ83HtG1AItQChMCYElX51CbXR3fClqD 47rn11oOXdlpuRtilzX2Y6f28lGhsnvOChYolTacXSXLJvUzjVDd4G2Pi2sI4ZZ8ctlqM+ rIHN5vcO839+XCHzJVF2y7ae9KXOa3sNVqjSLGOM88BfPkm4MfDhDLmxjYG0goUuKYw/F9 SFYUVcJ/zPImOcmAM2r5i/6F3PWEhVleSxjfbOr2Nxr7ELlmZiGy9vSdTEuD1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734853551; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=onjoVz2dnQe7LLcKFvtqGk8N0VqlZNgTVXhgsRDVkcQ=; b=fLp6vmWlQhtzkIQLd+aFJ4g1YwfG/NEtDQ/MadAQkijEXNHfUhuDZgg4pV0I+nwrP1HloH kBj1C6fSskJqr1dlg6newACrOMk9UlHXYjVdGGgjecz4S/+vh23wj7Kjgmb0IaCoauQd3i pi4NMw40hTt1xVkcrcVk8m6tOMHesagvUPTzWR9Wu4RH4axaHYUem0Ruac2O15ofej5+s6 dCcngDxxuiz9aRaVL0cnAwX8LkvGfeNULmLgRsJK+WzRzClIcZrAmYeK455gYVTnU8kr3Y GMqkAshpKV2+qlIhSpSjYhp78eYcXmn3mRUJ87IWIWmXCz0kiapBBVHs4kRvvg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734853551; a=rsa-sha256; cv=none; b=ij4Bmh/eDGNK72sC/Yj7pd4WB/Pw6PC9RTsKC24yRyfqJv6pxeCU1+8SfHEavHsxEN2U1p GqQOYWbg/FoHbK2InclgDBaD9oAqWFYRniS2V3Re2g0DXvNAaaYh22N/rgGJvutZlnbFKK l9fuHPgB8DMWnuOSmOiU6c1JOiZn8zSypiMTAgBuKXHLlNsh2ihbZ/K4dGMUmUQUIkE/AV XG1UXFEnGdYo4DVFwUMFRUNskHozPIH5Z6u7yfFI71dVM6PlpZg56utWRtll1BDf9hlDdg kDVC8XOeC5OwS2l5sK6A6AVBleR0cVCmP/RU1twH2tWYTZCQai8PPYjnSdsTew== 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 4YGCrH0S3tz10l0; Sun, 22 Dec 2024 07:45:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BM7joGq021468; Sun, 22 Dec 2024 07:45:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BM7joa9021465; Sun, 22 Dec 2024 07:45:50 GMT (envelope-from git) Date: Sun, 22 Dec 2024 07:45:50 GMT Message-Id: <202412220745.4BM7joa9021465@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Xin LI Subject: git: 8c7e4d11fef6 - stable/14 - MFC: Update the expat version referenced in libbsdxml.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: delphij X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8c7e4d11fef6ba9d5fc26571f72b8d877b0c1efb Auto-Submitted: auto-generated The branch stable/14 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=8c7e4d11fef6ba9d5fc26571f72b8d877b0c1efb commit 8c7e4d11fef6ba9d5fc26571f72b8d877b0c1efb Author: Enji Cooper AuthorDate: 2024-10-02 02:26:37 +0000 Commit: Xin LI CommitDate: 2024-12-22 07:43:59 +0000 MFC: Update the expat version referenced in libbsdxml.3 This change updates the version of expat referenced from 2.6.0 to 2.6.3, correcting documentation post-ffd294a1f4c23863c3e515d16dce31d5509bcb01. Bump .Dd for the change. MFC with: ffd294a1f4c23863c3e515d16dce31d5509bcb01 Differential Revision: https://reviews.freebsd.org/D46865 (cherry picked from commit ba23ab2168ffabc2c5e647a1a37ab9a8fb482bb8) --- lib/libexpat/libbsdxml.3 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libexpat/libbsdxml.3 b/lib/libexpat/libbsdxml.3 index c6c2518ea41a..2ec1f71b58bb 100644 --- a/lib/libexpat/libbsdxml.3 +++ b/lib/libexpat/libbsdxml.3 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\"/ -.Dd February 17, 2024 +.Dd October 1, 2024 .Dt LIBBSDXML 3 .Os .Sh NAME @@ -34,7 +34,7 @@ .Sh DESCRIPTION The .Nm -library is a verbatim copy of the eXpat XML library version 2.6.0. +library is a verbatim copy of the eXpat XML library version 2.6.3. .Pp The .Nm From nobody Sun Dec 22 07:45:52 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 4YGCrK0l4tz5jD1G; Sun, 22 Dec 2024 07:45:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YGCrJ28zHz4f8H; Sun, 22 Dec 2024 07:45:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734853552; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=agQIPpxgVnn4i8z/aksyxidG5uEGY5nGEFRishvKTAg=; b=efMXpiIrlTvlY75fY/EkmUP/46oyPFxuxKNqpw3lFad/UtssYQwcKGSIH1sZoASTKKWQdE 7lG29ugP5ZkaS6NR9E1Tfp3l/+3eq5ZU0Kd5bgfkXzDFu+e89a65t4xmFhJG6FBei6TS4t Z1koAHNQajiUROJ09S0uFOz5RgsvkhjhX7UaNKkOs9ViRexZ0y8u6+n3q+9OAC6aWd6Z5a xZ9ep56wJiUPuU0gY4r+xllrwrpYQxITxE8kOqB1YlvJad9hC9/7JDE4gPh7B7VoVQSPiM NuiZFDp7+R0alo0yPt1Enl3LyKJs8N/JjBNi/IEXhebz68pTeZELrjSVkpVNXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734853552; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=agQIPpxgVnn4i8z/aksyxidG5uEGY5nGEFRishvKTAg=; b=vCux5iKw9yWuyKlA8vUljr/Oud72sqfBuP2SqzY71sDANXv/XNH5ry2dNEa6y0hmqr9mcA xlUZy1HEjxZ5PhBZwtW7eDHgPVj3E4M4i2qpu6699hZyW+Oiv47/SrWYNY6XiX3mGme1lX TOAyEHqgcmnr/SsR2IW2DGFbP2LWiuRh9Kf8dJPm6m8Tpu1J7WSrMbZ5Sl2H+QRKQZ3mRS 9NCljn2+famhc63opB3UCZb/yoQQWczLYekuBEBlhk4RU28lnO1EdGv6392hU6Yqd6xSpy ohlYacKgIGTxM3PPz9g6JdltgOAtfkA+0inZs6XtjoJRRblI7aAHYcKEVQ6rzQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734853552; a=rsa-sha256; cv=none; b=K20BR92dthIAluF9L7IC58WeQjtTIInoiPR4Ep3jHvSV2b6xl1zAGZMbiIgWVZ/UWuSyZ3 iyn2enmyvLgjo0RlPdBubJH6A3YUaLmBCTmU6jK7GPyQdivORnLR5qwlUqp2tw820WDOOG aeH5ehe9si8hYeUpWZstbnxM/J+IwQPOKk8/orgPbSXD7gLrrYAMoRKVpDNFZLyv/q90fV Sv25YfADQhlgMKspHnzG14y5GYJu/vv5N0V7Sx6So0PV/KAVN2S8JJOOLTWYpoNQBW1Pjv BE5fHI5xoZATzrlXHwqoBhMEoA3SzqhaFZinGPZ0kz8Jh3uQsRdFxtjhNHBZgw== 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 4YGCrJ1Kr9z10XF; Sun, 22 Dec 2024 07:45:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BM7jqWu021518; Sun, 22 Dec 2024 07:45:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BM7jqkn021515; Sun, 22 Dec 2024 07:45:52 GMT (envelope-from git) Date: Sun, 22 Dec 2024 07:45:52 GMT Message-Id: <202412220745.4BM7jqkn021515@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Xin LI Subject: git: 78ab4c182b9f - stable/14 - MFC: MFV: expat 2.6.4. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: 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: delphij X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 78ab4c182b9faa09688a040b252ba111952e5e17 Auto-Submitted: auto-generated The branch stable/14 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=78ab4c182b9faa09688a040b252ba111952e5e17 commit 78ab4c182b9faa09688a040b252ba111952e5e17 Author: Xin LI AuthorDate: 2024-12-09 04:24:16 +0000 Commit: Xin LI CommitDate: 2024-12-22 07:45:34 +0000 MFC: MFV: expat 2.6.4. (cherry picked from commit 908f215e80fa482aa953c39afa6bb516f561fc00) --- contrib/expat/Changes | 31 ++++++++++++++++++ contrib/expat/README.md | 47 ++++++++++++++++++++++++--- contrib/expat/configure.ac | 6 ++-- contrib/expat/doc/reference.html | 2 +- contrib/expat/doc/xmlwf.1 | 2 +- contrib/expat/doc/xmlwf.xml | 2 +- contrib/expat/examples/element_declarations.c | 9 ++--- contrib/expat/lib/expat.h | 6 ++-- contrib/expat/lib/xmlparse.c | 18 +++++++--- contrib/expat/tests/basic_tests.c | 17 +++++++--- contrib/expat/tests/common.c | 33 ++----------------- contrib/expat/tests/common.h | 11 +------ contrib/expat/tests/handlers.c | 42 +++++++++++++++++++----- contrib/expat/tests/handlers.h | 17 ++++++++-- contrib/expat/tests/misc_tests.c | 39 ++++++++++++++++++---- contrib/expat/xmlwf/xmlfile.c | 4 ++- lib/libexpat/Makefile | 1 - lib/libexpat/expat_config.h | 9 ++--- lib/libexpat/libbsdxml.3 | 4 +-- 19 files changed, 206 insertions(+), 94 deletions(-) diff --git a/contrib/expat/Changes b/contrib/expat/Changes index c1d22efa5a3c..aa19f70ae219 100644 --- a/contrib/expat/Changes +++ b/contrib/expat/Changes @@ -30,6 +30,37 @@ !! THANK YOU! Sebastian Pipping -- Berlin, 2024-03-09 !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +Release 2.6.4 Wed November 6 2024 + Security fixes: + #915 CVE-2024-50602 -- Fix crash within function XML_ResumeParser + from a NULL pointer dereference by disallowing function + XML_StopParser to (stop or) suspend an unstarted parser. + A new error code XML_ERROR_NOT_STARTED was introduced to + properly communicate this situation. // CWE-476 CWE-754 + + Other changes: + #903 CMake: Add alias target "expat::expat" + #905 docs: Document use via CMake >=3.18 with FetchContent + and SOURCE_SUBDIR and its consequences + #902 tests: Reduce use of global parser instance + #904 tests: Resolve duplicate handler + #317 #918 tests: Improve tests on doctype closing (ex CVE-2019-15903) + #914 Fix signedness of format strings + #919 #920 Version info bumped from 10:3:9 (libexpat*.so.1.9.3) + to 11:0:10 (libexpat*.so.1.10.0); see https://verbump.de/ + for what these numbers do + + Infrastructure: + #907 CI: Upgrade Clang from 18 to 19 + #913 CI: Drop macos-12 and add macos-15 + #910 CI: Adapt to breaking changes in GitHub Actions + #898 Add missing entries to .gitignore + + Special thanks to: + Hanno Böck + José Eduardo Gutiérrez Conejo + José Ricardo Cardona Quesada + Release 2.6.3 Wed September 4 2024 Security fixes: #887 #890 CVE-2024-45490 -- Calling function XML_ParseBuffer with diff --git a/contrib/expat/README.md b/contrib/expat/README.md index 180a68e4abbe..23d26dad2b92 100644 --- a/contrib/expat/README.md +++ b/contrib/expat/README.md @@ -11,7 +11,7 @@ > at the top of the `Changes` file. -# Expat, Release 2.6.3 +# Expat, Release 2.6.4 This is Expat, a C99 library for parsing [XML 1.0 Fourth Edition](https://www.w3.org/TR/2006/REC-xml-20060816/), started by @@ -43,9 +43,9 @@ This license is the same as the MIT/X Consortium license. ## Using libexpat in your CMake-Based Project -There are two ways of using libexpat with CMake: +There are three documented ways of using libexpat with CMake: -### a) Module Mode +### a) `find_package` with Module Mode This approach leverages CMake's own [module `FindEXPAT`](https://cmake.org/cmake/help/latest/module/FindEXPAT.html). @@ -70,7 +70,7 @@ target_include_directories(hello PRIVATE ${EXPAT_INCLUDE_DIRS}) target_link_libraries(hello PUBLIC ${EXPAT_LIBRARIES}) ``` -### b) Config Mode +### b) `find_package` with Config Mode This approach requires files from… @@ -98,6 +98,45 @@ add_executable(hello target_link_libraries(hello PUBLIC expat::expat) ``` +### c) The `FetchContent` module + +This approach — as demonstrated below — requires CMake >=3.18 for both the +[`FetchContent` module](https://cmake.org/cmake/help/latest/module/FetchContent.html) +and its support for the `SOURCE_SUBDIR` option to be available. + +Please note that: +- Use of the `FetchContent` module with *non-release* SHA1s or `master` + of libexpat is neither advised nor considered officially supported. +- Pinning to a specific commit is great for robust CI. +- Pinning to a specific commit needs updating every time there is a new + release of libexpat — either manually or through automation —, + to not miss out on libexpat security updates. + +For an example that pulls in libexpat via Git: + +```cmake +cmake_minimum_required(VERSION 3.18) + +include(FetchContent) + +project(hello VERSION 1.0.0) + +FetchContent_Declare( + expat + GIT_REPOSITORY https://github.com/libexpat/libexpat/ + GIT_TAG 000000000_GIT_COMMIT_SHA1_HERE_000000000 # i.e. Git tag R_0_Y_Z + SOURCE_SUBDIR expat/ +) + +FetchContent_MakeAvailable(expat) + +add_executable(hello + hello.c +) + +target_link_libraries(hello PUBLIC expat) +``` + ## Building from a Git Clone diff --git a/contrib/expat/configure.ac b/contrib/expat/configure.ac index 1a930413ffe5..fffcd125e9c4 100644 --- a/contrib/expat/configure.ac +++ b/contrib/expat/configure.ac @@ -84,9 +84,9 @@ dnl dnl If the API changes incompatibly set LIBAGE back to 0 dnl -LIBCURRENT=10 # sync -LIBREVISION=3 # with -LIBAGE=9 # CMakeLists.txt! +LIBCURRENT=11 # sync +LIBREVISION=0 # with +LIBAGE=10 # CMakeLists.txt! AC_CONFIG_HEADERS([expat_config.h]) AH_TOP([#ifndef EXPAT_CONFIG_H diff --git a/contrib/expat/doc/reference.html b/contrib/expat/doc/reference.html index 4cfb2ce9384e..c2ae9bb71431 100644 --- a/contrib/expat/doc/reference.html +++ b/contrib/expat/doc/reference.html @@ -52,7 +52,7 @@

The Expat XML Parser - Release 2.6.3 + Release 2.6.4

diff --git a/contrib/expat/doc/xmlwf.1 b/contrib/expat/doc/xmlwf.1 index 347c36f06109..61b302581ce9 100644 --- a/contrib/expat/doc/xmlwf.1 +++ b/contrib/expat/doc/xmlwf.1 @@ -5,7 +5,7 @@ \\$2 \(la\\$1\(ra\\$3 .. .if \n(.g .mso www.tmac -.TH XMLWF 1 "September 4, 2024" "" "" +.TH XMLWF 1 "November 6, 2024" "" "" .SH NAME xmlwf \- Determines if an XML document is well-formed .SH SYNOPSIS diff --git a/contrib/expat/doc/xmlwf.xml b/contrib/expat/doc/xmlwf.xml index 10b29782b197..cf6d984af463 100644 --- a/contrib/expat/doc/xmlwf.xml +++ b/contrib/expat/doc/xmlwf.xml @@ -21,7 +21,7 @@ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [ Scott"> Bronson"> - September 4, 2024"> + November 6, 2024"> 1"> bronson@rinspin.com"> diff --git a/contrib/expat/examples/element_declarations.c b/contrib/expat/examples/element_declarations.c index 7ce8544f6f04..d644b2ffa5ea 100644 --- a/contrib/expat/examples/element_declarations.c +++ b/contrib/expat/examples/element_declarations.c @@ -15,6 +15,7 @@ Copyright (c) 2016-2024 Sebastian Pipping Copyright (c) 2017 Rhodri James Copyright (c) 2019 Zhongyuan Zhou + Copyright (c) 2024 Hanno Böck Licensed under the MIT license: Permission is hereby granted, free of charge, to any person obtaining @@ -127,15 +128,15 @@ dumpContentModelElement(const XML_Content *model, unsigned level, } // Node - printf("[%u] type=%s(%d), quant=%s(%d)", (unsigned)(model - root), - contentTypeName(model->type), model->type, - contentQuantName(model->quant), model->quant); + printf("[%u] type=%s(%u), quant=%s(%u)", (unsigned)(model - root), + contentTypeName(model->type), (unsigned int)model->type, + contentQuantName(model->quant), (unsigned int)model->quant); if (model->name) { printf(", name=\"%" XML_FMT_STR "\"", model->name); } else { printf(", name=NULL"); } - printf(", numchildren=%d", model->numchildren); + printf(", numchildren=%u", model->numchildren); printf("\n"); } diff --git a/contrib/expat/lib/expat.h b/contrib/expat/lib/expat.h index d0d6015a6628..523b37d8d578 100644 --- a/contrib/expat/lib/expat.h +++ b/contrib/expat/lib/expat.h @@ -130,7 +130,9 @@ enum XML_Error { /* Added in 2.3.0. */ XML_ERROR_NO_BUFFER, /* Added in 2.4.0. */ - XML_ERROR_AMPLIFICATION_LIMIT_BREACH + XML_ERROR_AMPLIFICATION_LIMIT_BREACH, + /* Added in 2.6.4. */ + XML_ERROR_NOT_STARTED, }; enum XML_Content_Type { @@ -1066,7 +1068,7 @@ XML_SetReparseDeferralEnabled(XML_Parser parser, XML_Bool enabled); */ #define XML_MAJOR_VERSION 2 #define XML_MINOR_VERSION 6 -#define XML_MICRO_VERSION 3 +#define XML_MICRO_VERSION 4 #ifdef __cplusplus } diff --git a/contrib/expat/lib/xmlparse.c b/contrib/expat/lib/xmlparse.c index d9285b213b38..a4e091e7c33c 100644 --- a/contrib/expat/lib/xmlparse.c +++ b/contrib/expat/lib/xmlparse.c @@ -1,4 +1,4 @@ -/* ba4cdf9bdb534f355a9def4c9e25d20ee8e72f95b0a4d930be52e563f5080196 (2.6.3+) +/* c5625880f4bf417c1463deee4eb92d86ff413f802048621c57e25fe483eb59e4 (2.6.4+) __ __ _ ___\ \/ /_ __ __ _| |_ / _ \\ /| '_ \ / _` | __| @@ -40,6 +40,7 @@ Copyright (c) 2023 Owain Davies Copyright (c) 2023-2024 Sony Corporation / Snild Dolkow Copyright (c) 2024 Berkay Eren Ürün + Copyright (c) 2024 Hanno Böck Licensed under the MIT license: Permission is hereby granted, free of charge, to any person obtaining @@ -2234,6 +2235,9 @@ XML_StopParser(XML_Parser parser, XML_Bool resumable) { if (parser == NULL) return XML_STATUS_ERROR; switch (parser->m_parsingStatus.parsing) { + case XML_INITIALIZED: + parser->m_errorCode = XML_ERROR_NOT_STARTED; + return XML_STATUS_ERROR; case XML_SUSPENDED: if (resumable) { parser->m_errorCode = XML_ERROR_SUSPENDED; @@ -2244,7 +2248,7 @@ XML_StopParser(XML_Parser parser, XML_Bool resumable) { case XML_FINISHED: parser->m_errorCode = XML_ERROR_FINISHED; return XML_STATUS_ERROR; - default: + case XML_PARSING: if (resumable) { #ifdef XML_DTD if (parser->m_isParamEntity) { @@ -2255,6 +2259,9 @@ XML_StopParser(XML_Parser parser, XML_Bool resumable) { parser->m_parsingStatus.parsing = XML_SUSPENDED; } else parser->m_parsingStatus.parsing = XML_FINISHED; + break; + default: + assert(0); } return XML_STATUS_OK; } @@ -2519,6 +2526,9 @@ XML_ErrorString(enum XML_Error code) { case XML_ERROR_AMPLIFICATION_LIMIT_BREACH: return XML_L( "limit on input amplification factor (from DTD and entities) breached"); + /* Added in 2.6.4. */ + case XML_ERROR_NOT_STARTED: + return XML_L("parser not started"); } return NULL; } @@ -7856,7 +7866,7 @@ accountingReportDiff(XML_Parser rootParser, assert(! rootParser->m_parentParser); fprintf(stderr, - " (+" EXPAT_FMT_PTRDIFF_T("6") " bytes %s|%d, xmlparse.c:%d) %*s\"", + " (+" EXPAT_FMT_PTRDIFF_T("6") " bytes %s|%u, xmlparse.c:%d) %*s\"", bytesMore, (account == XML_ACCOUNT_DIRECT) ? "DIR" : "EXP", levelsAwayFromRootParser, source_line, 10, ""); @@ -7969,7 +7979,7 @@ entityTrackingReportStats(XML_Parser rootParser, ENTITY *entity, fprintf( stderr, - "expat: Entities(%p): Count %9d, depth %2d/%2d %*s%s%s; %s length %d (xmlparse.c:%d)\n", + "expat: Entities(%p): Count %9u, depth %2u/%2u %*s%s%s; %s length %d (xmlparse.c:%d)\n", (void *)rootParser, rootParser->m_entity_stats.countEverOpened, rootParser->m_entity_stats.currentDepth, rootParser->m_entity_stats.maximumDepthSeen, diff --git a/contrib/expat/tests/basic_tests.c b/contrib/expat/tests/basic_tests.c index 0d97b1090c7f..d38b8fd18416 100644 --- a/contrib/expat/tests/basic_tests.c +++ b/contrib/expat/tests/basic_tests.c @@ -2357,11 +2357,20 @@ START_TEST(test_attributes) { info[0].attributes = doc_info; info[1].attributes = tag_info; - XML_SetStartElementHandler(g_parser, counting_start_element_handler); - XML_SetUserData(g_parser, info); - if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE) + XML_Parser parser = XML_ParserCreate(NULL); + assert_true(parser != NULL); + ParserAndElementInfo parserAndElementInfos = { + parser, + info, + }; + + XML_SetStartElementHandler(parser, counting_start_element_handler); + XML_SetUserData(parser, &parserAndElementInfos); + if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text), XML_TRUE) == XML_STATUS_ERROR) - xml_failure(g_parser); + xml_failure(parser); + + XML_ParserFree(parser); } END_TEST diff --git a/contrib/expat/tests/common.c b/contrib/expat/tests/common.c index 26d0c5473a63..3aea8d74d1ee 100644 --- a/contrib/expat/tests/common.c +++ b/contrib/expat/tests/common.c @@ -10,7 +10,7 @@ Copyright (c) 2003 Greg Stein Copyright (c) 2005-2007 Steven Solie Copyright (c) 2005-2012 Karl Waclawek - Copyright (c) 2016-2023 Sebastian Pipping + Copyright (c) 2016-2024 Sebastian Pipping Copyright (c) 2017-2022 Rhodri James Copyright (c) 2017 Joe Orton Copyright (c) 2017 José Gutiérrez de la Concha @@ -51,6 +51,7 @@ #include "chardata.h" #include "minicheck.h" #include "common.h" +#include "handlers.h" /* Common test data */ @@ -221,30 +222,6 @@ _expect_failure(const char *text, enum XML_Error errorCode, _xml_failure(g_parser, file, lineno); } -/* Character data support for handlers, built on top of the code in - * chardata.c - */ -void XMLCALL -accumulate_characters(void *userData, const XML_Char *s, int len) { - CharData_AppendXMLChars((CharData *)userData, s, len); -} - -void XMLCALL -accumulate_attribute(void *userData, const XML_Char *name, - const XML_Char **atts) { - CharData *storage = (CharData *)userData; - UNUSED_P(name); - /* Check there are attributes to deal with */ - if (atts == NULL) - return; - - while (storage->count < 0 && atts[0] != NULL) { - /* "accumulate" the value of the first attribute we see */ - CharData_AppendXMLChars(storage, atts[1], -1); - atts += 2; - } -} - void _run_character_check(const char *text, const XML_Char *expected, const char *file, int line) { @@ -273,12 +250,6 @@ _run_attribute_check(const char *text, const XML_Char *expected, CharData_CheckXMLChars(&storage, expected); } -void XMLCALL -ext_accumulate_characters(void *userData, const XML_Char *s, int len) { - ExtTest *test_data = (ExtTest *)userData; - accumulate_characters(test_data->storage, s, len); -} - void _run_ext_character_check(const char *text, ExtTest *test_data, const XML_Char *expected, const char *file, int line) { diff --git a/contrib/expat/tests/common.h b/contrib/expat/tests/common.h index 52f00cc0eeb0..bc4c7da68071 100644 --- a/contrib/expat/tests/common.h +++ b/contrib/expat/tests/common.h @@ -10,7 +10,7 @@ Copyright (c) 2003 Greg Stein Copyright (c) 2005-2007 Steven Solie Copyright (c) 2005-2012 Karl Waclawek - Copyright (c) 2016-2023 Sebastian Pipping + Copyright (c) 2016-2024 Sebastian Pipping Copyright (c) 2017-2022 Rhodri James Copyright (c) 2017 Joe Orton Copyright (c) 2017 José Gutiérrez de la Concha @@ -111,12 +111,6 @@ extern void _expect_failure(const char *text, enum XML_Error errorCode, /* Support functions for handlers to collect up character and attribute data. */ -extern void XMLCALL accumulate_characters(void *userData, const XML_Char *s, - int len); - -extern void XMLCALL accumulate_attribute(void *userData, const XML_Char *name, - const XML_Char **atts); - extern void _run_character_check(const char *text, const XML_Char *expected, const char *file, int line); @@ -135,9 +129,6 @@ typedef struct ExtTest { CharData *storage; } ExtTest; -extern void XMLCALL ext_accumulate_characters(void *userData, const XML_Char *s, - int len); - extern void _run_ext_character_check(const char *text, ExtTest *test_data, const XML_Char *expected, const char *file, int line); diff --git a/contrib/expat/tests/handlers.c b/contrib/expat/tests/handlers.c index 449ada70f9a2..0211985fe95c 100644 --- a/contrib/expat/tests/handlers.c +++ b/contrib/expat/tests/handlers.c @@ -103,7 +103,9 @@ end_element_event_handler2(void *userData, const XML_Char *name) { void XMLCALL counting_start_element_handler(void *userData, const XML_Char *name, const XML_Char **atts) { - ElementInfo *info = (ElementInfo *)userData; + ParserAndElementInfo *const parserAndElementInfos + = (ParserAndElementInfo *)userData; + ElementInfo *info = parserAndElementInfos->info; AttrInfo *attr; int count, id, i; @@ -120,12 +122,12 @@ counting_start_element_handler(void *userData, const XML_Char *name, * is possibly a little unexpected, but it is what the * documentation in expat.h tells us to expect. */ - count = XML_GetSpecifiedAttributeCount(g_parser); + count = XML_GetSpecifiedAttributeCount(parserAndElementInfos->parser); if (info->attr_count * 2 != count) { fail("Not got expected attribute count"); return; } - id = XML_GetIdAttributeIndex(g_parser); + id = XML_GetIdAttributeIndex(parserAndElementInfos->parser); if (id == -1 && info->id_name != NULL) { fail("ID not present"); return; @@ -1880,12 +1882,6 @@ accumulate_entity_decl(void *userData, const XML_Char *entityName, CharData_AppendXMLChars(storage, XCS("\n"), 1); } -void XMLCALL -accumulate_char_data(void *userData, const XML_Char *s, int len) { - CharData *const storage = (CharData *)userData; - CharData_AppendXMLChars(storage, s, len); -} - void XMLCALL accumulate_start_element(void *userData, const XML_Char *name, const XML_Char **atts) { @@ -1910,6 +1906,34 @@ accumulate_start_element(void *userData, const XML_Char *name, CharData_AppendXMLChars(storage, XCS(")\n"), 2); } +void XMLCALL +accumulate_characters(void *userData, const XML_Char *s, int len) { + CharData *const storage = (CharData *)userData; + CharData_AppendXMLChars(storage, s, len); +} + +void XMLCALL +accumulate_attribute(void *userData, const XML_Char *name, + const XML_Char **atts) { + CharData *const storage = (CharData *)userData; + UNUSED_P(name); + /* Check there are attributes to deal with */ + if (atts == NULL) + return; + + while (storage->count < 0 && atts[0] != NULL) { + /* "accumulate" the value of the first attribute we see */ + CharData_AppendXMLChars(storage, atts[1], -1); + atts += 2; + } +} + +void XMLCALL +ext_accumulate_characters(void *userData, const XML_Char *s, int len) { + ExtTest *const test_data = (ExtTest *)userData; + accumulate_characters(test_data->storage, s, len); +} + void XMLCALL checking_default_handler(void *userData, const XML_Char *s, int len) { DefaultCheck *data = (DefaultCheck *)userData; diff --git a/contrib/expat/tests/handlers.h b/contrib/expat/tests/handlers.h index e1f0995f79e6..8850bb948da3 100644 --- a/contrib/expat/tests/handlers.h +++ b/contrib/expat/tests/handlers.h @@ -92,6 +92,11 @@ typedef struct elementInfo { AttrInfo *attributes; } ElementInfo; +typedef struct StructParserAndElementInfo { + XML_Parser parser; + ElementInfo *info; +} ParserAndElementInfo; + extern void XMLCALL counting_start_element_handler(void *userData, const XML_Char *name, const XML_Char **atts); @@ -564,13 +569,19 @@ extern void XMLCALL accumulate_entity_decl( const XML_Char *systemId, const XML_Char *publicId, const XML_Char *notationName); -extern void XMLCALL accumulate_char_data(void *userData, const XML_Char *s, - int len); - extern void XMLCALL accumulate_start_element(void *userData, const XML_Char *name, const XML_Char **atts); +extern void XMLCALL accumulate_characters(void *userData, const XML_Char *s, + int len); + +extern void XMLCALL accumulate_attribute(void *userData, const XML_Char *name, + const XML_Char **atts); + +extern void XMLCALL ext_accumulate_characters(void *userData, const XML_Char *s, + int len); + typedef struct default_check { const XML_Char *expected; const int expectedLen; diff --git a/contrib/expat/tests/misc_tests.c b/contrib/expat/tests/misc_tests.c index 2ee9320b1392..9afe0922d6b2 100644 --- a/contrib/expat/tests/misc_tests.c +++ b/contrib/expat/tests/misc_tests.c @@ -208,7 +208,7 @@ START_TEST(test_misc_version) { if (! versions_equal(&read_version, &parsed_version)) fail("Version mismatch"); - if (xcstrcmp(version_text, XCS("expat_2.6.3"))) /* needs bump on releases */ + if (xcstrcmp(version_text, XCS("expat_2.6.4"))) /* needs bump on releases */ fail("XML_*_VERSION in expat.h out of sync?\n"); } END_TEST @@ -332,14 +332,15 @@ START_TEST(test_misc_deny_internal_entity_closing_doctype_issue_317) { "'>\n" "\n" "%e;"; - const char *const inputTwo = "'>\n" - "\n" - "%e2;"; + const char *const inputTwo + = "'>\n" + "\n" + "%e2;"; const char *const inputThree = "\n" "\n" - "%e;"; + "%e;/>"; const char *const inputIssue317 = "\n" "Hell'>\n" @@ -447,7 +448,7 @@ START_TEST(test_misc_general_entities_support) { XML_SetExternalEntityRefHandler(parser, external_entity_failer__if_not_xml_ge); XML_SetEntityDeclHandler(parser, accumulate_entity_decl); - XML_SetCharacterDataHandler(parser, accumulate_char_data); + XML_SetCharacterDataHandler(parser, accumulate_characters); if (_XML_Parse_SINGLE_BYTES(parser, doc, (int)strlen(doc), XML_TRUE) != XML_STATUS_OK) { @@ -496,6 +497,28 @@ START_TEST(test_misc_char_handler_stop_without_leak) { } END_TEST +START_TEST(test_misc_resumeparser_not_crashing) { + XML_Parser parser = XML_ParserCreate(NULL); + XML_GetBuffer(parser, 1); + XML_StopParser(parser, /*resumable=*/XML_TRUE); + XML_ResumeParser(parser); // could crash here, previously + XML_ParserFree(parser); +} +END_TEST + +START_TEST(test_misc_stopparser_rejects_unstarted_parser) { + const XML_Bool cases[] = {XML_TRUE, XML_FALSE}; + for (size_t i = 0; i < sizeof(cases) / sizeof(cases[0]); i++) { + const XML_Bool resumable = cases[i]; + XML_Parser parser = XML_ParserCreate(NULL); + assert_true(XML_GetErrorCode(parser) == XML_ERROR_NONE); + assert_true(XML_StopParser(parser, resumable) == XML_STATUS_ERROR); + assert_true(XML_GetErrorCode(parser) == XML_ERROR_NOT_STARTED); + XML_ParserFree(parser); + } +} +END_TEST + void make_miscellaneous_test_case(Suite *s) { TCase *tc_misc = tcase_create("miscellaneous tests"); @@ -520,4 +543,6 @@ make_miscellaneous_test_case(Suite *s) { test_misc_create_external_entity_parser_with_null_context); tcase_add_test(tc_misc, test_misc_general_entities_support); tcase_add_test(tc_misc, test_misc_char_handler_stop_without_leak); + tcase_add_test(tc_misc, test_misc_resumeparser_not_crashing); + tcase_add_test(tc_misc, test_misc_stopparser_rejects_unstarted_parser); } diff --git a/contrib/expat/xmlwf/xmlfile.c b/contrib/expat/xmlwf/xmlfile.c index 0598b86b5fb7..9c4f7f8dbadd 100644 --- a/contrib/expat/xmlwf/xmlfile.c +++ b/contrib/expat/xmlwf/xmlfile.c @@ -15,6 +15,7 @@ Copyright (c) 2017 Rhodri James Copyright (c) 2019 David Loffredo Copyright (c) 2021 Donghee Na + Copyright (c) 2024 Hanno Böck Licensed under the MIT license: Permission is hereby granted, free of charge, to any person obtaining @@ -91,7 +92,8 @@ reportError(XML_Parser parser, const XML_Char *filename) { filename, XML_GetErrorLineNumber(parser), XML_GetErrorColumnNumber(parser), message); else - ftprintf(stderr, T("%s: (unknown message %d)\n"), filename, code); + ftprintf(stderr, T("%s: (unknown message %u)\n"), filename, + (unsigned int)code); } /* This implementation will give problems on files larger than INT_MAX. */ diff --git a/lib/libexpat/Makefile b/lib/libexpat/Makefile index 08c8604e74c5..92ba6b671488 100644 --- a/lib/libexpat/Makefile +++ b/lib/libexpat/Makefile @@ -1,4 +1,3 @@ - PACKAGE= runtime EXPAT= ${SRCTOP}/contrib/expat diff --git a/lib/libexpat/expat_config.h b/lib/libexpat/expat_config.h index 0d581a431a53..2bb52a4baa03 100644 --- a/lib/libexpat/expat_config.h +++ b/lib/libexpat/expat_config.h @@ -89,7 +89,7 @@ #define PACKAGE_NAME "expat" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "expat 2.6.0" +#define PACKAGE_STRING "expat 2.6.4" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "expat" @@ -98,7 +98,7 @@ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "2.6.0" +#define PACKAGE_VERSION "2.6.4" /* Define to 1 if all of the C90 standard headers exist (not just the ones required in a freestanding environment). This macro is provided for @@ -106,7 +106,7 @@ #define STDC_HEADERS 1 /* Version number of package */ -#define VERSION "2.6.0" +#define VERSION "2.6.4" /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ @@ -146,7 +146,4 @@ /* Define to `long int' if does not define. */ /* #undef off_t */ -/* Define to `unsigned int' if does not define. */ -/* #undef size_t */ - #endif // ndef EXPAT_CONFIG_H diff --git a/lib/libexpat/libbsdxml.3 b/lib/libexpat/libbsdxml.3 index 2ec1f71b58bb..21c07d39e5e2 100644 --- a/lib/libexpat/libbsdxml.3 +++ b/lib/libexpat/libbsdxml.3 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\"/ -.Dd October 1, 2024 +.Dd December 8, 2024 .Dt LIBBSDXML 3 .Os .Sh NAME @@ -34,7 +34,7 @@ .Sh DESCRIPTION The .Nm -library is a verbatim copy of the eXpat XML library version 2.6.3. +library is a verbatim copy of the eXpat XML library version 2.6.4. .Pp The .Nm From nobody Sun Dec 22 07:46: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 4YGCs63f5Nz5jDC7; Sun, 22 Dec 2024 07:46: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YGCs63N8lz4fsb; Sun, 22 Dec 2024 07:46:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734853594; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=puSw616dkO7snnqGThO+mDoXBBL5uidccQue7mTWijE=; b=ADI/xX+UcrOZivQCwUPdNJmhnk1YgcLGXQvx27YIpT3N0XylZ3RKwIY/5dfJ9o8f1QWnIX ew5k0+0iVLq9pefZOfPNj4uHmfPQ9quHKcQYEhQ5VKTIg6YwAcm6AuzXMGf6mTQcKrJgdg TjgQwcoUhpIQ/8jZKNAkEoq21gp9+I6HYqpHxCdJ4JoC3jPKxDhzeozNtAwALoVg5TxVFa NdGIXlDJ1wXQGCXa4bt73sqRr6QqrsrbxN/q/Zd7uBT0Jmirvx8uA5nn3aDSYWdhae3h1z KYXAqPVw0AX3/OZOJHw4/VywuxiWFzhQ4GJIr8l2NuX+DcM0JRdrieOpyiIS9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734853594; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=puSw616dkO7snnqGThO+mDoXBBL5uidccQue7mTWijE=; b=Sm/41mp7XnOeJ/kYRGoWEqoYQlS6g9+/TDK1d8VkRSd6vLAcZvfBn2f0La9uhQRWHr92Lf 5ZbkSSMPLZ5lQ6ka3B8PMUAcpmsQM0wXq+6VOMprYozDG99KZ34Pb68ZjJc/gjr134Jsa2 f0/TO8xOjPpxisfFYbT7zijXfgXd86h2+pb9f/l81nmWv5BY2xWVDIquhypM3d/J3sQemj 8zff2zOXH5kPQ1YY1YWZ2ID76JIFPpmBeuE0RzwhA0uTqjIYpDdEFI42fJYYpj9z5kaR5N rL/EOgGZk8OSTORjqCqDQViO2IurnPYw3Qtlii5RVMZAQJqFOCr3ojlwXWpOBQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734853594; a=rsa-sha256; cv=none; b=fUXmfoYaAzgUrBJ6WPOEy+JNtAcG5t/noPoBJNewKhYXNNOWSFUkLnNSHZz7jHv0VNGUoX Ouc2krSxFdd6j9jL6MEbTSrPwSXvgk6UlAIW1MPU7UVspr6+dx6IiTv/AeBftk05evDnBS /+FxN5YGmHgAyKYSfBS6Ijm8ej7ZJvOeQq2oKiNV0CXv0fJUeaUs3BjnG2M4z9JUyU9Iyc +0DvCLuMvZx33VR37bQ692XYopVMFTrz+W7KCHxxO5FEFkKKZDJmEv5YPvAmbHPnSlSKwG GJeurEbWIptPQgNIWdQpiIFwaPDPdPBtT3GPMJqN3mFuHea6w2fPVuazbR+onA== 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 4YGCs62tmcz10l1; Sun, 22 Dec 2024 07:46:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BM7kYc7021867; Sun, 22 Dec 2024 07:46:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BM7kYH6021864; Sun, 22 Dec 2024 07:46:34 GMT (envelope-from git) Date: Sun, 22 Dec 2024 07:46:34 GMT Message-Id: <202412220746.4BM7kYH6021864@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Xin LI Subject: git: bab279022ba2 - stable/13 - MFC: MFV: expat 2.6.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: delphij X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: bab279022ba2bed4f216924b3b5fdfc60ced364c Auto-Submitted: auto-generated The branch stable/13 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=bab279022ba2bed4f216924b3b5fdfc60ced364c commit bab279022ba2bed4f216924b3b5fdfc60ced364c Author: Enji Cooper AuthorDate: 2024-09-28 14:19:59 +0000 Commit: Xin LI CommitDate: 2024-12-22 07:46:24 +0000 MFC: MFV: expat 2.6.3 The 2.6.1 - 2.6.3 releases address several security issues with the library. The release notes for the 2.6.1-2.6.3 releases can be found at https://github.com/libexpat/libexpat/blob/R_2_6_3/expat/Changes . Differential Revision: https://reviews.freebsd.org/D46829 Merge commit '8e1eae2319cd3a651941c88b46d95e8ee8507c6c' (cherry picked from commit ffd294a1f4c23863c3e515d16dce31d5509bcb01) --- contrib/expat/Changes | 136 ++++++++++++++++++- contrib/expat/FREEBSD-Xlist | 1 - contrib/expat/Makefile.am | 6 +- contrib/expat/Makefile.in | 8 +- contrib/expat/README.md | 14 +- contrib/expat/buildconf.sh | 24 +--- contrib/expat/configure.ac | 39 ++++-- contrib/expat/doc/Makefile.am | 21 ++- contrib/expat/doc/Makefile.in | 58 ++++----- contrib/expat/doc/reference.html | 19 ++- contrib/expat/doc/xmlwf.1 | 2 +- contrib/expat/doc/xmlwf.xml | 2 +- contrib/expat/examples/Makefile.in | 2 +- contrib/expat/expat_config.h.in | 3 - contrib/expat/fix-xmltest-log.sh | 12 +- contrib/expat/lib/Makefile.am | 19 +-- contrib/expat/lib/Makefile.in | 79 ++++++++---- contrib/expat/lib/expat.h | 5 +- contrib/expat/lib/internal.h | 17 ++- contrib/expat/lib/siphash.h | 3 +- contrib/expat/lib/xmlparse.c | 73 ++++++++--- contrib/expat/tests/Makefile.am | 11 +- contrib/expat/tests/Makefile.in | 19 +-- contrib/expat/tests/README.md | 11 ++ contrib/expat/tests/README.txt | 13 -- contrib/expat/tests/acc_tests.c | 59 +++++++++ contrib/expat/tests/basic_tests.c | 208 ++++++++++++++++++++---------- contrib/expat/tests/benchmark/Makefile.in | 2 +- contrib/expat/tests/misc_tests.c | 2 +- contrib/expat/xmlwf/Makefile.in | 2 +- 30 files changed, 605 insertions(+), 265 deletions(-) diff --git a/contrib/expat/Changes b/contrib/expat/Changes index a7d4caf9ac81..c1d22efa5a3c 100644 --- a/contrib/expat/Changes +++ b/contrib/expat/Changes @@ -1,6 +1,136 @@ -NOTE: We are looking for help with a few things: - https://github.com/libexpat/libexpat/labels/help%20wanted - If you can help, please get in touch. Thanks! + __ __ _ + ___\ \/ /_ __ __ _| |_ + / _ \\ /| '_ \ / _` | __| + | __// \| |_) | (_| | |_ + \___/_/\_\ .__/ \__,_|\__| + |_| XML parser + +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!! Expat is UNDERSTAFFED and WITHOUT FUNDING. !! +!! ~~~~~~~~~~~~ !! +!! The following topics need *additional skilled C developers* to progress !! +!! in a timely manner or at all (loosely ordered by descending priority): !! +!! !! +!! - fixing a complex non-public security issue, !! +!! - teaming up on researching and fixing future security reports and !! +!! ClusterFuzz findings with few-days-max response times in communication !! +!! in order to (1) have a sound fix ready before the end of a 90 days !! +!! grace period and (2) in a sustainable manner, !! +!! - implementing and auto-testing XML 1.0r5 support !! +!! (needs discussion before pull requests), !! +!! - smart ideas on fixing the Autotools CMake files generation issue !! +!! without breaking CI (needs discussion before pull requests), !! +!! - the Windows binaries topic (needs requirements engineering first), !! +!! - pushing migration from `int` to `size_t` further !! +!! including edge-cases test coverage (needs discussion before anything). !! +!! !! +!! For details, please reach out via e-mail to sebastian@pipping.org so we !! +!! can schedule a voice call on the topic, in English or German. !! +!! !! +!! THANK YOU! Sebastian Pipping -- Berlin, 2024-03-09 !! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +Release 2.6.3 Wed September 4 2024 + Security fixes: + #887 #890 CVE-2024-45490 -- Calling function XML_ParseBuffer with + len < 0 without noticing and then calling XML_GetBuffer + will have XML_ParseBuffer fail to recognize the problem + and XML_GetBuffer corrupt memory. + With the fix, XML_ParseBuffer now complains with error + XML_ERROR_INVALID_ARGUMENT just like sibling XML_Parse + has been doing since Expat 2.2.1, and now documented. + Impact is denial of service to potentially artitrary code + execution. + #888 #891 CVE-2024-45491 -- Internal function dtdCopy can have an + integer overflow for nDefaultAtts on 32-bit platforms + (where UINT_MAX equals SIZE_MAX). + Impact is denial of service to potentially artitrary code + execution. + #889 #892 CVE-2024-45492 -- Internal function nextScaffoldPart can + have an integer overflow for m_groupSize on 32-bit + platforms (where UINT_MAX equals SIZE_MAX). + Impact is denial of service to potentially artitrary code + execution. + + Other changes: + #851 #879 Autotools: Sync CMake templates with CMake 3.28 + #853 Autotools: Always provide path to find(1) for portability + #861 Autotools: Ensure that the m4 directory always exists. + #870 Autotools: Simplify handling of SIZEOF_VOID_P + #869 Autotools: Support non-GNU sed + #856 Autotools|CMake: Fix main() to main(void) + #865 Autotools|CMake: Fix compile tests for HAVE_SYSCALL_GETRANDOM + #863 Autotools|CMake: Stop requiring dos2unix + #854 #855 CMake: Fix check for symbols size_t and off_t + #864 docs|tests: Convert README to Markdown and update + #741 Windows: Drop support for Visual Studio <=15.0/2017 + #886 Drop needless XML_DTD guards around is_param access + #885 Fix typo in a code comment + #894 #896 Version info bumped from 10:2:9 (libexpat*.so.1.9.2) + to 10:3:9 (libexpat*.so.1.9.3); see https://verbump.de/ + for what these numbers do + + Infrastructure: + #880 Readme: Promote the call for help + #868 CI: Fix various issues + #849 CI: Allow triggering GitHub Actions workflows manually + #851 #872 .. + #873 #879 CI: Adapt to breaking changes in GitHub Actions + + Special thanks to: + Alexander Bluhm + Berkay Eren Ürün + Dag-Erling Smørgrav + Ferenc Géczi + TaiYou + +Release 2.6.2 Wed March 13 2024 + Security fixes: + #839 #842 CVE-2024-28757 -- Prevent billion laughs attacks with + isolated use of external parsers. Please see the commit + message of commit 1d50b80cf31de87750103656f6eb693746854aa8 + for details. + + Bug fixes: + #839 #841 Reject direct parameter entity recursion + and avoid the related undefined behavior + + Other changes: + #847 Autotools: Fix build for DOCBOOK_TO_MAN containing spaces + #837 Add missing #821 and #824 to 2.6.1 change log + #838 #843 Version info bumped from 10:1:9 (libexpat*.so.1.9.1) + to 10:2:9 (libexpat*.so.1.9.2); see https://verbump.de/ + for what these numbers do + + Special thanks to: + Philippe Antoine + Tomas Korbar + and + Clang UndefinedBehaviorSanitizer + OSS-Fuzz / ClusterFuzz + +Release 2.6.1 Thu February 29 2024 + Bug fixes: + #817 Make tests independent of CPU speed, and thus more robust + #828 #836 Expose billion laughs API with XML_DTD defined and + XML_GE undefined, regression from 2.6.0 + + Other changes: + #829 Hide test-only code behind new internal macro + #833 Autotools: Reject expat_config.h.in defining SIZEOF_VOID_P + #821 #824 Autotools: Fix "make clean" for case: + ./configure --without-docbook && make clean all + #819 Address compiler warnings + #832 #834 Version info bumped from 10:0:9 (libexpat*.so.1.9.0) + to 10:1:9 (libexpat*.so.1.9.1); see https://verbump.de/ + for what these numbers do + + Infrastructure: + #818 CI: Adapt to breaking changes in clang-format + + Special thanks to: + David Hall + Snild Dolkow Release 2.6.0 Tue February 6 2024 Security fixes: diff --git a/contrib/expat/FREEBSD-Xlist b/contrib/expat/FREEBSD-Xlist index c1f2a689fee4..82ceb055ae1e 100644 --- a/contrib/expat/FREEBSD-Xlist +++ b/contrib/expat/FREEBSD-Xlist @@ -1,4 +1,3 @@ -# $FreeBSD$ *.MPW *.cmake *.def diff --git a/contrib/expat/Makefile.am b/contrib/expat/Makefile.am index 9c2259d23e63..7d8e17c2cf86 100644 --- a/contrib/expat/Makefile.am +++ b/contrib/expat/Makefile.am @@ -10,6 +10,8 @@ # Copyright (c) 2018 KangLin # Copyright (c) 2022 Johnny Jazeix # Copyright (c) 2023 Sony Corporation / Snild Dolkow +# Copyright (c) 2024 Alexander Bluhm +# Copyright (c) 2024 Dag-Erling Smørgrav # Licensed under the MIT license: # # Permission is hereby granted, free of charge, to any person obtaining @@ -114,10 +116,10 @@ buildlib: @echo 'ERROR: is no longer supported. INSTEAD please:' >&2 @echo 'ERROR:' >&2 @echo 'ERROR: * Mass-patch Makefile.am, e.g.' >&2 - @echo 'ERROR: # find -name Makefile.am -exec sed \' >&2 + @echo 'ERROR: # find . -name Makefile.am -exec sed \' >&2 @echo 'ERROR: -e "s,libexpat\.la,libexpatw.la," \' >&2 @echo 'ERROR: -e "s,libexpat_la,libexpatw_la," \' >&2 - @echo 'ERROR: -i {} +' >&2 + @echo 'ERROR: -i.bak {} +' >&2 @echo 'ERROR:' >&2 @echo 'ERROR: * Run automake to re-generate Makefile.in files' >&2 @echo 'ERROR:' >&2 diff --git a/contrib/expat/Makefile.in b/contrib/expat/Makefile.in index f505224f6fa8..c0fcb5dd05d1 100644 --- a/contrib/expat/Makefile.in +++ b/contrib/expat/Makefile.in @@ -26,6 +26,8 @@ # Copyright (c) 2018 KangLin # Copyright (c) 2022 Johnny Jazeix # Copyright (c) 2023 Sony Corporation / Snild Dolkow +# Copyright (c) 2024 Alexander Bluhm +# Copyright (c) 2024 Dag-Erling Smørgrav # Licensed under the MIT license: # # Permission is hereby granted, free of charge, to any person obtaining @@ -384,6 +386,7 @@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ +SIZEOF_VOID_P = @SIZEOF_VOID_P@ SO_MAJOR = @SO_MAJOR@ SO_MINOR = @SO_MINOR@ SO_PATCH = @SO_PATCH@ @@ -397,7 +400,6 @@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -ac_cv_sizeof_void_p = @ac_cv_sizeof_void_p@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -1080,10 +1082,10 @@ buildlib: @echo 'ERROR: is no longer supported. INSTEAD please:' >&2 @echo 'ERROR:' >&2 @echo 'ERROR: * Mass-patch Makefile.am, e.g.' >&2 - @echo 'ERROR: # find -name Makefile.am -exec sed \' >&2 + @echo 'ERROR: # find . -name Makefile.am -exec sed \' >&2 @echo 'ERROR: -e "s,libexpat\.la,libexpatw.la," \' >&2 @echo 'ERROR: -e "s,libexpat_la,libexpatw_la," \' >&2 - @echo 'ERROR: -i {} +' >&2 + @echo 'ERROR: -i.bak {} +' >&2 @echo 'ERROR:' >&2 @echo 'ERROR: * Run automake to re-generate Makefile.in files' >&2 @echo 'ERROR:' >&2 diff --git a/contrib/expat/README.md b/contrib/expat/README.md index 43c4f4f3dbb3..180a68e4abbe 100644 --- a/contrib/expat/README.md +++ b/contrib/expat/README.md @@ -4,8 +4,14 @@ [![Downloads SourceForge](https://img.shields.io/sourceforge/dt/expat?label=Downloads%20SourceForge)](https://sourceforge.net/projects/expat/files/) [![Downloads GitHub](https://img.shields.io/github/downloads/libexpat/libexpat/total?label=Downloads%20GitHub)](https://github.com/libexpat/libexpat/releases) +> [!CAUTION] +> +> Expat is **understaffed** and without funding. +> There is a [call for help with details](https://github.com/libexpat/libexpat/blob/master/expat/Changes) +> at the top of the `Changes` file. -# Expat, Release 2.6.0 + +# Expat, Release 2.6.3 This is Expat, a C99 library for parsing [XML 1.0 Fourth Edition](https://www.w3.org/TR/2006/REC-xml-20060816/), started by @@ -20,7 +26,7 @@ Expat supports the following compilers: - GNU GCC >=4.5 - LLVM Clang >=3.5 -- Microsoft Visual Studio >=15.0/2017 (rolling `${today} minus 5 years`) +- Microsoft Visual Studio >=16.0/2019 (rolling `${today} minus 5 years`) Windows users can use the [`expat-win32bin-*.*.*.{exe,zip}` download](https://github.com/libexpat/libexpat/releases), @@ -158,10 +164,10 @@ support this mode of compilation (yet): 1. Mass-patch `Makefile.am` files to use `libexpatw.la` for a library name:
- `find -name Makefile.am -exec sed + `find . -name Makefile.am -exec sed -e 's,libexpat\.la,libexpatw.la,' -e 's,libexpat_la,libexpatw_la,' - -i {} +` + -i.bak {} +` 1. Run `automake` to re-write `Makefile.in` files:
`automake` diff --git a/contrib/expat/buildconf.sh b/contrib/expat/buildconf.sh index 5e2b3269c256..4e506b30082b 100755 --- a/contrib/expat/buildconf.sh +++ b/contrib/expat/buildconf.sh @@ -8,6 +8,7 @@ # # Copyright (c) 2017-2022 Sebastian Pipping # Copyright (c) 2018 Marco Maggi +# Copyright (c) 2024 Dag-Erling Smørgrav # Licensed under the MIT license: # # Permission is hereby granted, free of charge, to any person obtaining @@ -31,25 +32,4 @@ set -e -# File expat_config.h.in (as generated by autoheader by autoreconf) contains -# macro SIZEOF_VOID_P which is (1) not really needed by Expat as of today and -# (2) a problem to "multilib" systems with one shared installed -# /usr/include/expat_config.h for two Expats with different "void *" sizes -# installed in e.g. /usr/lib32 and /usr/lib64. Hence we patch macro -# SIZEOF_VOID_P out of template expat_config.h.in so that configure will -# not put SIZEOF_VOID_P in the eventual expat_config.h. -patch_expat_config_h_in() { - local filename="$1" - local sizeof_void_p_line_number="$(grep -F -n SIZEOF_VOID_P "${filename}" | awk -F: '{print $1}')" - [[ ${sizeof_void_p_line_number} =~ ^[0-9]+$ ]] # cheap assert - local first_line_to_delete=$(( sizeof_void_p_line_number - 1 )) - local last_line_to_delete=$(( sizeof_void_p_line_number + 1 )) - # Note: Avoiding "sed -i" only for macOS portability. - local tempfile="$(mktemp)" - sed "${first_line_to_delete},${last_line_to_delete}d" "${filename}" > "${tempfile}" - mv "${tempfile}" "${filename}" -} - -autoreconf --warnings=all --install --verbose "$@" - -patch_expat_config_h_in expat_config.h.in +exec autoreconf --warnings=all --install --verbose "$@" diff --git a/contrib/expat/configure.ac b/contrib/expat/configure.ac index a5d1ff9317c8..1a930413ffe5 100644 --- a/contrib/expat/configure.ac +++ b/contrib/expat/configure.ac @@ -22,6 +22,8 @@ dnl Copyright (c) 2018 KangLin dnl Copyright (c) 2019 Mohammed Khajapasha dnl Copyright (c) 2019 Kishore Kunche dnl Copyright (c) 2020 Jeffrey Walton +dnl Copyright (c) 2024 Ferenc Géczi +dnl Copyright (c) 2024 Dag-Erling Smørgrav dnl Licensed under the MIT license: dnl dnl Permission is hereby granted, free of charge, to any person obtaining @@ -83,7 +85,7 @@ dnl If the API changes incompatibly set LIBAGE back to 0 dnl LIBCURRENT=10 # sync -LIBREVISION=0 # with +LIBREVISION=3 # with LIBAGE=9 # CMakeLists.txt! AC_CONFIG_HEADERS([expat_config.h]) @@ -160,7 +162,6 @@ AC_C_BIGENDIAN([AC_DEFINE([WORDS_BIGENDIAN], 1) AC_DEFINE_UNQUOTED([BYTEORDER], $BYTEORDER, [1234 = LILENDIAN, 4321 = BIGENDIAN]) AC_C_CONST -AC_TYPE_SIZE_T AC_ARG_WITH([xmlwf], [AS_HELP_STRING([--without-xmlwf], [do not build xmlwf])], @@ -215,7 +216,7 @@ AC_LINK_IFELSE([AC_LANG_SOURCE([ #else # include /* for arc4random_buf on BSD */ #endif - int main() { + int main(void) { char dummy[[123]]; // double brackets for m4 arc4random_buf(dummy, 0U); return 0; @@ -232,7 +233,7 @@ AC_LINK_IFELSE([AC_LANG_SOURCE([ #else # include #endif - int main() { + int main(void) { arc4random(); return 0; } @@ -254,7 +255,7 @@ AS_IF([test "x$with_getrandom" != xno], AC_LINK_IFELSE([AC_LANG_SOURCE([ #include /* for NULL */ #include - int main() { + int main(void) { return getrandom(NULL, 0U, 0U); } ])], @@ -275,10 +276,11 @@ AS_HELP_STRING([--without-sys-getrandom], AS_IF([test "x$with_sys_getrandom" != xno], [AC_MSG_CHECKING([for syscall SYS_getrandom (Linux 3.17+)]) AC_LINK_IFELSE([AC_LANG_SOURCE([ + #define _GNU_SOURCE #include /* for NULL */ #include /* for syscall */ #include /* for SYS_getrandom */ - int main() { + int main(void) { syscall(SYS_getrandom, NULL, 0, 0); return 0; } @@ -357,11 +359,22 @@ AS_IF([test "x${DOCBOOK_TO_MAN}" != x -a "x$with_docbook" != xno], page for xmlwf.])])]) dnl This will make sure that a release tarball shipping a pre-rendered xmlwf man page will -dnl get it installed, independent of whether some flavor of docbook2man is available. +dnl get it installed, when no working flavor of docbook2man is available (or wanted). dnl This relies on file xmlwf.1 being at least as recent as its source file xmlwf.xml. AS_IF([test -f "${srcdir}"/doc/xmlwf.1], - [AM_CONDITIONAL(WITH_DOCBOOK, [true])], - [AM_CONDITIONAL(WITH_DOCBOOK, [test "x${DOCBOOK_TO_MAN}" != x])]) + [AM_CONDITIONAL(WITH_MANPAGE, [true]) + AS_IF([test "x$with_docbook" = xno -o "x${DOCBOOK_TO_MAN}" = x], + [AM_CONDITIONAL(WITH_PREBUILT_MANPAGE, [true]) + AM_CONDITIONAL(WITH_DISTRIBUTABLE_MANPAGE, [false])], + [AM_CONDITIONAL(WITH_PREBUILT_MANPAGE, [false]) + AM_CONDITIONAL(WITH_DISTRIBUTABLE_MANPAGE, [true])]) + ], + [AS_IF([test "x$with_docbook" != xno -a "x${DOCBOOK_TO_MAN}" != x], + [AM_CONDITIONAL(WITH_MANPAGE, [true]) + AM_CONDITIONAL(WITH_DISTRIBUTABLE_MANPAGE, [true])], + [AM_CONDITIONAL(WITH_MANPAGE, [false]) + AM_CONDITIONAL(WITH_DISTRIBUTABLE_MANPAGE, [false])]) + AM_CONDITIONAL(WITH_PREBUILT_MANPAGE, [false])]) dnl Configure CMake file templates dnl NOTE: The *_TRUE variables read here are Automake conditionals @@ -392,7 +405,6 @@ LIBDIR_BASENAME="$(basename "${libdir}")" SO_MAJOR="$(expr "${LIBCURRENT}" - "${LIBAGE}")" SO_MINOR="${LIBAGE}" SO_PATCH="${LIBREVISION}" -AC_CHECK_SIZEOF([void *]) # sets ac_cv_sizeof_void_p AC_SUBST([EXPAT_ATTR_INFO]) AC_SUBST([EXPAT_DTD]) AC_SUBST([EXPAT_LARGE_SIZE]) @@ -405,8 +417,13 @@ AC_SUBST([LIBDIR_BASENAME]) AC_SUBST([SO_MAJOR]) AC_SUBST([SO_MINOR]) AC_SUBST([SO_PATCH]) -AC_SUBST([ac_cv_sizeof_void_p]) +dnl The canonical way of doing this is AC_CHECK_SIZEOF(void *), but +dnl that adds SIZEOF_VOID_P to expat_config.h.in, making it difficult +dnl to have 32-bit and 64-bit versions of libexpat installed on the +dnl same system with a single, shared copy of the header. +AC_COMPUTE_INT(SIZEOF_VOID_P, [sizeof(void *)]) +AC_SUBST([SIZEOF_VOID_P]) dnl write the Automake flags we set AC_SUBST([AM_CPPFLAGS]) diff --git a/contrib/expat/doc/Makefile.am b/contrib/expat/doc/Makefile.am index c3a3ce59c1b9..3bea96e9aa6f 100644 --- a/contrib/expat/doc/Makefile.am +++ b/contrib/expat/doc/Makefile.am @@ -6,9 +6,10 @@ # \___/_/\_\ .__/ \__,_|\__| # |_| XML parser # -# Copyright (c) 2017-2022 Sebastian Pipping +# Copyright (c) 2017-2024 Sebastian Pipping # Copyright (c) 2017 Stephen Groat # Copyright (c) 2017 Joe Orton +# Copyright (c) 2024 Tomas Korbar # Licensed under the MIT license: # # Permission is hereby granted, free of charge, to any person obtaining @@ -32,26 +33,24 @@ .PHONY: dist-hook # not inside conditional to avoid automake warning -if WITH_DOCBOOK +if WITH_MANPAGE dist_man_MANS = xmlwf.1 xmlwf.1: xmlwf.xml -rm -f $@ - $(DOCBOOK_TO_MAN) $< + test "x$(DOCBOOK_TO_MAN)" != x && $(DOCBOOK_TO_MAN) $< test -f $@ || mv XMLWF.1 $@ -else +endif + +if !WITH_DISTRIBUTABLE_MANPAGE dist-hook: @echo 'ERROR: Configure with --with-docbook for "make dist".' 1>&2 @false endif -# https://www.gnu.org/software/automake/manual/automake.html#What-Gets-Cleaned -.PHONY: clean-local -clean-local: clean-local-check - -.PHONY: clean-local-check -clean-local-check: - $(RM) xmlwf.1 +if !WITH_PREBUILT_MANPAGE +CLEANFILES = xmlwf.1 +endif EXTRA_DIST = \ ok.min.css \ diff --git a/contrib/expat/doc/Makefile.in b/contrib/expat/doc/Makefile.in index 18f86be3947b..72deb0565d94 100644 --- a/contrib/expat/doc/Makefile.in +++ b/contrib/expat/doc/Makefile.in @@ -22,9 +22,10 @@ # \___/_/\_\ .__/ \__,_|\__| # |_| XML parser # -# Copyright (c) 2017-2022 Sebastian Pipping +# Copyright (c) 2017-2024 Sebastian Pipping # Copyright (c) 2017 Stephen Groat # Copyright (c) 2017 Joe Orton +# Copyright (c) 2024 Tomas Korbar # Licensed under the MIT license: # # Permission is hereby granted, free of charge, to any person obtaining @@ -285,6 +286,7 @@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ +SIZEOF_VOID_P = @SIZEOF_VOID_P@ SO_MAJOR = @SO_MAJOR@ SO_MINOR = @SO_MINOR@ SO_PATCH = @SO_PATCH@ @@ -298,7 +300,6 @@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -ac_cv_sizeof_void_p = @ac_cv_sizeof_void_p@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -345,7 +346,8 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -@WITH_DOCBOOK_TRUE@dist_man_MANS = xmlwf.1 +@WITH_MANPAGE_TRUE@dist_man_MANS = xmlwf.1 +@WITH_PREBUILT_MANPAGE_FALSE@CLEANFILES = xmlwf.1 EXTRA_DIST = \ ok.min.css \ reference.html \ @@ -439,7 +441,7 @@ ctags CTAGS: cscope cscopelist: -@WITH_DOCBOOK_TRUE@dist-hook: +@WITH_DISTRIBUTABLE_MANPAGE_TRUE@dist-hook: distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am @@ -505,6 +507,7 @@ install-strip: mostlyclean-generic: clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) @@ -515,7 +518,7 @@ maintainer-clean-generic: @echo "it deletes files that may require special tools to rebuild." clean: clean-am -clean-am: clean-generic clean-libtool clean-local mostlyclean-am +clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile @@ -584,38 +587,31 @@ uninstall-man: uninstall-man1 .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ - clean-local cscopelist-am ctags-am dist-hook distclean \ - distclean-generic distclean-libtool distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-man1 install-pdf \ - install-pdf-am install-ps install-ps-am install-strip \ - installcheck installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ - uninstall-am uninstall-man uninstall-man1 + cscopelist-am ctags-am dist-hook distclean distclean-generic \ + distclean-libtool distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-man1 install-pdf install-pdf-am install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ + ps ps-am tags-am uninstall uninstall-am uninstall-man \ + uninstall-man1 .PRECIOUS: Makefile .PHONY: dist-hook # not inside conditional to avoid automake warning -@WITH_DOCBOOK_TRUE@xmlwf.1: xmlwf.xml -@WITH_DOCBOOK_TRUE@ -rm -f $@ -@WITH_DOCBOOK_TRUE@ $(DOCBOOK_TO_MAN) $< -@WITH_DOCBOOK_TRUE@ test -f $@ || mv XMLWF.1 $@ -@WITH_DOCBOOK_FALSE@dist-hook: -@WITH_DOCBOOK_FALSE@ @echo 'ERROR: Configure with --with-docbook for "make dist".' 1>&2 -@WITH_DOCBOOK_FALSE@ @false - -# https://www.gnu.org/software/automake/manual/automake.html#What-Gets-Cleaned -.PHONY: clean-local -clean-local: clean-local-check - -.PHONY: clean-local-check -clean-local-check: - $(RM) xmlwf.1 +@WITH_MANPAGE_TRUE@xmlwf.1: xmlwf.xml +@WITH_MANPAGE_TRUE@ -rm -f $@ +@WITH_MANPAGE_TRUE@ test "x$(DOCBOOK_TO_MAN)" != x && $(DOCBOOK_TO_MAN) $< +@WITH_MANPAGE_TRUE@ test -f $@ || mv XMLWF.1 $@ + +@WITH_DISTRIBUTABLE_MANPAGE_FALSE@dist-hook: +@WITH_DISTRIBUTABLE_MANPAGE_FALSE@ @echo 'ERROR: Configure with --with-docbook for "make dist".' 1>&2 +@WITH_DISTRIBUTABLE_MANPAGE_FALSE@ @false # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/contrib/expat/doc/reference.html b/contrib/expat/doc/reference.html index 898f03a3364d..4cfb2ce9384e 100644 --- a/contrib/expat/doc/reference.html +++ b/contrib/expat/doc/reference.html @@ -52,7 +52,7 @@

The Expat XML Parser - Release 2.6.0 + Release 2.6.3

@@ -319,7 +319,7 @@ directions in the next section. Otherwise if you have Microsoft's Developer Studio installed, you can use CMake to generate a .sln file, e.g. -cmake -G"Visual Studio 15 2017" -DCMAKE_BUILD_TYPE=RelWithDebInfo . +cmake -G"Visual Studio 16 2019" -DCMAKE_BUILD_TYPE=RelWithDebInfo . , and build Expat using msbuild /m expat.sln after.

Alternatively, you may download the Win32 binary package that @@ -356,10 +356,7 @@ library and header would get installed in

Configuring Expat Using the Pre-Processor

Expat's feature set can be configured using a small number of -pre-processor definitions. The definition of this symbols does not -affect the set of entry points for Expat, only the behavior of the API -and the definition of character types in the case of -XML_UNICODE_WCHAR_T. The symbols are:

+pre-processor definitions. The symbols are:

XML_GE
@@ -1138,7 +1135,9 @@ containing part (or perhaps all) of the document. The number of bytes of s that are part of the document is indicated by len. This means that s doesn't have to be null-terminated. It also means that if len is larger than the number of bytes in the block of -memory that s points at, then a memory fault is likely. The +memory that s points at, then a memory fault is likely. +Negative values for len are rejected since Expat 2.2.1. +The isFinal parameter informs the parser that this is the last piece of the document. Frequently, the last piece is empty (i.e. len is zero.) @@ -1186,11 +1185,17 @@ XML_ParseBuffer(XML_Parser p, int isFinal);
+

This is just like XML_Parse, except in this case Expat provides the buffer. By obtaining the buffer from Expat with the XML_GetBuffer function, the application can avoid double copying of the input. +

+ +

+Negative values for len are rejected since Expat 2.6.3. +

XML_GetBuffer

diff --git a/contrib/expat/doc/xmlwf.1 b/contrib/expat/doc/xmlwf.1 index ac5ce21e6b81..347c36f06109 100644 --- a/contrib/expat/doc/xmlwf.1 +++ b/contrib/expat/doc/xmlwf.1 @@ -5,7 +5,7 @@ \\$2 \(la\\$1\(ra\\$3 .. .if \n(.g .mso www.tmac -.TH XMLWF 1 "February 6, 2024" "" "" +.TH XMLWF 1 "September 4, 2024" "" "" .SH NAME xmlwf \- Determines if an XML document is well-formed .SH SYNOPSIS diff --git a/contrib/expat/doc/xmlwf.xml b/contrib/expat/doc/xmlwf.xml index 2b3f1ccd74a8..10b29782b197 100644 --- a/contrib/expat/doc/xmlwf.xml +++ b/contrib/expat/doc/xmlwf.xml @@ -21,7 +21,7 @@ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [ Scott"> Bronson"> - February 6, 2024"> + September 4, 2024"> 1"> bronson@rinspin.com"> diff --git a/contrib/expat/examples/Makefile.in b/contrib/expat/examples/Makefile.in index 0ccc020dd94f..044c9089c565 100644 --- a/contrib/expat/examples/Makefile.in +++ b/contrib/expat/examples/Makefile.in @@ -313,6 +313,7 @@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ +SIZEOF_VOID_P = @SIZEOF_VOID_P@ SO_MAJOR = @SO_MAJOR@ SO_MINOR = @SO_MINOR@ SO_PATCH = @SO_PATCH@ @@ -326,7 +327,6 @@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -ac_cv_sizeof_void_p = @ac_cv_sizeof_void_p@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ diff --git a/contrib/expat/expat_config.h.in b/contrib/expat/expat_config.h.in index 91c32340868e..67ef89c7171a 100644 --- a/contrib/expat/expat_config.h.in +++ b/contrib/expat/expat_config.h.in @@ -139,7 +139,4 @@ /* Define to `long int' if does not define. */ #undef off_t -/* Define to `unsigned int' if does not define. */ -#undef size_t - #endif // ndef EXPAT_CONFIG_H diff --git a/contrib/expat/fix-xmltest-log.sh b/contrib/expat/fix-xmltest-log.sh index 7981cf3b00c8..4739acab6b02 100755 --- a/contrib/expat/fix-xmltest-log.sh +++ b/contrib/expat/fix-xmltest-log.sh @@ -7,6 +7,7 @@ # |_| XML parser # # Copyright (c) 2019-2022 Sebastian Pipping +# Copyright (c) 2024 Dag-Erling Smørgrav # Licensed under the MIT license: # # Permission is hereby granted, free of charge, to any person obtaining @@ -32,10 +33,10 @@ set -e filename="${1:-tests/xmltest.log}" -dos2unix "${filename}" - -tempfile="$(mktemp)" -sed \ +sed -i.bak \ + -e '# convert DOS line endings to Unix without resorting to dos2unix' \ + -e $'s/\r//' \ + \ -e 's/^wine: Call .* msvcrt\.dll\._wperror, aborting$/ibm49i02.dtd: No such file or directory/' \ \ -e '/^wine: /d' \ @@ -46,5 +47,4 @@ sed \ -e '/^wine client error:/d' \ -e '/^In ibm\/invalid\/P49\/: Unhandled exception: unimplemented .\+/d' \ \ - "${filename}" > "${tempfile}" -mv "${tempfile}" "${filename}" + "${filename}" diff --git a/contrib/expat/lib/Makefile.am b/contrib/expat/lib/Makefile.am index 0e0185b59120..1958f322f319 100644 --- a/contrib/expat/lib/Makefile.am +++ b/contrib/expat/lib/Makefile.am @@ -6,7 +6,7 @@ # \___/_/\_\ .__/ \__,_|\__| # |_| XML parser # -# Copyright (c) 2017-2022 Sebastian Pipping +# Copyright (c) 2017-2024 Sebastian Pipping # Copyright (c) 2017 Tomasz Kłoczko # Copyright (c) 2019 David Loffredo # Licensed under the MIT license: @@ -36,7 +36,9 @@ include_HEADERS = \ expat_external.h lib_LTLIBRARIES = libexpat.la -noinst_LTLIBRARIES = libexpatinternal.la +if WITH_TESTS +noinst_LTLIBRARIES = libtestpat.la +endif libexpat_la_LDFLAGS = \ @AM_LDFLAGS@ \ @@ -44,17 +46,16 @@ libexpat_la_LDFLAGS = \ -no-undefined \ -version-info @LIBCURRENT@:@LIBREVISION@:@LIBAGE@ -libexpat_la_SOURCES = - -# This layer of indirection allows -# the test suite to access internal symbols -# despite compiling with -fvisibility=hidden -libexpatinternal_la_SOURCES = \ +libexpat_la_SOURCES = \ xmlparse.c \ xmltok.c \ xmlrole.c -libexpat_la_LIBADD = libexpatinternal.la +if WITH_TESTS +libtestpat_la_CPPFLAGS = -DXML_TESTING + +libtestpat_la_SOURCES = $(libexpat_la_SOURCES) +endif doc_DATA = \ ../AUTHORS \ diff --git a/contrib/expat/lib/Makefile.in b/contrib/expat/lib/Makefile.in index 29584d8bbe74..1a97e85fc41f 100644 --- a/contrib/expat/lib/Makefile.in +++ b/contrib/expat/lib/Makefile.in @@ -22,7 +22,7 @@ # \___/_/\_\ .__/ \__,_|\__| # |_| XML parser # -# Copyright (c) 2017-2022 Sebastian Pipping +# Copyright (c) 2017-2024 Sebastian Pipping # Copyright (c) 2017 Tomasz Kłoczko # Copyright (c) 2019 David Loffredo # Licensed under the MIT license: @@ -176,8 +176,8 @@ am__uninstall_files_from_dir = { \ am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(docdir)" \ "$(DESTDIR)$(includedir)" LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES) -libexpat_la_DEPENDENCIES = libexpatinternal.la -am_libexpat_la_OBJECTS = +libexpat_la_LIBADD = +am_libexpat_la_OBJECTS = xmlparse.lo xmltok.lo xmlrole.lo libexpat_la_OBJECTS = $(am_libexpat_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -186,9 +186,13 @@ am__v_lt_1 = libexpat_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libexpat_la_LDFLAGS) $(LDFLAGS) -o $@ -libexpatinternal_la_LIBADD = -am_libexpatinternal_la_OBJECTS = xmlparse.lo xmltok.lo xmlrole.lo -libexpatinternal_la_OBJECTS = $(am_libexpatinternal_la_OBJECTS) +libtestpat_la_LIBADD = +am__libtestpat_la_SOURCES_DIST = xmlparse.c xmltok.c xmlrole.c +am__objects_1 = libtestpat_la-xmlparse.lo libtestpat_la-xmltok.lo \ + libtestpat_la-xmlrole.lo +@WITH_TESTS_TRUE@am_libtestpat_la_OBJECTS = $(am__objects_1) +libtestpat_la_OBJECTS = $(am_libtestpat_la_OBJECTS) +@WITH_TESTS_TRUE@am_libtestpat_la_rpath = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false @@ -204,8 +208,10 @@ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/conftools/depcomp am__maybe_remake_depfiles = depfiles -am__depfiles_remade = ./$(DEPDIR)/xmlparse.Plo ./$(DEPDIR)/xmlrole.Plo \ - ./$(DEPDIR)/xmltok.Plo +am__depfiles_remade = ./$(DEPDIR)/libtestpat_la-xmlparse.Plo \ + ./$(DEPDIR)/libtestpat_la-xmlrole.Plo \ + ./$(DEPDIR)/libtestpat_la-xmltok.Plo ./$(DEPDIR)/xmlparse.Plo \ + ./$(DEPDIR)/xmlrole.Plo ./$(DEPDIR)/xmltok.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -225,8 +231,9 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = -SOURCES = $(libexpat_la_SOURCES) $(libexpatinternal_la_SOURCES) -DIST_SOURCES = $(libexpat_la_SOURCES) $(libexpatinternal_la_SOURCES) +SOURCES = $(libexpat_la_SOURCES) $(libtestpat_la_SOURCES) +DIST_SOURCES = $(libexpat_la_SOURCES) \ + $(am__libtestpat_la_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ @@ -344,6 +351,7 @@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ +SIZEOF_VOID_P = @SIZEOF_VOID_P@ SO_MAJOR = @SO_MAJOR@ SO_MINOR = @SO_MINOR@ SO_PATCH = @SO_PATCH@ @@ -357,7 +365,6 @@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -ac_cv_sizeof_void_p = @ac_cv_sizeof_void_p@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -410,24 +417,20 @@ include_HEADERS = \ expat_external.h lib_LTLIBRARIES = libexpat.la -noinst_LTLIBRARIES = libexpatinternal.la +@WITH_TESTS_TRUE@noinst_LTLIBRARIES = libtestpat.la libexpat_la_LDFLAGS = \ @AM_LDFLAGS@ \ @LIBM@ \ -no-undefined \ -version-info @LIBCURRENT@:@LIBREVISION@:@LIBAGE@ -libexpat_la_SOURCES = - -# This layer of indirection allows -# the test suite to access internal symbols -# despite compiling with -fvisibility=hidden -libexpatinternal_la_SOURCES = \ +libexpat_la_SOURCES = \ xmlparse.c \ xmltok.c \ xmlrole.c -libexpat_la_LIBADD = libexpatinternal.la +@WITH_TESTS_TRUE@libtestpat_la_CPPFLAGS = -DXML_TESTING +@WITH_TESTS_TRUE@libtestpat_la_SOURCES = $(libexpat_la_SOURCES) doc_DATA = \ ../AUTHORS \ ../Changes @@ -534,8 +537,8 @@ clean-noinstLTLIBRARIES: libexpat.la: $(libexpat_la_OBJECTS) $(libexpat_la_DEPENDENCIES) $(EXTRA_libexpat_la_DEPENDENCIES) $(AM_V_CCLD)$(libexpat_la_LINK) -rpath $(libdir) $(libexpat_la_OBJECTS) $(libexpat_la_LIBADD) $(LIBS) -libexpatinternal.la: $(libexpatinternal_la_OBJECTS) $(libexpatinternal_la_DEPENDENCIES) $(EXTRA_libexpatinternal_la_DEPENDENCIES) - $(AM_V_CCLD)$(LINK) $(libexpatinternal_la_OBJECTS) $(libexpatinternal_la_LIBADD) $(LIBS) +libtestpat.la: $(libtestpat_la_OBJECTS) $(libtestpat_la_DEPENDENCIES) $(EXTRA_libtestpat_la_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) $(am_libtestpat_la_rpath) $(libtestpat_la_OBJECTS) $(libtestpat_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -543,6 +546,9 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtestpat_la-xmlparse.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtestpat_la-xmlrole.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtestpat_la-xmltok.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmlparse.Plo@am__quote@ # am--include-marker *** 979 LINES SKIPPED *** From nobody Sun Dec 22 07:46: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 4YGCs75kZ1z5jDJ5; Sun, 22 Dec 2024 07:46: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YGCs73ysHz4fq7; Sun, 22 Dec 2024 07:46:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734853595; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JXoDwJ80E3HWSYCq4uSd0rpzk3X9kCkLuTKCL9FdoaU=; b=BSmAnUGmwJdngRc5FnPFB3YQPIo5zpznmV3tXl2498zN2Rw3HESUcdJBqhqrVt5l/0z2HY EYdGvTQCFWfz5hUrdOZN9FnuktL2v8GPh6yPWhdivV/9BtIr0uIgs+L+zITyGEAul98lMv ZHtv9MnFKVmB3u0hrj+N2jXsNE1bTKhkFO7v0ZNqfcYTJ37zoyw01nYLZz6MO3GYcUg9uM 1g/+LStLgvWW2c7Jvgvs04ZLiWN2dn0IjUvzFfJVoN8ilKlwBOyToGqstjHE9Z6Uz8IQld wZp+sF4rUyQf15LmJret8bbeUlvrWzAO8vnBCP5ocuNI4s/txJ8ptoM+S0OWeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734853595; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JXoDwJ80E3HWSYCq4uSd0rpzk3X9kCkLuTKCL9FdoaU=; b=QDwwjmpUq5WCPcOb1daSxScj7WdKpeuSoa1Blyb0j9TYAvxf5srGiPP5bvN4IYlVkC/J8K 7ZjAh6b0eiHg6wZFsAqCuK7hRMOeGtE+QZWfqL+3kBHhj/gZzeDyNMJ8GUT8m4zZEfSYrA 1872zcA0JCGYYQr3zTrRdZ+oXX973KC3QDcNmDyWj1uL0hy+kr/t/1w0ZPdVZsj7rShfoA P/wcTMKEOnnr+w00WAmnAviZV2Ly3pDE0xXQHkqHNyG4yKtB6G7jrqpEIcxproKfRxD+NR nITG0x3fbezYmHqNSfMkWoSrh0pXx9WPqQsUjv/SByJwZ/mVAhKgiLOBLBTdJw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734853595; a=rsa-sha256; cv=none; b=DRS/HHXqi13snrK2xoSukUUYS9GiSGeYSaLCI7x1WPY06M0jL40JAByCUHsdrf4HrDZaqU kZ5xIo/aeCoEP1sbhmYFbm2ioyA1kxrgQbVuSwx6B6nb4JOOy/FFQDBEYoB6gsRIwQkayV awUjC0PmUjsn9iuw+vdDClsplWEGeBRrgeD9GEYoptv6vmktOpzdtpi79zv7FmjrjByYeC RcJ/10ZDz6BWSgEsP8o2ckGV+Nh3623FodQw5iuQkCFmYpjOvXUKV/PEBNxjxE/WOOC7+A n9WIvqA74GbiQuqr47OF32qsUgx6DKeigmwae7s94lz5cxiVpwMQ9Euo8LP+lA== 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 4YGCs73SVXz103T; Sun, 22 Dec 2024 07:46:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BM7kZxs021920; Sun, 22 Dec 2024 07:46:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BM7kZ90021917; Sun, 22 Dec 2024 07:46:35 GMT (envelope-from git) Date: Sun, 22 Dec 2024 07:46:35 GMT Message-Id: <202412220746.4BM7kZ90021917@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Xin LI Subject: git: eab7ed2ec2af - stable/13 - MFC: Update the expat version referenced in libbsdxml.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: delphij X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: eab7ed2ec2af6307842abcc94c11743a1058bd11 Auto-Submitted: auto-generated The branch stable/13 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=eab7ed2ec2af6307842abcc94c11743a1058bd11 commit eab7ed2ec2af6307842abcc94c11743a1058bd11 Author: Enji Cooper AuthorDate: 2024-10-02 02:26:37 +0000 Commit: Xin LI CommitDate: 2024-12-22 07:46:25 +0000 MFC: Update the expat version referenced in libbsdxml.3 This change updates the version of expat referenced from 2.6.0 to 2.6.3, correcting documentation post-ffd294a1f4c23863c3e515d16dce31d5509bcb01. Bump .Dd for the change. MFC with: ffd294a1f4c23863c3e515d16dce31d5509bcb01 Differential Revision: https://reviews.freebsd.org/D46865 (cherry picked from commit ba23ab2168ffabc2c5e647a1a37ab9a8fb482bb8) --- lib/libexpat/libbsdxml.3 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libexpat/libbsdxml.3 b/lib/libexpat/libbsdxml.3 index c6c2518ea41a..2ec1f71b58bb 100644 --- a/lib/libexpat/libbsdxml.3 +++ b/lib/libexpat/libbsdxml.3 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\"/ -.Dd February 17, 2024 +.Dd October 1, 2024 .Dt LIBBSDXML 3 .Os .Sh NAME @@ -34,7 +34,7 @@ .Sh DESCRIPTION The .Nm -library is a verbatim copy of the eXpat XML library version 2.6.0. +library is a verbatim copy of the eXpat XML library version 2.6.3. .Pp The .Nm From nobody Sun Dec 22 07:46: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 4YGCs86fVxz5jDG8; Sun, 22 Dec 2024 07:46: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YGCs85nbbz4fsd; Sun, 22 Dec 2024 07:46:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734853596; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cvE0yTZjnsrv+Ibe8vjf8CsWzHq5gejia6WRJBiFYpg=; b=ygS675ozyifQzN7Xdc0x4o/a8oLmV26dwzHYMU/h9v4PyPEk3eTlPc+Yxf6aMYPE4Vniu7 IQT9H7a6Po+wmq30JJ0ZVJO1uDqQckcTtq0jx298kzW7LFhhmhDgTW273SmDkuDn+lz7nr wdYc5qvaIktP8OaB5UAM70p2TL7S2KV9/VtSEJZYAlcawoUlKm9tNsAh4nzTxMXYrlQ3+J 0pY7t1AXDtxuocLO1PUMJByusa5YdoRpTKWyN2Sogya+4H2fInZasXAC6NGbBgi2AR/L+Z qI598eDbwVSnvZkoWDx1k3tmzJA5WTczY0Rkad5KRT55DhGS+SZckn1uG3F14g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734853596; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cvE0yTZjnsrv+Ibe8vjf8CsWzHq5gejia6WRJBiFYpg=; b=JuvU3DXVKiJF33em2n7PBEfbe2CnHD/nQPyK36zzp815a/GE5kPLE0J0o0USPHGkSCJM2V pfmQUYtVoIUpBBaHDHBOjwkYPuvK5e75vDBh7deTvDmyVK7dhQYhzcLJzmNYKa2a2SILDr aZuexiXy40T18QkVAGK/6rnbfGHpOxDOcWb5MTlK2hXexPffXEvHFv1jd42kT9W+RLaiPo 1Cu5XBXY+kZtxTs96jQ1xz05xv7T/TDCBPyZcy41AceQ+zDc9eL3u6iip9aoxx/ZnQ9s0v VgqF013fpN7HfE3tbK7F+1LRYa1hVLTKm+aT0rZ+frN8yoGY8APmsfYtQwKIcg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734853596; a=rsa-sha256; cv=none; b=A6LA6o/RDRH7Afm8skwIw5FndlNo/5G/27z1YSqe7/6aMlN5JROnWqsfBAtNfxqn0oFFE0 qmEFPSRbd2T9JPtmNr6Akkd8JWwmcxLkFS0tp95WYhyBloTq8E1sO5zP41Ckdw8g/SmMj8 3KjAe1VnPvl8sJLjtF5NJGUlZchRcmWKxiJDfWBzTw0HYlX13AFEIQLFcLRIZOrwVA3YDq niORvu/wtv7ym+PP61D1XRxuol8yerrqT1YBHXA9Vrba3NLqOmCCUkquHgQP1wHe2BmEqp pBc/yT1F5Ys6y3lPJavzYGrNu0/Lo7PlObyD0TSmgHOynP8Wvu3Xi6KA38pPfQ== 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 4YGCs84Lmsz10Yn; Sun, 22 Dec 2024 07:46:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BM7kaSV021967; Sun, 22 Dec 2024 07:46:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BM7kaFj021964; Sun, 22 Dec 2024 07:46:36 GMT (envelope-from git) Date: Sun, 22 Dec 2024 07:46:36 GMT Message-Id: <202412220746.4BM7kaFj021964@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Xin LI Subject: git: 3d46113d2196 - stable/13 - MFC: MFV: expat 2.6.4. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: 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: delphij X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3d46113d21963d4236506f7c8e9c476b1f4aa512 Auto-Submitted: auto-generated The branch stable/13 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=3d46113d21963d4236506f7c8e9c476b1f4aa512 commit 3d46113d21963d4236506f7c8e9c476b1f4aa512 Author: Xin LI AuthorDate: 2024-12-09 04:24:16 +0000 Commit: Xin LI CommitDate: 2024-12-22 07:46:25 +0000 MFC: MFV: expat 2.6.4. (cherry picked from commit 908f215e80fa482aa953c39afa6bb516f561fc00) --- contrib/expat/Changes | 31 ++++++++++++++++++ contrib/expat/README.md | 47 ++++++++++++++++++++++++--- contrib/expat/configure.ac | 6 ++-- contrib/expat/doc/reference.html | 2 +- contrib/expat/doc/xmlwf.1 | 2 +- contrib/expat/doc/xmlwf.xml | 2 +- contrib/expat/examples/element_declarations.c | 9 ++--- contrib/expat/lib/expat.h | 6 ++-- contrib/expat/lib/xmlparse.c | 18 +++++++--- contrib/expat/tests/basic_tests.c | 17 +++++++--- contrib/expat/tests/common.c | 33 ++----------------- contrib/expat/tests/common.h | 11 +------ contrib/expat/tests/handlers.c | 42 +++++++++++++++++++----- contrib/expat/tests/handlers.h | 17 ++++++++-- contrib/expat/tests/misc_tests.c | 39 ++++++++++++++++++---- contrib/expat/xmlwf/xmlfile.c | 4 ++- lib/libexpat/Makefile | 1 - lib/libexpat/expat_config.h | 9 ++--- lib/libexpat/libbsdxml.3 | 4 +-- 19 files changed, 206 insertions(+), 94 deletions(-) diff --git a/contrib/expat/Changes b/contrib/expat/Changes index c1d22efa5a3c..aa19f70ae219 100644 --- a/contrib/expat/Changes +++ b/contrib/expat/Changes @@ -30,6 +30,37 @@ !! THANK YOU! Sebastian Pipping -- Berlin, 2024-03-09 !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +Release 2.6.4 Wed November 6 2024 + Security fixes: + #915 CVE-2024-50602 -- Fix crash within function XML_ResumeParser + from a NULL pointer dereference by disallowing function + XML_StopParser to (stop or) suspend an unstarted parser. + A new error code XML_ERROR_NOT_STARTED was introduced to + properly communicate this situation. // CWE-476 CWE-754 + + Other changes: + #903 CMake: Add alias target "expat::expat" + #905 docs: Document use via CMake >=3.18 with FetchContent + and SOURCE_SUBDIR and its consequences + #902 tests: Reduce use of global parser instance + #904 tests: Resolve duplicate handler + #317 #918 tests: Improve tests on doctype closing (ex CVE-2019-15903) + #914 Fix signedness of format strings + #919 #920 Version info bumped from 10:3:9 (libexpat*.so.1.9.3) + to 11:0:10 (libexpat*.so.1.10.0); see https://verbump.de/ + for what these numbers do + + Infrastructure: + #907 CI: Upgrade Clang from 18 to 19 + #913 CI: Drop macos-12 and add macos-15 + #910 CI: Adapt to breaking changes in GitHub Actions + #898 Add missing entries to .gitignore + + Special thanks to: + Hanno Böck + José Eduardo Gutiérrez Conejo + José Ricardo Cardona Quesada + Release 2.6.3 Wed September 4 2024 Security fixes: #887 #890 CVE-2024-45490 -- Calling function XML_ParseBuffer with diff --git a/contrib/expat/README.md b/contrib/expat/README.md index 180a68e4abbe..23d26dad2b92 100644 --- a/contrib/expat/README.md +++ b/contrib/expat/README.md @@ -11,7 +11,7 @@ > at the top of the `Changes` file. -# Expat, Release 2.6.3 +# Expat, Release 2.6.4 This is Expat, a C99 library for parsing [XML 1.0 Fourth Edition](https://www.w3.org/TR/2006/REC-xml-20060816/), started by @@ -43,9 +43,9 @@ This license is the same as the MIT/X Consortium license. ## Using libexpat in your CMake-Based Project -There are two ways of using libexpat with CMake: +There are three documented ways of using libexpat with CMake: -### a) Module Mode +### a) `find_package` with Module Mode This approach leverages CMake's own [module `FindEXPAT`](https://cmake.org/cmake/help/latest/module/FindEXPAT.html). @@ -70,7 +70,7 @@ target_include_directories(hello PRIVATE ${EXPAT_INCLUDE_DIRS}) target_link_libraries(hello PUBLIC ${EXPAT_LIBRARIES}) ``` -### b) Config Mode +### b) `find_package` with Config Mode This approach requires files from… @@ -98,6 +98,45 @@ add_executable(hello target_link_libraries(hello PUBLIC expat::expat) ``` +### c) The `FetchContent` module + +This approach — as demonstrated below — requires CMake >=3.18 for both the +[`FetchContent` module](https://cmake.org/cmake/help/latest/module/FetchContent.html) +and its support for the `SOURCE_SUBDIR` option to be available. + +Please note that: +- Use of the `FetchContent` module with *non-release* SHA1s or `master` + of libexpat is neither advised nor considered officially supported. +- Pinning to a specific commit is great for robust CI. +- Pinning to a specific commit needs updating every time there is a new + release of libexpat — either manually or through automation —, + to not miss out on libexpat security updates. + +For an example that pulls in libexpat via Git: + +```cmake +cmake_minimum_required(VERSION 3.18) + +include(FetchContent) + +project(hello VERSION 1.0.0) + +FetchContent_Declare( + expat + GIT_REPOSITORY https://github.com/libexpat/libexpat/ + GIT_TAG 000000000_GIT_COMMIT_SHA1_HERE_000000000 # i.e. Git tag R_0_Y_Z + SOURCE_SUBDIR expat/ +) + +FetchContent_MakeAvailable(expat) + +add_executable(hello + hello.c +) + +target_link_libraries(hello PUBLIC expat) +``` + ## Building from a Git Clone diff --git a/contrib/expat/configure.ac b/contrib/expat/configure.ac index 1a930413ffe5..fffcd125e9c4 100644 --- a/contrib/expat/configure.ac +++ b/contrib/expat/configure.ac @@ -84,9 +84,9 @@ dnl dnl If the API changes incompatibly set LIBAGE back to 0 dnl -LIBCURRENT=10 # sync -LIBREVISION=3 # with -LIBAGE=9 # CMakeLists.txt! +LIBCURRENT=11 # sync +LIBREVISION=0 # with +LIBAGE=10 # CMakeLists.txt! AC_CONFIG_HEADERS([expat_config.h]) AH_TOP([#ifndef EXPAT_CONFIG_H diff --git a/contrib/expat/doc/reference.html b/contrib/expat/doc/reference.html index 4cfb2ce9384e..c2ae9bb71431 100644 --- a/contrib/expat/doc/reference.html +++ b/contrib/expat/doc/reference.html @@ -52,7 +52,7 @@

The Expat XML Parser - Release 2.6.3 + Release 2.6.4

diff --git a/contrib/expat/doc/xmlwf.1 b/contrib/expat/doc/xmlwf.1 index 347c36f06109..61b302581ce9 100644 --- a/contrib/expat/doc/xmlwf.1 +++ b/contrib/expat/doc/xmlwf.1 @@ -5,7 +5,7 @@ \\$2 \(la\\$1\(ra\\$3 .. .if \n(.g .mso www.tmac -.TH XMLWF 1 "September 4, 2024" "" "" +.TH XMLWF 1 "November 6, 2024" "" "" .SH NAME xmlwf \- Determines if an XML document is well-formed .SH SYNOPSIS diff --git a/contrib/expat/doc/xmlwf.xml b/contrib/expat/doc/xmlwf.xml index 10b29782b197..cf6d984af463 100644 --- a/contrib/expat/doc/xmlwf.xml +++ b/contrib/expat/doc/xmlwf.xml @@ -21,7 +21,7 @@ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [ Scott"> Bronson"> - September 4, 2024"> + November 6, 2024"> 1"> bronson@rinspin.com"> diff --git a/contrib/expat/examples/element_declarations.c b/contrib/expat/examples/element_declarations.c index 7ce8544f6f04..d644b2ffa5ea 100644 --- a/contrib/expat/examples/element_declarations.c +++ b/contrib/expat/examples/element_declarations.c @@ -15,6 +15,7 @@ Copyright (c) 2016-2024 Sebastian Pipping Copyright (c) 2017 Rhodri James Copyright (c) 2019 Zhongyuan Zhou + Copyright (c) 2024 Hanno Böck Licensed under the MIT license: Permission is hereby granted, free of charge, to any person obtaining @@ -127,15 +128,15 @@ dumpContentModelElement(const XML_Content *model, unsigned level, } // Node - printf("[%u] type=%s(%d), quant=%s(%d)", (unsigned)(model - root), - contentTypeName(model->type), model->type, - contentQuantName(model->quant), model->quant); + printf("[%u] type=%s(%u), quant=%s(%u)", (unsigned)(model - root), + contentTypeName(model->type), (unsigned int)model->type, + contentQuantName(model->quant), (unsigned int)model->quant); if (model->name) { printf(", name=\"%" XML_FMT_STR "\"", model->name); } else { printf(", name=NULL"); } - printf(", numchildren=%d", model->numchildren); + printf(", numchildren=%u", model->numchildren); printf("\n"); } diff --git a/contrib/expat/lib/expat.h b/contrib/expat/lib/expat.h index d0d6015a6628..523b37d8d578 100644 --- a/contrib/expat/lib/expat.h +++ b/contrib/expat/lib/expat.h @@ -130,7 +130,9 @@ enum XML_Error { /* Added in 2.3.0. */ XML_ERROR_NO_BUFFER, /* Added in 2.4.0. */ - XML_ERROR_AMPLIFICATION_LIMIT_BREACH + XML_ERROR_AMPLIFICATION_LIMIT_BREACH, + /* Added in 2.6.4. */ + XML_ERROR_NOT_STARTED, }; enum XML_Content_Type { @@ -1066,7 +1068,7 @@ XML_SetReparseDeferralEnabled(XML_Parser parser, XML_Bool enabled); */ #define XML_MAJOR_VERSION 2 #define XML_MINOR_VERSION 6 -#define XML_MICRO_VERSION 3 +#define XML_MICRO_VERSION 4 #ifdef __cplusplus } diff --git a/contrib/expat/lib/xmlparse.c b/contrib/expat/lib/xmlparse.c index d9285b213b38..a4e091e7c33c 100644 --- a/contrib/expat/lib/xmlparse.c +++ b/contrib/expat/lib/xmlparse.c @@ -1,4 +1,4 @@ -/* ba4cdf9bdb534f355a9def4c9e25d20ee8e72f95b0a4d930be52e563f5080196 (2.6.3+) +/* c5625880f4bf417c1463deee4eb92d86ff413f802048621c57e25fe483eb59e4 (2.6.4+) __ __ _ ___\ \/ /_ __ __ _| |_ / _ \\ /| '_ \ / _` | __| @@ -40,6 +40,7 @@ Copyright (c) 2023 Owain Davies Copyright (c) 2023-2024 Sony Corporation / Snild Dolkow Copyright (c) 2024 Berkay Eren Ürün + Copyright (c) 2024 Hanno Böck Licensed under the MIT license: Permission is hereby granted, free of charge, to any person obtaining @@ -2234,6 +2235,9 @@ XML_StopParser(XML_Parser parser, XML_Bool resumable) { if (parser == NULL) return XML_STATUS_ERROR; switch (parser->m_parsingStatus.parsing) { + case XML_INITIALIZED: + parser->m_errorCode = XML_ERROR_NOT_STARTED; + return XML_STATUS_ERROR; case XML_SUSPENDED: if (resumable) { parser->m_errorCode = XML_ERROR_SUSPENDED; @@ -2244,7 +2248,7 @@ XML_StopParser(XML_Parser parser, XML_Bool resumable) { case XML_FINISHED: parser->m_errorCode = XML_ERROR_FINISHED; return XML_STATUS_ERROR; - default: + case XML_PARSING: if (resumable) { #ifdef XML_DTD if (parser->m_isParamEntity) { @@ -2255,6 +2259,9 @@ XML_StopParser(XML_Parser parser, XML_Bool resumable) { parser->m_parsingStatus.parsing = XML_SUSPENDED; } else parser->m_parsingStatus.parsing = XML_FINISHED; + break; + default: + assert(0); } return XML_STATUS_OK; } @@ -2519,6 +2526,9 @@ XML_ErrorString(enum XML_Error code) { case XML_ERROR_AMPLIFICATION_LIMIT_BREACH: return XML_L( "limit on input amplification factor (from DTD and entities) breached"); + /* Added in 2.6.4. */ + case XML_ERROR_NOT_STARTED: + return XML_L("parser not started"); } return NULL; } @@ -7856,7 +7866,7 @@ accountingReportDiff(XML_Parser rootParser, assert(! rootParser->m_parentParser); fprintf(stderr, - " (+" EXPAT_FMT_PTRDIFF_T("6") " bytes %s|%d, xmlparse.c:%d) %*s\"", + " (+" EXPAT_FMT_PTRDIFF_T("6") " bytes %s|%u, xmlparse.c:%d) %*s\"", bytesMore, (account == XML_ACCOUNT_DIRECT) ? "DIR" : "EXP", levelsAwayFromRootParser, source_line, 10, ""); @@ -7969,7 +7979,7 @@ entityTrackingReportStats(XML_Parser rootParser, ENTITY *entity, fprintf( stderr, - "expat: Entities(%p): Count %9d, depth %2d/%2d %*s%s%s; %s length %d (xmlparse.c:%d)\n", + "expat: Entities(%p): Count %9u, depth %2u/%2u %*s%s%s; %s length %d (xmlparse.c:%d)\n", (void *)rootParser, rootParser->m_entity_stats.countEverOpened, rootParser->m_entity_stats.currentDepth, rootParser->m_entity_stats.maximumDepthSeen, diff --git a/contrib/expat/tests/basic_tests.c b/contrib/expat/tests/basic_tests.c index 0d97b1090c7f..d38b8fd18416 100644 --- a/contrib/expat/tests/basic_tests.c +++ b/contrib/expat/tests/basic_tests.c @@ -2357,11 +2357,20 @@ START_TEST(test_attributes) { info[0].attributes = doc_info; info[1].attributes = tag_info; - XML_SetStartElementHandler(g_parser, counting_start_element_handler); - XML_SetUserData(g_parser, info); - if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE) + XML_Parser parser = XML_ParserCreate(NULL); + assert_true(parser != NULL); + ParserAndElementInfo parserAndElementInfos = { + parser, + info, + }; + + XML_SetStartElementHandler(parser, counting_start_element_handler); + XML_SetUserData(parser, &parserAndElementInfos); + if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text), XML_TRUE) == XML_STATUS_ERROR) - xml_failure(g_parser); + xml_failure(parser); + + XML_ParserFree(parser); } END_TEST diff --git a/contrib/expat/tests/common.c b/contrib/expat/tests/common.c index 26d0c5473a63..3aea8d74d1ee 100644 --- a/contrib/expat/tests/common.c +++ b/contrib/expat/tests/common.c @@ -10,7 +10,7 @@ Copyright (c) 2003 Greg Stein Copyright (c) 2005-2007 Steven Solie Copyright (c) 2005-2012 Karl Waclawek - Copyright (c) 2016-2023 Sebastian Pipping + Copyright (c) 2016-2024 Sebastian Pipping Copyright (c) 2017-2022 Rhodri James Copyright (c) 2017 Joe Orton Copyright (c) 2017 José Gutiérrez de la Concha @@ -51,6 +51,7 @@ #include "chardata.h" #include "minicheck.h" #include "common.h" +#include "handlers.h" /* Common test data */ @@ -221,30 +222,6 @@ _expect_failure(const char *text, enum XML_Error errorCode, _xml_failure(g_parser, file, lineno); } -/* Character data support for handlers, built on top of the code in - * chardata.c - */ -void XMLCALL -accumulate_characters(void *userData, const XML_Char *s, int len) { - CharData_AppendXMLChars((CharData *)userData, s, len); -} - -void XMLCALL -accumulate_attribute(void *userData, const XML_Char *name, - const XML_Char **atts) { - CharData *storage = (CharData *)userData; - UNUSED_P(name); - /* Check there are attributes to deal with */ - if (atts == NULL) - return; - - while (storage->count < 0 && atts[0] != NULL) { - /* "accumulate" the value of the first attribute we see */ - CharData_AppendXMLChars(storage, atts[1], -1); - atts += 2; - } -} - void _run_character_check(const char *text, const XML_Char *expected, const char *file, int line) { @@ -273,12 +250,6 @@ _run_attribute_check(const char *text, const XML_Char *expected, CharData_CheckXMLChars(&storage, expected); } -void XMLCALL -ext_accumulate_characters(void *userData, const XML_Char *s, int len) { - ExtTest *test_data = (ExtTest *)userData; - accumulate_characters(test_data->storage, s, len); -} - void _run_ext_character_check(const char *text, ExtTest *test_data, const XML_Char *expected, const char *file, int line) { diff --git a/contrib/expat/tests/common.h b/contrib/expat/tests/common.h index 52f00cc0eeb0..bc4c7da68071 100644 --- a/contrib/expat/tests/common.h +++ b/contrib/expat/tests/common.h @@ -10,7 +10,7 @@ Copyright (c) 2003 Greg Stein Copyright (c) 2005-2007 Steven Solie Copyright (c) 2005-2012 Karl Waclawek - Copyright (c) 2016-2023 Sebastian Pipping + Copyright (c) 2016-2024 Sebastian Pipping Copyright (c) 2017-2022 Rhodri James Copyright (c) 2017 Joe Orton Copyright (c) 2017 José Gutiérrez de la Concha @@ -111,12 +111,6 @@ extern void _expect_failure(const char *text, enum XML_Error errorCode, /* Support functions for handlers to collect up character and attribute data. */ -extern void XMLCALL accumulate_characters(void *userData, const XML_Char *s, - int len); - -extern void XMLCALL accumulate_attribute(void *userData, const XML_Char *name, - const XML_Char **atts); - extern void _run_character_check(const char *text, const XML_Char *expected, const char *file, int line); @@ -135,9 +129,6 @@ typedef struct ExtTest { CharData *storage; } ExtTest; -extern void XMLCALL ext_accumulate_characters(void *userData, const XML_Char *s, - int len); - extern void _run_ext_character_check(const char *text, ExtTest *test_data, const XML_Char *expected, const char *file, int line); diff --git a/contrib/expat/tests/handlers.c b/contrib/expat/tests/handlers.c index 449ada70f9a2..0211985fe95c 100644 --- a/contrib/expat/tests/handlers.c +++ b/contrib/expat/tests/handlers.c @@ -103,7 +103,9 @@ end_element_event_handler2(void *userData, const XML_Char *name) { void XMLCALL counting_start_element_handler(void *userData, const XML_Char *name, const XML_Char **atts) { - ElementInfo *info = (ElementInfo *)userData; + ParserAndElementInfo *const parserAndElementInfos + = (ParserAndElementInfo *)userData; + ElementInfo *info = parserAndElementInfos->info; AttrInfo *attr; int count, id, i; @@ -120,12 +122,12 @@ counting_start_element_handler(void *userData, const XML_Char *name, * is possibly a little unexpected, but it is what the * documentation in expat.h tells us to expect. */ - count = XML_GetSpecifiedAttributeCount(g_parser); + count = XML_GetSpecifiedAttributeCount(parserAndElementInfos->parser); if (info->attr_count * 2 != count) { fail("Not got expected attribute count"); return; } - id = XML_GetIdAttributeIndex(g_parser); + id = XML_GetIdAttributeIndex(parserAndElementInfos->parser); if (id == -1 && info->id_name != NULL) { fail("ID not present"); return; @@ -1880,12 +1882,6 @@ accumulate_entity_decl(void *userData, const XML_Char *entityName, CharData_AppendXMLChars(storage, XCS("\n"), 1); } -void XMLCALL -accumulate_char_data(void *userData, const XML_Char *s, int len) { - CharData *const storage = (CharData *)userData; - CharData_AppendXMLChars(storage, s, len); -} - void XMLCALL accumulate_start_element(void *userData, const XML_Char *name, const XML_Char **atts) { @@ -1910,6 +1906,34 @@ accumulate_start_element(void *userData, const XML_Char *name, CharData_AppendXMLChars(storage, XCS(")\n"), 2); } +void XMLCALL +accumulate_characters(void *userData, const XML_Char *s, int len) { + CharData *const storage = (CharData *)userData; + CharData_AppendXMLChars(storage, s, len); +} + +void XMLCALL +accumulate_attribute(void *userData, const XML_Char *name, + const XML_Char **atts) { + CharData *const storage = (CharData *)userData; + UNUSED_P(name); + /* Check there are attributes to deal with */ + if (atts == NULL) + return; + + while (storage->count < 0 && atts[0] != NULL) { + /* "accumulate" the value of the first attribute we see */ + CharData_AppendXMLChars(storage, atts[1], -1); + atts += 2; + } +} + +void XMLCALL +ext_accumulate_characters(void *userData, const XML_Char *s, int len) { + ExtTest *const test_data = (ExtTest *)userData; + accumulate_characters(test_data->storage, s, len); +} + void XMLCALL checking_default_handler(void *userData, const XML_Char *s, int len) { DefaultCheck *data = (DefaultCheck *)userData; diff --git a/contrib/expat/tests/handlers.h b/contrib/expat/tests/handlers.h index e1f0995f79e6..8850bb948da3 100644 --- a/contrib/expat/tests/handlers.h +++ b/contrib/expat/tests/handlers.h @@ -92,6 +92,11 @@ typedef struct elementInfo { AttrInfo *attributes; } ElementInfo; +typedef struct StructParserAndElementInfo { + XML_Parser parser; + ElementInfo *info; +} ParserAndElementInfo; + extern void XMLCALL counting_start_element_handler(void *userData, const XML_Char *name, const XML_Char **atts); @@ -564,13 +569,19 @@ extern void XMLCALL accumulate_entity_decl( const XML_Char *systemId, const XML_Char *publicId, const XML_Char *notationName); -extern void XMLCALL accumulate_char_data(void *userData, const XML_Char *s, - int len); - extern void XMLCALL accumulate_start_element(void *userData, const XML_Char *name, const XML_Char **atts); +extern void XMLCALL accumulate_characters(void *userData, const XML_Char *s, + int len); + +extern void XMLCALL accumulate_attribute(void *userData, const XML_Char *name, + const XML_Char **atts); + +extern void XMLCALL ext_accumulate_characters(void *userData, const XML_Char *s, + int len); + typedef struct default_check { const XML_Char *expected; const int expectedLen; diff --git a/contrib/expat/tests/misc_tests.c b/contrib/expat/tests/misc_tests.c index 2ee9320b1392..9afe0922d6b2 100644 --- a/contrib/expat/tests/misc_tests.c +++ b/contrib/expat/tests/misc_tests.c @@ -208,7 +208,7 @@ START_TEST(test_misc_version) { if (! versions_equal(&read_version, &parsed_version)) fail("Version mismatch"); - if (xcstrcmp(version_text, XCS("expat_2.6.3"))) /* needs bump on releases */ + if (xcstrcmp(version_text, XCS("expat_2.6.4"))) /* needs bump on releases */ fail("XML_*_VERSION in expat.h out of sync?\n"); } END_TEST @@ -332,14 +332,15 @@ START_TEST(test_misc_deny_internal_entity_closing_doctype_issue_317) { "'>\n" "\n" "%e;"; - const char *const inputTwo = "'>\n" - "\n" - "%e2;"; + const char *const inputTwo + = "'>\n" + "\n" + "%e2;"; const char *const inputThree = "\n" "\n" - "%e;"; + "%e;/>"; const char *const inputIssue317 = "\n" "Hell'>\n" @@ -447,7 +448,7 @@ START_TEST(test_misc_general_entities_support) { XML_SetExternalEntityRefHandler(parser, external_entity_failer__if_not_xml_ge); XML_SetEntityDeclHandler(parser, accumulate_entity_decl); - XML_SetCharacterDataHandler(parser, accumulate_char_data); + XML_SetCharacterDataHandler(parser, accumulate_characters); if (_XML_Parse_SINGLE_BYTES(parser, doc, (int)strlen(doc), XML_TRUE) != XML_STATUS_OK) { @@ -496,6 +497,28 @@ START_TEST(test_misc_char_handler_stop_without_leak) { } END_TEST +START_TEST(test_misc_resumeparser_not_crashing) { + XML_Parser parser = XML_ParserCreate(NULL); + XML_GetBuffer(parser, 1); + XML_StopParser(parser, /*resumable=*/XML_TRUE); + XML_ResumeParser(parser); // could crash here, previously + XML_ParserFree(parser); +} +END_TEST + +START_TEST(test_misc_stopparser_rejects_unstarted_parser) { + const XML_Bool cases[] = {XML_TRUE, XML_FALSE}; + for (size_t i = 0; i < sizeof(cases) / sizeof(cases[0]); i++) { + const XML_Bool resumable = cases[i]; + XML_Parser parser = XML_ParserCreate(NULL); + assert_true(XML_GetErrorCode(parser) == XML_ERROR_NONE); + assert_true(XML_StopParser(parser, resumable) == XML_STATUS_ERROR); + assert_true(XML_GetErrorCode(parser) == XML_ERROR_NOT_STARTED); + XML_ParserFree(parser); + } +} +END_TEST + void make_miscellaneous_test_case(Suite *s) { TCase *tc_misc = tcase_create("miscellaneous tests"); @@ -520,4 +543,6 @@ make_miscellaneous_test_case(Suite *s) { test_misc_create_external_entity_parser_with_null_context); tcase_add_test(tc_misc, test_misc_general_entities_support); tcase_add_test(tc_misc, test_misc_char_handler_stop_without_leak); + tcase_add_test(tc_misc, test_misc_resumeparser_not_crashing); + tcase_add_test(tc_misc, test_misc_stopparser_rejects_unstarted_parser); } diff --git a/contrib/expat/xmlwf/xmlfile.c b/contrib/expat/xmlwf/xmlfile.c index 0598b86b5fb7..9c4f7f8dbadd 100644 --- a/contrib/expat/xmlwf/xmlfile.c +++ b/contrib/expat/xmlwf/xmlfile.c @@ -15,6 +15,7 @@ Copyright (c) 2017 Rhodri James Copyright (c) 2019 David Loffredo Copyright (c) 2021 Donghee Na + Copyright (c) 2024 Hanno Böck Licensed under the MIT license: Permission is hereby granted, free of charge, to any person obtaining @@ -91,7 +92,8 @@ reportError(XML_Parser parser, const XML_Char *filename) { filename, XML_GetErrorLineNumber(parser), XML_GetErrorColumnNumber(parser), message); else - ftprintf(stderr, T("%s: (unknown message %d)\n"), filename, code); + ftprintf(stderr, T("%s: (unknown message %u)\n"), filename, + (unsigned int)code); } /* This implementation will give problems on files larger than INT_MAX. */ diff --git a/lib/libexpat/Makefile b/lib/libexpat/Makefile index 08c8604e74c5..92ba6b671488 100644 --- a/lib/libexpat/Makefile +++ b/lib/libexpat/Makefile @@ -1,4 +1,3 @@ - PACKAGE= runtime EXPAT= ${SRCTOP}/contrib/expat diff --git a/lib/libexpat/expat_config.h b/lib/libexpat/expat_config.h index 0d581a431a53..2bb52a4baa03 100644 --- a/lib/libexpat/expat_config.h +++ b/lib/libexpat/expat_config.h @@ -89,7 +89,7 @@ #define PACKAGE_NAME "expat" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "expat 2.6.0" +#define PACKAGE_STRING "expat 2.6.4" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "expat" @@ -98,7 +98,7 @@ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "2.6.0" +#define PACKAGE_VERSION "2.6.4" /* Define to 1 if all of the C90 standard headers exist (not just the ones required in a freestanding environment). This macro is provided for @@ -106,7 +106,7 @@ #define STDC_HEADERS 1 /* Version number of package */ -#define VERSION "2.6.0" +#define VERSION "2.6.4" /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ @@ -146,7 +146,4 @@ /* Define to `long int' if does not define. */ /* #undef off_t */ -/* Define to `unsigned int' if does not define. */ -/* #undef size_t */ - #endif // ndef EXPAT_CONFIG_H diff --git a/lib/libexpat/libbsdxml.3 b/lib/libexpat/libbsdxml.3 index 2ec1f71b58bb..21c07d39e5e2 100644 --- a/lib/libexpat/libbsdxml.3 +++ b/lib/libexpat/libbsdxml.3 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\"/ -.Dd October 1, 2024 +.Dd December 8, 2024 .Dt LIBBSDXML 3 .Os .Sh NAME @@ -34,7 +34,7 @@ .Sh DESCRIPTION The .Nm -library is a verbatim copy of the eXpat XML library version 2.6.3. +library is a verbatim copy of the eXpat XML library version 2.6.4. .Pp The .Nm From nobody Sun Dec 22 07:47: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 4YGCss6H0sz5jD1T; Sun, 22 Dec 2024 07:47: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YGCss5cs9z4gRX; Sun, 22 Dec 2024 07:47:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734853633; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GjvB/h7tdndhkrcb6SatK/DFf/Pfe2Qdqfkz5aGkkrg=; b=GFQuRi2wJahbIHoOSprrerIR2+UtoIhtJMuaXIXM4+1yWP3Na4utuMzFz1zzXeFdN9jGog fTHJNJNhVvVVNw4iCaVfIjlNEywNJwvFFN5WsgzCiRtspELX4Z8/A+6uluH7/8YhCqJoRC grlbpRgJ+POFW9xGY85jnMSG75TM+ZHvdJVgkkxorJGXCRyyCexJZkaRnb0pIbatECgg3U 4b6uw/CkUvZ658BrNyz8YAKbCLsLCC5iZYcyCWUnRJpfi8UxI10rDBZHDWxgFQmmlMFMXR IvHd0ZJRuvCwMevrxPXYdp+SxsrfagwM95raWGLoF42oiQuzOPoXC1YytbG0OA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734853633; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GjvB/h7tdndhkrcb6SatK/DFf/Pfe2Qdqfkz5aGkkrg=; b=RCXOb2Rb6ECL/S55xadWP+58ZWCrfikct5RyoAug7TEkdDlKu9ou7SeF6W0eqXdQvlSzl8 SBFWxuhWUnkPmUKeYtWS10nG1NF3C7ivBUmu2up0swChZdILL4qrQry10Q2UESehgoQFi7 Txc0Y5ymagsYbrf0PuYF67dCox9DLOXGzyBA+u8DMIWQzSu31oiYP+BRmiLk2sEkBIqn/N dxYEZuJ4t8IA7cES9t6884OyNRNo1Y2AMk96HVrMvewwPy/MMIEn55lJdVM3GXfr0/iHpE 6JPukTzvNBpLVodh1Ay+IscPiP1tNvo2bDfYmngF/4atkhlwfH+r8MFKESfY1w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734853633; a=rsa-sha256; cv=none; b=GXxTd+R5mptj495ejtWFUyPEjw0OJMyyhYb9juhFbcvDuoT4Y6MS5v/ojUxtgeBSk8QaRw ol5GLL04/60dVfubkNupI1JBZcjjXOtJZHrd0Osn8V3q/FoUhhUl6PlEk1mGpPiVBaC4/0 MlHOO73bxzNhBoPxBfshWAATQNQzbo68C2j53tPN3LmRC1Lmm6sn40muzmX8b0rg6V2/1A LsXKStcNAmzhXPV18G4fP8HC1kJqsUGUiLYbTPQGwpOynULs8N2tSV6Z/upyP5IwJqqxm6 NiRzmWsGUxqcqd0JaMlTiOMWGhHHG2yV/XbYQDxd0TYo9P7nTJMCX65ZrlJ9kw== 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 4YGCss55Q8zyrW; Sun, 22 Dec 2024 07:47:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BM7lDwQ022276; Sun, 22 Dec 2024 07:47:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BM7lDeQ022273; Sun, 22 Dec 2024 07:47:13 GMT (envelope-from git) Date: Sun, 22 Dec 2024 07:47:13 GMT Message-Id: <202412220747.4BM7lDeQ022273@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Xin LI Subject: git: 0bb4c188d363 - stable/14 - MFC: MFV: less v668. 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: delphij X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0bb4c188d363a24b856b9b885717a0dd15c5b2de Auto-Submitted: auto-generated The branch stable/14 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=0bb4c188d363a24b856b9b885717a0dd15c5b2de commit 0bb4c188d363a24b856b9b885717a0dd15c5b2de Author: Xin LI AuthorDate: 2024-12-09 04:50:00 +0000 Commit: Xin LI CommitDate: 2024-12-22 07:46:59 +0000 MFC: MFV: less v668. (cherry picked from commit c77c488926555ca344ae3a417544cf7a720e1de1) --- contrib/less/LICENSE | 2 +- contrib/less/NEWS | 134 ++++++++ contrib/less/brac.c | 2 +- contrib/less/ch.c | 131 ++++---- contrib/less/charset.c | 181 +++++----- contrib/less/charset.h | 2 +- contrib/less/cmd.h | 6 +- contrib/less/cmdbuf.c | 217 ++++++------ contrib/less/command.c | 392 ++++++++++++++-------- contrib/less/compose.uni | 2 +- contrib/less/cvt.c | 33 +- contrib/less/decode.c | 376 +++++++++++++++------ contrib/less/edit.c | 362 ++++++++++---------- contrib/less/evar.c | 192 +++++++++++ contrib/less/filename.c | 430 ++++++++++++------------ contrib/less/fmt.uni | 2 +- contrib/less/forwback.c | 84 +++-- contrib/less/funcs.h | 387 ++++++++++++---------- contrib/less/help.c | 54 +-- contrib/less/ifile.c | 18 +- contrib/less/input.c | 109 +++--- contrib/less/jump.c | 51 ++- contrib/less/lang.h | 57 ++++ contrib/less/less.h | 125 ++++--- contrib/less/less.hlp | 52 ++- contrib/less/less.nro | 389 +++++++++++++++++----- contrib/less/lessecho.c | 15 +- contrib/less/lessecho.nro | 6 +- contrib/less/lesskey.c | 73 ++-- contrib/less/lesskey.h | 24 +- contrib/less/lesskey.nro | 38 ++- contrib/less/lesskey_parse.c | 114 +++++-- contrib/less/lglob.h | 2 +- contrib/less/line.c | 440 ++++++++++++++++-------- contrib/less/linenum.c | 83 +++-- contrib/less/lsystem.c | 17 +- contrib/less/main.c | 272 ++++++++++++--- contrib/less/mark.c | 36 +- contrib/less/optfunc.c | 533 ++++++++++++++++++----------- contrib/less/option.c | 262 ++++++++++----- contrib/less/option.h | 9 +- contrib/less/opttbl.c | 113 ++++--- contrib/less/os.c | 64 ++-- contrib/less/output.c | 501 ++++++++++++++++------------ contrib/less/pattern.c | 40 +-- contrib/less/pattern.h | 6 +- contrib/less/pckeys.h | 2 +- contrib/less/position.c | 70 +++- contrib/less/position.h | 2 +- contrib/less/prompt.c | 112 ++++--- contrib/less/regexp.c | 120 +++---- contrib/less/regexp.h | 14 +- contrib/less/screen.c | 744 ++++++++++++++++++++++++++--------------- contrib/less/scrsize.c | 2 +- contrib/less/search.c | 774 +++++++++++++++++++++++++++++++++++++------ contrib/less/signal.c | 22 +- contrib/less/tags.c | 79 ++--- contrib/less/ttyin.c | 47 ++- contrib/less/ubin.uni | 2 +- contrib/less/version.c | 47 ++- contrib/less/wide.uni | 6 +- contrib/less/xbuf.c | 64 +++- contrib/less/xbuf.h | 13 +- usr.bin/less/Makefile | 2 +- usr.bin/less/defines.h | 62 ++-- 65 files changed, 5718 insertions(+), 2904 deletions(-) diff --git a/contrib/less/LICENSE b/contrib/less/LICENSE index d22cc6070c51..d4f3bf6d1ce6 100644 --- a/contrib/less/LICENSE +++ b/contrib/less/LICENSE @@ -2,7 +2,7 @@ ------------ Less -Copyright (C) 1984-2023 Mark Nudelman +Copyright (C) 1984-2024 Mark Nudelman Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/contrib/less/NEWS b/contrib/less/NEWS index b1f8771c6c31..e869439ea4ee 100644 --- a/contrib/less/NEWS +++ b/contrib/less/NEWS @@ -9,6 +9,140 @@ Report bugs, suggestions or comments at https://github.com/gwsw/less/issues. +====================================================================== + + Major changes between "less" versions 661 and 668 + +* Make 256/true colors work better on Windows without -Da + (github #539, github #546, github #562). + +* Fix build using --with-secure (github #544). + +* Fix crash when using --header on command line (github #545). + +* Fix possible crash when scrolling left/right or toggling -S (github #547). + +* Fix bug when using #stop in a lesskey file (github #551). + +* Fix bug when using --shift or --match-shift on command line with + a parameter starting with '.' (github #554). + +* Fix bug in R command when file size changes (github #553). + +* Fix bug using --header when file does not fill screen (github #556). + +* Fix ^X bug when output is not a terminal (github #558). + +* Fix bug where ^Z is not handled immediately (github #563). + +* Fix bug where first byte from a LESSOPEN filter is deleted if it is + greater than 0x7F (github #568). + +* Fix uninitialized variable in edit_ifile (github #573). + +* Fix incorrect handling of UTF-8 chars in prompts (github #576). + +====================================================================== + + Major changes between "less" versions 643 and 661 + +* Add ^O^N, ^O^P, ^O^L and ^O^O commands and mouse clicks (with --mouse) + to find and open OSC8 hyperlinks (github #251). + +* Add --match-shift option. + +* Add --lesskey-content option (github #447). + +* Add LESSKEY_CONTENT environment variable (github #447). + +* Add --no-search-header-lines and --no-search-header-columns options + (github #397). + +* Add ctrl-L search modifier (github #367). + +* A ctrl-P at the start of a shell command suppresses the "done" + message (github #462). + +* Add attribute characters ('*', '~', '_', '&') to --color + parameter (github #471). + +* Allow expansion of environment variables in lesskey files. + +* Add LESSSECURE_ALLOW environment variable (github #449). + +* Add LESS_UNSUPPORT environment variable. + +* Add line number parameter to --header option (github #436). + +* Mouse right-click jumps to position marked by left-click (github #390). + +* Ensure that the target line is not obscured by a header line + set by --header (github #444). + +* Change default character set to "utf-8", except remains "dos" on MS-DOS. + +* Add message when search with ^W wraps (github #459). + +* UCRT builds on Windows 10 and later now support Unicode file names + (github #438). + +* Improve behavior of interrupt while reading non-terminated pipe + (github #414). + +* Improve parsing of -j, -x and -# options (github #393). + +* Support files larger than 4GB on Windows (github #417). + +* Support entry of Unicode chars larger than U+FFFF on Windows (github #391). + +* Improve colors of bold, underline and standout text on Windows. + +* Allow --rscroll to accept non-ASCII characters (github #483). + +* Allow the parameter to certain options to be terminated with a + space (--color, --quotes, --rscroll, --search-options + and --intr) (github #495). + +* Fix bug where # substitution failed after viewing help (github #420). + +* Fix crash if files are deleted while less is viewing them (github #404). + +* Workaround unreliable ReadConsoleInputW behavior on Windows + with non-ASCII input. + +* Fix -J display when searching for non-ASCII characters (github #422). + +* Don't filter header lines via the & command (github #423). + +* Fix bug when horizontally shifting long lines (github #425). + +* Add -x and -D options to lesstest, to make it easier to diagnose + a failed lesstest run. + +* Fix bug searching long lines with --incsearch and -S (github #428). + +* Fix bug that made ESC-} fail if top line on screen was empty (github #429). + +* Fix bug with --mouse on Windows when used with pipes (github #440). + +* Fix bug in --+OPTION command line syntax. + +* Fix display bug when using -w with an empty line with a CR/LF + line ending (github #474). + +* When substituting '#' or '%' with a filename, quote the filename + if it contains a space (github #480). + +* Fix wrong sleep time when system has usleep but not nanosleep (github #489). + +* Fix bug when file name contains a newline. + +* Fix bug when file name contains nonprintable characters (github #503). + +* Fix DJGPP build (github #497). + +* Update Unicode tables. + ====================================================================== Major changes between "less" versions 633 and 643 diff --git a/contrib/less/brac.c b/contrib/less/brac.c index da4efab8605e..170cd73da516 100644 --- a/contrib/less/brac.c +++ b/contrib/less/brac.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2023 Mark Nudelman + * Copyright (C) 1984-2024 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. diff --git a/contrib/less/ch.c b/contrib/less/ch.c index 51045438a296..336af7792120 100644 --- a/contrib/less/ch.c +++ b/contrib/less/ch.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2023 Mark Nudelman + * Copyright (C) 1984-2024 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -20,13 +20,6 @@ #include #endif -#if HAVE_PROCFS -#include -#if HAVE_LINUX_MAGIC_H -#include -#endif -#endif - typedef POSITION BLOCKNUM; public int ignore_eoi; @@ -46,7 +39,7 @@ struct bufnode { struct buf { struct bufnode node; BLOCKNUM block; - unsigned int datasize; + size_t datasize; unsigned char data[LBUFSIZE]; }; #define bufnode_buf(bn) ((struct buf *) bn) @@ -64,7 +57,7 @@ struct filestate { POSITION fpos; int nbufs; BLOCKNUM block; - unsigned int offset; + size_t offset; POSITION fsize; }; @@ -122,15 +115,14 @@ struct filestate { thisfile->hashtbl[h].hnext = (bn); static struct filestate *thisfile; -static int ch_ungotchar = -1; +static unsigned char ch_ungotchar; +static lbool ch_have_ungotchar = FALSE; static int maxbufs = -1; extern int autobuf; extern int sigs; -extern int secure; -extern int screen_trashed; extern int follow_mode; -extern int waiting_for_data; +extern lbool waiting_for_data; extern constant char helpdata[]; extern constant int size_helpdata; extern IFILE curr_ifile; @@ -141,6 +133,13 @@ extern char *namelogfile; static int ch_addbuf(); +/* + * Return the file position corresponding to an offset within a block. + */ +static POSITION ch_position(BLOCKNUM block, size_t offset) +{ + return (block * LBUFSIZE) + (POSITION) offset; +} /* * Get the character pointed to by the read pointer. @@ -149,8 +148,8 @@ static int ch_get(void) { struct buf *bp; struct bufnode *bn; - int n; - int read_again; + ssize_t n; + lbool read_again; int h; POSITION pos; POSITION len; @@ -187,6 +186,8 @@ static int ch_get(void) goto found; } } + if (ABORT_SIGS()) + return (EOI); if (bn == END_OF_HCHAIN(h)) { /* @@ -223,7 +224,7 @@ static int ch_get(void) for (;;) { - pos = (ch_block * LBUFSIZE) + bp->datasize; + pos = ch_position(ch_block, bp->datasize); if ((len = ch_length()) != NULL_POSITION && pos >= len) /* * At end of file. @@ -239,7 +240,7 @@ static int ch_get(void) */ if (!(ch_flags & CH_CANSEEK)) return ('?'); - if (lseek(ch_file, (off_t)pos, SEEK_SET) == BAD_LSEEK) + if (less_lseek(ch_file, (less_off_t)pos, SEEK_SET) == BAD_LSEEK) { error("seek error", NULL_PARG); clear_eol(); @@ -253,19 +254,18 @@ static int ch_get(void) * If we read less than a full block, that's ok. * We use partial block and pick up the rest next time. */ - if (ch_ungotchar != -1) + if (ch_have_ungotchar) { bp->data[bp->datasize] = ch_ungotchar; n = 1; - ch_ungotchar = -1; + ch_have_ungotchar = FALSE; } else if (ch_flags & CH_HELPFILE) { - bp->data[bp->datasize] = helpdata[ch_fpos]; + bp->data[bp->datasize] = (unsigned char) helpdata[ch_fpos]; n = 1; } else { - n = iread(ch_file, &bp->data[bp->datasize], - (unsigned int)(LBUFSIZE - bp->datasize)); + n = iread(ch_file, &bp->data[bp->datasize], LBUFSIZE - bp->datasize); } read_again = FALSE; @@ -295,12 +295,15 @@ static int ch_get(void) /* * If we have a log file, write the new data to it. */ - if (!secure && logfile >= 0 && n > 0) - write(logfile, (char *) &bp->data[bp->datasize], n); + if (secure_allow(SF_LOGFILE)) + { + if (logfile >= 0 && n > 0) + write(logfile, &bp->data[bp->datasize], (size_t) n); + } #endif ch_fpos += n; - bp->datasize += n; + bp->datasize += (size_t) n; if (n == 0) { @@ -323,7 +326,7 @@ static int ch_get(void) if (ignore_eoi && follow_mode == FOLLOW_NAME && curr_ifile_changed()) { /* screen_trashed=2 causes make_display to reopen the file. */ - screen_trashed = 2; + screen_trashed_num(2); return (EOI); } if (sigs) @@ -363,9 +366,15 @@ static int ch_get(void) */ public void ch_ungetchar(int c) { - if (c != -1 && ch_ungotchar != -1) - error("ch_ungetchar overrun", NULL_PARG); - ch_ungotchar = c; + if (c < 0) + ch_have_ungotchar = FALSE; + else + { + if (ch_have_ungotchar) + error("ch_ungetchar overrun", NULL_PARG); + ch_ungotchar = (unsigned char) c; + ch_have_ungotchar = TRUE; + } } #if LOGFILE @@ -375,7 +384,7 @@ public void ch_ungetchar(int c) */ public void end_logfile(void) { - static int tried = FALSE; + static lbool tried = FALSE; if (logfile < 0) return; @@ -402,7 +411,7 @@ public void sync_logfile(void) { struct buf *bp; struct bufnode *bn; - int warned = FALSE; + lbool warned = FALSE; BLOCKNUM block; BLOCKNUM nblocks; @@ -411,13 +420,13 @@ public void sync_logfile(void) nblocks = (ch_fpos + LBUFSIZE - 1) / LBUFSIZE; for (block = 0; block < nblocks; block++) { - int wrote = FALSE; + lbool wrote = FALSE; FOR_BUFS(bn) { bp = bufnode_buf(bn); if (bp->block == block) { - write(logfile, (char *) bp->data, bp->datasize); + write(logfile, bp->data, bp->datasize); wrote = TRUE; break; } @@ -436,7 +445,7 @@ public void sync_logfile(void) /* * Determine if a specific block is currently in one of the buffers. */ -static int buffered(BLOCKNUM block) +static lbool buffered(BLOCKNUM block) { struct buf *bp; struct bufnode *bn; @@ -486,7 +495,7 @@ public int ch_seek(POSITION pos) * Set read pointer. */ ch_block = new_block; - ch_offset = pos % LBUFSIZE; + ch_offset = (size_t) (pos % LBUFSIZE); return (0); } @@ -533,7 +542,7 @@ public int ch_end_buffer_seek(void) FOR_BUFS(bn) { bp = bufnode_buf(bn); - buf_pos = (bp->block * LBUFSIZE) + bp->datasize; + buf_pos = ch_position(bp->block, bp->datasize); if (buf_pos > end_pos) end_pos = buf_pos; } @@ -597,7 +606,7 @@ public POSITION ch_tell(void) { if (thisfile == NULL) return (NULL_POSITION); - return (ch_block * LBUFSIZE) + ch_offset; + return ch_position(ch_block, ch_offset); } /* @@ -647,14 +656,14 @@ public int ch_back_get(void) * Set max amount of buffer space. * bufspace is in units of 1024 bytes. -1 mean no limit. */ -public void ch_setbufspace(int bufspace) +public void ch_setbufspace(ssize_t bufspace) { if (bufspace < 0) maxbufs = -1; else { - int lbufk = LBUFSIZE / 1024; - maxbufs = bufspace / lbufk + (bufspace % lbufk != 0); + size_t lbufk = LBUFSIZE / 1024; + maxbufs = (int) (bufspace / lbufk + (bufspace % lbufk != 0)); if (maxbufs < 1) maxbufs = 1; } @@ -688,11 +697,6 @@ public void ch_flush(void) bufnode_buf(bn)->block = -1; } - /* - * Figure out the size of the file, if we can. - */ - ch_fsize = filesize(ch_file); - /* * Seek to a known position: the beginning of the file. */ @@ -700,19 +704,16 @@ public void ch_flush(void) ch_block = 0; /* ch_fpos / LBUFSIZE; */ ch_offset = 0; /* ch_fpos % LBUFSIZE; */ - /* - * This is a kludge to workaround a Linux kernel bug: files in - * /proc have a size of 0 according to fstat() but have readable - * data. They are sometimes, but not always, seekable. - * Force them to be non-seekable here. - */ - if (ch_fsize == 0) + if (ch_flags & CH_NOTRUSTSIZE) { ch_fsize = NULL_POSITION; ch_flags &= ~CH_CANSEEK; + } else + { + ch_fsize = (ch_flags & CH_HELPFILE) ? size_helpdata : filesize(ch_file); } - if (lseek(ch_file, (off_t)0, SEEK_SET) == BAD_LSEEK) + if (less_lseek(ch_file, (less_off_t)0, SEEK_SET) == BAD_LSEEK) { /* * Warning only; even if the seek fails for some reason, @@ -795,7 +796,7 @@ public int seekable(int f) return (0); } #endif - return (lseek(f, (off_t)1, SEEK_SET) != BAD_LSEEK); + return (less_lseek(f, (less_off_t)1, SEEK_SET) != BAD_LSEEK); } /* @@ -812,7 +813,7 @@ public void ch_set_eof(void) /* * Initialize file state for a new file. */ -public void ch_init(int f, int flags) +public void ch_init(int f, int flags, ssize_t nread) { /* * See if we already have a filestate for this file. @@ -843,6 +844,22 @@ public void ch_init(int f, int flags) } if (thisfile->file == -1) thisfile->file = f; + + /* + * Figure out the size of the file, if we can. + */ + ch_fsize = (flags & CH_HELPFILE) ? size_helpdata : filesize(ch_file); + + /* + * This is a kludge to workaround a Linux kernel bug: files in some + * pseudo filesystems like /proc and tracefs have a size of 0 according + * to fstat() but have readable data. + */ + if (ch_fsize == 0 && nread > 0) + { + ch_flags |= CH_NOTRUSTSIZE; + } + ch_flush(); } @@ -851,7 +868,7 @@ public void ch_init(int f, int flags) */ public void ch_close(void) { - int keepstate = FALSE; + lbool keepstate = FALSE; if (thisfile == NULL) return; diff --git a/contrib/less/charset.c b/contrib/less/charset.c index 881ebafd02cf..3e8fb0fa9354 100644 --- a/contrib/less/charset.c +++ b/contrib/less/charset.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2023 Mark Nudelman + * Copyright (C) 1984-2024 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -120,8 +120,8 @@ struct cs_alias { #define IS_CONTROL_CHAR 02 static char chardef[256]; -static char *binfmt = NULL; -static char *utfbinfmt = NULL; +static constant char *binfmt = NULL; +static constant char *utfbinfmt = NULL; public int binattr = AT_STANDOUT|AT_COLOR_BIN; static struct xbuffer user_wide_array; @@ -139,13 +139,13 @@ static struct wchar_range_table user_prt_table; static void wchar_range_table_set(struct wchar_range_table *tbl, struct xbuffer *arr) { tbl->table = (struct wchar_range *) arr->data; - tbl->count = arr->end / sizeof(struct wchar_range); + tbl->count = (unsigned int) (arr->end / sizeof(struct wchar_range)); } /* * Skip over a "U" or "U+" prefix before a hex codepoint. */ -static char * skip_uprefix(char *s) +static constant char * skip_uprefix(constant char *s) { if (*s == 'U' || *s == 'u') if (*++s == '+') ++s; @@ -155,14 +155,14 @@ static char * skip_uprefix(char *s) /* * Parse a dash-separated range of hex values. */ -static void wchar_range_get(char **ss, struct wchar_range *range) +static void wchar_range_get(constant char **ss, struct wchar_range *range) { - char *s = skip_uprefix(*ss); - range->first = lstrtoul(s, &s, 16); + constant char *s = skip_uprefix(*ss); + range->first = lstrtoulc(s, &s, 16); if (s[0] == '-') { s = skip_uprefix(&s[1]); - range->last = lstrtoul(s, &s, 16); + range->last = lstrtoulc(s, &s, 16); } else { range->last = range->first; @@ -173,7 +173,7 @@ static void wchar_range_get(char **ss, struct wchar_range *range) /* * Parse the LESSUTFCHARDEF variable. */ -static void ichardef_utf(char *s) +static void ichardef_utf(constant char *s) { xbuf_init(&user_wide_array); xbuf_init(&user_ubin_array); @@ -241,7 +241,7 @@ static void ichardef_utf(char *s) * b binary character * c control character */ -static void ichardef(char *s) +static void ichardef(constant char *s) { char *cp; int n; @@ -298,7 +298,7 @@ static void ichardef(char *s) * Define a charset, given a charset name. * The valid charset names are listed in the "charsets" array. */ -static int icharset(char *name, int no_error) +static int icharset(constant char *name, int no_error) { struct charset *p; struct cs_alias *a; @@ -363,23 +363,8 @@ static void ilocale(void) /* * Define the printing format for control (or binary utf) chars. */ -public void setfmt(char *s, char **fmtvarptr, int *attrptr, char *default_fmt, int for_printf) +public void setfmt(constant char *s, constant char **fmtvarptr, int *attrptr, constant char *default_fmt, lbool for_printf) { - if (s && utf_mode) - { - /* It would be too hard to account for width otherwise. */ - char constant *t = s; - while (*t) - { - if (*t < ' ' || *t > '~') - { - s = default_fmt; - goto attr; - } - t++; - } - } - if (s == NULL || *s == '\0') s = default_fmt; else if (for_printf && @@ -391,7 +376,6 @@ public void setfmt(char *s, char **fmtvarptr, int *attrptr, char *default_fmt, i /* * Select the attributes if it starts with "*". */ - attr: if (*s == '*' && s[1] != '\0') { switch (s[1]) @@ -412,16 +396,7 @@ public void setfmt(char *s, char **fmtvarptr, int *attrptr, char *default_fmt, i */ static void set_charset(void) { - char *s; - -#if MSDOS_COMPILER==WIN32C - /* - * If the Windows console is using UTF-8, we'll use it too. - */ - if (GetConsoleOutputCP() == CP_UTF8) - if (icharset("utf-8", 1)) - return; -#endif + constant char *s; ichardef_utf(lgetenv("LESSUTFCHARDEF")); @@ -476,15 +451,13 @@ static void set_charset(void) ilocale(); #else #if MSDOS_COMPILER - /* - * Default to "dos". - */ +#if MSDOS_COMPILER==WIN32C + (void) icharset("utf-8", 1); +#else (void) icharset("dos", 1); +#endif #else - /* - * Default to "latin1". - */ - (void) icharset("latin1", 1); + (void) icharset("utf-8", 1); #endif #endif } @@ -494,7 +467,7 @@ static void set_charset(void) */ public void init_charset(void) { - char *s; + constant char *s; #if HAVE_LOCALE setlocale(LC_ALL, ""); @@ -512,20 +485,22 @@ public void init_charset(void) /* * Is a given character a "binary" character? */ -public int binary_char(LWCHAR c) +public lbool binary_char(LWCHAR c) { if (utf_mode) return (is_ubin_char(c)); - c &= 0377; - return (chardef[c] & IS_BINARY_CHAR); + if (c >= sizeof(chardef)) + return TRUE; + return ((chardef[c] & IS_BINARY_CHAR) != 0); } /* * Is a given character a "control" character? */ -public int control_char(LWCHAR c) +public lbool control_char(LWCHAR c) { - c &= 0377; + if (c >= sizeof(chardef)) + return TRUE; return (chardef[c] & IS_CONTROL_CHAR); } @@ -533,12 +508,12 @@ public int control_char(LWCHAR c) * Return the printable form of a character. * For example, in the "ascii" charset '\3' is printed as "^C". */ -public char * prchar(LWCHAR c) +public constant char * prchar(LWCHAR c) { - /* {{ This buffer can be overrun if LESSBINFMT is a long string. }} */ + /* {{ Fixed buffer size means LESSBINFMT etc can be truncated. }} */ static char buf[MAX_PRCHAR_LEN+1]; - c &= 0377; + c &= 0377; /*{{type-issue}}*/ if ((c < 128 || !utf_mode) && !control_char(c)) SNPRINTF1(buf, sizeof(buf), "%c", (int) c); else if (c == ESC) @@ -567,7 +542,7 @@ public char * prchar(LWCHAR c) /* * Return the printable form of a UTF-8 character. */ -public char * prutfchar(LWCHAR ch) +public constant char * prutfchar(LWCHAR ch) { static char buf[MAX_PRCHAR_LEN+1]; @@ -596,7 +571,7 @@ public char * prutfchar(LWCHAR ch) /* * Get the length of a UTF-8 character in bytes. */ -public int utf_len(int ch) +public int utf_len(char ch) { if ((ch & 0x80) == 0) return 1; @@ -606,10 +581,12 @@ public int utf_len(int ch) return 3; if ((ch & 0xF8) == 0xF0) return 4; +#if 0 if ((ch & 0xFC) == 0xF8) return 5; if ((ch & 0xFE) == 0xFC) return 6; +#endif /* Invalid UTF-8 encoding. */ return 1; } @@ -617,42 +594,41 @@ public int utf_len(int ch) /* * Does the parameter point to the lead byte of a well-formed UTF-8 character? */ -public int is_utf8_well_formed(char *ss, int slen) +public lbool is_utf8_well_formed(constant char *ss, int slen) { int i; int len; - unsigned char *s = (unsigned char *) ss; + unsigned char s0 = (unsigned char) ss[0]; - if (IS_UTF8_INVALID(s[0])) - return (0); + if (IS_UTF8_INVALID(s0)) + return (FALSE); - len = utf_len(s[0]); + len = utf_len(ss[0]); if (len > slen) - return (0); + return (FALSE); if (len == 1) - return (1); + return (TRUE); if (len == 2) { - if (s[0] < 0xC2) - return (0); + if (s0 < 0xC2) + return (FALSE); } else { - unsigned char mask; - mask = (~((1 << (8-len)) - 1)) & 0xFF; - if (s[0] == mask && (s[1] & mask) == 0x80) - return (0); + unsigned char mask = (unsigned char) (~((1 << (8-len)) - 1)); + if (s0 == mask && (ss[1] & mask) == 0x80) + return (FALSE); } for (i = 1; i < len; i++) - if (!IS_UTF8_TRAIL(s[i])) - return (0); - return (1); + if (!IS_UTF8_TRAIL(ss[i])) + return (FALSE); + return (TRUE); } /* * Skip bytes until a UTF-8 lead byte (11xxxxxx) or ASCII byte (0xxxxxxx) is found. */ -public void utf_skip_to_lead(char **pp, char *limit) +public void utf_skip_to_lead(constant char **pp, constant char *limit) { do { ++(*pp); @@ -663,9 +639,10 @@ public void utf_skip_to_lead(char **pp, char *limit) /* * Get the value of a UTF-8 character. */ -public LWCHAR get_wchar(constant char *p) +public LWCHAR get_wchar(constant char *sp) { - switch (utf_len(p[0])) + constant unsigned char *p = (constant unsigned char *) sp; + switch (utf_len(sp[0])) { case 1: default: @@ -690,6 +667,7 @@ public LWCHAR get_wchar(constant char *p) ((p[1] & 0x3F) << 12) | ((p[2] & 0x3F) << 6) | (p[3] & 0x3F)); +#if 0 case 5: /* 111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx */ return (LWCHAR) ( @@ -707,13 +685,14 @@ public LWCHAR get_wchar(constant char *p) ((p[3] & 0x3F) << 12) | ((p[4] & 0x3F) << 6) | (p[5] & 0x3F)); +#endif } } /* * Store a character into a UTF-8 string. */ -public void put_wchar(char **pp, LWCHAR ch) +public void put_wchar(mutable char **pp, LWCHAR ch) { if (!utf_mode || ch < 0x80) { @@ -737,6 +716,7 @@ public void put_wchar(char **pp, LWCHAR ch) *(*pp)++ = (char) (0x80 | ((ch >> 12) & 0x3F)); *(*pp)++ = (char) (0x80 | ((ch >> 6) & 0x3F)); *(*pp)++ = (char) (0x80 | (ch & 0x3F)); +#if 0 } else if (ch < 0x4000000) { /* 111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx */ @@ -754,17 +734,18 @@ public void put_wchar(char **pp, LWCHAR ch) *(*pp)++ = (char) (0x80 | ((ch >> 12) & 0x3F)); *(*pp)++ = (char) (0x80 | ((ch >> 6) & 0x3F)); *(*pp)++ = (char) (0x80 | (ch & 0x3F)); +#endif } } /* * Step forward or backward one character in a string. */ -public LWCHAR step_char(char **pp, signed int dir, constant char *limit) +public LWCHAR step_charc(constant char **pp, signed int dir, constant char *limit) { LWCHAR ch; int len; - char *p = *pp; + constant char *p = *pp; if (!utf_mode) { @@ -798,6 +779,14 @@ public LWCHAR step_char(char **pp, signed int dir, constant char *limit) return ch; } +public LWCHAR step_char(char **pp, signed int dir, constant char *limit) +{ + constant char *p = (constant char *) *pp; + LWCHAR ch = step_charc(&p, dir, limit); + *pp = (char *) p; + return ch; +} + *** 16754 LINES SKIPPED *** From nobody Sun Dec 22 07:47: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 4YGCtW59mFz5jDLG; Sun, 22 Dec 2024 07:47: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YGCtW4Tvkz4gZq; Sun, 22 Dec 2024 07:47:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734853667; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yoC8U6rvivArhqgYvBdsfyMysiLJDazWCC9QieyRn5o=; b=JvEa9pacJdVwwMjg52OdrDz64nES5UFUABWrPx7Kl/iVFvZiayB/oetiJdftohtIde8sAm nHpMs02KajiNIp+sKjLDql+0hUIuLQIn8Dd3UkogGVFbR2a85a5aJvmMvUOdXPv1/Bec65 G6PEO9SkrDyhvnx5tbWVCNrzYoH9V4jVTJj5rrlyF4YsBvduQkkpJRz+2g7WiE+C9atCL7 O4T1lBUqKQmr5bvZn/xk+gdO8wGWkHA699djnzmhUNUIiaEfouhNj31/7Oh3cZAUCBMqAl gpkKE6dl/ifrW4b/W9kZqrH1+BmpVqV9jS4E9aKLQjBxFAk7V6yVdpOJD0q5vg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734853667; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yoC8U6rvivArhqgYvBdsfyMysiLJDazWCC9QieyRn5o=; b=nQSkOFaz2/7vm2UTe5unYsCoViw1RQBMHmlrRVrgBbtGyTBrU5qb9eUX72/ybzKW8ecROK IH0J4GLyIGjMY+WASaYhWRoBxMBxWsFkkPIfn0X7iET2T9D41lK4MHUwHHIwlKXd3X2JPP 2wEtkkD7ybUabomvmsF4tPwv4OZcXGGxztBEFPBkMyAvaeG5gu7e1fV+om1k7Mr/CBLhcf 2TU2cjXc11rfcOchdRnTcwL1NgOO0lQZJDBiNcROYuWmxPCxFHDZB5KZVeYOaA7FuILZve 52CLBht/5nwlXX38cK8zlwhPSp47TnWoSUTFoMXv3KvYgQDNN8ah4+17MsM17A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734853667; a=rsa-sha256; cv=none; b=Se3WfUBvWuq8EAlk5+oHyZWzpNIxy0CmR9KustVg84VPZeTr6XWhMxUxHoBaHpzMkEBfv+ 7bJtK9xOS92hvSzSqMnJdapwVyW9YGZ84sYhxaF/mQxIaBRdYgNHyT4m1jrEfv5DmH0oBo mTkZqhyM0SymCrg5j+e0ofh4pMZx1ovw9YIQVsbLe2BRRiEKK1hIRGl3gAKHT2/o1Tz/68 E/NtT33hRtbDr6l3NBLCKaxZudcUCk9gxnzFe6aEHa+20mfz08SxnQV4xxJuM2LSy1Z0QS gwdIBqyzb3TuzDcnyO/CGSBYrbQcGrkfHC+Lb6Bdej5kGk8HSp2BmcOzg0/V7g== 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 4YGCtW45mKz10rY; Sun, 22 Dec 2024 07:47:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BM7llXc022579; Sun, 22 Dec 2024 07:47:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BM7llic022576; Sun, 22 Dec 2024 07:47:47 GMT (envelope-from git) Date: Sun, 22 Dec 2024 07:47:47 GMT Message-Id: <202412220747.4BM7llic022576@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Xin LI Subject: git: eed6d080a74f - stable/13 - MFC: MFV: less v668. 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: delphij X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: eed6d080a74f9f74e367a9178b2764780724518c Auto-Submitted: auto-generated The branch stable/13 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=eed6d080a74f9f74e367a9178b2764780724518c commit eed6d080a74f9f74e367a9178b2764780724518c Author: Xin LI AuthorDate: 2024-12-09 04:50:00 +0000 Commit: Xin LI CommitDate: 2024-12-22 07:47:24 +0000 MFC: MFV: less v668. (cherry picked from commit c77c488926555ca344ae3a417544cf7a720e1de1) --- contrib/less/LICENSE | 2 +- contrib/less/NEWS | 134 ++++++++ contrib/less/brac.c | 2 +- contrib/less/ch.c | 131 ++++---- contrib/less/charset.c | 181 +++++----- contrib/less/charset.h | 2 +- contrib/less/cmd.h | 6 +- contrib/less/cmdbuf.c | 217 ++++++------ contrib/less/command.c | 392 ++++++++++++++-------- contrib/less/compose.uni | 2 +- contrib/less/cvt.c | 33 +- contrib/less/decode.c | 376 +++++++++++++++------ contrib/less/edit.c | 362 ++++++++++---------- contrib/less/evar.c | 192 +++++++++++ contrib/less/filename.c | 430 ++++++++++++------------ contrib/less/fmt.uni | 2 +- contrib/less/forwback.c | 84 +++-- contrib/less/funcs.h | 387 ++++++++++++---------- contrib/less/help.c | 54 +-- contrib/less/ifile.c | 18 +- contrib/less/input.c | 109 +++--- contrib/less/jump.c | 51 ++- contrib/less/lang.h | 57 ++++ contrib/less/less.h | 125 ++++--- contrib/less/less.hlp | 52 ++- contrib/less/less.nro | 389 +++++++++++++++++----- contrib/less/lessecho.c | 15 +- contrib/less/lessecho.nro | 6 +- contrib/less/lesskey.c | 73 ++-- contrib/less/lesskey.h | 24 +- contrib/less/lesskey.nro | 38 ++- contrib/less/lesskey_parse.c | 114 +++++-- contrib/less/lglob.h | 2 +- contrib/less/line.c | 440 ++++++++++++++++-------- contrib/less/linenum.c | 83 +++-- contrib/less/lsystem.c | 17 +- contrib/less/main.c | 272 ++++++++++++--- contrib/less/mark.c | 36 +- contrib/less/optfunc.c | 533 ++++++++++++++++++----------- contrib/less/option.c | 262 ++++++++++----- contrib/less/option.h | 9 +- contrib/less/opttbl.c | 113 ++++--- contrib/less/os.c | 64 ++-- contrib/less/output.c | 501 ++++++++++++++++------------ contrib/less/pattern.c | 40 +-- contrib/less/pattern.h | 6 +- contrib/less/pckeys.h | 2 +- contrib/less/position.c | 70 +++- contrib/less/position.h | 2 +- contrib/less/prompt.c | 112 ++++--- contrib/less/regexp.c | 120 +++---- contrib/less/regexp.h | 14 +- contrib/less/screen.c | 744 ++++++++++++++++++++++++++--------------- contrib/less/scrsize.c | 2 +- contrib/less/search.c | 774 +++++++++++++++++++++++++++++++++++++------ contrib/less/signal.c | 22 +- contrib/less/tags.c | 79 ++--- contrib/less/ttyin.c | 47 ++- contrib/less/ubin.uni | 2 +- contrib/less/version.c | 47 ++- contrib/less/wide.uni | 6 +- contrib/less/xbuf.c | 64 +++- contrib/less/xbuf.h | 13 +- usr.bin/less/Makefile | 2 +- usr.bin/less/defines.h | 62 ++-- 65 files changed, 5718 insertions(+), 2904 deletions(-) diff --git a/contrib/less/LICENSE b/contrib/less/LICENSE index d22cc6070c51..d4f3bf6d1ce6 100644 --- a/contrib/less/LICENSE +++ b/contrib/less/LICENSE @@ -2,7 +2,7 @@ ------------ Less -Copyright (C) 1984-2023 Mark Nudelman +Copyright (C) 1984-2024 Mark Nudelman Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/contrib/less/NEWS b/contrib/less/NEWS index b1f8771c6c31..e869439ea4ee 100644 --- a/contrib/less/NEWS +++ b/contrib/less/NEWS @@ -9,6 +9,140 @@ Report bugs, suggestions or comments at https://github.com/gwsw/less/issues. +====================================================================== + + Major changes between "less" versions 661 and 668 + +* Make 256/true colors work better on Windows without -Da + (github #539, github #546, github #562). + +* Fix build using --with-secure (github #544). + +* Fix crash when using --header on command line (github #545). + +* Fix possible crash when scrolling left/right or toggling -S (github #547). + +* Fix bug when using #stop in a lesskey file (github #551). + +* Fix bug when using --shift or --match-shift on command line with + a parameter starting with '.' (github #554). + +* Fix bug in R command when file size changes (github #553). + +* Fix bug using --header when file does not fill screen (github #556). + +* Fix ^X bug when output is not a terminal (github #558). + +* Fix bug where ^Z is not handled immediately (github #563). + +* Fix bug where first byte from a LESSOPEN filter is deleted if it is + greater than 0x7F (github #568). + +* Fix uninitialized variable in edit_ifile (github #573). + +* Fix incorrect handling of UTF-8 chars in prompts (github #576). + +====================================================================== + + Major changes between "less" versions 643 and 661 + +* Add ^O^N, ^O^P, ^O^L and ^O^O commands and mouse clicks (with --mouse) + to find and open OSC8 hyperlinks (github #251). + +* Add --match-shift option. + +* Add --lesskey-content option (github #447). + +* Add LESSKEY_CONTENT environment variable (github #447). + +* Add --no-search-header-lines and --no-search-header-columns options + (github #397). + +* Add ctrl-L search modifier (github #367). + +* A ctrl-P at the start of a shell command suppresses the "done" + message (github #462). + +* Add attribute characters ('*', '~', '_', '&') to --color + parameter (github #471). + +* Allow expansion of environment variables in lesskey files. + +* Add LESSSECURE_ALLOW environment variable (github #449). + +* Add LESS_UNSUPPORT environment variable. + +* Add line number parameter to --header option (github #436). + +* Mouse right-click jumps to position marked by left-click (github #390). + +* Ensure that the target line is not obscured by a header line + set by --header (github #444). + +* Change default character set to "utf-8", except remains "dos" on MS-DOS. + +* Add message when search with ^W wraps (github #459). + +* UCRT builds on Windows 10 and later now support Unicode file names + (github #438). + +* Improve behavior of interrupt while reading non-terminated pipe + (github #414). + +* Improve parsing of -j, -x and -# options (github #393). + +* Support files larger than 4GB on Windows (github #417). + +* Support entry of Unicode chars larger than U+FFFF on Windows (github #391). + +* Improve colors of bold, underline and standout text on Windows. + +* Allow --rscroll to accept non-ASCII characters (github #483). + +* Allow the parameter to certain options to be terminated with a + space (--color, --quotes, --rscroll, --search-options + and --intr) (github #495). + +* Fix bug where # substitution failed after viewing help (github #420). + +* Fix crash if files are deleted while less is viewing them (github #404). + +* Workaround unreliable ReadConsoleInputW behavior on Windows + with non-ASCII input. + +* Fix -J display when searching for non-ASCII characters (github #422). + +* Don't filter header lines via the & command (github #423). + +* Fix bug when horizontally shifting long lines (github #425). + +* Add -x and -D options to lesstest, to make it easier to diagnose + a failed lesstest run. + +* Fix bug searching long lines with --incsearch and -S (github #428). + +* Fix bug that made ESC-} fail if top line on screen was empty (github #429). + +* Fix bug with --mouse on Windows when used with pipes (github #440). + +* Fix bug in --+OPTION command line syntax. + +* Fix display bug when using -w with an empty line with a CR/LF + line ending (github #474). + +* When substituting '#' or '%' with a filename, quote the filename + if it contains a space (github #480). + +* Fix wrong sleep time when system has usleep but not nanosleep (github #489). + +* Fix bug when file name contains a newline. + +* Fix bug when file name contains nonprintable characters (github #503). + +* Fix DJGPP build (github #497). + +* Update Unicode tables. + ====================================================================== Major changes between "less" versions 633 and 643 diff --git a/contrib/less/brac.c b/contrib/less/brac.c index da4efab8605e..170cd73da516 100644 --- a/contrib/less/brac.c +++ b/contrib/less/brac.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2023 Mark Nudelman + * Copyright (C) 1984-2024 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. diff --git a/contrib/less/ch.c b/contrib/less/ch.c index 51045438a296..336af7792120 100644 --- a/contrib/less/ch.c +++ b/contrib/less/ch.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2023 Mark Nudelman + * Copyright (C) 1984-2024 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -20,13 +20,6 @@ #include #endif -#if HAVE_PROCFS -#include -#if HAVE_LINUX_MAGIC_H -#include -#endif -#endif - typedef POSITION BLOCKNUM; public int ignore_eoi; @@ -46,7 +39,7 @@ struct bufnode { struct buf { struct bufnode node; BLOCKNUM block; - unsigned int datasize; + size_t datasize; unsigned char data[LBUFSIZE]; }; #define bufnode_buf(bn) ((struct buf *) bn) @@ -64,7 +57,7 @@ struct filestate { POSITION fpos; int nbufs; BLOCKNUM block; - unsigned int offset; + size_t offset; POSITION fsize; }; @@ -122,15 +115,14 @@ struct filestate { thisfile->hashtbl[h].hnext = (bn); static struct filestate *thisfile; -static int ch_ungotchar = -1; +static unsigned char ch_ungotchar; +static lbool ch_have_ungotchar = FALSE; static int maxbufs = -1; extern int autobuf; extern int sigs; -extern int secure; -extern int screen_trashed; extern int follow_mode; -extern int waiting_for_data; +extern lbool waiting_for_data; extern constant char helpdata[]; extern constant int size_helpdata; extern IFILE curr_ifile; @@ -141,6 +133,13 @@ extern char *namelogfile; static int ch_addbuf(); +/* + * Return the file position corresponding to an offset within a block. + */ +static POSITION ch_position(BLOCKNUM block, size_t offset) +{ + return (block * LBUFSIZE) + (POSITION) offset; +} /* * Get the character pointed to by the read pointer. @@ -149,8 +148,8 @@ static int ch_get(void) { struct buf *bp; struct bufnode *bn; - int n; - int read_again; + ssize_t n; + lbool read_again; int h; POSITION pos; POSITION len; @@ -187,6 +186,8 @@ static int ch_get(void) goto found; } } + if (ABORT_SIGS()) + return (EOI); if (bn == END_OF_HCHAIN(h)) { /* @@ -223,7 +224,7 @@ static int ch_get(void) for (;;) { - pos = (ch_block * LBUFSIZE) + bp->datasize; + pos = ch_position(ch_block, bp->datasize); if ((len = ch_length()) != NULL_POSITION && pos >= len) /* * At end of file. @@ -239,7 +240,7 @@ static int ch_get(void) */ if (!(ch_flags & CH_CANSEEK)) return ('?'); - if (lseek(ch_file, (off_t)pos, SEEK_SET) == BAD_LSEEK) + if (less_lseek(ch_file, (less_off_t)pos, SEEK_SET) == BAD_LSEEK) { error("seek error", NULL_PARG); clear_eol(); @@ -253,19 +254,18 @@ static int ch_get(void) * If we read less than a full block, that's ok. * We use partial block and pick up the rest next time. */ - if (ch_ungotchar != -1) + if (ch_have_ungotchar) { bp->data[bp->datasize] = ch_ungotchar; n = 1; - ch_ungotchar = -1; + ch_have_ungotchar = FALSE; } else if (ch_flags & CH_HELPFILE) { - bp->data[bp->datasize] = helpdata[ch_fpos]; + bp->data[bp->datasize] = (unsigned char) helpdata[ch_fpos]; n = 1; } else { - n = iread(ch_file, &bp->data[bp->datasize], - (unsigned int)(LBUFSIZE - bp->datasize)); + n = iread(ch_file, &bp->data[bp->datasize], LBUFSIZE - bp->datasize); } read_again = FALSE; @@ -295,12 +295,15 @@ static int ch_get(void) /* * If we have a log file, write the new data to it. */ - if (!secure && logfile >= 0 && n > 0) - write(logfile, (char *) &bp->data[bp->datasize], n); + if (secure_allow(SF_LOGFILE)) + { + if (logfile >= 0 && n > 0) + write(logfile, &bp->data[bp->datasize], (size_t) n); + } #endif ch_fpos += n; - bp->datasize += n; + bp->datasize += (size_t) n; if (n == 0) { @@ -323,7 +326,7 @@ static int ch_get(void) if (ignore_eoi && follow_mode == FOLLOW_NAME && curr_ifile_changed()) { /* screen_trashed=2 causes make_display to reopen the file. */ - screen_trashed = 2; + screen_trashed_num(2); return (EOI); } if (sigs) @@ -363,9 +366,15 @@ static int ch_get(void) */ public void ch_ungetchar(int c) { - if (c != -1 && ch_ungotchar != -1) - error("ch_ungetchar overrun", NULL_PARG); - ch_ungotchar = c; + if (c < 0) + ch_have_ungotchar = FALSE; + else + { + if (ch_have_ungotchar) + error("ch_ungetchar overrun", NULL_PARG); + ch_ungotchar = (unsigned char) c; + ch_have_ungotchar = TRUE; + } } #if LOGFILE @@ -375,7 +384,7 @@ public void ch_ungetchar(int c) */ public void end_logfile(void) { - static int tried = FALSE; + static lbool tried = FALSE; if (logfile < 0) return; @@ -402,7 +411,7 @@ public void sync_logfile(void) { struct buf *bp; struct bufnode *bn; - int warned = FALSE; + lbool warned = FALSE; BLOCKNUM block; BLOCKNUM nblocks; @@ -411,13 +420,13 @@ public void sync_logfile(void) nblocks = (ch_fpos + LBUFSIZE - 1) / LBUFSIZE; for (block = 0; block < nblocks; block++) { - int wrote = FALSE; + lbool wrote = FALSE; FOR_BUFS(bn) { bp = bufnode_buf(bn); if (bp->block == block) { - write(logfile, (char *) bp->data, bp->datasize); + write(logfile, bp->data, bp->datasize); wrote = TRUE; break; } @@ -436,7 +445,7 @@ public void sync_logfile(void) /* * Determine if a specific block is currently in one of the buffers. */ -static int buffered(BLOCKNUM block) +static lbool buffered(BLOCKNUM block) { struct buf *bp; struct bufnode *bn; @@ -486,7 +495,7 @@ public int ch_seek(POSITION pos) * Set read pointer. */ ch_block = new_block; - ch_offset = pos % LBUFSIZE; + ch_offset = (size_t) (pos % LBUFSIZE); return (0); } @@ -533,7 +542,7 @@ public int ch_end_buffer_seek(void) FOR_BUFS(bn) { bp = bufnode_buf(bn); - buf_pos = (bp->block * LBUFSIZE) + bp->datasize; + buf_pos = ch_position(bp->block, bp->datasize); if (buf_pos > end_pos) end_pos = buf_pos; } @@ -597,7 +606,7 @@ public POSITION ch_tell(void) { if (thisfile == NULL) return (NULL_POSITION); - return (ch_block * LBUFSIZE) + ch_offset; + return ch_position(ch_block, ch_offset); } /* @@ -647,14 +656,14 @@ public int ch_back_get(void) * Set max amount of buffer space. * bufspace is in units of 1024 bytes. -1 mean no limit. */ -public void ch_setbufspace(int bufspace) +public void ch_setbufspace(ssize_t bufspace) { if (bufspace < 0) maxbufs = -1; else { - int lbufk = LBUFSIZE / 1024; - maxbufs = bufspace / lbufk + (bufspace % lbufk != 0); + size_t lbufk = LBUFSIZE / 1024; + maxbufs = (int) (bufspace / lbufk + (bufspace % lbufk != 0)); if (maxbufs < 1) maxbufs = 1; } @@ -688,11 +697,6 @@ public void ch_flush(void) bufnode_buf(bn)->block = -1; } - /* - * Figure out the size of the file, if we can. - */ - ch_fsize = filesize(ch_file); - /* * Seek to a known position: the beginning of the file. */ @@ -700,19 +704,16 @@ public void ch_flush(void) ch_block = 0; /* ch_fpos / LBUFSIZE; */ ch_offset = 0; /* ch_fpos % LBUFSIZE; */ - /* - * This is a kludge to workaround a Linux kernel bug: files in - * /proc have a size of 0 according to fstat() but have readable - * data. They are sometimes, but not always, seekable. - * Force them to be non-seekable here. - */ - if (ch_fsize == 0) + if (ch_flags & CH_NOTRUSTSIZE) { ch_fsize = NULL_POSITION; ch_flags &= ~CH_CANSEEK; + } else + { + ch_fsize = (ch_flags & CH_HELPFILE) ? size_helpdata : filesize(ch_file); } - if (lseek(ch_file, (off_t)0, SEEK_SET) == BAD_LSEEK) + if (less_lseek(ch_file, (less_off_t)0, SEEK_SET) == BAD_LSEEK) { /* * Warning only; even if the seek fails for some reason, @@ -795,7 +796,7 @@ public int seekable(int f) return (0); } #endif - return (lseek(f, (off_t)1, SEEK_SET) != BAD_LSEEK); + return (less_lseek(f, (less_off_t)1, SEEK_SET) != BAD_LSEEK); } /* @@ -812,7 +813,7 @@ public void ch_set_eof(void) /* * Initialize file state for a new file. */ -public void ch_init(int f, int flags) +public void ch_init(int f, int flags, ssize_t nread) { /* * See if we already have a filestate for this file. @@ -843,6 +844,22 @@ public void ch_init(int f, int flags) } if (thisfile->file == -1) thisfile->file = f; + + /* + * Figure out the size of the file, if we can. + */ + ch_fsize = (flags & CH_HELPFILE) ? size_helpdata : filesize(ch_file); + + /* + * This is a kludge to workaround a Linux kernel bug: files in some + * pseudo filesystems like /proc and tracefs have a size of 0 according + * to fstat() but have readable data. + */ + if (ch_fsize == 0 && nread > 0) + { + ch_flags |= CH_NOTRUSTSIZE; + } + ch_flush(); } @@ -851,7 +868,7 @@ public void ch_init(int f, int flags) */ public void ch_close(void) { - int keepstate = FALSE; + lbool keepstate = FALSE; if (thisfile == NULL) return; diff --git a/contrib/less/charset.c b/contrib/less/charset.c index 881ebafd02cf..3e8fb0fa9354 100644 --- a/contrib/less/charset.c +++ b/contrib/less/charset.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2023 Mark Nudelman + * Copyright (C) 1984-2024 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -120,8 +120,8 @@ struct cs_alias { #define IS_CONTROL_CHAR 02 static char chardef[256]; -static char *binfmt = NULL; -static char *utfbinfmt = NULL; +static constant char *binfmt = NULL; +static constant char *utfbinfmt = NULL; public int binattr = AT_STANDOUT|AT_COLOR_BIN; static struct xbuffer user_wide_array; @@ -139,13 +139,13 @@ static struct wchar_range_table user_prt_table; static void wchar_range_table_set(struct wchar_range_table *tbl, struct xbuffer *arr) { tbl->table = (struct wchar_range *) arr->data; - tbl->count = arr->end / sizeof(struct wchar_range); + tbl->count = (unsigned int) (arr->end / sizeof(struct wchar_range)); } /* * Skip over a "U" or "U+" prefix before a hex codepoint. */ -static char * skip_uprefix(char *s) +static constant char * skip_uprefix(constant char *s) { if (*s == 'U' || *s == 'u') if (*++s == '+') ++s; @@ -155,14 +155,14 @@ static char * skip_uprefix(char *s) /* * Parse a dash-separated range of hex values. */ -static void wchar_range_get(char **ss, struct wchar_range *range) +static void wchar_range_get(constant char **ss, struct wchar_range *range) { - char *s = skip_uprefix(*ss); - range->first = lstrtoul(s, &s, 16); + constant char *s = skip_uprefix(*ss); + range->first = lstrtoulc(s, &s, 16); if (s[0] == '-') { s = skip_uprefix(&s[1]); - range->last = lstrtoul(s, &s, 16); + range->last = lstrtoulc(s, &s, 16); } else { range->last = range->first; @@ -173,7 +173,7 @@ static void wchar_range_get(char **ss, struct wchar_range *range) /* * Parse the LESSUTFCHARDEF variable. */ -static void ichardef_utf(char *s) +static void ichardef_utf(constant char *s) { xbuf_init(&user_wide_array); xbuf_init(&user_ubin_array); @@ -241,7 +241,7 @@ static void ichardef_utf(char *s) * b binary character * c control character */ -static void ichardef(char *s) +static void ichardef(constant char *s) { char *cp; int n; @@ -298,7 +298,7 @@ static void ichardef(char *s) * Define a charset, given a charset name. * The valid charset names are listed in the "charsets" array. */ -static int icharset(char *name, int no_error) +static int icharset(constant char *name, int no_error) { struct charset *p; struct cs_alias *a; @@ -363,23 +363,8 @@ static void ilocale(void) /* * Define the printing format for control (or binary utf) chars. */ -public void setfmt(char *s, char **fmtvarptr, int *attrptr, char *default_fmt, int for_printf) +public void setfmt(constant char *s, constant char **fmtvarptr, int *attrptr, constant char *default_fmt, lbool for_printf) { - if (s && utf_mode) - { - /* It would be too hard to account for width otherwise. */ - char constant *t = s; - while (*t) - { - if (*t < ' ' || *t > '~') - { - s = default_fmt; - goto attr; - } - t++; - } - } - if (s == NULL || *s == '\0') s = default_fmt; else if (for_printf && @@ -391,7 +376,6 @@ public void setfmt(char *s, char **fmtvarptr, int *attrptr, char *default_fmt, i /* * Select the attributes if it starts with "*". */ - attr: if (*s == '*' && s[1] != '\0') { switch (s[1]) @@ -412,16 +396,7 @@ public void setfmt(char *s, char **fmtvarptr, int *attrptr, char *default_fmt, i */ static void set_charset(void) { - char *s; - -#if MSDOS_COMPILER==WIN32C - /* - * If the Windows console is using UTF-8, we'll use it too. - */ - if (GetConsoleOutputCP() == CP_UTF8) - if (icharset("utf-8", 1)) - return; -#endif + constant char *s; ichardef_utf(lgetenv("LESSUTFCHARDEF")); @@ -476,15 +451,13 @@ static void set_charset(void) ilocale(); #else #if MSDOS_COMPILER - /* - * Default to "dos". - */ +#if MSDOS_COMPILER==WIN32C + (void) icharset("utf-8", 1); +#else (void) icharset("dos", 1); +#endif #else - /* - * Default to "latin1". - */ - (void) icharset("latin1", 1); + (void) icharset("utf-8", 1); #endif #endif } @@ -494,7 +467,7 @@ static void set_charset(void) */ public void init_charset(void) { - char *s; + constant char *s; #if HAVE_LOCALE setlocale(LC_ALL, ""); @@ -512,20 +485,22 @@ public void init_charset(void) /* * Is a given character a "binary" character? */ -public int binary_char(LWCHAR c) +public lbool binary_char(LWCHAR c) { if (utf_mode) return (is_ubin_char(c)); - c &= 0377; - return (chardef[c] & IS_BINARY_CHAR); + if (c >= sizeof(chardef)) + return TRUE; + return ((chardef[c] & IS_BINARY_CHAR) != 0); } /* * Is a given character a "control" character? */ -public int control_char(LWCHAR c) +public lbool control_char(LWCHAR c) { - c &= 0377; + if (c >= sizeof(chardef)) + return TRUE; return (chardef[c] & IS_CONTROL_CHAR); } @@ -533,12 +508,12 @@ public int control_char(LWCHAR c) * Return the printable form of a character. * For example, in the "ascii" charset '\3' is printed as "^C". */ -public char * prchar(LWCHAR c) +public constant char * prchar(LWCHAR c) { - /* {{ This buffer can be overrun if LESSBINFMT is a long string. }} */ + /* {{ Fixed buffer size means LESSBINFMT etc can be truncated. }} */ static char buf[MAX_PRCHAR_LEN+1]; - c &= 0377; + c &= 0377; /*{{type-issue}}*/ if ((c < 128 || !utf_mode) && !control_char(c)) SNPRINTF1(buf, sizeof(buf), "%c", (int) c); else if (c == ESC) @@ -567,7 +542,7 @@ public char * prchar(LWCHAR c) /* * Return the printable form of a UTF-8 character. */ -public char * prutfchar(LWCHAR ch) +public constant char * prutfchar(LWCHAR ch) { static char buf[MAX_PRCHAR_LEN+1]; @@ -596,7 +571,7 @@ public char * prutfchar(LWCHAR ch) /* * Get the length of a UTF-8 character in bytes. */ -public int utf_len(int ch) +public int utf_len(char ch) { if ((ch & 0x80) == 0) return 1; @@ -606,10 +581,12 @@ public int utf_len(int ch) return 3; if ((ch & 0xF8) == 0xF0) return 4; +#if 0 if ((ch & 0xFC) == 0xF8) return 5; if ((ch & 0xFE) == 0xFC) return 6; +#endif /* Invalid UTF-8 encoding. */ return 1; } @@ -617,42 +594,41 @@ public int utf_len(int ch) /* * Does the parameter point to the lead byte of a well-formed UTF-8 character? */ -public int is_utf8_well_formed(char *ss, int slen) +public lbool is_utf8_well_formed(constant char *ss, int slen) { int i; int len; - unsigned char *s = (unsigned char *) ss; + unsigned char s0 = (unsigned char) ss[0]; - if (IS_UTF8_INVALID(s[0])) - return (0); + if (IS_UTF8_INVALID(s0)) + return (FALSE); - len = utf_len(s[0]); + len = utf_len(ss[0]); if (len > slen) - return (0); + return (FALSE); if (len == 1) - return (1); + return (TRUE); if (len == 2) { - if (s[0] < 0xC2) - return (0); + if (s0 < 0xC2) + return (FALSE); } else { - unsigned char mask; - mask = (~((1 << (8-len)) - 1)) & 0xFF; - if (s[0] == mask && (s[1] & mask) == 0x80) - return (0); + unsigned char mask = (unsigned char) (~((1 << (8-len)) - 1)); + if (s0 == mask && (ss[1] & mask) == 0x80) + return (FALSE); } for (i = 1; i < len; i++) - if (!IS_UTF8_TRAIL(s[i])) - return (0); - return (1); + if (!IS_UTF8_TRAIL(ss[i])) + return (FALSE); + return (TRUE); } /* * Skip bytes until a UTF-8 lead byte (11xxxxxx) or ASCII byte (0xxxxxxx) is found. */ -public void utf_skip_to_lead(char **pp, char *limit) +public void utf_skip_to_lead(constant char **pp, constant char *limit) { do { ++(*pp); @@ -663,9 +639,10 @@ public void utf_skip_to_lead(char **pp, char *limit) /* * Get the value of a UTF-8 character. */ -public LWCHAR get_wchar(constant char *p) +public LWCHAR get_wchar(constant char *sp) { - switch (utf_len(p[0])) + constant unsigned char *p = (constant unsigned char *) sp; + switch (utf_len(sp[0])) { case 1: default: @@ -690,6 +667,7 @@ public LWCHAR get_wchar(constant char *p) ((p[1] & 0x3F) << 12) | ((p[2] & 0x3F) << 6) | (p[3] & 0x3F)); +#if 0 case 5: /* 111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx */ return (LWCHAR) ( @@ -707,13 +685,14 @@ public LWCHAR get_wchar(constant char *p) ((p[3] & 0x3F) << 12) | ((p[4] & 0x3F) << 6) | (p[5] & 0x3F)); +#endif } } /* * Store a character into a UTF-8 string. */ -public void put_wchar(char **pp, LWCHAR ch) +public void put_wchar(mutable char **pp, LWCHAR ch) { if (!utf_mode || ch < 0x80) { @@ -737,6 +716,7 @@ public void put_wchar(char **pp, LWCHAR ch) *(*pp)++ = (char) (0x80 | ((ch >> 12) & 0x3F)); *(*pp)++ = (char) (0x80 | ((ch >> 6) & 0x3F)); *(*pp)++ = (char) (0x80 | (ch & 0x3F)); +#if 0 } else if (ch < 0x4000000) { /* 111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx */ @@ -754,17 +734,18 @@ public void put_wchar(char **pp, LWCHAR ch) *(*pp)++ = (char) (0x80 | ((ch >> 12) & 0x3F)); *(*pp)++ = (char) (0x80 | ((ch >> 6) & 0x3F)); *(*pp)++ = (char) (0x80 | (ch & 0x3F)); +#endif } } /* * Step forward or backward one character in a string. */ -public LWCHAR step_char(char **pp, signed int dir, constant char *limit) +public LWCHAR step_charc(constant char **pp, signed int dir, constant char *limit) { LWCHAR ch; int len; - char *p = *pp; + constant char *p = *pp; if (!utf_mode) { @@ -798,6 +779,14 @@ public LWCHAR step_char(char **pp, signed int dir, constant char *limit) return ch; } +public LWCHAR step_char(char **pp, signed int dir, constant char *limit) +{ + constant char *p = (constant char *) *pp; + LWCHAR ch = step_charc(&p, dir, limit); + *pp = (char *) p; + return ch; +} + *** 16754 LINES SKIPPED *** From nobody Sun Dec 22 07:49: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 4YGCwc2Wtxz5jDJQ; Sun, 22 Dec 2024 07:49: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YGCwc1gy7z4h1N; Sun, 22 Dec 2024 07:49:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734853776; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7bFdKwQmcYtIjgNiW0quOYnw95riYgjgw3bzofrhEVg=; b=n+lMsvKfZyTQD6tH8jg7eDvF3Bk5oCCyMzwLQjYkc2DCqvj8RSxj2vsvuNoZDMlLVcfr2e kECagdiiOBhLqq3tBSFof1LqC0NOq8272Td54qu5RFWI0zkUDzESTdYejjZLUTClW7NUzk 0ghRimoGf71Dr5JXeonEy1pQFZ6GkO3b83SW3T7V9bO5PTcyGrZjg6b3R4Lrz5SanXTXc5 Ss9tp/QbzKwfHs79vjhNoJqtz7bMcxlJQUF1c82k6FTeLGfJVZoKXjnFikEjAbQBPvoS3x QZOeXUP5TmCdXLjbAHTTNyF9LQ8sq2BFNlFVLQyLIDEzFTJ6WBB4U18tMmfdhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734853776; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7bFdKwQmcYtIjgNiW0quOYnw95riYgjgw3bzofrhEVg=; b=dCB2Qv25hVPdL7hvGe4R8v32DD5r1YNqqkPZfYGM85GnjHCT753of3xOUnrosfHzfP0ryR 7FodiNB48p0wzcRC8/gL06PuG6yiPx+FNZwh9XpgLc8v9utZ1SNOlAYxuLcM33T38PTupL rlFdMQTlhfQ5REQeJfM/DKzjOt0M06DGKsvAt0aOe63moIRhAb/sEyPgMysWQwgsF6WEtU 2jAYD1wxodM1EyWkrL8Vh8W5bBfbLoogzIJ9a1JRA1nhdsjXMcDsRTAGxMpS6mBIlzuEYj ZU873Y737kaqKZQvXhgGooa9WbVVNu02bguuVkceSulBZA9THKWGwYiSVVCRhQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734853776; a=rsa-sha256; cv=none; b=GoRGAWevczokYcYkC/GwcpC2g1kOH8yopIJoq16z+vjnGFJcOoQRBKc9DY97KR0H/7XQ0E 606+It+2cVhnWXqu8Zki3828JmiqEaxAg4DfwX/7idWFQ5y/Wh3gcbTi+L3DKI+30M9FLz R3KWp8dp4IUR/sDRQtYNKonFsivwK9vTzV7G6F8UxEp9W7+3scIvq2yZ6m7TOLE5uqRlyA q6C3hUKiZZYknarzdys9XshUu8dJ3L6ivSdfp+p45Weg+W8ugcW+2YRbcTe6jG8zo8pffh YOoTi5q0ShRRuYruPA9gIDLBwZCK3x50JxNFlW9DgKU8NeVTvv845sX8W6SPcA== 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 4YGCwc1Dk0z103V; Sun, 22 Dec 2024 07:49:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BM7naTF023427; Sun, 22 Dec 2024 07:49:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BM7nanW023424; Sun, 22 Dec 2024 07:49:36 GMT (envelope-from git) Date: Sun, 22 Dec 2024 07:49:36 GMT Message-Id: <202412220749.4BM7nanW023424@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Xin LI Subject: git: 538bf98c7c3a - stable/14 - MFC: hexdump: Do not trust st_size if it equals zero. 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: delphij X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 538bf98c7c3ad65b6fa70cadd86635139c689097 Auto-Submitted: auto-generated The branch stable/14 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=538bf98c7c3ad65b6fa70cadd86635139c689097 commit 538bf98c7c3ad65b6fa70cadd86635139c689097 Author: Ricardo Branco AuthorDate: 2024-01-03 20:17:58 +0000 Commit: Xin LI CommitDate: 2024-12-22 07:49:29 +0000 MFC: hexdump: Do not trust st_size if it equals zero. PR: bin/276106 (cherry picked from commit e23954bd42fe4331b67ba8f6446bcccf751096f1) --- usr.bin/hexdump/display.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/usr.bin/hexdump/display.c b/usr.bin/hexdump/display.c index 6c0018dcef3c..a32585c296ef 100644 --- a/usr.bin/hexdump/display.c +++ b/usr.bin/hexdump/display.c @@ -397,13 +397,14 @@ doskip(const char *fname, int statok) if (statok) { if (fstat(fileno(stdin), &sb)) err(1, "%s", fname); - if (S_ISREG(sb.st_mode) && skip > sb.st_size) { + if (S_ISREG(sb.st_mode) && skip > sb.st_size && sb.st_size > 0) { address += sb.st_size; skip -= sb.st_size; return; } } - if (!statok || S_ISFIFO(sb.st_mode) || S_ISSOCK(sb.st_mode)) { + if (!statok || S_ISFIFO(sb.st_mode) || S_ISSOCK(sb.st_mode) || \ + (S_ISREG(sb.st_mode) && sb.st_size == 0)) { noseek(); return; } From nobody Sun Dec 22 07: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 4YGCwd3Tt9z5jDCX; Sun, 22 Dec 2024 07: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YGCwd2fSZz4h1P; Sun, 22 Dec 2024 07: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=1734853777; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FnfpJq4qEpHvgQfOCb0h0kAPv4NC2HtHFRKvJgaf6Q8=; b=ZcQNZrX0nIkEl+jeEKfsv2uKWZcoa+f35RhhDiwj4w3Sag1YH9l90Svwjvthdx7KuHN4Md jpO07OUm6K31qUoy3IpUvzrOKsLv6oyNQGRIHJDnNWo+Q8CE9dtQRbW/mOGYQv8sRG4w8O nQYWNNk46UvPT2RsCZzEtO2lEFB4aXRbEXAx920wyibV8Kjy5Eyj18lb4yDKPssRrVMP0Y lxRCbwjwASQB7Tg1DhPRD5dJEgJi064rQ/WDlTkc91gU9z0XLwmTFE9hRteUz5dMbGezHX x74N5e7x3RHtj2UeUxTq74X/25CGn3o/Z+kGGorXWk8qms+m7C+RglHLnb9dfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734853777; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FnfpJq4qEpHvgQfOCb0h0kAPv4NC2HtHFRKvJgaf6Q8=; b=WxBoO4ospfsUXOKVbZPh0Bz0mEEOYiCnBdiUWpik/aqW+E9uuele7wUZonIcwxH87+Ukkd XyELYSw0Ak6nFJFlw4bIYMhLGJ8fdaPHViUOvQrybK0eaGjsgk57xF1f8ITzplsCZCURbb PWYcjlHPB5lsf5O6MCtzgpXOvIDmaPp0RxjDbNyaq6dWNWtO3UiFXp22UyPfenrNvzwSL2 zOXxnbX9zSWdinK8w1zyyszdg/oPm4rMVmrHjD43FPym4PDQ0ETLG5Rw2hyHeRGPQAmEx6 AktBUFUsKn2ndBf/pjSmZBy1+mFGpwSL6sLHcB2yCVKD1KkZr3khICvx0+B9yw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734853777; a=rsa-sha256; cv=none; b=g5ncC/Mt39wC1sDcIhGHruAyJ3CaJyUbfgdCrVF7c/q9+hykmlFI56xYnk5Omtk2npBzBX UgskYbb1k+Jhf+5oAsBxZRkPF8JUNfuK9OFl8LaZxDAebMOJRIJicx/o5x+aC31THW4lpA 1lrHg+5LkwJmCa7NzBnqH8SYVq0THJSZiL8f8EPVhCl5hXV+NpZfBC2FlE8+bljCbrhM/Z xA1YQPcrg8AZs9JTWIEerm1ejUpZH08pPVSPE9NQ9xSPpckqC2AzjNy03kLN++/EYRf7X5 k+RwWFKUikK0+EkvkqqVoYkh3ZPtL3qfS8WaBrFJ56LWx/2r+qMU1nddhigSXA== 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 4YGCwd2GzFz10XG; Sun, 22 Dec 2024 07:49:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BM7nbMT023486; Sun, 22 Dec 2024 07:49:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BM7nbEV023483; Sun, 22 Dec 2024 07:49:37 GMT (envelope-from git) Date: Sun, 22 Dec 2024 07:49:37 GMT Message-Id: <202412220749.4BM7nbEV023483@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Xin LI Subject: git: 1c6b4a0f3eb0 - stable/14 - MFC: tail: Do not trust st_size if it equals zero. 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: delphij X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1c6b4a0f3eb089e2eba644b604af40d7dbaff47a Auto-Submitted: auto-generated The branch stable/14 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=1c6b4a0f3eb089e2eba644b604af40d7dbaff47a commit 1c6b4a0f3eb089e2eba644b604af40d7dbaff47a Author: Ricardo Branco AuthorDate: 2024-01-03 20:32:47 +0000 Commit: Xin LI CommitDate: 2024-12-22 07:49:30 +0000 MFC: tail: Do not trust st_size if it equals zero. PR: bin/276107 (cherry picked from commit 1fb3caee72241b9b4dacbfb0109c972a86d4401f) --- usr.bin/tail/forward.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.bin/tail/forward.c b/usr.bin/tail/forward.c index 2edf8730e8b1..afbff43e6063 100644 --- a/usr.bin/tail/forward.c +++ b/usr.bin/tail/forward.c @@ -105,7 +105,7 @@ forward(FILE *fp, const char *fn, enum STYLE style, off_t off, struct stat *sbp) case FBYTES: if (off == 0) break; - if (S_ISREG(sbp->st_mode)) { + if (S_ISREG(sbp->st_mode) && sbp->st_size > 0) { if (sbp->st_size < off) off = sbp->st_size; if (fseeko(fp, off, SEEK_SET) == -1) { @@ -137,7 +137,7 @@ forward(FILE *fp, const char *fn, enum STYLE style, off_t off, struct stat *sbp) } break; case RBYTES: - if (S_ISREG(sbp->st_mode)) { + if (S_ISREG(sbp->st_mode) && sbp->st_size > 0) { if (sbp->st_size >= off && fseeko(fp, -off, SEEK_END) == -1) { ierr(fn); @@ -154,7 +154,7 @@ forward(FILE *fp, const char *fn, enum STYLE style, off_t off, struct stat *sbp) return; break; case RLINES: - if (S_ISREG(sbp->st_mode)) + if (S_ISREG(sbp->st_mode) && sbp->st_size > 0) if (!off) { if (fseeko(fp, (off_t)0, SEEK_END) == -1) { ierr(fn); From nobody Sun Dec 22 07:49: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 4YGCx22tyDz5jDTL; Sun, 22 Dec 2024 07:49:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YGCx22996z4hY2; Sun, 22 Dec 2024 07:49:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734853798; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sQGVsfQvwiWSyhMSD+DK91Ue3/6iL8GHmSArvWuu02Q=; b=ggzf4msdj+/qAAumnichTzg9Y/1Le/QqeaQu79zb9Qw6UEovo7SheCR5+Xvd79DQw/jfKn sm6nJomis3aJjEXcN5xfhJP6ChFMhJbkGDCq/Kb3ApvyYZhFPMlOtfCwnLHQXyn9m7hMqt 83wBKGfN3hqlCmNj88kWwICIV8p9IfhgXTxke/1BZNu2nUhAGWRQfIhefcideWDJp1RDrj I5qRucnMadFFRFkYuWH5i3R/Y4Lgdlwg7Q5FeT9iwpqLmyRoC07deGjZir6JdgUhzLpe5a EfvxOCXsPUKiW6U9pTYuNi30aB4+Vbg6rRFI3gVe3CrY1nT6semgiamz+E27Wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734853798; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sQGVsfQvwiWSyhMSD+DK91Ue3/6iL8GHmSArvWuu02Q=; b=E9IxcXi4i6wpKmJYTe4HMUH5uYLkmvahIwtRXN2JrXAAip23aPfzPUhILKvXMmjadQsMPZ 3uBM5vY+3lnS8eML2nTwjo2XaeGCp4qPb1QGkrS4vOGtv2vr+EhtFRCl98zxaLkp9H+4zh 4JAD82v5xBapftEb166dBAjXUsOGDp/muRRXU+DjojI1aCio/FG10Rl9CP/Li7SxSIn6m9 4dee3tFZ8Fulo5vODYWZ3j0Q2VpjIfW+diXaszw8+AaU87yJqQHo4JXoDQVSBcvYcZJWMW Kv6Iupptev4JWwkXA8k4J9YA1HBN0vqO5NYXbgdCnKARLcH7/+tJGGiBeiluKw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734853798; a=rsa-sha256; cv=none; b=M38MNR1uWtydZqx/l9Ot2nrMCJ6148uzFm2u4nox7j+YyOl6QwDMcVK1fCEKZtbqsKf+FA De7+z/9nv+/69An7GZXvbTf2RLA9lKwYgDFMT0k65PtGkReknuxw0Hh5DASOUKgtnAed+B 2v6AVD+izft9OAjAp2wO3hZmBmO9Ige0lxI6eK9dmX09ZYawnSTvwCFBO1BTNUxVfwwHY7 KVYkbOA1j5/6RCkkOIbjU2l1L/SWT80TbBUTZ3CeYXVAM2+j8Jbe3NgwZtdKLnTY4gQ94y awes5MLxOeClRAQg4WPIazozV0i9zO/z/7BjuZbGfJkoAr/a1paBy8p0oWQ8yQ== 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 4YGCx21nDSz10rc; Sun, 22 Dec 2024 07:49:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BM7nwUh023743; Sun, 22 Dec 2024 07:49:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BM7nwFY023740; Sun, 22 Dec 2024 07:49:58 GMT (envelope-from git) Date: Sun, 22 Dec 2024 07:49:58 GMT Message-Id: <202412220749.4BM7nwFY023740@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Xin LI Subject: git: ff99541a14d7 - stable/13 - MFC: hexdump: Do not trust st_size if it equals zero. 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: delphij X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ff99541a14d7b8cf85e93774e939efde38a469b9 Auto-Submitted: auto-generated The branch stable/13 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=ff99541a14d7b8cf85e93774e939efde38a469b9 commit ff99541a14d7b8cf85e93774e939efde38a469b9 Author: Ricardo Branco AuthorDate: 2024-01-03 20:17:58 +0000 Commit: Xin LI CommitDate: 2024-12-22 07:49:50 +0000 MFC: hexdump: Do not trust st_size if it equals zero. PR: bin/276106 (cherry picked from commit e23954bd42fe4331b67ba8f6446bcccf751096f1) --- usr.bin/hexdump/display.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/usr.bin/hexdump/display.c b/usr.bin/hexdump/display.c index bdcb4ed28170..079c14e8f823 100644 --- a/usr.bin/hexdump/display.c +++ b/usr.bin/hexdump/display.c @@ -393,13 +393,14 @@ doskip(const char *fname, int statok) if (statok) { if (fstat(fileno(stdin), &sb)) err(1, "%s", fname); - if (S_ISREG(sb.st_mode) && skip > sb.st_size) { + if (S_ISREG(sb.st_mode) && skip > sb.st_size && sb.st_size > 0) { address += sb.st_size; skip -= sb.st_size; return; } } - if (!statok || S_ISFIFO(sb.st_mode) || S_ISSOCK(sb.st_mode)) { + if (!statok || S_ISFIFO(sb.st_mode) || S_ISSOCK(sb.st_mode) || \ + (S_ISREG(sb.st_mode) && sb.st_size == 0)) { noseek(); return; } From nobody Sun Dec 22 07:49: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 4YGCx357Qkz5jDGf; Sun, 22 Dec 2024 07:49: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YGCx33NmCz4hQ7; Sun, 22 Dec 2024 07:49:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734853799; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6S0RqYHRL61kASaIYmY4j7r6qdu6tQ97Ue8uBX4J4kE=; b=YRkUkFkE8QBN3OA0gpqMGxe++PbvEWLVzGK3MyJFjlx/wxTg/hY7JeDXzA1hl9Tcwmg0bA WtSSsYr+uqT5xpHdWcNbouLUFoM1wCVESUDF43DY1HZ2zxeWg3gTrpACdtfZQUlw/JaLTh dira33BLJnZrXwxr57H6GFwjCcPl9J6FsxNY/nuPHODjYvYxMcic+wBgjlOfFWzVcfrU1u V6wzw6TO39jp6elyBlI52D6qf+HNld9zhGX8rWVe2T8yB8+KD3UpDgr3swCdn9AQTSuD70 OnZBKTo1J5tHobksrQpX2/830J8E73whTuFb2bdBxfCblViNkcl1BrifStfCzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734853799; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6S0RqYHRL61kASaIYmY4j7r6qdu6tQ97Ue8uBX4J4kE=; b=MZxXyGK7bBOvzMuIZydvcwp3Xuuz0w+ciLrnaO2rfWenbk55RwHNna2d5heEk4jHmR6LNB RCWK3jld317imKKxOpVbZ4p3OtSLi5/PESZnGWfhHI/I6hSeKF4RuGsvnONATpxJQuB9Ip IhW0EHFgIs3exVEM4Hgp/1lYptLtfkM+7GIBJQ7MiKeGDIpXHShzVS8KsLxoEHQpW7wlS1 2utAu6Evf9y7v/SlD+R54msiLUGR1u4HAMTnhvgGzgfDAgCZGeOjw4EkvOdwsLrg9q54Yf jur0IQY4o944o0RZxY4oGR+k3U8sdmx+KLoXyGxAUn+biDhMa8blZ63eoV5nvQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734853799; a=rsa-sha256; cv=none; b=WyN/+0cNq6Siii8mSVFyWDdasFzLs7E+xDRSLlMa4cKDCpOcRPGwc33gRkvbNRS9aaWjAO bmKFDPcKVc5uoQ3T13k0OJCjopbLsJltMiL9EoYX4lpPvvDtn9MF0dEx4eghgZjV6wL1RA DlQTLO+VMJsBc9uHra/yoRwB73vPmiba/TPDRTUyWRX9IkB05GvVypSyYdR/7xRsbJhlgB n3pJzVOmoPUgTw0ZyOqn1RtOMCqXMHCCy5pJhXVr5vfrW7ZT3XnYy2nCJyu0f/UUYfaG2X 3NSq8MVrVWDxNYmLKpQwT0l/WDVyLNTIiLpU9q2riIrbq9obVCNCZ+7eTNqnDQ== 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 4YGCx32qYcz10Yp; Sun, 22 Dec 2024 07:49:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BM7nx4n023812; Sun, 22 Dec 2024 07:49:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BM7nxlR023809; Sun, 22 Dec 2024 07:49:59 GMT (envelope-from git) Date: Sun, 22 Dec 2024 07:49:59 GMT Message-Id: <202412220749.4BM7nxlR023809@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Xin LI Subject: git: 4f20dec1bf17 - stable/13 - MFC: tail: Do not trust st_size if it equals zero. 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: delphij X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4f20dec1bf177408ef04969e5ac0f3523cd6df07 Auto-Submitted: auto-generated The branch stable/13 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=4f20dec1bf177408ef04969e5ac0f3523cd6df07 commit 4f20dec1bf177408ef04969e5ac0f3523cd6df07 Author: Ricardo Branco AuthorDate: 2024-01-03 20:32:47 +0000 Commit: Xin LI CommitDate: 2024-12-22 07:49:51 +0000 MFC: tail: Do not trust st_size if it equals zero. PR: bin/276107 (cherry picked from commit 1fb3caee72241b9b4dacbfb0109c972a86d4401f) --- usr.bin/tail/forward.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.bin/tail/forward.c b/usr.bin/tail/forward.c index 2edf8730e8b1..afbff43e6063 100644 --- a/usr.bin/tail/forward.c +++ b/usr.bin/tail/forward.c @@ -105,7 +105,7 @@ forward(FILE *fp, const char *fn, enum STYLE style, off_t off, struct stat *sbp) case FBYTES: if (off == 0) break; - if (S_ISREG(sbp->st_mode)) { + if (S_ISREG(sbp->st_mode) && sbp->st_size > 0) { if (sbp->st_size < off) off = sbp->st_size; if (fseeko(fp, off, SEEK_SET) == -1) { @@ -137,7 +137,7 @@ forward(FILE *fp, const char *fn, enum STYLE style, off_t off, struct stat *sbp) } break; case RBYTES: - if (S_ISREG(sbp->st_mode)) { + if (S_ISREG(sbp->st_mode) && sbp->st_size > 0) { if (sbp->st_size >= off && fseeko(fp, -off, SEEK_END) == -1) { ierr(fn); @@ -154,7 +154,7 @@ forward(FILE *fp, const char *fn, enum STYLE style, off_t off, struct stat *sbp) return; break; case RLINES: - if (S_ISREG(sbp->st_mode)) + if (S_ISREG(sbp->st_mode) && sbp->st_size > 0) if (!off) { if (fseeko(fp, (off_t)0, SEEK_END) == -1) { ierr(fn);