From nobody Sun Nov 19 01:15:41 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 4SXt4G29P1z50xv2; Sun, 19 Nov 2023 01:15:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SXt4G1XXKz3SxL; Sun, 19 Nov 2023 01:15:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1700356542; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=n3nU5ca3/7545RXU4UWOJP2F8iD4RNRMqSv7DkP0pdM=; b=mw07GXpcxCnpPc2Pm1FRHTSdR0Q73aScFlXv0bcvn7Gb6EC39hvmNwUXfqazCGUcAMMSHB xk2zV6pvYupZ+0Mr+FF1Zmdr7qiFL+vryZDz0EbbyDnH38qwUQSF661xi1xYUVrYzyUlVF O2oRTPMm2kGBytYZl26tbOw1V+r+C5POtXTZ1rpI1L4RN4xeQQFLwwaqkXO0wcdeTuxzmY pQwRupoNoxA2PBLQUXkDccW/nxoF31b99g8dX53BItpO3lf3VcIYtifw7FWXZdvL4WtOci 05kozyc7b2WJGzxZah6sh1ydQlKtkI+W44FWj17XAOiIQT9QDB92LEc3fx0TjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1700356542; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=n3nU5ca3/7545RXU4UWOJP2F8iD4RNRMqSv7DkP0pdM=; b=vem6lcKoS3wHkW8PixDcfBvSSLtRF93rx8LYBaYrSKEa3H3AaH2uCsoAfvUuk2LUwnXFTd 7ZREMBbSSQoTnGX6D3abzcyQzt6J0jbaab3ujylwJLbFr4ay0OP075e/M1o9/ih0oSvn/R JEGARJDVA0COKlVDr7Dzg+Nxzt0TtMP+YxXL2PnfGCioilDH35YIygVYPb0HkNwNFKLU2T yyVCLMGDjEN/bqhmMPGzvRQPDgfalWQEgrRhjhIRd72uh9Om6cLxsM4fZSZfCwqZ36RTMH DHh0G41uDypCbMquQyQ1TsjVxNdznVv16uKaQHvZrdwLvfT46UrPRTHx12dqaQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1700356542; a=rsa-sha256; cv=none; b=Qytsd6aNFkjwdAyT3u2O2xj1kIvpyjUFR/UthtdXANO+SJBz5T+AwbQKnx8T+/f0VMWhxu 2Rq33rGsHh72dMKSeqGxJrrHkLgLrC76UEOFbvexW46K4LN9gDztcQO/EnCx1H++XiwHku NR4x8if7HXFMzF+4W7nSeJq5mcMgAAztz/JuqDg2OuhaAJ+G0EsycJy9RBHRm7UjE+iK5e +QOLOUCKlyVbknjlSuVRqUi94fXltCwboMQp5vbeOueV6siOekp5gLe/OZ0MZt8RX5P17T nVsfNOHURNoAT/GwVzTXP0WROn59MwmIcEXSew8KgW+nsc3VUUtFEyH6A30HLA== 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 4SXt4G0bkVzq7w; Sun, 19 Nov 2023 01:15:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3AJ1Ff75099880; Sun, 19 Nov 2023 01:15:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3AJ1FfSu099877; Sun, 19 Nov 2023 01:15:41 GMT (envelope-from git) Date: Sun, 19 Nov 2023 01:15:41 GMT Message-Id: <202311190115.3AJ1FfSu099877@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Martin Matuska Subject: git: 3c773cad5706 - main - 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/main X-Git-Reftype: branch X-Git-Commit: 3c773cad57064c23873f286fbec69f6f0305b889 Auto-Submitted: auto-generated The branch main has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=3c773cad57064c23873f286fbec69f6f0305b889 commit 3c773cad57064c23873f286fbec69f6f0305b889 Author: Martin Matuska AuthorDate: 2023-11-19 01:09:34 +0000 Commit: Martin Matuska CommitDate: 2023-11-19 01:14:50 +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. MFC after: 1 week PR: 275099 --- 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 ce7a83d59d5a..c69bbc4911cb 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");