1 /* pam_permit module */
6 * Written by Andrew Morgan <morgan@parc.power.net> 1996/3/11
9 * Revision 1.1 2000/06/20 22:11:46 agmorgan
12 * Revision 1.1.1.1 1998/07/12 05:17:16 morgan
13 * Linux PAM sources pre-0.66
15 * Revision 1.5 1997/02/15 19:03:15 morgan
18 * Revision 1.4 1997/02/15 16:03:10 morgan
19 * force a name for user
21 * Revision 1.3 1996/06/02 08:10:14 morgan
22 * updated for new static protocol
26 #define DEFAULT_USER "nobody"
31 * here, we make definitions for the externally accessible functions
32 * in this file (these definitions are required for static modules
33 * but strongly encouraged generally) they are used to instruct the
34 * modules include file to define their prototypes.
38 #define PAM_SM_ACCOUNT
39 #define PAM_SM_SESSION
40 #define PAM_SM_PASSWORD
42 #include <security/pam_modules.h>
43 #include <security/_pam_macros.h>
45 /* --- authentication management functions --- */
48 int pam_sm_authenticate(pam_handle_t *pamh,int flags,int argc
52 const char *user=NULL;
55 * authentication requires we know who the user wants to be
57 retval = pam_get_user(pamh, &user, NULL);
58 if (retval != PAM_SUCCESS) {
59 D(("get user returned error: %s", pam_strerror(pamh,retval)));
62 if (user == NULL || *user == '\0') {
63 D(("username not known"));
64 pam_set_item(pamh, PAM_USER, (const void *) DEFAULT_USER);
66 user = NULL; /* clean up */
72 int pam_sm_setcred(pam_handle_t *pamh,int flags,int argc
78 /* --- account management functions --- */
81 int pam_sm_acct_mgmt(pam_handle_t *pamh,int flags,int argc
87 /* --- password management --- */
90 int pam_sm_chauthtok(pam_handle_t *pamh,int flags,int argc
96 /* --- session management --- */
99 int pam_sm_open_session(pam_handle_t *pamh,int flags,int argc
106 int pam_sm_close_session(pam_handle_t *pamh,int flags,int argc
112 /* end of module definition */
116 /* static module data */
118 struct pam_module _pam_permit_modstruct = {
124 pam_sm_close_session,