diff options
-rw-r--r-- | INSTALL | 2 | ||||
-rw-r--r-- | doc/manual.cli | 8 | ||||
-rw-r--r-- | libbrep/utility.hxx | 1 | ||||
-rw-r--r-- | mod/mod-ci.cxx | 14 | ||||
-rw-r--r-- | mod/mod-submit.cxx | 14 |
5 files changed, 10 insertions, 29 deletions
@@ -65,7 +65,7 @@ c) Install PostgreSQL and Apache2 development files. Specifically, we need files. Below are the names of their packages for some distributions: Debian/Ubuntu: libpq-dev libapr1-dev libapreq2-dev apache2-dev - Fedora/RHEL: posqtgresql-devel apr-devel libapreq2-devel httpd-devel + Fedora/RHEL: postgresql-devel apr-devel libapreq2-devel httpd-devel FreeBSD: postgresqlXY-client apr libapreq2 apache24 d) Unless you already have the build2 toolchain, install it by following diff --git a/doc/manual.cli b/doc/manual.cli index 61ef1f8..3b7f1ce 100644 --- a/doc/manual.cli +++ b/doc/manual.cli @@ -51,8 +51,8 @@ binary mode.| \li|Verify other parameters are valid manifest name/value pairs. -The value can only contain printable ASCII characters as well as tab -(\c{\\t}), carriage return (\c{\\r}), and line feed (\c{\\n}).| +The value can only contain UTF-8 encoded Unicode graphic characters as well as +tab (\c{\\t}), carriage return (\c{\\r}), and line feed (\c{\\n}).| \li|Check for a duplicate submission. @@ -228,8 +228,8 @@ upload.| \li|Verify other parameters are valid manifest name/value pairs. -The value can only contain printable ASCII characters as well as tab -(\c{\\t}), carriage return (\c{\\r}), and line feed (\c{\\n}).| +The value can only contain UTF-8 encoded Unicode graphic characters as well as +tab (\c{\\t}), carriage return (\c{\\r}), and line feed (\c{\\n}).| \li|Generate CI request id and create request directory. diff --git a/libbrep/utility.hxx b/libbrep/utility.hxx index 96cf1d4..8c4c579 100644 --- a/libbrep/utility.hxx +++ b/libbrep/utility.hxx @@ -27,6 +27,7 @@ namespace brep // <libbutl/utility.mxx> // + using butl::utf8; using butl::icasecmp; using butl::reverse_iterate; } diff --git a/mod/mod-ci.cxx b/mod/mod-ci.cxx index 5a56526..b6db669 100644 --- a/mod/mod-ci.cxx +++ b/mod/mod-ci.cxx @@ -265,23 +265,13 @@ handle (request& rq, response& rs) } // Verify that unknown parameter values satisfy the requirements (contain - // only ASCII printable characters plus '\r', '\n', and '\t'). + // only UTF-8 encoded graphic characters plus '\t', '\r', and '\n'). // // Actually, the expected ones must satisfy too, so check them as well. // - auto printable = [] (const string& s) -> bool - { - for (char c: s) - { - if (!((c >= 0x20 && c <= 0x7E) || c == '\n' || c == '\r' || c == '\t')) - return false; - } - return true; - }; - for (const name_value& nv: rps) { - if (nv.value && !printable (*nv.value)) + if (nv.value && !utf8 (*nv.value, codepoint_types::graphic, U"\r\n\t")) return respond_manifest (400, "invalid parameter " + nv.name); } diff --git a/mod/mod-submit.cxx b/mod/mod-submit.cxx index 3130823..2dd8591 100644 --- a/mod/mod-submit.cxx +++ b/mod/mod-submit.cxx @@ -254,23 +254,13 @@ handle (request& rq, response& rs) return respond_manifest (400, "invalid package archive checksum"); // Verify that unknown parameter values satisfy the requirements (contain - // only ASCII printable characters plus '\r', '\n', and '\t'). + // only UTF-8 encoded graphic characters plus '\t', '\r', and '\n'). // // Actually, the expected ones must satisfy too, so check them as well. // - auto printable = [] (const string& s) -> bool - { - for (char c: s) - { - if (!((c >= 0x20 && c <= 0x7E) || c == '\n' || c == '\r' || c == '\t')) - return false; - } - return true; - }; - for (const name_value& nv: rps) { - if (nv.value && !printable (*nv.value)) + if (nv.value && !utf8 (*nv.value, codepoint_types::graphic, U"\r\n\t")) return respond_manifest (400, "invalid parameter " + nv.name); } |