aboutsummaryrefslogtreecommitdiff
path: root/swaylock/password.c
diff options
context:
space:
mode:
authorRyan Dwyer <RyanDwyer@users.noreply.github.com>2018-07-18 09:32:03 +1000
committerGitHub <noreply@github.com>2018-07-18 09:32:03 +1000
commit8ce7e3b44eea0a270ecc35a9da2ae801aaf6bce1 (patch)
tree6badffb0c6ee33b4e23e914c4c9f9b39a625b5f3 /swaylock/password.c
parent621d2666b1ac214c63628bbe0ac8f5d6485cb501 (diff)
parent48b911a4596f50b585a1073d32413236d9defb60 (diff)
Merge branch 'master' into destroy-output-destroy-empty-workspaces
Diffstat (limited to 'swaylock/password.c')
-rw-r--r--swaylock/password.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/swaylock/password.c b/swaylock/password.c
index d844ec98..7c686b34 100644
--- a/swaylock/password.c
+++ b/swaylock/password.c
@@ -53,15 +53,15 @@ static bool attempt_password(struct swaylock_password *pw) {
// TODO: only call pam_start once. keep the same handle the whole time
if ((pam_err = pam_start("swaylock", username,
&local_conversation, &local_auth_handle)) != PAM_SUCCESS) {
- wlr_log(L_ERROR, "PAM returned error %d", pam_err);
+ wlr_log(WLR_ERROR, "PAM returned error %d", pam_err);
}
if ((pam_err = pam_authenticate(local_auth_handle, 0)) != PAM_SUCCESS) {
- wlr_log(L_ERROR, "pam_authenticate failed");
+ wlr_log(WLR_ERROR, "pam_authenticate failed");
goto fail;
}
// TODO: only call pam_end once we succeed at authing. refresh tokens beforehand
if ((pam_err = pam_end(local_auth_handle, pam_err)) != PAM_SUCCESS) {
- wlr_log(L_ERROR, "pam_end failed");
+ wlr_log(WLR_ERROR, "pam_end failed");
goto fail;
}
clear_password_buffer(pw);
@@ -95,6 +95,10 @@ void swaylock_handle_key(struct swaylock_state *state,
switch (keysym) {
case XKB_KEY_KP_Enter: /* fallthrough */
case XKB_KEY_Return:
+ if (state->args.ignore_empty && state->password.len == 0) {
+ break;
+ }
+
state->auth_state = AUTH_STATE_VALIDATING;
damage_state(state);
while (wl_display_dispatch(state->display) != -1 && state->run_display) {