diff options
Diffstat (limited to 'modules/pam_debug')
-rw-r--r-- | modules/pam_debug/.cvsignore | 8 | ||||
-rw-r--r-- | modules/pam_debug/Makefile.am | 31 | ||||
-rw-r--r-- | modules/pam_debug/README.xml | 41 | ||||
-rw-r--r-- | modules/pam_debug/pam_debug.8.xml | 231 | ||||
-rw-r--r-- | modules/pam_debug/pam_debug.c | 167 | ||||
-rwxr-xr-x | modules/pam_debug/tst-pam_debug | 2 |
6 files changed, 0 insertions, 480 deletions
diff --git a/modules/pam_debug/.cvsignore b/modules/pam_debug/.cvsignore deleted file mode 100644 index af38ef08..00000000 --- a/modules/pam_debug/.cvsignore +++ /dev/null @@ -1,8 +0,0 @@ -*.la -*.lo -.deps -.libs -Makefile -Makefile.in -README -pam_debug.8 diff --git a/modules/pam_debug/Makefile.am b/modules/pam_debug/Makefile.am deleted file mode 100644 index 0b798516..00000000 --- a/modules/pam_debug/Makefile.am +++ /dev/null @@ -1,31 +0,0 @@ -# -# Copyright (c) 2005, 2006 Thorsten Kukuk <kukuk@thkukuk.de> -# - -CLEANFILES = *~ - -EXTRA_DIST = README $(MANS) $(XMLS) tst-pam_debug - -man_MANS = pam_debug.8 -XMLS = README.xml pam_debug.8.xml - -securelibdir = $(SECUREDIR) -secureconfdir = $(SCONFIGDIR) - -AM_CFLAGS = -I$(top_srcdir)/libpam/include -I$(top_srcdir)/libpamc/include -AM_LDFLAGS = -no-undefined -avoid-version -module -if HAVE_VERSIONING - AM_LDFLAGS += -Wl,--version-script=$(srcdir)/../modules.map -endif - -securelib_LTLIBRARIES = pam_debug.la -pam_debug_la_LIBADD = -L$(top_builddir)/libpam -lpam - -TESTS = tst-pam_debug - -if ENABLE_REGENERATE_MAN -noinst_DATA = README -README: pam_debug.8.xml --include $(top_srcdir)/Make.xml.rules -endif - diff --git a/modules/pam_debug/README.xml b/modules/pam_debug/README.xml deleted file mode 100644 index ef41911b..00000000 --- a/modules/pam_debug/README.xml +++ /dev/null @@ -1,41 +0,0 @@ -<?xml version="1.0" encoding='UTF-8'?> -<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" -"http://www.docbook.org/xml/4.3/docbookx.dtd" -[ -<!-- -<!ENTITY pamaccess SYSTEM "pam_debug.8.xml"> ---> -]> - -<article> - - <articleinfo> - - <title> - <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" - href="pam_debug.8.xml" xpointer='xpointer(//refnamediv[@id = "pam_debug-name"]/*)'/> - </title> - - </articleinfo> - - <section> - <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" - href="pam_debug.8.xml" xpointer='xpointer(//refsect1[@id = "pam_debug-description"]/*)'/> - </section> - - <section> - <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" - href="pam_debug.8.xml" xpointer='xpointer(//refsect1[@id = "pam_debug-options"]/*)'/> - </section> - - <section> - <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" - href="pam_debug.8.xml" xpointer='xpointer(//refsect1[@id = "pam_debug-examples"]/*)'/> - </section> - - <section> - <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" - href="pam_debug.8.xml" xpointer='xpointer(//refsect1[@id = "pam_debug-author"]/*)'/> - </section> - -</article> diff --git a/modules/pam_debug/pam_debug.8.xml b/modules/pam_debug/pam_debug.8.xml deleted file mode 100644 index 65519852..00000000 --- a/modules/pam_debug/pam_debug.8.xml +++ /dev/null @@ -1,231 +0,0 @@ -<?xml version="1.0" encoding='UTF-8'?> -<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" - "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd"> - -<refentry id="pam_debug"> - - <refmeta> - <refentrytitle>pam_debug</refentrytitle> - <manvolnum>8</manvolnum> - <refmiscinfo class="sectdesc">Linux-PAM Manual</refmiscinfo> - </refmeta> - - <refnamediv id="pam_debug-name"> - <refname>pam_debug</refname> - <refpurpose>PAM module to debug the PAM stack</refpurpose> - </refnamediv> - - <refsynopsisdiv> - <cmdsynopsis id="pam_debug-cmdsynopsis"> - <command>pam_debug.so</command> - <arg choice="opt"> - auth=<replaceable>value</replaceable> - </arg> - <arg choice="opt"> - cred=<replaceable>value</replaceable> - </arg> - <arg choice="opt"> - acct=<replaceable>value</replaceable> - </arg> - <arg choice="opt"> - prechauthtok=<replaceable>value</replaceable> - </arg> - <arg choice="opt"> - chauthtok=<replaceable>value</replaceable> - </arg> - <arg choice="opt"> - auth=<replaceable>value</replaceable> - </arg> - <arg choice="opt"> - open_session=<replaceable>value</replaceable> - </arg> - <arg choice="opt"> - close_session=<replaceable>value</replaceable> - </arg> - </cmdsynopsis> - </refsynopsisdiv> - - <refsect1 id="pam_debug-description"> - <title>DESCRIPTION</title> - <para> - The pam_debug PAM module is intended as a debugging aide for - determining how the PAM stack is operating. This module returns - what its module arguments tell it to return. - </para> - </refsect1> - - <refsect1 id="pam_debug-options"> - <title>OPTIONS</title> - <variablelist> - <varlistentry> - <term> - <option>auth=<replaceable>value</replaceable></option> - </term> - <listitem> - <para> - The - <citerefentry> - <refentrytitle>pam_sm_authenticate</refentrytitle><manvolnum>3</manvolnum> - </citerefentry> function will return - <replaceable>value</replaceable>. - </para> - </listitem> - </varlistentry> - <varlistentry> - <term> - <option>cred=<replaceable>value</replaceable></option> - </term> - <listitem> - <para> - The - <citerefentry> - <refentrytitle>pam_sm_setcred</refentrytitle><manvolnum>3</manvolnum> - </citerefentry> function will return - <replaceable>value</replaceable>. - </para> - </listitem> - </varlistentry> - <varlistentry> - <term> - <option>acct=<replaceable>value</replaceable></option> - </term> - <listitem> - <para> - The - <citerefentry> - <refentrytitle>pam_sm_acct_mgmt</refentrytitle><manvolnum>3</manvolnum> - </citerefentry> function will return - <replaceable>value</replaceable>. - </para> - </listitem> - </varlistentry> - <varlistentry> - <term> - <option>prechauthtok=<replaceable>value</replaceable></option> - </term> - <listitem> - <para> - The - <citerefentry> - <refentrytitle>pam_sm_chauthtok</refentrytitle><manvolnum>3</manvolnum> - </citerefentry> function will return - <replaceable>value</replaceable> if the - <emphasis>PAM_PRELIM_CHECK</emphasis> flag is set. - </para> - </listitem> - </varlistentry> - <varlistentry> - <term> - <option>chauthtok=<replaceable>value</replaceable></option> - </term> - <listitem> - <para> - The - <citerefentry> - <refentrytitle>pam_sm_chauthtok</refentrytitle><manvolnum>3</manvolnum> - </citerefentry> function will return - <replaceable>value</replaceable> if the - <emphasis>PAM_PRELIM_CHECK</emphasis> flag is - <emphasis remap='B'>not</emphasis> set. - </para> - </listitem> - </varlistentry> - <varlistentry> - <term> - <option>open_session=<replaceable>value</replaceable></option> - </term> - <listitem> - <para> - The - <citerefentry> - <refentrytitle>pam_sm_open_session</refentrytitle><manvolnum>3</manvolnum> - </citerefentry> function will return - <replaceable>value</replaceable>. - </para> - </listitem> - </varlistentry> - <varlistentry> - <term> - <option>close_session=<replaceable>value</replaceable></option> - </term> - <listitem> - <para> - The - <citerefentry> - <refentrytitle>pam_sm_close_session</refentrytitle><manvolnum>3</manvolnum> - </citerefentry> function will return - <replaceable>value</replaceable>. - </para> - </listitem> - </varlistentry> - </variablelist> - <para> - Where <replaceable>value</replaceable> can be one of: success, - open_err, symbol_err, service_err, system_err, buf_err, perm_denied, - auth_err, cred_insufficient, authinfo_unavail, user_unknown, - maxtries, new_authtok_reqd, acct_expired, session_err, cred_unavail, - cred_expired, cred_err, no_module_data, conv_err, authtok_err, - authtok_recover_err, authtok_lock_busy, authtok_disable_aging, - try_again, ignore, abort, authtok_expired, module_unknown, - bad_item, conv_again, incomplete. - </para> - </refsect1> - - <refsect1 id="pam_debug-services"> - <title>MODULE SERVICES PROVIDED</title> - <para> - The services <option>auth</option>, <option>account</option>, - <option>password</option> and <option>session</option> are supported. - </para> - </refsect1> - - <refsect1 id='pam_debug-return_values'> - <title>RETURN VALUES</title> - <variablelist> - <varlistentry> - <term>PAM_SUCCESS</term> - <listitem> - <para> - Default return code if no other value was specified, - else specified return value. - </para> - </listitem> - </varlistentry> - </variablelist> - </refsect1> - - <refsect1 id='pam_debug-examples'> - <title>EXAMPLES</title> - <programlisting> -auth requisite pam_permit.so -auth [success=2 default=ok] pam_debug.so auth=perm_denied cred=success -auth [default=reset] pam_debug.so auth=success cred=perm_denied -auth [success=done default=die] pam_debug.so -auth optional pam_debug.so auth=perm_denied cred=perm_denied -auth sufficient pam_debug.so auth=success cred=success - </programlisting> - </refsect1> - - <refsect1 id='pam_debug-see_also'> - <title>SEE ALSO</title> - <para> - <citerefentry> - <refentrytitle>pam.conf</refentrytitle><manvolnum>5</manvolnum> - </citerefentry>, - <citerefentry> - <refentrytitle>pam.d</refentrytitle><manvolnum>8</manvolnum> - </citerefentry>, - <citerefentry> - <refentrytitle>pam</refentrytitle><manvolnum>8</manvolnum> - </citerefentry> - </para> - </refsect1> - - <refsect1 id='pam_debug-author'> - <title>AUTHOR</title> - <para> - pam_debug was written by Andrew G. Morgan <morgan@kernel.org>. - </para> - </refsect1> - -</refentry> diff --git a/modules/pam_debug/pam_debug.c b/modules/pam_debug/pam_debug.c deleted file mode 100644 index a65d1bf2..00000000 --- a/modules/pam_debug/pam_debug.c +++ /dev/null @@ -1,167 +0,0 @@ -/* pam_permit module */ - -/* - * $Id$ - * - * Written by Andrew Morgan <morgan@kernel.org> 2001/02/04 - * - */ - -#define DEFAULT_USER "nobody" - -#include "config.h" - -#include <stdio.h> - -/* - * This module is intended as a debugging aide for determining how - * the PAM stack is operating. - * - * here, we make definitions for the externally accessible functions - * in this file (these definitions are required for static modules - * but strongly encouraged generally) they are used to instruct the - * modules include file to define their prototypes. - */ - -#define PAM_SM_AUTH -#define PAM_SM_ACCOUNT -#define PAM_SM_SESSION -#define PAM_SM_PASSWORD - -#include <security/pam_modules.h> -#include <security/_pam_macros.h> -#include <security/pam_ext.h> - -#define _PAM_ACTION_UNDEF (-10) -#include "../../libpam/pam_tokens.h" - -/* --- authentication management functions --- */ - -static int state(pam_handle_t *pamh, const char *text) -{ - int retval; - - retval = pam_info (pamh, "%s", text); - - if (retval != PAM_SUCCESS) { - D(("pam_info failed")); - } - - return retval; -} - -static int parse_args(int retval, const char *event, - pam_handle_t *pamh, int argc, const char **argv) -{ - int i; - - for (i=0; i<argc; ++i) { - int length = strlen(event); - if (!strncmp(event, argv[i], length) && (argv[i][length] == '=')) { - int j; - const char *return_string = argv[i] + (length+1); - - for (j=0; j<_PAM_RETURN_VALUES; ++j) { - if (!strcmp(return_string, _pam_token_returns[j])) { - retval = j; - state(pamh, argv[i]); - break; - } - } - break; - } - } - - return retval; -} - -PAM_EXTERN -int pam_sm_authenticate(pam_handle_t *pamh, int flags UNUSED, - int argc, const char **argv) -{ - int retval; - const char *user=NULL; - - /* - * authentication requires we know who the user wants to be - */ - retval = pam_get_user(pamh, &user, NULL); - if (retval != PAM_SUCCESS) { - D(("get user returned error: %s", pam_strerror(pamh,retval))); - return retval; - } - if (user == NULL || *user == '\0') { - D(("username not known")); - retval = pam_set_item(pamh, PAM_USER, (const void *) DEFAULT_USER); - if (retval != PAM_SUCCESS) - return retval; - } - user = NULL; /* clean up */ - - retval = parse_args(PAM_SUCCESS, "auth", pamh, argc, argv); - - return retval; -} - -PAM_EXTERN -int pam_sm_setcred(pam_handle_t *pamh, int flags UNUSED, - int argc, const char **argv) -{ - return parse_args(PAM_SUCCESS, "cred", pamh, argc, argv); -} - -/* --- account management functions --- */ - -PAM_EXTERN -int pam_sm_acct_mgmt(pam_handle_t *pamh, int flags UNUSED, - int argc, const char **argv) -{ - return parse_args(PAM_SUCCESS, "acct", pamh, argc, argv); -} - -/* --- password management --- */ - -PAM_EXTERN -int pam_sm_chauthtok(pam_handle_t *pamh, int flags UNUSED, - int argc, const char **argv) -{ - if (flags & PAM_PRELIM_CHECK) { - return parse_args(PAM_SUCCESS, "prechauthtok", pamh, argc, argv); - } else { - return parse_args(PAM_SUCCESS, "chauthtok", pamh, argc, argv); - } -} - -/* --- session management --- */ - -PAM_EXTERN -int pam_sm_open_session(pam_handle_t *pamh, int flags UNUSED, - int argc, const char **argv) -{ - return parse_args(PAM_SUCCESS, "open_session", pamh, argc, argv); -} - -PAM_EXTERN -int pam_sm_close_session(pam_handle_t *pamh, int flags UNUSED, - int argc, const char **argv) -{ - return parse_args(PAM_SUCCESS, "close_session", pamh, argc, argv); -} - -/* end of module definition */ - -#ifdef PAM_STATIC - -/* static module data */ - -struct pam_module _pam_debug_modstruct = { - "pam_debug", - pam_sm_authenticate, - pam_sm_setcred, - pam_sm_acct_mgmt, - pam_sm_open_session, - pam_sm_close_session, - pam_sm_chauthtok -}; - -#endif diff --git a/modules/pam_debug/tst-pam_debug b/modules/pam_debug/tst-pam_debug deleted file mode 100755 index f07ff640..00000000 --- a/modules/pam_debug/tst-pam_debug +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -../../tests/tst-dlopen .libs/pam_debug.so |