pam_deny.c revision 79476
1/*-
2 * Copyright 2001 Mark R V Murray
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 *    notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 *    notice, this list of conditions and the following disclaimer in the
12 *    documentation and/or other materials provided with the distribution.
13 *
14 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 * $FreeBSD: head/lib/libpam/modules/pam_deny/pam_deny.c 79476 2001-07-09 18:20:51Z markm $
27 */
28
29#define PAM_SM_AUTH
30#define PAM_SM_ACCOUNT
31#define PAM_SM_SESSION
32#define PAM_SM_PASSWORD
33
34#include <security/pam_modules.h>
35#include "pam_mod_misc.h"
36
37PAM_EXTERN int
38pam_sm_authenticate(pam_handle_t *pamh, int flags, int argc, const char **argv)
39{
40	struct options options;
41
42	pam_std_option(&options, NULL, argc, argv);
43
44	PAM_LOG("Options processed");
45
46	PAM_RETURN(PAM_AUTH_ERR);
47}
48
49PAM_EXTERN int
50pam_sm_setcred(pam_handle_t *pamh, int flags, int argc, const char **argv)
51{
52	struct options options;
53
54	pam_std_option(&options, NULL, argc, argv);
55
56	PAM_LOG("Options processed");
57
58	PAM_RETURN(PAM_CRED_UNAVAIL);
59}
60
61PAM_EXTERN int
62pam_sm_acct_mgmt(pam_handle_t *pamh, int flags, int argc ,const char **argv)
63{
64	struct options options;
65
66	pam_std_option(&options, NULL, argc, argv);
67
68	PAM_LOG("Options processed");
69
70	PAM_RETURN(PAM_ACCT_EXPIRED);
71}
72
73PAM_EXTERN int
74pam_sm_chauthtok(pam_handle_t *pamh, int flags, int argc, const char **argv)
75{
76	struct options options;
77
78	pam_std_option(&options, NULL, argc, argv);
79
80	PAM_LOG("Options processed");
81
82	PAM_RETURN(PAM_AUTHTOK_ERR);
83}
84
85PAM_EXTERN int
86pam_sm_open_session(pam_handle_t *pamh, int flags, int argc, const char **argv)
87{
88	struct options options;
89
90	pam_std_option(&options, NULL, argc, argv);
91
92	PAM_LOG("Options processed");
93
94	PAM_RETURN(PAM_SYSTEM_ERR);
95}
96
97PAM_EXTERN int
98pam_sm_close_session(pam_handle_t *pamh, int flags, int argc, const char **argv)
99{
100	struct options options;
101
102	pam_std_option(&options, NULL, argc, argv);
103
104	PAM_LOG("Options processed");
105
106	PAM_RETURN(PAM_SYSTEM_ERR);
107}
108
109PAM_MODULE_ENTRY("pam_deny");
110