xref: /illumos-gate/usr/src/lib/libpam/pam_modules.h (revision d48be21240dfd051b689384ce2b23479d757f2d8)
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 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
34 extern int
35 pam_sm_authenticate(
36 	pam_handle_t	*pamh,
37 	int	flags,
38 	int	argc,
39 	const char	**argv);
40 
41 extern int
42 pam_sm_setcred(
43 	pam_handle_t	*pamh,
44 	int	flags,
45 	int	argc,
46 	const char	**argv);
47 
48 extern int
49 pam_sm_acct_mgmt(
50 	pam_handle_t	*pamh,
51 	int	flags,
52 	int	argc,
53 	const char	**argv);
54 
55 extern int
56 pam_sm_open_session(
57 	pam_handle_t	*pamh,
58 	int	flags,
59 	int	argc,
60 	const char	**argv);
61 
62 extern int
63 pam_sm_close_session(
64 	pam_handle_t	*pamh,
65 	int	flags,
66 	int	argc,
67 	const char	**argv);
68 
69 /*
70  * Be careful - there are flags defined for pam_chauthtok() in
71  * pam_appl.h also.
72  */
73 #define	PAM_PRELIM_CHECK	0x1
74 #define	PAM_UPDATE_AUTHTOK	0x2
75 
76 extern int
77 pam_sm_chauthtok(
78 	pam_handle_t	*pamh,
79 	int		flags,
80 	int		argc,
81 	const char	**argv);
82 
83 /*
84  * pam_set_data is used to create module specific data, and
85  * to optionally add a cleanup handler that gets called by pam_end.
86  *
87  */
88 extern int
89 pam_set_data(
90 	pam_handle_t *pamh,		/* PAM handle */
91 	const char *module_data_name,	/* unique module data name */
92 	void *data,			/* the module specific data */
93 	void (*cleanup)(pam_handle_t *pamh, void *data, int pam_end_status)
94 );
95 
96 /*
97  * get module specific data set by pam_set_scheme_data.
98  * returns PAM_NO_MODULE_DATA if specified module data was not found.
99  */
100 extern int
101 pam_get_data(
102 	const pam_handle_t *pamh,
103 	const char *module_data_name,
104 	const void **data
105 );
106 
107 #ifdef __cplusplus
108 }
109 #endif
110 
111 #endif	/* _PAM_MODULES_H */
112