Evince puts up spurious error window when .pdf extension is missing

Bug #1403717 reported by Scott Cowles Jacobs
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
evince (Ubuntu)
Confirmed
Low
Unassigned

Bug Description

I first noticed this when trying to display a .pdf file that was downloaded from the New York State of Health website.
Their notices have filenames like "Template030", and have no extension.

When i couldn't use Evince, I used LibreOffice Writer to display them successfully (actually, what came up was LibreOffice Draw, for some reason).

I since took a look at the error window message, and saw that it said "Error opening file: Permission denied"

I used Sakura terminal, and the Nemo Properties context menu option to compare the permissions between one of these files, and a file that Evince had no trouble displaying, and found NO DIFFERENCE.

I took another look at the files, and suddenly noted that the file I was trying to display had no extension.
Surely, it could not be that simple...
Renamed the file with the same name + ".pdf"
Displayed fine.
Renamed a file that HAD displayed fine to remove ".pdf"
Error window.

Perhaps some part of the standard for .pdf files is that they MUST have ".pdf" extensions. I do not know.

Either way, putting up an error window that says "Permission denied" is unhelpful.
Perhaps a WARNING window with: "Required file extension .pdf missing."

Can it be that the extension is the only way Evince can tell that it is a .pdf file? I don't think so...
LibreOffice had no problem with it.
I had no problem also with GIMP.
Chromium displayed it correctly when I brought it up with file://[filename]

---------------------------------------------
scott@scott-ASUS-M2N68-AM-PLUS:~$ uname -a
Linux scott-ASUS-M2N68-AM-PLUS 3.16.0-28-generic #37-Ubuntu SMP Mon Dec 8 17:22:00 UTC 2014 i686 athlon i686 GNU/Linux
scott@scott-ASUS-M2N68-AM-PLUS:~$ lsb_release -dsc
Ubuntu 14.10
utopic
scott@scott-ASUS-M2N68-AM-PLUS:~$ echo $DESKTOP_SESSION
Lubuntu

scott@scott-ASUS-M2N68-AM-PLUS:~$ evince --version
GNOME Document Viewer 3.14.1

-Scott Jacobs

ProblemType: Bug
DistroRelease: Ubuntu 14.10
Package: evince 3.14.1-0ubuntu1
ProcVersionSignature: Ubuntu 3.16.0-28.37-generic 3.16.7-ckt1
Uname: Linux 3.16.0-28-generic i686
NonfreeKernelModules: nvidia
ApportVersion: 2.14.7-0ubuntu8
Architecture: i386
CurrentDesktop: LXDE
Date: Wed Dec 17 22:47:58 2014
InstallationDate: Installed on 2014-11-01 (46 days ago)
InstallationMedia: Lubuntu 14.10 "Utopic Unicorn" - Release i386 (20141022.1)
SourcePackage: evince
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Scott Cowles Jacobs (scott092707) wrote :
Revision history for this message
Seth Arnold (seth-arnold) wrote :

Evince is providing the best error message it can with the information available to it. The AppArmor mandatory access control system has rejected this because the filename doesn't match something expected for evince to open.

You can modify the file /etc/apparmor.d/local/usr.bin.evince to include whatever files you want to allow. I suggest something like:

owner @{HOME}/Downloads/** r,

assuming, of course, that your browser has downloaded the file to your Downloads/ directory.

Once you have modified the file to include permissions you want to allow, you can run:

sudo apparmor_parser --replace /etc/apparmor.d/usr.bin.evince

Thanks

Changed in evince (Ubuntu):
status: New → Confirmed
Revision history for this message
Scott Cowles Jacobs (scott092707) wrote :

How, exactly, are we to attract new users to Linux, if Evince/Apparmor puts up an incomprehensible error message for a simple lack of file extension (in this case), or bombs completely if a user has a non-standard partition scheme (most data files in a partition outside "/" (a previous Evince/Apparmor bug/feature that I encountered).

A new user is just going to try to bring up a .pdf file that his health insurance marketplace sent him, and Evince is going to fail to do so.

He is not going to know anything about AppArmor, or that that is why his (perfectly good) file won't display.

Assuming that AppArmor is actually a good thing to have (what it does has escaped me so far), then it needs to have more flexible defaults, especially where potential new users are concerned.
If it is somehow VITAL that a document program have a ".pdf" extension,
then we should have GIMP and LibreOffice and Chromium (etc.) also fail with the same incomprehensible error message when confronted with a .pdf file without ".pdf".

Apparently, Evince/AppArmor is more concerned with what the file name is, than whether the file is a proper .pdf file, which the other programs have no trouble decoding.

You seem to feel that this is not a bug.

It is, at the very least, an over-sensitivity to an omission that for many (most?) programs, is no problem at all.

-Scott

Changed in evince (Ubuntu):
importance: Undecided → Low
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.