Bug 2150529
| Summary: | evince shows weird error, when trying to open a file with a colon in the name | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Albert Flügel <af> |
| Component: | evince | Assignee: | Marek Kašík <mkasik> |
| Status: | NEW --- | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | low | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 37 | CC: | feborges, gnome-sig, mclasen, mkasik, rstrode, sandmann |
| Target Milestone: | --- | Keywords: | Reopened |
| Target Release: | --- | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2023-05-25 18:00:25 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Attachments: | |||
|
Description
Albert Flügel
2022-12-03 18:34:55 UTC
It seems that the way to fix this should be to mention this behaviour in the man page (see https://gitlab.gnome.org/GNOME/glib/-/issues/1623). I'll wait for reaction on this proposal in https://gitlab.gnome.org/GNOME/glib/-/issues/549. I can hardly believe this. When a program does nonsense, it is written to the documentation: This program does nonsense, but you are warned and it is documented. Happy new year. Created attachment 1934705 [details]
Proposed patch for glib2, where actually the problem is
In gio/gfile.c , function new_for_cmdline_arg the given filename is checked for an absolute path, then a (weak) criterion is applied to check, if it is a URI. This criterion also may match normal filenames. Thus i added a check, if the given name is specifying an existing regular file and if this is the case, it is handled as that and the URI check is ignored, actually skipped.
Created attachment 1934706 [details]
Spec file to build glib2 with the attached patch as release -3
Actually there are more questionable implementation details: In shell/main.c of evince's own sources we find the function get_label_from_filename, called from load_files. It checks for the hash character in the given name, followed by a possible "label". This makes no sense for filenames, that might as well contain a hash (or "pound"). It might apply for real URIs, but first here also it should be checked, if the given argument refers to an existing regular file. All this URI handling (what - surprisingly for me - really works for http-like URLs - btw how does evince deal with invalid certificates etcetcetc) is in my opinion questionable. Why should a document viewer download files or in general deal with URIs at all ? When navigating in the WWW, the browser downloads the file and starts the helper application pointing it to the downloaded temporary file. And the browser also does the cleanup, more regarding this see below. Aside of this general consideration the URI handling in evince is erroneous in a wider degree. It is e.g. not possible to start evince with an argument like file://myfile.pdf (though internally a filename argument is converted to this form). When i do this, i get the same weird error message like shown above. Thus i do not consider the URI handling of evince mature in any aspect. Regarding the context of the weird error message: It indicates an indeed existing (empty) file in a temporary directory, that is not removed after terminating evince. Starting evince several times with invalid files leads to more and more trash in /tmp . So there is more room for bug fixing. So be warned: When i find the time, i'll suggest more patches. Created attachment 1934864 [details]
Proposed patch to properly cleanup /tmp after a failed "remote" load
ev_window_clear_local_uri should be called, not priv->local_uri handled "manually" in a different way
Created attachment 1934865 [details]
proposed patch to omit the check of a "label" on a bare file name
Created attachment 1934866 [details]
Spec file to build evince with the 2 proposed patches for evince as release -2
This message is a reminder that Fedora Linux 36 is nearing its end of life. Fedora will stop maintaining and issuing updates for Fedora Linux 36 on 2023-05-16. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a 'version' of '36'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, change the 'version' to a later Fedora Linux version. Note that the version field may be hidden. Click the "Show advanced fields" button if you do not see it. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora Linux 36 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora Linux, you are encouraged to change the 'version' to a later version prior to this bug being closed. Fedora Linux 36 entered end-of-life (EOL) status on 2023-05-16. Fedora Linux 36 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora Linux please feel free to reopen this bug against that version. Note that the version field may be hidden. Click the "Show advanced fields" button if you do not see the version field. If you are unable to reopen this bug, please file a new report against an active release. Thank you for reporting this bug and we are sorry it could not be fixed. issue is still happily alive on Fedora 37. |