guix/gnu/system
Giacomo Leidi 337037d22c
accounts: Add /etc/subid and /etc/subgid allocation logic.
This commit adds allocation logic for subid ranges. Subid ranges are
ranges of contiguous subids that are mapped to a user in the host
system. This patch implements a flexible allocation algorithm allowing
users that do not want (or need) to specify details of the subid ranges
that they are requesting to avoid doing so, while upholding requests of
users that need to have specific ranges.

* gnu/build/accounts.scm (%subordinate-id-min): New variable;
(%subordinate-id-max): new variable;
(%subordinate-id-count): new variable;
(subordinate-id?): new variable;
(&subordinate-id-error): new variable;
(&subordinate-id-overflow-error): new variable;
(&illegal-subid-range-error): new variable;
(&specific-subid-range-expected-error): new variable;
(&generic-subid-range-expected-error): new variable;
(within-interval?): new variable;
(allocate-unused-range): new variable;
(allocate-generic-range): new variable;
(allocate-specific-range): new variable;
(reserve-subids): new variable;
(range->entry): new variable;
(entry->range): new variable;
(allocate-subids): new variable;
(subuid+subgid-databases): new variable.

* gnu/system/accounts.scm (subid-range-end): New variable;
(subid-range-has-start?): new variable;
(subid-range-less): new variable.

* test/accounts.scm: Test them.

Change-Id: I8de1fd7cfe508b9c76408064d6f498471da0752d
Co-Authored-By: Ludovic Courtès <ludo@gnu.org>
Signed-off-by: Giacomo Leidi <goodoldpaul@autistici.org>
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2024-12-18 18:32:40 +01:00
..
examples system: examples: Update instructions in {bare,devel}-hurd64.tmpl. 2024-12-18 17:00:13 +01:00
images system: image: Add hurd64 image types. 2024-12-03 08:39:00 +01:00
accounts.scm accounts: Add /etc/subid and /etc/subgid allocation logic. 2024-12-18 18:32:40 +01:00
file-systems.scm services: base: Add optional delayed mount of file-systems 2024-06-04 12:08:34 +02:00
hurd.scm services: shepherd: Default to 1.0. 2024-12-09 23:15:44 +01:00
image.scm image: Add support for btrfs. 2024-10-14 14:08:43 +02:00
install.scm install: Open info manuals that have region codes. 2024-11-20 16:01:47 +01:00
keyboard.scm
linux-container.scm
linux-initrd.scm linux-initrd: Export ‘file-system-modules’. 2024-11-18 10:58:42 +01:00
locale.scm system: locale: ‘glibc-supported-locales’ uses zstd instead of xz. 2024-09-09 17:17:55 +02:00
mapped-devices.scm mapped-devices: lvm: Add missing module import. 2024-05-27 19:30:22 +02:00
nss.scm
pam.scm
privilege.scm privilege: Add file-like->setuid-program helper. 2024-09-08 02:00:00 +02:00
setuid.scm privilege: Add file-like->setuid-program helper. 2024-09-08 02:00:00 +02:00
shadow.scm
uuid.scm uuid: Add support for exFAT. 2024-09-01 02:00:00 +02:00
vm.scm