What is the maximum UID and GID? Can they be negative numbers?
To begin the investigation, we need to first know the type limitation. Is it an int or uint? @Wikipedia says it's signed int, but the sign bit is ignored, so 2^x ? x= ?
en.wikipedia.org/wiki/User_iden… en.wikipedia.org/wiki/Group_ide…
Still... (u?)int? Both Linux and macOS define {g,u}id as uint. Can we assume we will never encounter a negative {u,g}id? Hahaha, innocent of you to assume! On macOS, /etc/{passwd,group} has entries for `nobody` with {g,u}id of -2.
The issue was recognized when a friend reported `scp` and `rsync` not working. I found the culprit to be not hooking up the session's/channel's I/O to spawned process, otherwise the new process assumed the null devices as its std{in,out,err}.