1 /* pam_permit module */
4 * $Id: pam_permit.c,v 1.5 1997/02/15 19:03:15 morgan Exp $
5 * $FreeBSD: src/contrib/libpam/modules/pam_permit/pam_permit.c,v 1.3.4.2 2001/06/11 15:28:23 markm Exp $
7 * Written by Andrew Morgan <morgan@parc.power.net> 1996/3/11
9 * $Log: pam_permit.c,v $
10 * Revision 1.5 1997/02/15 19:03:15 morgan
13 * Revision 1.4 1997/02/15 16:03:10 morgan
14 * force a name for user
16 * Revision 1.3 1996/06/02 08:10:14 morgan
17 * updated for new static protocol
21 #define DEFAULT_USER "nobody"
26 * here, we make definitions for the externally accessible functions
27 * in this file (these definitions are required for static modules
28 * but strongly encouraged generally) they are used to instruct the
29 * modules include file to define their prototypes.
33 #define PAM_SM_ACCOUNT
34 #define PAM_SM_SESSION
35 #define PAM_SM_PASSWORD
37 #include <security/pam_modules.h>
38 #include <security/_pam_macros.h>
40 /* --- authentication management functions --- */
43 int pam_sm_authenticate(pam_handle_t *pamh,int flags,int argc
47 const char *user=NULL;
50 * authentication requires we know who the user wants to be
52 retval = pam_get_user(pamh, &user, NULL);
53 if (retval != PAM_SUCCESS) {
54 D(("get user returned error: %s", pam_strerror(pamh,retval)));
57 if (user == NULL || *user == '\0') {
58 D(("username not known"));
59 pam_set_item(pamh, PAM_USER, (const void *) DEFAULT_USER);
61 user = NULL; /* clean up */
67 int pam_sm_setcred(pam_handle_t *pamh,int flags,int argc
73 /* --- account management functions --- */
76 int pam_sm_acct_mgmt(pam_handle_t *pamh,int flags,int argc
82 /* --- password management --- */
85 int pam_sm_chauthtok(pam_handle_t *pamh,int flags,int argc
91 /* --- session management --- */
94 int pam_sm_open_session(pam_handle_t *pamh,int flags,int argc
101 int pam_sm_close_session(pam_handle_t *pamh,int flags,int argc
107 /* end of module definition */
109 PAM_MODULE_ENTRY("pam_permit");