diff options
author | Ryan Dwyer <RyanDwyer@users.noreply.github.com> | 2018-07-18 09:32:03 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-18 09:32:03 +1000 |
commit | 8ce7e3b44eea0a270ecc35a9da2ae801aaf6bce1 (patch) | |
tree | 6badffb0c6ee33b4e23e914c4c9f9b39a625b5f3 /swaylock/password.c | |
parent | Destroy empty workspace when destroying its output (diff) | |
parent | Merge pull request #2281 from pvsr/X11_click (diff) | |
download | sway-8ce7e3b44eea0a270ecc35a9da2ae801aaf6bce1.tar.gz sway-8ce7e3b44eea0a270ecc35a9da2ae801aaf6bce1.tar.zst sway-8ce7e3b44eea0a270ecc35a9da2ae801aaf6bce1.zip |
Merge branch 'master' into destroy-output-destroy-empty-workspaces
Diffstat (limited to 'swaylock/password.c')
-rw-r--r-- | swaylock/password.c | 10 |
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) { | |||
53 | // TODO: only call pam_start once. keep the same handle the whole time | 53 | // TODO: only call pam_start once. keep the same handle the whole time |
54 | if ((pam_err = pam_start("swaylock", username, | 54 | if ((pam_err = pam_start("swaylock", username, |
55 | &local_conversation, &local_auth_handle)) != PAM_SUCCESS) { | 55 | &local_conversation, &local_auth_handle)) != PAM_SUCCESS) { |
56 | wlr_log(L_ERROR, "PAM returned error %d", pam_err); | 56 | wlr_log(WLR_ERROR, "PAM returned error %d", pam_err); |
57 | } | 57 | } |
58 | if ((pam_err = pam_authenticate(local_auth_handle, 0)) != PAM_SUCCESS) { | 58 | if ((pam_err = pam_authenticate(local_auth_handle, 0)) != PAM_SUCCESS) { |
59 | wlr_log(L_ERROR, "pam_authenticate failed"); | 59 | wlr_log(WLR_ERROR, "pam_authenticate failed"); |
60 | goto fail; | 60 | goto fail; |
61 | } | 61 | } |
62 | // TODO: only call pam_end once we succeed at authing. refresh tokens beforehand | 62 | // TODO: only call pam_end once we succeed at authing. refresh tokens beforehand |
63 | if ((pam_err = pam_end(local_auth_handle, pam_err)) != PAM_SUCCESS) { | 63 | if ((pam_err = pam_end(local_auth_handle, pam_err)) != PAM_SUCCESS) { |
64 | wlr_log(L_ERROR, "pam_end failed"); | 64 | wlr_log(WLR_ERROR, "pam_end failed"); |
65 | goto fail; | 65 | goto fail; |
66 | } | 66 | } |
67 | clear_password_buffer(pw); | 67 | clear_password_buffer(pw); |
@@ -95,6 +95,10 @@ void swaylock_handle_key(struct swaylock_state *state, | |||
95 | switch (keysym) { | 95 | switch (keysym) { |
96 | case XKB_KEY_KP_Enter: /* fallthrough */ | 96 | case XKB_KEY_KP_Enter: /* fallthrough */ |
97 | case XKB_KEY_Return: | 97 | case XKB_KEY_Return: |
98 | if (state->args.ignore_empty && state->password.len == 0) { | ||
99 | break; | ||
100 | } | ||
101 | |||
98 | state->auth_state = AUTH_STATE_VALIDATING; | 102 | state->auth_state = AUTH_STATE_VALIDATING; |
99 | damage_state(state); | 103 | damage_state(state); |
100 | while (wl_display_dispatch(state->display) != -1 && state->run_display) { | 104 | while (wl_display_dispatch(state->display) != -1 && state->run_display) { |