public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Mike Gilbert" <floppym@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/systemd/files/, sys-apps/systemd/
Date: Sun, 13 Aug 2017 23:32:43 +0000 (UTC)	[thread overview]
Message-ID: <1502667160.4ad264dbae71c361b268ef521ace36d81b118dc8.floppym@gentoo> (raw)

commit:     4ad264dbae71c361b268ef521ace36d81b118dc8
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Sun Aug 13 23:32:31 2017 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Sun Aug 13 23:32:40 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4ad264db

sys-apps/systemd: backport bug fixes

Bug: https://bugs.gentoo.org/625970
Bug: https://bugs.gentoo.org/625480
Package-Manager: Portage-2.3.6_p34, Repoman-2.3.3_p12

 ...-look-for-generators-in-usr-lib-systemd-s.patch |  4 +-
 ...0002-cryptsetup-fix-infinite-timeout-6486.patch | 43 ++++++++++
 ...ke-sure-idn2-conversions-are-roundtrippab.patch | 92 ++++++++++++++++++++++
 ...systemd-234-r2.ebuild => systemd-234-r3.ebuild} |  2 +
 4 files changed, 139 insertions(+), 2 deletions(-)

diff --git a/sys-apps/systemd/files/234-0001-path-lookup-look-for-generators-in-usr-lib-systemd-s.patch b/sys-apps/systemd/files/234-0001-path-lookup-look-for-generators-in-usr-lib-systemd-s.patch
index 47e2730a7b3..6912b481f20 100644
--- a/sys-apps/systemd/files/234-0001-path-lookup-look-for-generators-in-usr-lib-systemd-s.patch
+++ b/sys-apps/systemd/files/234-0001-path-lookup-look-for-generators-in-usr-lib-systemd-s.patch
@@ -1,7 +1,7 @@
 From d9287b10d714175521e3bcd6c53de4819b1357c5 Mon Sep 17 00:00:00 2001
 From: Mike Gilbert <floppym@gentoo.org>
 Date: Mon, 17 Jul 2017 11:21:25 -0400
-Subject: [PATCH] path-lookup: look for generators in
+Subject: [PATCH 1/3] path-lookup: look for generators in
  {,/usr}/lib/systemd/system-generators
 
 Bug: https://bugs.gentoo.org/625402
@@ -23,5 +23,5 @@ index e2b3f8b74..1ee0e1cdb 100644
                                  NULL);
  
 -- 
-2.13.3
+2.14.0
 

