Make setthetime() static per the prototype.
[dragonfly.git] / contrib / libpam / libpam / pam_auth.c
1 /*
2  * pam_auth.c -- PAM authentication
3  *
4  * $Id: pam_auth.c,v 1.7 1997/04/05 06:53:52 morgan Exp morgan $
5  * $FreeBSD: src/contrib/libpam/libpam/pam_auth.c,v 1.1.1.1.6.2 2001/06/11 15:28:12 markm Exp $
6  * $DragonFly: src/contrib/libpam/libpam/Attic/pam_auth.c,v 1.2 2003/06/17 04:24:03 dillon Exp $
7  *
8  * $Log: pam_auth.c,v $
9  * Revision 1.7  1997/04/05 06:53:52  morgan
10  * fail-delay changes
11  *
12  */
13
14 #include <stdio.h>
15 #include <stdlib.h>
16
17 #include "pam_private.h"
18
19 int pam_authenticate(pam_handle_t *pamh, int flags)
20 {
21     int retval;
22
23     D(("pam_authenticate called"));
24
25     if (pamh->former.choice == PAM_NOT_STACKED) {
26         _pam_sanitize(pamh);
27         _pam_start_timer(pamh);    /* we try to make the time for a failure
28                                       independent of the time it takes to
29                                       fail */
30     }
31
32     IF_NO_PAMH("pam_authenticate",pamh,PAM_SYSTEM_ERR);
33     retval = _pam_dispatch(pamh, flags, PAM_AUTHENTICATE);
34
35     if (retval != PAM_INCOMPLETE) {
36         _pam_sanitize(pamh);
37         _pam_await_timer(pamh, retval);   /* if unsuccessful then wait now */
38         D(("pam_authenticate exit"));
39     } else {
40         D(("will resume when ready"));
41     }
42
43     return retval;
44 }
45
46 int pam_setcred(pam_handle_t *pamh, int flags)
47 {
48     int retval;
49
50     IF_NO_PAMH("pam_setcred", pamh, PAM_SYSTEM_ERR);
51
52     D(("pam_setcred called"));
53
54     if (! flags) {
55         flags = PAM_ESTABLISH_CRED;
56     }
57
58     retval = _pam_dispatch(pamh, flags, PAM_SETCRED);
59
60     D(("pam_setcred exit"));
61
62     return retval;
63 }