Closed Bug 1634053 Opened 5 years ago Closed 5 years ago

On Linux, DNS resolution (DNS.jsm) of addons and OpenPGP code fails, because the code looks for libresolv.so which isn't present in most user installs

Categories

(Thunderbird :: Add-Ons: Extensions API, defect, P1)

Tracking

(thunderbird_esr78+ fixed, thunderbird84 affected)

RESOLVED FIXED
85 Branch
Tracking Status
thunderbird_esr78 + fixed
thunderbird84 --- affected

People

(Reporter: strassenbahn, Assigned: KaiE)

Details

Attachments

(3 files)

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:75.0) Gecko/20100101 Firefox/75.0

Steps to reproduce:

If shared library libresolv.so (symlink) does not exist add-on name resolution via DNS.jsm does not work.

Actual results:

Using the latest Ubuntu 20.04 Version I installed thunderbird and the two addons TBSync and "Provider for CalDav and CardDav). On some installations The Addons refused to connect to a Nextcloud server.
After some investigation it was found that DNS resolving did not work (Error thrown by DNS.jsm). - On some installations it did work.
The issue is that the library-symlink libresolv.so not not part of the libc6 package that is usually installed but is part of the libc6-dev package which - by default is not installed. It could also be considered as an Ubuntu-bug, however Thunderbird itself seem to use a different name resolution - so basically adding imap/smtp servers did work so obviously a different name resolution technique is used. This should be harmonized.

Expected results:

The name resolution technique should be the same as of the main Thunderbird - which worked fine without libresolv.so

Because this bug's Severity has not been changed from the default since it was filed, and it's Priority is -- (non,) indicating it has has not been previously triaged, the bug's Severity is being updated to -- (default, untriaged.)

Severity: normal → --

In case you are a developer:
Can you check if this issue remains using the DNS API? That API is not using the same DNS.jsm but nsIDNSService

DNS API: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/dns
Works in TB as well.

Regarding the lib issue, I tried contacting the package maintainers, so they can set it as a dependency. I do not think we can do anything about that.

Status: UNCONFIRMED → RESOLVED
Closed: 5 years ago
Resolution: --- → INVALID

John, it seems this is a complaint about a part of Thunderbird that doesn't use the official DNS APIs, but rather tries to open an external shared library directly, using ctypes - legacy code we inherited when integrating OpenPGP

Status: RESOLVED → REOPENED
Ever confirmed: true
Resolution: INVALID → ---

Wait, I might have misunderstood, too.
That DNS.jsm isn't part of OpenPGP, it's in mail/base.

We're talking about comm/mail/base/modules/DNS.jsm right?

This file has references to shared libraries, using a list of potential filenames that's apparently incomplete.

If systems may legitimately use filenames that we don't attempt to open, then it's a bug on our side.

The core issue here is that DNS.js searches for "libresolv.so" filename which is a development symlink used only at build-time so it's not guaranteed to exist on end user system. The proper filename to search is "libresolv.so.2" which is a symlink used at runtime and what all glibc based distros must have available.

Se downstream issues reported about to DNS.jsm this behavior and thta affects opengpg:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=973697
https://github.com/flathub/org.mozilla.Thunderbird/issues/157

Ultimately you may keep searching for libresolv.so but add libresolv.so.2 to the search list. Perhaps that would be the safest change.

https://hg.mozilla.org/releases/comm-esr78/file/7bfb6e5797a4120c798eaa67a9cddd2846badcee/mail/base/modules/DNS.jsm#l41

I confirm that on my Linux system, libresolv.so is contained in a development package, which isn't installed for most users.

libresolve.so.2 is the standard filename.

Summary: DNS resolution (DNS.jsm) of addons fail if libresolv.so is not installed → On Linux, DNS resolution (DNS.jsm) of addons and OpenPGP code fails, because the code looks for libresolv.so which isn't present in most user installs
Assignee: nobody → kaie
Severity: -- → S2
Priority: -- → P1
Target Milestone: --- → 85 Branch

Pushed by kaie@kuix.de:
https://hg.mozilla.org/comm-central/rev/b7f6c01ac69d
Fix DNS.jsm lookups on Linux systems that don't have development libraries installed. r=mkmelin DONTBUILD

Status: REOPENED → RESOLVED
Closed: 5 years ago5 years ago
Resolution: --- → FIXED

That was too quick. I had not tested the patch, and Emerson correctly pointed out - it doesn't work.

The first patch would attempt to load resolv.2.so but we must look for resolv.so.2 - we need code similar as in OTRLib.jsm

Status: RESOLVED → REOPENED
Resolution: FIXED → ---

Pushed by kaie@kuix.de:
https://hg.mozilla.org/comm-central/rev/42ed0ced938b
Fix DNS.jsm to correctly combine candidate libname and version suffix. r=rjl DONTBUILD

Status: REOPENED → RESOLVED
Closed: 5 years ago5 years ago
Resolution: --- → FIXED
Attached patch combined.patchSplinter Review

This is a combined patch for uplifting.

Attachment #9191200 - Flags: review+

Someone should test tomorrow's nightly build on macOS, and verify that DNS.jsm code still works, for example by using openpgp key manager, keyserver, lookup by an email address, and ensure there's no exception related to DNS.jsm on the error console.

I have applied this patch to a local macOS comm-esr78 build, and WKD/keyserver downloading still works (which depends on this DNS code).

Comment on attachment 9191200 [details] [diff] [review]
combined.patch

[Approval Request Comment]
Regression caused by (bug #): no
User impact if declined: failing DNS lookup in Add-ons and in OpenPGP keyserver searching
Testing completed (on c-c, etc.):
Risk to taking this patch (and alternatives if risky): low

Attachment #9191200 - Flags: approval-comm-esr78?
Attachment #9191200 - Flags: approval-comm-beta?

Comment on attachment 9191200 [details] [diff] [review]
combined.patch

[Triage Comment]
This didn't/won't make a beta uplift. But seems extremely low risk so ...

Approved for esr78

Attachment #9191200 - Flags: approval-comm-esr78?
Attachment #9191200 - Flags: approval-comm-esr78+
Attachment #9191200 - Flags: approval-comm-beta?
Attachment #9191200 - Flags: approval-comm-beta-
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: