From nobody Fri Jan 05 08:18:59 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T5xDz472Sz56Tjq; Fri, 5 Jan 2024 08:18:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4T5xDz3cmGz44XG; Fri, 5 Jan 2024 08:18:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704442739; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2IJKhXn1n7Kxg5i9OhIfxqZGfh5hPK8Ih+1CBliap7o=; b=UMozlaeEE+j1LUzlHZZbsfjXGFYkROj1PWR6jgFw16KtFIpq9mEiRAAvjHReM02fXiCkOI CgznmD2/CVUxF6XYRkZgHQ/hYx3R0gIFvcmUbobvCUfe03mQRnP8xNlW341QKNqSuoiOwR KhVSxTZR/7nWc88uzoRfYQurDxCNtpzs/PVYue+1hrq9PREjiJEdcooUS3TZtrUuvOirqB wOwE+IMnS/U/fRtOVARRK4ttq1n1xt2JhA/2G8z1T3eL0+jV1oV+OURVX+pM02nwV9TgKG Hv9UTLRbI4vPNViBPksTccRtheR5FP/cTbqT5IKvUoLtHW5f/gFcSCXCoWKx8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704442739; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2IJKhXn1n7Kxg5i9OhIfxqZGfh5hPK8Ih+1CBliap7o=; b=HIYTnw2oAg/LAYRZsr7e3s/sgPBJHcUyRjg/p8otRzEALTzg4FDX0+3fRhcXMY7gMxFJ7r vDDlisTrLXpbU6NW5DFUnVVtwZA+VHBao0BOEEQeKvjrJiSoEr7KkQAvKH59hDbNj9AomT cMY6WUFQnxcN9TsaVcT+8aIIpvGod9mIMsNbnW1WJNR8vFJfgTTBUiP9U65ZHD7rFalK92 6135ZkC6S3p9lc8NfaxXgSJzER7Go3qzmTL2JfDZ3LMFRy8M9HyFj2itL3xveVJM/tNeca kGLbFXBZPmhoTCt7fm540nl/gULz+tnxe8YsTV8P6sBQBnbTOzf2alye9W4zYw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704442739; a=rsa-sha256; cv=none; b=aNdP+sjI6dhnPad2I2vHamJs1M1BDSZwq3XhK0fAJ0G9sadrolmiFIcaFCS+L4HiZ3l2Qk vuid4tHb1vU5+mMJCpwe7n8qyM1tF/F9vkIbHWn2/OJSRLPlpMWGzzyYEfZxvK1TqQxze/ 084rR55sNzpKvwmZMt8hsGRmbt/4dl/eTalR0G8h+Zh19y5Z3p+aMVuOW5xeaBSHsWFww0 lbRoeI6oH1xs77Jz23/EXHfeyzgyTnZ5LNrKyEeVP5bR+YHqSzuaQTxoqUcZ4Ed5/TfhCH 5aJ3yypyAUgpXcygBdaR3QPqtG1PJt49dtcqGq5Xxmp3sjHwfD8X5Y9x30HC/g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4T5xDz2ZgtzqVt; Fri, 5 Jan 2024 08:18:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 4058IxaS015955; Fri, 5 Jan 2024 08:18:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4058Ixgx015952; Fri, 5 Jan 2024 08:18:59 GMT (envelope-from git) Date: Fri, 5 Jan 2024 08:18:59 GMT Message-Id: <202401050818.4058Ixgx015952@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Wolfram Schneider Subject: git: c3c8d1f55d4b - stable/14 - improve handling of shell metacharacters in filenames List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wosch X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c3c8d1f55d4be3a39696e5692425ae1d9c36bf77 Auto-Submitted: auto-generated The branch stable/14 has been updated by wosch: URL: https://cgit.FreeBSD.org/src/commit/?id=c3c8d1f55d4be3a39696e5692425ae1d9c36bf77 commit c3c8d1f55d4be3a39696e5692425ae1d9c36bf77 Author: Wolfram Schneider AuthorDate: 2023-12-27 17:35:08 +0000 Commit: Wolfram Schneider CommitDate: 2024-01-05 08:18:01 +0000 improve handling of shell metacharacters in filenames PR: 275967 MFC after: 1 week (cherry picked from commit c4368d03e52c7c97d583ee6b81a59510d371ffbb) --- usr.bin/man/man.sh | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/usr.bin/man/man.sh b/usr.bin/man/man.sh index b18895a91d96..87594699b2c2 100755 --- a/usr.bin/man/man.sh +++ b/usr.bin/man/man.sh @@ -143,8 +143,8 @@ check_cat() { if exists "$1"; then use_cat=yes catpage=$found - setup_cattool $catpage - decho " Found catpage $catpage" + setup_cattool "$catpage" + decho " Found catpage \"$catpage\"" return 0 else return 1 @@ -169,8 +169,8 @@ check_man() { # cat page found and is newer, use that use_cat=yes catpage=$found - setup_cattool $catpage - decho " Using catpage $catpage" + setup_cattool "$catpage" + decho " Using catpage \"$catpage\"" else # no cat page or is older unset use_cat @@ -342,10 +342,10 @@ man_display_page() { ret=0 else if [ $debug -gt 0 ]; then - decho "Command: $cattool $catpage | $MANPAGER" + decho "Command: $cattool \"$catpage\" | $MANPAGER" ret=0 else - eval "$cattool $catpage | $MANPAGER" + eval "$cattool \"$catpage\" | $MANPAGER" ret=$? fi fi @@ -370,7 +370,7 @@ man_display_page() { pipeline="mandoc $mandoc_args | $MANPAGER" fi - if ! eval "$cattool $manpage | $testline" ;then + if ! eval "$cattool \"$manpage\" | $testline" ;then if which -s groff; then man_display_page_groff else @@ -383,10 +383,10 @@ man_display_page() { fi if [ $debug -gt 0 ]; then - decho "Command: $cattool $manpage | $pipeline" + decho "Command: $cattool \"$manpage\" | $pipeline" ret=0 else - eval "$cattool $manpage | $pipeline" + eval "$cattool \"$manpage\" | $pipeline" ret=$? fi } @@ -476,10 +476,10 @@ man_display_page_groff() { fi if [ $debug -gt 0 ]; then - decho "Command: $cattool $manpage | $pipeline" + decho "Command: $cattool \"$manpage\" | $pipeline" ret=0 else - eval "$cattool $manpage | $pipeline" + eval "$cattool \"$manpage\" | $pipeline" ret=$? fi }