login provides some required infrastructure for logins and for changing effective user or group IDs, including:
Reimplement this command in Rust:
Upstream: https://github.com/shadow-maint/shadow