userdbctl: fix "Password OK" shown even when password is empty or locked (#21308)

userdbctl: fix "Password OK" shown even when password is empty or locked
This commit is contained in:
Pigmy-penguin
2022-01-06 16:01:38 +00:00
committed by GitHub
parent 7611946ebc
commit cd933f14bd
3 changed files with 25 additions and 6 deletions
+4
View File
@@ -114,6 +114,10 @@ int is_this_me(const char *username);
const char *get_home_root(void);
static inline bool hashed_password_is_locked_or_invalid(const char *password) {
return password && password[0] != '$';
}
/* A locked *and* invalid password for "struct spwd"'s .sp_pwdp and "struct passwd"'s .pw_passwd field */
#define PASSWORD_LOCKED_AND_INVALID "!*"