1 /* $NetBSD: openpam_constants.c,v 1.2 2014/10/24 18:17:56 christos Exp $ */ 2 3 /*- 4 * Copyright (c) 2001-2003 Networks Associates Technology, Inc. 5 * Copyright (c) 2004-2011 Dag-Erling Smørgrav 6 * All rights reserved. 7 * 8 * This software was developed for the FreeBSD Project by ThinkSec AS and 9 * Network Associates Laboratories, the Security Research Division of 10 * Network Associates, Inc. under DARPA/SPAWAR contract N66001-01-C-8035 11 * ("CBOSS"), as part of the DARPA CHATS research program. 12 * 13 * Redistribution and use in source and binary forms, with or without 14 * modification, are permitted provided that the following conditions 15 * are met: 16 * 1. Redistributions of source code must retain the above copyright 17 * notice, this list of conditions and the following disclaimer. 18 * 2. Redistributions in binary form must reproduce the above copyright 19 * notice, this list of conditions and the following disclaimer in the 20 * documentation and/or other materials provided with the distribution. 21 * 3. The name of the author may not be used to endorse or promote 22 * products derived from this software without specific prior written 23 * permission. 24 * 25 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 28 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 35 * SUCH DAMAGE. 36 * 37 * Id: openpam_constants.c 690 2013-08-15 13:22:51Z des 38 */ 39 40 #ifdef HAVE_CONFIG_H 41 # include "config.h" 42 #endif 43 44 #include <sys/cdefs.h> 45 __RCSID("$NetBSD: openpam_constants.c,v 1.2 2014/10/24 18:17:56 christos Exp $"); 46 47 #include <security/pam_appl.h> 48 49 #include "openpam_impl.h" 50 51 const char *pam_err_name[PAM_NUM_ERRORS] = { 52 "PAM_SUCCESS", 53 "PAM_OPEN_ERR", 54 "PAM_SYMBOL_ERR", 55 "PAM_SERVICE_ERR", 56 "PAM_SYSTEM_ERR", 57 "PAM_BUF_ERR", 58 "PAM_CONV_ERR", 59 "PAM_PERM_DENIED", 60 "PAM_MAXTRIES", 61 "PAM_AUTH_ERR", 62 "PAM_NEW_AUTHTOK_REQD", 63 "PAM_CRED_INSUFFICIENT", 64 "PAM_AUTHINFO_UNAVAIL", 65 "PAM_USER_UNKNOWN", 66 "PAM_CRED_UNAVAIL", 67 "PAM_CRED_EXPIRED", 68 "PAM_CRED_ERR", 69 "PAM_ACCT_EXPIRED", 70 "PAM_AUTHTOK_EXPIRED", 71 "PAM_SESSION_ERR", 72 "PAM_AUTHTOK_ERR", 73 "PAM_AUTHTOK_RECOVERY_ERR", 74 "PAM_AUTHTOK_LOCK_BUSY", 75 "PAM_AUTHTOK_DISABLE_AGING", 76 "PAM_NO_MODULE_DATA", 77 "PAM_IGNORE", 78 "PAM_ABORT", 79 "PAM_TRY_AGAIN", 80 "PAM_MODULE_UNKNOWN", 81 "PAM_DOMAIN_UNKNOWN" 82 }; 83 84 const char *pam_item_name[PAM_NUM_ITEMS] = { 85 "(NO ITEM)", 86 "PAM_SERVICE", 87 "PAM_USER", 88 "PAM_TTY", 89 "PAM_RHOST", 90 "PAM_CONV", 91 "PAM_AUTHTOK", 92 "PAM_OLDAUTHTOK", 93 "PAM_RUSER", 94 "PAM_USER_PROMPT", 95 "PAM_REPOSITORY", 96 "PAM_AUTHTOK_PROMPT", 97 "PAM_OLDAUTHTOK_PROMPT", 98 "PAM_HOST", 99 "PAM_SOCKADDR", 100 "PAM_NUSER" 101 }; 102 103 const char *pam_facility_name[PAM_NUM_FACILITIES] = { 104 [PAM_ACCOUNT] = "account", 105 [PAM_AUTH] = "auth", 106 [PAM_PASSWORD] = "password", 107 [PAM_SESSION] = "session", 108 }; 109 110 const char *pam_control_flag_name[PAM_NUM_CONTROL_FLAGS] = { 111 [PAM_BINDING] = "binding", 112 [PAM_OPTIONAL] = "optional", 113 [PAM_REQUIRED] = "required", 114 [PAM_REQUISITE] = "requisite", 115 [PAM_SUFFICIENT] = "sufficient", 116 }; 117 118 const char *pam_func_name[PAM_NUM_PRIMITIVES] = { 119 "pam_authenticate", 120 "pam_setcred", 121 "pam_acct_mgmt", 122 "pam_open_session", 123 "pam_close_session", 124 "pam_chauthtok" 125 }; 126 127 const char *pam_sm_func_name[PAM_NUM_PRIMITIVES] = { 128 "pam_sm_authenticate", 129 "pam_sm_setcred", 130 "pam_sm_acct_mgmt", 131 "pam_sm_open_session", 132 "pam_sm_close_session", 133 "pam_sm_chauthtok" 134 }; 135 136 const char *openpam_policy_path[] = { 137 "/etc/pam.d/", 138 "/etc/pam.conf", 139 #ifndef __NetBSD__ 140 "/usr/local/etc/pam.d/", 141 "/usr/local/etc/pam.conf", 142 #endif 143 NULL 144 }; 145 146 const char *openpam_module_path[] = { 147 #ifdef OPENPAM_MODULES_DIRECTORY 148 OPENPAM_MODULES_DIRECTORY, 149 #else 150 "/usr/lib", 151 "/usr/local/lib", 152 #endif 153 NULL 154 }; 155