diff --git a/CMakeLists.txt b/CMakeLists.txt index 00b82c0..0666db1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,7 @@ cmake_minimum_required(VERSION 3.16) # also find the version number here. generate_auto_job also reads the # version from here. project(qpdf - VERSION 12.3.1 + VERSION 12.3.2 LANGUAGES C CXX) # Honor CMAKE_REQUIRED_LIBRARIES when checking for include files. This diff --git a/include/qpdf/DLL.h b/include/qpdf/DLL.h index 3c05672..cc6dcbb 100644 --- a/include/qpdf/DLL.h +++ b/include/qpdf/DLL.h @@ -27,12 +27,12 @@ /* The first version of qpdf to include the version constants is 10.6.0. */ #define QPDF_MAJOR_VERSION 12 #define QPDF_MINOR_VERSION 3 -#define QPDF_PATCH_VERSION 1 +#define QPDF_PATCH_VERSION 2 #ifdef QPDF_FUTURE -# define QPDF_VERSION "12.3.1+future" +# define QPDF_VERSION "12.3.2+future" #else -# define QPDF_VERSION "12.3.1" +# define QPDF_VERSION "12.3.2" #endif /* diff --git a/job.sums b/job.sums index 62c564a..cbbbe57 100644 --- a/job.sums +++ b/job.sums @@ -1,5 +1,5 @@ # Generated by generate_auto_job -CMakeLists.txt 7ff9aa661d492874c4a14819401031656fb4386a4430f433b6f127e7d4fa5fe3 +CMakeLists.txt 9ed8b0574b60d0625004b4f578089166d10c3d2f2bfc61edf94c105020d82264 generate_auto_job 8e3175a515aa8837d8a01bba0346b04b3d777d70330ba5b7d52f691316054a34 include/qpdf/auto_job_c_att.hh 4c2b171ea00531db54720bf49a43f8b34481586ae7fb6cbf225099ee42bc5bb4 include/qpdf/auto_job_c_copy_att.hh 50609012bff14fd82f0649185940d617d05d530cdc522185c7f3920a561ccb42 @@ -17,5 +17,5 @@ libqpdf/qpdf/auto_job_json_init.hh 33934c23235c760a1fc1375c74f4fd52c8f5accf655c5 libqpdf/qpdf/auto_job_schema.hh 81b8d57f05f5125a722912b6ee5e10fc6b02ae68e040108b75f32fc6527c02b1 manual/_ext/qpdf.py 6add6321666031d55ed4aedf7c00e5662bba856dfcd66ccb526563bffefbb580 manual/cli.rst efbce4b34fefbe1f46fca9c9693af245a7f7e2b63c0853c464569087aa49cb18 -manual/qpdf.1 5a944d1d3684fc240fbb5a80885a364a31dcfa1cdd9bcdcb30885db09b335a3e +manual/qpdf.1 0783e8741f21ed28b3d3d2c5e07beb7eef6e227dd82bd0b316a17875f39f1589 manual/qpdf.1.in 436ecc85d45c4c9e2dbd1725fb7f0177fb627179469f114561adf3cb6cbb677b diff --git a/libqpdf/QPDFJob.cc b/libqpdf/QPDFJob.cc index db6718a..c972706 100644 --- a/libqpdf/QPDFJob.cc +++ b/libqpdf/QPDFJob.cc @@ -2505,9 +2505,13 @@ void QPDFJob::Selection::password(std::string password) { auto& in = input(); - if (!in.password.empty()) { + if (password_provided) { usage("--password already specified for this file"); } + if (!(in.password.empty() || in.password == password)) { + usage("different --password already specified for this file"); + } + password_provided = true; in.password = password; } diff --git a/libqpdf/qpdf/QPDFJob_private.hh b/libqpdf/qpdf/QPDFJob_private.hh index 86e4007..bc36fdb 100644 --- a/libqpdf/qpdf/QPDFJob_private.hh +++ b/libqpdf/qpdf/QPDFJob_private.hh @@ -29,6 +29,7 @@ struct QPDFJob::Selection std::pair* in_entry{nullptr}; std::string range; // An empty range means all pages. std::vector selected_pages; + bool password_provided{false}; }; // A single input PDF. diff --git a/manual/qpdf.1 b/manual/qpdf.1 index 60ca32d..fc40392 100644 --- a/manual/qpdf.1 +++ b/manual/qpdf.1 @@ -3,7 +3,7 @@ .\" Edits will be automatically overwritten if the build is .\" run in maintainer mode. .\" -.TH QPDF "1" "" "qpdf version 12.3.1" "User Commands" +.TH QPDF "1" "" "qpdf version 12.3.2" "User Commands" .SH NAME qpdf \- PDF transformation software .SH SYNOPSIS diff --git a/manual/release-notes.rst b/manual/release-notes.rst index d84e971..72c385b 100644 --- a/manual/release-notes.rst +++ b/manual/release-notes.rst @@ -13,6 +13,13 @@ more detail. .. x.y.z: not yet released +12.3.2: not yet released + - Bug fixes + + - Fix bug introduced in 12.3.0. If the :qpdf:ref:`--password` was specified + for the same file multiple times a usage error was thrown. Specifying + the the password multiple times is common within the :qpdf:ref:`--pages` + option when using the QPDFJob interface. 12.3.1: January 19, 2026 - Bug fixes diff --git a/qpdf/qtest/arg-parsing.test b/qpdf/qtest/arg-parsing.test index a5eefd3..2546b2c 100644 --- a/qpdf/qtest/arg-parsing.test +++ b/qpdf/qtest/arg-parsing.test @@ -15,7 +15,7 @@ cleanup(); my $td = new TestDriver('arg-parsing'); -my $n_tests = 33; +my $n_tests = 35; $td->runtest("required argument", {$td->COMMAND => "qpdf --password minimal.pdf"}, @@ -88,6 +88,16 @@ $td->runtest("duplicated pages password", {$td->REGEXP => ".*password already specified.*", $td->EXIT_STATUS => 2}, $td->NORMALIZE_NEWLINES); +$td->runtest("inconsistent pages passwords", + {$td->COMMAND => "qpdf --pages . --password=z --range=1 . --password=y --range=2 --"}, + {$td->REGEXP => ".*different --password already specified.*", + $td->EXIT_STATUS => 2}, + $td->NORMALIZE_NEWLINES); +$td->runtest("consistent pages passwords", + {$td->COMMAND => "qpdf --pages . --password=z --range=1 . --password=z --range=2 --"}, + {$td->REGEXP => ".*an input file name is required.*", + $td->EXIT_STATUS => 2}, + $td->NORMALIZE_NEWLINES); $td->runtest("v1-only objects json-key", {$td->COMMAND => "qpdf --json=2 --json-key=objects minimal.pdf"}, {$td->REGEXP => ".*\"objects\" and \"objectinfo\" are " .