From e3935ad1431623b5e3966e95cd75b45e7e00e278 Mon Sep 17 00:00:00 2001 From: Brian Ashworth Date: Mon, 14 Jan 2019 23:30:54 -0500 Subject: 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 --- pam.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'pam.c') diff --git a/pam.c b/pam.c index e48056f..805817a 100644 --- a/pam.c +++ b/pam.c @@ -5,7 +5,7 @@ #include #include #include -#include +#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); -- cgit v1.2.3