#include "mod_insert.h" extern "C" { #ifndef PAM_STATIC #define PAM_STATIC #endif #include } extern struct pam_module_list *_pam_static_modules; std::set *smf_authstrings = 0; //We allocate memory here that is never freed. //In the event we implement M-host shutdown, we'll //have to free this memory. // //lint -e{1524} pam_module_insert::pam_module_insert(pam_module *mod) { pam_module_list *elem = new pam_module_list; // If this module has a description, register it in the authmethods // table. if (mod->descr != 0) { if (smf_authstrings == 0) { smf_authstrings = new std::set; } smf_authstrings->insert(mod->descr); } elem->modp = mod; // XXX - place semaphore around these two lines // (currently not needed, since only one thread does initialization) elem->next = _pam_static_modules; _pam_static_modules = elem; }