getting user by name even if no match - pw_what_if_no_match_but_by_name_exists

This commit is contained in:
Michał Krzysztof Feiler 2018-10-12 15:03:16 +02:00
parent 5da7bcf031
commit 7b8ad5b0c0
1 changed files with 9 additions and 0 deletions

View File

@ -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++)