Skip to content

UID allocation with sysusers differs from the Perl-based users script #325052

@ivan770

Description

@ivan770

Describe the bug

Normal users usually get UIDs in the range of >=1000 when the Perl-based users script is activated:

my ($min, $max, $up) = $isSystemUser ? (400, 999, 0) : (1000, 29999, 1);

This is not the case when systemd.sysusers.enable is enabled, as new normal users may receive a UID in the range of <1000.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Open systemd-sysusers-mutable.nix test.
  2. Add the following line at the end of the "normalo user is created" subtest:
    print(machine.succeed("id -u normalo"))
  3. Run the test using nix -L build .#nixosTests.systemd-sysusers-mutable

Expected behavior

UID allocation behavior is the same as in the Perl users script.

Notify maintainers

@nikstur

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

 - system: `"x86_64-linux"`
 - host os: `Linux 6.9.7-xanmod1, NixOS, 24.05 (Uakari), 24.05.20240702.706eef5`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.22.2`
 - nixpkgs: `/etc/nix/inputs/nixpkgs`

Add a 👍 reaction to issues you find important.

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.kind: bugSomething is broken6.topic: nixosIssues or PRs affecting NixOS modules, or package usability issues specific to NixOS

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions