From ddad2fc296bc353265004c5ec3700a7a921888bb Mon Sep 17 00:00:00 2001 From: Russ Allbery Date: Tue, 14 Sep 2021 20:30:22 -0700 Subject: Fix localization of RSS dates MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix unintended localization of dates in RSS output, which are supposed to be RFC 2822 dates and therefore always use English month and day of week names. Thanks to Slaven Rezić for testing. --- Changes | 6 ++++++ README | 1 + README.md | 1 + docs/docknot.yaml | 1 + lib/App/DocKnot/Command.pm | 12 ++++++------ lib/App/DocKnot/Spin/RSS.pm | 11 +++++++---- t/data/generate/docknot/output/thread | 1 + 7 files changed, 23 insertions(+), 10 deletions(-) diff --git a/Changes b/Changes index bb48b43..948113f 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,11 @@ Revision history for DocKnot +5.01 - Not Released + + - Fix unintended localization of dates in RSS output, which are supposed + to be RFC 2822 dates and therefore always use English month and day of + week names. Thanks to Slaven Rezić for testing. + 5.00 - 2021-09-12 - Merge spin and spin-rss into this package, making it a full, if highly diff --git a/README b/README index 505a714..ba04a75 100644 --- a/README +++ b/README @@ -51,6 +51,7 @@ REQUIREMENTS Perl 5.24 or later and Module::Build are required to build this module. The following additional Perl modules are required to use it: + * Date::Language (part of TimeDate) * Date::Parse (part of TimeDate) * File::BaseDir * File::ShareDir diff --git a/README.md b/README.md index 8be94ad..8d1342e 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,7 @@ for your own purposes. Perl 5.24 or later and Module::Build are required to build this module. The following additional Perl modules are required to use it: +* Date::Language (part of TimeDate) * Date::Parse (part of TimeDate) * File::BaseDir * File::ShareDir diff --git a/docs/docknot.yaml b/docs/docknot.yaml index bf85a81..12b9eb7 100644 --- a/docs/docknot.yaml +++ b/docs/docknot.yaml @@ -124,6 +124,7 @@ requirements: | Perl 5.24 or later and Module::Build are required to build this module. The following additional Perl modules are required to use it: + * Date::Language (part of TimeDate) * Date::Parse (part of TimeDate) * File::BaseDir * File::ShareDir diff --git a/lib/App/DocKnot/Command.pm b/lib/App/DocKnot/Command.pm index 093d0b5..50da1cc 100644 --- a/lib/App/DocKnot/Command.pm +++ b/lib/App/DocKnot/Command.pm @@ -293,12 +293,12 @@ App::DocKnot::Command - Run DocKnot commands =head1 REQUIREMENTS -Perl 5.24 or later and the modules Date::Parse (part of TimeDate), -File::BaseDir, File::ShareDir, Git::Repository, Image::Size, IO::Compress::Xz -(part of IO-Compress-Lzma), IO::Uncompress::Gunzip (part of IO-Compress), -IPC::Run, IPC::System::Simple, JSON::MaybeXS, Kwalify, List::SomeUtils, -Perl6::Slurp, Template (part of Template Toolkit), and YAML::XS, all of which -are available from CPAN. +Perl 5.24 or later and the modules Date::Language, Date::Parse (both part of +TimeDate), File::BaseDir, File::ShareDir, Git::Repository, Image::Size, +IO::Compress::Xz (part of IO-Compress-Lzma), IO::Uncompress::Gunzip (part of +IO-Compress), IPC::Run, IPC::System::Simple, JSON::MaybeXS, Kwalify, +List::SomeUtils, Perl6::Slurp, Template (part of Template Toolkit), and +YAML::XS, all of which are available from CPAN. =head1 DESCRIPTION diff --git a/lib/App/DocKnot/Spin/RSS.pm b/lib/App/DocKnot/Spin/RSS.pm index 7599426..dff4665 100644 --- a/lib/App/DocKnot/Spin/RSS.pm +++ b/lib/App/DocKnot/Spin/RSS.pm @@ -18,6 +18,7 @@ use warnings; use App::DocKnot; use App::DocKnot::Spin::Thread; use Cwd qw(getcwd); +use Date::Language (); use Date::Parse qw(str2time); use File::Basename qw(fileparse); use Perl6::Slurp qw(slurp); @@ -405,8 +406,9 @@ sub _rss_output { # Determine the current date and latest publication date of all of the # entries, published in the obnoxious format used by RSS. + my $lang = Date::Language->new('English'); my $format = '%a, %d %b %Y %H:%M:%S %z'; - my $now = strftime($format, localtime()); + my $now = $lang->strftime($format, [localtime()]); my $latest = $now; if ($entries_ref->@*) { $latest = strftime($format, localtime($entries_ref->[0]{date})); @@ -439,7 +441,7 @@ EOC # Output each entry, formatting the contents of the entry as we go. for my $entry_ref ($entries_ref->@*) { - my $date = strftime($format, localtime($entry_ref->{date})); + my $date = $lang->strftime($format, [localtime($entry_ref->{date})]); my $title = _escape($entry_ref->{title}); my $description; if ($entry_ref->{description}) { @@ -813,8 +815,9 @@ App::DocKnot::Spin::RSS - Generate RSS and thread from a feed description file =head1 REQUIREMENTS -Perl 5.006 or later and the modules Date::Parse (part of the TimeDate -distribution) and Perl6::Slurp, both of which are available from CPAN. +Perl 5.006 or later and the modules Date::Language, Date::Parse (both part of +the TimeDate distribution), and Perl6::Slurp, both of which are available from +CPAN. =head1 DESCRIPTION diff --git a/t/data/generate/docknot/output/thread b/t/data/generate/docknot/output/thread index f2044cd..6806bbf 100644 --- a/t/data/generate/docknot/output/thread +++ b/t/data/generate/docknot/output/thread @@ -104,6 +104,7 @@ for your own purposes. Perl 5.24 or later and Module::Build are required to build this module. The following additional Perl modules are required to use it: +\bullet(packed)[Date::Language (part of TimeDate)] \bullet(packed)[Date::Parse (part of TimeDate)] \bullet(packed)[File::BaseDir] \bullet(packed)[File::ShareDir] -- cgit v1.2.3 From ce7d21a2aefcf809953ac1d57b429acce90831aa Mon Sep 17 00:00:00 2001 From: Russ Allbery Date: Tue, 14 Sep 2021 21:02:58 -0700 Subject: Set locale to C in some tests The generated changes file intentionally uses the localized month name for headings, so set the locale to C in the tests that involve it for reproducible test output. --- t/cli/spin.t | 6 ++++++ t/spin/tree.t | 7 ++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/t/cli/spin.t b/t/cli/spin.t index 434cbb5..674047f 100755 --- a/t/cli/spin.t +++ b/t/cli/spin.t @@ -17,6 +17,7 @@ use Cwd qw(getcwd realpath); use File::Copy::Recursive qw(dircopy); use File::Spec (); use File::Temp (); +use POSIX qw(LC_ALL setlocale); use Test::RRA qw(is_file_contents); use Test::DocKnot::Spin qw(is_spin_output is_spin_output_tree); @@ -25,6 +26,11 @@ use Test::More; # Load the module. BEGIN { use_ok('App::DocKnot::Command') } +# Force the C locale because some of the output intentionally uses localized +# month names and we have to force those to English for comparison of test +# results. +setlocale(LC_ALL, 'C'); + # Create the command-line parser. my $docknot = App::DocKnot::Command->new(); isa_ok($docknot, 'App::DocKnot::Command'); diff --git a/t/spin/tree.t b/t/spin/tree.t index a88d0d0..b3bf302 100755 --- a/t/spin/tree.t +++ b/t/spin/tree.t @@ -18,11 +18,16 @@ use File::Copy::Recursive qw(dircopy); use File::Spec (); use File::Temp (); use Perl6::Slurp qw(slurp); -use POSIX qw(strftime); +use POSIX qw(LC_ALL setlocale strftime); use Test::DocKnot::Spin qw(is_spin_output_tree); use Test::More; +# Force the C locale because some of the output intentionally uses localized +# month names and we have to force those to English for comparison of test +# results. +setlocale(LC_ALL, 'C'); + # Expected output when spinning our tree of input files. my $EXPECTED_OUTPUT = <<'OUTPUT'; Generating thread file .../changes.th -- cgit v1.2.3 From 6da6c2d35ce754452331e2d9ec511b80a30857a9 Mon Sep 17 00:00:00 2001 From: Russ Allbery Date: Sun, 17 Oct 2021 16:16:01 -0700 Subject: Fix stray indentation in thread output The addition of links to the developer section in the thread ouput for a package without separate API documentation was incorrectly indented due to a copy/paste error. Fix this. --- share/templates/thread.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/templates/thread.tmpl b/share/templates/thread.tmpl index d0c5990..7bfd907 100644 --- a/share/templates/thread.tmpl +++ b/share/templates/thread.tmpl @@ -193,7 +193,7 @@ Security advisories: [% END %][% END %] Developer documentation: [% FOREACH doc IN docs.developer %] - \doc[[% doc.name %].html][[% doc.title %]][% END %][% IF vcs.github %] +\doc[[% doc.name %].html][[% doc.title %]][% END %][% IF vcs.github %] \doc[https://github.com/[% vcs.github %]] [GitHub][% END %][% IF support.github %] \doc[https://github.com/[% support.github %]/issues] -- cgit v1.2.3 From 22ff9e7e3bc4c8ae61578888232d5d04719841d7 Mon Sep 17 00:00:00 2001 From: Russ Allbery Date: Sun, 17 Oct 2021 16:19:06 -0700 Subject: Update the pam-krb5 generate test Update to the latest version so that the generation of the to-do link for packages without API documentation is tested. --- t/data/generate/pam-krb5/docknot.yaml | 635 +++++++++++++++--------------- t/data/generate/pam-krb5/output/readme | 61 ++- t/data/generate/pam-krb5/output/readme-md | 67 ++-- t/data/generate/pam-krb5/output/thread | 30 +- 4 files changed, 432 insertions(+), 361 deletions(-) diff --git a/t/data/generate/pam-krb5/docknot.yaml b/t/data/generate/pam-krb5/docknot.yaml index cf4ce0b..2fd2dfd 100644 --- a/t/data/generate/pam-krb5/docknot.yaml +++ b/t/data/generate/pam-krb5/docknot.yaml @@ -1,15 +1,28 @@ +# Package metadata for pam-krb5. +# +# This file contains configuration for DocKnot used to generate +# documentation files (like README.md) and web pages. Other documentation +# in this package is generated automatically from these files as part of +# the release process. For more information, see DocKnot's documentation. +# +# DocKnot is available from . +# +# Copyright 2017, 2020-2021 Russ Allbery +# +# SPDX-License-Identifier: BSD-3-clause or GPL-1+ + format: v1 name: pam-krb5 maintainer: Russ Allbery -version: '4.8' +version: '4.11' synopsis: PAM module for Kerberos authentication license: name: BSD-3-clause-or-GPL-1+ copyrights: - holder: Russ Allbery - years: 2005-2010, 2014-2015, 2017 + years: 2005-2010, 2014-2015, 2017, 2020-2021 - holder: The Board of Trustees of the Leland Stanford Junior University years: 2009-2011 - holder: Andres Salomon @@ -24,25 +37,26 @@ build: kerberos: true manpages: true middle: | - The module will be installed in `/usr/local/lib/security` by default, - except on 64-bit versions of Linux which will use - `/usr/local/lib64/security` to match the default PAM configuration. You - can change the installation locations with the `--prefix`, `--mandir`, and - `--libdir` options to configure. The module will always be installed in a - subdirectory named `security` under the specified libdir. On Linux, use - `--prefix=/usr` to install the man page into `/usr/share/man` and the PAM - module in `/lib/security` or `/lib64/security`. + The module will be installed in `/usr/local/lib/security` by default, but + expect to have to override this using `--libdir`. The correct + installation path for PAM modules varies considerably between systems. + The module will always be installed in a subdirectory named `security` + under the specified value of `--libdir`. On Red Hat Linux, for example, + `--libdir=/usr/lib64` is appropriate to install the module into the system + PAM directory. On Debian's amd64 architecture, + `--libdir=/usr/lib/x86_64-linux-gnu` would be correct. reduced_depends: true type: Autoconf + valgrind: true distribution: packaging: debian: package: libpam-krb5 summary: | Debian packages are available from Debian in Debian 4.0 (etch) and - later releases as libpam-krb5 and libpam-heimdal. The former - packages are built against the MIT Kerberos libraries and the - latter against the Heimdal libraries. + later releases as libpam-krb5 and libpam-heimdal. The former packages + are built against the MIT Kerberos libraries and the latter against + the Heimdal libraries. section: kerberos tarname: pam-krb5 version: pam-krb5 @@ -54,6 +68,8 @@ vcs: browse: https://git.eyrie.org/?p=kerberos/pam-krb5.git github: rra/pam-krb5 openhub: https://www.openhub.net/p/pamkrb5 + status: + workflow: build type: Git url: https://git.eyrie.org/git/kerberos/pam-krb5.git @@ -66,6 +82,9 @@ quote: title: '"Look, ma, no hands!"' work: Salon advisories: + - date: 2020-03-30 + threshold: '4.9' + versions: 4.8 and earlier - date: 2009-02-11 threshold: '3.13' versions: 3.12 and earlier @@ -73,6 +92,9 @@ docs: user: - name: pam-krb5 title: Manual page + developer: + - name: todo + title: To-do list blurb: | pam-krb5 is a Kerberos PAM module for either MIT Kerberos or Heimdal. It @@ -88,33 +110,104 @@ blurb: | description: | pam-krb5 provides a Kerberos PAM module that supports authentication, user ticket cache handling, simple authorization (via .k5login or checking - Kerberos principals against local usernames), and password changing. It - can be configured through either options in the PAM configuration itself - or through entries in the system krb5.conf file, and it tries to work - around PAM implementation flaws in commonly-used PAM-enabled applications - such as OpenSSH and xdm. It supports both PKINIT and FAST to the extent - that the underlying Kerberos libraries support these features. + Kerberos principals against local usernames), and password changing. It can + be configured through either options in the PAM configuration itself or + through entries in the system krb5.conf file, and it tries to work around + PAM implementation flaws in commonly-used PAM-enabled applications such as + OpenSSH and xdm. It supports both PKINIT and FAST to the extent that the + underlying Kerberos libraries support these features. This is not the Kerberos PAM module maintained on Sourceforge and used on Red Hat systems. It is an independent implementation that, if it ever shared any common code, diverged long ago. It supports some features that the Sourceforge module does not (particularly around authorization), and does not support some options (particularly ones not directly related to - Kerberos) that it does. This module will never support Kerberos v4 or - AFS. For an AFS session module that works with this module (or any other - Kerberos PAM module), see + Kerberos) that it does. This module will never support Kerberos v4 or AFS. + For an AFS session module that works with this module (or any other Kerberos + PAM module), see [pam-afs-session](https://www.eyrie.org/~eagle/software/pam-afs-session/). If there are other options besides AFS and Kerberos v4 support from the Sourceforge PAM module that you're missing in this module, please let me know. +requirements: | + Either MIT Kerberos (or Kerberos implementations based on it) or Heimdal are + supported. MIT Keberos 1.3 or later may be required; this module has not + been tested with earlier versions. + + For PKINIT support, Heimdal 0.8rc1 or later or MIT Kerberos 1.6.3 or later + are required. Earlier MIT Kerberos 1.6 releases have a bug in their + handling of PKINIT options. MIT Kerberos 1.12 or later is required to use + the use_pkinit PAM option. + + For FAST (Flexible Authentication Secure Tunneling) support, MIT Kerberos + 1.7 or higher is required. For anonymous FAST support, anonymous + authentication (generally anonymous PKINIT) support is required in both the + Kerberos libraries and in the local KDC. + + This module should work on Linux and build with gcc or clang. It may still + work on Solaris and build with the Sun C compiler, but I have only tested it + on Linux recently. There is beta-quality support for the AIX NAS Kerberos + implementation that has not been tested in years. Other PAM implementations + will probably require some porting, although untested build system support + is present for FreeBSD, Mac OS X, and HP-UX. I personally can only test on + Linux and rely on others to report problems on other operating systems. + + Old versions of OpenSSH are known to call `pam_authenticate` followed by + `pam_setcred(PAM_REINITIALIZE_CRED)` without first calling + `pam_open_session`, thereby requesting that an existing ticket cache be + renewed (similar to what a screensaver would want) rather than requesting a + new ticket cache be created. Since this behavior is indistinguishable at + the PAM level from a screensaver, pam-krb5 when used with these old versions + of OpenSSH will refresh the ticket cache of the OpenSSH daemon rather than + setting up a new ticket cache for the user. The resulting ticket cache will + have the correct permissions (this is not a security concern), but will not + be named correctly or referenced in the user's environment and will be + overwritten by the next user login. The best solution to this problem is to + upgrade OpenSSH. I'm not sure exactly when this problem was fixed, but at + the very least OpenSSH 4.3 and later do not exhibit it. + +test: + lancaster: true + prefix: | + pam-krb5 comes with a comprehensive test suite, but it requires some + configuration in order to test anything other than low-level utility + functions. For the full test suite, you will need to have a running KDC + in which you can create two test accounts, one with admin access to the + other. Using a test KDC environment, if you have one, is recommended. + + Follow the instructions in `tests/config/README` to configure the test + suite. + + Now, you can run the test suite with: + suffix: | + The default libkadm5clnt library on the system must match the + implementation of your KDC for the module/expired test to work, since the + two kadmin protocols are not compatible. If you use the MIT library + against a Heimdal server, the test will be skipped; if you use the Heimdal + library against an MIT server, the test suite may hang. + + Several `module/expired` tests are expected to fail with Heimdal 1.5 due + to a bug in Heimdal with reauthenticating immediately after a + library-mediated password change of an expired password. This is fixed in + later releases of Heimdal. + + To run the full test suite, Perl 5.10 or later is required. The following + additional Perl modules will be used if present: + + * Test::Pod + * Test::Spelling + + All are available on CPAN. Those tests will be skipped if the modules are + not available. + sections: - title: Configuring body: | - Just installing the module does not enable it or change anything - about your system authentication configuration. To use the module - for all system authentication on Debian systems, put something like: + Just installing the module does not enable it or change anything about + your system authentication configuration. To use the module for all + system authentication on Debian systems, put something like: ``` auth sufficient pam_krb5.so minimum_uid=1000 @@ -135,42 +228,42 @@ sections: account required pam_unix.so ``` - in `/etc/pam.d/common-account`. The `minimum_uid` setting tells the - PAM module to pass on any users with a UID lower than 1000, thereby - bypassing Kerberos authentication for the root account and any - system accounts. You normally want to do this since otherwise, if - the network is down, the Kerberos authentication can time out and - make it difficult to log in as root and fix matters. This also - avoids problems with Kerberos principals that happen to match system - accounts accidentally getting access to those accounts. + in `/etc/pam.d/common-account`. The `minimum_uid` setting tells the PAM + module to pass on any users with a UID lower than 1000, thereby + bypassing Kerberos authentication for the root account and any system + accounts. You normally want to do this since otherwise, if the network + is down, the Kerberos authentication can time out and make it difficult + to log in as root and fix matters. This also avoids problems with + Kerberos principals that happen to match system accounts accidentally + getting access to those accounts. - Be sure to include the module in the session group as well as the - auth group. Without the session entry, the user's ticket cache will - not be created properly for ssh logins (among possibly others). + Be sure to include the module in the session group as well as the auth + group. Without the session entry, the user's ticket cache will not be + created properly for ssh logins (among possibly others). - If your users should normally all use Kerberos passwords - exclusively, putting something like: + If your users should normally all use Kerberos passwords exclusively, + putting something like: ``` password sufficient pam_krb5.so minimum_uid=1000 password required pam_unix.so try_first_pass obscure md5 ``` - in `/etc/pam.d/common-password` will change users' passwords in - Kerberos by default and then only fall back on Unix if that doesn't - work. (You can make this tighter by using the more complex - new-style PAM configuration.) If you instead want to synchronize - local and Kerberos passwords and change them both at the same time, - you can do something like: + in `/etc/pam.d/common-password` will change users' passwords in Kerberos + by default and then only fall back on Unix if that doesn't work. (You + can make this tighter by using the more complex new-style PAM + configuration.) If you instead want to synchronize local and Kerberos + passwords and change them both at the same time, you can do something + like: ``` password required pam_unix.so obscure sha512 password required pam_krb5.so use_authtok minimum_uid=1000 ``` - If you have multiple environments that you want to synchronize and - you don't want password changes to continue if the Kerberos password - change fails, use the `clear_on_fail` option. For example: + If you have multiple environments that you want to synchronize and you + don't want password changes to continue if the Kerberos password change + fails, use the `clear_on_fail` option. For example: ``` password required pam_krb5.so clear_on_fail minimum_uid=1000 @@ -178,19 +271,19 @@ sections: password required pam_smbpass.so use_authtok ``` - In this case, if `pam_krb5` cannot change the password (due to - password strength rules on the KDC, for example), it will clear the - stored password (because of the `clear_on_fail` option), and since - `pam_unix` and `pam_smbpass` are both configured with `use_authtok`, - they will both fail. `clear_on_fail` is not the default because it - would interfere with the more common pattern of falling back to - local passwords if the user doesn't exist in Kerberos. + In this case, if `pam_krb5` cannot change the password (due to password + strength rules on the KDC, for example), it will clear the stored + password (because of the `clear_on_fail` option), and since `pam_unix` + and `pam_smbpass` are both configured with `use_authtok`, they will both + fail. `clear_on_fail` is not the default because it would interfere + with the more common pattern of falling back to local passwords if the + user doesn't exist in Kerberos. - If you use a more complex configuration with the Linux PAM `[]` - syntax for the session and account groups, note that `pam_krb5` - returns a status of ignore, not success, if the user didn't log on - with Kerberos. You may need to handle that explicitly with - `ignore=ignore` in your action list. + If you use a more complex configuration with the Linux PAM `[]` syntax + for the session and account groups, note that `pam_krb5` returns a + status of ignore, not success, if the user didn't log on with Kerberos. + You may need to handle that explicitly with `ignore=ignore` in your + action list. There are many, many other possibilities. See the Linux PAM documentation for all the configuration options. @@ -200,19 +293,17 @@ sections: You can also use pam-krb5 only for specific services. In that case, modify the files in `/etc/pam.d` for that particular service to use - `pam_krb5.so` for authentication. For services that are using - passwords over TLS to authenticate users, you may want to use the - `ignore_k5login` and `no_ccache` options to the authenticate module. - `.k5login` authorization is only meaningful for local accounts and - ticket caches are usually (although not always) only useful for - interactive sessions. - - Configuring the module for Solaris is both simpler and less - flexible, since Solaris (at least Solaris 8 and 9, which are the - last versions of Solaris with which this module was extensively - tested) use a single `/etc/pam.conf` file that contains - configuration for all programs. For console login on Solaris, try - something like: + `pam_krb5.so` for authentication. For services that are using passwords + over TLS to authenticate users, you may want to use the `ignore_k5login` + and `no_ccache` options to the authenticate module. `.k5login` + authorization is only meaningful for local accounts and ticket caches + are usually (although not always) only useful for interactive sessions. + + Configuring the module for Solaris is both simpler and less flexible, + since Solaris (at least Solaris 8 and 9, which are the last versions of + Solaris with which this module was extensively tested) use a single + `/etc/pam.conf` file that contains configuration for all programs. For + console login on Solaris, try something like: ``` login auth sufficient /usr/local/lib/security/pam_krb5.so minimum_uid=100 @@ -223,70 +314,66 @@ sections: login session required /usr/lib/security/pam_unix_session.so.1 ``` - A similar configuration could be used for other services, such as - ssh. See the pam.conf(5) man page for more information. When using - this module with Solaris login (at least on Solaris 8 and 9), you - will probably also need to add `retain_after_close` to the PAM - configuration to avoid having the user's credentials deleted before - they are logged in. - - The Solaris Kerberos library reportedly does not support prompting - for a password change of an expired account during authentication. - Supporting password change for expired accounts on Solaris with - native Kerberos may therefore require setting the `defer_pwchange` - or `force_pwchange` option for selected login applications. See the - description and warnings about that option in the pam_krb5(5) man - page. - - Some configuration options may be put in the `krb5.conf` file used - by your Kerberos libraries (usually `/etc/krb5.conf` or + A similar configuration could be used for other services, such as ssh. + See the pam.conf(5) man page for more information. When using this + module with Solaris login (at least on Solaris 8 and 9), you will + probably also need to add `retain_after_close` to the PAM configuration + to avoid having the user's credentials deleted before they are logged + in. + + The Solaris Kerberos library reportedly does not support prompting for a + password change of an expired account during authentication. Supporting + password change for expired accounts on Solaris with native Kerberos may + therefore require setting the `defer_pwchange` or `force_pwchange` + option for selected login applications. See the description and + warnings about that option in the pam_krb5(5) man page. + + Some configuration options may be put in the `krb5.conf` file used by + your Kerberos libraries (usually `/etc/krb5.conf` or `/usr/local/etc/krb5.conf`) instead or in addition to the PAM configuration. See the man page for more details. - The Kerberos library, via pam-krb5, will prompt the user to change - their password if their password is expired, but when using OpenSSH, - this will only work when `ChallengeResponseAuthentication` is - enabled. Unless this option is enabled, OpenSSH doesn't pass PAM - messages to the user and can only respond to a simple password - prompt. - - If you are using MIT Kerberos, be aware that users whose passwords - are expired will not be prompted to change their password unless the - KDC configuration for your realm in `[realms]` in `krb5.conf` - contains a `master_kdc` setting or, if using DNS SRV records, you - have a DNS entry for `_kerberos-master` as well as `_kerberos`. + The Kerberos library, via pam-krb5, will prompt the user to change their + password if their password is expired, but when using OpenSSH, this will + only work when `ChallengeResponseAuthentication` is enabled. Unless + this option is enabled, OpenSSH doesn't pass PAM messages to the user + and can only respond to a simple password prompt. + + If you are using MIT Kerberos, be aware that users whose passwords are + expired will not be prompted to change their password unless the KDC + configuration for your realm in `[realms]` in `krb5.conf` contains a + `master_kdc` setting or, if using DNS SRV records, you have a DNS entry + for `_kerberos-master` as well as `_kerberos`. - title: Debugging body: | - The first step when debugging any problems with this module is to - add `debug` to the PAM options for the module (either in the PAM - configuration or in `krb5.conf`). This will significantly increase - the logging from the module and should provide a trace of exactly - what failed and any available error information. - - Many Kerberos authentication problems are due to configuration - issues in `krb5.conf`. If pam-krb5 doesn't work, first check that - `kinit` works on the same system. That will test your basic - Kerberos configuration. If the system has a keytab file installed - that's readable by the process doing authentication via PAM, make - sure that the keytab is current and contains a key for - `host/` where is the fully-qualified hostname. - pam-krb5 prevents KDC spoofing by checking the user's credentials - when possible, but this means that if a keytab is present it must be - correct or authentication will fail. You can check the keytab with - `klist -k` and `kinit -k`. - - Be sure that all libraries and modules, including PAM modules, - loaded by a program use the same Kerberos libraries. Sometimes - programs that use PAM, such as current versions of OpenSSH, also - link against Kerberos directly. If your sshd is linked against one - set of Kerberos libraries and pam-krb5 is linked against a different - set of Kerberos libraries, this will often cause problems (such as - segmentation faults, bus errors, assertions, or other strange - behavior). Similar issues apply to the com_err library or any other - library used by both modules and shared libraries and by the - application that loads them. If your OS ships Kerberos libraries, - it's usually best if possible to build all Kerberos software on the - system against those libraries. + The first step when debugging any problems with this module is to add + `debug` to the PAM options for the module (either in the PAM + configuration or in `krb5.conf`). This will significantly increase the + logging from the module and should provide a trace of exactly what + failed and any available error information. + + Many Kerberos authentication problems are due to configuration issues in + `krb5.conf`. If pam-krb5 doesn't work, first check that `kinit` works + on the same system. That will test your basic Kerberos configuration. + If the system has a keytab file installed that's readable by the process + doing authentication via PAM, make sure that the keytab is current and + contains a key for `host/` where is the fully-qualified + hostname. pam-krb5 prevents KDC spoofing by checking the user's + credentials when possible, but this means that if a keytab is present it + must be correct or authentication will fail. You can check the keytab + with `klist -k` and `kinit -k`. + + Be sure that all libraries and modules, including PAM modules, loaded by + a program use the same Kerberos libraries. Sometimes programs that use + PAM, such as current versions of OpenSSH, also link against Kerberos + directly. If your sshd is linked against one set of Kerberos libraries + and pam-krb5 is linked against a different set of Kerberos libraries, + this will often cause problems (such as segmentation faults, bus errors, + assertions, or other strange behavior). Similar issues apply to the + com_err library or any other library used by both modules and shared + libraries and by the application that loads them. If your OS ships + Kerberos libraries, it's usually best if possible to build all Kerberos + software on the system against those libraries. - title: Implementation Notes body: | The normal sequence of actions taken for a user login is: @@ -304,60 +391,56 @@ sections: pam_close_session ``` - followed by closing the open PAM session. The corresponding - `pam_sm_*` functions in this module are called when an application - calls those public interface functions. Not all applications call - all of those functions, or in particularly that order, although - `pam_authenticate` is always first and has to be. - - When `pam_authenticate` is called, pam-krb5 creates a temporary - ticket cache in `/tmp` and sets the PAM environment variable - `PAM_KRB5CCNAME` to point to it. This ticket cache will be - automatically destroyed when the PAM session is closed and is there - only to pass the initial credentials to the call to `pam_setcred`. - The module would use a memory cache, but memory caches will only - work if the application preserves the PAM environment between the - calls to `pam_authenticate` and `pam_setcred`. Most do, but OpenSSH - notoriously does not and calls `pam_authenticate` in a subprocess, - so this method is used to pass the tickets to the `pam_setcred` call - in a different process. - - `pam_authenticate` does a complete authentication, including - checking the resulting TGT by obtaining a service ticket for the - local host if possible, but this requires read access to the system - keytab. If the keytab doesn't exist, can't be read, or doesn't - include the appropriate credentials, the default is to accept the - authentication. This can be controlled by setting - `verify_ap_req_nofail` to true in `[libdefaults]` in - `/etc/krb5.conf`. `pam_authenticate` also does a basic - authorization check, by default calling `krb5_kuserok` (which uses - `~/.k5login` if available and falls back to checking that the - principal corresponds to the account name). This can be customized - with several options documented in the pam_krb5(5) man page. - - pam-krb5 treats `pam_open_session` and - `pam_setcred(PAM_ESTABLISH_CRED)` as synonymous, as some - applications call one and some call the other. Both copy the - initial credentials from the temporary cache into a permanent cache - for this session and set `KRB5CCNAME` in the environment. It will - remember when the credential cache has been established and then - avoid doing any duplicate work afterwards, since some applications - call `pam_setcred` or `pam_open_session` multiple times (most - notably X.Org 7 and earlier xdm, which also throws away the module - settings the last time it calls them). + followed by closing the open PAM session. The corresponding `pam_sm_*` + functions in this module are called when an application calls those + public interface functions. Not all applications call all of those + functions, or in particularly that order, although `pam_authenticate` is + always first and has to be. + + When `pam_authenticate` is called, pam-krb5 creates a temporary ticket + cache in `/tmp` and sets the PAM environment variable `PAM_KRB5CCNAME` + to point to it. This ticket cache will be automatically destroyed when + the PAM session is closed and is there only to pass the initial + credentials to the call to `pam_setcred`. The module would use a memory + cache, but memory caches will only work if the application preserves the + PAM environment between the calls to `pam_authenticate` and + `pam_setcred`. Most do, but OpenSSH notoriously does not and calls + `pam_authenticate` in a subprocess, so this method is used to pass the + tickets to the `pam_setcred` call in a different process. + + `pam_authenticate` does a complete authentication, including checking + the resulting TGT by obtaining a service ticket for the local host if + possible, but this requires read access to the system keytab. If the + keytab doesn't exist, can't be read, or doesn't include the appropriate + credentials, the default is to accept the authentication. This can be + controlled by setting `verify_ap_req_nofail` to true in `[libdefaults]` + in `/etc/krb5.conf`. `pam_authenticate` also does a basic authorization + check, by default calling `krb5_kuserok` (which uses `~/.k5login` if + available and falls back to checking that the principal corresponds to + the account name). This can be customized with several options + documented in the pam_krb5(5) man page. + + pam-krb5 treats `pam_open_session` and `pam_setcred(PAM_ESTABLISH_CRED)` + as synonymous, as some applications call one and some call the other. + Both copy the initial credentials from the temporary cache into a + permanent cache for this session and set `KRB5CCNAME` in the + environment. It will remember when the credential cache has been + established and then avoid doing any duplicate work afterwards, since + some applications call `pam_setcred` or `pam_open_session` multiple + times (most notably X.Org 7 and earlier xdm, which also throws away the + module settings the last time it calls them). `pam_acct_mgmt` finds the ticket cache, reads it in to obtain the - authenticated principal, and then does is another authorization - check against `.k5login` or the local account name as described - above. + authenticated principal, and then does is another authorization check + against `.k5login` or the local account name as described above. - After the call to `pam_setcred` or `pam_open_session`, the ticket - cache will be destroyed whenever the calling application either - destroys the PAM environment or calls `pam_close_session`, which it - should do on user logout. + After the call to `pam_setcred` or `pam_open_session`, the ticket cache + will be destroyed whenever the calling application either destroys the + PAM environment or calls `pam_close_session`, which it should do on user + logout. - The normal sequence of events when refreshing a ticket cache (such - as inside a screensaver) is: + The normal sequence of events when refreshing a ticket cache (such as + inside a screensaver) is: ``` pam_authenticate @@ -365,36 +448,36 @@ sections: pam_acct_mgmt ``` - (`PAM_REFRESH_CRED` may be used instead.) Authentication proceeds - as above. At the `pam_setcred` stage, rather than creating a new - ticket cache, the module instead finds the current ticket cache - (from the `KRB5CCNAME` environment variable or the default ticket - cache location from the Kerberos library) and then reinitializes it - with the credentials from the temporary `pam_authenticate` ticket - cache. When refreshing a ticket cache, the application should not - open a session. Calling `pam_acct_mgmt` is optional; pam-krb5 - doesn't do anything different when it's called in this case. - - If `pam_authenticate` apparently didn't succeed, or if an account - was configured to be ignored via `ignore_root` or `minimum_uid`, + (`PAM_REFRESH_CRED` may be used instead.) Authentication proceeds as + above. At the `pam_setcred` stage, rather than creating a new ticket + cache, the module instead finds the current ticket cache (from the + `KRB5CCNAME` environment variable or the default ticket cache location + from the Kerberos library) and then reinitializes it with the + credentials from the temporary `pam_authenticate` ticket cache. When + refreshing a ticket cache, the application should not open a session. + Calling `pam_acct_mgmt` is optional; pam-krb5 doesn't do anything + different when it's called in this case. + + If `pam_authenticate` apparently didn't succeed, or if an account was + configured to be ignored via `ignore_root` or `minimum_uid`, `pam_setcred` (and therefore `pam_open_session`) and `pam_acct_mgmt` - return `PAM_IGNORE`, which tells the PAM library to proceed as if - that module wasn't listed in the PAM configuration at all. - `pam_authenticate`, however, returns failure in the ignored user - case by default, since otherwise a configuration using `ignore_root` - with pam-krb5 as the only PAM module would allow anyone to log in as - root without a password. There doesn't appear to be a case where - returning `PAM_IGNORE` instead would improve the module's behavior, - but if you know of a case, please let me know. + return `PAM_IGNORE`, which tells the PAM library to proceed as if that + module wasn't listed in the PAM configuration at all. + `pam_authenticate`, however, returns failure in the ignored user case by + default, since otherwise a configuration using `ignore_root` with + pam-krb5 as the only PAM module would allow anyone to log in as root + without a password. There doesn't appear to be a case where returning + `PAM_IGNORE` instead would improve the module's behavior, but if you + know of a case, please let me know. By default, `pam_authenticate` intentionally does not follow the PAM - standard for handling expired accounts and instead returns failure - from `pam_authenticate` unless the Kerberos libraries are able to - change the account password during authentication. Too many - applications either do not call `pam_acct_mgmt` or ignore its exit - status. The fully correct PAM behavior (returning success from - `pam_authenticate` and `PAM_NEW_AUTHTOK_REQD` from `pam_acct_mgmt`) - can be enabled with the `defer_pwchange` option. + standard for handling expired accounts and instead returns failure from + `pam_authenticate` unless the Kerberos libraries are able to change the + account password during authentication. Too many applications either do + not call `pam_acct_mgmt` or ignore its exit status. The fully correct + PAM behavior (returning success from `pam_authenticate` and + `PAM_NEW_AUTHTOK_REQD` from `pam_acct_mgmt`) can be enabled with the + `defer_pwchange` option. The `defer_pwchange` option is unfortunately somewhat tricky to implement. In this case, the calling sequence is: @@ -410,124 +493,62 @@ sections: During the first `pam_authenticate`, we can't obtain credentials and therefore a ticket cache since the password is expired. But `pam_authenticate` isn't called again after `pam_chauthtok`, so - `pam_chauthtok` has to create a ticket cache. We however don't want - it to do this for the normal password change (`passwd`) case. + `pam_chauthtok` has to create a ticket cache. We however don't want it + to do this for the normal password change (`passwd`) case. What we do is set a flag in our PAM data structure saying that we're processing an expired password, and `pam_chauthtok`, if it sees that - flag, redoes the authentication with password prompting disabled - after it finishes changing the password. - - Unfortunately, when handling password changes this way, - `pam_chauthtok` will always have to prompt the user for their - current password again even though they just typed it. This is - because the saved authentication tokens are cleared after - `pam_authenticate` returns, for security reasons. We could hack - around this by saving the password in our PAM data structure, but - this would let the application gain access to it (exactly what the - clearing is intended to prevent) and breaks a PAM library guarantee. - We could also work around this by having `pam_authenticate` get the - `kadmin/changepw` authenticator in the expired password case and - store it for `pam_chauthtok`, but it doesn't seem worth the hassle. + flag, redoes the authentication with password prompting disabled after + it finishes changing the password. + + Unfortunately, when handling password changes this way, `pam_chauthtok` + will always have to prompt the user for their current password again + even though they just typed it. This is because the saved + authentication tokens are cleared after `pam_authenticate` returns, for + security reasons. We could hack around this by saving the password in + our PAM data structure, but this would let the application gain access + to it (exactly what the clearing is intended to prevent) and breaks a + PAM library guarantee. We could also work around this by having + `pam_authenticate` get the `kadmin/changepw` authenticator in the + expired password case and store it for `pam_chauthtok`, but it doesn't + seem worth the hassle. - title: History and Acknowledgements body: | Originally written by Frank Cusack , with the following acknowledgement: > Thanks to Naomaru Itoi , Curtis King - > , and Derrick Brashear , - > all of whom have written and made available Kerberos 4/5 modules. + > , and Derrick Brashear , all + > of whom have written and made available Kerberos 4/5 modules. > Although no code in this module is directly from these author's > modules, (except the get_user_info() routine in support.c; derived - > from whichever of these authors originally wrote the first module - > the other 2 copied from), it was extremely helpful to look over - > their code which aided in my design. + > from whichever of these authors originally wrote the first module the + > other 2 copied from), it was extremely helpful to look over their code + > which aided in my design. The module was then patched for the FreeBSD ports collection with - additional modifications by unknown maintainers and then was - modified by Joel Kociolek to be usable with - Debian GNU/Linux. - - It was packaged by Sam Hartman as the Kerberos v5 PAM module for - Debian and improved and modified by him and later by Russ Allbery to - fix bugs and add additional features. It was then adopted by Andres - Salomon, who added support for refreshing credentials. - - The current distribution is maintained by Russ Allbery, who also - added support for reading configuration from `krb5.conf`, added many - features for compatibility with the Sourceforge module, commented - and standardized the formatting of the code, and overhauled the + additional modifications by unknown maintainers and then was modified by + Joel Kociolek to be usable with Debian GNU/Linux. + + It was packaged by Sam Hartman as the Kerberos v5 PAM module for Debian + and improved and modified by him and later by Russ Allbery to fix bugs + and add additional features. It was then adopted by Andres Salomon, who + added support for refreshing credentials. + + The current distribution is maintained by Russ Allbery, who also added + support for reading configuration from `krb5.conf`, added many features + for compatibility with the Sourceforge module, commented and + standardized the formatting of the code, and overhauled the documentation. Thanks to Douglas E. Engert for the initial implementation of PKINIT - support. I have since modified and reworked it extensively, so any - bugs or compilation problems are my fault. + support. I have since modified and reworked it extensively, so any bugs + or compilation problems are my fault. - Thanks to Markus Moeller for lots of debugging and multiple patches - and suggestions for improved portability. + Thanks to Markus Moeller for lots of debugging and multiple patches and + suggestions for improved portability. Thanks to Booker Bense for the implementation of the `alt_auth_map` option. Thanks to Sam Hartman for the FAST support implementation. - -requirements: | - Either MIT Kerberos (or Kerberos implementations based on it) or Heimdal - are supported. MIT Keberos 1.3 or later may be required; this module has - not been tested with earlier versions. - - For PKINIT support, Heimdal 0.8rc1 or later or MIT Kerberos 1.6.3 or later - are required. Earlier MIT Kerberos 1.6 releases have a bug in their - handling of PKINIT options. - - For FAST (Flexible Authentication Secure Tunneling) support, MIT Kerberos - 1.7 or higher is required. For anonymous FAST support, anonymous - authentication (generally anonymous PKINIT) support is required in both - the Kerberos libraries and in the local KDC. - - This module should work on Linux and Solaris (and build with gcc, clang, - or the Sun C compiler), but has been far more heavily tested on Linux. - There is beta-quality support for the AIX NAS Kerberos implementation. - Other PAM implementations will probably require some porting, although - untested build system support is present for FreeBSD, Mac OS X, and HP-UX. - I personally can only test on Linux and rely on others to report problems - on other operating systems. - - Old versions of OpenSSH are known to call `pam_authenticate` followed by - `pam_setcred(PAM_REINITIALIZE_CRED)` without first calling - `pam_open_session`, thereby requesting that an existing ticket cache be - renewed (similar to what a screensaver would want) rather than requesting - a new ticket cache be created. Since this behavior is indistinguishable - at the PAM level from a screensaver, pam-krb5 when used with these old - versions of OpenSSH will refresh the ticket cache of the OpenSSH daemon - rather than setting up a new ticket cache for the user. The resulting - ticket cache will have the correct permissions (this is not a security - concern), but will not be named correctly or referenced in the user's - environment and will be overwritten by the next user login. The best - solution to this problem is to upgrade OpenSSH. I'm not sure exactly when - this problem was fixed, but at the very least OpenSSH 4.3 and later do not - exhibit it. - -test: - prefix: | - pam-krb5 comes with a comprehensive test suite, but it requires some - configuration in order to test anything other than low-level utility - functions. For the full test suite, you will need to have a running KDC - in which you can create two test accounts, one with admin access to the - other. Using a test KDC environment, if you have one, is recommended. - - Follow the instructions in `tests/config/README` to configure the test - suite. - - Now, you can run the test suite with: - suffix: | - The default libkadm5clnt library on the system must match the - implementation of your KDC for the module/expired test to work, since the - two kadmin protocols are not compatible. If you use the MIT library - against a Heimdal server, the test will be skipped; if you use the Heimdal - library against an MIT server, the test suite may hang. - - Several `module/expired` tests are expected to fail with Heimdal 1.5 due - to a bug in Heimdal with reauthenticating immediately after a - library-mediated password change of an expired password. This is fixed in - later releases of Heimdal. diff --git a/t/data/generate/pam-krb5/output/readme b/t/data/generate/pam-krb5/output/readme index 5d6e7a0..3b7cb5c 100644 --- a/t/data/generate/pam-krb5/output/readme +++ b/t/data/generate/pam-krb5/output/readme @@ -1,13 +1,13 @@ - pam-krb5 4.8 + pam-krb5 4.11 (PAM module for Kerberos authentication) Maintained by Russ Allbery - Copyright 2005-2010, 2014-2015, 2017 Russ Allbery . - Copyright 2009-2011 The Board of Trustees of the Leland Stanford Junior - University. Copyright 2005 Andres Salomon . - Copyright 1999-2000 Frank Cusack . This software - is distributed under a BSD-style license. Please see the section - LICENSE below for more information. + Copyright 2005-2010, 2014-2015, 2017, 2020-2021 Russ Allbery + . Copyright 2009-2011 The Board of Trustees of the + Leland Stanford Junior University. Copyright 2005 Andres Salomon + . Copyright 1999-2000 Frank Cusack + . This software is distributed under a BSD-style + license. Please see the section LICENSE below for more information. BLURB @@ -56,17 +56,19 @@ REQUIREMENTS For PKINIT support, Heimdal 0.8rc1 or later or MIT Kerberos 1.6.3 or later are required. Earlier MIT Kerberos 1.6 releases have a bug in - their handling of PKINIT options. + their handling of PKINIT options. MIT Kerberos 1.12 or later is + required to use the use_pkinit PAM option. For FAST (Flexible Authentication Secure Tunneling) support, MIT Kerberos 1.7 or higher is required. For anonymous FAST support, anonymous authentication (generally anonymous PKINIT) support is required in both the Kerberos libraries and in the local KDC. - This module should work on Linux and Solaris (and build with gcc, clang, - or the Sun C compiler), but has been far more heavily tested on Linux. - There is beta-quality support for the AIX NAS Kerberos implementation. - Other PAM implementations will probably require some porting, although + This module should work on Linux and build with gcc or clang. It may + still work on Solaris and build with the Sun C compiler, but I have only + tested it on Linux recently. There is beta-quality support for the AIX + NAS Kerberos implementation that has not been tested in years. Other + PAM implementations will probably require some porting, although untested build system support is present for FreeBSD, Mac OS X, and HP-UX. I personally can only test on Linux and rely on others to report problems on other operating systems. @@ -107,14 +109,14 @@ BUILDING AND INSTALLATION directory is also supported, if you wish, by creating an empty directory and then running configure with the correct relative path. - The module will be installed in /usr/local/lib/security by default, - except on 64-bit versions of Linux which will use - /usr/local/lib64/security to match the default PAM configuration. You - can change the installation locations with the --prefix, --mandir, and - --libdir options to configure. The module will always be installed in a - subdirectory named security under the specified libdir. On Linux, use - --prefix=/usr to install the man page into /usr/share/man and the PAM - module in /lib/security or /lib64/security. + The module will be installed in /usr/local/lib/security by default, but + expect to have to override this using --libdir. The correct + installation path for PAM modules varies considerably between systems. + The module will always be installed in a subdirectory named security + under the specified value of --libdir. On Red Hat Linux, for example, + --libdir=/usr/lib64 is appropriate to install the module into the system + PAM directory. On Debian's amd64 architecture, + --libdir=/usr/lib/x86_64-linux-gnu would be correct. Normally, configure will use krb5-config to determine the flags to use to compile with your Kerberos libraries. To specify a particular @@ -197,6 +199,22 @@ TESTING library-mediated password change of an expired password. This is fixed in later releases of Heimdal. + To run the full test suite, Perl 5.10 or later is required. The + following additional Perl modules will be used if present: + + * Test::Pod + * Test::Spelling + + All are available on CPAN. Those tests will be skipped if the modules + are not available. + + To enable tests that don't detect functionality problems but are used to + sanity-check the release, set the environment variable RELEASE_TESTING + to a true value. To enable tests that may be sensitive to the local + environment or that produce a lot of false positives without uncovering + many problems, set the environment variable AUTHOR_TESTING to a true + value. + CONFIGURING Just installing the module does not enable it or change anything about @@ -566,7 +584,8 @@ LICENSE The pam-krb5 package as a whole is covered by the following copyright statement and license: - Copyright 2005-2010, 2014-2015, 2017 Russ Allbery + Copyright 2005-2010, 2014-2015, 2017, 2020-2021 + Russ Allbery Copyright 2009-2011 The Board of Trustees of the Leland Stanford Junior University Copyright 2005 Andres Salomon diff --git a/t/data/generate/pam-krb5/output/readme-md b/t/data/generate/pam-krb5/output/readme-md index 9834f04..e74b675 100644 --- a/t/data/generate/pam-krb5/output/readme-md +++ b/t/data/generate/pam-krb5/output/readme-md @@ -1,14 +1,17 @@ # pam-krb5 +[![Build +status](https://github.com/rra/pam-krb5/workflows/build/badge.svg)](https://github.com/rra/pam-krb5/actions) [![Debian package](https://img.shields.io/debian/v/libpam-krb5/unstable)](https://tracker.debian.org/pkg/libpam-krb5) -Copyright 2005-2010, 2014-2015, 2017 Russ Allbery . -Copyright 2009-2011 The Board of Trustees of the Leland Stanford Junior -University. Copyright 2005 Andres Salomon . -Copyright 1999-2000 Frank Cusack . This software is -distributed under a BSD-style license. Please see the section -[License](#license) below for more information. +Copyright 2005-2010, 2014-2015, 2017, 2020-2021 Russ Allbery +. Copyright 2009-2011 The Board of Trustees of the +Leland Stanford Junior University. Copyright 2005 Andres Salomon +. Copyright 1999-2000 Frank Cusack +. This software is distributed under a BSD-style +license. Please see the section [License](#license) below for more +information. ## Blurb @@ -55,20 +58,22 @@ not been tested with earlier versions. For PKINIT support, Heimdal 0.8rc1 or later or MIT Kerberos 1.6.3 or later are required. Earlier MIT Kerberos 1.6 releases have a bug in their -handling of PKINIT options. +handling of PKINIT options. MIT Kerberos 1.12 or later is required to use +the use_pkinit PAM option. For FAST (Flexible Authentication Secure Tunneling) support, MIT Kerberos 1.7 or higher is required. For anonymous FAST support, anonymous authentication (generally anonymous PKINIT) support is required in both the Kerberos libraries and in the local KDC. -This module should work on Linux and Solaris (and build with gcc, clang, -or the Sun C compiler), but has been far more heavily tested on Linux. -There is beta-quality support for the AIX NAS Kerberos implementation. -Other PAM implementations will probably require some porting, although -untested build system support is present for FreeBSD, Mac OS X, and HP-UX. -I personally can only test on Linux and rely on others to report problems -on other operating systems. +This module should work on Linux and build with gcc or clang. It may +still work on Solaris and build with the Sun C compiler, but I have only +tested it on Linux recently. There is beta-quality support for the AIX +NAS Kerberos implementation that has not been tested in years. Other PAM +implementations will probably require some porting, although untested +build system support is present for FreeBSD, Mac OS X, and HP-UX. I +personally can only test on Linux and rely on others to report problems on +other operating systems. Old versions of OpenSSH are known to call `pam_authenticate` followed by `pam_setcred(PAM_REINITIALIZE_CRED)` without first calling @@ -108,14 +113,14 @@ probably have to be done as root. Building outside of the source directory is also supported, if you wish, by creating an empty directory and then running configure with the correct relative path. -The module will be installed in `/usr/local/lib/security` by default, -except on 64-bit versions of Linux which will use -`/usr/local/lib64/security` to match the default PAM configuration. You -can change the installation locations with the `--prefix`, `--mandir`, and -`--libdir` options to configure. The module will always be installed in a -subdirectory named `security` under the specified libdir. On Linux, use -`--prefix=/usr` to install the man page into `/usr/share/man` and the PAM -module in `/lib/security` or `/lib64/security`. +The module will be installed in `/usr/local/lib/security` by default, but +expect to have to override this using `--libdir`. The correct +installation path for PAM modules varies considerably between systems. +The module will always be installed in a subdirectory named `security` +under the specified value of `--libdir`. On Red Hat Linux, for example, +`--libdir=/usr/lib64` is appropriate to install the module into the system +PAM directory. On Debian's amd64 architecture, +`--libdir=/usr/lib/x86_64-linux-gnu` would be correct. Normally, configure will use `krb5-config` to determine the flags to use to compile with your Kerberos libraries. To specify a particular @@ -208,6 +213,22 @@ to a bug in Heimdal with reauthenticating immediately after a library-mediated password change of an expired password. This is fixed in later releases of Heimdal. +To run the full test suite, Perl 5.10 or later is required. The following +additional Perl modules will be used if present: + +* Test::Pod +* Test::Spelling + +All are available on CPAN. Those tests will be skipped if the modules are +not available. + +To enable tests that don't detect functionality problems but are used to +sanity-check the release, set the environment variable `RELEASE_TESTING` +to a true value. To enable tests that may be sensitive to the local +environment or that produce a lot of false positives without uncovering +many problems, set the environment variable `AUTHOR_TESTING` to a true +value. + ## Configuring Just installing the module does not enable it or change anything about @@ -586,7 +607,7 @@ requests are gratefully reviewed and normally accepted. The pam-krb5 package as a whole is covered by the following copyright statement and license: -> Copyright 2005-2010, 2014-2015, 2017 +> Copyright 2005-2010, 2014-2015, 2017, 2020-2021 > Russ Allbery > > Copyright 2009-2011 diff --git a/t/data/generate/pam-krb5/output/thread b/t/data/generate/pam-krb5/output/thread index e8ac73e..6554083 100644 --- a/t/data/generate/pam-krb5/output/thread +++ b/t/data/generate/pam-krb5/output/thread @@ -48,11 +48,15 @@ \h2[Security Advisories] + \link[security/2020-03-30.html] + [2020-03-30]: pam-krb5 4.8 and earlier\break + \link[security/2009-02-11.html] [2009-02-11]: pam-krb5 3.12 and earlier\break \h2[Development] + \link[todo.html][To-do list] \break \link[https://github.com/rra/pam-krb5] [GitHub] \break \link[https://github.com/rra/pam-krb5/issues] @@ -110,20 +114,22 @@ not been tested with earlier versions. For PKINIT support, Heimdal 0.8rc1 or later or MIT Kerberos 1.6.3 or later are required. Earlier MIT Kerberos 1.6 releases have a bug in their -handling of PKINIT options. +handling of PKINIT options. MIT Kerberos 1.12 or later is required to use +the use_pkinit PAM option. For FAST (Flexible Authentication Secure Tunneling) support, MIT Kerberos 1.7 or higher is required. For anonymous FAST support, anonymous authentication (generally anonymous PKINIT) support is required in both the Kerberos libraries and in the local KDC. -This module should work on Linux and Solaris (and build with gcc, clang, -or the Sun C compiler), but has been far more heavily tested on Linux. -There is beta-quality support for the AIX NAS Kerberos implementation. -Other PAM implementations will probably require some porting, although -untested build system support is present for FreeBSD, Mac OS X, and HP-UX. -I personally can only test on Linux and rely on others to report problems -on other operating systems. +This module should work on Linux and build with gcc or clang. It may +still work on Solaris and build with the Sun C compiler, but I have only +tested it on Linux recently. There is beta-quality support for the AIX +NAS Kerberos implementation that has not been tested in years. Other PAM +implementations will probably require some porting, although untested +build system support is present for FreeBSD, Mac OS X, and HP-UX. I +personally can only test on Linux and rely on others to report problems on +other operating systems. Old versions of OpenSSH are known to call \code[pam_authenticate] followed by \code[pam_setcred(PAM_REINITIALIZE_CRED)] without first calling @@ -158,7 +164,7 @@ The distribution: An \link[https://archives.eyrie.org/software/ARCHIVE/pam-krb5/] [archive of older releases] is also available. \class(alert)[Versions older than -3.13 have known security vulnerabilities and should not be used.] +4.9 have known security vulnerabilities and should not be used.] Debian packages are available from Debian in Debian 4.0 (etch) and later releases as libpam-krb5 and libpam-heimdal. The former packages are built @@ -188,11 +194,15 @@ User documentation: Security advisories: +\doc[security/2020-03-30.html] + [2020-03-30: 4.8 and earlier] + \doc[security/2009-02-11.html] [2009-02-11: 3.12 and earlier] Developer documentation: +\doc[todo.html][To-do list] \doc[https://github.com/rra/pam-krb5] [GitHub] \doc[https://github.com/rra/pam-krb5/issues] @@ -207,7 +217,7 @@ license: \block[ - Copyright 2005-2010, 2014-2015, 2017 + Copyright 2005-2010, 2014-2015, 2017, 2020-2021 Russ Allbery Copyright 2009-2011 -- cgit v1.2.3 From 3722a15cf5b2325d8ef8fc914c6b744c3a9e4192 Mon Sep 17 00:00:00 2001 From: Russ Allbery Date: Sun, 17 Oct 2021 16:24:16 -0700 Subject: Fix blank lines between security advisories The new pam-krb5 test revealed a whitespace problem causing blank lines to be introduced between security advisories in the sidebar. Avoid that with more careful templating. --- Changes | 2 ++ share/templates/thread.tmpl | 8 ++++---- t/data/generate/pam-krb5/output/thread | 6 ++---- t/data/generate/remctl/output/thread | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Changes b/Changes index 948113f..c31715d 100644 --- a/Changes +++ b/Changes @@ -6,6 +6,8 @@ to be RFC 2822 dates and therefore always use English month and day of week names. Thanks to Slaven Rezić for testing. + - Fix small whitespace problems in thread output. + 5.00 - 2021-09-12 - Merge spin and spin-rss into this package, making it a full, if highly diff --git a/share/templates/thread.tmpl b/share/templates/thread.tmpl index 7bfd907..cffeb18 100644 --- a/share/templates/thread.tmpl +++ b/share/templates/thread.tmpl @@ -47,8 +47,8 @@ \h2[Security Advisories] [% FOREACH advisory IN advisories %] \link[security/[% advisory.date %].html] - [[% advisory.date %]]: [% name %] [% advisory.versions %]\break -[% END %][% END %] + [[% advisory.date %]]: [% name %] [% advisory.versions %] \break[% END %] +[% END %] \h2[Development] [% FOREACH doc IN docs.developer %] \link[[% doc.name %].html][[% doc.title %]] \break[% END %][% IF vcs.github %] @@ -189,8 +189,8 @@ User documentation: Security advisories: [% FOREACH advisory IN advisories %] \doc[security/[% advisory.date %].html] - [[% advisory.date %]: [% advisory.versions %]] -[% END %][% END %] + [[% advisory.date %]: [% advisory.versions %]][% END %] +[% END %] Developer documentation: [% FOREACH doc IN docs.developer %] \doc[[% doc.name %].html][[% doc.title %]][% END %][% IF vcs.github %] diff --git a/t/data/generate/pam-krb5/output/thread b/t/data/generate/pam-krb5/output/thread index 6554083..a370131 100644 --- a/t/data/generate/pam-krb5/output/thread +++ b/t/data/generate/pam-krb5/output/thread @@ -49,10 +49,9 @@ \h2[Security Advisories] \link[security/2020-03-30.html] - [2020-03-30]: pam-krb5 4.8 and earlier\break - + [2020-03-30]: pam-krb5 4.8 and earlier \break \link[security/2009-02-11.html] - [2009-02-11]: pam-krb5 3.12 and earlier\break + [2009-02-11]: pam-krb5 3.12 and earlier \break \h2[Development] @@ -196,7 +195,6 @@ Security advisories: \doc[security/2020-03-30.html] [2020-03-30: 4.8 and earlier] - \doc[security/2009-02-11.html] [2009-02-11: 3.12 and earlier] diff --git a/t/data/generate/remctl/output/thread b/t/data/generate/remctl/output/thread index 615ed8f..3ecd5f8 100644 --- a/t/data/generate/remctl/output/thread +++ b/t/data/generate/remctl/output/thread @@ -54,7 +54,7 @@ \h2[Security Advisories] \link[security/2018-04-01.html] - [2018-04-01]: remctl 3.12 and 3.13\break + [2018-04-01]: remctl 3.12 and 3.13 \break \h2[Development] -- cgit v1.2.3 From 4aab7cb9631a8abedb5675baef772a65cb3539e8 Mon Sep 17 00:00:00 2001 From: Russ Allbery Date: Sun, 17 Oct 2021 19:21:17 -0700 Subject: Support distribution from a main branch Support creating distributions from branches named main rather than master. The first of main or master that's found in the repository will be used. Use Git::Repository for creating distributions and testing the distribution code rather than hand-rolling git invocations. --- Changes | 4 ++++ lib/App/DocKnot/Dist.pm | 29 +++++++++++++++++++---------- t/dist/basic.t | 45 +++++++++++++++++++-------------------------- 3 files changed, 42 insertions(+), 36 deletions(-) diff --git a/Changes b/Changes index c31715d..a82f801 100644 --- a/Changes +++ b/Changes @@ -2,6 +2,10 @@ 5.01 - Not Released + - Support creating distributions from branches named main rather than + master. The first of main or master that's found in the repository + will be used. + - Fix unintended localization of dates in RSS output, which are supposed to be RFC 2822 dates and therefore always use English month and day of week names. Thanks to Slaven Rezić for testing. diff --git a/lib/App/DocKnot/Dist.pm b/lib/App/DocKnot/Dist.pm index 1db9b13..4caa9b5 100644 --- a/lib/App/DocKnot/Dist.pm +++ b/lib/App/DocKnot/Dist.pm @@ -23,12 +23,13 @@ use Cwd qw(getcwd); use File::Copy qw(move); use File::Find qw(find); use File::Path qw(remove_tree); +use Git::Repository (); use IO::Compress::Xz (); use IO::Uncompress::Gunzip (); use IPC::Run qw(run); use IPC::System::Simple qw(systemx); use List::SomeUtils qw(lastval); -use List::Util qw(any); +use List::Util qw(any first); # Base commands to run for various types of distributions. Additional # variations may be added depending on additional configuration parameters. @@ -390,13 +391,19 @@ sub make_distribution { } # Export the Git repository into a new directory. - my @git = ( - 'git', 'archive', - "--remote=$source", "--prefix=${prefix}/", - 'master', + my $repo = Git::Repository->new(work_tree => $source); + my @branches = $repo->run( + 'for-each-ref' => '--format=%(refname:short)', 'refs/heads/', ); - my @tar = qw(tar xf -); - run(\@git, q{|}, \@tar) or die "@git | @tar failed with status $?\n"; + my $head = first { $_ eq 'main' || $_ eq 'master' } @branches; + my $archive = $repo->command(archive => "--prefix=${prefix}/", $head); + run([qw(tar xf -)], '<', $archive->stdout) + or die "git archive | tar xf - failed with status $?\n"; + $archive->close(); + + if ($archive->exit != 0) { + die 'git archive failed with status ' . $archive->exit . "\n"; + } # Change to that directory and run the configured commands. chdir($prefix); @@ -461,9 +468,9 @@ App::DocKnot::Dist - Prepare a distribution tarball =head1 REQUIREMENTS Git, Perl 5.24 or later, and the modules File::BaseDir, File::ShareDir, -IO::Compress::Xz (part of IO-Compress-Lzma), IO::Uncompress::Gunzip (part of -IO-Compress), IPC::Run, IPC::System::Simple, Kwalify, List::SomeUtils, and -YAML::XS, all of which are available from CPAN. +Git::Repository, IO::Compress::Xz (part of IO-Compress-Lzma), +IO::Uncompress::Gunzip (part of IO-Compress), IPC::Run, IPC::System::Simple, +Kwalify, List::SomeUtils, and YAML::XS, all of which are available from CPAN. The tools to build whatever type of software distribution is being prepared are also required, since the distribution is built and tested as part of @@ -557,6 +564,8 @@ an implementation detail of make_distribution(). =item make_distribution() Generate distribution tarballs in the C directory provided to new(). +The distribution will be generated from the first branch found named either +C
or C. If C already contains a subdirectory whose name matches the C of the distribution, it will be forcibly removed. In order to diff --git a/t/dist/basic.t b/t/dist/basic.t index 95a6986..f8ca97b 100755 --- a/t/dist/basic.t +++ b/t/dist/basic.t @@ -17,6 +17,7 @@ use Cwd qw(getcwd); use File::Copy::Recursive qw(dircopy); use File::Spec; use File::Temp; +use Git::Repository; use IPC::Run qw(run); use IPC::System::Simple qw(capturex systemx); @@ -36,44 +37,36 @@ my $dir = File::Temp->newdir(); my $sourcedir = File::Spec->catfile($dir, 'source'); my $distdir = File::Spec->catfile($dir, 'dist'); -# Check whether git is available and can be used to initialize a repository. -eval { - systemx( - 'git', 'init', '-b', 'master', '-q', - File::Spec->catfile($dir, 'source'), - ); -}; -if ($@) { - plan skip_all => 'git init failed (possibly no git binary)'; -} - -# Copy all files from the data directory, and commit them. We have to rename -# the test while we copy it to avoid having it picked up by the main package -# test suite. +# Create a new repository, copy all files from the data directory, and commit +# them. We have to rename the test while we copy it to avoid having it picked +# up by the main package test suite. dircopy($dataroot, $sourcedir) or die "$0: cannot copy $dataroot to $sourcedir: $!\n"; my $testpath = File::Spec->catfile($sourcedir, 't', 'api', 'empty.t'); rename($testpath . '.in', $testpath); -chdir($sourcedir); -systemx(qw(git config --add user.name Test)); -systemx(qw(git config --add user.email test@example.com)); -systemx(qw(git add -A .)); -systemx(qw(git commit -q -m Initial)); +Git::Repository->run(init => '-b', 'main', { cwd => $sourcedir, quiet => 1 }); +my $repo = Git::Repository->new(work_tree => $sourcedir); +$repo->run(config => '--add', 'user.name', 'Test'); +$repo->run(config => '--add', 'user.email', 'test@example.com'); +$repo->run(add => '-A', q{.}); +$repo->run(commit => '-q', '-m', 'Initial commit'); # Check whether we have all the necessary tools to run the test. -my $out; -my $result - = eval { run(['git', 'archive', 'HEAD'], q{|}, ['tar', 'tf', q{-}], \$out) }; +my $result; +eval { + my $archive = $repo->command(archive => 'HEAD'); + my $out; + $result = run([qw(tar tf -)], '<', $archive->stdout, '>', \$out); + $archive->close(); + $result &&= $archive->exit == 0; +}; if ($@ || !$result) { - chdir($cwd); plan skip_all => 'git and tar not available'; } else { plan tests => 20; } -# Load the module. Change back to the starting directory for this so that -# coverage analysis works. -chdir($cwd); +# Load the module now that we're sure we can run tests. require_ok('App::DocKnot::Dist'); # Put some existing files in the directory that are marked read-only. These -- cgit v1.2.3 From 3bc6eae68d8206f232fc9835450e793758a8ea8c Mon Sep 17 00:00:00 2001 From: Russ Allbery Date: Sun, 17 Oct 2021 19:29:57 -0700 Subject: Fix tests with git without -b flag Don't require that git support a -b flag when running the dist/basic.t test. --- t/dist/basic.t | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/dist/basic.t b/t/dist/basic.t index f8ca97b..319b5cb 100755 --- a/t/dist/basic.t +++ b/t/dist/basic.t @@ -44,7 +44,7 @@ dircopy($dataroot, $sourcedir) or die "$0: cannot copy $dataroot to $sourcedir: $!\n"; my $testpath = File::Spec->catfile($sourcedir, 't', 'api', 'empty.t'); rename($testpath . '.in', $testpath); -Git::Repository->run(init => '-b', 'main', { cwd => $sourcedir, quiet => 1 }); +Git::Repository->run('init', { cwd => $sourcedir, quiet => 1 }); my $repo = Git::Repository->new(work_tree => $sourcedir); $repo->run(config => '--add', 'user.name', 'Test'); $repo->run(config => '--add', 'user.email', 'test@example.com'); -- cgit v1.2.3 From 8312775b24d2b126b4a6a9de0d293844b18eda3a Mon Sep 17 00:00:00 2001 From: Russ Allbery Date: Sun, 19 Dec 2021 16:02:45 -0800 Subject: Fix App::DocKnot::Spin::Thread examples Update the examples in the documentation to match the current API. --- lib/App/DocKnot/Spin/Thread.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/App/DocKnot/Spin/Thread.pm b/lib/App/DocKnot/Spin/Thread.pm index 492666d..46fa7ba 100644 --- a/lib/App/DocKnot/Spin/Thread.pm +++ b/lib/App/DocKnot/Spin/Thread.pm @@ -1502,7 +1502,7 @@ App::DocKnot::Spin::Thread - Generate HTML from the macro language thread use App::DocKnot::Spin::Thread; my $thread = App::DocKnot::Spin::Thread->new(); - $thread->spin_file('/path/to/file.th', '/path/to/file.html'); + my $output = $thread->spin_thread($input); use App::DocKnot::Spin::Sitemap; use App::DocKnot::Spin::Versions; @@ -1515,7 +1515,7 @@ App::DocKnot::Spin::Thread - Generate HTML from the macro language thread sitemap => $sitemap, versions => $versions, }); - $thread->spin_file('/input/file.th', '/output/file.th'); + $thread->spin_thread_file('/input/file.th', '/output/file.html'); =head1 REQUIREMENTS -- cgit v1.2.3 From 3f8cd16b8469c577c582efcc78861b37a9484a50 Mon Sep 17 00:00:00 2001 From: Russ Allbery Date: Sun, 19 Dec 2021 20:35:42 -0800 Subject: Fix App::DocKnot::Spin::Thread synopsis The code in the synopsis used an undefined variable. --- lib/App/DocKnot/Spin/Thread.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/App/DocKnot/Spin/Thread.pm b/lib/App/DocKnot/Spin/Thread.pm index 46fa7ba..2523d8d 100644 --- a/lib/App/DocKnot/Spin/Thread.pm +++ b/lib/App/DocKnot/Spin/Thread.pm @@ -1501,6 +1501,7 @@ App::DocKnot::Spin::Thread - Generate HTML from the macro language thread use App::DocKnot::Spin::Thread; + my $input = 'some thread'; my $thread = App::DocKnot::Spin::Thread->new(); my $output = $thread->spin_thread($input); -- cgit v1.2.3 From d26471ced74e5017f77bdfce1db876389137618a Mon Sep 17 00:00:00 2001 From: Russ Allbery Date: Sun, 19 Dec 2021 20:37:03 -0800 Subject: Add load_yaml_file to App::DocKnot Add load_yaml_file method to App::DocKnot, which loads a YAML file with schema checking. --- Changes | 3 ++ lib/App/DocKnot.pm | 45 ++++++++++++++++++++-- lib/App/DocKnot/Config.pm | 39 +------------------ .../output/software/docknot/api/app-docknot.html | 12 +++++- 4 files changed, 57 insertions(+), 42 deletions(-) diff --git a/Changes b/Changes index a82f801..05eeb0a 100644 --- a/Changes +++ b/Changes @@ -10,6 +10,9 @@ to be RFC 2822 dates and therefore always use English month and day of week names. Thanks to Slaven Rezić for testing. + - Add load_yaml_file method to App::DocKnot, which loads a YAML file with + schema checking. + - Fix small whitespace problems in thread output. 5.00 - 2021-09-12 diff --git a/lib/App/DocKnot.pm b/lib/App/DocKnot.pm index 7a9101f..e7d5b65 100644 --- a/lib/App/DocKnot.pm +++ b/lib/App/DocKnot.pm @@ -20,6 +20,8 @@ use warnings; use File::BaseDir qw(config_files); use File::ShareDir qw(module_file); use File::Spec; +use Kwalify qw(validate); +use YAML::XS (); ############################################################################## # Helper methods @@ -53,6 +55,36 @@ sub appdata_path { return $path; } +# Load a YAML file with schema checking. +# +# $path - Path to the YAML file to load +# $schema - Name of the schema file against which to check it +# +# Returns: Contents of the file as a hash +# Throws: YAML::XS exception on invalid file +# Text exception on schema mismatch +sub load_yaml_file { + my ($self, $path, $schema) = @_; + + # Tell YAML::XS to use real booleans. Otherwise, Kwalify is unhappy with + # data elements set to false. + local $YAML::XS::Boolean = 'JSON::PP'; + + # Load the metadata and check it against the schema. + my $data_ref = YAML::XS::LoadFile($path); + my $schema_path = $self->appdata_path('schema', $schema . '.yaml'); + my $schema_ref = YAML::XS::LoadFile($schema_path); + eval { validate($schema_ref, $data_ref) }; + if ($@) { + my $errors = $@; + chomp($errors); + die "schema validation for $path failed:\n$errors\n"; + } + + # Return the verified contents. + return $data_ref; +} + ############################################################################## # Module return value and documentation ############################################################################## @@ -62,7 +94,7 @@ __END__ =for stopwords Allbery DocKnot docknot MERCHANTABILITY NONINFRINGEMENT sublicense -submodules +submodules Kwalify =head1 NAME @@ -70,8 +102,8 @@ App::DocKnot - Documentation and software release management =head1 REQUIREMENTS -Perl 5.24 or later and the modules File::BaseDir and File::ShareDir, both of -which are available from CPAN. +Perl 5.24 or later and the modules File::BaseDir, File::ShareDir, Kwalify, and +YAML::XS, all of which are available from CPAN. =head1 DESCRIPTION @@ -96,6 +128,13 @@ overridden by the user via files in F<$HOME/.config/docknot> or F (or whatever $XDG_CONFIG_HOME and $XDG_CONFIG_DIRS are set to). Raises a text exception if the desired file could not be located. +=item load_yaml_file(PATH, SCHEMA) + +Load a YAML file with schema checking. PATH is the path to the file. +SCHEMA is the name of the schema, which will be loaded from the F +directory using appdata_path(). See the description of that method for the +paths that are searched. + =back =head1 AUTHOR diff --git a/lib/App/DocKnot/Config.pm b/lib/App/DocKnot/Config.pm index f67b489..f4a118b 100644 --- a/lib/App/DocKnot/Config.pm +++ b/lib/App/DocKnot/Config.pm @@ -18,43 +18,8 @@ use warnings; use Carp qw(croak); use File::BaseDir qw(config_files); -use Kwalify qw(validate); use YAML::XS (); -############################################################################## -# Helper methods -############################################################################## - -# Load a YAML file with schema checking. -# -# $path - Path to the YAML file to load -# $schema - Name of the schema file against which to check it -# -# Returns: Contents of the file as a hash -# Throws: YAML::XS exception on invalid file -# Text exception on schema mismatch -sub _load_yaml_file { - my ($self, $path, $schema) = @_; - - # Tell YAML::XS to use real booleans. Otherwise, Kwalify is unhappy with - # data elements set to false. - local $YAML::XS::Boolean = 'JSON::PP'; - - # Load the metadata and check it against the schema. - my $data_ref = YAML::XS::LoadFile($path); - my $schema_path = $self->appdata_path('schema', $schema); - my $schema_ref = YAML::XS::LoadFile($schema_path); - eval { validate($schema_ref, $data_ref) }; - if ($@) { - my $errors = $@; - chomp($errors); - die "schema validation for $path failed:\n$errors\n"; - } - - # Return the verified contents. - return $data_ref; -} - ############################################################################## # Public Interface ############################################################################## @@ -92,7 +57,7 @@ sub config { my ($self) = @_; # Load the package metadata. - my $data_ref = $self->_load_yaml_file($self->{metadata}, 'docknot.yaml'); + my $data_ref = $self->load_yaml_file($self->{metadata}, 'docknot'); # build.install defaults to true. if (!exists($data_ref->{build}{install})) { @@ -136,7 +101,7 @@ sub global_config { if (!defined($config_path)) { return {}; } - my $data_ref = $self->_load_yaml_file($config_path, 'config.yaml'); + my $data_ref = $self->load_yaml_file($config_path, 'config'); # Return the resulting configuration. return $data_ref; diff --git a/t/data/spin/output/software/docknot/api/app-docknot.html b/t/data/spin/output/software/docknot/api/app-docknot.html index 5076e73..ea3d829 100644 --- a/t/data/spin/output/software/docknot/api/app-docknot.html +++ b/t/data/spin/output/software/docknot/api/app-docknot.html @@ -45,8 +45,8 @@

REQUIREMENTS

-Perl 5.24 or later and the modules File::BaseDir and File::ShareDir, both of -which are available from CPAN. +Perl 5.24 or later and the modules File::BaseDir, File::ShareDir, Kwalify, and +YAML::XS, all of which are available from CPAN.

DESCRIPTION

@@ -77,6 +77,14 @@ overridden by the user via files in $HOME/.config/docknot or /etc/xdg/docknot (or whatever $XDG_CONFIG_HOME and $XDG_CONFIG_DIRS are set to). Raises a text exception if the desired file could not be located.

+ +
load_yaml_file(PATH, SCHEMA)
+

+Load a YAML file with schema checking. PATH is the path to the file. +SCHEMA is the name of the schema, which will be loaded from the schema +directory using appdata_path(). See the description of that method for the +paths that are searched. +

AUTHOR

-- cgit v1.2.3 From 75c60cbc6a3c81f1991fac42966e13fa3cc77b51 Mon Sep 17 00:00:00 2001 From: Russ Allbery Date: Thu, 23 Dec 2021 16:25:43 -0800 Subject: Add *.spin pointers and Markdown support Add a new *.spin input file for docknot spin that points to an external file with instructions for how to convert it to HTML. Via this mechanism, support formatting Markdown files as HTML via docknot spin. This support requires the pandoc program be installed. The path to pandoc may be specified in the DocKnot global configuration file. Remove an extra blank line after the leading navbar in output converted from thread. --- .github/workflows/build.yaml | 2 + Changes | 8 +- lib/App/DocKnot/Spin.pm | 20 +- lib/App/DocKnot/Spin/Pointer.pm | 379 +++++++++++++++++++++ lib/App/DocKnot/Spin/Sitemap.pm | 1 - lib/App/DocKnot/Spin/Thread.pm | 8 +- share/schema/config.yaml | 2 + share/schema/pointer.yaml | 20 ++ share/templates/html.tmpl | 22 ++ t/data/spin/markdown/input/.sitemap | 4 + t/data/spin/markdown/input/other.spin | 3 + t/data/spin/markdown/input/test.spin | 3 + t/data/spin/markdown/output/other.html | 42 +++ t/data/spin/markdown/output/test.html | 42 +++ t/data/spin/markdown/test.md | 9 + .../output/software/docknot/api/app-docknot.html | 1 - t/data/spin/output/software/docknot/index.html | 1 - t/data/spin/output/software/index.html | 1 - t/data/spin/output/usefor/index.html | 1 - t/lib/Test/DocKnot/Spin.pm | 2 +- t/spin/markdown.t | 56 +++ t/spin/sitemap.t | 1 - t/style/coverage.t | 5 +- 23 files changed, 618 insertions(+), 15 deletions(-) create mode 100644 lib/App/DocKnot/Spin/Pointer.pm create mode 100644 share/schema/pointer.yaml create mode 100644 share/templates/html.tmpl create mode 100644 t/data/spin/markdown/input/.sitemap create mode 100644 t/data/spin/markdown/input/other.spin create mode 100644 t/data/spin/markdown/input/test.spin create mode 100644 t/data/spin/markdown/output/other.html create mode 100644 t/data/spin/markdown/output/test.html create mode 100644 t/data/spin/markdown/test.md create mode 100755 t/spin/markdown.t diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 935056e..85b7dfa 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -36,6 +36,8 @@ jobs: steps: - uses: actions/checkout@v2 + - name: Install pandoc + run: apt-get -y --no-install-recommends install pandoc - uses: perl-actions/install-with-cpm@v1.4 with: cpanfile: "cpanfile" diff --git a/Changes b/Changes index 05eeb0a..9d14a27 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,12 @@ Revision history for DocKnot -5.01 - Not Released +6.00 - Not Released + + - Add a new *.spin input file for docknot spin that points to an external + file with instructions for how to convert it to HTML. Via this + mechanism, support formatting Markdown files as HTML via docknot spin. + This support requires the pandoc program be installed. The path to + pandoc may be specified in the DocKnot global configuration file. - Support creating distributions from branches named main rather than master. The first of main or master that's found in the repository diff --git a/lib/App/DocKnot/Spin.pm b/lib/App/DocKnot/Spin.pm index 655aa64..27b57e0 100644 --- a/lib/App/DocKnot/Spin.pm +++ b/lib/App/DocKnot/Spin.pm @@ -17,6 +17,7 @@ use 5.024; use autodie; use warnings; +use App::DocKnot::Spin::Pointer; use App::DocKnot::Spin::RSS; use App::DocKnot::Spin::Sitemap; use App::DocKnot::Spin::Thread; @@ -116,7 +117,7 @@ sub _footer { if ($self->{sitemap} && $self->{output}) { my $page = $out_path; $page =~ s{ \A \Q$self->{output}\E }{}xms; - $output .= join(q{}, $self->{sitemap}->navbar($page)); + $output .= join(q{}, $self->{sitemap}->navbar($page)) . "\n"; } # Figure out the modification dates. Use the RCS/CVS Id if available, @@ -427,6 +428,14 @@ sub _process_file { if (-e $rss_path) { $self->{rss}->generate($rss_path, $file); } + } elsif ($file =~ m{ [.] spin \z }xms) { + $output =~ s{ [.] spin \z }{.html}xms; + $shortout =~ s{ [.] spin \z }{.html}xms; + $self->{generated}{$output} = 1; + if ($self->{pointer}->is_out_of_date($input, $output)) { + _print_checked("Converting $shortout\n"); + $self->{pointer}->spin_pointer($input, $output); + } } elsif ($file =~ m{ [.] th \z }xms) { $output =~ s{ [.] th \z }{.html}xms; $shortout =~ s{ [.] th \z }{.html}xms; @@ -594,6 +603,15 @@ sub spin { }, ); + # Create the processor for pointers. + $self->{pointer} = App::DocKnot::Spin::Pointer->new( + { + output => $output, + sitemap => $self->{sitemap}, + 'style-url' => $self->{style_url}, + }, + ); + # Process the input tree. find( { diff --git a/lib/App/DocKnot/Spin/Pointer.pm b/lib/App/DocKnot/Spin/Pointer.pm new file mode 100644 index 0000000..969660f --- /dev/null +++ b/lib/App/DocKnot/Spin/Pointer.pm @@ -0,0 +1,379 @@ +# Generate HTML from a pointer to an external file. +# +# The input tree for spin may contain pointers to external files in various +# formats. This module parses those pointer files and performs the conversion +# of those external files into HTML. +# +# SPDX-License-Identifier: MIT + +############################################################################## +# Modules and declarations +############################################################################## + +package App::DocKnot::Spin::Pointer 5.00; + +use 5.024; +use autodie; +use parent qw(App::DocKnot); +use warnings; + +use App::DocKnot::Config; +use Carp qw(croak); +use Encode qw(decode encode); +use File::BaseDir qw(config_files); +use IPC::System::Simple qw(capturex); +use Kwalify qw(validate); +use POSIX qw(strftime); +use Template (); +use YAML::XS (); + +# The URL to the software page for all of my web page generation software, +# used to embed a link to the software that generated the page. +my $URL = 'https://www.eyrie.org/~eagle/software/web/'; + +############################################################################## +# Utility functions +############################################################################## + +# Check if a file, which may not exist, is newer than another list of files. +# +# $file - File whose timestamp to compare +# @others - Other files to compare against +# +# Returns: True if $file exists and is newer than @others, false otherwise +sub _is_newer { + my ($file, @others) = @_; + return if !-e $file; + my $file_mtime = (stat($file))[9]; + my @others_mtimes = map { (stat)[9] } @others; + return all { $file_mtime >= $_ } @others_mtimes; +} + +# print with error checking and an explicit file handle. autodie +# unfortunately can't help us because print can't be prototyped and hence +# can't be overridden. +# +# $fh - Output file handle +# $file - File name for error reporting +# @args - Remaining arguments to print +# +# Returns: undef +# Throws: Text exception on output failure +sub _print_fh { + my ($fh, $file, @args) = @_; + print {$fh} @args or croak("cannot write to $file: $!"); + return; +} + +############################################################################## +# Format conversions +############################################################################## + +# Convert a Markdown file to HTML. +# +# $data_ref - Data from the pointer file +# path - Path to the Markdown file to convert +# $output - Path to the output file +# +# Throws: Text exception on conversion failure +sub _spin_markdown { + my ($self, $data_ref, $output) = @_; + my $source = $data_ref->{path}; + + # Do the Markdown conversion using pandoc. + my $html = capturex( + $self->{pandoc_path}, '--wrap=preserve', '-f', 'markdown', + '-t', 'html', $source, + ); + + # Pull the title out of the contents of the

header if not set. + my $title = $data_ref->{title}; + if (!defined($title)) { + ($title) = $html =~ m{

]+ > (.*?)

}xms; + } + + # Construct the template variables. + my ($links, $navbar, $style); + if ($self->{sitemap}) { + my $page = $output; + $page =~ s{ \A \Q$self->{output}\E }{}xms; + my @links = $self->{sitemap}->links($page); + if (@links) { + $links = join(q{}, @links); + } + my @navbar = $self->{sitemap}->navbar($page); + if (@navbar) { + $navbar = join(q{}, @navbar); + } + } + if ($data_ref->{style}) { + $style = $self->{style_url} . $data_ref->{style}; + } + my %vars = ( + docknot_url => $URL, + html => decode('utf-8', $html), + links => $links, + modified => strftime('%Y-%m-%d', gmtime((stat($source))[9])), + navbar => $navbar, + now => strftime('%Y-%m-%d', gmtime()), + style => $style, + title => $title, + ); + + # Construct the output page from those template variables. + my $result; + $self->{template}->process($self->{template_path}, \%vars, \$result) + or croak($self->{template}->error()); + + # Write the result to the output file. + open(my $outfh, '>', $output); + _print_fh($outfh, $output, encode('utf-8', $result)); + close($outfh); + return; +} + +############################################################################## +# Public interface +############################################################################## + +# Create a new HTML converter for pointers. This object can (and should) be +# reused for all pointer conversions done while spinning a tree of files. +# +# $args - Anonymous hash of arguments with the following keys: +# docknot-url - URL to DocKnot itself for use in page footers +# output - Root of the output tree +# sitemap - App::DocKnot::Spin::Sitemap object +# style-url - Partial URL to style sheets +# +# Returns: Newly created object +# Throws: Text exception on failure to initialize Template Toolkit +sub new { + my ($class, $args_ref) = @_; + + # Get the configured path to pandoc, if any. + my $config_reader = App::DocKnot::Config->new(); + my $global_config_ref = $config_reader->global_config(); + my $pandoc = $global_config_ref->{pandoc} // 'pandoc'; + + # Add a trailing slash to the partial URL for style sheets. + my $style_url = $args_ref->{'style-url'} // q{}; + if ($style_url) { + $style_url =~ s{ /* \z }{/}xms; + } + + # Create and return the object. + my $tt = Template->new({ ABSOLUTE => 1 }) or croak(Template->error()); + my $self = { + output => $args_ref->{output}, + pandoc_path => $pandoc, + sitemap => $args_ref->{sitemap}, + style_url => $style_url, + template => $tt, + }; + bless($self, $class); + $self->{template_path} = $self->appdata_path('templates', 'html.tmpl'); + return $self; +} + +# Check if the result of a pointer file needs to be regenerated. +# +# $pointer - Pointer file to process +# $output - Corresponding output path +# +# Returns: True if the output file does not exist or has a modification date +# older than either the pointer file or the underlying source file, +# false otherwise +# Throws: YAML::XS exception on invalid pointer +sub is_out_of_date { + my ($self, $pointer, $output) = @_; + my $data_ref = $self->load_yaml_file($pointer, 'pointer'); + if (!-e $data_ref->{path}) { + die "$pointer: path $data_ref->{path} does not exist\n"; + } + return !_is_newer($output, $pointer, $data_ref->{path}); +} + +# Process a given pointer file. +# +# $pointer - Pointer file to process +# $output - Corresponding output path +# +# Throws: YAML::XS exception on invalid pointer +# Text exception for missing input file +# Text exception on failure to convert the file +sub spin_pointer { + my ($self, $pointer, $output, $options_ref) = @_; + my $data_ref = $self->load_yaml_file($pointer, 'pointer'); + + # Dispatch to the appropriate conversion function. + if ($data_ref->{format} eq 'markdown') { + $self->_spin_markdown($data_ref, $output); + } else { + die "$pointer: unknown output format $data_ref->{format}\n"; + } + return; +} + +############################################################################## +# Module return value and documentation +############################################################################## + +1; + +__END__ + +=for stopwords +Allbery DocKnot MERCHANTABILITY NONINFRINGEMENT Kwalify sublicense unstyled + +=head1 NAME + +App::DocKnot::Spin::Pointer - Generate HTML from a pointer to an external file + +=head1 SYNOPSIS + + use App::DocKnot::Spin::Pointer; + use App::DocKnot::Spin::Sitemap; + + my $sitemap = App::DocKnot::Spin::Sitemap->new('/input/.sitemap'); + my $pointer = App::DocKnot::Spin::Pointer->new({ + output => '/output', + sitemap => $sitemap, + }); + $pointer->spin_pointer('/input/file.spin', '/output/file.html'); + +=head1 REQUIREMENTS + +Perl 5.24 or later and the modules File::ShareDir, Kwalify, and YAML::XS, all +of which are available from CPAN. + +=head1 DESCRIPTION + +The tree of input files for App::DocKnot::Spin may contain pointers to +external files in various formats. These files are in YAML format and end in +C<.spin>. This module processes those files and converts them to HTML and, if +so configured, adds the links to integrate the page with the rest of the site. + +For the details of the pointer file format, see L below. + +=head1 CLASS METHODS + +=over 4 + +=item new(ARGS) + +Create a new App::DocKnot::Spin::Pointer object. A single converter object +can be used repeatedly to convert pointers in a tree of files. ARGS should +be a hash reference with one or more of the following keys, all of which are +optional: + +=over 4 + +=item output + +The path to the root of the output tree when converting a tree of files. This +will be used to calculate relative path names for generating inter-page links +using the provided C argument. If C is given, this option +should also always be given. + +=item sitemap + +An App::DocKnot::Spin::Sitemap object. This will be used to create inter-page +links. For inter-page links, the C argument must also be provided. + +=item style-url + +The base URL for style sheets. A style sheet specified in a pointer file will +be considered to be relative to this URL and this URL will be prepended to it. +If this option is not given, the name of the style sheet will be used verbatim +as its URL, except with C<.css> appended. + +=back + +=back + +=head1 INSTANCE METHODS + +=over 4 + +=item is_out_of_date(POINTER, OUTPUT) + +Returns true if OUTPUT is missing or if it was modified less recently than the +modification time of either POINTER or the underlying file that it points to. + +=item spin_pointer(POINTER, OUTPUT) + +Convert a single pointer file to HTML. POINTER is the path to the pointer +file, and OUTPUT is the path to where to write the output. + +=back + +=head1 POINTER FILES + +A pointer file is a YAML file ending in C<.spin> that points to the source +file for a generated HTML page and provides additional configuration for its +conversion. The valid keys for a pointer file are: + +=over 4 + +=item format + +The format of the source file. The only valid value currently is C. +Required. + +=item path + +The path to the source file. It may be relative, in which case it's relative +to the pointer file. Required. + +=item style + +The style sheet to use for the converted output. Optional. If not set, the +converted output may be unstyled or may use a default style sheet appropriate +to the input format. + +=item title + +The title of the converted page. Optional. If not set, the title will be +taken from the converted file in a format-specific way. For Markdown, the +title will be the contents of the first top-level heading. + +=back + +=head1 AUTHOR + +Russ Allbery + +=head1 COPYRIGHT AND LICENSE + +Copyright 2021 Russ Allbery + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +=head1 SEE ALSO + +L, L, L + +This module is part of the App-DocKnot distribution. The current version of +DocKnot is available from CPAN, or directly from its web site at +L. + +=cut + +# Local Variables: +# copyright-at-end-flag: t diff --git a/lib/App/DocKnot/Spin/Sitemap.pm b/lib/App/DocKnot/Spin/Sitemap.pm index 038cc9f..1a37964 100644 --- a/lib/App/DocKnot/Spin/Sitemap.pm +++ b/lib/App/DocKnot/Spin/Sitemap.pm @@ -312,7 +312,6 @@ sub navbar { @breadcrumbs, $next_link, "\n", - "\n", ); } diff --git a/lib/App/DocKnot/Spin/Thread.pm b/lib/App/DocKnot/Spin/Thread.pm index 2523d8d..6669286 100644 --- a/lib/App/DocKnot/Spin/Thread.pm +++ b/lib/App/DocKnot/Spin/Thread.pm @@ -1262,7 +1262,7 @@ sub _cmd_signature { if ($self->{sitemap} && $self->{output}) { my $page = $self->{out_path}; $page =~ s{ \A \Q$self->{output}\E }{}xms; - $output .= join(q{}, $self->{sitemap}->navbar($page)); + $output .= join(q{}, $self->{sitemap}->navbar($page)) . "\n"; } # Figure out the modification dates. Use the Git repository if available. @@ -1277,12 +1277,12 @@ sub _cmd_signature { } # Determine which template to use and substitute in the appropriate times. - $output .= "
\n" . q{ } x 4; + $output .= "
\n"; my $link = qq{spun}; if ($modified eq $now) { - $output .= "Last modified and\n $link $modified\n"; + $output .= " Last modified and\n $link $modified\n"; } else { - $output .= "Last $link\n $now from thread modified $modified\n"; + $output .= " Last $link\n $now from thread modified $modified\n"; } # Close out the document. diff --git a/share/schema/config.yaml b/share/schema/config.yaml index d63f829..d49312c 100644 --- a/share/schema/config.yaml +++ b/share/schema/config.yaml @@ -8,5 +8,7 @@ type: map mapping: distdir: type: text + pandoc: + type: text pgp_key: type: text diff --git a/share/schema/pointer.yaml b/share/schema/pointer.yaml new file mode 100644 index 0000000..fc8232d --- /dev/null +++ b/share/schema/pointer.yaml @@ -0,0 +1,20 @@ +# Kwalify schema for spin pointers to external files. +# +# Copyright 2021 Russ Allbery +# +# SPDX-License-Identifier: MIT + +type: map +mapping: + format: + type: text + required: true + enum: + - markdown + path: + type: text + required: true + style: + type: text + title: + type: text diff --git a/share/templates/html.tmpl b/share/templates/html.tmpl new file mode 100644 index 0000000..c9c72db --- /dev/null +++ b/share/templates/html.tmpl @@ -0,0 +1,22 @@ + + + + + [% title %] + [% IF style %] + [% END %] +[% IF links %][% links %][% END %] + + +[% IF navbar %][% navbar %] +[% END %][% html %][% IF navbar %] +[% navbar %][% END %] +
[% IF modified == now %] + Last modified and + spun [% modified %][% ELSE %] + Last spun + [% now %] from Markdown modified [% modified %][% END %] + + diff --git a/t/data/spin/markdown/input/.sitemap b/t/data/spin/markdown/input/.sitemap new file mode 100644 index 0000000..8c523a1 --- /dev/null +++ b/t/data/spin/markdown/input/.sitemap @@ -0,0 +1,4 @@ +/: Test Root + /foo.html: Some document + /other.html: Other test Markdown + /test.html: Test Markdown diff --git a/t/data/spin/markdown/input/other.spin b/t/data/spin/markdown/input/other.spin new file mode 100644 index 0000000..000cefe --- /dev/null +++ b/t/data/spin/markdown/input/other.spin @@ -0,0 +1,3 @@ +format: markdown +path: ../test.md +title: Other test Markdown diff --git a/t/data/spin/markdown/input/test.spin b/t/data/spin/markdown/input/test.spin new file mode 100644 index 0000000..7927ae8 --- /dev/null +++ b/t/data/spin/markdown/input/test.spin @@ -0,0 +1,3 @@ +format: markdown +path: ../test.md +style: markdown.css diff --git a/t/data/spin/markdown/output/other.html b/t/data/spin/markdown/output/other.html new file mode 100644 index 0000000..8948c0b --- /dev/null +++ b/t/data/spin/markdown/output/other.html @@ -0,0 +1,42 @@ + + + + + Other test Markdown + + + + + + + + + + + + + + +

Test Markdown

+

This is a test Markdown document.

+

Another header

+

Another section.

+

Some Üniçodé¡

+ + + + + + + +
+ Last spun + %DATE% from thread modified %DATE% + + diff --git a/t/data/spin/markdown/output/test.html b/t/data/spin/markdown/output/test.html new file mode 100644 index 0000000..2e9178d --- /dev/null +++ b/t/data/spin/markdown/output/test.html @@ -0,0 +1,42 @@ + + + + + Test Markdown + + + + + + + + + + + + + + +

Test Markdown

+

This is a test Markdown document.

+

Another header

+

Another section.

+

Some Üniçodé¡

+ + + + + + + +
+ Last spun + %DATE% from thread modified %DATE% + + diff --git a/t/data/spin/markdown/test.md b/t/data/spin/markdown/test.md new file mode 100644 index 0000000..4d00f0f --- /dev/null +++ b/t/data/spin/markdown/test.md @@ -0,0 +1,9 @@ +# Test Markdown + +This is a test Markdown document. + +## Another header + +Another section. + +Some Ãœniçodé¡ diff --git a/t/data/spin/output/software/docknot/api/app-docknot.html b/t/data/spin/output/software/docknot/api/app-docknot.html index ea3d829..944c09c 100644 --- a/t/data/spin/output/software/docknot/api/app-docknot.html +++ b/t/data/spin/output/software/docknot/api/app-docknot.html @@ -27,7 +27,6 @@ App::DocKnot::Command > -

App::DocKnot

(Documentation and software release management)

diff --git a/t/data/spin/output/software/docknot/index.html b/t/data/spin/output/software/docknot/index.html index aed23d8..b0352b3 100644 --- a/t/data/spin/output/software/docknot/index.html +++ b/t/data/spin/output/software/docknot/index.html @@ -26,7 +26,6 @@ rra-c-util> > -

DocKnot