diff --git a/sys-apps/systemd/files/234-0002-cryptsetup-fix-infinite-timeout-6486.patch b/sys-apps/systemd/files/234-0002-cryptsetup-fix-infinite-timeout-6486.patch
new file mode 100644
index 00000000000..8ea131adfd0
--- /dev/null
+++ b/sys-apps/systemd/files/234-0002-cryptsetup-fix-infinite-timeout-6486.patch
@@ -0,0 +1,43 @@
+From 793c786f470aeedf443686cff30f97acaff23a04 Mon Sep 17 00:00:00 2001
+From: Andrew Soutar <andrew@andrewsoutar.com>
+Date: Mon, 31 Jul 2017 02:19:16 -0400
+Subject: [PATCH 2/3] cryptsetup: fix infinite timeout (#6486)
+
+0004f698d causes `arg_timeout` to be infinity instead of 0 when timeout=0. The
+logic here now matches this change.
+
+Fixes #6381
+---
+ src/cryptsetup/cryptsetup.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/src/cryptsetup/cryptsetup.c b/src/cryptsetup/cryptsetup.c
+index 3b4c08616..08ed7e53b 100644
+--- a/src/cryptsetup/cryptsetup.c
++++ b/src/cryptsetup/cryptsetup.c
+@@ -56,7 +56,7 @@ static bool arg_tcrypt_veracrypt = false;
+ static char **arg_tcrypt_keyfiles = NULL;
+ static uint64_t arg_offset = 0;
+ static uint64_t arg_skip = 0;
+-static usec_t arg_timeout = 0;
++static usec_t arg_timeout = USEC_INFINITY;
+ 
+ /* Options Debian's crypttab knows we don't:
+ 
+@@ -670,10 +670,10 @@ int main(int argc, char *argv[]) {
+                 if (arg_discards)
+                         flags |= CRYPT_ACTIVATE_ALLOW_DISCARDS;
+ 
+-                if (arg_timeout > 0)
+-                        until = now(CLOCK_MONOTONIC) + arg_timeout;
+-                else
++                if (arg_timeout == USEC_INFINITY)
+                         until = 0;
++                else
++                        until = now(CLOCK_MONOTONIC) + arg_timeout;
+ 
+                 arg_key_size = (arg_key_size > 0 ? arg_key_size : (256 / 8));
+ 
+-- 
+2.14.0
+

diff --git a/sys-apps/systemd/files/234-0003-resolved-make-sure-idn2-conversions-are-roundtrippab.patch b/sys-apps/systemd/files/234-0003-resolved-make-sure-idn2-conversions-are-roundtrippab.patch
new file mode 100644
index 00000000000..e083f854107
--- /dev/null
+++ b/sys-apps/systemd/files/234-0003-resolved-make-sure-idn2-conversions-are-roundtrippab.patch
@@ -0,0 +1,92 @@
+From 47d36aeaebc3083795de40c80e75f0fda48c3053 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
+Date: Fri, 21 Jul 2017 07:51:07 -0400
+Subject: [PATCH 3/3] resolved: make sure idn2 conversions are roundtrippable
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+While working on the gateway→_gateway conversion, I noticed that
+libidn2 strips the leading underscore in some names.
+https://gitlab.com/libidn/libidn2/issues/30 was resolved in
+https://gitlab.com/libidn/libidn2/commit/05d753ea69e2308cd02436d0511f4b844071dc79,
+which disabled "STD3 ASCII rules" by default, i.e. disabled stripping
+of underscores. So the situation is that with previously released libidn2
+versions we would get incorrect behaviour, and once new libidn2 is released,
+we should be OK.
+
+Let's implement a simple test which checks that the name survives the
+roundtrip, and if it doesn't, skip IDN resolution. Under old libidn2 this will
+fail in more cases, and under new libidn2 in fewer, but should be the right
+thing to do also under new libidn2.
+---
+ src/shared/dns-domain.c    | 29 ++++++++++++++++++++++++++---
+ src/test/test-dns-domain.c |  6 ++++++
+ 2 files changed, 32 insertions(+), 3 deletions(-)
+
+diff --git a/src/shared/dns-domain.c b/src/shared/dns-domain.c
+index 12c4d65dd..139d286af 100644
+--- a/src/shared/dns-domain.c
++++ b/src/shared/dns-domain.c
+@@ -1274,15 +1274,38 @@ int dns_name_apply_idna(const char *name, char **ret) {
+ 
+ #if defined(HAVE_LIBIDN2)
+         int r;
++        _cleanup_free_ char *t = NULL;
+ 
+         assert(name);
+         assert(ret);
+ 
+-        r = idn2_lookup_u8((uint8_t*) name, (uint8_t**) ret,
++        r = idn2_lookup_u8((uint8_t*) name, (uint8_t**) &t,
+                            IDN2_NFC_INPUT | IDN2_NONTRANSITIONAL);
+-        if (r == IDN2_OK)
++        log_debug("idn2_lookup_u8: %s → %s", name, t);
++        if (r == IDN2_OK) {
++                if (!startswith(name, "xn--")) {
++                        _cleanup_free_ char *s = NULL;
++
++                        r = idn2_to_unicode_8z8z(t, &s, 0);
++                        if (r != IDN2_OK) {
++                                log_debug("idn2_to_unicode_8z8z(\"%s\") failed: %d/%s",
++                                          t, r, idn2_strerror(r));
++                                return 0;
++                        }
++
++                        if (!streq_ptr(name, s)) {
++                                log_debug("idn2 roundtrip failed: \"%s\" → \"%s\" → \"%s\", ignoring.",
++                                          name, t, s);
++                                return 0;
++                        }
++                }
++
++                *ret = t;
++                t = NULL;
+                 return 1; /* *ret has been written */
+-        log_debug("idn2_lookup_u8(\"%s\") failed: %s", name, idn2_strerror(r));
++        }
++
++        log_debug("idn2_lookup_u8(\"%s\") failed: %d/%s", name, r, idn2_strerror(r));
+         if (r == IDN2_2HYPHEN)
+                 /* The name has two hypens — forbidden by IDNA2008 in some cases */
+                 return 0;
+diff --git a/src/test/test-dns-domain.c b/src/test/test-dns-domain.c
+index 11cf0b1f0..cbd2d1e65 100644
+--- a/src/test/test-dns-domain.c
++++ b/src/test/test-dns-domain.c
+@@ -652,6 +652,12 @@ static void test_dns_name_apply_idna(void) {
+         test_dns_name_apply_idna_one("föö.bär.", ret, "xn--f-1gaa.xn--br-via");
+         test_dns_name_apply_idna_one("xn--f-1gaa.xn--br-via", ret, "xn--f-1gaa.xn--br-via");
+ 
++        test_dns_name_apply_idna_one("_443._tcp.fedoraproject.org", ret2,
++                                     "_443._tcp.fedoraproject.org");
++        test_dns_name_apply_idna_one("_443", ret2, "_443");
++        test_dns_name_apply_idna_one("gateway", ret, "gateway");
++        test_dns_name_apply_idna_one("_gateway", ret2, "_gateway");
++
+         test_dns_name_apply_idna_one("r3---sn-ab5l6ne7.googlevideo.com", ret2,
+                                      ret2 ? "r3---sn-ab5l6ne7.googlevideo.com" : "");
+ }
+-- 
+2.14.0
+

