1
0
mirror of https://github.com/Yubico/yubico-pam.git synced 2024-11-29 00:24:11 +01:00

add ykclient_global_init() and ykclient_global_done() calls

This commit is contained in:
Klas Lindfors 2015-02-16 08:19:59 +01:00
parent 4b8b24d189
commit 3b3a96efc2

View File

@ -791,8 +791,13 @@ pam_sm_authenticate (pam_handle_t * pamh,
goto done;
}
rc = ykclient_init (&ykc);
if (rc != YKCLIENT_OK)
if(ykclient_global_init() != YKCLIENT_OK)
{
DBG (("Failed initializing ykclient library"));
retval = PAM_AUTHINFO_UNAVAIL;
goto done;
}
if (ykclient_init (&ykc) != YKCLIENT_OK)
{
DBG (("ykclient_init() failed (%d): %s", rc, ykclient_strerror (rc)));
retval = PAM_AUTHINFO_UNAVAIL;
@ -1014,7 +1019,10 @@ done:
if (tmpurl)
free(tmpurl);
if (ykc)
ykclient_done (&ykc);
{
ykclient_done (&ykc);
ykclient_global_done();
}
if (cfg->alwaysok && retval != PAM_SUCCESS)
{
DBG (("alwaysok needed (otherwise return with %d)", retval));