From: Jason Franklin Date: Fri, 8 May 2020 17:20:14 +0000 (-0400) Subject: Check for "NONEXISTENT" in "src/pwck.c" X-Git-Tag: v4.9~76^2~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c040058fe3828fd48b01f3410b8095145fcd7f37;p=thirdparty%2Fshadow.git Check for "NONEXISTENT" in "src/pwck.c" --- diff --git a/src/pwck.c b/src/pwck.c index be404c37f..3d494a69d 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; + } } }