1*e7d22a2eSchristos /* $NetBSD: pam_permit.c,v 1.2 2004/12/12 08:18:46 christos Exp $ */
2*e7d22a2eSchristos
36f11bdf1Schristos /*-
46f11bdf1Schristos * Copyright 2001 Mark R V Murray
56f11bdf1Schristos * All rights reserved.
66f11bdf1Schristos *
76f11bdf1Schristos * Redistribution and use in source and binary forms, with or without
86f11bdf1Schristos * modification, are permitted provided that the following conditions
96f11bdf1Schristos * are met:
106f11bdf1Schristos * 1. Redistributions of source code must retain the above copyright
116f11bdf1Schristos * notice, this list of conditions and the following disclaimer.
126f11bdf1Schristos * 2. Redistributions in binary form must reproduce the above copyright
136f11bdf1Schristos * notice, this list of conditions and the following disclaimer in the
146f11bdf1Schristos * documentation and/or other materials provided with the distribution.
156f11bdf1Schristos *
166f11bdf1Schristos * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
176f11bdf1Schristos * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
186f11bdf1Schristos * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
196f11bdf1Schristos * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
206f11bdf1Schristos * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
216f11bdf1Schristos * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
226f11bdf1Schristos * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
236f11bdf1Schristos * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
246f11bdf1Schristos * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
256f11bdf1Schristos * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
266f11bdf1Schristos * SUCH DAMAGE.
276f11bdf1Schristos */
286f11bdf1Schristos
296f11bdf1Schristos #include <sys/cdefs.h>
30*e7d22a2eSchristos #ifdef __FreeBSD__
316f11bdf1Schristos __FBSDID("$FreeBSD: src/lib/libpam/modules/pam_permit/pam_permit.c,v 1.8 2002/04/12 22:27:22 des Exp $");
32*e7d22a2eSchristos #else
33*e7d22a2eSchristos __RCSID("$NetBSD: pam_permit.c,v 1.2 2004/12/12 08:18:46 christos Exp $");
34*e7d22a2eSchristos #endif
356f11bdf1Schristos
366f11bdf1Schristos #include <stddef.h>
376f11bdf1Schristos
386f11bdf1Schristos #define PAM_SM_AUTH
396f11bdf1Schristos #define PAM_SM_ACCOUNT
406f11bdf1Schristos #define PAM_SM_SESSION
416f11bdf1Schristos #define PAM_SM_PASSWORD
426f11bdf1Schristos
436f11bdf1Schristos #include <security/pam_appl.h>
446f11bdf1Schristos #include <security/pam_modules.h>
456f11bdf1Schristos
466f11bdf1Schristos PAM_EXTERN int
pam_sm_authenticate(pam_handle_t * pamh,int flags __unused,int argc __unused,const char * argv[]__unused)476f11bdf1Schristos pam_sm_authenticate(pam_handle_t *pamh, int flags __unused,
486f11bdf1Schristos int argc __unused, const char *argv[] __unused)
496f11bdf1Schristos {
506f11bdf1Schristos const char *user;
516f11bdf1Schristos int r;
526f11bdf1Schristos
536f11bdf1Schristos if ((r = pam_get_user(pamh, &user, NULL)) != PAM_SUCCESS)
546f11bdf1Schristos return (r);
556f11bdf1Schristos
566f11bdf1Schristos return (PAM_SUCCESS);
576f11bdf1Schristos }
586f11bdf1Schristos
596f11bdf1Schristos PAM_EXTERN int
pam_sm_setcred(pam_handle_t * pamh __unused,int flags __unused,int argc __unused,const char * argv[]__unused)606f11bdf1Schristos pam_sm_setcred(pam_handle_t *pamh __unused, int flags __unused,
616f11bdf1Schristos int argc __unused, const char *argv[] __unused)
626f11bdf1Schristos {
636f11bdf1Schristos
646f11bdf1Schristos return (PAM_SUCCESS);
656f11bdf1Schristos }
666f11bdf1Schristos
676f11bdf1Schristos PAM_EXTERN int
pam_sm_acct_mgmt(pam_handle_t * pamh __unused,int flags __unused,int argc __unused,const char * argv[]__unused)686f11bdf1Schristos pam_sm_acct_mgmt(pam_handle_t *pamh __unused, int flags __unused,
696f11bdf1Schristos int argc __unused, const char *argv[] __unused)
706f11bdf1Schristos {
716f11bdf1Schristos
726f11bdf1Schristos return (PAM_SUCCESS);
736f11bdf1Schristos }
746f11bdf1Schristos
756f11bdf1Schristos PAM_EXTERN int
pam_sm_chauthtok(pam_handle_t * pamh __unused,int flags __unused,int argc __unused,const char * argv[]__unused)766f11bdf1Schristos pam_sm_chauthtok(pam_handle_t *pamh __unused, int flags __unused,
776f11bdf1Schristos int argc __unused, const char *argv[] __unused)
786f11bdf1Schristos {
796f11bdf1Schristos
806f11bdf1Schristos return (PAM_SUCCESS);
816f11bdf1Schristos }
826f11bdf1Schristos
836f11bdf1Schristos PAM_EXTERN int
pam_sm_open_session(pam_handle_t * pamh __unused,int flags __unused,int argc __unused,const char * argv[]__unused)846f11bdf1Schristos pam_sm_open_session(pam_handle_t *pamh __unused, int flags __unused,
856f11bdf1Schristos int argc __unused, const char *argv[] __unused)
866f11bdf1Schristos {
876f11bdf1Schristos
886f11bdf1Schristos return (PAM_SUCCESS);
896f11bdf1Schristos }
906f11bdf1Schristos
916f11bdf1Schristos PAM_EXTERN int
pam_sm_close_session(pam_handle_t * pamh __unused,int flags __unused,int argc __unused,const char * argv[]__unused)926f11bdf1Schristos pam_sm_close_session(pam_handle_t *pamh __unused, int flags __unused,
936f11bdf1Schristos int argc __unused, const char *argv[] __unused)
946f11bdf1Schristos {
956f11bdf1Schristos
966f11bdf1Schristos return (PAM_SUCCESS);
976f11bdf1Schristos }
986f11bdf1Schristos
996f11bdf1Schristos PAM_MODULE_ENTRY("pam_permit");
100