diff options
author | Giacomo Leidi <goodoldpaul@autistici.org> | 2024-10-08 00:40:27 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2024-12-18 18:32:40 +0100 |
commit | 337037d22cfcc7764c1ce87127166c351a91369d (patch) | |
tree | aaa67b2d13770e5b0daa8cad0d00f64fa40b5fdd /gnu/build/secret-service.scm | |
parent | 58f430f69e71f95cedab9912c1c9f2cc8660fad9 (diff) | |
download | guix-337037d22cfcc7764c1ce87127166c351a91369d.tar.gz guix-337037d22cfcc7764c1ce87127166c351a91369d.zip |
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>
Diffstat (limited to 'gnu/build/secret-service.scm')
0 files changed, 0 insertions, 0 deletions