It turns out macOS does several things that go against the assumptions currently built into lsr:
- The
/etc/passwdfile has an extensive comment at the top of the file; several lines starting with#. - macOS (and apparently some other operating systems) allow negative
uids andgids.
So, the changes here:
- Allow for comments in
/etc/passwd; and - Use
i33instead ofu32,posix.uid_tandposix.gid_twhen parsing and usinguids andgids.
I chose
i33here just so we wouldn't have to include a comptimeif/elsecheck everywhere we're doing something with auidorgid. Sinceu32fits intoi33things just seemlessly work.I don't think the structs are packed, so maybe we should bump this up to
i64? Don't know what makes the most sense here, buti33seems pretty good so far.