From nobody Sun Nov 26 00:25:59 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 4Sd8dg3Rwtz51w4d; Sun, 26 Nov 2023 00:25: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 4Sd8dg3017z3Gm8; Sun, 26 Nov 2023 00:25:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1700958359; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5Ypl5CyrC6FhcZw9Jb05C9Ixg7l3YYa3SKG7qpvWHQ8=; b=Dk7sxJpH54BzmNG9MThvfEB0xc4zQ/Ep2Auqkyb6poq8G+eBHRNLZS7BWWgfXMntvGpP3p Bd0NFE0Ufak41xsctoy3SsARkBxS00QXxh1lJ2bdcRyocDU+Dw3KpZrvS8YyIKI90ZwSlp 066woMVktroxvCYsKbKWNfVUogB4tJ/wh7xRGb6W3nwgzpshL4O9iAbu2eS+sc/mlVesM4 EHJo66/rqQs3OVCHgkDvT0IW0dZscChHj9Pte7i9OW5oHeSIVcwbDKL4BYy5AWsdLT3QE1 w5uWNQJXTFNB6648B48E8ylWguPQm8qvsJXWjO84dJq50ajWV09mvIMK6seTHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1700958359; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5Ypl5CyrC6FhcZw9Jb05C9Ixg7l3YYa3SKG7qpvWHQ8=; b=vTXzI8m9N96lMoZ8jhx46dT/8Zs1QDeBqGIqvAbJiAaEQ70S/yppwMPo88xkj0Sv0MCbfi ACFv7hqdBSTZrWB3CNWeiGpVVdvwlh/W8TLvABqHiFJZ3mE9e4VboP5IpgxA/S0e9SQWTS ljs6ZDHXWk+cw83ipe47DYtUsFwLH7DNQfy3ZMRMA8TBwyhnn6cAHrf/kip/YBEaQEDCAN 54fZ/xVePEqwi4cnkE0kmWP3PeumFJOtxRRFZRVQsZQBayqF6vez17Yh/Nwvue3TaP3Q9y PCRrxLDs446heX1ZpnaLFgGkxoBEgEAgeL3duoezY5ZzQa4D0DReixNwv3Nt/Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1700958359; a=rsa-sha256; cv=none; b=cVMIxb31XD889uJ7dwiHuj1yL/Mpgk5U4yrElywFOw8dVdg8bUNF+dHLdCXQl8p13/bMDu pkKMkcp8cl2X4GLk3fGJ8ZH+2Ms+XZpz5MnjgobKK1NUi+ByaJ2OfrkB30jGYSYED8vYU/ 4ib+XGInGPDZiP/nFqe8K3xNEPOi2ttHZTi1kcyNjG7fvA6fiIaLjfTcVV88YVOhr/oBm8 d+IUBe/AxhCp41mp/B1Ttu+s9dyAKReyTI4Zl6diaUL03gkT2+YApuPRo3/JqTtSj0yp8I O5aR8/Q6COJTg+H+jeql0bn2EDFjIjzgjEhkV/HwmmXeqWXsRNYs1i42a5/eOw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sd8dg254KzZcd; Sun, 26 Nov 2023 00:25: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 3AQ0Px9g057185; Sun, 26 Nov 2023 00:25:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3AQ0Pxme057182; Sun, 26 Nov 2023 00:25:59 GMT (envelope-from git) Date: Sun, 26 Nov 2023 00:25:59 GMT Message-Id: <202311260025.3AQ0Pxme057182@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Martin Matuska Subject: git: a4d16707a81b - stable/14 - cat: fallback on EISDIR with copy_file_range(2) 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: mm X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a4d16707a81b13cb711a4a75843d5d24486de150 Auto-Submitted: auto-generated The branch stable/14 has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=a4d16707a81b13cb711a4a75843d5d24486de150 commit a4d16707a81b13cb711a4a75843d5d24486de150 Author: Martin Matuska AuthorDate: 2023-11-19 01:09:34 +0000 Commit: Martin Matuska CommitDate: 2023-11-26 00:24:42 +0000 cat: fallback on EISDIR with copy_file_range(2) The filesystem may support reading directories directly when security.bsd.allow_read_dir is set. PR: 275099 (cherry picked from commit 3c773cad57064c23873f286fbec69f6f0305b889) --- bin/cat/cat.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/cat/cat.c b/bin/cat/cat.c index ec14451acd0c..1468faf494a3 100644 --- a/bin/cat/cat.c +++ b/bin/cat/cat.c @@ -281,7 +281,8 @@ scanfiles(char *argv[], int cooked __unused) } else { #ifndef BOOTSTRAP_CAT if (in_kernel_copy(fd) == -1) { - if (errno == EINVAL || errno == EBADF) + if (errno == EINVAL || errno == EBADF || + errno == EISDIR) raw_cat(fd); else err(1, "stdout");