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