From c040058fe3828fd48b01f3410b8095145fcd7f37 Mon Sep 17 00:00:00 2001 From: Jason Franklin Date: Fri, 8 May 2020 13:20:14 -0400 Subject: [PATCH] Check for "NONEXISTENT" in "src/pwck.c" --- src/pwck.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/pwck.c b/src/pwck.c index be404c37..3d494a69 100644 --- a/src/pwck.c +++ b/src/pwck.c @@ -527,12 +527,16 @@ static void check_pw_file (int *errors, bool *changed) * Make sure the home directory exists */ if (!quiet && (access (pwd->pw_dir, F_OK) != 0)) { + const char *nonexistent = getdef_str("NONEXISTENT"); + /* - * Home directory doesn't exist, give a warning + * Home directory does not exist, give a warning (unless intentional) */ - printf (_("user '%s': directory '%s' does not exist\n"), - pwd->pw_name, pwd->pw_dir); - *errors += 1; + if (NULL == nonexistent || strcmp (pwd->pw_dir, nonexistent) != 0) { + printf (_("user '%s': directory '%s' does not exist\n"), + pwd->pw_name, pwd->pw_dir); + *errors += 1; + } } }