Deleted Added
full compact
pam_opie.c (89618) pam_opie.c (89760)
1/*-
2 * Copyright 2000 James Bloom
3 * All rights reserved.
4 * Based upon code Copyright 1998 Juniper Networks, Inc.
5 * Copyright (c) 2001 Networks Associates Technologies, Inc.
6 * All rights reserved.
7 * Copyright (c) 2002 Networks Associates Technologies, Inc.
8 * All rights reserved.

--- 24 unchanged lines hidden (view full) ---

33 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
34 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
36 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
37 * SUCH DAMAGE.
38 */
39
40#include <sys/cdefs.h>
1/*-
2 * Copyright 2000 James Bloom
3 * All rights reserved.
4 * Based upon code Copyright 1998 Juniper Networks, Inc.
5 * Copyright (c) 2001 Networks Associates Technologies, Inc.
6 * All rights reserved.
7 * Copyright (c) 2002 Networks Associates Technologies, Inc.
8 * All rights reserved.

--- 24 unchanged lines hidden (view full) ---

33 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
34 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
36 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
37 * SUCH DAMAGE.
38 */
39
40#include <sys/cdefs.h>
41__FBSDID("$FreeBSD: head/lib/libpam/modules/pam_opie/pam_opie.c 89618 2002-01-21 18:46:25Z des $");
41__FBSDID("$FreeBSD: head/lib/libpam/modules/pam_opie/pam_opie.c 89760 2002-01-24 18:37:17Z markm $");
42
43#include <sys/types.h>
44#include <opie.h>
45#include <pwd.h>
46#include <stdio.h>
47#include <string.h>
48#include <unistd.h>
49

--- 12 unchanged lines hidden (view full) ---

62
63static struct opttab other_options[] = {
64 { "auth_as_self", PAM_OPT_AUTH_AS_SELF },
65 { "no_fake_prompts", PAM_OPT_NO_FAKE_PROMPTS },
66 { NULL, 0 }
67};
68
69PAM_EXTERN int
42
43#include <sys/types.h>
44#include <opie.h>
45#include <pwd.h>
46#include <stdio.h>
47#include <string.h>
48#include <unistd.h>
49

--- 12 unchanged lines hidden (view full) ---

