GNU bug report logs - #56699
[PATCH] gnu: greetd-service-type: Add greeter-extra-groups config field.

Previous Next

Package: guix-patches;

Reported by: muradm <mail <at> muradm.net>

Date: Fri, 22 Jul 2022 11:46:02 UTC

Severity: normal

Tags: patch

Done: Liliana Marie Prikler <liliana.prikler <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 56699 in the body.
You can then email your comments to 56699 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#56699; Package guix-patches. (Fri, 22 Jul 2022 11:46:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to muradm <mail <at> muradm.net>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Fri, 22 Jul 2022 11:46:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: muradm <mail <at> muradm.net>
To: guix-patches <at> gnu.org
Subject: [PATCH] gnu: greetd-service-type: Add greeter-extra-groups config
 field.
Date: Fri, 22 Jul 2022 14:45:01 +0300
* gnu/services/base.scm (greetd-service-type): Added configurable groups.
[extensions]: Switching accounts-service-type from const to function.
(<greetd-configuration>): Added greeter-extra-groups field of type list.
(greetd-accounts-service): New variable, function returning list necessary
accounts for accounts-service-type, including the greeter-extra-groups.
(%greetd-accounts): Removed.
* doc/guix.texi: Mention greeter-extra-groups field with example.
---
 doc/guix.texi         |  8 ++++++++
 gnu/services/base.scm | 28 +++++++++++++++-------------
 2 files changed, 23 insertions(+), 13 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 3c5864ec1a..51678b7f19 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -18493,6 +18493,14 @@ the 'root' account has just been created.
 @item @code{terminals} (default: @code{'()})
 List of @code{greetd-terminal-configuration} per terminal for which
 @code{greetd} should be started.
+
+@item @code{greeter-extra-groups} (default: @code{'()})
+List of groups which should be added to @code{greeter} user. For instance:
+@lisp
+(greeter-extra-groups '("seat"))
+@end lisp
+Note that, however it will fail if @code{seatd-service-type} is not present,
+or to be more specific, @code{seat} group is not present.
 @end table
 @end deftp
 
diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index 27eae75c46..94c8dcac2a 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -2918,17 +2918,6 @@ (define (make-greetd-terminal-configuration-file config)
      "user = " default-session-user "\n"
      "command = " default-session-command "\n")))
 
-(define %greetd-accounts
-  (list (user-account
-         (name "greeter")
-         (group "greeter")
-         ;; video group is required for graphical greeters.
-         (supplementary-groups '("video"))
-         (system? #t))
-        (user-group
-         (name "greeter")
-         (system? #t))))
-
 (define %greetd-file-systems
   (list (file-system
           (device "none")
@@ -2956,7 +2945,20 @@ (define-record-type* <greetd-configuration>
   greetd-configuration?
   (motd greetd-motd (default %default-motd))
   (allow-empty-passwords? greetd-allow-empty-passwords? (default #t))
-  (terminals greetd-terminals (default '())))
+  (terminals greetd-terminals (default '()))
+  (greeter-extra-groups greetd-greeter-extra-groups (default '())))
+
+(define (greetd-accounts-service config)
+  (list (user-group (name "greeter") (system? #t))
+        (user-account
+         (name "greeter")
+         (group "greeter")
+         ;; video group is required for graphical greeters.
+         (supplementary-groups
+          (append
+           '("video")
+           (greetd-greeter-extra-groups config)))
+         (system? #t))))
 
 (define (make-greetd-pam-mount-conf-file config)
   (computed-file
@@ -3033,7 +3035,7 @@ (define greetd-service-type
 login manager daemon.")
    (extensions
     (list
-     (service-extension account-service-type (const %greetd-accounts))
+     (service-extension account-service-type greetd-accounts-service)
      (service-extension file-system-service-type (const %greetd-file-systems))
      (service-extension etc-service-type greetd-etc-service)
      (service-extension pam-root-service-type greetd-pam-service)
-- 
2.36.1





Information forwarded to guix-patches <at> gnu.org:
bug#56699; Package guix-patches. (Sun, 24 Jul 2022 16:32:01 GMT) Full text and rfc822 format available.

Message #8 received at 56699 <at> debbugs.gnu.org (full text, mbox):

From: "(" <paren <at> disroot.org>
To: "muradm" <mail <at> muradm.net>, <56699 <at> debbugs.gnu.org>
Subject: Re: [bug#56699] [PATCH] gnu: greetd-service-type: Add
 greeter-extra-groups config field.
Date: Sun, 24 Jul 2022 17:31:39 +0100
On Fri Jul 22, 2022 at 12:45 PM BST, muradm wrote:
> +         ;; video group is required for graphical greeters.
> +         (supplementary-groups
> +          (append
> +           '("video")
> +           (greetd-greeter-extra-groups config)))
Change to (cons "video" (greetd-greeter-extra-groups config)) or maybe
use cons* if you think there's a possibility that more groups will later
need to be added.

Otherwise SGTM :)

    -- (




Added indication that bug 56699 blocks56971 Request was from Liliana Marie Prikler <liliana.prikler <at> ist.tugraz.at> to control <at> debbugs.gnu.org. (Thu, 04 Aug 2022 11:09:02 GMT) Full text and rfc822 format available.

Information forwarded to guix-patches <at> gnu.org:
bug#56699; Package guix-patches. (Fri, 05 Aug 2022 06:49:02 GMT) Full text and rfc822 format available.

Message #13 received at submit <at> debbugs.gnu.org (full text, mbox):

From: muradm <mail <at> muradm.net>
To: "(" <paren <at> disroot.org>
Cc: 56699 <at> debbugs.gnu.org, guix-patches <at> gnu.org
Subject: Re: [bug#56699] [PATCH] gnu: greetd-service-type: Add
 greeter-extra-groups config field.
Date: Fri, 05 Aug 2022 09:44:48 +0300
[Message part 1 (text/plain, inline)]
supplimentary-groups receiving a list, so I find it more 
informative
when adding apples with apples. And yes with high enough chance
more groups could be added to the list of defaults.

Is there any preference on using cons* in favour of more readable
append?

thanks in advance,
muradm

"(" <paren <at> disroot.org> writes:

> On Fri Jul 22, 2022 at 12:45 PM BST, muradm wrote:
>> +         ;; video group is required for graphical greeters.
>> +         (supplementary-groups
>> +          (append
>> +           '("video")
>> +           (greetd-greeter-extra-groups config)))
> Change to (cons "video" (greetd-greeter-extra-groups config)) or 
> maybe
> use cons* if you think there's a possibility that more groups 
> will later
> need to be added.
>
> Otherwise SGTM :)
>
>     -- (

[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#56699; Package guix-patches. (Fri, 05 Aug 2022 06:49:02 GMT) Full text and rfc822 format available.

Information forwarded to guix-patches <at> gnu.org:
bug#56699; Package guix-patches. (Fri, 05 Aug 2022 07:55:02 GMT) Full text and rfc822 format available.

Message #19 received at 56699 <at> debbugs.gnu.org (full text, mbox):

From: Liliana Marie Prikler <liliana.prikler <at> ist.tugraz.at>
To: muradm <mail <at> muradm.net>, "(" <paren <at> disroot.org>
Cc: 56699 <at> debbugs.gnu.org
Subject: Re: [bug#56699] [PATCH] gnu: greetd-service-type: Add
 greeter-extra-groups config field.
Date: Fri, 05 Aug 2022 09:54:50 +0200
Am Freitag, dem 05.08.2022 um 09:44 +0300 schrieb muradm:
> supplimentary-groups receiving a list, so I find it more 
> informative when adding apples with apples. And yes with high enough
> chance more groups could be added to the list of defaults.
What are "the defaults" here, though?  A sequence of hard-coded values
known at compile time.  There is no need to make that sequence a list.

> Is there any preference on using cons* in favour of more readable
> append?
Use of cons or cons* signals that you are only expecting user-supplied
groups to be a list and everything else known values.  Use of append on
the other hand signals that you are expecting multiple lists, which
even if you did are not currently present.

Cheers




Information forwarded to guix-patches <at> gnu.org:
bug#56699; Package guix-patches. (Sun, 07 Aug 2022 21:46:01 GMT) Full text and rfc822 format available.

Message #22 received at submit <at> debbugs.gnu.org (full text, mbox):

From: muradm <mail <at> muradm.net>
To: Liliana Marie Prikler <liliana.prikler <at> ist.tugraz.at>
Cc: "\(" <paren <at> disroot.org>, 56699 <at> debbugs.gnu.org, guix-patches <at> gnu.org
Subject: Re: [bug#56699] [PATCH v2] gnu: greetd-service-type: Add
 greeter-extra-groups config field.
Date: Mon, 08 Aug 2022 00:42:09 +0300
[Message part 1 (text/plain, inline)]
Correct, no defaults are given. Attached is v2. Defaults
non existent, append/cons* irrelevant.



thanks in advance,
muradm

Liliana Marie Prikler <liliana.prikler <at> ist.tugraz.at> writes:

> Am Freitag, dem 05.08.2022 um 09:44 +0300 schrieb muradm:
>> supplimentary-groups receiving a list, so I find it more
>> informative when adding apples with apples. And yes with high 
>> enough
>> chance more groups could be added to the list of defaults.
> What are "the defaults" here, though?  A sequence of hard-coded 
> values
> known at compile time.  There is no need to make that sequence a 
> list.
>
>> Is there any preference on using cons* in favour of more 
>> readable
>> append?
> Use of cons or cons* signals that you are only expecting 
> user-supplied
> groups to be a list and everything else known values.  Use of 
> append on
> the other hand signals that you are expecting multiple lists, 
> which
> even if you did are not currently present.
>
> Cheers

[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#56699; Package guix-patches. (Sun, 07 Aug 2022 21:46:02 GMT) Full text and rfc822 format available.

Information forwarded to guix-patches <at> gnu.org:
bug#56699; Package guix-patches. (Sun, 07 Aug 2022 21:49:02 GMT) Full text and rfc822 format available.

Message #28 received at 56699 <at> debbugs.gnu.org (full text, mbox):

From: muradm <mail <at> muradm.net>
To: 56699 <at> debbugs.gnu.org,
 Liliana Marie Prikler <liliana.prikler <at> ist.tugraz.at>
Cc: "\(" <paren <at> disroot.org>, guix-patches <at> gnu.org
Subject: [PATCH v2] gnu: greetd-service-type: Add greeter-extra-groups config
 field.
Date: Mon,  8 Aug 2022 00:48:04 +0300
* gnu/services/base.scm (greetd-service-type): Added configurable groups.
[extensions]: Switching accounts-service-type from const to function.
(<greetd-configuration>): Added greeter-groups field of type list.
(greetd-accounts-service): New variable, function returning list necessary
accounts for accounts-service-type, including the greeter-extra-groups.
(%greetd-accounts): Removed.
* gnu/tests/desktop.scm (%minimal-services): Add test for greeter-groups.
* doc/guix.texi: Mention greeter-extra-groups field with example.
---
 doc/guix.texi         |  8 ++++++++
 gnu/services/base.scm | 24 +++++++++++-------------
 gnu/tests/desktop.scm |  7 +++++++
 3 files changed, 26 insertions(+), 13 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 21cee4e369..2b09bea3b0 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -18509,6 +18509,14 @@ the 'root' account has just been created.
 @item @code{terminals} (default: @code{'()})
 List of @code{greetd-terminal-configuration} per terminal for which
 @code{greetd} should be started.
+
+@item @code{greeter-groups} (default: @code{'()})
+List of groups which should be added to @code{greeter} user. For instance:
+@lisp
+(greeter-groups '("seat" "video"))
+@end lisp
+Note that, however it will fail if @code{seatd-service-type} is not present,
+or to be more specific, @code{seat} group is not present.
 @end table
 @end deftp
 
diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index 27eae75c46..85de6decfe 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -2918,17 +2918,6 @@ (define (make-greetd-terminal-configuration-file config)
      "user = " default-session-user "\n"
      "command = " default-session-command "\n")))
 
-(define %greetd-accounts
-  (list (user-account
-         (name "greeter")
-         (group "greeter")
-         ;; video group is required for graphical greeters.
-         (supplementary-groups '("video"))
-         (system? #t))
-        (user-group
-         (name "greeter")
-         (system? #t))))
-
 (define %greetd-file-systems
   (list (file-system
           (device "none")
@@ -2956,7 +2945,16 @@ (define-record-type* <greetd-configuration>
   greetd-configuration?
   (motd greetd-motd (default %default-motd))
   (allow-empty-passwords? greetd-allow-empty-passwords? (default #t))
-  (terminals greetd-terminals (default '())))
+  (terminals greetd-terminals (default '()))
+  (greeter-groups greetd-greeter-groups (default '())))
+
+(define (greetd-accounts-service config)
+  (list (user-group (name "greeter") (system? #t))
+        (user-account
+         (name "greeter")
+         (group "greeter")
+         (supplementary-groups (greetd-greeter-groups config))
+         (system? #t))))
 
 (define (make-greetd-pam-mount-conf-file config)
   (computed-file
@@ -3033,7 +3031,7 @@ (define greetd-service-type
 login manager daemon.")
    (extensions
     (list
-     (service-extension account-service-type (const %greetd-accounts))
+     (service-extension account-service-type greetd-accounts-service)
      (service-extension file-system-service-type (const %greetd-file-systems))
      (service-extension etc-service-type greetd-etc-service)
      (service-extension pam-root-service-type greetd-pam-service)
diff --git a/gnu/tests/desktop.scm b/gnu/tests/desktop.scm
index 25971f9225..ef4a7e0ec9 100644
--- a/gnu/tests/desktop.scm
+++ b/gnu/tests/desktop.scm
@@ -122,6 +122,7 @@ (define %minimal-services
     (service seatd-service-type)
     (service greetd-service-type
              (greetd-configuration
+              (greeter-groups '("input" "video"))
               (terminals
                (list
                 ;; we can make any terminal active by default
@@ -286,6 +287,12 @@ (define (greetd-pid-to-sock pid)
               (marionette-type "echo alice > /run/user/1000/test\n" marionette)
               (file-get-all-strings "/run/user/1000/test")))
 
+          (test-equal "check greeter user has correct groups"
+            "greeter input video\n"
+            (begin
+              (marionette-type "id -Gn greeter > /run/user/1000/greeter-groups\n" marionette)
+              (file-get-all-strings "/run/user/1000/greeter-groups")))
+
           (test-assert "screendump"
             (begin
               (marionette-control (string-append "screendump " #$output
-- 
2.37.1





Information forwarded to guix-patches <at> gnu.org:
bug#56699; Package guix-patches. (Mon, 08 Aug 2022 05:42:02 GMT) Full text and rfc822 format available.

Message #31 received at 56699 <at> debbugs.gnu.org (full text, mbox):

From: Liliana Marie Prikler <liliana.prikler <at> ist.tugraz.at>
To: muradm <mail <at> muradm.net>, 56699 <at> debbugs.gnu.org
Cc: "\(" <paren <at> disroot.org>
Subject: Re: [PATCH v2] gnu: greetd-service-type: Add greeter-extra-groups
 config field.
Date: Mon, 08 Aug 2022 07:41:35 +0200
Am Montag, dem 08.08.2022 um 00:48 +0300 schrieb muradm:
> ---
>  doc/guix.texi         |  8 ++++++++
>  gnu/services/base.scm | 24 +++++++++++-------------
>  gnu/tests/desktop.scm |  7 +++++++
>  3 files changed, 26 insertions(+), 13 deletions(-)
> 
> diff --git a/doc/guix.texi b/doc/guix.texi
> index 21cee4e369..2b09bea3b0 100644
> --- a/doc/guix.texi
> +++ b/doc/guix.texi
> @@ -18509,6 +18509,14 @@ the 'root' account has just been created.
>  @item @code{terminals} (default: @code{'()})
>  List of @code{greetd-terminal-configuration} per terminal for which
>  @code{greetd} should be started.
> +
> +@item @code{greeter-groups} (default: @code{'()})
> +List of groups which should be added to @code{greeter} user. For
> instance:
> +@lisp
> +(greeter-groups '("seat" "video"))
> +@end lisp
> +Note that, however it will fail if @code{seatd-service-type} is not
> present,
> +or to be more specific, @code{seat} group is not present.
Note that this example will fail if the @code{seat} group does not
exist.

> +  (greeter-groups greetd-greeter-groups (default '())))
I think, we can err a little on the side of verbosity here and make
clear that it's greeter-supplementary-groups.

Other than that LGTM




Information forwarded to guix-patches <at> gnu.org:
bug#56699; Package guix-patches. (Mon, 08 Aug 2022 19:30:02 GMT) Full text and rfc822 format available.

Message #34 received at 56699 <at> debbugs.gnu.org (full text, mbox):

From: muradm <mail <at> muradm.net>
To: Liliana Marie Prikler <liliana.prikler <at> ist.tugraz.at>
Cc: "\(" <paren <at> disroot.org>, 56699 <at> debbugs.gnu.org
Subject: Re: [PATCH v2] gnu: greetd-service-type: Add greeter-extra-groups
 config field.
Date: Mon, 08 Aug 2022 22:27:40 +0300
[v3-0001-gnu-greetd-service-type-Add-greeter-extra-groups-.patch (text/x-patch, inline)]
From c8ba263cd3323c06cd3044243347e76a85cb9628 Mon Sep 17 00:00:00 2001
From: muradm <mail <at> muradm.net>
Date: Fri, 22 Jul 2022 14:28:57 +0300
Subject: [PATCH v3] gnu: greetd-service-type: Add greeter-extra-groups config
 field.
To: 56699 <at> debbugs.gnu.org

* gnu/services/base.scm (greetd-service-type): Added configurable
supplementary groups.
[extensions]: Switching accounts-service-type from const to function.
(<greetd-configuration>): Added greeter-supplementary-groups field.
(greetd-accounts-service): New variable, function returning list
necessary accounts for accounts-service-type, including the
greeter-supplementary-groups.
(%greetd-accounts): Removed.
* gnu/tests/desktop.scm (%minimal-services): Add test for
greeter-supplementary-groups.
* doc/guix.texi: Mention greeter-supplementary-groups field with example.
---
 doc/guix.texi         |  8 ++++++++
 gnu/services/base.scm | 24 +++++++++++-------------
 gnu/tests/desktop.scm |  7 +++++++
 3 files changed, 26 insertions(+), 13 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 9a6a5c307d..8eda5bb2c0 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -18541,6 +18541,14 @@ the 'root' account has just been created.
 @item @code{terminals} (default: @code{'()})
 List of @code{greetd-terminal-configuration} per terminal for which
 @code{greetd} should be started.
+
+@item @code{greeter-supplementary-groups} (default: @code{'()})
+List of groups which should be added to @code{greeter} user. For instance:
+@lisp
+(greeter-supplementary-groups '("seat" "video"))
+@end lisp
+Note that, however it will fail if @code{seatd-service-type} is not present,
+or to be more specific, @code{seat} group is not present.
 @end table
 @end deftp
 
diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index 27eae75c46..251196b108 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -2918,17 +2918,6 @@ (define (make-greetd-terminal-configuration-file config)
      "user = " default-session-user "\n"
      "command = " default-session-command "\n")))
 
-(define %greetd-accounts
-  (list (user-account
-         (name "greeter")
-         (group "greeter")
-         ;; video group is required for graphical greeters.
-         (supplementary-groups '("video"))
-         (system? #t))
-        (user-group
-         (name "greeter")
-         (system? #t))))
-
 (define %greetd-file-systems
   (list (file-system
           (device "none")
@@ -2956,7 +2945,16 @@ (define-record-type* <greetd-configuration>
   greetd-configuration?
   (motd greetd-motd (default %default-motd))
   (allow-empty-passwords? greetd-allow-empty-passwords? (default #t))
-  (terminals greetd-terminals (default '())))
+  (terminals greetd-terminals (default '()))
+  (greeter-supplementary-groups greetd-greeter-supplementary-groups (default '())))
+
+(define (greetd-accounts-service config)
+  (list (user-group (name "greeter") (system? #t))
+        (user-account
+         (name "greeter")
+         (group "greeter")
+         (supplementary-groups (greetd-greeter-supplementary-groups config))
+         (system? #t))))
 
 (define (make-greetd-pam-mount-conf-file config)
   (computed-file
@@ -3033,7 +3031,7 @@ (define greetd-service-type
 login manager daemon.")
    (extensions
     (list
-     (service-extension account-service-type (const %greetd-accounts))
+     (service-extension account-service-type greetd-accounts-service)
      (service-extension file-system-service-type (const %greetd-file-systems))
      (service-extension etc-service-type greetd-etc-service)
      (service-extension pam-root-service-type greetd-pam-service)
diff --git a/gnu/tests/desktop.scm b/gnu/tests/desktop.scm
index 25971f9225..f20423f0aa 100644
--- a/gnu/tests/desktop.scm
+++ b/gnu/tests/desktop.scm
@@ -122,6 +122,7 @@ (define %minimal-services
     (service seatd-service-type)
     (service greetd-service-type
              (greetd-configuration
+              (greeter-supplementary-groups '("input" "video"))
               (terminals
                (list
                 ;; we can make any terminal active by default
@@ -286,6 +287,12 @@ (define (greetd-pid-to-sock pid)
               (marionette-type "echo alice > /run/user/1000/test\n" marionette)
               (file-get-all-strings "/run/user/1000/test")))
 
+          (test-equal "check greeter user has correct groups"
+            "greeter input video\n"
+            (begin
+              (marionette-type "id -Gn greeter > /run/user/1000/greeter-groups\n" marionette)
+              (file-get-all-strings "/run/user/1000/greeter-groups")))
+
           (test-assert "screendump"
             (begin
               (marionette-control (string-append "screendump " #$output
-- 
2.37.1

[Message part 2 (text/plain, inline)]
Liliana Marie Prikler <liliana.prikler <at> ist.tugraz.at> writes:

> Am Montag, dem 08.08.2022 um 00:48 +0300 schrieb muradm:
>> ---
>>  doc/guix.texi         |  8 ++++++++
>>  gnu/services/base.scm | 24 +++++++++++-------------
>>  gnu/tests/desktop.scm |  7 +++++++
>>  3 files changed, 26 insertions(+), 13 deletions(-)
>>
>> diff --git a/doc/guix.texi b/doc/guix.texi
>> index 21cee4e369..2b09bea3b0 100644
>> --- a/doc/guix.texi
>> +++ b/doc/guix.texi
>> @@ -18509,6 +18509,14 @@ the 'root' account has just been 
>> created.
>>  @item @code{terminals} (default: @code{'()})
>>  List of @code{greetd-terminal-configuration} per terminal for 
>> which
>>  @code{greetd} should be started.
>> +
>> +@item @code{greeter-groups} (default: @code{'()})
>> +List of groups which should be added to @code{greeter} user. 
>> For
>> instance:
>> +@lisp
>> +(greeter-groups '("seat" "video"))
>> +@end lisp
>> +Note that, however it will fail if @code{seatd-service-type} 
>> is not
>> present,
>> +or to be more specific, @code{seat} group is not present.
> Note that this example will fail if the @code{seat} group does 
> not
> exist.
Which is stated right on the next line.

>> +  (greeter-groups greetd-greeter-groups (default '())))
> I think, we can err a little on the side of verbosity here and 
> make
> clear that it's greeter-supplementary-groups.
done

> Other than that LGTM

[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#56699; Package guix-patches. (Tue, 09 Aug 2022 06:26:02 GMT) Full text and rfc822 format available.

Message #37 received at 56699 <at> debbugs.gnu.org (full text, mbox):

From: Liliana Marie Prikler <liliana.prikler <at> ist.tugraz.at>
To: muradm <mail <at> muradm.net>
Cc: "\(" <paren <at> disroot.org>, 56699 <at> debbugs.gnu.org
Subject: Re: [PATCH v2] gnu: greetd-service-type: Add greeter-extra-groups
 config field.
Date: Tue, 09 Aug 2022 08:25:16 +0200
Am Montag, dem 08.08.2022 um 22:27 +0300 schrieb muradm:
> 
> Liliana Marie Prikler <liliana.prikler <at> ist.tugraz.at> writes:
> 
> > Am Montag, dem 08.08.2022 um 00:48 +0300 schrieb muradm:
> > > ---
> > >  doc/guix.texi         |  8 ++++++++
> > >  gnu/services/base.scm | 24 +++++++++++-------------
> > >  gnu/tests/desktop.scm |  7 +++++++
> > >  3 files changed, 26 insertions(+), 13 deletions(-)
> > > 
> > > diff --git a/doc/guix.texi b/doc/guix.texi
> > > index 21cee4e369..2b09bea3b0 100644
> > > --- a/doc/guix.texi
> > > +++ b/doc/guix.texi
> > > @@ -18509,6 +18509,14 @@ the 'root' account has just been 
> > > created.
> > >  @item @code{terminals} (default: @code{'()})
> > >  List of @code{greetd-terminal-configuration} per terminal for 
> > > which
> > >  @code{greetd} should be started.
> > > +
> > > +@item @code{greeter-groups} (default: @code{'()})
> > > +List of groups which should be added to @code{greeter} user. 
> > > For
> > > instance:
> > > +@lisp
> > > +(greeter-groups '("seat" "video"))
> > > +@end lisp
> > > +Note that, however it will fail if @code{seatd-service-type} 
> > > is not
> > > present,
> > > +or to be more specific, @code{seat} group is not present.
> > Note that this example will fail if the @code{seat} group does 
> > not exist.
> Which is stated right on the next line.
In a convoluted way.  "Note that this example will fail if the
@code{seat} group does not exist." is imho easier on the reader.

Cheers




Information forwarded to guix-patches <at> gnu.org:
bug#56699; Package guix-patches. (Tue, 09 Aug 2022 19:43:02 GMT) Full text and rfc822 format available.

Message #40 received at 56699 <at> debbugs.gnu.org (full text, mbox):

From: muradm <mail <at> muradm.net>
To: Liliana Marie Prikler <liliana.prikler <at> ist.tugraz.at>
Cc: "\(" <paren <at> disroot.org>, 56699 <at> debbugs.gnu.org
Subject: Re: [PATCH v4] gnu: greetd-service-type: Add greeter-extra-groups
 config field.
Date: Tue, 09 Aug 2022 22:40:47 +0300
[Message part 1 (text/plain, inline)]
fixed

[v4-0001-gnu-greetd-service-type-Add-greeter-extra-groups-.patch (text/x-patch, inline)]
From d92efe5c5f26645513911ac11ec8876681768b4b Mon Sep 17 00:00:00 2001
From: muradm <mail <at> muradm.net>
Date: Fri, 22 Jul 2022 14:28:57 +0300
Subject: [PATCH v4] gnu: greetd-service-type: Add greeter-extra-groups config
 field.
To: 56699 <at> debbugs.gnu.org

* gnu/services/base.scm (greetd-service-type): Added configurable
supplementary groups.
[extensions]: Switching accounts-service-type from const to function.
(<greetd-configuration>): Added greeter-supplementary-groups field.
(greetd-accounts-service): New variable, function returning list
necessary accounts for accounts-service-type, including the
greeter-supplementary-groups.
(%greetd-accounts): Removed.
* gnu/tests/desktop.scm (%minimal-services): Add test for
greeter-supplementary-groups.
* doc/guix.texi: Mention greeter-supplementary-groups field with example.
---
 doc/guix.texi         |  7 +++++++
 gnu/services/base.scm | 24 +++++++++++-------------
 gnu/tests/desktop.scm |  7 +++++++
 3 files changed, 25 insertions(+), 13 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 896c830aeb..3f04a32f2d 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -18554,6 +18554,13 @@ the 'root' account has just been created.
 @item @code{terminals} (default: @code{'()})
 List of @code{greetd-terminal-configuration} per terminal for which
 @code{greetd} should be started.
+
+@item @code{greeter-supplementary-groups} (default: @code{'()})
+List of groups which should be added to @code{greeter} user. For instance:
+@lisp
+(greeter-supplementary-groups '("seat" "video"))
+@end lisp
+Note that, this example will fail if @code{seat} group does not exist.
 @end table
 @end deftp
 
diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index 27eae75c46..251196b108 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -2918,17 +2918,6 @@ (define (make-greetd-terminal-configuration-file config)
      "user = " default-session-user "\n"
      "command = " default-session-command "\n")))
 
-(define %greetd-accounts
-  (list (user-account
-         (name "greeter")
-         (group "greeter")
-         ;; video group is required for graphical greeters.
-         (supplementary-groups '("video"))
-         (system? #t))
-        (user-group
-         (name "greeter")
-         (system? #t))))
-
 (define %greetd-file-systems
   (list (file-system
           (device "none")
@@ -2956,7 +2945,16 @@ (define-record-type* <greetd-configuration>
   greetd-configuration?
   (motd greetd-motd (default %default-motd))
   (allow-empty-passwords? greetd-allow-empty-passwords? (default #t))
-  (terminals greetd-terminals (default '())))
+  (terminals greetd-terminals (default '()))
+  (greeter-supplementary-groups greetd-greeter-supplementary-groups (default '())))
+
+(define (greetd-accounts-service config)
+  (list (user-group (name "greeter") (system? #t))
+        (user-account
+         (name "greeter")
+         (group "greeter")
+         (supplementary-groups (greetd-greeter-supplementary-groups config))
+         (system? #t))))
 
 (define (make-greetd-pam-mount-conf-file config)
   (computed-file
@@ -3033,7 +3031,7 @@ (define greetd-service-type
 login manager daemon.")
    (extensions
     (list
-     (service-extension account-service-type (const %greetd-accounts))
+     (service-extension account-service-type greetd-accounts-service)
      (service-extension file-system-service-type (const %greetd-file-systems))
      (service-extension etc-service-type greetd-etc-service)
      (service-extension pam-root-service-type greetd-pam-service)
diff --git a/gnu/tests/desktop.scm b/gnu/tests/desktop.scm
index 25971f9225..f20423f0aa 100644
--- a/gnu/tests/desktop.scm
+++ b/gnu/tests/desktop.scm
@@ -122,6 +122,7 @@ (define %minimal-services
     (service seatd-service-type)
     (service greetd-service-type
              (greetd-configuration
+              (greeter-supplementary-groups '("input" "video"))
               (terminals
                (list
                 ;; we can make any terminal active by default
@@ -286,6 +287,12 @@ (define (greetd-pid-to-sock pid)
               (marionette-type "echo alice > /run/user/1000/test\n" marionette)
               (file-get-all-strings "/run/user/1000/test")))
 
+          (test-equal "check greeter user has correct groups"
+            "greeter input video\n"
+            (begin
+              (marionette-type "id -Gn greeter > /run/user/1000/greeter-groups\n" marionette)
+              (file-get-all-strings "/run/user/1000/greeter-groups")))
+
           (test-assert "screendump"
             (begin
               (marionette-control (string-append "screendump " #$output
-- 
2.37.1

[Message part 3 (text/plain, inline)]

Liliana Marie Prikler <liliana.prikler <at> ist.tugraz.at> writes:

> Am Montag, dem 08.08.2022 um 22:27 +0300 schrieb muradm:
>>
>> Liliana Marie Prikler <liliana.prikler <at> ist.tugraz.at> writes:
>>
>> > Am Montag, dem 08.08.2022 um 00:48 +0300 schrieb muradm:
>> > > ---
>> > >  doc/guix.texi         |  8 ++++++++
>> > >  gnu/services/base.scm | 24 +++++++++++-------------
>> > >  gnu/tests/desktop.scm |  7 +++++++
>> > >  3 files changed, 26 insertions(+), 13 deletions(-)
>> > >
>> > > diff --git a/doc/guix.texi b/doc/guix.texi
>> > > index 21cee4e369..2b09bea3b0 100644
>> > > --- a/doc/guix.texi
>> > > +++ b/doc/guix.texi
>> > > @@ -18509,6 +18509,14 @@ the 'root' account has just been
>> > > created.
>> > >  @item @code{terminals} (default: @code{'()})
>> > >  List of @code{greetd-terminal-configuration} per terminal 
>> > > for
>> > > which
>> > >  @code{greetd} should be started.
>> > > +
>> > > +@item @code{greeter-groups} (default: @code{'()})
>> > > +List of groups which should be added to @code{greeter} 
>> > > user.
>> > > For
>> > > instance:
>> > > +@lisp
>> > > +(greeter-groups '("seat" "video"))
>> > > +@end lisp
>> > > +Note that, however it will fail if 
>> > > @code{seatd-service-type}
>> > > is not
>> > > present,
>> > > +or to be more specific, @code{seat} group is not present.
>> > Note that this example will fail if the @code{seat} group 
>> > does
>> > not exist.
>> Which is stated right on the next line.
> In a convoluted way.  "Note that this example will fail if the
> @code{seat} group does not exist." is imho easier on the reader.
>
> Cheers

[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#56699; Package guix-patches. (Wed, 10 Aug 2022 07:50:02 GMT) Full text and rfc822 format available.

Message #43 received at 56699 <at> debbugs.gnu.org (full text, mbox):

From: Liliana Marie Prikler <liliana.prikler <at> ist.tugraz.at>
To: muradm <mail <at> muradm.net>
Cc: "\(" <paren <at> disroot.org>, 56699 <at> debbugs.gnu.org
Subject: Re: [PATCH v4] gnu: greetd-service-type: Add greeter-extra-groups
 config field.
Date: Wed, 10 Aug 2022 09:49:36 +0200
Am Dienstag, dem 09.08.2022 um 22:40 +0300 schrieb muradm:
> fixed
v4 LGTM




Reply sent to Liliana Marie Prikler <liliana.prikler <at> gmail.com>:
You have taken responsibility. (Fri, 26 Aug 2022 17:07:02 GMT) Full text and rfc822 format available.

Notification sent to muradm <mail <at> muradm.net>:
bug acknowledged by developer. (Fri, 26 Aug 2022 17:07:02 GMT) Full text and rfc822 format available.

Message #48 received at 56699-done <at> debbugs.gnu.org (full text, mbox):

From: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
To: muradm <mail <at> muradm.net>
Cc: 56690-done <at> debbugs.gnu.org, 56699-done <at> debbugs.gnu.org,
 56971-done <at> debbugs.gnu.org
Subject: Re: greeter user permissions are not enough to talk with seatd
Date: Fri, 26 Aug 2022 19:06:14 +0200
Am Donnerstag, dem 04.08.2022 um 12:45 +0300 schrieb muradm:
> * 56690 - gnu: seatd-service-type: Should use seat group.
> With this change, if seatd-service-type is present in the
> system configuration, "seat" group will be added, and seatd
> will run as root/seat. Group is configurable, but default is 
> "seat".
I made it so that by default the sanitizer is used to turn the string
"seat" into a group and used (ice-9 match), reducing some needless
redundancy.  I also reworded the manual to the best of my ability
following our conversations and adapted the commit message.

> * 56699 - gnu: greetd-service-type: Add greeter-extra-groups 
>   config field.
> With this change, if user wants to use seatd-service-type with
> greeter requiring seatd.sock, he can add "seat" group to
> greeter-extra-groups field.
I fixed some minor issue in the manual and reindented the marionette-
type in the tests, also reworded the commit message.

I didn't get the chance to run the system tests – some timeout causes
the marionette build to fail on my machine – but I verified
independently that at least the seatd socket has the right permissions.
I hope this will be enough for you to get gtkgreet running.

Cheers




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 24 Sep 2022 11:24:12 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 186 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.