From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id qLnHDTUKI2T89QAASxT56A (envelope-from ) for ; Tue, 28 Mar 2023 17:39:33 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id cMWPDTUKI2Q3WgEAauVa8A (envelope-from ) for ; Tue, 28 Mar 2023 17:39:33 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id E6AB1C9E0 for ; Tue, 28 Mar 2023 17:39:32 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=V9KApMMq; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1680017973; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=dZ9SyFlQ677cb/JfrgXMFPQmvlH0kEmGZel+WFvf1dw=; b=u1gS3yIucOHe+72PjLU9qjU79AtgZhNV/vGoY6Ijx1QdUpdIyGG5wP01cTijzdJFYr17vV WsjWjdE6v4TP2em9HB7ZP2QxVbo2HlAZeAMDyzOUN8p6uhE6+2XojD2jMBfz+qIOm3JmLp 3WmPVEhQ/x5DqUq07Uul7/VEatmDdUhG+uQ0f5MENXlYxfz9ayDHMA0t1you9B8FW8RE11 shoeLBASPHTdrGtuL9/qtVPt3tUCHrYZ22SggdNHoas3K+Zk/e5lRD0Q2e1y545dY/COWI QhTtN2OSaMW9QtFJ/IcYXKDa8ynpByhajLWqg+6TmL2nyw+O2Kg3JHDfkdrXJw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1680017973; a=rsa-sha256; cv=none; b=NkhWmvfFuDC5lywMqFsfUfuMhg10KtShwYleg07dLxQ7J+lWnbyMWADNCl6vXQfZ8i6PVF h6f7288+C4gSXekS+6bW0fAFhrFpaiOhUKhufH8lxPJWWxsqAwMONCmDOsAWa23w/yXF+L PXWwxF3gsLzlF6VVaWP4HWFUkVPdQBntnwAdiVTgrnFFHej+ImfgnpKT4+vBx1zNBmAjRg +5whnZx0srM1kyS8Qis9DgF5/LHhiZ7+9EyrYvW6yF1j4T0uquX2yR2xIBsMWWQlONhniB s4N+J7p+ECtXmdLYv6hmX1dllO7ceBRqLf5b5GUpQH+Qn7wdbtLmSbv5Jb9yuw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=V9KApMMq; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1phBPd-0008MO-JJ; Tue, 28 Mar 2023 11:39:05 -0400 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 1phBPc-0008Lc-0T for guix-patches@gnu.org; Tue, 28 Mar 2023 11:39:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1phBPb-0006Jk-Oe for guix-patches@gnu.org; Tue, 28 Mar 2023 11:39:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1phBPa-0004c7-J5 for guix-patches@gnu.org; Tue, 28 Mar 2023 11:39:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#62357] [PATCH] services: base: add pam-mount-volume support for greetd Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 28 Mar 2023 15:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62357 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Brian Cully Cc: 62357@debbugs.gnu.org Received: via spool by 62357-submit@debbugs.gnu.org id=B62357.168001791217694 (code B ref 62357); Tue, 28 Mar 2023 15:39:02 +0000 Received: (at 62357) by debbugs.gnu.org; 28 Mar 2023 15:38:32 +0000 Received: from localhost ([127.0.0.1]:50540 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1phBP6-0004bJ-0d for submit@debbugs.gnu.org; Tue, 28 Mar 2023 11:38:32 -0400 Received: from eggs.gnu.org ([209.51.188.92]:52020) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1phBP4-0004b1-7k for 62357@debbugs.gnu.org; Tue, 28 Mar 2023 11:38:31 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1phBOy-0006DB-MI; Tue, 28 Mar 2023 11:38:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=dZ9SyFlQ677cb/JfrgXMFPQmvlH0kEmGZel+WFvf1dw=; b=V9KApMMqbdVz+3YmFKnL n48FaQ1enL8X1bMd6YSpbMjcC5BqwDr1zF9BD6ofVi1VJkra+7mN2j55imGU3KNCOKcBnckk1t4JF etTh7D0yAIofGsCMwZofspW3HbeL6TqWs3ytVB5ZMw2OrRILrSAUtGhGDYASHz1DhUEy0NnAD2reb SrYkvn3qoQqI8tJapafeXtFCHne9cFX09guVim6tnpG4vEG7YdPzX85puuorRxgSh+6SXaXwHinxZ xgJxUamsHLw00baf59VWOQo+S4lpBlKWINPDuL6VWvM5T12QsWoa8L/KhCrrPJcAuuLhUNPJq8I47 l4QRfi4p3sTRdA==; Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1phBOv-0008Hq-4x; Tue, 28 Mar 2023 11:38:22 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <3dc92c40bf6940f2453d1912af08c47771dfa42b.1679432782.git.bjc@spork.org> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: Octidi 8 Germinal an 231 de la =?UTF-8?Q?R=C3=A9volution, ?= jour de la Jonquille X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Tue, 28 Mar 2023 17:38:18 +0200 In-Reply-To: <3dc92c40bf6940f2453d1912af08c47771dfa42b.1679432782.git.bjc@spork.org> (Brian Cully's message of "Tue, 21 Mar 2023 17:06:22 -0400") Message-ID: <87y1ngga39.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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: X-Migadu-Queue-Id: E6AB1C9E0 X-Spam-Score: -3.23 X-Migadu-Spam-Score: -3.23 X-Migadu-Scanner: scn0.migadu.com List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-TUID: AEN4K0bHCRNj Hi Brian, Brian Cully skribis: > This patch lets users create mounts automatically on login with the greetd > service by adding `pam-mount-volume' records via the `extra-pam-mount-vol= umes' > field of `greetd-configuration'. > > The existing rules for XDG_RUNTIME_DIR have been migrated to > `%base-pam-mount-volumes' and are installed by default. > > * gnu/services/base.scm (): new record > (pam-mount-volume->sxml): new procedure > (%base-pam-mount-volumes): new variable > (greetd-pam-mount-rules): new function > (%greetd-pam-mount-rules): removed variable > (): new field `extra-pam-mount-volumes' I=E2=80=99m not familiar with pam-mount-volume, so this is a somewhat superficial review, but the risks seem low anyway. As you note, we=E2=80=99ll need documentation. It would also be nice to ha= ve a system test because it=E2=80=99s the kind of feature that can be quite cent= ral and it=E2=80=99s annoying when it doesn=E2=80=99t work as advertised. > + pam-mount-volume-path > + pam-mount-volume-path Duplicate. > +(define-record-type* > + pam-mount-volume make-pam-mount-volume > + pam-mount-volume? > + (user pam-mount-volume-user (default #f)) ; string > + (uid pam-mount-volume-uid (default #f)) ; number or (number . number) > + (pgrp pam-mount-volume-pgrp (default #f)) ; string > + (gid pam-mount-volume-gid (default #f)) ; number or (number . number) > + (sgrp pam-mount-volume-sgrp (default #f)) ; string > + (fstype pam-mount-volume-fstype (default #f)) ; string > + (noroot pam-mount-volume-noroot (default #f)) ; bool > + (server pam-mount-volume-server (default #f)) ; string > + (path pam-mount-volume-path (default #f)) ; string > + (mountpoint pam-mount-volume-mountpoint (default #f)) ; string > + (header pam-mount-volume-header (default #f)) ; string > + (options pam-mount-volume-options (default #f)) ; string > + (ssh pam-mount-volume-ssh (default #f)) ; bool > + (cipher pam-mount-volume-cipher (default #f)) ; string > + (fskeycipher pam-mount-volume-fskeycipher (default #f)) ; string > + (fskeyhash pam-mount-volume-fskeyhash (default #f)) ; string > + (fskeypath pam-mount-volume-fskeypath (default #f))) ; string The general convention is to avoid abbreviations (so =E2=80=98mount-point= =E2=80=99, =E2=80=98file-system-type=E2=80=99, etc.), unless there=E2=80=99s a good re= ason not to (for instance because =E2=80=9Cfskeypath=E2=80=9D is a thing that =E2=80=98pam-m= ount-volume=E2=80=99 experts are familiar with). Similarly, =E2=80=9Cfile name=E2=80=9D rather than =E2= =80=9Cpath=E2=80=9D, except when referring to a search path. > + (define attrs > + (filter > + (cut cadr <>) > + (map (lambda (field-desc) > + (let* ((field-name (car field-desc)) > + (field-formatter (cdr field-desc)) > + (field-accessor (record-accessor f= ield-name))) > + (list field-name (field-formatter (field-accessor volume))= ))) > + `((user . ,string-for) Please always use =E2=80=98match=E2=80=99 (info "(guix) Data Types and Patt= ern Matching"). So: (define attrs (filter-map (match-lambda ((name . formatter) =E2=80=A6)) =E2=80=A6)) =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 > +(define %base-pam-mount-volumes > + (list > + (pam-mount-volume->sxml Please add a comment below =E2=80=98define=E2=80=99 explaining what this is. > -(define %greetd-pam-mount-rules > +(define (greetd-pam-mount-rules config) > + (define volumes > + (append (map pam-mount-volume->sxml > + (greetd-extra-pam-mount-volumes config)) > + %base-pam-mount-volumes)) > + > `((debug (@ (enable "0"))) > - (volume (@ (sgrp "users") > - (fstype "tmpfs") > - (mountpoint "/run/user/%(USERUID)") > - (options "noexec,nosuid,nodev,size=3D1g,mode=3D0700,uid= =3D%(USERUID),gid=3D%(USERGID)"))) > + ,@volumes > (logout (@ (wait "0") > (hup "0") > (term "yes") > @@ -3198,7 +3297,8 @@ (define-record-type* > (motd greetd-motd (default %default-motd)) > (allow-empty-passwords? greetd-allow-empty-passwords? (default #t)) > (terminals greetd-terminals (default '())) > - (greeter-supplementary-groups greetd-greeter-supplementary-groups (def= ault '()))) > + (greeter-supplementary-groups greetd-greeter-supplementary-groups (def= ault '())) > + (extra-pam-mount-volumes greetd-extra-pam-mount-volumes (default '()))) Should there be a =E2=80=98pam-mount-volume-service-type=E2=80=99 that =E2= =80=98greetd=E2=80=99 would extend? It would seem more natural to me. Thanks! Ludo=E2=80=99.