| |
@@ -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) ||
|
| |
This is a fix for https://bugzilla.redhat.com/show_bug.cgi?id=1912131 - the Epiphany Flatpak fails to resolve any URLs because the 'resolve' nss plugin is used, it fails to connect to resolved, and fails all lookups with "not found" because of the particular way it fails to connect to resolved.
A Flatpak can have three different views of the system bus:
- No system bus
- A filtered view
- Complete system bus access
The problem only occurs in the second case - there seems to be some incompatibility between sd-bus and the filtered proxy that Flatpak exports so connection to the bus starts, but then the connection drops before the first call is made. I haven't investigated what the problem is in more detail.
(Since resolved is not in the filtered view, all that would happen if things worked better would be a clean org.freedesktop.DBus.Error.ServiceUnknown error.)
We can work around this by sed'ing /etc/nssswitch.conf when creating the Flatpak container to remove references to resolv, so we don't strongly need this fix, but since I spent quite a bit of time debugging this with @catanzaro and testing a fix, I figured I'd submit a PR anyways :-) There seems to be no upstream relevance since the 246 branch of systemd that f33 uses is EOL, and newer branches use varlink instead.