pam_permit.c revision 1.2
11.2Schristos/*	$NetBSD: pam_permit.c,v 1.2 2004/12/12 08:18:46 christos Exp $	*/
21.2Schristos
31.1Schristos/*-
41.1Schristos * Copyright 2001 Mark R V Murray
51.1Schristos * All rights reserved.
61.1Schristos *
71.1Schristos * Redistribution and use in source and binary forms, with or without
81.1Schristos * modification, are permitted provided that the following conditions
91.1Schristos * are met:
101.1Schristos * 1. Redistributions of source code must retain the above copyright
111.1Schristos *    notice, this list of conditions and the following disclaimer.
121.1Schristos * 2. Redistributions in binary form must reproduce the above copyright
131.1Schristos *    notice, this list of conditions and the following disclaimer in the
141.1Schristos *    documentation and/or other materials provided with the distribution.
151.1Schristos *
161.1Schristos * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
171.1Schristos * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
181.1Schristos * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
191.1Schristos * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
201.1Schristos * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
211.1Schristos * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
221.1Schristos * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
231.1Schristos * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
241.1Schristos * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
251.1Schristos * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
261.1Schristos * SUCH DAMAGE.
271.1Schristos */
281.1Schristos
291.1Schristos#include <sys/cdefs.h>
301.2Schristos#ifdef __FreeBSD__
311.1Schristos__FBSDID("$FreeBSD: src/lib/libpam/modules/pam_permit/pam_permit.c,v 1.8 2002/04/12 22:27:22 des Exp $");
321.2Schristos#else
331.2Schristos__RCSID("$NetBSD: pam_permit.c,v 1.2 2004/12/12 08:18:46 christos Exp $");
341.2Schristos#endif
351.1Schristos
361.1Schristos#include <stddef.h>
371.1Schristos
381.1Schristos#define	PAM_SM_AUTH
391.1Schristos#define	PAM_SM_ACCOUNT
401.1Schristos#define	PAM_SM_SESSION
411.1Schristos#define	PAM_SM_PASSWORD
421.1Schristos
431.1Schristos#include <security/pam_appl.h>
441.1Schristos#include <security/pam_modules.h>
451.1Schristos
461.1SchristosPAM_EXTERN int
471.1Schristospam_sm_authenticate(pam_handle_t *pamh, int flags __unused,
481.1Schristos    int argc __unused, const char *argv[] __unused)
491.1Schristos{
501.1Schristos	const char *user;
511.1Schristos	int r;
521.1Schristos
531.1Schristos	if ((r = pam_get_user(pamh, &user, NULL)) != PAM_SUCCESS)
541.1Schristos		return (r);
551.1Schristos
561.1Schristos	return (PAM_SUCCESS);
571.1Schristos}
581.1Schristos
591.1SchristosPAM_EXTERN int
601.1Schristospam_sm_setcred(pam_handle_t *pamh __unused, int flags __unused,
611.1Schristos    int argc __unused, const char *argv[] __unused)
621.1Schristos{
631.1Schristos
641.1Schristos	return (PAM_SUCCESS);
651.1Schristos}
661.1Schristos
671.1SchristosPAM_EXTERN int
681.1Schristospam_sm_acct_mgmt(pam_handle_t *pamh __unused, int flags __unused,
691.1Schristos    int argc __unused, const char *argv[] __unused)
701.1Schristos{
711.1Schristos
721.1Schristos	return (PAM_SUCCESS);
731.1Schristos}
741.1Schristos
751.1SchristosPAM_EXTERN int
761.1Schristospam_sm_chauthtok(pam_handle_t *pamh __unused, int flags __unused,
771.1Schristos    int argc __unused, const char *argv[] __unused)
781.1Schristos{
791.1Schristos
801.1Schristos	return (PAM_SUCCESS);
811.1Schristos}
821.1Schristos
831.1SchristosPAM_EXTERN int
841.1Schristospam_sm_open_session(pam_handle_t *pamh __unused, int flags __unused,
851.1Schristos    int argc __unused, const char *argv[] __unused)
861.1Schristos{
871.1Schristos
881.1Schristos	return (PAM_SUCCESS);
891.1Schristos}
901.1Schristos
911.1SchristosPAM_EXTERN int
921.1Schristospam_sm_close_session(pam_handle_t *pamh __unused, int flags __unused,
931.1Schristos    int argc __unused, const char *argv[] __unused)
941.1Schristos{
951.1Schristos
961.1Schristos	return (PAM_SUCCESS);
971.1Schristos}
981.1Schristos
991.1SchristosPAM_MODULE_ENTRY("pam_permit");
100