HomeFreeBSD

chroot: slightly cleanup

Description

chroot: slightly cleanup

Highlights:

  • Pull resolve_user() and resolve_group() out to make the main flow a bit easier to read
  • Fix some edge-cases in user/group resolution: you can have fully numeric usernames, and they may or may not live within the valid ID range. Switch to just trying to resolve every specified group/user as a name, first, with a fallback to converting it to a numeric type and trying to resolve it as an ID.
  • Constify locals in main() that don't need to be mutable, re-sort

Reviewed by: emaste, olce
Differential Revision: https://reviews.freebsd.org/D51509

Details

Provenance
kevansAuthored on Aug 3 2025, 4:15 AM
Reviewer
emaste
Differential Revision
D51509: chroot: slightly cleanup
Parents
rG702423e864a5: libc: gen: refactor execvPe() for readability
Branches
Unknown
Tags
Unknown