Is it OK to close pam_handle and re-open it?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Is it necessary to preserve the same pam_handle across
multiple calls to the various pam_* functions, or is it
OK to fetch a new pam_handle by calling pam_start() whenever
one is needed? Is there some state that is lost by doing
this? 

So, for example is the following code actually OK, or would
the same 'pamh' instance need to be preserved across all of the 
calls to pam_authenticate, pam_acct_mgmt, etc?

func1()
{
  pam_handle_t *pamh = 0;
  pam_start("myapp", 0, &conv, &pamh);
  pam_authenticate(pamh, 0);
  pam_end(pamh);
}

func2()
{
  pam_handle_t *pamh = 0;
  pam_start("myapp", 0, &conv, &pamh);
  pam_acct_mgmt(pamh, 0);
  pam_end(pamh);
}

func3()
{
  pam_handle_t *pamh = 0;
  pam_start("myapp", 0, &conv, &pamh);
  pam_open_session(pamh)
  pam_end(pamh);
}




_______________________________________________

Pam-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/pam-list

[Index of Archives]     [Fedora Users]     [Kernel]     [Red Hat Install]     [Linux for the blind]     [Gimp]

  Powered by Linux