2N/A/*
2N/A * CDDL HEADER START
2N/A *
2N/A * The contents of this file are subject to the terms of the
2N/A * Common Development and Distribution License, Version 1.0 only
2N/A * (the "License"). You may not use this file except in compliance
2N/A * with the License.
2N/A *
2N/A * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2N/A * or http://www.opensolaris.org/os/licensing.
2N/A * See the License for the specific language governing permissions
2N/A * and limitations under the License.
2N/A *
2N/A * When distributing Covered Code, include this CDDL HEADER in each
2N/A * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2N/A * If applicable, add the following below this CDDL HEADER, with the
2N/A * fields enclosed by brackets "[]" replaced with your own identifying
2N/A * information: Portions Copyright [yyyy] [name of copyright owner]
2N/A *
2N/A * CDDL HEADER END
2N/A */
2N/A/*
2N/A * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
2N/A * Use is subject to license terms.
2N/A */
2N/A
2N/A#pragma ident "%Z%%M% %I% %E% SMI"
2N/A
2N/A#include <strings.h>
2N/A#include <syslog.h>
2N/A
2N/A#include <security/pam_appl.h>
2N/A#include <security/pam_modules.h>
2N/A
2N/A/*
2N/A * pam_deny - PAM service module that returns the default error code for
2N/A * all service module types.
2N/A *
2N/A * Entry argv = debug, syslog call LOG_AUTH | LOG_DEBUG.
2N/A *
2N/A * Exit PAM_* appropriate for service module type.
2N/A *
2N/A * Uses PAM_USER, PAM_SERVICE
2N/A */
2N/A
2N/Astatic void
2N/Adebug(pam_handle_t *pamh, int flags, int argc, const char **argv, char *mod)
2N/A{
2N/A char *user;
2N/A char *service;
2N/A
2N/A if (argc < 1 || strcmp(argv[0], "debug") != 0)
2N/A return;
2N/A
2N/A (void) pam_get_item(pamh, PAM_SERVICE, (void **)&service);
2N/A (void) pam_get_item(pamh, PAM_USER, (void **)&user);
2N/A
2N/A syslog(LOG_AUTH | LOG_DEBUG, "%s pam_deny:%s(%x) for %s",
2N/A service ? service : "No Service Specified", mod, flags,
2N/A user ? user : "No User Specified");
2N/A}
2N/A
2N/Aint
2N/Apam_sm_authenticate(pam_handle_t *pamh, int flags, int argc, const char **argv)
2N/A{
2N/A debug(pamh, flags, argc, argv, "pam_sm_authenticate");
2N/A return (PAM_AUTH_ERR);
2N/A}
2N/A
2N/Aint
2N/Apam_sm_setcred(pam_handle_t *pamh, int flags, int argc, const char **argv)
2N/A{
2N/A debug(pamh, flags, argc, argv, "pam_sm_setcred");
2N/A return (PAM_CRED_ERR);
2N/A}
2N/A
2N/Aint
2N/Apam_sm_acct_mgmt(pam_handle_t *pamh, int flags, int argc, const char **argv)
2N/A{
2N/A debug(pamh, flags, argc, argv, "pam_sm_acct_mgmt");
2N/A return (PAM_ACCT_EXPIRED);
2N/A}
2N/A
2N/Aint
2N/Apam_sm_open_session(pam_handle_t *pamh, int flags, int argc, const char **argv)
2N/A{
2N/A debug(pamh, flags, argc, argv, "pam_sm_open_session");
2N/A return (PAM_SESSION_ERR);
2N/A}
2N/A
2N/Aint
2N/Apam_sm_close_session(pam_handle_t *pamh, int flags, int argc, const char **argv)
2N/A{
2N/A debug(pamh, flags, argc, argv, "pam_sm_close_session");
2N/A return (PAM_SESSION_ERR);
2N/A}
2N/A
2N/Aint
2N/Apam_sm_chauthtok(pam_handle_t *pamh, int flags, int argc, const char **argv)
2N/A{
2N/A debug(pamh, flags, argc, argv, "pam_sm_chauthtok");
2N/A return (PAM_AUTHTOK_ERR);
2N/A}