1f800c5
diff --git a/libuser.c b/libuser.c
1f800c5
index 7a36520..06c6200 100644
1f800c5
--- a/libuser.c
1f800c5
+++ b/libuser.c
1f800c5
@@ -245,6 +245,7 @@ pwdb_display_status(const char *username)
1f800c5
 	struct lu_ent *ent;
1f800c5
 	struct lu_error *error = NULL;
1f800c5
 	char *current;
1f800c5
+	char *current_user;
1f800c5
 	char *realname;
1f800c5
 	const char *msg;
1f800c5
 	int shadow = 1;
1f800c5
@@ -268,9 +269,10 @@ pwdb_display_status(const char *username)
1f800c5
 			goto bail;
1f800c5
 		}
1f800c5
 		current = lu_ent_get_first_value_strdup(ent, LU_SHADOWPASSWORD);
1f800c5
+		current_user = lu_ent_get_first_value_strdup(ent, LU_USERPASSWORD);
1f800c5
 		if (current == NULL) {
1f800c5
 			shadow = 0;
1f800c5
-			current = lu_ent_get_first_value_strdup(ent, LU_USERPASSWORD);
1f800c5
+			current = current_user;
1f800c5
 		} else {
1f800c5
 			sp_lstchg = (time_t) ent_value_int64(ent, LU_SHADOWLASTCHANGE);
1f800c5
 			sp_min = ent_value_int64(ent, LU_SHADOWMIN);
1f800c5
@@ -310,6 +312,13 @@ pwdb_display_status(const char *username)
1f800c5
 				msg = _("Password set, DES crypt.");
1f800c5
 			}
1f800c5
 			if (shadow) {
1f800c5
+				if (status[0] != 'N' && current_user && strlen(current_user) == 0) {
1f800c5
+					fprintf(stderr, "%s: %s\n", progname,
1f800c5
+						_("There is a password information set in /etc/shadow,"
1f800c5
+						  " but the password field in /etc/passwd is empty."));
1f800c5
+					msg = _("Empty password.");
1f800c5
+					status = "NP";
1f800c5
+				}
1f800c5
 				sp_lstchg = sp_lstchg * 24L * 3600L;
1f800c5
 				localtime_r(&sp_lstchg, &tm;;
1f800c5
 				strftime(date, sizeof(date), "%Y-%m-%d", &tm;;
1f800c5
@@ -319,6 +328,9 @@ pwdb_display_status(const char *username)
1f800c5
 				printf("%s %s (%s)\n", realname, status, msg);
1f800c5
 			}
1f800c5
 			g_free(current);
1f800c5
+			if (shadow && current_user) {
1f800c5
+				g_free(current_user);
1f800c5
+			}
1f800c5
 		} else {
1f800c5
 			printf(_("No password set.\n"));
1f800c5
 		}