summaryrefslogtreecommitdiff
path: root/modules/pam_stress
diff options
context:
space:
mode:
Diffstat (limited to 'modules/pam_stress')
-rw-r--r--modules/pam_stress/Makefile.am4
-rw-r--r--modules/pam_stress/Makefile.in15
-rw-r--r--modules/pam_stress/README.xml26
-rw-r--r--modules/pam_stress/pam_stress.828
-rw-r--r--modules/pam_stress/pam_stress.8.xml71
-rw-r--r--modules/pam_stress/pam_stress.c11
6 files changed, 78 insertions, 77 deletions
diff --git a/modules/pam_stress/Makefile.am b/modules/pam_stress/Makefile.am
index e964fcc4..ee78daef 100644
--- a/modules/pam_stress/Makefile.am
+++ b/modules/pam_stress/Makefile.am
@@ -15,7 +15,11 @@ dist_check_SCRIPTS = tst-pam_stress
TESTS = $(dist_check_SCRIPTS)
securelibdir = $(SECUREDIR)
+if HAVE_VENDORDIR
+secureconfdir = $(VENDOR_SCONFIGDIR)
+else
secureconfdir = $(SCONFIGDIR)
+endif
AM_CFLAGS = -I$(top_srcdir)/libpam/include -I$(top_srcdir)/libpamc/include \
$(WARN_CFLAGS)
diff --git a/modules/pam_stress/Makefile.in b/modules/pam_stress/Makefile.in
index 297f39d2..4788de54 100644
--- a/modules/pam_stress/Makefile.in
+++ b/modules/pam_stress/Makefile.in
@@ -428,6 +428,7 @@ CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
+DOCBOOK_RNG = @DOCBOOK_RNG@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
@@ -440,11 +441,13 @@ EXEEXT = @EXEEXT@
EXE_CFLAGS = @EXE_CFLAGS@
EXE_LDFLAGS = @EXE_LDFLAGS@
FGREP = @FGREP@
+FILECMD = @FILECMD@
FO2PDF = @FO2PDF@
GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
GMSGFMT = @GMSGFMT@
GMSGFMT_015 = @GMSGFMT_015@
GREP = @GREP@
+HTML_STYLESHEET = @HTML_STYLESHEET@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -476,12 +479,14 @@ LIBSELINUX = @LIBSELINUX@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
+LOGIND_CFLAGS = @LOGIND_CFLAGS@
LTLIBICONV = @LTLIBICONV@
LTLIBINTL = @LTLIBINTL@
LTLIBOBJS = @LTLIBOBJS@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
+MAN_STYLESHEET = @MAN_STYLESHEET@
MKDIR_P = @MKDIR_P@
MSGFMT = @MSGFMT@
MSGFMT_015 = @MSGFMT_015@
@@ -504,6 +509,7 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
+PDF_STYLESHEET = @PDF_STYLESHEET@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
@@ -514,12 +520,16 @@ SECUREDIR = @SECUREDIR@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
-STRINGPARAM_HMAC = @STRINGPARAM_HMAC@
+STRINGPARAM_PROFILECONDITIONS = @STRINGPARAM_PROFILECONDITIONS@
STRINGPARAM_VENDORDIR = @STRINGPARAM_VENDORDIR@
STRIP = @STRIP@
+SYSTEMD_CFLAGS = @SYSTEMD_CFLAGS@
+SYSTEMD_LIBS = @SYSTEMD_LIBS@
TIRPC_CFLAGS = @TIRPC_CFLAGS@
TIRPC_LIBS = @TIRPC_LIBS@
+TXT_STYLESHEET = @TXT_STYLESHEET@
USE_NLS = @USE_NLS@
+VENDOR_SCONFIGDIR = @VENDOR_SCONFIGDIR@
VERSION = @VERSION@
WARN_CFLAGS = @WARN_CFLAGS@
XGETTEXT = @XGETTEXT@
@@ -593,7 +603,8 @@ XMLS = README.xml pam_stress.8.xml
dist_check_SCRIPTS = tst-pam_stress
TESTS = $(dist_check_SCRIPTS)
securelibdir = $(SECUREDIR)
-secureconfdir = $(SCONFIGDIR)
+@HAVE_VENDORDIR_FALSE@secureconfdir = $(SCONFIGDIR)
+@HAVE_VENDORDIR_TRUE@secureconfdir = $(VENDOR_SCONFIGDIR)
AM_CFLAGS = -I$(top_srcdir)/libpam/include -I$(top_srcdir)/libpamc/include \
$(WARN_CFLAGS)
diff --git a/modules/pam_stress/README.xml b/modules/pam_stress/README.xml
index 6f94685e..cc7a1848 100644
--- a/modules/pam_stress/README.xml
+++ b/modules/pam_stress/README.xml
@@ -1,31 +1,19 @@
-<?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 pamstress SYSTEM "pam_stress.8.xml">
--->
-]>
+<article xmlns="http://docbook.org/ns/docbook" version="5.0">
-<article>
-
- <articleinfo>
+ <info>
<title>
- <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
- href="pam_stress.8.xml" xpointer='xpointer(//refnamediv[@id = "pam_stress-name"]/*)'/>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="pam_stress.8.xml" xpointer='xpointer(id("pam_stress-name")/*)'/>
</title>
- </articleinfo>
+ </info>
<section>
- <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
- href="pam_stress.8.xml" xpointer='xpointer(//refsect1[@id = "pam_stress-description"]/*)'/>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="pam_stress.8.xml" xpointer='xpointer(id("pam_stress-description")/*)'/>
</section>
<section>
- <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
- href="pam_stress.8.xml" xpointer='xpointer(//refsect1[@id = "pam_stress-options"]/*)'/>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="pam_stress.8.xml" xpointer='xpointer(id("pam_stress-options")/*)'/>
</section>
-</article>
+</article> \ No newline at end of file
diff --git a/modules/pam_stress/pam_stress.8 b/modules/pam_stress/pam_stress.8
index 2fdb9397..a522b7fb 100644
--- a/modules/pam_stress/pam_stress.8
+++ b/modules/pam_stress/pam_stress.8
@@ -1,13 +1,13 @@
'\" t
.\" Title: pam_stress
.\" Author: [see the "AUTHORS" section]
-.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\" Date: 09/03/2021
+.\" Generator: DocBook XSL Stylesheets v1.79.2 <http://docbook.sf.net/>
+.\" Date: 05/07/2023
.\" Manual: Linux-PAM Manual
-.\" Source: Linux-PAM Manual
+.\" Source: Linux-PAM
.\" Language: English
.\"
-.TH "PAM_STRESS" "8" "09/03/2021" "Linux-PAM Manual" "Linux-PAM Manual"
+.TH "PAM_STRESS" "8" "05/07/2023" "Linux\-PAM" "Linux\-PAM Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -37,52 +37,52 @@ pam_stress \- The stress\-testing PAM module
The pam_stress PAM module is mainly intended to give the impression of failing as a fully functioning module might\&.
.SH "OPTIONS"
.PP
-\fBdebug\fR
+debug
.RS 4
Put lots of information in syslog\&. *NOTE* this option writes passwords to syslog, so don\*(Aqt use anything sensitive when testing\&.
.RE
.PP
-\fBno_warn\fR
+no_warn
.RS 4
Do not give warnings about things (otherwise warnings are issued via the conversation function)
.RE
.PP
-\fBuse_first_pass\fR
+use_first_pass
.RS 4
Do not prompt for a password, for pam_sm_authentication function just use item PAM_AUTHTOK\&.
.RE
.PP
-\fBtry_first_pass\fR
+try_first_pass
.RS 4
Do not prompt for a password unless there has been no previous authentication token (item PAM_AUTHTOK is NULL)
.RE
.PP
-\fBrootok\fR
+rootok
.RS 4
This is intended for the pam_sm_chauthtok function and it instructs this function to permit root to change the user\*(Aqs password without entering the old password\&.
.RE
.PP
-\fBexpired\fR
+expired
.RS 4
An argument intended for the account and chauthtok module parts\&. It instructs the module to act as if the user\*(Aqs password has expired
.RE
.PP
-\fBfail_1\fR
+fail_1
.RS 4
This instructs the module to make its first function fail\&.
.RE
.PP
-\fBfail_2\fR
+fail_2
.RS 4
This instructs the module to make its second function (if there is one) fail\&.
.RE
.PP
-\fBprelim\fR
+prelim
.RS 4
For pam_sm_chauthtok, means fail on PAM_PRELIM_CHECK\&.
.RE
.PP
-\fBrequired\fR
+required
.RS 4
For pam_sm_chauthtok, means fail if the user hasn\*(Aqt already been authenticated by this module\&. (See stress_new_pwd data string in the NOTES\&.)
.RE
diff --git a/modules/pam_stress/pam_stress.8.xml b/modules/pam_stress/pam_stress.8.xml
index 98888b1c..617b7aae 100644
--- a/modules/pam_stress/pam_stress.8.xml
+++ b/modules/pam_stress/pam_stress.8.xml
@@ -1,16 +1,13 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
- "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
-
-<refentry id='pam_stress'>
+<refentry xmlns="http://docbook.org/ns/docbook" version="5.0" xml:id="pam_stress">
<refmeta>
<refentrytitle>pam_stress</refentrytitle>
<manvolnum>8</manvolnum>
- <refmiscinfo class='setdesc'>Linux-PAM Manual</refmiscinfo>
+ <refmiscinfo class="source">Linux-PAM</refmiscinfo>
+ <refmiscinfo class="manual">Linux-PAM Manual</refmiscinfo>
</refmeta>
- <refnamediv id='pam_stress-name'>
+ <refnamediv xml:id="pam_stress-name">
<refname>pam_stress</refname>
<refpurpose>The stress-testing PAM module</refpurpose>
</refnamediv>
@@ -18,42 +15,42 @@
<!-- body begins here -->
<refsynopsisdiv>
- <cmdsynopsis id="pam_stress-cmdsynopsis">
+ <cmdsynopsis xml:id="pam_stress-cmdsynopsis" sepchar=" ">
<command>pam_stress.so</command>
- <arg choice="opt">
+ <arg choice="opt" rep="norepeat">
debug
</arg>
- <arg choice="opt">
+ <arg choice="opt" rep="norepeat">
no_warn
</arg>
- <arg choice="opt">
+ <arg choice="opt" rep="norepeat">
use_first_pass
</arg>
- <arg choice="opt">
+ <arg choice="opt" rep="norepeat">
try_first_pass
</arg>
- <arg choice="opt">
+ <arg choice="opt" rep="norepeat">
rootok
</arg>
- <arg choice="opt">
+ <arg choice="opt" rep="norepeat">
expired
</arg>
- <arg choice="opt">
+ <arg choice="opt" rep="norepeat">
fail_1
</arg>
- <arg choice="opt">
+ <arg choice="opt" rep="norepeat">
fail_2
</arg>
- <arg choice="opt">
+ <arg choice="opt" rep="norepeat">
prelim
</arg>
- <arg choice="opt">
+ <arg choice="opt" rep="norepeat">
required
</arg>
</cmdsynopsis>
</refsynopsisdiv>
- <refsect1 id="pam_stress-description">
+ <refsect1 xml:id="pam_stress-description">
<title>DESCRIPTION</title>
<para>
The pam_stress PAM module is mainly intended to give the impression of failing as a fully
@@ -61,13 +58,13 @@ functioning module might.
</para>
</refsect1>
- <refsect1 id="pam_stress-options">
+ <refsect1 xml:id="pam_stress-options">
<title>OPTIONS</title>
<variablelist>
<varlistentry>
<term>
- <option>debug</option>
+ debug
</term>
<listitem>
<para>
@@ -79,7 +76,7 @@ functioning module might.
<varlistentry>
<term>
- <option>no_warn</option>
+ no_warn
</term>
<listitem>
<para>
@@ -91,7 +88,7 @@ functioning module might.
<varlistentry>
<term>
- <option>use_first_pass</option>
+ use_first_pass
</term>
<listitem>
<para>
@@ -103,7 +100,7 @@ functioning module might.
<varlistentry>
<term>
- <option>try_first_pass</option>
+ try_first_pass
</term>
<listitem>
<para>
@@ -115,7 +112,7 @@ functioning module might.
<varlistentry>
<term>
- <option>rootok</option>
+ rootok
</term>
<listitem>
<para>
@@ -128,7 +125,7 @@ functioning module might.
<varlistentry>
<term>
- <option>expired</option>
+ expired
</term>
<listitem>
<para>
@@ -141,7 +138,7 @@ functioning module might.
<varlistentry>
<term>
- <option>fail_1</option>
+ fail_1
</term>
<listitem>
<para>
@@ -152,7 +149,7 @@ functioning module might.
<varlistentry>
<term>
- <option>fail_2</option>
+ fail_2
</term>
<listitem>
<para>
@@ -164,7 +161,7 @@ functioning module might.
<varlistentry>
<term>
- <option>prelim</option>
+ prelim
</term>
<listitem>
<para>
@@ -175,7 +172,7 @@ functioning module might.
<varlistentry>
<term>
- <option>required</option>
+ required
</term>
<listitem>
<para>
@@ -189,7 +186,7 @@ functioning module might.
</variablelist>
</refsect1>
- <refsect1 id="pam_stress-types">
+ <refsect1 xml:id="pam_stress-types">
<title>MODULE TYPES PROVIDED</title>
<para>
All module types (<option>auth</option>, <option>account</option>,
@@ -197,7 +194,7 @@ functioning module might.
</para>
</refsect1>
- <refsect1 id="pam_stress-return_values">
+ <refsect1 xml:id="pam_stress-return_values">
<title>RETURN VALUES</title>
<variablelist>
<varlistentry>
@@ -307,7 +304,7 @@ functioning module might.
</variablelist>
</refsect1>
- <refsect1 id='pam_stress-notes'>
+ <refsect1 xml:id="pam_stress-notes">
<title>NOTES</title>
<para>
This module uses the stress_new_pwd data string which tells
@@ -316,7 +313,7 @@ functioning module might.
</para>
</refsect1>
- <refsect1 id='pam_stress-examples'>
+ <refsect1 xml:id="pam_stress-examples">
<title>EXAMPLES</title>
<programlisting>
#%PAM-1.0
@@ -329,7 +326,7 @@ session required pam_stress.so
</programlisting>
</refsect1>
- <refsect1 id="pam_stress-see_also">
+ <refsect1 xml:id="pam_stress-see_also">
<title>SEE ALSO</title>
<para>
<citerefentry>
@@ -344,7 +341,7 @@ session required pam_stress.so
</para>
</refsect1>
- <refsect1 id="pam_stress-authors">
+ <refsect1 xml:id="pam_stress-authors">
<title>AUTHORS</title>
<para>
The pam_stress PAM module was developed by
@@ -353,4 +350,4 @@ session required pam_stress.so
Lucas Ramage &lt;ramage.lucas@protonmail.com&gt;.
</para>
</refsect1>
-</refentry>
+</refentry> \ No newline at end of file
diff --git a/modules/pam_stress/pam_stress.c b/modules/pam_stress/pam_stress.c
index 6c7a6251..b2c55586 100644
--- a/modules/pam_stress/pam_stress.c
+++ b/modules/pam_stress/pam_stress.c
@@ -18,6 +18,7 @@
#include <security/pam_modules.h>
#include <security/_pam_macros.h>
#include <security/pam_ext.h>
+#include "pam_inline.h"
/* ---------- */
@@ -240,7 +241,7 @@ int pam_sm_authenticate(pam_handle_t *pamh, int flags,
/* try to set password item */
retval = pam_set_item(pamh,PAM_AUTHTOK,pass);
- _pam_overwrite(pass); /* clean up local copy of password */
+ pam_overwrite_string(pass); /* clean up local copy of password */
free(pass);
pass = NULL;
if (retval != PAM_SUCCESS) {
@@ -432,7 +433,7 @@ int pam_sm_chauthtok(pam_handle_t *pamh, int flags,
return retval;
}
retval = pam_set_item(pamh, PAM_OLDAUTHTOK, pass);
- _pam_overwrite(pass);
+ pam_overwrite_string(pass);
free(pass);
pass = NULL;
if (retval != PAM_SUCCESS) {
@@ -495,7 +496,7 @@ int pam_sm_chauthtok(pam_handle_t *pamh, int flags,
if (strcmp(resp[i-2].resp,resp[i-1].resp)) {
/* passwords are not the same; forget and return error */
- _pam_drop_reply(resp, i);
+ pam_drop_response(resp, i);
if (!(flags & PAM_SILENT) && !(ctrl & PAM_ST_NO_WARN)) {
pmsg[0] = &msg[0];
@@ -505,7 +506,7 @@ int pam_sm_chauthtok(pam_handle_t *pamh, int flags,
resp = NULL;
(void) converse(pamh,1,pmsg,&resp);
if (resp) {
- _pam_drop_reply(resp, 1);
+ pam_drop_response(resp, 1);
}
}
return PAM_AUTHTOK_ERR;
@@ -523,7 +524,7 @@ int pam_sm_chauthtok(pam_handle_t *pamh, int flags,
retval = PAM_SYSTEM_ERR;
}
- _pam_drop_reply(resp, i); /* clean up the passwords */
+ pam_drop_response(resp, i); /* clean up the passwords */
} else {
pam_syslog(pamh, LOG_ERR,
"pam_sm_chauthtok: this must be a Linux-PAM error");