aboutsummaryrefslogtreecommitdiff
path: root/tests/id.test
AgeCommit message (Collapse)Author
2019-11-23id.test: fix tests on Mac.Elliott Hughes
BSDs call the root group "wheel" instead. Also remove the duplicated "id id" from the progress output.
2019-11-05id: fix Android issues.Elliott Hughes
glibc doesn't set errno when getpw* fails, so the perror_exit() looked fine. bionic sets ENOENT and the trailing "No such file or directory" looks silly, so switch to error_exit(). Additionally, the default format tests fail on Android because of SELinux (but for a different reason than usual!). There's no id --no-context flag, so use sed to just throw away any SELinux context.
2019-11-05id.c: fix -nG.Elliott Hughes
The previous patch broke -nG, so move the -G code back to showone() which handles -n. Add the missing tests for the various uses of -n. Also refactor the code to avoid the need to test optflags directly.
2019-11-04id: various fixes.Elliott Hughes
Handle unknown groups (fixes #117). Fix -G to show *all* groups, not just all supplementary groups. Fix -Z output to not include "context=".
2019-11-03id: support numeric lookup.Elliott Hughes
Fall back to converting the "name" to an integer and calling getpwuid(). We need to update `username` for the later call to getgrouplist(). Also fix the separator printing logic to avoid a trailing ',' on `id 0`. Switch to FLAG() and move some declarations down to where they can be initialized, both for clarity. Also add simple tests. Sadly, there's no always-present user that is in multiple groups.