diff --git a/src/pam.c b/src/pam.c index 8e2641d..b68ac5a 100644 --- a/src/pam.c +++ b/src/pam.c @@ -36,6 +36,7 @@ int pam_sm_authenticate(pam_handle_t *pamh, int flags, char *conf_file = PUSB_CONF_FILE; int retval; + pusb_log_init(&opts); retval = pam_get_item(pamh, PAM_SERVICE, (const void **)(const void *)&service); if (retval != PAM_SUCCESS) @@ -58,7 +59,6 @@ int pam_sm_authenticate(pam_handle_t *pamh, int flags, if (!pusb_conf_parse(conf_file, &opts, user, service)) return (PAM_AUTH_ERR); - pusb_log_init(&opts); if (!opts.enable) { log_debug("Not enabled, exiting...\n"); diff --git a/src/pamusb-check.c b/src/pamusb-check.c index 30a449b..0466b71 100644 --- a/src/pamusb-check.c +++ b/src/pamusb-check.c @@ -123,6 +123,8 @@ int main(int argc, char **argv) pusb_check_usage(argv[0]); return (1); } + + pusb_log_init(&opts); if (!pusb_conf_init(&opts)) return (1); if (!pusb_conf_parse(conf_file, &opts, user, service)) @@ -132,7 +134,6 @@ int main(int argc, char **argv) opts.quiet = 1; opts.debug = 0; } - pusb_log_init(&opts); if (dump) { pusb_check_conf_dump(&opts, user, service);