This commit was generated by cvs2svn to compensate for changes in r91830,
which included commits to RCS files with non-trunk default branches.
This commit is contained in:
commit
5e9dfbda74
@ -1,5 +1,5 @@
|
|||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2002 Networks Associates Technologies, Inc.
|
* Copyright (c) 2002 Networks Associates Technology, Inc.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* This software was developed for the FreeBSD Project by ThinkSec AS and
|
* This software was developed for the FreeBSD Project by ThinkSec AS and
|
||||||
@ -31,7 +31,7 @@
|
|||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $P4: //depot/projects/openpam/lib/openpam_dynamic.c#1 $
|
* $P4: //depot/projects/openpam/lib/openpam_dynamic.c#3 $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <dlfcn.h>
|
#include <dlfcn.h>
|
||||||
@ -64,15 +64,15 @@ openpam_dynamic(const char *path)
|
|||||||
if (asprintf(&vpath, "%s.%d", path, LIB_MAJ) == -1)
|
if (asprintf(&vpath, "%s.%d", path, LIB_MAJ) == -1)
|
||||||
goto buf_err;
|
goto buf_err;
|
||||||
if ((dlh = dlopen(vpath, RTLD_NOW)) == NULL) {
|
if ((dlh = dlopen(vpath, RTLD_NOW)) == NULL) {
|
||||||
openpam_log(PAM_LOG_ERROR, "dlopen(): %s", dlerror());
|
|
||||||
*strrchr(vpath, '.') = '\0';
|
*strrchr(vpath, '.') = '\0';
|
||||||
if ((dlh = dlopen(vpath, RTLD_NOW)) == NULL) {
|
if ((dlh = dlopen(vpath, RTLD_NOW)) == NULL) {
|
||||||
openpam_log(PAM_LOG_ERROR, "dlopen(): %s", dlerror());
|
|
||||||
free(module);
|
free(module);
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
module->path = vpath;
|
free(vpath);
|
||||||
|
if ((module->path = strdup(path)) == NULL)
|
||||||
|
goto buf_err;
|
||||||
module->dlh = dlh;
|
module->dlh = dlh;
|
||||||
for (i = 0; i < PAM_NUM_PRIMITIVES; ++i)
|
for (i = 0; i < PAM_NUM_PRIMITIVES; ++i)
|
||||||
module->func[i] = dlsym(dlh, _pam_sm_func_name[i]);
|
module->func[i] = dlsym(dlh, _pam_sm_func_name[i]);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2002 Networks Associates Technologies, Inc.
|
* Copyright (c) 2002 Networks Associates Technology, Inc.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* This software was developed for the FreeBSD Project by ThinkSec AS and
|
* This software was developed for the FreeBSD Project by ThinkSec AS and
|
||||||
@ -31,7 +31,7 @@
|
|||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $P4: //depot/projects/openpam/lib/openpam_load.c#10 $
|
* $P4: //depot/projects/openpam/lib/openpam_load.c#12 $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <dlfcn.h>
|
#include <dlfcn.h>
|
||||||
@ -81,9 +81,14 @@ openpam_load_module(const char *path)
|
|||||||
(module == NULL) ? "no" : "using", path);
|
(module == NULL) ? "no" : "using", path);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (module == NULL)
|
if (module == NULL) {
|
||||||
|
openpam_log(PAM_LOG_ERROR, "no %s found", path);
|
||||||
return (NULL);
|
return (NULL);
|
||||||
|
}
|
||||||
|
openpam_log(PAM_LOG_DEBUG, "adding %s to cache", module->path);
|
||||||
module->next = modules;
|
module->next = modules;
|
||||||
|
if (module->next != NULL)
|
||||||
|
module->next->prev = module;
|
||||||
module->prev = NULL;
|
module->prev = NULL;
|
||||||
modules = module;
|
modules = module;
|
||||||
found:
|
found:
|
||||||
@ -119,6 +124,9 @@ openpam_release_module(pam_module_t *module)
|
|||||||
module->prev->next = module->next;
|
module->prev->next = module->next;
|
||||||
if (module->next != NULL)
|
if (module->next != NULL)
|
||||||
module->next->prev = module->prev;
|
module->next->prev = module->prev;
|
||||||
|
if (module == modules)
|
||||||
|
modules = module->next;
|
||||||
|
openpam_log(PAM_LOG_DEBUG, "releasing %s", module->path);
|
||||||
free(module->path);
|
free(module->path);
|
||||||
free(module);
|
free(module);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user