Discovered this while writing the tests for #12252
GNU coreutils deduplicates group IDs before printing them. This can be observed when using unshared, which will map all unmapped GIDs to 65534(nogroup):
$ unshare -U --map-user=101010 --map-group=1010101 -- id
uid=101010 gid=1010101 groups=1010101,65534(nogroup)
C:\> unshare -U --map-user=101010 --map-group=1010101 -- ./target/release/id
uid=101010(101010) gid=1010101(1010101) groups=1010101(1010101),65534(nogroup),65534(nogroup),65534(nogroup),65534(nogroup),65534(nogroup),65534(nogroup)
Discovered this while writing the tests for #12252
GNU coreutils deduplicates group IDs before printing them. This can be observed when using
unshared, which will map all unmapped GIDs to65534(nogroup):