Browse Source

Initialize the logging ASAP to catch earlier errors

master
Andrea Luzzardi 17 years ago
parent
commit
4abebea030
2 changed files with 3 additions and 2 deletions
  1. +1
    -1
      pam_usb/src/pam.c
  2. +2
    -1
      pam_usb/src/pamusb-check.c

+ 1
- 1
pam_usb/src/pam.c View File

@ -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");


+ 2
- 1
pam_usb/src/pamusb-check.c View File

@ -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);


Loading…
Cancel
Save