From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 12 15:45:18 2023 Received: (at submit) by debbugs.gnu.org; 12 Feb 2023 20:45:18 +0000 Received: from localhost ([127.0.0.1]:46957 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pRJDq-0004VL-Ak for submit@debbugs.gnu.org; Sun, 12 Feb 2023 15:45:18 -0500 Received: from lists.gnu.org ([209.51.188.17]:54442) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pRJDo-0004VD-J1 for submit@debbugs.gnu.org; Sun, 12 Feb 2023 15:45:16 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pRJDn-0002WH-Vy for guix-patches@gnu.org; Sun, 12 Feb 2023 15:45:16 -0500 Received: from tobias.gr ([2a02:c205:2020:6054::1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pRJDk-0000tl-TH for guix-patches@gnu.org; Sun, 12 Feb 2023 15:45:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=2018; bh=48mqN4ozzI93N As3Xg8tnAUTIE+Gv+HIjmMu4HdIqG8=; h=date:subject:to:from; d=tobias.gr; b=ics9WN2xNmUAeM1QmgZA0UdxFCbGY5xRjMsSiKiOItDVR7VSHUPkTVlMdFMMn+7tOj5V l2F+Bj6lyheQnWMVVCsShldzzAQCxD9JTd86+iPquWAaDbEdz2NfjjsPfNgHwV7/4p2K43 mMyzKTTTt6U43NrtdWuKqFbJs3ON8xhXUir+SSKbY9kI7z0eRHHZMEyS6w85eizcyPzfGm n/3fwRXfyhDEWmtrABwSAj1WQorLQEY/37ABn0h58RjwjpHOGM01ChJi4J+MB59ARBRJSi o87HkdhQgN6VkDcHv4cTeVrEwbnvOJAPOF5boT6er2x/Zaw1fkJX6g0FDogRIGmw== Received: by submission.tobias.gr (OpenSMTPD) with ESMTPSA id 552c9a40 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for ; Sun, 12 Feb 2023 20:45:06 +0000 (UTC) From: Tobias Geerinckx-Rice To: guix-patches@gnu.org Subject: Add support for file capabilities(7) Date: Sun, 12 Feb 2023 21:37:54 +0100 BIMI-Selector: v=BIMI1; s=default; Message-ID: <87r0uuehlr.fsf@nckx> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Received-SPF: pass client-ip=2a02:c205:2020:6054::1; envelope-from=me@tobias.gr; helo=tobias.gr X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.6 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.6 (--) --=-=-= Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Hi Guix, I need to offload some of my eternally rebased local patches.=20 Here's one that makes it easy to assign capabilities(7) =E2=80=94=20 currently through setcap(8) =E2=80=94 to programmes like we can=20 set{u,g}id. There are many packages that benefit from this. Mine are: (privileged-programs (cons* (privileged-program (file-append mtr "/sbin/mtr") (capabilities "cap_net_raw+ep")) (privileged-program (file-append nethogs "/sbin/nethogs") (capabilities "cap_net_admin,cap_new_raw+ep")) (privileged-program (file-append light "/bin/light") (setuid? #t)) %default-privileged-programs)) The set's over a year old and needs a bit of love. Some details=20 might have bitrot, I probably forgot a to-do or two in that year,=20 and there's something unguixy about calling setcap(8) instead of=20 writing a completely new Guile binding/module :-) I'm quite opinionated about the setuid-programs unification: there=20 should not be multiple confusing and masking layers of privilege,=20 and it should be possible to setgid a capable executable. Kind regards, T G-R --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iIMEARYKACsWIQT12iAyS4c9C3o4dnINsP+IT1VteQUCY+lQYA0cbWVAdG9iaWFz LmdyAAoJEA2w/4hPVW15h3kBAOtjELUR1tSfAWbx7f7qjNB0pyTrg2RiycYVSiWu cBUuAQC0JQh8dHFZx3vQLwN8HH5iZt2nmiHI49u7qlNWdWiECQ== =RXHi -----END PGP SIGNATURE----- --=-=-=--