openpam_static.c revision 115619
16059Samurai/*- 26059Samurai * Copyright (c) 2002-2003 Networks Associates Technology, Inc. 36059Samurai * All rights reserved. 46059Samurai * 56059Samurai * This software was developed for the FreeBSD Project by ThinkSec AS and 66059Samurai * Network Associates Laboratories, the Security Research Division of 76059Samurai * Network Associates, Inc. under DARPA/SPAWAR contract N66001-01-C-8035 86059Samurai * ("CBOSS"), as part of the DARPA CHATS research program. 96059Samurai * 106059Samurai * Redistribution and use in source and binary forms, with or without 116059Samurai * modification, are permitted provided that the following conditions 126059Samurai * are met: 136059Samurai * 1. Redistributions of source code must retain the above copyright 146059Samurai * notice, this list of conditions and the following disclaimer. 156059Samurai * 2. Redistributions in binary form must reproduce the above copyright 166059Samurai * notice, this list of conditions and the following disclaimer in the 176059Samurai * documentation and/or other materials provided with the distribution. 186059Samurai * 3. The name of the author may not be used to endorse or promote 196059Samurai * products derived from this software without specific prior written 2037010Sbrian * permission. 218857Srgrimes * 226059Samurai * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 236059Samurai * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 2436285Sbrian * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2536452Sbrian * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 2630715Sbrian * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 2730715Sbrian * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2830715Sbrian * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2930715Sbrian * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 3036285Sbrian * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 3136285Sbrian * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 3230715Sbrian * SUCH DAMAGE. 3330715Sbrian * 346059Samurai * $P4: //depot/projects/openpam/lib/openpam_static.c#6 $ 3511336Samurai */ 3630715Sbrian 3730715Sbrian#include <string.h> 3830715Sbrian 396059Samurai#include <security/pam_appl.h> 406059Samurai 4118786Sjkh#include "openpam_impl.h" 4230715Sbrian 4330715Sbrian#ifdef OPENPAM_STATIC_MODULES 4430715Sbrian 4530715SbrianSET_DECLARE(_openpam_static_modules, pam_module_t); 4631061Sbrian 4730715Sbrian/* 4830715Sbrian * OpenPAM internal 4936285Sbrian * 506059Samurai * Locate a statically linked module 5131514Sbrian */ 5213389Sphk 5336285Sbrianpam_module_t * 5436285Sbrianopenpam_static(const char *path) 5536285Sbrian{ 566059Samurai pam_module_t **module; 5736285Sbrian 5836285Sbrian SET_FOREACH(module, _openpam_static_modules) { 5936285Sbrian if (strcmp((*module)->path, path) == 0) 6036285Sbrian return (*module); 6136285Sbrian } 6226142Sbrian return (NULL); 636735Samurai} 6413389Sphk 6513389Sphk#endif 6623840Sbrian 6730715Sbrian/* 6831195Sbrian * NOPARSE 6936285Sbrian */ 7036285Sbrian