From patchwork Fri Jul 22 04:27:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: muradm X-Patchwork-Id: 40815 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 9366327BBEA; Fri, 22 Jul 2022 05:29:56 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 1364327BBE9 for ; Fri, 22 Jul 2022 05:29:56 +0100 (BST) Received: from localhost ([::1]:51254 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oEkIV-0002iq-7T for patchwork@mira.cbaines.net; Fri, 22 Jul 2022 00:29:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46462) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oEkGg-0001aA-Dj for guix-patches@gnu.org; Fri, 22 Jul 2022 00:28:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:50046) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oEkGg-0000kB-4N for guix-patches@gnu.org; Fri, 22 Jul 2022 00:28:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oEkGf-0000hZ-SS for guix-patches@gnu.org; Fri, 22 Jul 2022 00:28:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#56690] [PATCH] gnu: seatd-service-type: Should use seat group. Resent-From: muradm Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 22 Jul 2022 04:28:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 56690 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 56690@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16584640762683 (code B ref -1); Fri, 22 Jul 2022 04:28:01 +0000 Received: (at submit) by debbugs.gnu.org; 22 Jul 2022 04:27:56 +0000 Received: from localhost ([127.0.0.1]:39795 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oEkGa-0000hD-2T for submit@debbugs.gnu.org; Fri, 22 Jul 2022 00:27:56 -0400 Received: from lists.gnu.org ([209.51.188.17]:36756) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oEkGT-0000gz-Ba for submit@debbugs.gnu.org; Fri, 22 Jul 2022 00:27:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46446) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oEkGT-0001Rh-6q for guix-patches@gnu.org; Fri, 22 Jul 2022 00:27:49 -0400 Received: from nomad-cl1.staging.muradm.net ([139.162.159.157]:53974 helo=nomad-cl1.muradm.net) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oEkGR-0000jG-Ec for guix-patches@gnu.org; Fri, 22 Jul 2022 00:27:48 -0400 Received: from localhost ([127.0.0.1]:46674) by nomad-cl1.muradm.net with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1oEkGB-0004es-0q for guix-patches@gnu.org; Fri, 22 Jul 2022 04:27:31 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=muradm.net; s=mail; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-Id:Date :Subject:To:From:Sender:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=mua2yXN7R2IhKYYRHZvnL0T33OYicTP8O+SBalav4lM=; b=Ip5YCerk9wtSxrKX433I/btste g0ERbawwBn3Q6irvacTfDQupE2AKBQ/cuMxcPqWtdjnQjttY360sDIFn4ok6M1WWygY9btb34jRmD /q+9nDZNklbyiRAnoZAGjAazzaBvM/x46JmX3sV4vZhUo2+zkq8tHtu/Vvlca17k84uFWMWheFRD8 GY1dGqhd5eXPfpNP1JL/0Hg4kxvXczMnFAXIXQXBUSEC+xoqX/eo0WpSMSYLtMs7xa+PG8o4uys9u 9MmsF3u7LHrqCyex3oF2nL6A6AP2zcC99nLcJN1LNkHZJcrnVpv0qXnYXVs9V/b8YAJ8dxONVX9af x4+WbIBvv9Ngr6sN3+DMMqvw0Rp4uMdyL9pPwpPetnkJaB7ewvGiqfXUPbhCiS7wPefkBpKLZLgmV wbIk6wzTjvmyE1OL2WPfnbrk454e7r36CpJ+cXr/N3BL7bCJJENbAJy0PXyYQjHmIlR7+Tduyq4I8 ZFdX+i0y9glYsni4HEZ6gOmR; Received: from muradm by localhost with local (Exim 4.96) (envelope-from ) id 1oEkGP-0006xV-0J for guix-patches@gnu.org; Fri, 22 Jul 2022 07:27:45 +0300 From: muradm Date: Fri, 22 Jul 2022 07:27:45 +0300 Message-Id: <20220722042745.26745-1-mail@muradm.net> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 Received-SPF: pass client-ip=139.162.159.157; envelope-from=mail@muradm.net; helo=nomad-cl1.muradm.net 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_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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 * gnu/services/desktop.scm (seatd-service-type): Uses "seat" group. [extensions]: Added account-service-type with %seatd-accounts. (%seatd-accounts): List with "seat" group. (): [group] Change default value to "seat". * doc/guix.texi: Mention that users may need to become members of "seat" group and update default value for group field. --- doc/guix.texi | 18 +++++++++++++++++- gnu/services/desktop.scm | 8 ++++++-- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 3c5864ec1a..750ed9b121 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -23151,6 +23151,22 @@ input), without requiring the applications needing access to be root. %base-services) @end lisp + +Users which are going to interact with @code{seatd} daemon while logged in +should be added to @code{seat} group. For instance: + +@lisp +(user-account + (name "alice") + (group "users") + (supplementary-groups '("wheel" ;allow use of sudo, etc. + "seat" ;interact with seatd + "audio" ;sound card + "video" ;video devices such as webcams + "cdrom")) ;the good ol' CD-ROM + (comment "Bob's sister")) +@end lisp + @end defvr @deftp {Data Type} seatd-configuration @@ -23163,7 +23179,7 @@ The seatd package to use. @item @code{user} (default: @samp{"root"}) User to own the seatd socket. -@item @code{group} (default: @samp{"users"}) +@item @code{group} (default: @samp{"seat"}) Group to own the seatd socket. @item @code{socket} (default: @samp{"/run/seatd.sock"}) diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm index 29a3722f1b..0d7cd71732 100644 --- a/gnu/services/desktop.scm +++ b/gnu/services/desktop.scm @@ -13,7 +13,7 @@ ;;; Copyright © 2020 Tobias Geerinckx-Rice ;;; Copyright © 2020 Reza Alizadeh Majd ;;; Copyright © 2021 Brice Waegeneire -;;; Copyright © 2021 muradm +;;; Copyright © 2021, 2022 muradm ;;; ;;; This file is part of GNU Guix. ;;; @@ -1646,7 +1646,7 @@ (define-record-type* seatd-configuration seatd-configuration? (seatd seatd-package (default seatd)) (user seatd-user (default "root")) - (group seatd-group (default "users")) + (group seatd-group (default "seat")) (socket seatd-socket (default "/run/seatd.sock")) (logfile seatd-logfile (default "/var/log/seatd.log")) (loglevel seatd-loglevel (default "info"))) @@ -1670,6 +1670,9 @@ (define (seatd-shepherd-service config) #:log-file #$(seatd-logfile config))) (stop #~(make-kill-destructor))))) +(define %seatd-accounts + (list (user-group (name "seat") (system? #t)))) + (define seatd-environment (match-lambda (($ _ _ _ socket) @@ -1683,6 +1686,7 @@ (define seatd-service-type applications needing access to be root.") (extensions (list + (service-extension account-service-type (const %seatd-accounts)) (service-extension session-environment-service-type seatd-environment) ;; TODO: once cgroups is separate dependency we should not mount it here ;; for now it is mounted here, because elogind mounts it