From 0f3880ec4a560059dac94090cee074cd7b862cca Mon Sep 17 00:00:00 2001 From: rhin123 Date: Wed, 15 Jan 2020 17:25:07 -0600 Subject: [PATCH] Userland: Stop id command accepting -n in default format --- Userland/id.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Userland/id.cpp b/Userland/id.cpp index 2dc4bab3f1..ee8b0ebd77 100644 --- a/Userland/id.cpp +++ b/Userland/id.cpp @@ -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) { fprintf(stderr, "cannot print \"only\" of more than one choice\n"); return 1;