Skip to content

Commit

Permalink
Remove samples/ directory from source distribution to prevent downloa…
Browse files Browse the repository at this point in the history
…ding all pdf's when installing pdfminer.six (#364)

Fixes #363 

* Remove samples/ and docs/ from source distribution. The samples/ dictionairy contains pdf's for testing purposes and the docs/ contain readthedocs documentation and is published online.

* Remove issue-00152-embedded-pdf.pdf because it contains a possible exploit.

See https://www.microsoft.com/en-us/wdsi/threats/malware-encyclopedia-description?Name=Exploit%3AJS%2FShellCode.gen
And pdfminer/pdfminer.six#363

* Added line to CHANGELOG.md

* Remove unused imports
  • Loading branch information
pietermarsman authored Jan 24, 2020
1 parent bc494ff commit 1c3047b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 17 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [Unreleased]

Nothing
### Security
- Removed samples/issue-00152-embedded-pdf.pdf because it contains a possible security thread; a javascript enabled object ([#364](https://github.com/pdfminer/pdfminer.six/pull/364))

## [20200121] - 2020-01-21

Expand Down
4 changes: 2 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ include *.txt
include *.md
include *.py
graft cmaprsrc
graft docs
graft pdfminer
graft samples
graft tools
global-exclude *.pyc
prune samples
prune docs
Binary file removed samples/contrib/issue-00152-embedded-pdf.pdf
Binary file not shown.
15 changes: 1 addition & 14 deletions tests/test_tools_dumppdf.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from shutil import rmtree
from tempfile import NamedTemporaryFile, mkdtemp
from tempfile import NamedTemporaryFile

from helpers import absolute_sample_path
from tools import dumppdf
Expand Down Expand Up @@ -37,15 +36,3 @@ def test_5(self):

def test_6(self):
run('nonfree/naacl06-shinyama.pdf', '-t -a')

def test_embedded_font_filename(self):
"""If UF font file name does not exist, then F should be used
Related issue: https://github.com/pdfminer/pdfminer.six/issues/152
"""
output_dir = mkdtemp()
try:
run('contrib/issue-00152-embedded-pdf.pdf',
'--extract-embedded %s' % output_dir)
finally:
rmtree(output_dir)

0 comments on commit 1c3047b

Please sign in to comment.