From 7b8ad5b0c0a96ff7ee267818075ee7a05d30e781 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Krzysztof=20Feiler?= Date: Fri, 12 Oct 2018 15:03:16 +0200 Subject: [PATCH] getting user by name even if no match - pw_what_if_no_match_but_by_name_exists --- finger/finger.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/finger/finger.c b/finger/finger.c index 94c3ec0..e9709e2 100644 --- a/finger/finger.c +++ b/finger/finger.c @@ -256,6 +256,15 @@ static void do_local(int argc, char *argv[], int *used) { used[i] = 1; } } + else { + struct passwd *pw_what_if_no_match_but_by_name_exists; + if (used[i] >=0 && (pw_what_if_no_match_but_by_name_exists = getpwnam(argv[i]))) { + if (!check_nofinger(pw_what_if_no_match_but_by_name_exists)) { + enter_person(pw_what_if_no_match_but_by_name_exists); + used[i] = 1; + } + } + } /* list errors */ for (i = 0; i < argc; i++)