From patchwork Tue Apr 28 06:52:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raghav Gururajan X-Patchwork-Id: 21697 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id C16C827BBE4; Tue, 28 Apr 2020 08:02:52 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 5CA4427BBE1 for ; Tue, 28 Apr 2020 08:02:52 +0100 (BST) Received: from localhost ([::1]:44018 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jTKGZ-0007lH-Sd for patchwork@mira.cbaines.net; Tue, 28 Apr 2020 03:02:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39630) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jTKGD-0007Xl-AF for guix-patches@gnu.org; Tue, 28 Apr 2020 03:02:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jTKFn-00077z-22 for guix-patches@gnu.org; Tue, 28 Apr 2020 03:02:29 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:55371) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jTKFm-00077k-LI for guix-patches@gnu.org; Tue, 28 Apr 2020 03:02:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jTKFm-0005bA-Ij for guix-patches@gnu.org; Tue, 28 Apr 2020 03:02:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#40922] gnu: udevil: Fix loading of setuid-programs. Resent-From: Raghav Gururajan Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 28 Apr 2020 07:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 40922 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: 40922@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.158805731121501 (code B ref -1); Tue, 28 Apr 2020 07:02:02 +0000 Received: (at submit) by debbugs.gnu.org; 28 Apr 2020 07:01:51 +0000 Received: from localhost ([127.0.0.1]:38684 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jTKFb-0005aj-AD for submit@debbugs.gnu.org; Tue, 28 Apr 2020 03:01:51 -0400 Received: from lists.gnu.org ([209.51.188.17]:52182) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jTKFa-0005ac-IM for submit@debbugs.gnu.org; Tue, 28 Apr 2020 03:01:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38754) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jTKB5-0004vS-Qy for guix-patches@gnu.org; Tue, 28 Apr 2020 03:01:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jTK6t-0000j9-4W for guix-patches@gnu.org; Tue, 28 Apr 2020 02:57:07 -0400 Received: from knopi.disroot.org ([178.21.23.139]:44780) by eggs.gnu.org with esmtps (TLS1.2:DHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1jTK6s-0000is-9c for guix-patches@gnu.org; Tue, 28 Apr 2020 02:52:50 -0400 Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 9685727EAF for ; Tue, 28 Apr 2020 08:52:46 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at disroot.org Received: from knopi.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rtK_36gxJVpA for ; Tue, 28 Apr 2020 08:52:45 +0200 (CEST) Date: Tue, 28 Apr 2020 02:52:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1588056765; bh=dSdkWDhgALF6TkK3C3jrmfGkHPgFUjVZNvR2n0oOTVk=; h=Date:From:To:Subject; b=GWCzy2ZEZ0XazYKVsPSuNCwUIDGAVK5sy+L/Es0jiJyGwy8agvOHUzWu47syJz64Y NCqfI7KvPfj1HE/BiwT7rAoROqlsZ3yHC96iM5JxUH6h4MHY2bixSb4f4UE5qCVMwG 4En+IvrUlDuFRirqodvIo4eGKNVPKKL/2KIXyq80QVHhQJkAiWZO6OThC7XK6rtw4U 6M958mFZHHPY7Mtq6kJnK1PtWY2gnlda8b1GBegAU5+inkgcITyQFSrVxw4JdSpfi1 nenmNQEp0f2yZTOr5cIUXQAbBqhNZcuzq67nx9cU4BAfBy42rUdnhuihVB5zNGFh6M TmjsvX0JvT3xQ== From: Raghav Gururajan Message-ID: <20200428025228.09935bde.raghavgururajan@disroot.org> Mime-Version: 1.0 Received-SPF: pass client-ip=178.21.23.139; envelope-from=raghavgururajan@disroot.org; helo=knopi.disroot.org X-detected-operating-system: by eggs.gnu.org: First seen = 2020/04/28 02:52:46 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches From de62f6773a75bffff632f70fa3062b3668462543 Mon Sep 17 00:00:00 2001 From: Raghav Gururajan Date: Tue, 28 Apr 2020 02:29:36 -0400 Subject: [PATCH] gnu: udevil: Fix loading of setuid-programs. * gnu/packages/disk.scm (udevil): Fix loading of setuid-programs. [1] Patched references to mount, umount, losetup and setfacl; as udevil expects these programs to have uid set as root. [2] Patched references to udevil; as udevil itself and devmon expects udevil to have uid set as root. --- gnu/packages/disk.scm | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/gnu/packages/disk.scm b/gnu/packages/disk.scm index b7d3b9d954..2b9ba8e38d 100644 --- a/gnu/packages/disk.scm +++ b/gnu/packages/disk.scm @@ -103,16 +103,34 @@ (build-system gnu-build-system) (arguments `(#:configure-flags - (list "--disable-systemd" - (string-append "--sysconfdir=" - (assoc-ref %outputs "out") - "/etc")) + (list + "--disable-systemd" + (string-append "--sysconfdir=" + (assoc-ref %outputs "out") + "/etc") + ;; udevil expects these programs to be run with uid set as root. + ;; user has to manually add these programs to setuid-programs. + ;; mount and umount are default setuid-programs in guix system. + "--with-mount-prog=/run/setuid-programs/mount" + "--with-umount-prog=/run/setuid-programs/umount" + "--with-losetup-prog=/run/setuid-programs/losetup" + "--with-setfacl-prog=/run/setuid-programs/setfacl") #:phases (modify-phases %standard-phases (add-after 'unpack 'remove-root-reference (lambda _ (substitute* "src/Makefile.in" (("-o root -g root") "")) + #t)) + (add-after 'unpack 'patch-udevil-reference + ;; udevil expects itself to be run with uid set as root. + ;; devmon also expects udevil to be run with uid set as root. + ;; user has to manually add udevil to setuid-programs. + (lambda _ + (substitute* "src/udevil.c" + (("/usr/bin/udevil") "/run/setuid-programs/udevil")) + (substitute* "src/devmon" + (("`which udevil 2>/dev/null`") "/run/setuid-programs/udevil")) #t))))) (native-inputs `(("intltool" ,intltool) -- 2.26.2