services: screen-locker: Migrate to (gnu system privilege).

* gnu/services/xorg.scm (screen-locker-setuid-programs): Rename from this…
(screen-locker-privileged-programs): …to this.  Use <privileged-program>.
(screen-locker-service-type): Extend the PRIVILEGED-PROGRAM-SERVICE-TYPE.

Change-Id: Icbd891def4fc90ed5365702731f009dec358c19e
This commit is contained in:
Tobias Geerinckx-Rice 2024-09-01 02:00:00 +02:00
parent 876c343bbf
commit 76cb23c117
No known key found for this signature in database
GPG Key ID: 0DB0FF884F556D79

View File

@ -38,9 +38,9 @@
#:use-module (gnu services)
#:use-module (gnu services configuration)
#:use-module (gnu services shepherd)
#:use-module (gnu system pam)
#:use-module (gnu system setuid)
#:use-module (gnu system keyboard)
#:use-module (gnu system pam)
#:use-module (gnu system privilege)
#:use-module (gnu services base)
#:use-module (gnu services dbus)
#:use-module (gnu packages base)
@ -847,11 +847,13 @@ reboot_cmd " shepherd "/sbin/reboot\n"
allow-empty-password?))
'())))
(define (screen-locker-setuid-programs config)
(define (screen-locker-privileged-programs config)
(match-record config <screen-locker-configuration>
(name program using-setuid?)
(if using-setuid?
(list (file-like->setuid-program program))
(list (privileged-program
(program program)
(setuid? #t)))
'())))
(define screen-locker-service-type
@ -859,8 +861,8 @@ reboot_cmd " shepherd "/sbin/reboot\n"
(extensions
(list (service-extension pam-root-service-type
screen-locker-pam-services)
(service-extension setuid-program-service-type
screen-locker-setuid-programs)))
(service-extension privileged-program-service-type
screen-locker-privileged-programs)))
(description
"Allow the given program to be used as a screen locker for
the graphical server by making it setuid-root, so it can authenticate users,