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.
This commit is contained in:
Owen W. Taylor 2021-01-04 15:50:45 -05:00
parent b24ba6cad7
commit 779685bf4b
2 changed files with 19 additions and 1 deletions

View File

@ -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) ||

View File

@ -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 <otaylor@redhat.com> - 246.9-3
- Fix nss-resolve to properly fallback in a Flatpak sandbox
* Sat Jan 2 2021 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 246.9-2
- Fix bfq patch again (#1813219)