summaryrefslogtreecommitdiffstats
path: root/swaylock
diff options
context:
space:
mode:
authorLibravatar Christoph Gysin <christoph.gysin@gmail.com>2016-01-24 13:33:32 +0200
committerLibravatar Christoph Gysin <christoph.gysin@gmail.com>2016-01-25 20:14:44 +0200
commit52fea936930d500edf7a1e257421049111d352f1 (patch)
tree60c6b75a58148aae2b982a871eb3e89d067d7435 /swaylock
parentswaylock: remove global variable pam_reply (diff)
downloadsway-52fea936930d500edf7a1e257421049111d352f1.tar.gz
sway-52fea936930d500edf7a1e257421049111d352f1.tar.zst
sway-52fea936930d500edf7a1e257421049111d352f1.zip
swaylock: add pam conversation debug output
Diffstat (limited to 'swaylock')
-rw-r--r--swaylock/main.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/swaylock/main.c b/swaylock/main.c
index e04d0d62..ca3453ff 100644
--- a/swaylock/main.c
+++ b/swaylock/main.c
@@ -40,6 +40,20 @@ char *password;
40int function_conversation(int num_msg, const struct pam_message **msg, 40int function_conversation(int num_msg, const struct pam_message **msg,
41 struct pam_response **resp, void *appdata_ptr) { 41 struct pam_response **resp, void *appdata_ptr) {
42 42
43 const char* msg_style_names[] = {
44 NULL,
45 "PAM_PROMPT_ECHO_OFF",
46 "PAM_PROMPT_ECHO_ON",
47 "PAM_ERROR_MSG",
48 "PAM_TEXT_INFO",
49 };
50
51 for(int i=0; i<num_msg; ++i) {
52 sway_log(L_DEBUG, "msg[%d]: (%s) %s", i,
53 msg_style_names[msg[i]->msg_style],
54 msg[i]->msg);
55 }
56
43 struct pam_response *pam_reply = malloc(sizeof(struct pam_response)); 57 struct pam_response *pam_reply = malloc(sizeof(struct pam_response));
44 pam_reply[0].resp = password; 58 pam_reply[0].resp = password;
45 pam_reply[0].resp_retcode = 0; 59 pam_reply[0].resp_retcode = 0;