Commit Graph

232 Commits

Author SHA1 Message Date
Yaakov Selkowitz
37b416c152 doc: make PDF documentation optional
While building any documentation requires xsltproc, only the PDF
documentation requires fop, which is dependency-heavy, and not always
available (e.g. it is not included in RHEL).  This allows the HTML
documentation to be built while skipping the PDFs.
2024-11-05 08:54:03 -05:00
root
df46458bee padout: build as a native executable
Add 'native: true' to the build config of padout.

Resolves: https://github.com/linux-pam/linux-pam/issues/850
Signed-off-by: Sietse <sietse@wizdom.nu>
2024-11-03 13:27:19 +00:00
Dmitry V. Levin
613e59dca7 build: drop autotools support
There is no point in supporting two different build systems.
2024-10-23 08:00:00 +00:00
Andrey Kovalev
43bdb7ce04 pam_get_authtok*: disallow setting pamh to NULL
This also prevents a potential NULL pointer dereference in
pam_get_authtok_internal and pam_get_authtok_verify when
the pamh argument they access is set to NULL.
2024-10-18 08:00:00 +00:00
Dmitry V. Levin
7fb6beed01 meson: build Linux-PAM using meson
On my non-representative hardware, the full build using autotools
(./autogen.sh && CFLAGS=-O2 ./configure && make -j`nproc` && make -j`nproc` install)
takes about 45 seconds.

On the same hardware, the full build using meson
(meson setup -Doptimization=2 dir && meson compile -C dir && meson install -C dir)
takes just about 7.5 seconds.
2024-09-10 08:00:00 +00:00
Dmitry V. Levin
aa3e91322c Remove unused .gitignore file
doc/specs/formatter/.gitignore became irrelevant along with the whole
doc/specs/formatter directory after commit
96eb2dc401 back in 2005.
2024-09-10 08:00:00 +00:00
Dmitry V. Levin
214e97e115 build: consistently include config.h unconditionally
Given that in most places config.h is included unconditionally,
there is no point in keeping remaining HAVE_CONFIG_H checks.

Public header files do not use config.h and therefore
are not affected by this change anyway.
2024-08-28 08:00:00 +00:00
Dmitry V. Levin
d2536800c5 doc: remove unused custom-html.xsl
* doc/custom-html.xsl.in: Remove.
* configure.ac: Do not generate doc/custom-html.xsl file.
* doc/.gitignore: Remove custom-html.xsl.
* doc/Makefile.am (DISTCLEANFILES): Remove custom-html.xsl.
(EXTRA_DIST): Remove custom-html.xsl.in.

Complements: cf2fc5ff7b ("doc: Update PAM documentation from DockBook 4 to DocBook 5")
2024-08-24 08:00:00 +00:00
Dmitry V. Levin
7b87f9fe57 doc: fix pam_get_data manual regarding PAM_NO_MODULE_DATA return value
pam_get_data manual page used to claim that PAM_NO_MODULE_DATA is
returned not only when no module specific data is present but also
when there is a corresponding data entry with NULL value.

As this claim is in contradiction with the implementation and with the
pam manual page, fix pam_get_data manual page.

* doc/man/pam_get_data.3.xml (PAM_NO_MODULE_DATA): Sync with
the implementation and with the pam manual page.

Resolves: https://github.com/linux-pam/linux-pam/pull/780
2024-04-03 08:00:00 +00:00
Aura Herrero Ruiz
88eccaedc6 doc: fix uses of non-neutral gender pronouns 2024-04-02 14:00:00 +00:00
Christian Göttsche
1c879809cf doc: do not clean bootstrapped files
The two files custom-html.xsl and custom-man.xsl are created at
configure time.  Only delete them on `make distclean` instead of
`make clean` to be able to re-generate manual pages afterwards.

