From nobody Fri Feb 16 12:50:53 2024 X-Original-To: dev-commits-src-main@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 4TbsHK5v8Vz5BpQT; Fri, 16 Feb 2024 12: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TbsHK3r7vz4VJp; Fri, 16 Feb 2024 12: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=1708087853; 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=pE48t/P2pnhfTWrh0Xxdf4wj8b7KxbaJKNqdYodYQNo=; b=t3IBFcXbnsinl10D16aKtnmJQUs9i5th9f0jp/afaMEGdY/Iq6o7UX6yWWWRdvusTHSIov R8v3T7FhxRw++b8w++73fvR9ySx7lS3CcESac5Ac1HfEC8uBojJ2NheiykKyDZk1zp3uEh HrIzNE+wNUGkhtMZDEm1/1qv/m8Lhl2EEKYQ5jgY4gl5zwNm916jS2GuI5EPhElH7RNN9V NpRffHVtqb//0RcCLalOD9AsDh1bPUnUac+fIbauKs6YmJIgh0+I55f3LnOS87jJK9AMjq BaUPz3NMyUJhQ9ZktG8+QLbCSFF3oZv90KBOQtwOOZk9dUmOz9Sw5Kji5/CD7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708087853; 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=pE48t/P2pnhfTWrh0Xxdf4wj8b7KxbaJKNqdYodYQNo=; b=tuhYmWV9NghPt4nCtCJUD6sHwt0MWSYi1+lRHFEiqUomrw3xix6cidYwvjgSVQ+qFsQXih aPsjXQn9JDW5itUXzfWnvmEqoSc9OTmL7uPL5eGmVU9HSW1Bw92EIZ3xPLm0Oh9aHMgU67 QSw6iVFiFPULhIkZgPeilYvm41EkTDuHRn2gYwXcOCnivpLk8oQ/a0n5JFpW9EqGKuFFJd G7CTRGjxqhxM9ztcCga6IFGMwvW0rl5PLBu0Mms/znhcUyH7u9is+SUHO8LrW7YJf8Fu0G GiLT0dV0lYWYJpCNUt6FYfpeTowOQDvbBJNeUlX7n41nuTwd1LN9cpK2YkmOBA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708087853; a=rsa-sha256; cv=none; b=BQ+yzQj7k4QNSIkvm85tJ1DT1exRkunUCpwBeseXm9E2k0HjeKQFM55yCaWpfzUG0BwdI5 ff3kev7Xi7x/rFphrWV0YHobOyGrdbpwkCeU08bPEPVNfiuXGoMNveIpX8OuDIS5UcOMm9 t0ESuMyy9yCFeN0KJXX/1BzEO6J3mCJAoYt4wZfd7kASMZaKMbaEPJOmXqbLZOnHY/As/X YVl4wbdKT5xJSOvWbfPVKcaTRADTbeZW44Rp53B+ycECqEOwlvKD9o6DxMkNrgEorIZImL 41rDlcDHKR37O1E8Hbg/ZcOLY2FTYax7WKAHp8XEF5aF1tAKtFnZcMyy288/2Q== 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 4TbsHK2wkPzPq7; Fri, 16 Feb 2024 12:50:53 +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 41GCorCL013876; Fri, 16 Feb 2024 12:50:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41GCorZL013873; Fri, 16 Feb 2024 12:50:53 GMT (envelope-from git) Date: Fri, 16 Feb 2024 12:50:53 GMT Message-Id: <202402161250.41GCorZL013873@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 17d5b027c192 - main - md5: Clean up input stream rights. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 17d5b027c1921d0c6ba2de7993dd808dbf4df078 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=17d5b027c1921d0c6ba2de7993dd808dbf4df078 commit 17d5b027c1921d0c6ba2de7993dd808dbf4df078 Author: Dag-Erling Smørgrav AuthorDate: 2024-02-16 12:37:08 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-02-16 12:37:41 +0000 md5: Clean up input stream rights. Keep it simple, caph_limit_stdio() and fileargs_fopen() already take care of everything for us. MFC after: 1 week Reviewed by: markj, jhb, emaste Differential Revision: https://reviews.freebsd.org/D43897 --- sbin/md5/md5.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/sbin/md5/md5.c b/sbin/md5/md5.c index 2045b623ff57..b6405635a5a1 100644 --- a/sbin/md5/md5.c +++ b/sbin/md5/md5.c @@ -574,7 +574,7 @@ main(int argc, char *argv[]) argv += optind; #ifdef HAVE_CAPSICUM - if (caph_limit_stdout() < 0 || caph_limit_stderr() < 0) + if (caph_limit_stdio() < 0) err(1, "unable to limit rights for stdio"); #endif @@ -629,10 +629,6 @@ main(int argc, char *argv[]) rec = rec->next; continue; } -#ifdef HAVE_CAPSICUM - if (caph_rights_limit(fileno(f), &rights) < 0) - err(1, "capsicum"); -#endif if (cflag && mode != mode_bsd) { checkAgainst = rec->chksum; rec = rec->next; @@ -643,10 +639,6 @@ main(int argc, char *argv[]) MDOutput(&Algorithm[digest], p, filename); } while (*++argv); } else if (!cflag && string == NULL && !skip) { -#ifdef HAVE_CAPSICUM - if (caph_limit_stdin() < 0) - err(1, "capsicum"); -#endif if (mode == mode_bsd) output_mode = output_bare; p = MDInput(&Algorithm[digest], stdin, buf, pflag);