From nobody Wed Dec 27 17:39:55 2023 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 4T0f6M4Vp8z561wc; Wed, 27 Dec 2023 17:39:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4T0f6M3zHqz3cV0; Wed, 27 Dec 2023 17:39:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703698795; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Xjrv3VxtEazMVhe0SRFLr2OfAyRti+73M2L+QwNIpNo=; b=YPOUKkMh5aCnSF2QoNV36WSZEgWvALZihktz2wsTlL0g0LBtWBTJsF+Yg84PK10mXk+b8R K9Vjai1Ahoup0VxpbC/n0doMP4ANINImMvqgErZMov8Wx93pH7VN8c+dYNBF8HlT0Cjai4 TQcz1oMy1MTtPdY68l4qSRHhzTcN21GXRCpkJ9WceFrvfs8gq/6wFyk7QpzrbnWl9FrFhn KCHCyXTpcjf72o83Lb+ZvZ4+g5TpVDGtoU5N1PQRQkYZlk4bY3zs6utRH1+/F0MSc9G+mD 4M2Qcv7foJLCoWaUjriCdv7y+SH57PZcFCR1QPTTOEKYBNOGhTdodm3UNoJFMg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703698795; a=rsa-sha256; cv=none; b=X870zSYp5Anq0k8EGfVO+XBTvD8vyh2EXChACXSgAFL6UtFkBuSdYByr3R+txn0uwsvhlg zdce7UGHOdT/PM8UzJfaTuCiUQKUZyM0A5DfBZj1ot5D+S3Lck0+5aO2hQwUrstG19Jo2P JdDuksCOaT5t2j8SUgJWhDlPINhFdvc7RovUlwU5eRQy+ZQxnjiuDK4dCQmy7Y37b81jiv hhb5FibH89DybtdLJlw9GSBoOq5bA1blDi6GWCBrTPFmDnLLsqRf+kmAElZeK9Cp13qH4x tpQ0WfHU2NlWhYCfU/wqWoIvSg0sW3B5epT8/8QyKLM56Y9iJ1FfVhGva+8ZLg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703698795; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Xjrv3VxtEazMVhe0SRFLr2OfAyRti+73M2L+QwNIpNo=; b=L3mmK9s+98ocZ8yUog8SlRLIPomtNWE0WpeO1TdrxgCvbyg2UUGnNd0Edjd/wvWKX9l8dz rN1MKXjJKOjVb2MnkdZJWWKEeCz8j60NwOIYgx5VycmRNMlxtbDtdiw81p5ZnzlH76JDz+ I5UgV5xczo13zgY+8FjavRYqv5GwUfoKWc0scX6lhIYInbRdEu0CC+cyi5+Qj+M6A8IH1G 3/kiBafu54jR+5P077pc/jr6qk56qlvt2N/rlOnv2jNGvVRdpc4ZykIpdwZidlsuiO2Ia2 ZnPPiX1mR/PMTyIiSg7TRHpoa2E1u5uuuq8d7H8YWpA9hK8L0j4tbXIFpP2+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 4T0f6M32ppznmH; Wed, 27 Dec 2023 17:39:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BRHdtiC082807; Wed, 27 Dec 2023 17:39:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BRHdt94082804; Wed, 27 Dec 2023 17:39:55 GMT (envelope-from git) Date: Wed, 27 Dec 2023 17:39:55 GMT Message-Id: <202312271739.3BRHdt94082804@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Wolfram Schneider Subject: git: c4368d03e52c - main - 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/main X-Git-Reftype: branch X-Git-Commit: c4368d03e52c7c97d583ee6b81a59510d371ffbb Auto-Submitted: auto-generated The branch main has been updated by wosch: URL: https://cgit.FreeBSD.org/src/commit/?id=c4368d03e52c7c97d583ee6b81a59510d371ffbb commit c4368d03e52c7c97d583ee6b81a59510d371ffbb Author: Wolfram Schneider AuthorDate: 2023-12-27 17:35:08 +0000 Commit: Wolfram Schneider CommitDate: 2023-12-27 17:36:51 +0000 improve handling of shell metacharacters in filenames PR: 275967 MFC after: 1 week --- 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 }