Fixes: b285afe0ea ("doc: remove generated files during cleanup")
2024-01-16 14:23:02 +00:00
Tobias Stoeckmann
b285afe0ea doc: remove generated files during cleanup
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2024-01-12 18:01:04 +01:00
Tobias Stoeckmann
8c7c3901c9 doc: remove unneeded test statement
Since pam.d.5 is a generated file, the test for existence in srcdir can
be removed.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2024-01-12 18:01:04 +01:00
Tobias Stoeckmann
2b8895da5e treewide: strictly separate builddir and srcdir
Building outside of source directory fails if --disable-doc is not
explicitly chosen.

This happens because generated files are sometimes expected in the
source directory, where they won't exist.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2024-01-12 18:01:01 +01:00
Tobias Stoeckmann
c633ceb1b8 doc: Fix grammar mistake in Linux-PAM-ADG.xml
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2024-01-05 23:36:44 +00:00
Tobias Stoeckmann
0fb2978d0e treewide: fix typos in comments and documentation
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2023-12-18 09:10:08 +00:00
Dmitry V. Levin
954234f0a4 treewide: assume free(NULL) is no-op
The C standard guarantees that if the argument of free() is a null
pointer, no action occurs.
2023-12-14 08:00:00 +00:00
Dmitry V. Levin
2cae0f5c67 pam_canonicalize_user: new module to canonicalize user name
This module uses the name of the user obtained via pam_get_user(3)
as a key to query the password database, and replaces PAM_USER
with the pw_name value that has been returned.

The main usage scenario is systems where a user name is used in several
distinct authentication systems, some of them being case sensitive while
others are not.

* configure.ac (AC_CONFIG_FILES): Add
modules/pam_canonicalize_user/Makefile.
* doc/sag/pam_canonicalize_user.xml: New file.
* doc/sag/Linux-PAM_SAG.xml: Add a reference to
pam_canonicalize_user.xml.
* modules/Makefile.am (SUBDIRS): Add pam_canonicalize_user.
* modules/pam_canonicalize_user/Makefile.am: New file.
* modules/pam_canonicalize_user/README.xml: New file.
* modules/pam_canonicalize_user/pam_canonicalize_user.8.xml: New file.
* modules/pam_canonicalize_user/pam_canonicalize_user.c: New file.
* modules/pam_canonicalize_user/tst-pam_canonicalize_user: New file.
2023-11-14 23:25:00 +00:00
Luca Boccassi
52c04fea33 man: clarify PAM_DATA_SILENT in pam_set_data.3
pam_end.3 has additional and important information about PAM_DATA_SILENT,
copy it to pam_set_data.3 since that describes the cleanup callback where
it will be set.
2023-04-20 14:10:06 +01:00
Thorsten Kukuk
9c0965b188 doc: Include custom-html.xsl.in and custom-man.xsl.in
doc/Makefile.am: Replace custom-html.xsl and custom-man.xsl with
                 custom-html.xsl.in and custom-man.xsl.in EXTRA_DIST
2023-04-04 19:32:08 +02:00
Thorsten Kukuk
34b062d311 manual pages: document usage of $DISPLAY and PAM_TTY
man/pam_item_types_std.inc.xml: In the past, PAM_TTY was used for tty
devices and $DISPLAY variables for X-based applications. With the
introduction of PAM_DISPLAY PAM_TTY should only be used for devices.
2023-03-14 08:44:41 +01:00
Thorsten Kukuk
6b49cfcfe6 manual pages: enhance pam.d documentation
Make /usr/lib/pam.d and <vendordir>/pam.d more visible in the standard
manual pages, so that people don't assume there is only /etc/pam.d

* doc/man/pam.8.xml: Don't always speak about /etc/pam.d only
* doc/man/pam.conf-desc.xml: Don't always speak about /etc/pam.d only
* doc/man/pam.conf-dir.xml: Explain search path for pam config files
* doc/man/pam.conf.5.xml: Add filelist with all pam.d directories
2023-02-17 15:28:44 +01:00
Stefan Schubert
cf2fc5ff7b doc: Update PAM documentation from DockBook 4 to DocBook 5
Changed files
--------------

