Closed Bug 1673229 Opened 4 years ago Closed 4 years ago

When network.ftp.enabled is disabled, FF still tries to open FTP links resulting in indefinite number of tabs

Categories

(Core Graveyard :: Networking: FTP, defect)

Desktop
Linux
defect

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1667468

People

(Reporter: noblechuk5, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.83 Safari/537.36/8mqQhSuL-09

Steps to reproduce:

FF Nightly: 84.0a1 (2020-10-22) (64-bit)
OS: Linux ArcoB 5.8.14-arch1-1 #1 SMP PREEMPT Wed, 07 Oct 2020 23:59:46 +0000 x86_64 GNU/Linux

Open about:config and set network.ftp.enabled to false
In preferences, set FF as default program for FTP links
Restart browser
Try opening an FTP link. For example: ftp://ftp.gnu.org/old-gnu/Manuals/glibc-2.2.3/html_chapter/libc_24.html

Actual results:

Firefox starts opening tabs at a rate of 10 tabs per second: Very quick!
Even after closing the browser, it still respawns and keeps opening tabs until I guess a timeout or something makes it stop. All the tabs opened are empty, but it just keeps opening the tabs.

Expected results:

It should either say that FTP is not supported, or disable the option to use FF as the default program for FTP.
Given the fact that we set network.ftp.enabled to false, nothing should have even happened to begin with.

The behavior is similar to what is reported by https://bugzilla.mozilla.org/show_bug.cgi?id=1667468


So (un)suprisingly, after setting network.ftp.enabled to true, and restarting FF, clicking an FTP link actually opens the link inside FF.
What a mess!

Component: Untriaged → File Handling
OS: Unspecified → Linux
Hardware: Unspecified → Desktop
Component: File Handling → Untriaged
Summary: When network.ftp.enabled is disabled, FF still tries to open FTP links resulting in infinite loop → When network.ftp.enabled is disabled, FF still tries to open FTP links resulting in indefinite number of tabs

I guess Firefox registers itself as the default ftp:// protocol handler somehow. So Firefox tries to open the ftp:// link with an external app, which ends up with launching itself.

If Firefox receives another unknown protocol, it will search the URL with the default search engine instead. I think ftp:// should behave similarly when network.ftp.enabled is false.

Maybe here: https://searchfox.org/mozilla-central/rev/a147181ece866c1ecd176ac49f112785f960aac0/docshell/base/URIFixup.jsm#323-336

Since COMMON_PROTOCOLS contains ftp, Firefox will always consider it can handle ftp even if actually it cannot.

We should remove "ftp" from COMMON_PROTOCOLS if network.ftp.enabled is false.

EDIT: it did not work because externalProtocolService.externalProtocolHandlerExists("ftp") will return true.

Status: UNCONFIRMED → NEW
Component: Untriaged → DOM: Navigation
Ever confirmed: true
Product: Firefox → Core
Version: other → unspecified

If the URI comes from command line, we should not try to launch an external app to prevent infinite loop.

Status: NEW → RESOLVED
Closed: 4 years ago
Component: DOM: Navigation → Networking: FTP
Resolution: --- → DUPLICATE
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.