1 /* pam_permit module */
6 * Written by Andrew Morgan <morgan@parc.power.net> 1996/3/11
10 #define DEFAULT_USER "nobody"
15 * here, we make definitions for the externally accessible functions
16 * in this file (these definitions are required for static modules
17 * but strongly encouraged generally) they are used to instruct the
18 * modules include file to define their prototypes.
22 #define PAM_SM_ACCOUNT
23 #define PAM_SM_SESSION
24 #define PAM_SM_PASSWORD
26 #include <security/pam_modules.h>
27 #include <security/_pam_macros.h>
29 /* --- authentication management functions --- */
32 int pam_sm_authenticate(pam_handle_t *pamh,int flags,int argc
36 const char *user=NULL;
39 * authentication requires we know who the user wants to be
41 retval = pam_get_user(pamh, &user, NULL);
42 if (retval != PAM_SUCCESS) {
43 D(("get user returned error: %s", pam_strerror(pamh,retval)));
46 if (user == NULL || *user == '\0') {
47 D(("username not known"));
48 pam_set_item(pamh, PAM_USER, (const void *) DEFAULT_USER);
50 user = NULL; /* clean up */
56 int pam_sm_setcred(pam_handle_t *pamh,int flags,int argc
62 /* --- account management functions --- */
65 int pam_sm_acct_mgmt(pam_handle_t *pamh,int flags,int argc
71 /* --- password management --- */
74 int pam_sm_chauthtok(pam_handle_t *pamh,int flags,int argc
80 /* --- session management --- */
83 int pam_sm_open_session(pam_handle_t *pamh,int flags,int argc
90 int pam_sm_close_session(pam_handle_t *pamh,int flags,int argc
96 /* end of module definition */
100 /* static module data */
102 struct pam_module _pam_permit_modstruct = {
108 pam_sm_close_session,