diff options
| author | Tobias Geerinckx-Rice <me@tobias.gr> | 2022-10-23 02:00:01 +0200 |
|---|---|---|
| committer | Tobias Geerinckx-Rice <me@tobias.gr> | 2024-08-11 02:00:00 +0200 |
| commit | 4e58dfee6c7456d1e662f66041b8a157efe8710a (patch) | |
| tree | dfe3b18e5feb938490108b9da3078e1aad220ade /gnu/system.scm | |
| parent | beb37ea4ad9999c28cfb60aca5d021851f9a1176 (diff) | |
system: Add privileged-programs to <operating-system>.
* gnu/system.scm (<operating-system>): Add new privileged-programs
field, that defaults to…
(%default-privileged-programs): …this new variable, renamed from…
(%setuid-programs): …this, which is now defined as the empty list.
* doc/guix.texi (Setuid Programs): Rename this…
(Privileged Programs): …to this. Adjust all refs. Update all mentions
of ‘setuid’ (whether in prose, variable names, or code samples) to use
the new ‘privilege[d]’ terminology instead.
(operating-system Reference, X Window, Invoking guix system)
(Service Reference): Adjust likewise.
Diffstat (limited to 'gnu/system.scm')
| -rw-r--r-- | gnu/system.scm | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/gnu/system.scm b/gnu/system.scm index 4ac619d4eca..44f93f91d17 100644 --- a/gnu/system.scm +++ b/gnu/system.scm | |||
| @@ -77,6 +77,7 @@ | |||
| 77 | #:use-module (gnu system locale) | 77 | #:use-module (gnu system locale) |
| 78 | #:use-module (gnu system pam) | 78 | #:use-module (gnu system pam) |
| 79 | #:use-module (gnu system linux-initrd) | 79 | #:use-module (gnu system linux-initrd) |
| 80 | #:use-module (gnu system privilege) | ||
| 80 | #:use-module (gnu system setuid) | 81 | #:use-module (gnu system setuid) |
| 81 | #:use-module (gnu system uuid) | 82 | #:use-module (gnu system uuid) |
| 82 | #:use-module (gnu system file-systems) | 83 | #:use-module (gnu system file-systems) |
| @@ -130,6 +131,7 @@ | |||
| 130 | operating-system-keyboard-layout | 131 | operating-system-keyboard-layout |
| 131 | operating-system-name-service-switch | 132 | operating-system-name-service-switch |
| 132 | operating-system-pam-services | 133 | operating-system-pam-services |
| 134 | operating-system-privileged-programs | ||
| 133 | operating-system-setuid-programs | 135 | operating-system-setuid-programs |
| 134 | operating-system-skeletons | 136 | operating-system-skeletons |
| 135 | operating-system-sudoers-file | 137 | operating-system-sudoers-file |
| @@ -174,6 +176,7 @@ | |||
| 174 | 176 | ||
| 175 | local-host-aliases ;deprecated | 177 | local-host-aliases ;deprecated |
| 176 | %root-account | 178 | %root-account |
| 179 | %default-privileged-programs | ||
| 177 | %setuid-programs | 180 | %setuid-programs |
| 178 | %sudoers-specification | 181 | %sudoers-specification |
| 179 | %base-packages | 182 | %base-packages |
| @@ -301,7 +304,10 @@ VERSION is the target version of the boot-parameters record." | |||
| 301 | 304 | ||
| 302 | (pam-services operating-system-pam-services ; list of PAM services | 305 | (pam-services operating-system-pam-services ; list of PAM services |
| 303 | (default (base-pam-services))) | 306 | (default (base-pam-services))) |
| 307 | (privileged-programs operating-system-privileged-programs ; list of <privileged-program> | ||
| 308 | (default %default-privileged-programs)) | ||
| 304 | (setuid-programs operating-system-setuid-programs | 309 | (setuid-programs operating-system-setuid-programs |
| 310 | ;; For backwards compatibility; will be removed. | ||
| 305 | (default %setuid-programs)) ; list of <setuid-program> | 311 | (default %setuid-programs)) ; list of <setuid-program> |
| 306 | 312 | ||
| 307 | (sudoers-file operating-system-sudoers-file ; file-like | 313 | (sudoers-file operating-system-sudoers-file ; file-like |
| @@ -821,7 +827,8 @@ bookkeeping." | |||
| 821 | (service host-name-service-type host-name) | 827 | (service host-name-service-type host-name) |
| 822 | procs root-fs | 828 | procs root-fs |
| 823 | (service privileged-program-service-type | 829 | (service privileged-program-service-type |
| 824 | (operating-system-setuid-programs os)) | 830 | (append (operating-system-privileged-programs os) |
| 831 | (operating-system-setuid-programs os))) | ||
| 825 | (service profile-service-type | 832 | (service profile-service-type |
| 826 | (operating-system-packages os)) | 833 | (operating-system-packages os)) |
| 827 | boot-fs non-boot-fs | 834 | boot-fs non-boot-fs |
| @@ -860,7 +867,8 @@ bookkeeping." | |||
| 860 | (service hosts-service-type | 867 | (service hosts-service-type |
| 861 | (local-host-entries host-name))) | 868 | (local-host-entries host-name))) |
| 862 | (service privileged-program-service-type | 869 | (service privileged-program-service-type |
| 863 | (operating-system-setuid-programs os)) | 870 | (append (operating-system-privileged-programs os) |
| 871 | (operating-system-setuid-programs os))) | ||
| 864 | (service profile-service-type (operating-system-packages os))))) | 872 | (service profile-service-type (operating-system-packages os))))) |
| 865 | 873 | ||
| 866 | (define* (operating-system-services os) | 874 | (define* (operating-system-services os) |
| @@ -1239,8 +1247,7 @@ use 'plain-file' instead~%") | |||
| 1239 | ;; when /etc/machine-id is missing. Make sure these warnings are non-fatal. | 1247 | ;; when /etc/machine-id is missing. Make sure these warnings are non-fatal. |
| 1240 | ("DBUS_FATAL_WARNINGS" . "0"))) | 1248 | ("DBUS_FATAL_WARNINGS" . "0"))) |
| 1241 | 1249 | ||
| 1242 | (define %setuid-programs | 1250 | (define %default-privileged-programs |
| 1243 | ;; Default set of setuid-root programs. | ||
| 1244 | (let ((shadow (@ (gnu packages admin) shadow))) | 1251 | (let ((shadow (@ (gnu packages admin) shadow))) |
| 1245 | (map file-like->setuid-program | 1252 | (map file-like->setuid-program |
| 1246 | (list (file-append shadow "/bin/passwd") | 1253 | (list (file-append shadow "/bin/passwd") |
| @@ -1262,6 +1269,12 @@ use 'plain-file' instead~%") | |||
| 1262 | (file-append util-linux "/bin/mount") | 1269 | (file-append util-linux "/bin/mount") |
| 1263 | (file-append util-linux "/bin/umount"))))) | 1270 | (file-append util-linux "/bin/umount"))))) |
| 1264 | 1271 | ||
| 1272 | (define %setuid-programs | ||
| 1273 | ;; Do not add to this list or use it in new code! It's defined only to ease | ||
| 1274 | ;; transition to %default-privileged-programs and will be removed. Some rare | ||
| 1275 | ;; use cases already break, such as the obvious (remove … %setuid-programs). | ||
| 1276 | '()) | ||
| 1277 | |||
| 1265 | (define %sudoers-specification | 1278 | (define %sudoers-specification |
| 1266 | ;; Default /etc/sudoers contents: 'root' and all members of the 'wheel' | 1279 | ;; Default /etc/sudoers contents: 'root' and all members of the 'wheel' |
| 1267 | ;; group can do anything. See | 1280 | ;; group can do anything. See |