Make.xml.rules.in:
- Using RNG file instead of DTD file for checking XML files.
- Taking the correct stylesheet for README files.

doc/sag/Makefile.am, doc/adg/Makefile.am, doc/mwg/Makefile.am:
- Using RNG file instead of DTD file for checking XML files.

configure.ac:
- Adding a new option for selecting RNG check file (-enable-docbook-rng)
- Switching stylesheets to docbook 5
- Checking DocBook 5 environment instead of DocBook 4 environment

*.xml:
Update from DockBook 4 to DocBook 5
2022-12-16 10:31:37 +01:00
Thorsten Kukuk
5c1d6301fe doc/man/Makefile.am: fix XMLS list
The XMLS list of xml sources for the manual pages missed some xml files
and instead contained some nroff sources.
2022-12-06 22:57:40 +01:00
Stefan Schubert
3790bd4aa3 doc: make stylesheets configurable
Before this change, all stylesheets were hardcoded.
With this change, stylesheets can be defined at configure stage.

* configure.ac: Add new options to configure stylesheets:
--enable-html-stylesheet=FILE
--enable-txt-stylesheet=FILE
--enable-pdf-stylesheet=FILE
--enable-man-stylesheet=FILE
* doc/custom-html.xsl: Rename to doc/custom-html.xsl.in, parametrize html
stylesheet.
* doc/custom-man.xsl: Rename to doc/custom-man.xsl.in, parametrize man
stylesheet.
* doc/.gitignore: Add custom-man.xsl and custom-html.xsl.
* doc/adg/Makefile.am: Use stylesheet variables.
* doc/mwg/Makefile.am: Likewise.
* doc/sag/Makefile.am: Likewise.

