xref: /titanic_51/usr/src/lib/libpam/pam_modules.h (revision 1e49577a7fcde812700ded04431b49d67cc57d6d)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright (c) 1992-1995, by Sun Microsystems, Inc.
24  * All rights reserved.
25  */
26 
27 #ifndef	_PAM_MODULES_H
28 #define	_PAM_MODULES_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 extern int
37 pam_sm_authenticate(
38 	pam_handle_t	*pamh,
39 	int	flags,
40 	int	argc,
41 	const char	**argv);
42 
43 extern int
44 pam_sm_setcred(
45 	pam_handle_t	*pamh,
46 	int	flags,
47 	int	argc,
48 	const char	**argv);
49 
50 extern int
51 pam_sm_acct_mgmt(
52 	pam_handle_t	*pamh,
53 	int	flags,
54 	int	argc,
55 	const char	**argv);
56 
57 extern int
58 pam_sm_open_session(
59 	pam_handle_t	*pamh,
60 	int	flags,
61 	int	argc,
62 	const char	**argv);
63 
64 extern int
65 pam_sm_close_session(
66 	pam_handle_t	*pamh,
67 	int	flags,
68 	int	argc,
69 	const char	**argv);
70 
71 /*
72  * Be careful - there are flags defined for pam_chauthtok() in
73  * pam_appl.h also.
74  */
75 #define	PAM_PRELIM_CHECK	0x1
76 #define	PAM_UPDATE_AUTHTOK	0x2
77 
78 extern int
79 pam_sm_chauthtok(
80 	pam_handle_t	*pamh,
81 	int		flags,
82 	int		argc,
83 	const char	**argv);
84 
85 /*
86  * pam_set_data is used to create module specific data, and
87  * to optionally add a cleanup handler that gets called by pam_end.
88  *
89  */
90 extern int
91 pam_set_data(
92 	pam_handle_t *pamh,		/* PAM handle */
93 	const char *module_data_name,	/* unique module data name */
94 	void *data,			/* the module specific data */
95 	void (*cleanup)(pam_handle_t *pamh, void *data, int pam_end_status)
96 );
97 
98 /*
99  * get module specific data set by pam_set_scheme_data.
100  * returns PAM_NO_MODULE_DATA if specified module data was not found.
101  */
102 extern int
103 pam_get_data(
104 	const pam_handle_t *pamh,
105 	const char *module_data_name,
106 	const void **data
107 );
108 
109 #ifdef __cplusplus
110 }
111 #endif
112 
113 #endif	/* _PAM_MODULES_H */
114