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
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.
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]
23 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #pragma ident "%Z%%M% %I% %E% SMI"
32 #include <security/pam_appl.h>
33 #include <security/pam_modules.h>
36 * pam_allow - PAM service module that returns PAM_SUCCESS all service
39 * Entry argv = debug, syslog call LOG_AUTH | LOG_DEBUG.
43 * Uses PAM_USER, PAM_SERVICE
47 debug(pam_handle_t
*pamh
, int flags
, int argc
, const char **argv
, char *mod
)
52 if (argc
< 1 || strcmp(argv
[0], "debug") != 0)
55 (void) pam_get_item(pamh
, PAM_SERVICE
, (void **)&service
);
56 (void) pam_get_item(pamh
, PAM_USER
, (void **)&user
);
58 syslog(LOG_AUTH
| LOG_DEBUG
, "%s pam_allow:%s(%x) for %s",
59 service
? service
: "No Service Specified", mod
, flags
,
60 user
? user
: "No User Specified");
64 pam_sm_authenticate(pam_handle_t
*pamh
, int flags
, int argc
, const char **argv
)
66 debug(pamh
, flags
, argc
, argv
, "pam_sm_authenticate");
71 pam_sm_setcred(pam_handle_t
*pamh
, int flags
, int argc
, const char **argv
)
73 debug(pamh
, flags
, argc
, argv
, "pam_sm_setcred");
78 pam_sm_acct_mgmt(pam_handle_t
*pamh
, int flags
, int argc
, const char **argv
)
80 debug(pamh
, flags
, argc
, argv
, "pam_sm_acct_mgmt");
85 pam_sm_open_session(pam_handle_t
*pamh
, int flags
, int argc
, const char **argv
)
87 debug(pamh
, flags
, argc
, argv
, "pam_sm_open_session");
92 pam_sm_close_session(pam_handle_t
*pamh
, int flags
, int argc
, const char **argv
)
94 debug(pamh
, flags
, argc
, argv
, "pam_sm_close_session");
99 pam_sm_chauthtok(pam_handle_t
*pamh
, int flags
, int argc
, const char **argv
)
101 debug(pamh
, flags
, argc
, argv
, "pam_sm_chauthtok");
102 return (PAM_SUCCESS
);