Resolves: https://github.com/linux-pam/linux-pam/pull/499
2022-10-27 12:12:17 +00:00
liaohanqin
bee5908d2e doc: add pam_faillock module to SAG 2022-05-24 15:45:03 +00:00
Thorsten Kukuk
04109c25a7
Only include vendordir in manual page if set (#401) 2021-11-02 11:46:24 +01:00
Thorsten Kukuk
00a46bcead
Include pam_xauth_data.3.xml in source archive (#400) 2021-11-02 11:45:59 +01:00
Iker Pedrosa
b3bb13e18a pam_timestamp: replace hmac implementation
sha1 is no longer recommended as a cryptographic algorithm for
authentication. Thus, the idea of this change is to replace the
implementation provided by hmacsha1 included in pam_timestamp module by
the one in the openssl library. This way, there's no need to maintain
the cryptographic algorithm implementation and it can be easily changed
with a single configuration change.

modules/pam_timestamp/hmac_openssl_wrapper.c: implement wrapper
functions around openssl's hmac implementation. Moreover, manage the key
generation and its read and write in a file. Include an option to
configure the cryptographic algorithm in login.defs file.
modules/pam_timestamp/hmac_openssl_wrapper.h: likewise.
modules/pam_timestamp/pam_timestamp.c: replace calls to functions
provided by hmacsha1 by functions provided by openssl's wrapper.
configure.ac: include openssl dependecy if it is enabled.
modules/pam_timestamp/Makefile.am: include new files and openssl library
to compilation.
ci/install-dependencies.sh: include openssl library to dependencies.
NEWS: add new item to next release.
Make.xml.rules.in: add stringparam profiling for hmac
doc/custom-man.xsl: change import docbook to one with profiling
modules/pam_timestamp/pam_timestamp.8.xml: add conditional paragraph to
indicate the value in /etc/login.defs that holds the value for the
encryption algorithm

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1947294
2021-06-14 09:02:16 +02:00
Jeff Squyres
d62120ed7c pam.conf: clarify default action for unspecified return codes
Add short blurbs explaining that if a return code is not specified in
the "[value1=action1 value2=action2 ...]" form and "default=action" is
not specified, that return code's action defaults to "bad".

Signed-off-by: Jeff Squyres <jsquyres@cisco.com>
2021-05-24 08:43:38 +02:00
Hasan
82288cd815 man: fix spelling bug in pam_end.3.xml
* doc/man/pam_end.3.xml: Fix repeated words.
2021-05-01 21:01:45 +00:00
Tomas Mraz
017c3ff13d Clarify the effect of 'done' in documentation
The done action does not terminate the stack processing in case
there is a failing module with bad action up in the stack.

Fixes #307

* doc/man/pam.conf-syntax.xml: Clarify the effect of 'done'.
2020-12-07 16:22:41 +01:00
Dmitry V. Levin
709e37b7e1 Remove deprecated pam_tally and pam_tally2 modules
* ci/run-build-and-tests.sh (DISTCHECK_CONFIGURE_FLAGS): Remove
--enable-tally --enable-tally2.
* configure.ac: Remove --enable-tally and --enable-tally2 options.
(AM_CONDITIONAL): Remove COND_BUILD_PAM_TALLY and COND_BUILD_PAM_TALLY2.
(AC_CONFIG_FILES): Remove modules/pam_tally/Makefile and
modules/pam_tally2/Makefile.
* doc/sag/pam_tally.xml: Remove.
* doc/sag/pam_tally2.xml: Likewise.
* doc/sag/Linux-PAM_SAG.xml: Do not include pam_tally.xml and
pam_tally2.xml.
* modules/Makefile.am (MAYBE_PAM_TALLY, MAYBE_PAM_TALLY2): Remove.
(SUBDIRS): Remove MAYBE_PAM_TALLY and MAYBE_PAM_TALLY2.
* modules/pam_tally/.gitignore: Remove.
* modules/pam_tally/Makefile.am: Likewise.
* modules/pam_tally/README.xml: Likewise.
* modules/pam_tally/faillog.h: Likewise.
* modules/pam_tally/pam_tally.8.xml: Likewise.
* modules/pam_tally/pam_tally.c: Likewise.
* modules/pam_tally/pam_tally_app.c: Likewise.
* modules/pam_tally/tst-pam_tally: Likewise.
* modules/pam_tally2/.gitignore: Likewise.
* modules/pam_tally2/Makefile.am: Likewise.
* modules/pam_tally2/README.xml: Likewise.
* modules/pam_tally2/pam_tally2.8.xml: Likewise.
* modules/pam_tally2/pam_tally2.c: Likewise.
* modules/pam_tally2/pam_tally2_app.c: Likewise.
* modules/pam_tally2/tallylog.h: Likewise.
* modules/pam_tally2/tst-pam_tally2: Likewise.
* modules/pam_timestamp/pam_timestamp_check.8.xml: Fix typo by replacing
pam_tally with pam_timestamp.
* po/POTFILES.in: Remove ./modules/pam_tally/pam_tally_app.c,
./modules/pam_tally/pam_tally.c, ./modules/pam_tally2/pam_tally2_app.c,
and ./modules/pam_tally2/pam_tally2.c.
* NEWS: Document this change.
2020-10-29 08:00:00 +00:00
Dmitry V. Levin
d702ff714c Remove deprecated pam_cracklib module
* ci/install-dependencies.sh: Remove libcrack2-dev.
* ci/run-build-and-tests.sh (DISTCHECK_CONFIGURE_FLAGS): Remove
--enable-cracklib=check.
* conf/pam.conf: Remove references to pam_cracklib.so.
* configure.ac: Remove --enable-cracklib option.
(AC_SUBST): Remove LIBCRACK.
(AM_CONDITIONAL): Remove COND_BUILD_PAM_CRACKLIB.
(AC_CONFIG_FILES): Remove modules/pam_cracklib/Makefile.
* doc/sag/pam_cracklib.xml: Remove.
* doc/sag/Linux-PAM_SAG.xml: Do not include pam_cracklib.xml.
* modules/Makefile.am (MAYBE_PAM_CRACKLIB): Remove.
(SUBDIRS): Remove MAYBE_PAM_CRACKLIB.
* modules/pam_cracklib/Makefile.am: Remove.
* modules/pam_cracklib/README.xml: Likewise.
* modules/pam_cracklib/pam_cracklib.8.xml: Likewise.
* modules/pam_cracklib/pam_cracklib.c: Likewise.
* modules/pam_cracklib/tst-pam_cracklib: Likewise.
* xtests/tst-pam_cracklib1.c: Likewise.
* xtests/tst-pam_cracklib1.pamd: Likewise.
* xtests/tst-pam_cracklib2.c: Likewise.
* xtests/tst-pam_cracklib2.pamd: Likewise.
* modules/pam_pwhistory/pam_pwhistory.8.xml: Replace pam_cracklib
in examples with pam_passwdqc.
* modules/pam_unix/pam_unix.8.xml: Likewise.
* po/POTFILES.in: Remove ./modules/pam_cracklib/pam_cracklib.c.
* xtests/.gitignore: Remove tst-pam_cracklib1 and tst-pam_cracklib2.
* xtests/Makefile.am (EXTRA_DIST): Remove tst-pam_cracklib1.pamd
and tst-pam_cracklib2.pamd.
(XTESTS): Remove tst-pam_cracklib1 and tst-pam_cracklib2.
* NEWS: Document this change.
2020-10-29 08:00:00 +00:00
Dmitry V. Levin
54cf7a2398 .gitignore: move doc-specific entries to doc/.gitignore 2020-06-26 22:00:00 +00:00
Dmitry V. Levin
2e16ac35a0 doc: fix the description of stack jump effects
Every stack jump, besides the jump itself, has a side effect which is
one of 'ignore', 'ok', or 'bad'.  Unfortunately, the side effect is far
from obvious because it depends on the PAM function call, and the
documentation that contradicts the implementation does not help either.

* doc/man/pam.conf-syntax.xml (actionN): Rewrite the description
of stack jump effects to match the implementation.

Fixes: 871a6e14d6
2020-05-17 23:59:12 +00:00
Dmitry V. Levin
ee296a1093 man: document other valid pam_get_user return values
* doc/man/pam_get_user.3.xml (pam_get_user-return_values): Add
PAM_BUF_ERR, PAM_ABORT, and PAM_CONV_AGAIN.
2020-05-06 14:00:06 +00:00
Dmitry V. Levin
3c10a035c9 doc: remove references to PAM_SM_* macros
Starting with commit a684595c0b aka
Linux-PAM-1.3.0~14 (Remove "--enable-static-modules" option and support
from Linux-PAM), PAM_SM_* macros have no effect.
2020-05-03 12:21:11 +00:00
Tomas Mraz
925af12f8a pam_faillock: New module for locking after multiple auth failures 2020-04-30 09:42:45 +02:00
Dmitry V. Levin
ea951fdc86 build: rework vendordir substitution
Since Make.xml.rules is the only place where XSLTPROC_CUSTOM was used,
remove stereotypic definitions from other Makefiles, this way we no
longer have to worry about vendordir being used somewhere else in
documentation files.

Likewise, define VENDORDIR in config.h and remove stereotypic
-DVENDORDIR= additions from other Makefiles, this way we no longer
have to worry about VENDORDIR being used somewhere else in the code.

* configure.ac (AM_CONDITIONAL): Remove HAVE_VENDORDIR.
(AC_DEFINE_UNQUOTED): Add VENDORDIR.
(AC_SUBST): Remove VENDORDIR, add STRINGPARAM_VENDORDIR.
* Make.xml.rules.in: Replace $(XSLTPROC_CUSTOM) with
@STRINGPARAM_VENDORDIR@.
* doc/man/Makefile.am (XSLTPROC_CUSTOM): Remove.
* libpam/Makefile.am [HAVE_VENDORDIR]: Remove.
* modules/pam_securetty/Makefile.am [HAVE_VENDORDIR]: Remove.
(XSLTPROC_CUSTOM): Remove.
* modules/pam_securetty/pam_securetty.c: Move definitions of local
macros after config.h to benefit from macros defined there.
2020-04-28 10:10:08 +00:00
Sven Hartge
192611c6fb pam_setquota: new module to set or modify disk quotas on session start
This makes disk quotas usable with central user databases, such as MySQL or
LDAP.

Resolves: https://github.com/linux-pam/linux-pam/issues/92
2020-04-17 02:16:27 +02:00
Dmitry V. Levin
897c7412b2 Fix various typos found using codespell tool 2020-03-28 18:19:41 +00:00
Tomas Mraz
7a84910896 New API call pam_start_confdir()
To load PAM stack configurations from specified directory
2020-03-06 08:50:12 +01:00
Dmitry V. Levin
69097289e5 Fix whitespace issues
Remove trailing whitespace introduced by commit
f9c9c72121.
Remove blank lines at EOF introduced by commit
65d6735c59.

This makes the project free of warnings reported by
git diff --check 4b825dc642 HEAD

* doc/custom-html.xsl: Remove blank line at EOF.
* doc/custom-man.xsl: Likewise.
* modules/pam_motd/pam_motd.c: Remove trailing whitespace.
2020-03-05 00:58:23 +00:00
Steve Langasek
aea5d57019 Further grammar fixes
Signed-off-by: Russ Allbery <rra@debian.org>

Bug-Debian: https://bugs.debian.org/651560
2020-01-15 18:14:44 +01:00
Steve Langasek
7e15186e3e Miscellaneous spelling fixes 2020-01-15 18:14:44 +01:00
Steve Langasek
375825bd5d Miscellaneous grammar fixes 2020-01-15 18:14:44 +01:00
Tomas Mraz
1781f0165c Do not use CFLAGS for warning flags set from configure
To be able to set CFLAGS from make command-line but not to lose the
warning flags.

* configure.ac: Put warning flags to WARN_CFLAGS instead of CFLAGS.
* */Makefile.am: Apply WARN_CFLAGS to AM_CFLAGS.
2019-12-18 13:59:44 +01:00
Tomas Mraz
03f46bbe3f Fix or suppress various warnings when compiling with -Wall -Wextra
* conf/pam_conv1/Makefile.am: Add -Wno-unused-function -Wno-sign-compare to CFLAGS.
* doc/specs/Makefile.am: Likewise.

* libpamc/include/security/pam_client.h: Explicitly compare old_p with NULL.

* modules/pam_access/pam_access.c: Avoid double const.

* modules/pam_filter/pam_filter.c: Avoid arbitrary constants. Avoid strncpy()
without copying the NUL byte.

* modules/pam_group/pam_group.c: Mark switch fallthrough with comment.
* modules/pam_time/pam_time.c: Likewise.

* modules/pam_limits/pam_limits.c: Remove unused units variable.

* modules/pam_listfile/pam_listfile.c: Avoid unnecessary strncpy, use pointers.

* modules/pam_rootok/pam_rootok.c (log_callback): Mark unused parameter.

* modules/pam_selinux/pam_selinux.c: Use string_to_security_class() instead
of hardcoded value.

* modules/pam_sepermit/pam_sepermit.c: Properly cast when comparing.

* modules/pam_succeed_if/pam_succeed_if.c: Mark unused parameters.

* modules/pam_unix/pam_unix_passwd.c: Remove unused variables and properly
cast for comparison.

* modules/pam_unix/support.c: Remove unused function.
2019-12-16 10:49:03 +01:00
MIZUTA Takeshi
3419569e8e doc: fix typo in manpage 2019-10-08 08:50:51 +02:00