summaryrefslogtreecommitdiff
path: root/pam.c
diff options
context:
space:
mode:
authorBrian Ashworth <bosrsf04@gmail.com>2019-01-14 23:30:54 -0500
committerBrian Ashworth <bosrsf04@gmail.com>2019-01-14 23:30:54 -0500
commite3935ad1431623b5e3966e95cd75b45e7e00e278 (patch)
tree01a33b3422b9d17ad3b63fb4decb972876210f88 /pam.c
parentfcf1bd4ebea97ae6ecd30e4f4e0c526b405b871a (diff)
Implement logging and remove wlroots dependency
This implements a simpler version of the wlroots logger for swaylock. With this logger, the dependency on wlroots can be dropped. This also adds a debug flag and disables debugging output by default
Diffstat (limited to 'pam.c')
-rw-r--r--pam.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/pam.c b/pam.c
index e48056f..805817a 100644
--- a/pam.c
+++ b/pam.c
@@ -5,7 +5,7 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include <wlr/util/log.h>
+#include "log.h"
#include "swaylock.h"
void initialize_pw_backend(void) {
@@ -43,15 +43,15 @@ bool attempt_password(struct swaylock_password *pw) {
int pam_err;
if ((pam_err = pam_start("swaylock", username,
&local_conversation, &local_auth_handle)) != PAM_SUCCESS) {
- wlr_log(WLR_ERROR, "PAM returned error %d", pam_err);
+ swaylock_log(LOG_ERROR, "PAM returned error %d", pam_err);
}
if ((pam_err = pam_authenticate(local_auth_handle, 0)) != PAM_SUCCESS) {
- wlr_log(WLR_ERROR, "pam_authenticate failed");
+ swaylock_log(LOG_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(WLR_ERROR, "pam_end failed");
+ swaylock_log(LOG_ERROR, "pam_end failed");
goto fail;
}
clear_password_buffer(pw);