Userland: Stop id command accepting -n in default format

This commit is contained in:
rhin123 2020-01-15 17:25:07 -06:00 committed by Andreas Kling
commit 0f3880ec4a
Notes: sideshowbarker 2024-07-19 10:01:42 +09:00

View file

@ -41,6 +41,11 @@ int main(int argc, char** argv)
} }
} }
if (flag_print_name && !(flag_print_uid || flag_print_gid || flag_print_gid_all)) {
fprintf(stderr, "cannot print only names or real IDs in default format\n");
return 1;
}
if (flag_print_uid + flag_print_gid + flag_print_gid_all > 1) { if (flag_print_uid + flag_print_gid + flag_print_gid_all > 1) {
fprintf(stderr, "cannot print \"only\" of more than one choice\n"); fprintf(stderr, "cannot print \"only\" of more than one choice\n");
return 1; return 1;