62
63static struct opttab other_options[] = {
64 { "auth_as_self", PAM_OPT_AUTH_AS_SELF },
65 { "no_fake_prompts", PAM_OPT_NO_FAKE_PROMPTS },
66 { NULL, 0 }
67};
68
69PAM_EXTERN int
70pam_sm_authenticate(pam_handle_t *pamh, int flags, int argc, const char **argv)
70pam_sm_authenticate(pam_handle_t *pamh, int flags __unused, int argc, const char **argv)
71{
72 struct opie opie;
73 struct options options;
74 struct passwd *pwd;
75 int retval, i;
71{
72 struct opie opie;
73 struct options options;
74 struct passwd *pwd;
75 int retval, i;
76 char *(promptstr[]) = { "%s\nPassword: ", "%s\nPassword [echo on]: "};
76 const char *(promptstr[]) = { "%s\nPassword: ", "%s\nPassword [echo on]: "};
77 char challenge[OPIE_CHALLENGE_MAX];
78 char prompt[OPIE_CHALLENGE_MAX+22];
79 char resp[OPIE_SECRET_MAX];
80 const char *user;
81 const char *response;
82
83 pam_std_option(&options, other_options, argc, argv);
84

--- 62 unchanged lines hidden (view full) ---

147 * it expects. Thus we can't log an error and can only check for
148 * success or lack thereof.
149 */
150 retval = opieverify(&opie, resp) == 0 ? PAM_SUCCESS : PAM_AUTH_ERR;
151 PAM_RETURN(retval);
152}
153
154PAM_EXTERN int
77 char challenge[OPIE_CHALLENGE_MAX];
78 char prompt[OPIE_CHALLENGE_MAX+22];
79 char resp[OPIE_SECRET_MAX];
80 const char *user;
81 const char *response;
82
83 pam_std_option(&options, other_options, argc, argv);
84

--- 62 unchanged lines hidden (view full) ---

147 * it expects. Thus we can't log an error and can only check for
148 * success or lack thereof.
149 */
150 retval = opieverify(&opie, resp) == 0 ? PAM_SUCCESS : PAM_AUTH_ERR;
151 PAM_RETURN(retval);
152}
153
154PAM_EXTERN int
155pam_sm_setcred(pam_handle_t *pamh, int flags, int argc, const char **argv)
155pam_sm_setcred(pam_handle_t *pamh __unused, int flags __unused, int argc, const char **argv)
156{
157 struct options options;
158
159 pam_std_option(&options, other_options, argc, argv);
160
161 PAM_LOG("Options processed");
162
163 PAM_RETURN(PAM_SUCCESS);
164}
165
166PAM_EXTERN int
156{
157 struct options options;
158
159 pam_std_option(&options, other_options, argc, argv);
160
161 PAM_LOG("Options processed");
162
163 PAM_RETURN(PAM_SUCCESS);
164}
165
166PAM_EXTERN int
167pam_sm_acct_mgmt(pam_handle_t *pamh, int flags, int argc ,const char **argv)
167pam_sm_acct_mgmt(pam_handle_t *pamh __unused, int flags __unused, int argc ,const char **argv)
168{
169 struct options options;
170
171 pam_std_option(&options, NULL, argc, argv);
172
173 PAM_LOG("Options processed");
174
175 PAM_RETURN(PAM_IGNORE);
176}
177
178PAM_EXTERN int
168{
169 struct options options;
170
171 pam_std_option(&options, NULL, argc, argv);
172
173 PAM_LOG("Options processed");
174
175 PAM_RETURN(PAM_IGNORE);
176}
177
178PAM_EXTERN int
179pam_sm_chauthtok(pam_handle_t *pamh, int flags, int argc, const char **argv)
179pam_sm_chauthtok(pam_handle_t *pamh __unused, int flags __unused, int argc, const char **argv)
180{
181 struct options options;
182
183 pam_std_option(&options, NULL, argc, argv);
184
185 PAM_LOG("Options processed");
186
187 PAM_RETURN(PAM_IGNORE);
188}
189
190PAM_EXTERN int
180{
181 struct options options;
182
183 pam_std_option(&options, NULL, argc, argv);
184
185 PAM_LOG("Options processed");
186
187 PAM_RETURN(PAM_IGNORE);
188}
189
190PAM_EXTERN int
191pam_sm_open_session(pam_handle_t *pamh, int flags, int argc, const char **argv)
191pam_sm_open_session(pam_handle_t *pamh __unused, int flags __unused, int argc, const char **argv)
192{
193 struct options options;
194
195 pam_std_option(&options, NULL, argc, argv);
196
197 PAM_LOG("Options processed");
198
199 PAM_RETURN(PAM_IGNORE);
200}
201
202PAM_EXTERN int
192{
193 struct options options;
194
195 pam_std_option(&options, NULL, argc, argv);
196
197 PAM_LOG("Options processed");
198
199 PAM_RETURN(PAM_IGNORE);
200}
201
202PAM_EXTERN int
203pam_sm_close_session(pam_handle_t *pamh, int flags, int argc, const char **argv)
203pam_sm_close_session(pam_handle_t *pamh __unused, int flags __unused, int argc, const char **argv)
204{
205 struct options options;
206
207 pam_std_option(&options, NULL, argc, argv);
208
209 PAM_LOG("Options processed");
210
211 PAM_RETURN(PAM_IGNORE);
212}
213
214PAM_MODULE_ENTRY("pam_opie");
204{
205 struct options options;
206
207 pam_std_option(&options, NULL, argc, argv);
208
209 PAM_LOG("Options processed");
210
211 PAM_RETURN(PAM_IGNORE);
212}
213
214PAM_MODULE_ENTRY("pam_opie");