GNOME Bugzilla – Bug 781800
Strip off hostname from file URIs?
Last modified: 2019-02-07 11:06:33 UTC
As mentioned in the hyperlink bug 779734 comment 120, explicit hyperlinks with "file://" URIs should fill out the hostname (otherwise bad behavior is bound to happen over ssh). Ctrl+clicking on such an .odt file pops up LibreOffice's splash screen, and then it vanishes and nothing happens. Turns out, LibreOffice supports cmdline arguments "file:///path/to/file.odt" or "file://localhost/path/to/file.odt", but not "file://the-actual-hostname/path/to/file.odt". It doesn't even care about presenting a useful error dialog. Is this a bug in LibreOffice? Or in the piece of the GNOME infrastructure that constructs the command line from the URI? I'm wondering how many other apps suffer from this kind of problem. It's even more compilicated due to the slight disagreement between the RFC and the Freedesktop spec wrt. FQDN or gethostname(), see the aforementioned comment. Maybe LibreOffice just tries to figure out the FQDN and fails on my machine? (I don't have a domainname set, that is, `hostname` and `hostname --fqdn` report the same dot-free string for me.) Given that gnome-terminal verifies that the hostname is the local host and refuses to open otherwise, I'm wondering: Should it work around these problems by removing the hostname before opening the file: URI?
LibreOffice bug: https://bugs.documentfoundation.org/show_bug.cgi?id=107461
(In reply to Egmont Koblinger from comment #0) > Given that gnome-terminal verifies that the hostname is the local host and > refuses to open otherwise, I'm wondering: Should it work around these > problems by removing the hostname before opening the file: URI? It would make this work, and I don't see a downside, so my answer would be: yes.
Created attachment 350776 [details] [review] Fix v1 Something like this... will tidy up a bit before committing, not really in the mood for writing nice code today :)
Created attachment 358091 [details] [review] Fix v2 Finally the cleanup I've been planning to do for so long.
Submitted.
LibreOffice just fixed this for Unix systems. However, comments 4, 5 & 7 over there make some apparently good points about the "file" scheme being ambiguous wrt. SMB shares. And maybe we'll have a Windows port one day. So I'm wondering, maybe we should just leave our workaround in place??
Yes let's keep that for now.