summaryrefslogtreecommitdiff
path: root/src/pwck.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/pwck.c')
-rw-r--r--src/pwck.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/pwck.c b/src/pwck.c
index be404c37..4248944a 100644
--- a/src/pwck.c
+++ b/src/pwck.c
@@ -70,6 +70,7 @@
* Global variables
*/
const char *Prog;
+FILE *shadow_logfd = NULL;
static bool use_system_pw_file = true;
static bool use_system_spw_file = true;
@@ -527,12 +528,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;
+ }
}
}