1 /* pam_permit module */
4 * $Id: pam_permit.c,v 1.5 1997/02/15 19:03:15 morgan Exp $
6 * Written by Andrew Morgan <morgan@parc.power.net> 1996/3/11
8 * $Log: pam_permit.c,v $
9 * Revision 1.5 1997/02/15 19:03:15 morgan
12 * Revision 1.4 1997/02/15 16:03:10 morgan
13 * force a name for user
15 * Revision 1.3 1996/06/02 08:10:14 morgan
16 * updated for new static protocol
20 #define DEFAULT_USER "nobody"
25 * here, we make definitions for the externally accessible functions
26 * in this file (these definitions are required for static modules
27 * but strongly encouraged generally) they are used to instruct the
28 * modules include file to define their prototypes.
32 #define PAM_SM_ACCOUNT
33 #define PAM_SM_SESSION
34 #define PAM_SM_PASSWORD
36 #include <security/pam_modules.h>
37 #include <security/_pam_macros.h>
39 /* --- authentication management functions --- */
42 int pam_sm_authenticate(pam_handle_t *pamh,int flags,int argc
46 const char *user=NULL;
49 * authentication requires we know who the user wants to be
51 retval = pam_get_user(pamh, &user, NULL);
52 if (retval != PAM_SUCCESS) {
53 D(("get user returned error: %s", pam_strerror(pamh,retval)));
56 if (user == NULL || *user == '\0') {
57 D(("username not known"));
58 pam_set_item(pamh, PAM_USER, (const void *) DEFAULT_USER);
60 user = NULL; /* clean up */
66 int pam_sm_setcred(pam_handle_t *pamh,int flags,int argc
72 /* --- account management functions --- */
75 int pam_sm_acct_mgmt(pam_handle_t *pamh,int flags,int argc
81 /* --- password management --- */
84 int pam_sm_chauthtok(pam_handle_t *pamh,int flags,int argc
90 /* --- session management --- */
93 int pam_sm_open_session(pam_handle_t *pamh,int flags,int argc
100 int pam_sm_close_session(pam_handle_t *pamh,int flags,int argc
106 /* end of module definition */
110 /* static module data */
112 struct pam_module _pam_permit_modstruct = {
118 pam_sm_close_session,