1*7c478bd9Sstevel@tonic-gate /* 2*7c478bd9Sstevel@tonic-gate * CDDL HEADER START 3*7c478bd9Sstevel@tonic-gate * 4*7c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5*7c478bd9Sstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only 6*7c478bd9Sstevel@tonic-gate * (the "License"). You may not use this file except in compliance 7*7c478bd9Sstevel@tonic-gate * with the License. 8*7c478bd9Sstevel@tonic-gate * 9*7c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10*7c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 11*7c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 12*7c478bd9Sstevel@tonic-gate * and limitations under the License. 13*7c478bd9Sstevel@tonic-gate * 14*7c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 15*7c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16*7c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 17*7c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 18*7c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 19*7c478bd9Sstevel@tonic-gate * 20*7c478bd9Sstevel@tonic-gate * CDDL HEADER END 21*7c478bd9Sstevel@tonic-gate */ 22*7c478bd9Sstevel@tonic-gate /* 23*7c478bd9Sstevel@tonic-gate * Copyright 2005 Sun Microsystems, Inc. All rights reserved. 24*7c478bd9Sstevel@tonic-gate * Use is subject to license terms. 25*7c478bd9Sstevel@tonic-gate */ 26*7c478bd9Sstevel@tonic-gate 27*7c478bd9Sstevel@tonic-gate #ifndef _PAM_APPL_H 28*7c478bd9Sstevel@tonic-gate #define _PAM_APPL_H 29*7c478bd9Sstevel@tonic-gate 30*7c478bd9Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 31*7c478bd9Sstevel@tonic-gate 32*7c478bd9Sstevel@tonic-gate #include <sys/types.h> 33*7c478bd9Sstevel@tonic-gate 34*7c478bd9Sstevel@tonic-gate #ifdef __cplusplus 35*7c478bd9Sstevel@tonic-gate extern "C" { 36*7c478bd9Sstevel@tonic-gate #endif 37*7c478bd9Sstevel@tonic-gate 38*7c478bd9Sstevel@tonic-gate /* Generic PAM errors */ 39*7c478bd9Sstevel@tonic-gate #define PAM_SUCCESS 0 /* Normal function return */ 40*7c478bd9Sstevel@tonic-gate #define PAM_OPEN_ERR 1 /* Dlopen failure */ 41*7c478bd9Sstevel@tonic-gate #define PAM_SYMBOL_ERR 2 /* Symbol not found */ 42*7c478bd9Sstevel@tonic-gate #define PAM_SERVICE_ERR 3 /* Error in underlying service module */ 43*7c478bd9Sstevel@tonic-gate #define PAM_SYSTEM_ERR 4 /* System error */ 44*7c478bd9Sstevel@tonic-gate #define PAM_BUF_ERR 5 /* Memory buffer error */ 45*7c478bd9Sstevel@tonic-gate #define PAM_CONV_ERR 6 /* Conversation failure */ 46*7c478bd9Sstevel@tonic-gate #define PAM_PERM_DENIED 7 /* Permission denied */ 47*7c478bd9Sstevel@tonic-gate 48*7c478bd9Sstevel@tonic-gate /* Errors returned by pam_authenticate, pam_acct_mgmt(), and pam_setcred() */ 49*7c478bd9Sstevel@tonic-gate #define PAM_MAXTRIES 8 /* Maximum number of tries exceeded */ 50*7c478bd9Sstevel@tonic-gate #define PAM_AUTH_ERR 9 /* Authentication failure */ 51*7c478bd9Sstevel@tonic-gate #define PAM_NEW_AUTHTOK_REQD 10 /* Get new auth token from the user */ 52*7c478bd9Sstevel@tonic-gate #define PAM_CRED_INSUFFICIENT 11 /* can not access auth data b/c */ 53*7c478bd9Sstevel@tonic-gate /* of insufficient credentials */ 54*7c478bd9Sstevel@tonic-gate #define PAM_AUTHINFO_UNAVAIL 12 /* Can not retrieve auth information */ 55*7c478bd9Sstevel@tonic-gate #define PAM_USER_UNKNOWN 13 /* No account present for user */ 56*7c478bd9Sstevel@tonic-gate 57*7c478bd9Sstevel@tonic-gate /* Errors returned by pam_setcred() */ 58*7c478bd9Sstevel@tonic-gate #define PAM_CRED_UNAVAIL 14 /* can not retrieve user credentials */ 59*7c478bd9Sstevel@tonic-gate #define PAM_CRED_EXPIRED 15 /* user credentials expired */ 60*7c478bd9Sstevel@tonic-gate #define PAM_CRED_ERR 16 /* failure setting user credentials */ 61*7c478bd9Sstevel@tonic-gate 62*7c478bd9Sstevel@tonic-gate /* Errors returned by pam_acct_mgmt() */ 63*7c478bd9Sstevel@tonic-gate #define PAM_ACCT_EXPIRED 17 /* user account has expired */ 64*7c478bd9Sstevel@tonic-gate #define PAM_AUTHTOK_EXPIRED 18 /* Password expired and no longer */ 65*7c478bd9Sstevel@tonic-gate /* usable */ 66*7c478bd9Sstevel@tonic-gate 67*7c478bd9Sstevel@tonic-gate /* Errors returned by pam_open/close_session() */ 68*7c478bd9Sstevel@tonic-gate #define PAM_SESSION_ERR 19 /* can not make/remove entry for */ 69*7c478bd9Sstevel@tonic-gate /* specified session */ 70*7c478bd9Sstevel@tonic-gate 71*7c478bd9Sstevel@tonic-gate /* Errors returned by pam_chauthtok() */ 72*7c478bd9Sstevel@tonic-gate #define PAM_AUTHTOK_ERR 20 /* Authentication token */ 73*7c478bd9Sstevel@tonic-gate /* manipulation error */ 74*7c478bd9Sstevel@tonic-gate #define PAM_AUTHTOK_RECOVERY_ERR 21 /* Old authentication token */ 75*7c478bd9Sstevel@tonic-gate /* cannot be recovered */ 76*7c478bd9Sstevel@tonic-gate #define PAM_AUTHTOK_LOCK_BUSY 22 /* Authentication token */ 77*7c478bd9Sstevel@tonic-gate /* lock busy */ 78*7c478bd9Sstevel@tonic-gate #define PAM_AUTHTOK_DISABLE_AGING 23 /* Authentication token aging */ 79*7c478bd9Sstevel@tonic-gate /* is disabled */ 80*7c478bd9Sstevel@tonic-gate 81*7c478bd9Sstevel@tonic-gate /* Errors returned by pam_get_data */ 82*7c478bd9Sstevel@tonic-gate #define PAM_NO_MODULE_DATA 24 /* module data not found */ 83*7c478bd9Sstevel@tonic-gate 84*7c478bd9Sstevel@tonic-gate /* Errors returned by modules */ 85*7c478bd9Sstevel@tonic-gate #define PAM_IGNORE 25 /* ignore module */ 86*7c478bd9Sstevel@tonic-gate 87*7c478bd9Sstevel@tonic-gate #define PAM_ABORT 26 /* General PAM failure */ 88*7c478bd9Sstevel@tonic-gate #define PAM_TRY_AGAIN 27 /* Unable to update password */ 89*7c478bd9Sstevel@tonic-gate /* Try again another time */ 90*7c478bd9Sstevel@tonic-gate #define PAM_TOTAL_ERRNUM 28 91*7c478bd9Sstevel@tonic-gate 92*7c478bd9Sstevel@tonic-gate /* 93*7c478bd9Sstevel@tonic-gate * structure pam_message is used to pass prompt, error message, 94*7c478bd9Sstevel@tonic-gate * or any text information from scheme to application/user. 95*7c478bd9Sstevel@tonic-gate */ 96*7c478bd9Sstevel@tonic-gate 97*7c478bd9Sstevel@tonic-gate struct pam_message { 98*7c478bd9Sstevel@tonic-gate int msg_style; /* Msg_style - see below */ 99*7c478bd9Sstevel@tonic-gate char *msg; /* Message string */ 100*7c478bd9Sstevel@tonic-gate }; 101*7c478bd9Sstevel@tonic-gate 102*7c478bd9Sstevel@tonic-gate /* 103*7c478bd9Sstevel@tonic-gate * msg_style defines the interaction style between the 104*7c478bd9Sstevel@tonic-gate * scheme and the application. 105*7c478bd9Sstevel@tonic-gate */ 106*7c478bd9Sstevel@tonic-gate #define PAM_PROMPT_ECHO_OFF 1 /* Echo off when getting response */ 107*7c478bd9Sstevel@tonic-gate #define PAM_PROMPT_ECHO_ON 2 /* Echo on when getting response */ 108*7c478bd9Sstevel@tonic-gate #define PAM_ERROR_MSG 3 /* Error message */ 109*7c478bd9Sstevel@tonic-gate #define PAM_TEXT_INFO 4 /* Textual information */ 110*7c478bd9Sstevel@tonic-gate 111*7c478bd9Sstevel@tonic-gate /* 112*7c478bd9Sstevel@tonic-gate * Sun's proprietary message types 113*7c478bd9Sstevel@tonic-gate * Can these new new message types supported in version 2 114*7c478bd9Sstevel@tonic-gate * have the numbers like -XXX (ie., negative numbers). 115*7c478bd9Sstevel@tonic-gate * Hence will not clash with new proposals from X/OPEN 116*7c478bd9Sstevel@tonic-gate */ 117*7c478bd9Sstevel@tonic-gate #define PAM_MSG_NOCONF 2001 /* No confirmation from user */ 118*7c478bd9Sstevel@tonic-gate #define PAM_CONV_INTERRUPT 2002 /* Return from conv() */ 119*7c478bd9Sstevel@tonic-gate 120*7c478bd9Sstevel@tonic-gate /* 121*7c478bd9Sstevel@tonic-gate * max # of messages passed to the application through the 122*7c478bd9Sstevel@tonic-gate * conversation function call 123*7c478bd9Sstevel@tonic-gate */ 124*7c478bd9Sstevel@tonic-gate #define PAM_MAX_NUM_MSG 32 125*7c478bd9Sstevel@tonic-gate 126*7c478bd9Sstevel@tonic-gate /* 127*7c478bd9Sstevel@tonic-gate * max size (in chars) of each messages passed to the application 128*7c478bd9Sstevel@tonic-gate * through the conversation function call 129*7c478bd9Sstevel@tonic-gate */ 130*7c478bd9Sstevel@tonic-gate #define PAM_MAX_MSG_SIZE 512 131*7c478bd9Sstevel@tonic-gate 132*7c478bd9Sstevel@tonic-gate /* 133*7c478bd9Sstevel@tonic-gate * max size (in chars) of each response passed from the application 134*7c478bd9Sstevel@tonic-gate * through the conversation function call 135*7c478bd9Sstevel@tonic-gate */ 136*7c478bd9Sstevel@tonic-gate #define PAM_MAX_RESP_SIZE 512 137*7c478bd9Sstevel@tonic-gate 138*7c478bd9Sstevel@tonic-gate /* 139*7c478bd9Sstevel@tonic-gate * structure pam_response is used by the scheme to get the user's 140*7c478bd9Sstevel@tonic-gate * response back from the application/user. 141*7c478bd9Sstevel@tonic-gate */ 142*7c478bd9Sstevel@tonic-gate 143*7c478bd9Sstevel@tonic-gate struct pam_response { 144*7c478bd9Sstevel@tonic-gate char *resp; /* Response string */ 145*7c478bd9Sstevel@tonic-gate int resp_retcode; /* Return code - for future use */ 146*7c478bd9Sstevel@tonic-gate }; 147*7c478bd9Sstevel@tonic-gate 148*7c478bd9Sstevel@tonic-gate /* 149*7c478bd9Sstevel@tonic-gate * structure pam_conv is used by authentication applications for passing 150*7c478bd9Sstevel@tonic-gate * call back function pointers and application data pointers to the scheme 151*7c478bd9Sstevel@tonic-gate */ 152*7c478bd9Sstevel@tonic-gate struct pam_conv { 153*7c478bd9Sstevel@tonic-gate int (*conv)(int, struct pam_message **, 154*7c478bd9Sstevel@tonic-gate struct pam_response **, void *); 155*7c478bd9Sstevel@tonic-gate void *appdata_ptr; /* Application data ptr */ 156*7c478bd9Sstevel@tonic-gate }; 157*7c478bd9Sstevel@tonic-gate 158*7c478bd9Sstevel@tonic-gate /* the pam handle */ 159*7c478bd9Sstevel@tonic-gate typedef struct pam_handle pam_handle_t; 160*7c478bd9Sstevel@tonic-gate 161*7c478bd9Sstevel@tonic-gate /* 162*7c478bd9Sstevel@tonic-gate * pam_start() is called to initiate an authentication exchange 163*7c478bd9Sstevel@tonic-gate * with PAM. 164*7c478bd9Sstevel@tonic-gate */ 165*7c478bd9Sstevel@tonic-gate extern int 166*7c478bd9Sstevel@tonic-gate pam_start( 167*7c478bd9Sstevel@tonic-gate const char *service_name, /* Service Name */ 168*7c478bd9Sstevel@tonic-gate const char *user, /* User Name */ 169*7c478bd9Sstevel@tonic-gate const struct pam_conv *pam_conv, /* Conversation structure */ 170*7c478bd9Sstevel@tonic-gate pam_handle_t **pamh /* Address to store handle */ 171*7c478bd9Sstevel@tonic-gate ); 172*7c478bd9Sstevel@tonic-gate 173*7c478bd9Sstevel@tonic-gate /* 174*7c478bd9Sstevel@tonic-gate * pam_end() is called to end an authentication exchange with PAM. 175*7c478bd9Sstevel@tonic-gate */ 176*7c478bd9Sstevel@tonic-gate extern int 177*7c478bd9Sstevel@tonic-gate pam_end( 178*7c478bd9Sstevel@tonic-gate pam_handle_t *pamh, /* handle from pam_start() */ 179*7c478bd9Sstevel@tonic-gate int status /* the final status value that */ 180*7c478bd9Sstevel@tonic-gate /* gets passed to cleanup functions */ 181*7c478bd9Sstevel@tonic-gate ); 182*7c478bd9Sstevel@tonic-gate 183*7c478bd9Sstevel@tonic-gate /* 184*7c478bd9Sstevel@tonic-gate * pam_set_item is called to store an object in PAM handle. 185*7c478bd9Sstevel@tonic-gate */ 186*7c478bd9Sstevel@tonic-gate extern int 187*7c478bd9Sstevel@tonic-gate pam_set_item( 188*7c478bd9Sstevel@tonic-gate pam_handle_t *pamh, /* PAM handle */ 189*7c478bd9Sstevel@tonic-gate int item_type, /* Type of object - see below */ 190*7c478bd9Sstevel@tonic-gate const void *item /* Address of place to put pointer */ 191*7c478bd9Sstevel@tonic-gate /* to object */ 192*7c478bd9Sstevel@tonic-gate ); 193*7c478bd9Sstevel@tonic-gate 194*7c478bd9Sstevel@tonic-gate /* 195*7c478bd9Sstevel@tonic-gate * pam_get_item is called to retrieve an object from the static data area 196*7c478bd9Sstevel@tonic-gate */ 197*7c478bd9Sstevel@tonic-gate extern int 198*7c478bd9Sstevel@tonic-gate pam_get_item( 199*7c478bd9Sstevel@tonic-gate const pam_handle_t *pamh, /* PAM handle */ 200*7c478bd9Sstevel@tonic-gate int item_type, /* Type of object - see below */ 201*7c478bd9Sstevel@tonic-gate void ** item /* Address of place to put pointer */ 202*7c478bd9Sstevel@tonic-gate /* to object */ 203*7c478bd9Sstevel@tonic-gate ); 204*7c478bd9Sstevel@tonic-gate 205*7c478bd9Sstevel@tonic-gate /* Items supported by pam_[sg]et_item() calls */ 206*7c478bd9Sstevel@tonic-gate #define PAM_SERVICE 1 /* The program/service name */ 207*7c478bd9Sstevel@tonic-gate #define PAM_USER 2 /* The user name */ 208*7c478bd9Sstevel@tonic-gate #define PAM_TTY 3 /* The tty name */ 209*7c478bd9Sstevel@tonic-gate #define PAM_RHOST 4 /* The remote host name */ 210*7c478bd9Sstevel@tonic-gate #define PAM_CONV 5 /* The conversation structure */ 211*7c478bd9Sstevel@tonic-gate #define PAM_AUTHTOK 6 /* The authentication token */ 212*7c478bd9Sstevel@tonic-gate #define PAM_OLDAUTHTOK 7 /* Old authentication token */ 213*7c478bd9Sstevel@tonic-gate #define PAM_RUSER 8 /* The remote user name */ 214*7c478bd9Sstevel@tonic-gate #define PAM_USER_PROMPT 9 /* The user prompt */ 215*7c478bd9Sstevel@tonic-gate #define PAM_REPOSITORY 10 /* The repository to be updated */ 216*7c478bd9Sstevel@tonic-gate #define PAM_RESOURCE 11 /* Resource management info */ 217*7c478bd9Sstevel@tonic-gate 218*7c478bd9Sstevel@tonic-gate /* pam repository structure */ 219*7c478bd9Sstevel@tonic-gate 220*7c478bd9Sstevel@tonic-gate struct pam_repository { 221*7c478bd9Sstevel@tonic-gate char *type; /* Repository type, e.g., files, nis, ldap */ 222*7c478bd9Sstevel@tonic-gate void *scope; /* Optional scope information */ 223*7c478bd9Sstevel@tonic-gate size_t scope_len; /* length of scope inforamtion */ 224*7c478bd9Sstevel@tonic-gate }; 225*7c478bd9Sstevel@tonic-gate 226*7c478bd9Sstevel@tonic-gate typedef struct pam_repository pam_repository_t; 227*7c478bd9Sstevel@tonic-gate 228*7c478bd9Sstevel@tonic-gate /* 229*7c478bd9Sstevel@tonic-gate * PAM message version. 230*7c478bd9Sstevel@tonic-gate * Sun proprietary pam_[sg]et_item() extension 231*7c478bd9Sstevel@tonic-gate */ 232*7c478bd9Sstevel@tonic-gate #define PAM_MSG_VERSION 3001 /* PAM message version supported */ 233*7c478bd9Sstevel@tonic-gate #define PAM_MSG_VERSION_V2 "2.0" /* PAM 2.0 message version */ 234*7c478bd9Sstevel@tonic-gate 235*7c478bd9Sstevel@tonic-gate /* 236*7c478bd9Sstevel@tonic-gate * pam_get_user is called to retrieve the user name (PAM_USER). If PAM_USER 237*7c478bd9Sstevel@tonic-gate * is not set then this call will prompt for the user name using the 238*7c478bd9Sstevel@tonic-gate * conversation function. This function should only be used by modules, not 239*7c478bd9Sstevel@tonic-gate * applications. 240*7c478bd9Sstevel@tonic-gate */ 241*7c478bd9Sstevel@tonic-gate 242*7c478bd9Sstevel@tonic-gate extern int 243*7c478bd9Sstevel@tonic-gate pam_get_user( 244*7c478bd9Sstevel@tonic-gate pam_handle_t *pamh, /* PAM handle */ 245*7c478bd9Sstevel@tonic-gate char **user, /* User Name */ 246*7c478bd9Sstevel@tonic-gate const char *prompt /* Prompt */ 247*7c478bd9Sstevel@tonic-gate ); 248*7c478bd9Sstevel@tonic-gate 249*7c478bd9Sstevel@tonic-gate /* 250*7c478bd9Sstevel@tonic-gate * PAM equivalent to strerror(); 251*7c478bd9Sstevel@tonic-gate */ 252*7c478bd9Sstevel@tonic-gate extern const char * 253*7c478bd9Sstevel@tonic-gate pam_strerror( 254*7c478bd9Sstevel@tonic-gate pam_handle_t *pamh, /* pam handle */ 255*7c478bd9Sstevel@tonic-gate int errnum /* error number */ 256*7c478bd9Sstevel@tonic-gate ); 257*7c478bd9Sstevel@tonic-gate 258*7c478bd9Sstevel@tonic-gate /* general flag for pam_* functions */ 259*7c478bd9Sstevel@tonic-gate #define PAM_SILENT 0x80000000 260*7c478bd9Sstevel@tonic-gate 261*7c478bd9Sstevel@tonic-gate /* 262*7c478bd9Sstevel@tonic-gate * pam_authenticate is called to authenticate the current user. 263*7c478bd9Sstevel@tonic-gate */ 264*7c478bd9Sstevel@tonic-gate extern int 265*7c478bd9Sstevel@tonic-gate pam_authenticate( 266*7c478bd9Sstevel@tonic-gate pam_handle_t *pamh, 267*7c478bd9Sstevel@tonic-gate int flags 268*7c478bd9Sstevel@tonic-gate ); 269*7c478bd9Sstevel@tonic-gate 270*7c478bd9Sstevel@tonic-gate /* 271*7c478bd9Sstevel@tonic-gate * Flags for pam_authenticate 272*7c478bd9Sstevel@tonic-gate */ 273*7c478bd9Sstevel@tonic-gate 274*7c478bd9Sstevel@tonic-gate #define PAM_DISALLOW_NULL_AUTHTOK 0x1 /* The password must be non-null */ 275*7c478bd9Sstevel@tonic-gate 276*7c478bd9Sstevel@tonic-gate /* 277*7c478bd9Sstevel@tonic-gate * pam_acct_mgmt is called to perform account management processing 278*7c478bd9Sstevel@tonic-gate */ 279*7c478bd9Sstevel@tonic-gate extern int 280*7c478bd9Sstevel@tonic-gate pam_acct_mgmt( 281*7c478bd9Sstevel@tonic-gate pam_handle_t *pamh, 282*7c478bd9Sstevel@tonic-gate int flags 283*7c478bd9Sstevel@tonic-gate ); 284*7c478bd9Sstevel@tonic-gate 285*7c478bd9Sstevel@tonic-gate /* 286*7c478bd9Sstevel@tonic-gate * pam_open_session is called to note the initiation of new session in the 287*7c478bd9Sstevel@tonic-gate * appropriate administrative data bases. 288*7c478bd9Sstevel@tonic-gate */ 289*7c478bd9Sstevel@tonic-gate extern int 290*7c478bd9Sstevel@tonic-gate pam_open_session( 291*7c478bd9Sstevel@tonic-gate pam_handle_t *pamh, 292*7c478bd9Sstevel@tonic-gate int flags 293*7c478bd9Sstevel@tonic-gate ); 294*7c478bd9Sstevel@tonic-gate 295*7c478bd9Sstevel@tonic-gate /* 296*7c478bd9Sstevel@tonic-gate * pam_close_session records the termination of a session. 297*7c478bd9Sstevel@tonic-gate */ 298*7c478bd9Sstevel@tonic-gate extern int 299*7c478bd9Sstevel@tonic-gate pam_close_session( 300*7c478bd9Sstevel@tonic-gate pam_handle_t *pamh, 301*7c478bd9Sstevel@tonic-gate int flags 302*7c478bd9Sstevel@tonic-gate ); 303*7c478bd9Sstevel@tonic-gate 304*7c478bd9Sstevel@tonic-gate /* pam_setcred is called to set the credentials of the current user */ 305*7c478bd9Sstevel@tonic-gate extern int 306*7c478bd9Sstevel@tonic-gate pam_setcred( 307*7c478bd9Sstevel@tonic-gate pam_handle_t *pamh, 308*7c478bd9Sstevel@tonic-gate int flags 309*7c478bd9Sstevel@tonic-gate ); 310*7c478bd9Sstevel@tonic-gate 311*7c478bd9Sstevel@tonic-gate /* flags for pam_setcred() */ 312*7c478bd9Sstevel@tonic-gate #define PAM_ESTABLISH_CRED 0x1 /* set scheme specific user id */ 313*7c478bd9Sstevel@tonic-gate #define PAM_DELETE_CRED 0x2 /* unset scheme specific user id */ 314*7c478bd9Sstevel@tonic-gate #define PAM_REINITIALIZE_CRED 0x4 /* reinitialize user credentials */ 315*7c478bd9Sstevel@tonic-gate /* (after a password has changed */ 316*7c478bd9Sstevel@tonic-gate #define PAM_REFRESH_CRED 0x8 /* extend lifetime of credentials */ 317*7c478bd9Sstevel@tonic-gate 318*7c478bd9Sstevel@tonic-gate /* pam_chauthtok is called to change authentication token */ 319*7c478bd9Sstevel@tonic-gate 320*7c478bd9Sstevel@tonic-gate extern int 321*7c478bd9Sstevel@tonic-gate pam_chauthtok( 322*7c478bd9Sstevel@tonic-gate pam_handle_t *pamh, 323*7c478bd9Sstevel@tonic-gate int flags 324*7c478bd9Sstevel@tonic-gate ); 325*7c478bd9Sstevel@tonic-gate 326*7c478bd9Sstevel@tonic-gate /* 327*7c478bd9Sstevel@tonic-gate * Be careful - there are flags defined for pam_sm_chauthtok() in 328*7c478bd9Sstevel@tonic-gate * pam_modules.h also: 329*7c478bd9Sstevel@tonic-gate * PAM_PRELIM_CHECK 0x1 330*7c478bd9Sstevel@tonic-gate * PAM_UPDATE_AUTHTOK 0x2 331*7c478bd9Sstevel@tonic-gate */ 332*7c478bd9Sstevel@tonic-gate #define PAM_CHANGE_EXPIRED_AUTHTOK 0x4 /* update expired passwords only */ 333*7c478bd9Sstevel@tonic-gate #define PAM_NO_AUTHTOK_CHECK 0x8 /* bypass password strength tests */ 334*7c478bd9Sstevel@tonic-gate 335*7c478bd9Sstevel@tonic-gate /* pam_putenv is called to add environment variables to the PAM handle */ 336*7c478bd9Sstevel@tonic-gate 337*7c478bd9Sstevel@tonic-gate extern int 338*7c478bd9Sstevel@tonic-gate pam_putenv( 339*7c478bd9Sstevel@tonic-gate pam_handle_t *pamh, 340*7c478bd9Sstevel@tonic-gate const char *name_value 341*7c478bd9Sstevel@tonic-gate ); 342*7c478bd9Sstevel@tonic-gate 343*7c478bd9Sstevel@tonic-gate /* pam_getenv is called to retrieve an env variable from the PAM handle */ 344*7c478bd9Sstevel@tonic-gate 345*7c478bd9Sstevel@tonic-gate extern char * 346*7c478bd9Sstevel@tonic-gate pam_getenv( 347*7c478bd9Sstevel@tonic-gate pam_handle_t *pamh, 348*7c478bd9Sstevel@tonic-gate const char *name 349*7c478bd9Sstevel@tonic-gate ); 350*7c478bd9Sstevel@tonic-gate 351*7c478bd9Sstevel@tonic-gate /* pam_getenvlist is called to retrieve all env variables from the PAM handle */ 352*7c478bd9Sstevel@tonic-gate 353*7c478bd9Sstevel@tonic-gate extern char ** 354*7c478bd9Sstevel@tonic-gate pam_getenvlist( 355*7c478bd9Sstevel@tonic-gate pam_handle_t *pamh 356*7c478bd9Sstevel@tonic-gate ); 357*7c478bd9Sstevel@tonic-gate 358*7c478bd9Sstevel@tonic-gate #ifdef __cplusplus 359*7c478bd9Sstevel@tonic-gate } 360*7c478bd9Sstevel@tonic-gate #endif 361*7c478bd9Sstevel@tonic-gate 362*7c478bd9Sstevel@tonic-gate #endif /* _PAM_APPL_H */ 363