confd: harmonize empty and missing password hash behavior

Removing a user's password hash should be the same an empty password
hash.  In the latter case we already allow login with SSH keys, this
change harmonizes the behavior by also allowing login with SSH keys
when the users's password hash is removed.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2024-08-08 13:35:27 +02:00
parent 39e4935369
commit a275282307
+2 -2
View File
@@ -1087,10 +1087,10 @@ static sr_error_t handle_sr_passwd_update(sr_session_ctx_t *, struct confd *conf
NOTE("Password updated for user %s", user);
break;
case SR_OP_DELETED:
if (set_password(user, "*", true))
if (set_password(user, "*", false))
err = SR_ERR_SYS;
else
NOTE("Password deleted for user %s", user);
NOTE("Password login disabled for user %s", user);
break;
case SR_OP_MOVED:
break;