X-Original-To: alpine-aports@mail.alpinelinux.org Delivered-To: alpine-aports@mail.alpinelinux.org Received: from mail.alpinelinux.org (dallas-a1.alpinelinux.org [127.0.0.1]) by mail.alpinelinux.org (Postfix) with ESMTP id E2A5ADC1934 for ; Tue, 20 Oct 2015 21:42:23 +0000 (UTC) Received: from mail-wi0-f182.google.com (mail-wi0-f182.google.com [209.85.212.182]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mail.alpinelinux.org (Postfix) with ESMTPS id 61783DC009F for ; Tue, 20 Oct 2015 21:42:22 +0000 (UTC) Received: by wicll6 with SMTP id ll6so48141845wic.1 for ; Tue, 20 Oct 2015 14:42:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=przytarski.com; s=google; h=from:to:cc:subject:date:message-id; bh=tnfVb9t79okgDrQhBQ1rGYRy1aoluERLt0uTCfFjlGk=; b=XAXywZ5GXft8o2V+GIdRKyaGWFs8hOgsmzfrCYifocHa+DLn8WWTrENIL8J4rarWjy euuECQIXcJYfejZfNJgPGclNirhi2Iu7ne8PnF2oO7/xf8u0juPAz3rgeiPkTC3iDyqk ir8RbA8JWerYwbToyYmHzlMeSLidv2Tzn3Xpc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=tnfVb9t79okgDrQhBQ1rGYRy1aoluERLt0uTCfFjlGk=; b=eFkOJKfAyoPet4Sy/DWcH0Fj7GcNLkbynf+V0wdda1RP/+0lfIxCnHF+juFwZ1/Fzd 0easwFVgOdcRpszj9cW4paa/a3jcNcFjLYLrKbVMzgn0cOlqn/ug4xR5iMpL9G4ovp3w ckwoFE4h9wWRDAPqva5Huep4AkkrDryr4clqz8r1EjYYS/GV36vn84P+RYie6Gf+FIYT aPHimv4BiUOvbpNr3j5dtxo6MXFOTO8pqRVLT6FZwmkbgyH/iZhiri7QItRWlrpHlCEr 181kM+XdUbosiRtD8Y4vwv2BVirDp8QKn0z7FfT44bnQkAJ5r+xFKaq1jHI01LGE3gdh BA0A== X-Gm-Message-State: ALoCoQnHqFSFTMvV/FTpvIvqo+TZgp1RGF5p3YYDGtcXH04dly/dM6GLCYFVftkc6pNhYF5TQ939 X-Received: by 10.180.92.201 with SMTP id co9mr22331542wib.9.1445377341123; Tue, 20 Oct 2015 14:42:21 -0700 (PDT) Received: from shafire-x86_64.alpinelinux.org (176-20-159-88.business.edutel.nl. [88.159.20.176]) by smtp.gmail.com with ESMTPSA id bk4sm6242956wjc.1.2015.10.20.14.42.20 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 20 Oct 2015 14:42:20 -0700 (PDT) From: Dennis Przytarski To: alpine-aports@lists.alpinelinux.org Cc: Dennis Przytarski Subject: [alpine-aports] [PATCH] testing/knot: upgrade to 2.0.1 Date: Tue, 20 Oct 2015 21:42:14 +0000 Message-Id: <1445377334-18356-1-git-send-email-dennis@przytarski.com> X-Mailer: git-send-email 2.4.1 X-Virus-Scanned: ClamAV using ClamSMTP X-Mailinglist: alpine-aports Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: --- testing/knot/APKBUILD | 21 ++- testing/knot/dnssec-timestamps.patch | 307 ----------------------------------- testing/knot/wire-ctx.patch | 20 +++ 3 files changed, 30 insertions(+), 318 deletions(-) delete mode 100644 testing/knot/dnssec-timestamps.patch create mode 100644 testing/knot/wire-ctx.patch diff --git a/testing/knot/APKBUILD b/testing/knot/APKBUILD index 8cab834..3d4604f 100644 --- a/testing/knot/APKBUILD +++ b/testing/knot/APKBUILD @@ -2,8 +2,8 @@ # Contributor: Dennis Przytarski # Maintainer: Francesco Colista pkgname=knot -pkgver=2.0.0 -pkgrel=2 +pkgver=2.0.1 +pkgrel=0 pkgdesc="An high-performance authoritative-only DNS server" url="https://www.knot-dns.cz" arch="all" @@ -12,7 +12,7 @@ options="" depends="" depends_dev="gnutls-dev jansson-dev libcap-ng-dev libidn-dev openssl-dev userspace-rcu-dev zlib-dev" -makedepends="$depends_dev automake autoconf m4 bison flex perl libtool" +makedepends="$depends_dev m4 bison flex perl libtool" install="$pkgname.pre-install $pkgname.post-install" pkgusers="knot" pkggroups="knot" @@ -20,7 +20,7 @@ subpackages="$pkgname-dev $pkgname-doc" source="https://secure.nic.cz/files/knot-dns/${pkgname}-${pkgver}.tar.xz knotd.confd knotd.initd - dnssec-timestamps.patch" + wire-ctx.patch" _builddir="$srcdir"/$pkgname-$pkgver prepare() { @@ -35,7 +35,6 @@ prepare() { build() { cd "$_builddir" - autoreconf -if ./configure \ --build=$CBUILD \ --host=$CHOST \ @@ -61,15 +60,15 @@ package() { chmod 750 "${pkgdir}"/var/run/$pkgname } -md5sums="5d74b864640c32af3e125995a560fb38 knot-2.0.0.tar.xz +md5sums="96c128b890767bdb2f61e6d47e6622e5 knot-2.0.1.tar.xz 66f3111080662280d95bc928d6ca92d5 knotd.confd 5bdbc22866a28caae068e65d53916915 knotd.initd -9f43e63b3aa28e89ae6dc76a9c271bba dnssec-timestamps.patch" -sha256sums="28b2277647f618ea7edba741fd6685a8b1fc17d3a178b48f4ca7f2a43359998f knot-2.0.0.tar.xz +7cb1a48510736d38ff960af8cb602c1f wire-ctx.patch" +sha256sums="183bac1f23cb3996731c8161889ff5c1e2f99b9a6d8690390a2a23af433d6ce6 knot-2.0.1.tar.xz ff384d428c9e67139ed21b0c78eabf6a26d96f31775f6143ce0c4f9c4f6beaf3 knotd.confd c7690f1c4f748f436faa9e305ecbbb3d05e5cc50493eb10ca92bc73365578428 knotd.initd -dc5f77bfba14a5d3c49a962fa3ae0b8db8422c97e09c53c253acba2ead6dfcdb dnssec-timestamps.patch" -sha512sums="52482132759294a41ad91c2f4f13ee985b79776f7f90a02e79ed96f2a1925872c5c6dc38f04a96144b4b21994d336850b718f2c834f09d03f3049a75dc5b1a5d knot-2.0.0.tar.xz +1b7a3bf4b14133ccbe8a034ced47aeb2af1987b26b372d50c3aeb5702bc2235b wire-ctx.patch" +sha512sums="b74069a6da4eb0f456a3bd38318712f467f736af1712a14772f7e539b009c02f8e447c2fcd21f5005a2a4906466294ab6b46e7782aac3b88619063aed14cddb5 knot-2.0.1.tar.xz 471d3c639a8235ba09491c99d36c0a4f1074d6055ccfd3807be02a30d3ed5bbe69a84f0414ea7810db6bbc1e38f5837108e5744fc59f949ed78a262a7de4597e knotd.confd b6cd5b52ba65f9726164b21003fe0a0fc54f4f51aa7bbbcfd5b83aa4466e5224567a26c9c8ede13ac6a8090706e975e3220456112b20eb45304c9d92be7fb3d3 knotd.initd -c00fdd36930261f86db7ef71c32e1ba310bff2fdc6f797c8bcc8b91dbfe1576e0802915d18ee76e1ce707e48a0bae473b79d478914aa4102d916689459491003 dnssec-timestamps.patch" +563e202aff1a32116e51496dbb451e8fd47c289f6dbb935630e0f3a664c4c1ebf6d9733f1a5fed1f62cd7e6b152ebaf103b60ca5d535c5c3b006549c54016953 wire-ctx.patch" diff --git a/testing/knot/dnssec-timestamps.patch b/testing/knot/dnssec-timestamps.patch deleted file mode 100644 index d774eff..0000000 --- a/testing/knot/dnssec-timestamps.patch +++ /dev/null @@ -1,307 +0,0 @@ -diff --git a/src/dnssec/Makefile.am b/src/dnssec/Makefile.am -index 46b4377..f6398a6 100644 ---- a/src/dnssec/Makefile.am -+++ b/src/dnssec/Makefile.am -@@ -38,6 +38,8 @@ libshared_la_SOURCES = \ - shared/pem.h \ - shared/shared.h \ - shared/strtonum.h \ -+ shared/timestamp.c \ -+ shared/timestamp.h \ - shared/wire.h - - libdnssec_la_CPPFLAGS = \ -diff --git a/src/dnssec/lib/kasp/dir/json.c b/src/dnssec/lib/kasp/dir/json.c -index 333374a..a7f3aa9 100644 ---- a/src/dnssec/lib/kasp/dir/json.c -+++ b/src/dnssec/lib/kasp/dir/json.c -@@ -23,9 +23,7 @@ - #include "key.h" - #include "shared.h" - #include "strtonum.h" -- --// ISO 8610 --#define TIME_FORMAT "%Y-%m-%dT%H:%M:%S%z" -+#include "timestamp.h" - - int decode_ignore(_unused_ const json_t *value, _unused_ void *result) - { -@@ -279,14 +277,10 @@ int decode_time(const json_t *value, void *result) - } - - const char *time_str = json_string_value(value); -- struct tm tm = { 0 }; -- char *end = strptime(time_str, TIME_FORMAT, &tm); -- if (end == NULL || *end != '\0') { -+ if (!timestamp_read(time_str, time_ptr)) { - return DNSSEC_CONFIG_MALFORMED; - } - -- *time_ptr = timegm(&tm); -- - return DNSSEC_EOK; - } - -@@ -302,14 +296,8 @@ int encode_time(const void *value, json_t **result) - return DNSSEC_EOK; - } - -- struct tm tm = { 0 }; -- if (!gmtime_r(time_ptr, &tm)) { -- return DNSSEC_CONFIG_MALFORMED; -- } -- - char buffer[128] = { 0 }; -- int written = strftime(buffer, sizeof(buffer), TIME_FORMAT, &tm); -- if (written == 0) { -+ if (!timestamp_write(buffer, sizeof(buffer), *time_ptr)) { - return DNSSEC_CONFIG_MALFORMED; - } - -diff --git a/src/dnssec/shared/timestamp.c b/src/dnssec/shared/timestamp.c -new file mode 100644 -index 0000000..37279a8 ---- /dev/null -+++ b/src/dnssec/shared/timestamp.c -@@ -0,0 +1,96 @@ -+/* Copyright (C) 2015 CZ.NIC, z.s.p.o. -+ -+ This program is free software: you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation, either version 3 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program. If not, see . -+*/ -+ -+#include -+#include -+#include -+ -+#include "shared.h" -+ -+/* -+ * POSIX strftime supports '%z', strptime doesn't. -+ */ -+#define TIME_FORMAT "%Y-%m-%dT%H:%M:%S" -+ -+/*! -+ * Read time zone offset in +hhmm or -hhmm format. -+ * -+ * Format written by '%z' specifier in \ref strftime. -+ */ -+static bool read_timezone(const char *buffer, int *offset) -+{ -+ assert(buffer); -+ -+ if (strlen(buffer) != 5) { -+ return false; -+ } -+ -+ char sign; -+ unsigned hours, mins; -+ if (sscanf(buffer, "%c%2u%2u", &sign, &hours, &mins) != 3) { -+ return false; -+ } -+ -+ if (sign != '+' && sign != '-') { -+ return false; -+ } -+ -+ if (hours > 23 || mins > 59) { -+ return false; -+ } -+ -+ *offset = (sign == '+' ? 1 : -1) * (hours * 3600 + mins * 60); -+ -+ return true; -+} -+ -+_public_ -+bool timestamp_write(char *buffer, size_t size, time_t timestamp) -+{ -+ if (!buffer) { -+ return false; -+ } -+ -+ struct tm tm = { 0 }; -+ if (!gmtime_r(×tamp, &tm)) { -+ return false; -+ } -+ -+ return strftime(buffer, size, TIME_FORMAT "+0000", &tm) != 0; -+} -+ -+_public_ -+bool timestamp_read(const char *buffer, time_t *timestamp_ptr) -+{ -+ if (!buffer || !timestamp_ptr) { -+ return false; -+ } -+ -+ struct tm tm = { 0 }; -+ const char *timezone = strptime(buffer, TIME_FORMAT, &tm); -+ if (timezone == NULL) { -+ return false; -+ } -+ -+ int gmtoff = 0; -+ if (!read_timezone(timezone, &gmtoff)) { -+ return false; -+ } -+ -+ *timestamp_ptr = timegm(&tm) - gmtoff; -+ -+ return true; -+} -diff --git a/src/dnssec/shared/timestamp.h b/src/dnssec/shared/timestamp.h -new file mode 100644 -index 0000000..2cec029 ---- /dev/null -+++ b/src/dnssec/shared/timestamp.h -@@ -0,0 +1,46 @@ -+/* Copyright (C) 2015 CZ.NIC, z.s.p.o. -+ -+ This program is free software: you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation, either version 3 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program. If not, see . -+*/ -+ -+#pragma once -+ -+#include -+#include -+ -+/* -+ * The ISO 8610 'YYYY-MM-DDThh:mm:ss+zzzz' format is used. -+ */ -+ -+/*! -+ * Write time stamp into a string buffer. -+ * -+ * \param buffer Buffer to write time stamp into. -+ * \param size Size of the output buffer. -+ * \param timestamp Time stamp value to be written. -+ * -+ * \return Time stamp was written successfully. -+ * -+ */ -+bool timestamp_write(char *buffer, size_t size, time_t timestamp); -+ -+/*! -+ * Read a time stamp from a string buffer. -+ * -+ * \param[in] buffer Buffer to read time stamp from. -+ * \param[out] timestamp Read time stamp value. -+ * -+ * \return Time stamp was read successfully. -+ */ -+bool timestamp_read(const char *buffer, time_t *timestamp); -diff --git a/src/dnssec/tests/Makefile.am b/src/dnssec/tests/Makefile.am -index 0d81130..3677eb5 100644 ---- a/src/dnssec/tests/Makefile.am -+++ b/src/dnssec/tests/Makefile.am -@@ -43,6 +43,7 @@ check_PROGRAMS = \ - shared_bignum \ - shared_dname \ - shared_strtonum \ -+ shared_timestamp \ - shared_wire \ - tsig - -diff --git a/src/dnssec/tests/shared_timestamp.c b/src/dnssec/tests/shared_timestamp.c -new file mode 100644 -index 0000000..6024c80 ---- /dev/null -+++ b/src/dnssec/tests/shared_timestamp.c -@@ -0,0 +1,75 @@ -+/* Copyright (C) 2015 CZ.NIC, z.s.p.o. -+ -+ This program is free software: you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation, either version 3 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program. If not, see . -+*/ -+ -+#include -+#include -+ -+#include "timestamp.h" -+ -+int main(int argc, char *argv[]) -+{ -+ plan_lazy(); -+ -+ char buffer[128] = { 0 }; -+ -+ ok(timestamp_write(NULL, 0, 0) == false, -+ "timestamp_write: no buffer"); -+ ok(timestamp_write(buffer, 10, 0) == false, -+ "timestamp_write: small buffer"); -+ ok(timestamp_write(buffer, sizeof(buffer), 0) && -+ strcmp(buffer, "1970-01-01T00:00:00+0000") == 0, -+ "timestamp_write: epoch begin"); -+ ok(timestamp_write(buffer, sizeof(buffer), 1439554225) && -+ strcmp(buffer, "2015-08-14T12:10:25+0000") == 0, -+ "timestamp_write: date in past"); -+ ok(timestamp_write(buffer, sizeof(buffer), 2147483646) && -+ strcmp(buffer, "2038-01-19T03:14:06+0000") == 0, -+ "timestamp_write: date in future (likely)"); -+ -+ time_t ts = 0; -+ -+ ok(timestamp_read(NULL, &ts) == false, -+ "timestamp_read: no buffer"); -+ ok(timestamp_read("", NULL) == false, -+ "timestamp_read: no output"); -+ ok(timestamp_read("", &ts) == false, -+ "timestamp_read: empty input"); -+ ok(timestamp_read("1970-01-01T00:00:00", &ts) == false, -+ "timestamp_read: missing time zone"); -+ ok(timestamp_read("1970-01-01T00:00:00+000", &ts) == false, -+ "timestamp_read: malformed time zone"); -+ ok(timestamp_read("1970-01-01T00:00:00+2400", &ts) == false, -+ "timestamp_read: malformed time zone hours"); -+ ok(timestamp_read("1970-01-01T00:00:00+0090", &ts) == false, -+ "timestamp_read: malformed time zone minuts"); -+ ok(timestamp_read("1970-01-01T00:00:01+0000", &ts) && ts == 1, -+ "timestamp_read: first second since epoch"); -+ ok(timestamp_read("2009-02-13T23:31:31+0000", &ts) && ts == 1234567891, -+ "timestamp_read: date in past"); -+ ok(timestamp_read("2034-05-05T01:24:20+0000", &ts) && ts == 2030405060, -+ "timestamp_read: date in future (likely)"); -+ -+ ok(timestamp_read("2015-08-14T14:25:46+0200", &ts) && -+ timestamp_write(buffer, sizeof(buffer), ts) && -+ strcmp(buffer, "2015-08-14T12:25:46+0000") == 0, -+ "timestamp convert time zone (east)"); -+ ok(timestamp_read("2015-08-14T10:19:17-0230", &ts) && -+ timestamp_write(buffer, sizeof(buffer), ts) && -+ strcmp(buffer, "2015-08-14T12:49:17+0000") == 0, -+ "timestamp convert time zone (west)"); -+ -+ return 0; -+} diff --git a/testing/knot/wire-ctx.patch b/testing/knot/wire-ctx.patch new file mode 100644 index 0000000..1dc276d --- /dev/null +++ b/testing/knot/wire-ctx.patch @@ -0,0 +1,20 @@ +diff --git a/src/libknot/internal/wire_ctx.h b/src/libknot/internal/wire_ctx.h +index ae15390..a96250f 100644 +--- a/src/libknot/internal/wire_ctx.h ++++ b/src/libknot/internal/wire_ctx.h +@@ -18,11 +18,14 @@ + + #include + #include ++#include ++#include + #include ++#include + +-#include "libknot/rdata.h" + #include "libknot/internal/endian.h" + #include "libknot/internal/errcode.h" ++#include "libknot/rdata.h" + + /*! + * \brief Struct to keep the wire context. -- 2.4.1 --- Unsubscribe: alpine-aports+unsubscribe@lists.alpinelinux.org Help: alpine-aports+help@lists.alpinelinux.org ---