diff --git a/sys-apps/systemd/systemd-234-r2.ebuild b/sys-apps/systemd/systemd-234-r3.ebuild
similarity index 98%
rename from sys-apps/systemd/systemd-234-r2.ebuild
rename to sys-apps/systemd/systemd-234-r3.ebuild
index dceb9eda711..d5be135d849 100644
--- a/sys-apps/systemd/systemd-234-r2.ebuild
+++ b/sys-apps/systemd/systemd-234-r3.ebuild
@@ -149,6 +149,8 @@ src_unpack() {
 src_prepare() {
 	local PATCHES=(
 		"${FILESDIR}"/234-0001-path-lookup-look-for-generators-in-usr-lib-systemd-s.patch
+		"${FILESDIR}"/234-0002-cryptsetup-fix-infinite-timeout-6486.patch
+		"${FILESDIR}"/234-0003-resolved-make-sure-idn2-conversions-are-roundtrippab.patch
 	)
 
 	if ! use vanilla; then


             reply	other threads:[~2017-08-13 23:32 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-13 23:32 Mike Gilbert [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-09-26 19:15 [gentoo-commits] repo/gentoo:master commit in: sys-apps/systemd/files/, sys-apps/systemd/ Mike Gilbert
2024-04-29 17:27 Sam James
2023-12-28  3:53 Sam James
2023-07-06  8:15 Sam James
2023-05-05  4:13 Sam James
2023-04-29  3:50 Mike Gilbert
2023-01-30  2:14 Mike Gilbert
2023-01-13 20:06 Mike Gilbert
2023-01-13  5:33 Sam James
2023-01-11  7:50 Sam James
2022-10-15 18:57 Mike Gilbert
2022-10-14 21:18 Sam James
2022-09-18 15:52 Mike Gilbert
2022-08-02 23:40 Sam James
2022-05-24 22:35 Sam James
2022-05-23 18:35 Mike Gilbert
2022-05-21 22:22 Mike Gilbert
2022-05-07 18:32 Mike Gilbert
2022-04-30  0:30 Sam James
2022-04-28  1:26 Sam James
2022-01-15 15:41 Mike Gilbert
2022-01-13 16:29 Mike Gilbert
2021-10-26 15:00 Mike Gilbert
2021-07-20 19:19 Mike Gilbert
2021-07-11 14:41 Mike Gilbert
2021-06-20 17:33 Mike Gilbert
2021-04-27 18:16 Mike Gilbert
2021-03-17 14:19 Mike Gilbert
2020-11-03 15:48 Mike Gilbert
2020-10-14 19:15 Mike Gilbert
2020-09-24 14:51 Mike Gilbert
2020-08-22  1:56 Mike Gilbert
2020-07-06 14:05 Mike Gilbert
2020-06-11  2:29 Mike Gilbert
2020-03-09 21:22 Mike Gilbert
2020-01-26 17:19 Mike Gilbert
2020-01-07  7:19 Mike Gilbert
2019-09-03 15:27 Mike Gilbert
2019-07-31 14:06 Mike Gilbert
2019-06-17 16:19 Mike Gilbert
2019-05-23 12:26 Louis Sautier
2019-05-09 13:41 Mike Gilbert
2019-05-08 17:29 Mike Gilbert
2019-04-05 20:56 Mike Gilbert
2018-10-30 14:34 Mike Gilbert
2018-09-29 15:27 Mike Gilbert
2018-03-26 21:14 Pacho Ramos
2017-12-31  1:40 Mike Gilbert
2017-12-28 16:01 Mike Gilbert
2017-10-28 18:58 Mike Gilbert
2017-10-08 17:11 Mike Gilbert
2017-09-08 21:16 Mike Gilbert
2017-07-12 20:23 Mike Gilbert
2017-06-28 17:01 Mike Gilbert
2017-03-12 17:59 Mike Gilbert
2017-01-03 18:15 Mike Gilbert
2016-12-18 23:08 Mike Gilbert
2016-04-16 20:32 Mike Gilbert
2015-12-12 15:17 Mike Gilbert
2015-11-24 16:28 Mike Gilbert
2015-10-25  9:11 Michał Górny

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1502667160.4ad264dbae71c361b268ef521ace36d81b118dc8.floppym@gentoo \
    --to=floppym@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox