PDF files with wrong extension fail to load

Bug #444907 reported by Christian Dannie Storgaard
42
This bug affects 8 people
Affects Status Importance Assigned to Milestone
evince (Ubuntu)
Confirmed
Low
Unassigned

Bug Description

Binary package hint: evince

Opening a file with the extension .ashx will cause Evince to refuse to load the document and instead show the following error message:

Unable to open document
Error opening file: Permission denied

Renaming the filename to end in .pdf instead will cause it to open without any problems.

Evince package version tested: 2.28.0-0ubuntu1

ProblemType: Bug
Architecture: i386
Date: Tue Oct 6 22:58:43 2009
DistroRelease: Ubuntu 9.10
ExecutablePath: /usr/bin/evince
NonfreeKernelModules: nvidia
Package: evince 2.28.0-0ubuntu1
ProcEnviron:
 PATH=(custom, user)
 LANG=en_DK.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.31-11.38-generic
SourcePackage: evince
Uname: Linux 2.6.31-11-generic i686

Revision history for this message
Christian Dannie Storgaard (cybolic) wrote :
Revision history for this message
Pedro Villavicencio (pedro) wrote :

Not here, if i rename a pdf to .ashx evince open it anyways, could you add the document to the report? thanks.

Changed in evince (Ubuntu):
importance: Undecided → Low
status: New → Incomplete
Revision history for this message
Christian Dannie Storgaard (cybolic) wrote :

Sure, I have two documents it happens with, I'll attach one of them.

Revision history for this message
Christian Dannie Storgaard (cybolic) wrote :

I just found out that an ashx file is an "ASP.NET Web Handler File", so the extension is an error from the website I downloaded it from, not an actual document format. Still, Evince should be able to open it regardless of filename extension.

Revision history for this message
Pedro Villavicencio (pedro) wrote :

it does handle it fine here, i can open the file without renaming it to pdf. not confirming.

Revision history for this message
Christian Dannie Storgaard (cybolic) wrote :

Are you using the same version of Evince (2.28.0)?

Revision history for this message
Pedro Villavicencio (pedro) wrote :

now that i'm think of, it looks like a duplicate of bug 444962. marking it as such. And yes i'm using 2.28.0.

Revision history for this message
Christian Dannie Storgaard (cybolic) wrote :

I'm not sure it's a duplicate of #444962 - Nautilus doesn't render all files as text files (or any non-text files as text files for that matter) and neither removing ~/.local/share/mime, running "update-mime-database.real -V ~/.local/share/mime/", running "sudo update-mime-database /usr/share/mime; sudo update-desktop-database" or running Evince from a terminal (in all cases) fixes the problem.

Revision history for this message
John McCabe-Dansted (gmatht) wrote :

This does not appear to be a duplicate.

I also get this for files without a extension. However I can only reproduce this for some filenames. So if I rename any PDF file to
   httpprojecteuclidorgDPubSRepository10Disseminateviewbodyidp...lidndjfl1038949542
I get the "Error opening file: Permission denied" message, but I do not get this message if I rename the file to e.g.
   TViX_WiFi_English

Revision history for this message
John McCabe-Dansted (gmatht) wrote :

I can't open any pdf if I rename it
  httpprojecteuclidorgDPubSRepository10Disseminateviewbodyidp...lidndjfl103894954_.ashx
but I can if I rename it
  httpprojecteuclidorgDPubSRepository10Disseminateviewbodyidp...lidndjfl103894954_.pdf
Marking this bug as confirmed

Changed in evince (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
John McCabe-Dansted (gmatht) wrote :

FYI, I am using evince 2.28.1 on Ubuntu 9.10.

Revision history for this message
Christian Dannie Storgaard (cybolic) wrote :

This bug still occurs in Evince 2.32.0, also the problem does not seem to be in libpoppler (using http://code.activestate.com/recipes/577195-wxpython-pdf-viewer-using-poppler/ as a test).

Revision history for this message
Christian Dannie Storgaard (cybolic) wrote :

Updated the title as it seems that no matter what I rename the extension of a PDF file as (as long as it's not ".pdf"), Evince will refuse to load it.

summary: - Files with extension .ashx fail to load
+ PDF files with wrong extension fail to load
Revision history for this message
Ethan Baldridge (ethan-superiordocumentservices) wrote :

This also occurs with TIFF files or presumably any other file format. Evince seems to be processing files based on file extension rather than magic. I was just very confused by processing files with "gm convert +adjoin $i.pdf $i.tiff" (from within a for loop) and being unable to open the resulting single-page tiffs.

After a few seconds I said "oh no, you've got to be kidding me - I hope it's not doing a Windows thing" and ran:
export a=0; for i in `ls *.tiff.* | sort -n -t'.' -k 3`; do export a=$((a+1)); mv $i ${i/.tiff.*/.$a.tiff}; done
to rename the files from (ex.) foo.tiff.1 to foo.1.tiff

I'm on Natty-beta with evince-2.32.0-0ubuntu12

Revision history for this message
ariel cornejo (arielco) wrote :

Still present in 3.6.1-1ubuntu3

Revision history for this message
Martin Thornton (thornton-ma) wrote :

Seems to be an intentional security feature. File extensions are restricted by the files /etc/apparmor.d/usr.bin.evince and /etc/apparmor.d/abstractions/evince.

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.