From 779685bf4b1cdb74f6f20a6153299178a565e506 Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Mon, 4 Jan 2021 15:50:45 -0500 Subject: [PATCH] Fix nss-resolve to properly fallback in a Flatpak sandbox For unknown reasons, sd-bus has trouble connecting to the filtered D-Bus system proxy exported by Flatpak and the connection to the bus is closed during authentication. Don't mistake this for a remote error - that was causing a hard failure rather than a fallback. --- systemd-246-nss-resolve-fallback.patch | 13 +++++++++++++ systemd.spec | 7 ++++++- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 systemd-246-nss-resolve-fallback.patch diff --git a/systemd-246-nss-resolve-fallback.patch b/systemd-246-nss-resolve-fallback.patch new file mode 100644 index 0000000..636696a --- /dev/null +++ b/systemd-246-nss-resolve-fallback.patch @@ -0,0 +1,13 @@ +diff -up systemd-stable-246.9/src/nss-resolve/nss-resolve.c.fallback systemd-stable-246.9/src/nss-resolve/nss-resolve.c +--- systemd-stable-246.9/src/nss-resolve/nss-resolve.c.fallback 2021-01-04 15:48:33.668757361 -0500 ++++ systemd-stable-246.9/src/nss-resolve/nss-resolve.c 2021-01-04 15:49:00.111891935 -0500 +@@ -23,7 +23,8 @@ NSS_GETHOSTBYNAME_PROTOTYPES(resolve); + NSS_GETHOSTBYADDR_PROTOTYPES(resolve); + + static bool bus_error_shall_fallback(sd_bus_error *e) { +- return sd_bus_error_has_name(e, SD_BUS_ERROR_SERVICE_UNKNOWN) || ++ return sd_bus_error_get_errno(e) == ENOTCONN || ++ sd_bus_error_has_name(e, SD_BUS_ERROR_SERVICE_UNKNOWN) || + sd_bus_error_has_name(e, SD_BUS_ERROR_NAME_HAS_NO_OWNER) || + sd_bus_error_has_name(e, SD_BUS_ERROR_NO_REPLY) || + sd_bus_error_has_name(e, SD_BUS_ERROR_ACCESS_DENIED) || diff --git a/systemd.spec b/systemd.spec index 62b5aab..61c3d08 100644 --- a/systemd.spec +++ b/systemd.spec @@ -21,7 +21,7 @@ Name: systemd Url: https://www.freedesktop.org/wiki/Software/systemd Version: 246.9 -Release: 2%{?dist} +Release: 3%{?dist} # For a breakdown of the licensing, see README License: LGPLv2+ and MIT and GPLv2+ Summary: System and Service Manager @@ -81,6 +81,8 @@ Patch0007: 0001-Do-not-assert-in-test_add_acls_for_user.patch Patch0009: https://github.com/systemd/systemd/pull/17050/commits/f58b96d3e8d1cb0dd3666bc74fa673918b586612.patch +Patch0010: systemd-246-nss-resolve-fallback.patch + %ifarch %{ix86} x86_64 aarch64 %global have_gnu_efi 1 %endif @@ -880,6 +882,9 @@ getent passwd systemd-network &>/dev/null || useradd -r -u 192 -l -g systemd-net %files standalone-sysusers -f .file-list-standalone-sysusers %changelog +* Mon Jan 4 2021 Owen Taylor - 246.9-3 +- Fix nss-resolve to properly fallback in a Flatpak sandbox + * Sat Jan 2 2021 Zbigniew Jędrzejewski-Szmek - 246.9-2 - Fix bfq patch again (#1813219)