guix/gnu
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
..
bootloader
build accounts: Add /etc/subid and /etc/subgid allocation logic. 2024-12-18 18:32:40 +01:00
home
installer
machine
packages gramps: Update to 5.2.3. 2024-12-18 18:24:17 +01:00
services gnu: set-xorg-configuration: Update code comment. 2024-12-17 18:12:22 +02:00
system accounts: Add /etc/subid and /etc/subgid allocation logic. 2024-12-18 18:32:40 +01:00
tests
artwork.scm
bootloader.scm
ci.scm
compression.scm
home.scm
image.scm
installer.scm
local.mk gnu: librewolf: Support Guix icecat browser extensions. 2024-12-18 22:57:11 +08:00
machine.scm
packages.scm
services.scm
system.scm
tests.scm