Browse Source

Check the return of the conf initialization

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

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

@ -53,7 +53,8 @@ int pam_sm_authenticate(pam_handle_t *pamh, int flags,
if (argc > 1) if (argc > 1)
if (!strcmp(argv[0], "-c")) if (!strcmp(argv[0], "-c"))
conf_file = (char *)argv[1]; conf_file = (char *)argv[1];
pusb_conf_init(&opts);
if (!pusb_conf_init(&opts))
return (PAM_AUTH_ERR);
if (!pusb_conf_parse(conf_file, &opts, user, service)) if (!pusb_conf_parse(conf_file, &opts, user, service))
return (PAM_AUTH_ERR); return (PAM_AUTH_ERR);


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

@ -123,7 +123,8 @@ int main(int argc, char **argv)
pusb_check_usage(argv[0]); pusb_check_usage(argv[0]);
return (1); return (1);
} }
pusb_conf_init(&opts);
if (!pusb_conf_init(&opts))
return (1);
if (!pusb_conf_parse(conf_file, &opts, user, service)) if (!pusb_conf_parse(conf_file, &opts, user, service))
return (1); return (1);
if (quiet) if (quiet)


Loading…
Cancel
Save