xref: /titanic_53/usr/src/lib/libpam/pam_appl.h (revision bf430c99546e92acc3ba67238eb12cc61375bd1b)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*bf430c99Sgww  * Common Development and Distribution License (the "License").
6*bf430c99Sgww  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
217c478bd9Sstevel@tonic-gate /*
22*bf430c99Sgww  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
237c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
247c478bd9Sstevel@tonic-gate  */
257c478bd9Sstevel@tonic-gate 
267c478bd9Sstevel@tonic-gate #ifndef _PAM_APPL_H
277c478bd9Sstevel@tonic-gate #define	_PAM_APPL_H
287c478bd9Sstevel@tonic-gate 
297c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
307c478bd9Sstevel@tonic-gate 
317c478bd9Sstevel@tonic-gate #include <sys/types.h>
327c478bd9Sstevel@tonic-gate 
337c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
347c478bd9Sstevel@tonic-gate extern "C" {
357c478bd9Sstevel@tonic-gate #endif
367c478bd9Sstevel@tonic-gate 
377c478bd9Sstevel@tonic-gate /* Generic PAM errors */
387c478bd9Sstevel@tonic-gate #define	PAM_SUCCESS		0	/* Normal function return */
397c478bd9Sstevel@tonic-gate #define	PAM_OPEN_ERR		1	/* Dlopen failure */
407c478bd9Sstevel@tonic-gate #define	PAM_SYMBOL_ERR		2	/* Symbol not found */
417c478bd9Sstevel@tonic-gate #define	PAM_SERVICE_ERR		3	/* Error in underlying service module */
427c478bd9Sstevel@tonic-gate #define	PAM_SYSTEM_ERR		4	/* System error */
437c478bd9Sstevel@tonic-gate #define	PAM_BUF_ERR		5	/* Memory buffer error */
447c478bd9Sstevel@tonic-gate #define	PAM_CONV_ERR		6	/* Conversation failure */
457c478bd9Sstevel@tonic-gate #define	PAM_PERM_DENIED		7	/* Permission denied */
467c478bd9Sstevel@tonic-gate 
477c478bd9Sstevel@tonic-gate /* Errors returned by pam_authenticate, pam_acct_mgmt(), and pam_setcred() */
487c478bd9Sstevel@tonic-gate #define	PAM_MAXTRIES		8	/* Maximum number of tries exceeded */
497c478bd9Sstevel@tonic-gate #define	PAM_AUTH_ERR		9	/* Authentication failure */
507c478bd9Sstevel@tonic-gate #define	PAM_NEW_AUTHTOK_REQD	10	/* Get new auth token from the user */
517c478bd9Sstevel@tonic-gate #define	PAM_CRED_INSUFFICIENT	11	/* can not access auth data b/c */
527c478bd9Sstevel@tonic-gate 					/* of insufficient credentials  */
537c478bd9Sstevel@tonic-gate #define	PAM_AUTHINFO_UNAVAIL	12	/* Can not retrieve auth information */
547c478bd9Sstevel@tonic-gate #define	PAM_USER_UNKNOWN	13	/* No account present for user */
557c478bd9Sstevel@tonic-gate 
567c478bd9Sstevel@tonic-gate /* Errors returned by pam_setcred() */
577c478bd9Sstevel@tonic-gate #define	PAM_CRED_UNAVAIL	14	/* can not retrieve user credentials */
587c478bd9Sstevel@tonic-gate #define	PAM_CRED_EXPIRED	15	/* user credentials expired */
597c478bd9Sstevel@tonic-gate #define	PAM_CRED_ERR		16	/* failure setting user credentials */
607c478bd9Sstevel@tonic-gate 
617c478bd9Sstevel@tonic-gate /* Errors returned by pam_acct_mgmt() */
627c478bd9Sstevel@tonic-gate #define	PAM_ACCT_EXPIRED	17	/* user account has expired */
637c478bd9Sstevel@tonic-gate #define	PAM_AUTHTOK_EXPIRED 	18	/* Password expired and no longer */
647c478bd9Sstevel@tonic-gate 					/* usable */
657c478bd9Sstevel@tonic-gate 
667c478bd9Sstevel@tonic-gate /* Errors returned by pam_open/close_session() */
677c478bd9Sstevel@tonic-gate #define	PAM_SESSION_ERR		19	/* can not make/remove entry for */
687c478bd9Sstevel@tonic-gate 					/* specified session */
697c478bd9Sstevel@tonic-gate 
707c478bd9Sstevel@tonic-gate /* Errors returned by pam_chauthtok() */
717c478bd9Sstevel@tonic-gate #define	PAM_AUTHTOK_ERR		  20	/* Authentication token */
727c478bd9Sstevel@tonic-gate 					/*   manipulation error */
737c478bd9Sstevel@tonic-gate #define	PAM_AUTHTOK_RECOVERY_ERR  21	/* Old authentication token */
747c478bd9Sstevel@tonic-gate 					/*   cannot be recovered */
757c478bd9Sstevel@tonic-gate #define	PAM_AUTHTOK_LOCK_BUSY	  22	/* Authentication token */
767c478bd9Sstevel@tonic-gate 					/*   lock busy */
777c478bd9Sstevel@tonic-gate #define	PAM_AUTHTOK_DISABLE_AGING 23	/* Authentication token aging */
787c478bd9Sstevel@tonic-gate 					/*   is disabled */
797c478bd9Sstevel@tonic-gate 
807c478bd9Sstevel@tonic-gate /* Errors returned by pam_get_data */
817c478bd9Sstevel@tonic-gate #define	PAM_NO_MODULE_DATA	24	/* module data not found */
827c478bd9Sstevel@tonic-gate 
837c478bd9Sstevel@tonic-gate /* Errors returned by modules */
847c478bd9Sstevel@tonic-gate #define	PAM_IGNORE		25	/* ignore module */
857c478bd9Sstevel@tonic-gate 
867c478bd9Sstevel@tonic-gate #define	PAM_ABORT		26	/* General PAM failure */
877c478bd9Sstevel@tonic-gate #define	PAM_TRY_AGAIN		27	/* Unable to update password */
887c478bd9Sstevel@tonic-gate 					/* Try again another time */
897c478bd9Sstevel@tonic-gate #define	PAM_TOTAL_ERRNUM	28
907c478bd9Sstevel@tonic-gate 
917c478bd9Sstevel@tonic-gate /*
927c478bd9Sstevel@tonic-gate  * structure pam_message is used to pass prompt, error message,
937c478bd9Sstevel@tonic-gate  * or any text information from scheme to application/user.
947c478bd9Sstevel@tonic-gate  */
957c478bd9Sstevel@tonic-gate 
967c478bd9Sstevel@tonic-gate struct pam_message {
977c478bd9Sstevel@tonic-gate 	int msg_style;		/* Msg_style - see below */
987c478bd9Sstevel@tonic-gate 	char *msg; 		/* Message string */
997c478bd9Sstevel@tonic-gate };
1007c478bd9Sstevel@tonic-gate 
1017c478bd9Sstevel@tonic-gate /*
1027c478bd9Sstevel@tonic-gate  * msg_style defines the interaction style between the
1037c478bd9Sstevel@tonic-gate  * scheme and the application.
1047c478bd9Sstevel@tonic-gate  */
1057c478bd9Sstevel@tonic-gate #define	PAM_PROMPT_ECHO_OFF	1	/* Echo off when getting response */
1067c478bd9Sstevel@tonic-gate #define	PAM_PROMPT_ECHO_ON	2 	/* Echo on when getting response */
1077c478bd9Sstevel@tonic-gate #define	PAM_ERROR_MSG		3	/* Error message */
1087c478bd9Sstevel@tonic-gate #define	PAM_TEXT_INFO		4	/* Textual information */
1097c478bd9Sstevel@tonic-gate 
1107c478bd9Sstevel@tonic-gate /*
1117c478bd9Sstevel@tonic-gate  * Sun's proprietary message types
1127c478bd9Sstevel@tonic-gate  * Can these new new message types supported in version 2
1137c478bd9Sstevel@tonic-gate  * have the numbers like -XXX (ie., negative numbers).
1147c478bd9Sstevel@tonic-gate  * Hence will not clash with new proposals from X/OPEN
1157c478bd9Sstevel@tonic-gate  */
1167c478bd9Sstevel@tonic-gate #define	PAM_MSG_NOCONF		2001	/* No confirmation from user */
1177c478bd9Sstevel@tonic-gate #define	PAM_CONV_INTERRUPT	2002	/* Return from conv() */
1187c478bd9Sstevel@tonic-gate 
1197c478bd9Sstevel@tonic-gate /*
1207c478bd9Sstevel@tonic-gate  * max # of messages passed to the application through the
1217c478bd9Sstevel@tonic-gate  * conversation function call
1227c478bd9Sstevel@tonic-gate  */
1237c478bd9Sstevel@tonic-gate #define	PAM_MAX_NUM_MSG	32
1247c478bd9Sstevel@tonic-gate 
1257c478bd9Sstevel@tonic-gate /*
1267c478bd9Sstevel@tonic-gate  * max size (in chars) of each messages passed to the application
1277c478bd9Sstevel@tonic-gate  * through the conversation function call
1287c478bd9Sstevel@tonic-gate  */
1297c478bd9Sstevel@tonic-gate #define	PAM_MAX_MSG_SIZE	512
1307c478bd9Sstevel@tonic-gate 
1317c478bd9Sstevel@tonic-gate /*
1327c478bd9Sstevel@tonic-gate  * max size (in chars) of each response passed from the application
1337c478bd9Sstevel@tonic-gate  * through the conversation function call
1347c478bd9Sstevel@tonic-gate  */
1357c478bd9Sstevel@tonic-gate #define	PAM_MAX_RESP_SIZE	512
1367c478bd9Sstevel@tonic-gate 
1377c478bd9Sstevel@tonic-gate /*
1387c478bd9Sstevel@tonic-gate  * structure pam_response is used by the scheme to get the user's
1397c478bd9Sstevel@tonic-gate  * response back from the application/user.
1407c478bd9Sstevel@tonic-gate  */
1417c478bd9Sstevel@tonic-gate 
1427c478bd9Sstevel@tonic-gate struct pam_response {
1437c478bd9Sstevel@tonic-gate 	char *resp;		/* Response string */
1447c478bd9Sstevel@tonic-gate 	int resp_retcode;	/* Return code - for future use */
1457c478bd9Sstevel@tonic-gate };
1467c478bd9Sstevel@tonic-gate 
1477c478bd9Sstevel@tonic-gate /*
1487c478bd9Sstevel@tonic-gate  * structure pam_conv is used by authentication applications for passing
1497c478bd9Sstevel@tonic-gate  * call back function pointers and application data pointers to the scheme
1507c478bd9Sstevel@tonic-gate  */
1517c478bd9Sstevel@tonic-gate struct pam_conv {
1527c478bd9Sstevel@tonic-gate 	int (*conv)(int, struct pam_message **,
1537c478bd9Sstevel@tonic-gate 	    struct pam_response **, void *);
1547c478bd9Sstevel@tonic-gate 	void *appdata_ptr;		/* Application data ptr */
1557c478bd9Sstevel@tonic-gate };
1567c478bd9Sstevel@tonic-gate 
1577c478bd9Sstevel@tonic-gate /* the pam handle */
1587c478bd9Sstevel@tonic-gate typedef struct pam_handle pam_handle_t;
1597c478bd9Sstevel@tonic-gate 
1607c478bd9Sstevel@tonic-gate /*
1617c478bd9Sstevel@tonic-gate  * pam_start() is called to initiate an authentication exchange
1627c478bd9Sstevel@tonic-gate  * with PAM.
1637c478bd9Sstevel@tonic-gate  */
1647c478bd9Sstevel@tonic-gate extern int
1657c478bd9Sstevel@tonic-gate pam_start(
1667c478bd9Sstevel@tonic-gate 	const char *service_name,		/* Service Name */
1677c478bd9Sstevel@tonic-gate 	const char *user,			/* User Name */
1687c478bd9Sstevel@tonic-gate 	const struct pam_conv *pam_conv,	/* Conversation structure */
1697c478bd9Sstevel@tonic-gate 	pam_handle_t **pamh		/* Address to store handle */
1707c478bd9Sstevel@tonic-gate );
1717c478bd9Sstevel@tonic-gate 
1727c478bd9Sstevel@tonic-gate /*
1737c478bd9Sstevel@tonic-gate  * pam_end() is called to end an authentication exchange with PAM.
1747c478bd9Sstevel@tonic-gate  */
1757c478bd9Sstevel@tonic-gate extern int
1767c478bd9Sstevel@tonic-gate pam_end(
1777c478bd9Sstevel@tonic-gate 	pam_handle_t *pamh,		/* handle from pam_start() */
1787c478bd9Sstevel@tonic-gate 	int status			/* the final status value that */
1797c478bd9Sstevel@tonic-gate 					/* gets passed to cleanup functions */
1807c478bd9Sstevel@tonic-gate );
1817c478bd9Sstevel@tonic-gate 
1827c478bd9Sstevel@tonic-gate /*
1837c478bd9Sstevel@tonic-gate  * pam_set_item is called to store an object in PAM handle.
1847c478bd9Sstevel@tonic-gate  */
1857c478bd9Sstevel@tonic-gate extern int
1867c478bd9Sstevel@tonic-gate pam_set_item(
1877c478bd9Sstevel@tonic-gate 	pam_handle_t *pamh,		/* PAM handle */
1887c478bd9Sstevel@tonic-gate 	int item_type, 			/* Type of object - see below */
1897c478bd9Sstevel@tonic-gate 	const void *item		/* Address of place to put pointer */
1907c478bd9Sstevel@tonic-gate 					/*   to object */
1917c478bd9Sstevel@tonic-gate );
1927c478bd9Sstevel@tonic-gate 
1937c478bd9Sstevel@tonic-gate /*
1947c478bd9Sstevel@tonic-gate  * pam_get_item is called to retrieve an object from the static data area
1957c478bd9Sstevel@tonic-gate  */
1967c478bd9Sstevel@tonic-gate extern int
1977c478bd9Sstevel@tonic-gate pam_get_item(
1987c478bd9Sstevel@tonic-gate 	const pam_handle_t *pamh, 	/* PAM handle */
1997c478bd9Sstevel@tonic-gate 	int item_type, 			/* Type of object - see below */
2007c478bd9Sstevel@tonic-gate 	void **	item			/* Address of place to put pointer */
2017c478bd9Sstevel@tonic-gate 					/*   to object */
2027c478bd9Sstevel@tonic-gate );
2037c478bd9Sstevel@tonic-gate 
2047c478bd9Sstevel@tonic-gate /* Items supported by pam_[sg]et_item() calls */
2057c478bd9Sstevel@tonic-gate #define	PAM_SERVICE	1		/* The program/service name */
2067c478bd9Sstevel@tonic-gate #define	PAM_USER	2		/* The user name */
2077c478bd9Sstevel@tonic-gate #define	PAM_TTY		3		/* The tty name */
2087c478bd9Sstevel@tonic-gate #define	PAM_RHOST	4		/* The remote host name */
2097c478bd9Sstevel@tonic-gate #define	PAM_CONV	5		/* The conversation structure */
2107c478bd9Sstevel@tonic-gate #define	PAM_AUTHTOK	6		/* The authentication token */
2117c478bd9Sstevel@tonic-gate #define	PAM_OLDAUTHTOK	7		/* Old authentication token */
2127c478bd9Sstevel@tonic-gate #define	PAM_RUSER	8		/* The remote user name */
2137c478bd9Sstevel@tonic-gate #define	PAM_USER_PROMPT	9		/* The user prompt */
2147c478bd9Sstevel@tonic-gate #define	PAM_REPOSITORY	10		/* The repository to be updated */
2157c478bd9Sstevel@tonic-gate #define	PAM_RESOURCE	11		/* Resource management info */
216*bf430c99Sgww #define	PAM_AUSER	12		/* The authenticated user name */
2177c478bd9Sstevel@tonic-gate 
2187c478bd9Sstevel@tonic-gate /* pam repository structure */
2197c478bd9Sstevel@tonic-gate 
2207c478bd9Sstevel@tonic-gate struct pam_repository {
2217c478bd9Sstevel@tonic-gate 	char   *type;		/* Repository type, e.g., files, nis, ldap */
2227c478bd9Sstevel@tonic-gate 	void   *scope;		/* Optional scope information */
2237c478bd9Sstevel@tonic-gate 	size_t  scope_len;	/* length of scope inforamtion */
2247c478bd9Sstevel@tonic-gate };
2257c478bd9Sstevel@tonic-gate 
2267c478bd9Sstevel@tonic-gate typedef struct pam_repository pam_repository_t;
2277c478bd9Sstevel@tonic-gate 
2287c478bd9Sstevel@tonic-gate /*
2297c478bd9Sstevel@tonic-gate  * PAM message version.
2307c478bd9Sstevel@tonic-gate  * Sun proprietary pam_[sg]et_item() extension
2317c478bd9Sstevel@tonic-gate  */
2327c478bd9Sstevel@tonic-gate #define	PAM_MSG_VERSION	3001		/* PAM message version supported */
2337c478bd9Sstevel@tonic-gate #define	PAM_MSG_VERSION_V2 "2.0"	/* PAM 2.0 message version */
2347c478bd9Sstevel@tonic-gate 
2357c478bd9Sstevel@tonic-gate /*
2367c478bd9Sstevel@tonic-gate  * pam_get_user is called to retrieve the user name (PAM_USER). If PAM_USER
2377c478bd9Sstevel@tonic-gate  * is not set then this call will prompt for the user name using the
2387c478bd9Sstevel@tonic-gate  * conversation function. This function should only be used by modules, not
2397c478bd9Sstevel@tonic-gate  * applications.
2407c478bd9Sstevel@tonic-gate  */
2417c478bd9Sstevel@tonic-gate 
2427c478bd9Sstevel@tonic-gate extern int
2437c478bd9Sstevel@tonic-gate pam_get_user(
2447c478bd9Sstevel@tonic-gate 	pam_handle_t *pamh,		/* PAM handle */
2457c478bd9Sstevel@tonic-gate 	char **user, 			/* User Name */
2467c478bd9Sstevel@tonic-gate 	const char *prompt		/* Prompt */
2477c478bd9Sstevel@tonic-gate );
2487c478bd9Sstevel@tonic-gate 
2497c478bd9Sstevel@tonic-gate /*
2507c478bd9Sstevel@tonic-gate  * PAM equivalent to strerror();
2517c478bd9Sstevel@tonic-gate  */
2527c478bd9Sstevel@tonic-gate extern const char *
2537c478bd9Sstevel@tonic-gate pam_strerror(
2547c478bd9Sstevel@tonic-gate 	pam_handle_t *pamh,	/* pam handle */
2557c478bd9Sstevel@tonic-gate 	int errnum		/* error number */
2567c478bd9Sstevel@tonic-gate );
2577c478bd9Sstevel@tonic-gate 
2587c478bd9Sstevel@tonic-gate /* general flag for pam_* functions */
2597c478bd9Sstevel@tonic-gate #define	PAM_SILENT	0x80000000
2607c478bd9Sstevel@tonic-gate 
2617c478bd9Sstevel@tonic-gate /*
2627c478bd9Sstevel@tonic-gate  * pam_authenticate is called to authenticate the current user.
2637c478bd9Sstevel@tonic-gate  */
2647c478bd9Sstevel@tonic-gate extern int
2657c478bd9Sstevel@tonic-gate pam_authenticate(
2667c478bd9Sstevel@tonic-gate 	pam_handle_t *pamh,
2677c478bd9Sstevel@tonic-gate 	int flags
2687c478bd9Sstevel@tonic-gate );
2697c478bd9Sstevel@tonic-gate 
2707c478bd9Sstevel@tonic-gate /*
2717c478bd9Sstevel@tonic-gate  * Flags for pam_authenticate
2727c478bd9Sstevel@tonic-gate  */
2737c478bd9Sstevel@tonic-gate 
2747c478bd9Sstevel@tonic-gate #define	PAM_DISALLOW_NULL_AUTHTOK 0x1	/* The password must be non-null */
2757c478bd9Sstevel@tonic-gate 
2767c478bd9Sstevel@tonic-gate /*
2777c478bd9Sstevel@tonic-gate  * pam_acct_mgmt is called to perform account management processing
2787c478bd9Sstevel@tonic-gate  */
2797c478bd9Sstevel@tonic-gate extern int
2807c478bd9Sstevel@tonic-gate pam_acct_mgmt(
2817c478bd9Sstevel@tonic-gate 	pam_handle_t *pamh,
2827c478bd9Sstevel@tonic-gate 	int flags
2837c478bd9Sstevel@tonic-gate );
2847c478bd9Sstevel@tonic-gate 
2857c478bd9Sstevel@tonic-gate /*
2867c478bd9Sstevel@tonic-gate  * pam_open_session is called to note the initiation of new session in the
2877c478bd9Sstevel@tonic-gate  * appropriate administrative data bases.
2887c478bd9Sstevel@tonic-gate  */
2897c478bd9Sstevel@tonic-gate extern int
2907c478bd9Sstevel@tonic-gate pam_open_session(
2917c478bd9Sstevel@tonic-gate 	pam_handle_t *pamh,
2927c478bd9Sstevel@tonic-gate 	int flags
2937c478bd9Sstevel@tonic-gate );
2947c478bd9Sstevel@tonic-gate 
2957c478bd9Sstevel@tonic-gate /*
2967c478bd9Sstevel@tonic-gate  * pam_close_session records the termination of a session.
2977c478bd9Sstevel@tonic-gate  */
2987c478bd9Sstevel@tonic-gate extern int
2997c478bd9Sstevel@tonic-gate pam_close_session(
3007c478bd9Sstevel@tonic-gate 	pam_handle_t	*pamh,
3017c478bd9Sstevel@tonic-gate 	int		flags
3027c478bd9Sstevel@tonic-gate );
3037c478bd9Sstevel@tonic-gate 
3047c478bd9Sstevel@tonic-gate /* pam_setcred is called to set the credentials of the current user */
3057c478bd9Sstevel@tonic-gate extern int
3067c478bd9Sstevel@tonic-gate pam_setcred(
3077c478bd9Sstevel@tonic-gate 	pam_handle_t *pamh,
3087c478bd9Sstevel@tonic-gate 	int flags
3097c478bd9Sstevel@tonic-gate );
3107c478bd9Sstevel@tonic-gate 
3117c478bd9Sstevel@tonic-gate /* flags for pam_setcred() */
3127c478bd9Sstevel@tonic-gate #define	PAM_ESTABLISH_CRED	0x1	/* set scheme specific user id */
3137c478bd9Sstevel@tonic-gate #define	PAM_DELETE_CRED		0x2	/* unset scheme specific user id */
3147c478bd9Sstevel@tonic-gate #define	PAM_REINITIALIZE_CRED	0x4	/* reinitialize user credentials */
3157c478bd9Sstevel@tonic-gate 					/* (after a password has changed */
3167c478bd9Sstevel@tonic-gate #define	PAM_REFRESH_CRED	0x8	/* extend lifetime of credentials */
3177c478bd9Sstevel@tonic-gate 
3187c478bd9Sstevel@tonic-gate /* pam_chauthtok is called to change authentication token */
3197c478bd9Sstevel@tonic-gate 
3207c478bd9Sstevel@tonic-gate extern int
3217c478bd9Sstevel@tonic-gate pam_chauthtok(
3227c478bd9Sstevel@tonic-gate 	pam_handle_t	*pamh,
3237c478bd9Sstevel@tonic-gate 	int		flags
3247c478bd9Sstevel@tonic-gate );
3257c478bd9Sstevel@tonic-gate 
3267c478bd9Sstevel@tonic-gate /*
3277c478bd9Sstevel@tonic-gate  * Be careful - there are flags defined for pam_sm_chauthtok() in
3287c478bd9Sstevel@tonic-gate  * pam_modules.h also:
3297c478bd9Sstevel@tonic-gate  * PAM_PRELIM_CHECK	0x1
3307c478bd9Sstevel@tonic-gate  * PAM_UPDATE_AUTHTOK	0x2
3317c478bd9Sstevel@tonic-gate  */
3327c478bd9Sstevel@tonic-gate #define	PAM_CHANGE_EXPIRED_AUTHTOK	0x4 /* update expired passwords only */
3337c478bd9Sstevel@tonic-gate #define	PAM_NO_AUTHTOK_CHECK		0x8 /* bypass password strength tests */
3347c478bd9Sstevel@tonic-gate 
3357c478bd9Sstevel@tonic-gate /* pam_putenv is called to add environment variables to the PAM handle */
3367c478bd9Sstevel@tonic-gate 
3377c478bd9Sstevel@tonic-gate extern int
3387c478bd9Sstevel@tonic-gate pam_putenv(
3397c478bd9Sstevel@tonic-gate 	pam_handle_t	*pamh,
3407c478bd9Sstevel@tonic-gate 	const char	*name_value
3417c478bd9Sstevel@tonic-gate );
3427c478bd9Sstevel@tonic-gate 
3437c478bd9Sstevel@tonic-gate /* pam_getenv is called to retrieve an env variable from the PAM handle */
3447c478bd9Sstevel@tonic-gate 
3457c478bd9Sstevel@tonic-gate extern char *
3467c478bd9Sstevel@tonic-gate pam_getenv(
3477c478bd9Sstevel@tonic-gate 	pam_handle_t	*pamh,
3487c478bd9Sstevel@tonic-gate 	const char	*name
3497c478bd9Sstevel@tonic-gate );
3507c478bd9Sstevel@tonic-gate 
3517c478bd9Sstevel@tonic-gate /* pam_getenvlist is called to retrieve all env variables from the PAM handle */
3527c478bd9Sstevel@tonic-gate 
3537c478bd9Sstevel@tonic-gate extern char **
3547c478bd9Sstevel@tonic-gate pam_getenvlist(
3557c478bd9Sstevel@tonic-gate 	pam_handle_t	*pamh
3567c478bd9Sstevel@tonic-gate );
3577c478bd9Sstevel@tonic-gate 
3587c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
3597c478bd9Sstevel@tonic-gate }
3607c478bd9Sstevel@tonic-gate #endif
3617c478bd9Sstevel@tonic-gate 
3627c478bd9Sstevel@tonic-gate #endif /* _PAM_APPL_H */
363