users-groups service: add autoSubUidGidRange option

Previously we allocated subuids automatically for all normal users.
Make this explicitly configurable, so that one can use this for system
users too (or explicitly disable for normal users). Also don't allocate
automatically by default if a user already has ranges specified statically.
This commit is contained in:
Nikolay Amiantov 2022-01-05 13:20:47 +03:00
parent 95e4f1eff7
commit f2c5970a76
4 changed files with 26 additions and 2 deletions

View file

@ -351,7 +351,7 @@ foreach my $u (values %usersOut) {
push @subGids, $value;
}
if($u->{isNormalUser}) {
if($u->{autoSubUidGidRange}) {
my $subordinate = allocSubUid($name);
$subUidMap->{$name} = $subordinate;
my $value = join(":", ($name, $subordinate, 65536));