xref: /titanic_50/usr/src/cmd/ssh/include/auth-pam.h (revision 2722387f30847b828b57ba9ca59d2b47ee9244ec)
1 /* $Id: auth-pam.h,v 1.16 2002/07/23 00:44:07 stevesk Exp $ */
2 
3 #ifndef	_AUTH_PAM_H
4 #define	_AUTH_PAM_H
5 
6 #pragma ident	"%Z%%M%	%I%	%E% SMI"
7 
8 #ifdef __cplusplus
9 extern "C" {
10 #endif
11 
12 
13 /*
14  * Copyright (c) 2000 Damien Miller.  All rights reserved.
15  *
16  * Redistribution and use in source and binary forms, with or without
17  * modification, are permitted provided that the following conditions
18  * are met:
19  * 1. Redistributions of source code must retain the above copyright
20  *    notice, this list of conditions and the following disclaimer.
21  * 2. Redistributions in binary form must reproduce the above copyright
22  *    notice, this list of conditions and the following disclaimer in the
23  *    documentation and/or other materials provided with the distribution.
24  *
25  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
26  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
27  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
28  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
29  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
30  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
31  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
32  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
33  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
34  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35  */
36 /*
37  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
38  * Use is subject to license terms.
39  */
40 
41 #include "includes.h"
42 #ifdef USE_PAM
43 
44 const char * derive_pam_svc_name(Authmethod *method);
45 void new_start_pam(Authctxt *authctxt, struct pam_conv *conv);
46 int auth_pam_password(Authctxt *authctxt, const char *password);
47 int do_pam_non_initial_userauth(Authctxt *authctxt);
48 int finish_userauth_do_pam(Authctxt *authctxt);
49 void finish_pam(Authctxt *authctxt);
50 char **fetch_pam_environment(Authctxt *authctxt);
51 void free_pam_environment(char **env);
52 void message_cat(char **p, const char *a);
53 void print_pam_messages(void);
54 
55 #define AUTHPAM_DONE(ac) (ac != NULL && \
56 			ac->pam != NULL && \
57 			ac->pam->h != NULL && \
58 			ac->pam->state == PAM_S_DONE)
59 
60 #define AUTHPAM_RETVAL(ac, rv) ((ac != NULL && ac->pam != NULL) ? \
61 	ac->pam->last_pam_retval : rv)
62 
63 #define AUTHPAM_ERROR(ac, rv) ((ac != NULL && ac->pam != NULL && \
64 				ac->pam->last_pam_retval != PAM_SUCCESS) ? \
65 			ac->pam->last_pam_retval : rv)
66 
67 #endif	/* USE_PAM */
68 
69 #ifdef __cplusplus
70 }
71 #endif
72 
73 #endif /* _AUTH_PAM_H */
74